/* Property Valuation Bee: app styles on top of the Hive stylesheet (hive.css). One accent, solid white cards. */

body { font-size: 15.5px; line-height: 1.5; }
.page { padding-top: var(--s4); padding-bottom: var(--s7); display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 10.5px; color: var(--muted); word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); margin-bottom: var(--s1); }
.lede { font-size: 16px; color: var(--muted); max-width: 90ch; text-wrap: pretty; }
.lede-narrow { max-width: 110ch; }

/* Top bar */
.brand { display: inline-flex; align-items: center; flex: none; }
.logo { height: 32px; width: auto; }
.topnav { display: flex; gap: var(--s1); margin-right: auto; margin-left: var(--s5); }
.topnav-link { height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14.5px; color: var(--muted); }
.topnav-link:hover { color: var(--ink); }
.topnav-link.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-control); }
.pill-btn { text-decoration: none; }
.pill-btn.is-on { box-shadow: inset 0 0 0 1.5px var(--blue); }
.avatar-btn { cursor: default; }
.footer { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); justify-content: space-between; padding-top: var(--s5); padding-bottom: var(--s6); font-size: 13px; color: var(--muted); }

/* Cards */
.card { background: #fff; border-radius: var(--radius-tile); box-shadow: var(--shadow-tile); padding: clamp(18px, 2vw, 28px); min-width: 0; }
.card-head { margin-bottom: var(--s4); }
.card-head h2, .card-title { font-size: clamp(18px, 1.4vw, 21px); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin-bottom: var(--s2); }
.card-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.grid-cards { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); }

/* Page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.page-head h1 { font-size: clamp(28px, 2.6vw, 40px); line-height: 1.08; font-weight: 800; letter-spacing: -0.035em; color: var(--ink); text-wrap: balance; }
.h1-sub { font-weight: 600; color: var(--muted); letter-spacing: -0.02em; }
.head-actions { display: flex; align-items: center; gap: var(--s3); }

/* Compact hero (no big imagery) */
.hero-card { display: flex; gap: clamp(16px, 2.4vw, 32px); align-items: center; }
.hero-mark { flex: none; display: grid; place-items: center; width: clamp(64px, 6vw, 88px); aspect-ratio: 1; border-radius: 22px; background: var(--art-bg); color: #fff; }
.hero-copy h1 { font-size: clamp(24px, 2.3vw, 34px); line-height: 1.1; font-weight: 800; letter-spacing: -0.035em; color: var(--ink); text-wrap: balance; margin-bottom: var(--s2); }

/* Layouts: form beside guidance on wide screens */
.layout-split { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .layout-split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
@media (min-width: 1100px) { .layout-split-wide { grid-template-columns: minmax(0, 2.4fr) minmax(320px, 1fr); } }
.main-stack, .side-stack { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); align-content: start; }

/* Forms */
.fields { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin-bottom: var(--s4); }
.fields-tight { margin-bottom: 0; }
.field-wide { grid-column: 1 / -1; }
select.field-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.file-input { height: auto; padding: 10px 14px; }
.stack { display: grid; gap: var(--s3); }
.form-actions { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-top: var(--s5); }
.form-notice { margin-top: var(--s4); }
.dropzone { display: grid; justify-items: center; gap: 6px; padding: clamp(20px, 3vw, 36px) 16px; border-radius: 16px; text-align: center; cursor: pointer; color: var(--blue); background: #FBFBFF; box-shadow: inset 0 0 0 1.5px rgba(36, 36, 255, 0.22); transition: box-shadow 0.2s var(--ease-soft), background-color 0.2s; }
.dropzone:hover, .dropzone.is-over { background: var(--blue-soft); box-shadow: inset 0 0 0 1.5px var(--blue); }
.dropzone:focus-within { box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 4px rgba(36, 36, 255, 0.12); }
.dz-title { font-weight: 600; color: var(--ink); }
.file-list { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: var(--s3); padding: 8px 12px; border-radius: 12px; background: var(--page); font-size: 14px; }
.file-list .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.file-list .bar { width: 90px; height: 6px; border-radius: 99px; background: rgba(20, 20, 60, 0.08); overflow: hidden; }
.file-list .bar span { display: block; height: 100%; width: 0; background: var(--blue); transition: width 0.3s var(--ease); }
.file-list button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 8px; }
details.more { margin-top: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s4); }
details.more summary { cursor: pointer; font-weight: 600; color: var(--ink); margin-bottom: var(--s4); }
.filters { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); align-items: end; margin-bottom: var(--s4); }
.filter-actions { display: flex; gap: var(--s3); align-items: center; height: 48px; }

/* How it works */
.how { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.how li { padding-left: 4px; }
.how strong { color: var(--ink); }
.mini-list { list-style: none; padding: 0; margin: 0; display: grid; }
.mini-list a { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; }
.mini-list li:first-child a { border-top: 0; }
.mini-list a:hover .mini-main { color: var(--blue); }
.mini-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }

/* Status pills (one accent: blue for good, neutrals otherwise, the Hive's error pink-red for failures) */
.status { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.status-valued { background: var(--blue); color: #fff; }
.status-refer { background: var(--blue-soft); color: #1A1AB8; box-shadow: inset 0 0 0 1px rgba(36, 36, 255, 0.35); }
.status-cannot_value { background: rgba(20, 20, 60, 0.07); color: var(--ink); }
.status-failed { background: #FFF1F4; color: #B01E45; }
.status-queued, .status-running, .status-draft { background: var(--blue-soft); color: var(--blue); }
.status-running::before, .status-queued::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* Result card */
.result-title { font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; font-weight: 800; letter-spacing: -0.025em; color: var(--ink); margin-bottom: var(--s2); }
.value-row { display: flex; flex-wrap: wrap; gap: var(--s4) clamp(24px, 4vw, 56px); margin: var(--s2) 0 var(--s4); }
.value-row > div { display: grid; gap: 2px; }
.value-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.value-big { font-size: clamp(30px, 3.2vw, 46px); line-height: 1; font-weight: 800; letter-spacing: -0.035em; color: var(--ink); font-variant-numeric: tabular-nums; }
.value-mid { font-size: clamp(18px, 1.6vw, 24px); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.decision { max-width: 110ch; color: var(--text); }
.decision-refer { padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); color: #1A1AB8; }

/* Step trace */
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--s3); padding: var(--s4) 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: rgba(20, 20, 60, 0.06); color: var(--muted); }
.step-ok .step-mark { background: var(--blue); color: #fff; }
.step-warn .step-mark { background: var(--blue-soft); color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.step-stop .step-mark { background: #FFF1F4; color: #B01E45; }
.step-running .step-mark { background: var(--blue-soft); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); animation: blink 1s infinite; }
.step-head { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; }
.step-head h3 { font-size: 15.5px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.step-pending .step-head h3 { color: var(--muted); font-weight: 600; }
.step-summary { margin-top: 2px; color: var(--text); max-width: 120ch; }
.step-details { margin-top: var(--s2); }
.step-details > summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14px; width: fit-content; }
.step-details[open] > summary { margin-bottom: var(--s3); }
.sub { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: var(--s4) 0 var(--s2); }
.quote { margin: 6px 0; padding: 10px 14px; border-radius: 12px; background: var(--page); display: grid; gap: 4px; font-size: 14px; }
.quote .pg { font-size: 11.5px; font-weight: 700; color: var(--blue); }
.q-orig { color: var(--ink); }
.q-en { color: var(--muted); }
.plain { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.json { max-height: 360px; overflow: auto; background: var(--page); border-radius: 12px; padding: 12px; font-size: 12.5px; }

/* Key-value lists */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 6px var(--s4); font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * clamp(4px, 0.6vw, 8px)); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .empty { text-align: center; color: var(--muted); padding: var(--s6) 10px; }
.table-click tbody tr:hover { background: #FAFAFE; }
.row-muted td { color: var(--muted); }
.row-total td { font-weight: 700; color: var(--ink); border-top: 1.5px solid var(--line-strong); }
@media (max-width: 760px) { .col-opt { display: none; } }

/* Chips */
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(20, 20, 60, 0.06); color: var(--ink); white-space: nowrap; }
.chip-ok, .chip-pass { background: var(--blue-soft); color: var(--blue); }
.chip-bad, .chip-negative { background: #FFF1F4; color: #B01E45; }
.chip-flag { background: rgba(20, 20, 60, 0.06); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.chip-site { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.err { font-size: 12px; font-weight: 700; }
.err-ok { color: var(--blue); }
.err-mid { color: var(--ink); }
.err-bad { color: #B01E45; }

/* Admin */
.admin-tabs, .run-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(20, 20, 60, 0.05); width: fit-content; max-width: 100%; overflow-x: auto; }
.run-tabs { margin-top: var(--s4); }
.tab { height: 34px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tab.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-control); }
.stats { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); margin: 0; }
.stat { padding: 16px 18px; }
.stat dt { font-size: 12.5px; color: var(--muted); }
.stat dd { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.conn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.conn-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-on { background: var(--blue); }
.dot-off { background: rgba(20, 20, 60, 0.18); }
.rules { display: grid; }
.rule { display: grid; gap: var(--s3); grid-template-columns: minmax(0, 1fr); padding: var(--s4) 0; border-top: 1px solid var(--line); }
.rule:first-child { border-top: 0; }
@media (min-width: 1100px) { .rule { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; } }
.rule-label { font-weight: 600; color: var(--ink); }
.rule-edit { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.rule-edit .field-input { flex: 1; min-width: 200px; height: 42px; }

/* Report (Hero format, prints on A4) */
.report-actions { display: flex; gap: var(--s3); justify-content: flex-end; }
.report { background: #fff; border-radius: var(--radius-tile); box-shadow: var(--shadow-tile); padding: clamp(18px, 3vw, 40px); max-width: 1180px; width: 100%; margin: 0 auto; color: #1d1d24; }
.report-head { display: flex; align-items: center; gap: var(--s5); padding-bottom: var(--s4); border-bottom: 2px solid var(--ink); flex-wrap: wrap; }
.report-logo { height: 28px; width: auto; }
.report-head h1 { font-size: clamp(18px, 1.8vw, 24px); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.report-head p { font-size: 13px; color: var(--muted); }
.report h2 { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); margin: var(--s5) 0 var(--s2); }
.report h3 { font-size: 14px; font-weight: 700; margin: var(--s4) 0 var(--s2); }
.report-status { margin-top: var(--s4); padding: 12px 16px; border-radius: 12px; display: grid; gap: 4px; background: var(--page); }
.status-box-valued { background: var(--blue-soft); color: #1A1AB8; }
.status-box-failed { background: #FFF1F4; color: #B01E45; }
.rt { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: fixed; }
.rt th, .rt td { border: 1px solid rgba(20, 20, 60, 0.18); padding: 7px 9px; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.rt th { background: #F6F6FB; font-weight: 600; color: var(--ink); width: 22%; }
.rt td.blank { background: #fff; }
.rt-4 th { width: auto; }
.rt-comps { table-layout: auto; font-size: 12.5px; }
.rt-comps th { width: auto; }
.rl { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 13.5px; }
.report-none { padding: 12px 16px; border-radius: 12px; background: var(--page); }
.report-foot { margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .rt, .rt tbody, .rt tr, .rt th, .rt td { display: block; width: 100%; }
  .rt tr { margin-bottom: 8px; }
  .rt td.blank { display: none; }
  .rt-comps, .rt-4 { display: table; }
  .rt-comps tbody, .rt-4 tbody { display: table-row-group; } .rt-comps tr, .rt-4 tr { display: table-row; } .rt-comps th, .rt-comps td, .rt-4 th, .rt-4 td { display: table-cell; width: auto; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  body::before, .no-print, .report-actions { display: none !important; }
  .page { padding: 0; }
  .report { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .rt { font-size: 10.5px; }
  .page-break { break-before: page; }
  a { text-decoration: none; color: inherit; }
}

@media (max-width: 899px) {
  .topnav { margin-left: var(--s2); }
  .topnav-link { padding: 0 10px; font-size: 14px; }
  .hero-card { align-items: flex-start; }
}
@media (max-width: 599px) {
  .topbar { flex-wrap: wrap; }
  .topnav { order: 3; width: 100%; margin: var(--s2) 0 0; }
  .logo { height: 26px; }
  .hero-mark { width: 52px; border-radius: 16px; }
  .hero-mark svg { width: 30px; height: 30px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { margin-top: 6px; }
}
