:root {
  --bg: #f5efe7;
  --ink: #1f2a37;
  --muted: #5f6b7a;
  --card: #fffdf8;
  --line: #dccfb5;
  --brand: #b95a2e;
  --brand-dark: #8e3e1b;
  --pill: #f4e1c6;
  --good: #33673b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: radial-gradient(circle at 15% 20%, #fff8ee 0%, #f5efe7 40%, #efe5d7 100%);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(44px);
  opacity: 0.35;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: #ffc36e;
  left: -40px;
  top: 60px;
}

.shape-2 {
  width: 340px;
  height: 340px;
  background: #ff9770;
  right: -80px;
  top: 220px;
}

.topbar {
  padding: 24px 20px 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

@media (min-width: 701px) {
  .topbar-nav {
    display: flex;
    flex-direction: row;
    margin-top: 0;
  }

  .hamburger {
    display: none;
  }
}

.topbar-nav {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.topbar-nav.is-open {
  display: flex;
}

.topbar-nav a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 180ms ease, color 180ms ease;
}

.topbar-nav a:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.nav-user {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 253, 248, 0.72);
}

.login-card {
  max-width: 440px;
  margin-inline: auto;
}

.locked-finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.locked-finance-card {
  position: relative;
  display: flex;
  min-height: 132px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff8ed;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.locked-finance-card:hover,
.locked-finance-card:focus {
  border-color: var(--brand);
  background: #fff1df;
  outline: none;
  transform: translateY(-1px);
}

.locked-finance-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.locked-finance-card strong {
  font-size: 20px;
}

.locked-finance-card small {
  color: var(--muted);
  line-height: 1.4;
}

.locked-finance-card::after {
  content: attr(data-login-prompt);
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(100% + 8px);
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  z-index: 12;
}

.locked-finance-card:hover::after,
.locked-finance-card:focus::after {
  opacity: 1;
}

/* ── Nav settings (Valuo tokens) ────────────────── */

.nav-settings {
  padding: 4px 16px;
}

.nav-settings summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-settings summary::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--card);
  flex: 0 0 auto;
}

.nav-settings summary::-webkit-details-marker { display: none; }

.nav-settings-fallback {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.nav-settings-fallback summary {
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.7;
}

.nav-settings-fallback summary:hover { opacity: 1; }

.nav-fx .small-text {
  margin: 0;
  line-height: 1.35;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.settings-form label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  gap: 3px;
}

.settings-form input {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: monospace;
}

.settings-form textarea {
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: monospace;
  resize: vertical;
  min-height: 56px;
  width: 100%;
  box-sizing: border-box;
}

.settings-form input:focus,
.settings-form textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* ── Hamburger button ───────────────────────────── */

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hamburger:hover {
  background: none;
  transform: none;
}

/* ── Detail page back arrow ─────────────────────── */

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.detail-header-text {
  flex: 1;
  min-width: 0;
}

.detail-header-text h1 {
  margin: 0;
}

.detail-header-text p {
  margin: 2px 0 0;
}

.hero-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.detail-refresh {
  flex-shrink: 0;
  margin-left: auto;
}

.ai-summary {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.back-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: var(--pill);
  color: var(--brand);
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
  transition: background 180ms ease;
  margin-right: 4px;
}

.back-arrow:hover {
  background: var(--brand);
  color: #fff;
}

/* ── Clickable listing rows ─────────────────────── */

.listing-row {
  transition: background 120ms ease;
}

.listing-row:hover {
  background: #fdf5e6;
}

.listing-row.is-seen {
  background: #fbf7ef;
}

.brand {
  text-decoration: none;
  color: var(--brand-dark);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px 30px;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(86, 55, 22, 0.08);
  animation: rise 220ms ease;
  overflow: hidden;
}

.url-truncate {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes rise {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

h1,
h2,
h3 {
  margin: 0 0 10px;
}

label {
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

button,
.link-btn {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

button:hover,
.link-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.title-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  transition: color 180ms ease, text-decoration 180ms ease;
}

.title-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.stack {
  display: grid;
  gap: 10px;
}

.inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline > * {
  flex: 1;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

td.wrap-cell {
  white-space: normal;
}

.sort-header {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 180ms ease;
}

.sort-header:hover {
  color: var(--brand-dark);
}

.sort-header.is-sorted {
  color: var(--brand-dark);
}

.sort-arrow {
  font-size: 11px;
  display: inline-block;
}

.pill {
  background: var(--pill);
  color: #6d440f;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.commute-links {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.commute-links p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-start;
}

.view-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  background: #fff6ea;
  line-height: 1;
}

.view-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.filter-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  justify-content: flex-end;
  flex: 1 1 540px;
  flex-wrap: wrap;
}

.filter-form label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checkbox-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  cursor: pointer;
}

.checkbox-filter input {
  min-width: auto;
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.checkbox-filter span {
  color: var(--ink);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group-compact select {
  min-width: 84px;
}

.filter-form select,
.filter-form input {
  min-width: 140px;
  width: auto;
  min-height: 40px;
}

.filter-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

.filter-form input:focus,
.filter-form select:focus {
  outline: 2px solid rgba(185, 90, 46, 0.28);
  outline-offset: 2px;
}

.filter-break {
  flex-basis: 100%;
  height: 0;
}

.range-group {
  flex: 0 1 184px;
}

.range-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.range-inputs input {
  min-width: 0;
  width: 100%;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.results-strip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0;
}

.size-cell {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tiny-thumb {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
  display: block;
}

.tiny-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: #fff8ed;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  min-width: 112px;
}

.text-action {
  border: 1px solid var(--line);
  background: #fff6ea;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 36px;
  padding: 8px 10px;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.text-action:hover,
.text-action.is-active,
.highlight-action.is-active {
  background: #fff1bd;
  border-color: #d5a400;
  color: #5f4500;
}

.icon-btn {
  background: #fff6ea;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 12px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 6px;
  transition: background-color 150ms ease, color 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.not-interested-icon {
  min-width: 34px;
  min-height: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.not-interested-icon:hover {
  background-color: #f5e6e6;
  color: #a83226;
  border-color: #e6b8b3;
}

.icon-btn:hover {
  background-color: #f0e6d8;
  color: var(--brand);
}

.delete-icon:hover {
  background-color: #f5e6e6;
  color: #c0392b;
}

.pill-public {
  background: #e0f2fe;
  color: #075985;
}

.pill-highlight {
  background: #fef3c7;
  color: #92400e;
}

.pill-seen {
  background: #e5e7eb;
  color: #374151;
}

.address-link {
  color: var(--brand);
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms ease;
}

.address-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.distance-cell {
  font-family: "SF Mono", Monaco, monospace;
  font-weight: 700;
  color: var(--brand);
  font-size: 14px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-link,
.page-ellipsis {
  min-width: 40px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff6ea;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.page-link:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #fff1dc;
}

.page-link.is-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.page-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-ellipsis {
  min-width: 24px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}



.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.facts-grid div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.facts-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.facts-grid strong {
  font-size: 16px;
}

.actions-row {
  display: grid;
  gap: 10px;
  margin: 10px 0 16px;
}

/* ── Detail actions bar ─────────────────────────── */

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
}

.status-form select {
  width: auto;
  min-width: 120px;
}

.status-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.icon-action {
  background: none;
  border: 1px solid var(--line);
  color: var(--brand);
  font-size: 20px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, color 150ms ease;
}

.icon-action:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: none;
}

.detail-url {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

/* ── Collapsible section blocks ─────────────────── */

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.section-header h2 {
  flex: 1;
  margin: 0;
}

.chevron {
  font-size: 14px;
  color: var(--muted);
  transition: transform 200ms ease;
}

.is-collapsed .chevron {
  transform: rotate(-90deg);
}

.is-collapsed .section-body {
  display: none;
}

.section-body {
  margin-top: 12px;
}

#sections-container {
  display: grid;
  gap: 16px;
}

.drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  transition: color 150ms ease;
}

.drag-handle:hover {
  color: var(--brand);
}

.is-dragging {
  opacity: 0.6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ── Set main photo star ────────────────────────── */

.gallery-item {
  position: relative;
}

.set-main-form {
  position: absolute;
  top: 6px;
  right: 6px;
}

.set-main-btn {
  background: rgba(0, 0, 0, 0.5);
  color: #ccc;
  border: none;
  font-size: 16px;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease, background 150ms ease;
}

.set-main-btn:hover {
  color: #ffd700;
  background: rgba(0, 0, 0, 0.7);
  transform: none;
}

.set-main-btn.is-main {
  color: #ffd700;
  background: rgba(0, 0, 0, 0.7);
}

.description {
  white-space: pre-wrap;
  line-height: 1.55;
}

.label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.risk-label {
  background: #f7e6ce;
  color: #754616;
  border: 1px solid #e9cda7;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.active-row {
  background: #fdf5e6;
}

.rate-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rate-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
}
.rate-source {
  color: var(--muted);
  font-size: 0.85em;
}

/* Appreciation card */
.appreciation-display {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.appreciation-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.appreciation-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.appreciation-override {
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn-icon {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.9em;
  cursor: pointer;
  white-space: nowrap;
}
.btn-icon:hover { background: var(--brand-dark); }
.btn-icon:disabled { opacity: 0.5; cursor: wait; }
.btn-sm {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85em;
  cursor: pointer;
  color: var(--ink);
}
.btn-sm:hover { background: var(--pill); }
.btn-muted { color: var(--muted); }

/* ── Valuo inputs form ──────────────────────────── */

.valuo-inputs-details { border-top: 1px solid var(--line); padding-top: 8px; }

.valuo-inputs-toggle {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.valuo-inputs-toggle::-webkit-details-marker { display: none; }
.valuo-inputs-toggle::before { content: "▸ "; }
details[open] > .valuo-inputs-toggle::before { content: "▾ "; }

.valuo-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.valuo-inputs-grid label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  gap: 3px;
}

.valuo-inputs-grid input,
.valuo-inputs-grid select {
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.valuo-inputs-grid input:focus,
.valuo-inputs-grid select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.mortgage-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.mortgage-warnings {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mortgage-warning {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.9em;
}
.warning-hard {
  background: #fde8e8;
  color: #991b1b;
}
.warning-caution {
  background: #fef3c7;
  color: #92400e;
}
.text-danger {
  color: #991b1b;
}
.text-good {
  color: var(--good);
}
.text-caution {
  color: #92400e;
}
.page-heading {
  margin: 0 0 20px;
  font-size: 1.6rem;
  font-weight: 700;
}
.override-row {
  background: #f5eeff;
}
.mortgage-cell {
  white-space: nowrap;
  font-size: 0.85em;
}

.money-display {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.2;
  vertical-align: middle;
}

.money-primary {
  font-weight: 800;
  color: inherit;
}

.money-secondary {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  display: inline;
  font-size: 0.78em;
  font-weight: 700;
  min-height: 0;
  padding: 1px 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 180ms ease;
}

.money-secondary:hover,
.money-secondary:focus-visible {
  background: transparent;
  color: var(--brand);
  outline: none;
  transform: none;
}

.status-glyph {
  display: inline-flex;
  margin-left: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #fff2d6;
  color: #92400e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.limits-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.limit-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.limit-card.limit-primary {
  border-color: var(--good);
  background: #f0f7f1;
}
.limit-card.limit-hard {
  border-color: #991b1b;
  background: #fef2f2;
}
.limit-label {
  font-size: 0.8em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.limit-value {
  font-size: 1.3em;
  color: var(--ink);
}
.limit-split {
  font-size: 0.82em;
  color: var(--brand);
}

.orig-block {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fffdf9;
}

.orig-block summary {
  cursor: pointer;
  font-weight: 700;
}

.orig-block p {
  margin: 10px 0 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.gallery a {
  display: block;
  cursor: pointer;
}

.gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gallery img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(86, 55, 22, 0.15);
}

.plain-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 10px;
}

.plain-list li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.plain-list p {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.comm {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.comm-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 14px;
}

.lang-tabs {
  display: inline-flex;
  gap: 6px;
}

.lang-tab {
  background: #f3e4cc;
  color: #6d440f;
  border: 1px solid #e2c59a;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.lang-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.lang-pane {
  display: none;
}

.lang-pane.is-active {
  display: block;
}

.flash-list p {
  margin: 0;
  color: var(--good);
  font-weight: 700;
}

@media (max-width: 700px) {
  .topbar {
    padding: 16px 14px 8px;
  }

  .topbar-row {
    flex-direction: row;
    align-items: center;
  }

  .brand {
    font-size: 22px;
  }

  .subtitle {
    font-size: 13px;
  }

  .container {
    padding: 8px 10px 24px;
    gap: 12px;
  }

  .card {
    padding: 12px;
    border-radius: 12px;
  }

  h1 { font-size: 20px; }
  h2 { font-size: 18px; }
  h3 { font-size: 16px; }

  .inline {
    flex-direction: column;
    align-items: stretch;
  }

  .facts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .facts-grid div {
    padding: 8px;
  }

  .facts-grid strong {
    font-size: 14px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .gallery img {
    height: 120px;
  }

  .actions-row {
    gap: 8px;
  }

  .actions-row button {
    width: 100%;
  }

  .list-toolbar {
    flex-direction: column;
    gap: 8px;
  }

  .filter-form {
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }

  .filter-form select,
  .filter-form input {
    flex: 1;
    min-width: 0;
    width: 100%;
  }

  .filter-group,
  .checkbox-filter,
  .range-group,
  .filter-actions {
    width: 100%;
    flex: 1 1 100%;
  }

  .checkbox-filter {
    min-height: 48px;
    justify-content: flex-start;
  }

  .filter-break {
    display: none;
  }

  .filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: sticky;
    bottom: 8px;
    z-index: 5;
    padding: 8px;
    margin: 2px -8px -4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 250, 242, 0.96);
    box-shadow: 0 8px 24px rgba(72, 45, 19, 0.14);
  }

  .filter-actions .btn-sm {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
  }

  .view-tabs {
    width: 100%;
  }

  .view-tab {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
  }

  /* Table → stacked cards on mobile */
  .table-wrap table thead {
    display: none;
  }

  .table-wrap table,
  .table-wrap table tbody,
  .table-wrap table tr,
  .table-wrap table td {
    display: block;
    width: 100%;
  }

  .table-wrap table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fff;
    position: relative;
    overflow: hidden;
  }

  .table-wrap table td {
    border: none;
    padding: 3px 0;
    font-size: 14px;
    white-space: normal;
  }

  .table-wrap table td:first-child {
    float: left;
    margin-right: 10px;
    margin-bottom: 4px;
  }

  .tiny-thumb {
    width: 72px;
    height: 52px;
    border-radius: 8px;
  }

  .table-wrap table td:nth-child(7),
  .table-wrap table td:nth-child(9) {
    display: none;
  }

  .pagination {
    display: grid;
    grid-template-columns: 1fr;
  }

  .page-numbers {
    justify-content: flex-start;
  }

  .comm {
    padding: 8px;
  }

  .comm-head {
    font-size: 13px;
  }

  .commute-links p {
    font-size: 14px;
  }

  .hero-thumb {
    width: 48px;
    height: 48px;
  }

  .detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-actions .status-form select {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .facts-grid {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery img {
    height: 180px;
  }
}

/* ── Lightbox photo viewer ───────────────────────────── */

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox-overlay.is-open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  padding: 8px 14px;
  min-width: 48px;
  min-height: 48px;
  z-index: 1002;
  opacity: 0.8;
  transition: opacity 150ms ease;
}

.lightbox-close:hover {
  opacity: 1;
  background: none;
  transform: none;
}

.lightbox-counter {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 600;
  z-index: 1002;
}

.lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 60px 56px;
  min-height: 0;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 16px 14px;
  min-width: 48px;
  min-height: 64px;
  z-index: 1001;
  border-radius: 8px;
  opacity: 0.7;
  transition: opacity 150ms ease, background 150ms ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

@media (max-width: 700px) {
  .lightbox-img-wrap {
    padding: 56px 8px;
  }

  .lightbox-prev,
  .lightbox-next {
    padding: 12px 8px;
    font-size: 22px;
    min-width: 40px;
  }

  .lightbox-prev {
    left: 4px;
  }

  .lightbox-next {
    right: 4px;
  }
}

/* ── Cadastre Section ──────────────────────────── */

.cadastre-record {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  background: #fff;
}

.cadastre-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cadastre-header h3 {
  margin: 0;
  font-size: 1rem;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.inline-form input[type="text"],
.inline-form input[type="number"] {
  flex: 1;
  min-width: 160px;
}

.cadastre-data {
  margin-top: 10px;
}

.cadastre-data h4 {
  margin: 14px 0 6px;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.registry-data-stack {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.registry-data-block,
.registry-json-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf9;
}

.registry-data-block summary,
.registry-json-block summary {
  cursor: pointer;
  font-weight: 700;
  padding: 10px 12px;
}

.registry-data-body {
  border-top: 1px solid var(--line);
  padding: 0 12px 12px;
}

.registry-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: fixed;
}

.registry-data-table tr {
  border-bottom: 1px solid rgba(220, 207, 181, 0.65);
}

.registry-data-table tr:last-child {
  border-bottom: 0;
}

.registry-data-table th,
.registry-data-table td {
  padding: 7px 0;
  vertical-align: top;
  text-align: left;
}

.registry-data-table thead th {
  color: var(--ink);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 10px;
  padding-right: 12px;
}

.registry-data-table tbody th {
  width: 26%;
  padding-right: 14px;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.registry-data-table tbody td {
  width: 24%;
  padding-right: 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.registry-lazy-content {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.registry-json-block {
  margin-top: 10px;
}

.registry-json-block pre {
  margin: 0;
  max-height: 460px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #2a2118;
  color: #fff8ee;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.changes-alert li {
  background: #fff4e6;
  border-color: #f0c36d;
}

.btn-sm {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.btn-sm:hover { background: var(--line); }
.btn-sm.btn-primary {
  background: var(--accent, #2563eb);
  color: #fff;
  border-color: var(--accent, #2563eb);
}
.btn-sm.btn-primary:hover { opacity: 0.9; }

.registry-checker-page h1,
.registry-checker-page h2,
.registry-check-result h2,
.registry-check-result h3 {
  margin-top: 0;
}

.registry-checker-header {
  margin-bottom: 12px;
}

.registry-checker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.registry-check-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.registry-check-form label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.registry-check-form input {
  width: 100%;
}

.registry-alert {
  border: 1px solid #f0c36d;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff4e6;
  color: #6b3d00;
}

.registry-history-table-wrap {
  overflow-x: auto;
}

.registry-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.registry-history-table th,
.registry-history-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.registry-history-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .registry-checker-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Info icon tooltips ── */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--muted);
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 2px;
}

.info-icon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: normal;
  width: max-content;
  max-width: 220px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 10;
}

.info-icon:hover::after,
.info-icon:focus::after {
  opacity: 1;
}

/* ── Mortgage calculator inputs ── */
.calc-inputs {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 100px;
}

.calc-field label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.calc-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
}

.calc-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(185, 90, 46, 0.15);
}

.calc-reset {
  background: none;
  border: 1px solid var(--line);
  color: var(--brand);
  font-size: 18px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms, color 150ms;
}

.calc-reset:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: none;
}

/* ── Mode toggle (conservative / joint) ── */
.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.mortgage-mode-pill {
  font-size: 11px;
  padding: 3px 10px;
  margin-left: auto;
  margin-right: 4px;
}

.mode-tab {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  background: #fff6ea;
  transition: background 0.15s, color 0.15s;
}

.mode-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.limit-monthly {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand);
  margin-top: 2px;
}

/* ── Side-by-side profile forms ── */
.profile-forms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}

.profile-forms.solo-mode {
  grid-template-columns: 1fr;
}

.profile-forms.solo-mode .partner-profile-card {
  display: none;
}

@media (max-width: 700px) {
  .profile-forms {
    grid-template-columns: 1fr;
  }
}

/* ── Savings projection ── */
.projection-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.projection-inputs label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.85rem;
}

.projection-inputs input {
  width: 100%;
}

.projection-summary {
  margin: 18px 0 10px;
}

.projection-chart-wrap {
  margin-top: 14px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--line);
}

@media (max-width: 700px) {
  .projection-inputs {
    grid-template-columns: 1fr;
  }
}

/* Valuation pills */
.pill-green { background: #22c55e; color: #fff; }
.pill-yellow { background: #eab308; color: #1a1a2e; }
.pill-red { background: #ef4444; color: #fff; }

/* Public listing operations */
.operations-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(86, 55, 22, 0.08);
}

.operations-hero h1 {
  margin-bottom: 6px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ops-status-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 220px;
}

.ops-state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid transparent;
}

.ops-state-pill.is-ready { background: #dcfce7; color: #14532d; border-color: #86efac; }
.ops-state-pill.is-running { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.ops-state-pill.is-paused { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }
.ops-state-pill.is-backoff { background: #fef3c7; color: #78350f; border-color: #fcd34d; }

.ops-grid {
  display: grid;
  gap: 12px;
}

.ops-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ops-metric {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 20px rgba(86, 55, 22, 0.06);
}

.ops-metric span,
.ops-facts span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ops-metric strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 28px;
  line-height: 1.1;
}

.ops-metric small {
  color: var(--muted);
}

.operations-panel {
  display: grid;
  gap: 16px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-header p {
  margin: 0;
}

.ops-control-row,
.ops-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-inline {
  gap: 8px;
  padding: 10px 14px;
  min-height: 42px;
  border-radius: 10px;
}

.btn-inline svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.btn-inline:hover {
  transform: none;
}

.btn-danger {
  background: #b42318;
}

.btn-danger:hover {
  background: #8f1d14;
}

.btn-muted-control {
  background: #fff6ea;
  color: var(--brand);
  border: 1px solid var(--line);
}

.btn-muted-control:hover {
  background: var(--pill);
  color: var(--brand-dark);
}

.ops-progress-block {
  display: grid;
  gap: 8px;
}

.ops-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.ops-progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4e1c6;
  border: 1px solid var(--line);
}

.ops-progress-track span {
  display: block;
  height: 100%;
  min-width: 0;
  background: linear-gradient(90deg, #33673b, #0f766e);
  transition: width 220ms ease;
}

.ops-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ops-facts div {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fffaf1;
  min-width: 0;
}

.ops-facts strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ops-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: #fffbeb;
}

.ops-alert p {
  margin: 4px 0 0;
  color: #78350f;
}

.ops-settings-form {
  display: grid;
  gap: 16px;
}

.ops-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ops-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ops-form-grid input,
.ops-form-grid select {
  min-height: 42px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.ops-checkbox {
  justify-content: center;
  min-height: 68px;
}

.ops-checkbox input {
  width: auto;
  min-height: auto;
}

.ops-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.ops-section-title h3 {
  margin-bottom: 0;
}

.ops-history-table td,
.ops-history-table th {
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .ops-progress-track span,
  .btn-inline,
  .operations-hero,
  .ops-metric {
    transition: none;
    animation: none;
  }
}

@media (max-width: 980px) {
  .ops-grid-4,
  .ops-facts,
  .ops-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .operations-hero,
  .panel-header,
  .ops-alert {
    flex-direction: column;
    align-items: stretch;
  }

  .ops-status-strip,
  .ops-control-row,
  .ops-form-actions {
    justify-content: flex-start;
  }

  .ops-grid-4,
  .ops-facts,
  .ops-form-grid {
    grid-template-columns: 1fr;
  }

  .btn-inline {
    width: 100%;
  }
}

/* Valuation bar */
.valuation-bar { margin-top: 1rem; }
.valuation-bar .bar-labels {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--muted); margin-bottom: 4px;
}
.valuation-bar .bar-track {
  position: relative; height: 12px;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 50%, #ef4444 100%);
  border-radius: 6px;
}
.valuation-bar .bar-marker {
  position: absolute; top: -16px; transform: translateX(-50%);
  font-size: 14px; color: var(--fg); font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.btn-sm {
  padding: 4px 12px; font-size: 0.8rem;
  background: var(--accent); color: #fff;
  border: none; border-radius: 6px; cursor: pointer;
}
.btn-sm:hover { opacity: 0.85; }
