:root {
  --ink: #f3f0e9;
  --muted: #9a9b98;
  --dim: #686b68;
  --canvas: #090b0d;
  --surface: rgba(19, 22, 23, 0.92);
  --surface-2: #181c1d;
  --line: rgba(255, 255, 255, 0.09);
  --gold: #d8b572;
  --gold-bright: #f0cc84;
  --green: #78c7a1;
  --red: #eb826f;
  --blue: #8aafdd;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 85% -5%, rgba(113, 85, 44, 0.18), transparent 34rem),
    linear-gradient(180deg, #0d1011 0%, var(--canvas) 52%);
}
button, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
.hidden { display: none !important; }
.ambient { position: fixed; width: 28rem; height: 28rem; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .08; }
.ambient-a { background: var(--gold); top: -15rem; right: -10rem; }
.ambient-b { background: #3b7b68; bottom: -20rem; left: -16rem; }

.app-shell { width: min(100%, 700px); min-height: 100dvh; margin: 0 auto; position: relative; }
.boot-screen { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 2rem 1.5rem 6rem; }
.brand-mark { width: 3.2rem; height: 3.2rem; border: 1px solid rgba(216, 181, 114, .5); display: grid; place-items: center; border-radius: 50%; color: var(--gold); font-family: Georgia, serif; font-size: 1.5rem; margin-bottom: 2rem; }
.eyebrow { margin: 0 0 .55rem; color: var(--gold); font-size: .68rem; line-height: 1.3; font-weight: 700; letter-spacing: .17em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { letter-spacing: -.035em; }
.boot-screen h1 { margin-bottom: 1.25rem; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.65rem, 12vw, 5rem); font-weight: 400; line-height: .98; }
.boot-screen h1 em { color: var(--gold); font-weight: 400; }
.muted { color: var(--muted); }
.loader { width: 100%; height: 2px; margin-top: 1.4rem; overflow: hidden; background: var(--line); }
.loader span { display: block; width: 38%; height: 100%; background: var(--gold); animation: load 1.25s infinite ease-in-out; }
@keyframes load { from { transform: translateX(-110%); } to { transform: translateX(290%); } }

.workspace { min-height: 100dvh; padding: max(1.25rem, env(safe-area-inset-top)) 1rem calc(6.5rem + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; margin: 0 .25rem 1rem; }
.topbar h1 { margin: 0; font-family: Georgia, serif; font-size: 1.85rem; font-weight: 400; }
.icon-button { width: 2.85rem; height: 2.85rem; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.03); font-size: 1.3rem; cursor: pointer; }
.icon-button.loading { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-bottom: .85rem; }
.stat { padding: .85rem .8rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.stat strong { display: block; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 400; }
.stat span { color: var(--muted); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.filter-row { display: flex; gap: .5rem; margin: 0 -.15rem 1rem; padding: .15rem; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { white-space: nowrap; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: .78rem; cursor: pointer; }
.filter-chip.active { border-color: rgba(216,181,114,.45); background: rgba(216,181,114,.11); color: var(--gold-bright); }

.property-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); touch-action: pan-y; transition: transform .18s ease, opacity .18s ease; }
.property-card.dragging { transition: none; }
.property-card.swipe-left { transform: translateX(-110%) rotate(-5deg); opacity: 0; }
.property-card.swipe-right { transform: translateX(110%) rotate(5deg); opacity: 0; }
.property-card.swipe-up { transform: translateY(-80%) scale(.94); opacity: 0; }
.image-stage { position: relative; aspect-ratio: 16 / 10; background: #111; overflow: hidden; }
.image-stage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-stage.no-image { display: grid; place-items: center; color: var(--dim); background: linear-gradient(135deg, #171a1b, #101213); }
.image-counter, .source-pill { position: absolute; top: .75rem; padding: .38rem .62rem; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(4,6,7,.72); backdrop-filter: blur(12px); font-size: .68rem; }
.image-counter { right: .75rem; }
.source-pill { left: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.card-body { padding: 1.1rem; }
.street-line { display: flex; gap: .45rem; align-items: center; min-width: 0; color: var(--gold); font-size: .75rem; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
.street-line span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confidence { color: var(--dim); font-size: .62rem; }
.card-title { margin: .55rem 0 .85rem; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 400; line-height: 1.16; }
.price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.price { font-size: 1.35rem; font-weight: 700; letter-spacing: -.03em; }
.condo { color: var(--muted); font-size: .76rem; text-align: right; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.fact { min-height: 3.8rem; padding: .65rem .45rem; display: grid; align-content: center; background: var(--surface-2); text-align: center; }
.fact strong { display: block; font-size: .9rem; }
.fact span { margin-top: .15rem; color: var(--dim); font-size: .62rem; text-transform: uppercase; }
.signal-box { margin-top: .85rem; padding: .8rem .9rem; border-left: 2px solid var(--gold); background: rgba(216,181,114,.06); color: #c8c5bd; font-size: .78rem; line-height: 1.45; }
.signal-box.danger { border-color: var(--red); background: rgba(235,130,111,.06); }
.meta-line { display: flex; justify-content: space-between; gap: 1rem; margin-top: .9rem; color: var(--dim); font-size: .67rem; }
.card-link { color: var(--blue); text-decoration: none; }
.decision-actions { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: .55rem; margin-top: 1rem; }
.action-button { min-height: 3.25rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); font-size: .78rem; font-weight: 700; cursor: pointer; }
.action-button.reject { color: var(--red); }
.action-button.interest { border-color: rgba(120,199,161,.34); background: rgba(120,199,161,.1); color: #a7dfc3; }
.action-button.later { color: var(--gold-bright); }
.secondary-actions { display: flex; justify-content: center; margin-top: .7rem; }
.text-button { padding: .55rem; border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-decoration-color: rgba(255,255,255,.18); text-underline-offset: .2rem; font-size: .73rem; cursor: pointer; }
.queue-progress { margin-top: .8rem; display: flex; justify-content: space-between; color: var(--dim); font-size: .68rem; }
.empty-state { padding: 3rem 1.2rem; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: .45rem; color: var(--ink); font-family: Georgia, serif; font-size: 1.45rem; font-weight: 400; }

.bottom-nav { position: fixed; z-index: 10; bottom: max(.7rem, env(safe-area-inset-bottom)); left: 50%; width: min(calc(100% - 1.25rem), 670px); transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, 1fr); padding: .38rem; border: 1px solid var(--line); border-radius: 22px; background: rgba(14,17,18,.9); box-shadow: 0 12px 45px rgba(0,0,0,.48); backdrop-filter: blur(22px); }
.nav-item { min-height: 3.35rem; border: 0; border-radius: 17px; background: transparent; color: var(--dim); font-size: .68rem; cursor: pointer; }
.nav-item span { display: block; margin-bottom: .15rem; font-size: 1.1rem; }
.nav-item b { display: inline-grid; min-width: 1.1rem; min-height: 1.1rem; place-items: center; margin-left: .2rem; border-radius: 99px; background: var(--red); color: white; font-size: .58rem; }
.nav-item b:empty { display: none; }
.nav-item.active { background: rgba(216,181,114,.09); color: var(--gold-bright); }

.section-intro { padding: .7rem .2rem 1rem; }
.section-intro h2 { margin-bottom: .55rem; font-family: Georgia, serif; font-size: 1.7rem; font-weight: 400; }
.section-intro p:last-child { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.group-card { margin-bottom: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.group-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; margin-bottom: .85rem; }
.group-head h3 { margin: .2rem 0 0; font-family: Georgia, serif; font-size: 1.25rem; font-weight: 400; }
.status-pill { padding: .35rem .55rem; border-radius: 999px; background: rgba(216,181,114,.1); color: var(--gold); font-size: .62rem; white-space: nowrap; }
.status-pill.conflict { background: rgba(235,130,111,.1); color: var(--red); }
.common-data { margin: 0 0 .9rem; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.mini-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #131617; }
.mini-card img, .mini-placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: grid; place-items: center; color: var(--dim); background: #0f1112; }
.mini-card-body { padding: .7rem; }
.mini-card h4 { min-height: 2.3em; margin: 0 0 .4rem; font-size: .78rem; line-height: 1.15; }
.mini-card p { margin: .2rem 0; color: var(--muted); font-size: .68rem; }
.evidence-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: .75rem 0; }
.evidence-chip { padding: .3rem .45rem; border-radius: 8px; background: rgba(138,175,221,.08); color: #abc8e9; font-size: .61rem; }
.verdict-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .45rem; }
.verdict-button { min-height: 2.85rem; border: 1px solid var(--line); border-radius: 13px; background: transparent; color: var(--muted); font-size: .69rem; font-weight: 700; cursor: pointer; }
.verdict-button.same.selected, .verdict-button.same:hover { border-color: rgba(120,199,161,.45); color: var(--green); background: rgba(120,199,161,.08); }
.verdict-button.different.selected, .verdict-button.different:hover { border-color: rgba(235,130,111,.45); color: var(--red); background: rgba(235,130,111,.08); }
.verdict-button.inconclusive.selected, .verdict-button.inconclusive:hover { border-color: rgba(216,181,114,.45); color: var(--gold); background: rgba(216,181,114,.08); }
.pair-nav { display: flex; align-items: center; justify-content: space-between; margin-top: .8rem; }
.small-button { padding: .58rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); font-size: .7rem; cursor: pointer; }
.finalize-button { width: 100%; margin-top: .9rem; }
.conflict-box { margin-top: .8rem; padding: .7rem; border: 1px solid rgba(235,130,111,.25); border-radius: 12px; color: #f0a99c; background: rgba(235,130,111,.06); font-size: .72rem; }

.streets-list { display: grid; gap: .7rem; }
.street-card { padding: 1rem; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.street-card-head { display: flex; align-items: start; justify-content: space-between; gap: .8rem; }
.street-card h3 { margin: 0 0 .3rem; font-family: Georgia, serif; font-size: 1.15rem; font-weight: 400; }
.street-card-meta { color: var(--muted); font-size: .7rem; }
.confidence-badge { padding: .3rem .45rem; border-radius: 8px; color: var(--green); background: rgba(120,199,161,.08); font-size: .58rem; text-transform: uppercase; }
.confidence-badge.inferred { color: var(--gold); background: rgba(216,181,114,.08); }
.confidence-badge.unknown { color: var(--muted); background: rgba(255,255,255,.04); }
.street-actions { display: flex; gap: .4rem; margin-top: .85rem; overflow-x: auto; }
.street-pref { padding: .52rem .65rem; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--dim); font-size: .65rem; cursor: pointer; white-space: nowrap; }
.street-pref.selected { border-color: rgba(216,181,114,.38); color: var(--gold); background: rgba(216,181,114,.08); }
.street-pref.exclusion { margin-left: auto; color: var(--red); }

.sheet-dialog { width: 100%; max-width: 700px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 28px 28px 0 0; background: transparent; color: var(--ink); }
.sheet-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.sheet-panel { max-height: 92dvh; overflow-y: auto; margin: 0; padding: .7rem 1.15rem calc(1.1rem + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; background: #151819; box-shadow: var(--shadow); }
.sheet-handle { width: 2.8rem; height: .25rem; margin: .15rem auto 1.2rem; border-radius: 99px; background: rgba(255,255,255,.18); }
.dialog-heading h2 { margin-bottom: .4rem; font-family: Georgia, serif; font-size: 1.65rem; font-weight: 400; }
.dialog-heading p:last-child { margin-bottom: 1rem; color: var(--muted); font-size: .8rem; }
.reason-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .48rem; margin-bottom: 1rem; }
.reason-option { min-height: 2.7rem; padding: .6rem; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); font-size: .7rem; cursor: pointer; }
.reason-option.selected { border-color: rgba(235,130,111,.42); background: rgba(235,130,111,.08); color: #f1a99c; }
.field-label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .72rem; }
textarea { width: 100%; resize: vertical; padding: .8rem; border: 1px solid var(--line); border-radius: 13px; background: #0f1213; color: var(--ink); }
.form-error { min-height: 1.1rem; margin: .45rem 0; color: var(--red); font-size: .7rem; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.45fr; gap: .6rem; }
.button { min-height: 3rem; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: transparent; font-weight: 700; font-size: .78rem; cursor: pointer; }
.button:disabled { opacity: .45; cursor: wait; }
.button-primary { border-color: rgba(216,181,114,.45); background: var(--gold); color: #17120a; }
.button-danger { border-color: rgba(235,130,111,.45); background: var(--red); color: #210d09; }
.button-ghost { color: var(--muted); }
.button-full { width: 100%; }
.candidate-list { display: grid; gap: .6rem; margin-bottom: 1rem; }
.candidate-row { display: grid; grid-template-columns: 4.8rem 1fr auto; gap: .7rem; align-items: center; padding: .55rem; border: 1px solid var(--line); border-radius: 16px; background: #101314; text-align: left; cursor: pointer; }
.candidate-row img, .candidate-row .mini-placeholder { width: 4.8rem; aspect-ratio: 1; border-radius: 11px; object-fit: cover; }
.candidate-row h3 { margin: 0 0 .2rem; font-size: .76rem; }
.candidate-row p { margin: 0; color: var(--muted); font-size: .65rem; }
.score { color: var(--gold); font-family: Georgia, serif; font-size: 1rem; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(6rem + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 2rem); transform: translate(-50%, 2rem); padding: .72rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: #ece6d9; color: #151515; font-size: .73rem; opacity: 0; pointer-events: none; transition: .22s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 600px) {
  .workspace { padding-left: 1.5rem; padding-right: 1.5rem; }
  .property-card { max-width: 560px; margin: 0 auto; }
  .queue-progress { max-width: 560px; margin-left: auto; margin-right: auto; }
  .sheet-dialog { margin-bottom: 1.2rem; border-radius: 28px; }
  .sheet-panel { border-radius: 28px; border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
