:root {
  --paper: #f7f3eb;
  --ink: #191816;
  --muted: #696156;
  --line: #d8cfc0;
  --panel: #fffaf1;
  --olive: #556b3c;
  --clay: #a64f35;
  --sea: #22656b;
  --gold: #c28b2c;
  --danger: #9d2b24;
  --shadow: 0 18px 50px rgba(55, 42, 23, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(25, 24, 22, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(25, 24, 22, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

main {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.auth-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 14px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.auth-bar a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.auth-bar form {
  margin: 0;
}

a {
  color: inherit;
}

.hero,
.dashboard-head,
.panel {
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.92);
  box-shadow: var(--shadow);
}

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 36px;
  align-items: end;
  padding: 54px;
  background:
    linear-gradient(120deg, rgba(85, 107, 60, 0.18), rgba(194, 139, 44, 0.10)),
    var(--panel);
}

.eyebrow,
.card-kicker {
  margin: 0 0 10px;
  color: var(--clay);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 18px;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.9;
  font-weight: 500;
}

h2 {
  font-size: 30px;
  line-height: 1;
}

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.45;
}

.quick-create,
.upload-panel form,
.details-form {
  display: grid;
  gap: 14px;
}

.quick-create {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.login-shell {
  min-height: calc(100vh - 92px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(540px, 100%);
}

.login-card h1 {
  font-size: clamp(44px, 8vw, 76px);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

input,
textarea,
select,
button,
.button-link {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  font: inherit;
}

input,
textarea,
select {
  min-height: 42px;
  padding: 10px 12px;
  background: #fffdf8;
}

textarea {
  resize: vertical;
}

button,
.button-link {
  min-height: 44px;
  padding: 10px 14px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}

button:hover,
.button-link:hover {
  background: var(--sea);
  border-color: var(--sea);
}

.button-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.danger:hover {
  background: #6f1712;
  border-color: #6f1712;
}

.danger-form {
  min-width: 180px;
}

.table-action {
  width: auto;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions form {
  margin: 0;
}

.artifact-link {
  display: inline-block;
  border-bottom: 1px solid var(--sea);
  color: var(--sea);
  text-decoration: none;
}

.artifact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.file-event {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.file-event strong,
.file-event span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.file-event strong {
  color: var(--ink);
}

.file-event span,
.file-event p,
.file-event small {
  margin: 0;
  color: var(--muted);
}

.file-event.status-failed strong {
  color: var(--danger);
}

.inline-override {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  min-width: 320px;
}

.inline-override input {
  min-height: 34px;
}

.split,
.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.property-card {
  display: grid;
  min-height: 250px;
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.property-card:hover {
  transform: translateY(-2px);
}

.property-card p {
  color: var(--muted);
  line-height: 1.45;
}

.event-list {
  display: grid;
  gap: 10px;
}

.disclosure-panel > summary {
  cursor: pointer;
  list-style: none;
  margin: 0;
  user-select: none;
}

.disclosure-panel > summary::-webkit-details-marker {
  display: none;
}

.disclosure-panel > summary:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 5px;
}

.disclosure-panel .disclosure-body {
  margin-top: 20px;
}

.disclosure-action {
  min-width: 54px;
  color: var(--sea);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-align: right;
  text-transform: uppercase;
}

.when-open {
  display: none;
}

.disclosure-panel[open] .when-open {
  display: inline;
}

.disclosure-panel[open] .when-closed {
  display: none;
}

.event-row {
  display: grid;
  grid-template-columns: 96px 170px minmax(0, 1fr) 220px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.event-row span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
}

.event-row p,
.event-row small {
  margin: 0;
  color: var(--muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.metric-list {
  display: grid;
  gap: 10px;
}

.metric-list span {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.metric-list strong {
  color: var(--ink);
  text-align: right;
}

.tool-pill {
  display: inline-block;
  min-width: 92px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
}

.tool-pill.ok {
  border-color: var(--olive);
  color: var(--olive);
}

.tool-pill.missing {
  border-color: var(--danger);
  color: var(--danger);
}

.status-failed span {
  border-color: var(--danger);
  color: var(--danger);
}

.status-succeeded span,
.status-ready span {
  border-color: var(--olive);
  color: var(--olive);
}

.card-stats {
  display: flex;
  gap: 8px;
  align-self: end;
}

.card-stats span,
.risk-stamp,
.finding-tags span {
  border: 1px solid var(--line);
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

.back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
}

.dashboard-head {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: end;
  padding: 42px;
  margin-bottom: 18px;
}

.dashboard-head h1 {
  font-size: clamp(42px, 6vw, 80px);
}

/* Property detail: a case file, not a completion dashboard. */
.investigation-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 72px);
  border: 1px solid #c9bda9;
  background:
    radial-gradient(circle at 82% 12%, rgba(194, 139, 44, 0.14), transparent 27%),
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(238, 232, 218, 0.96));
  box-shadow: 0 28px 80px rgba(55, 42, 23, 0.16);
}

.investigation-hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 28%;
  height: 4px;
  background: var(--clay);
}

.case-nav,
.case-meta,
.confidence-score > span,
.confidence-score > p,
.confidence-dimensions,
.next-action > span,
.trail-kicker,
.trail-card-meta,
.trail-axis,
.trail-finish,
.dossier-divider span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.case-nav {
  display: flex;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.case-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  margin-top: clamp(38px, 7vw, 86px);
}

.case-location {
  margin-bottom: 9px;
  color: var(--clay);
  font-size: 16px;
  font-style: italic;
}

.case-heading h1 {
  max-width: 980px;
  margin: 0;
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-size: clamp(48px, 7vw, 104px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.88;
}

.case-price {
  margin: 0 0 4px;
  font-size: clamp(26px, 3vw, 46px);
  white-space: nowrap;
}

.case-meta {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case-conclusion {
  max-width: 980px;
  margin: clamp(36px, 6vw, 72px) 0 0;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.08;
}

.confidence-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(420px, 1.5fr);
  gap: clamp(30px, 6vw, 90px);
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.confidence-score > span,
.confidence-score > p {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.confidence-score strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 66px;
  font-weight: 400;
  line-height: 1;
}

.confidence-score small {
  color: var(--muted);
  font-size: 22px;
}

.confidence-track {
  width: 100%;
  height: 2px;
  margin: 16px 0 13px;
  background: var(--line);
}

.confidence-track i {
  display: block;
  height: 100%;
  background: var(--clay);
  transform-origin: left;
  animation: reveal-confidence 900ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes reveal-confidence {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.confidence-dimensions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 34px;
  margin: 0;
}

.confidence-dimensions div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.confidence-dimensions dt {
  color: var(--muted);
}

.confidence-dimensions dd {
  margin: 0;
  text-align: right;
}

.confidence-dimensions .good { color: var(--olive); }
.confidence-dimensions .warn { color: var(--danger); }
.confidence-dimensions .partial { color: #8a641e; }
.confidence-dimensions .open { color: #8a8175; }

.next-action {
  position: relative;
  display: grid;
  grid-template-columns: minmax(140px, 0.45fr) minmax(220px, 0.9fr) 1.4fr 32px;
  gap: 22px;
  align-items: center;
  margin-top: 36px;
  padding: 20px 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease;
}

.next-action:hover {
  transform: translateY(-2px);
  background: #2c3028;
}

.next-action > span {
  color: #cabfad;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.next-action strong { font-size: 18px; font-weight: 500; }
.next-action p { margin: 0; color: #d8d0c4; font-size: 14px; line-height: 1.45; }
.next-action b { font-size: 25px; font-weight: 400; text-align: right; }

.investigation-trail {
  position: relative;
  margin-top: 18px;
  padding: clamp(44px, 7vw, 92px) clamp(18px, 4vw, 56px) 78px;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 250, 241, 0.88), rgba(255, 250, 241, 0.88)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(25, 24, 22, 0.035) 32px);
}

.trail-title {
  width: min(570px, 100%);
  margin: 0 auto 76px;
  text-align: center;
}

.trail-title h2 {
  margin-bottom: 14px;
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 400;
  line-height: 1.03;
}

.trail-title > p:last-child { color: var(--muted); line-height: 1.5; }

.trail-axis {
  position: absolute;
  top: 322px;
  bottom: 87px;
  left: 50%;
  width: 1px;
  background: #b9ad9b;
}

.trail-axis span {
  position: absolute;
  top: -34px;
  left: 50%;
  padding: 0 9px;
  background: var(--panel);
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
}

.trail-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr);
  align-items: center;
  max-width: 1120px;
  min-height: 196px;
  margin: 0 auto 26px;
  animation: trail-arrive 500ms ease both;
  animation-delay: calc(var(--trail-index) * 70ms);
}

@keyframes trail-arrive {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.trail-card {
  position: relative;
  min-height: 152px;
  padding: 22px 24px;
  border: 1px solid #d5cbbc;
  background: rgba(255, 253, 248, 0.96);
  transition: border-color 180ms ease, transform 180ms ease;
}

.trail-card:hover { border-color: #a99a84; transform: translateY(-2px); }

.evidence-card::after,
.outcome-card::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 38px;
  border-top: 1px solid #b9ad9b;
}

.evidence-card::after { right: -39px; }
.outcome-card::before { left: -39px; }

.trail-card h3 {
  margin-bottom: 9px;
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-size: 25px;
  font-weight: 400;
}

.trail-card > p:not(.trail-kicker) {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.48;
}

.trail-kicker {
  margin-bottom: 8px;
  color: var(--clay);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.trail-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  justify-content: space-between;
  color: #82796e;
  font-size: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.trail-card > a {
  display: inline-flex;
  gap: 8px;
  margin-top: 14px;
  color: var(--sea);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.trail-node {
  display: grid;
  place-items: center;
}

.trail-node span {
  width: 15px;
  height: 15px;
  border: 4px solid var(--panel);
  border-radius: 50%;
  outline: 1px solid #948774;
  background: var(--ink);
}

.state-empty .trail-node span { background: var(--panel); }
.state-processing .trail-node span {
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(194, 139, 44, .35);
  animation: evidence-pulse 2s ease-out infinite;
}
.state-warning .trail-node span { background: var(--clay); outline-color: var(--clay); }
.state-locked .trail-node span { background: #d8d0c3; outline-color: #bfb4a4; }
.state-locked .trail-card { opacity: .57; }
.state-warning .trail-card { border-color: rgba(166, 79, 53, .48); }

@keyframes evidence-pulse {
  70%, 100% { box-shadow: 0 0 0 12px rgba(194, 139, 44, 0); }
}

.trail-finish {
  position: relative;
  z-index: 2;
  width: min(390px, calc(100% - 30px));
  margin: 58px auto 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
  text-transform: uppercase;
}

.trail-finish span {
  position: absolute;
  top: -7px;
  left: calc(50% - 7px);
  width: 14px;
  height: 14px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: var(--ink);
  outline: 1px solid var(--ink);
}

.trail-finish strong { display: block; font-size: 11px; letter-spacing: .12em; }
.trail-finish p { margin: 7px 0 0; color: var(--muted); font-family: Georgia, serif; font-size: 13px; line-height: 1.4; text-transform: none; }

.dossier-divider {
  display: flex;
  gap: 24px;
  align-items: baseline;
  margin: 52px 0 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}

.dossier-divider span {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.dossier-divider p { margin: 0; color: var(--muted); font-size: 14px; }

.risk-stamp {
  display: grid;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
}

.risk-stamp span {
  color: #d5cab8;
}

.parcel-map {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #eee8dc;
  overflow: hidden;
}

.parcel-map img,
.parcel-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.parcel-map img {
  object-fit: cover;
}

.parcel-map polygon {
  fill: rgba(194, 139, 44, 0.28);
  stroke: var(--clay);
  stroke-width: 5;
  vector-effect: non-scaling-stroke;
}

.parcel-map .candidate-parcel {
  fill: rgba(194, 139, 44, 0.28);
  stroke: var(--clay);
}

.parcel-map .neighbor-parcel {
  fill: rgba(93, 135, 193, 0.2);
  stroke: #6f87b8;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 10 6;
  opacity: 0.95;
}

.parcel-map .candidate-internal-line {
  fill: none;
  stroke: #d7c8a8;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 8 6;
  opacity: 0.95;
}

.parcel-map circle {
  fill: var(--sea);
  stroke: white;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.parcel-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.parcel-details > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.parcel-details span,
.parcel-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.parcel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.parcel-actions form,
.parcel-actions button {
  width: auto;
  margin: 0;
}

.parcel-status {
  padding: 7px 9px;
  border: 1px solid var(--line);
}

.parcel-status.candidate {
  border-color: var(--gold);
  color: #76510e;
}

.parcel-status.confirmed {
  border-color: var(--olive);
  color: var(--olive);
}

.parcel-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.explorer {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr);
  gap: 16px;
  margin-top: 14px;
  height: clamp(560px, 74vh, 900px);
}

.explorer-map {
  position: relative;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
}

.explorer-map-editing {
  cursor: crosshair !important;
}

.explorer-map .leaflet-container {
  height: 100%;
  min-height: 0;
}

.explorer-inspector {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fffdf8;
  padding: 14px 22px 14px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(25, 24, 22, 0.35) rgba(255, 253, 248, 0.15);
}

.explorer-inspector::-webkit-scrollbar {
  width: 8px;
}

.explorer-inspector::-webkit-scrollbar-thumb {
  background: rgba(25, 24, 22, 0.35);
}

.explorer-inspector::-webkit-scrollbar-track {
  background: rgba(255, 253, 248, 0.18);
}

.inspector-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.inspector-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.inspector-section h3 {
  margin-bottom: 10px;
}

.layer-control-list {
  display: grid;
  gap: 4px;
}

.layer-control-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}

.layer-control-list input[type="checkbox"] {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--clay);
}

.explorer-selection-empty {
  color: var(--muted);
  margin: 10px 0 0;
}

.explorer-detail {
  display: grid;
  gap: 7px;
  font-size: 13px;
}

.explorer-chip {
  display: inline-block;
  padding: 5px 8px;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.explorer-chip-seeded {
  border-color: var(--gold);
  color: #76510e;
}

.explorer-chip-aligned {
  border-color: var(--olive);
  color: var(--olive);
}

.explorer-drone-card {
  border: 1px solid var(--line);
  margin-bottom: 10px;
  padding: 10px;
  background: #fff8e8;
  display: grid;
  gap: 10px;
}

.explorer-drone-card.is-active,
.explorer-drone-card.is-selected {
  outline: 2px solid rgba(42, 93, 100, 0.45);
}

.explorer-drone-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  flex-wrap: wrap;
  gap: 10px;
}

.explorer-inspector > * {
  min-width: 0;
}

.explorer-drone-card-head p,
.explorer-drone-card-head strong {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.explorer-drone-card-head > div {
  min-width: 0;
}

.explorer-drone-card-head strong {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.explorer-drone-media {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
}

.explorer-drone-media img {
  display: block;
  width: 100%;
  max-height: 120px;
  height: auto;
  object-fit: cover;
  border-radius: 2px;
}

.explorer-drone-control {
  display: grid;
  gap: 8px;
}

.explorer-drone-control .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.explorer-slider {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.explorer-slider em {
  font-style: normal;
  margin-left: 0.4em;
  font-size: 11px;
}

.explorer-slider input[type="range"] {
  width: 100%;
  padding: 0;
}

.explorer-drone-card .drone-toggle {
  display: inline-block;
}

.explorer-drone-card .drone-save,
.explorer-drone-card .drone-reset {
  display: none;
}

.explorer-drone-card.is-adjusting .drone-save,
.explorer-drone-card.is-adjusting .drone-reset {
  display: inline-block;
}

.explorer-drone-card .table-action {
  width: auto;
  min-height: 30px;
}

.explorer-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.explorer-poi-bucket + .explorer-poi-bucket {
  margin-top: 12px;
}

.explorer-poi-bucket h4 {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  text-transform: uppercase;
  font-variant: all-small-caps;
  letter-spacing: 0.08em;
}

.explorer-poi-bucket h4 em {
  color: var(--muted);
  margin-left: auto;
  font-size: 11px;
  font-style: normal;
}

.explorer-poi-rows {
  display: grid;
  gap: 0;
}

.explorer-poi-row {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  min-height: 28px;
  align-items: center;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font-size: 13px;
  cursor: pointer;
}

.explorer-poi-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-poi-row strong {
  margin: 0;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.explorer-poi-row:hover {
  background: rgba(42, 93, 100, 0.06);
}

.explorer-poi-toggle {
  margin-top: 2px;
  border: 0;
  padding: 5px 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
  width: auto;
  cursor: pointer;
}

.explorer-drone-overlay {
  filter: drop-shadow(0 2px 10px rgba(8, 6, 5, 0.35));
  will-change: transform, opacity;
}

.catastro-resolve {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.catastro-resolve button {
  width: auto;
}

.explorer-poi-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(35, 44, 60, 0.95);
  border: 1px solid rgba(253, 250, 246, 0.95);
  color: #fffdf8;
  display: grid;
  place-items: center;
  font-size: 10px;
  line-height: 1;
}

.explorer-pin-crosshair {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #000;
  background: #fff;
  border-radius: 50%;
  border: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.explorer-pin-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

[data-pin-form] {
  display: none;
}

[data-pin-display] {
  border: 1px solid var(--line);
  padding: 12px;
  background: #fffaf1;
}

[data-pin-display] p {
  margin: 0 0 8px;
}

[data-pin-display] p:last-child {
  margin-bottom: 0;
}

.catastro-resolve {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.catastro-resolve button {
  width: auto;
}

.panel {
  margin-top: 18px;
  padding: 28px;
}

.panel-head {
  display: flex;
  gap: 18px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-head p {
  max-width: 680px;
  color: var(--muted);
}

.market-source-count,
.market-source-status {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.market-source-grid {
  display: grid;
  gap: 14px;
}

.market-source-card {
  padding: 20px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.market-source-header {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
}

.market-source-header .eyebrow {
  margin-bottom: 7px;
}

.market-source-header h3 {
  margin-bottom: 0;
}

.market-source-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

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

.market-source-facts dt {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.market-source-facts dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.market-source-card > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.upload-panel {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 520px);
  gap: 24px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf8;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.mismatch-value {
  min-width: 150px;
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

.missing-item {
  padding: 14px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.missing-item span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--clay);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.missing-item h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.missing-item p,
.missing-item strong {
  color: var(--muted);
  line-height: 1.4;
}

.missing-upload {
  display: inline-flex;
  width: fit-content;
  margin-top: 14px;
  padding: 8px 11px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  text-decoration: none;
}

.missing-upload:hover,
.missing-upload:focus-visible {
  border-color: var(--sea);
  background: var(--sea);
}

.missing-item strong {
  display: block;
  color: var(--ink);
  font-weight: 500;
}

.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.frame-card {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.frame-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.frame-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  color: var(--muted);
}

.frame-meta strong,
.frame-meta em {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  text-transform: uppercase;
}

.frame-meta strong {
  max-width: 120px;
  color: var(--ink);
}

.star {
  position: absolute;
  top: 8px;
  right: 8px;
  width: auto;
  min-height: 0;
  padding: 5px 8px;
  border: 1px solid var(--paper);
  background: rgba(25, 24, 22, 0.78);
  font-size: 12px;
}

.star.active {
  background: var(--gold);
  color: var(--ink);
}

.finding-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.analysis-coverage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.analysis-coverage > div {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--line);
}

.analysis-coverage > div span,
.analysis-coverage summary,
.coverage-sources > section > strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.analysis-coverage > div strong {
  font-size: 22px;
}

.analysis-coverage details,
.analysis-coverage > p {
  grid-column: 1 / -1;
}

.analysis-coverage summary {
  width: fit-content;
  color: var(--sea);
  cursor: pointer;
}

.coverage-sources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.coverage-sources section {
  padding: 12px;
  border: 1px solid var(--line);
}

.coverage-sources ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.analysis-coverage > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.finding {
  display: grid;
  grid-template-columns: minmax(220px, 34%) minmax(0, 1fr);
  border: 1px solid var(--line);
  background: #fffdf8;
  overflow: hidden;
}

.finding-copy {
  padding: 20px;
}

.finding-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.finding-evidence {
  position: relative;
  display: grid;
  min-height: 220px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  overflow: hidden;
}

.finding-evidence img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  transition: transform 180ms ease-out;
}

.finding-evidence:hover img,
.finding-evidence:focus-visible img {
  transform: scale(1.02);
}

.finding-evidence > span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  gap: 8px;
  align-items: end;
  justify-content: space-between;
  padding: 36px 12px 12px;
  background: linear-gradient(transparent, rgba(25, 24, 22, 0.9));
}

.finding-evidence strong,
.finding-evidence em {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
}

.finding-evidence strong {
  max-width: 75%;
  overflow-wrap: anywhere;
}

.finding-evidence em {
  flex: none;
  color: #d5cab8;
  text-transform: uppercase;
}

.finding-evidence-missing {
  place-items: end start;
  min-height: 160px;
}

.finding-evidence-missing > span {
  position: static;
  display: grid;
  align-items: start;
  background: none;
}

.finding h3 {
  font-size: 22px;
}

.finding p,
.finding small {
  color: var(--muted);
  line-height: 1.45;
}

.finding p b,
.finding small b {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.finding strong {
  display: block;
  margin-top: 12px;
}

.sev-high,
.sev-critical {
  border-left: 6px solid var(--danger);
}

.sev-medium {
  border-left: 6px solid var(--gold);
}

.report-freshness {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.report-freshness strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.report-freshness span {
  color: var(--muted);
}

.report-freshness.current strong {
  color: var(--olive);
}

.report-freshness.stale strong,
.report-freshness.missing strong {
  color: var(--clay);
}

.report-panel textarea {
  width: 100%;
  padding: 18px;
  background: #12110f;
  color: #f6efe1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.5;
}

.report-actions {
  min-width: min(100%, 460px);
  grid-template-columns: 1fr 1fr 1fr;
}

.report-meta {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
}

.report-provenance {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.report-provenance span,
.report-provenance a {
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--muted);
  font-size: 12px;
}

.report-provenance a {
  color: var(--sea);
}

.report-provenance strong {
  color: var(--ink);
  font-weight: 500;
}

.empty {
  padding: 26px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
}

.empty p {
  margin-bottom: 6px;
  color: var(--ink);
}

.error {
  max-width: 760px;
  margin: 40px auto;
}

@media (max-width: 900px) {
  main {
    width: min(100% - 20px, 1500px);
  }

  .hero,
  .dashboard-head,
  .upload-panel {
    grid-template-columns: 1fr;
  }

  .case-heading,
  .confidence-grid {
    grid-template-columns: 1fr;
  }

  .case-heading {
    gap: 18px;
    margin-top: 42px;
  }

  .case-price {
    font-size: 27px;
  }

  .confidence-grid {
    gap: 26px;
  }

  .next-action {
    grid-template-columns: 1fr 30px;
  }

  .next-action > span,
  .next-action p {
    grid-column: 1;
  }

  .next-action b {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .investigation-trail {
    padding-left: 18px;
    padding-right: 18px;
  }

  .trail-title {
    margin-bottom: 58px;
    text-align: left;
  }

  .trail-axis {
    top: 330px;
    bottom: 90px;
    left: 31px;
  }

  .trail-axis span {
    left: 0;
    transform: none;
  }

  .trail-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 38px;
  }

  .trail-node {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    padding-top: 26px;
  }

  .trail-card {
    grid-column: 2;
    min-height: auto;
  }

  .evidence-card { grid-row: 1; }
  .outcome-card { grid-row: 2; border-top-style: dashed; }
  .evidence-card::after,
  .outcome-card::before { display: none; }

  .trail-finish {
    margin-left: 14px;
  }

  .dossier-divider {
    display: block;
  }

  .dossier-divider p {
    margin-top: 7px;
  }

  .hero {
    min-height: auto;
    padding: 26px;
  }

  .dashboard-head,
  .panel {
    padding: 22px;
  }

  .panel-head,
  .report-meta {
    display: grid;
  }

  .event-row {
    grid-template-columns: 1fr;
  }

  .split,
  .button-row,
  .settings-grid {
    grid-template-columns: 1fr;
  }

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

  .parcel-details,
  .explorer {
    grid-template-columns: 1fr;
  }

  .explorer {
    height: auto;
  }

  .explorer-map {
    height: auto;
    min-height: 420px;
  }

  .explorer-inspector {
    height: auto;
    min-height: 420px;
  }

  .catastro-resolve,
  .catastro-resolve {
    grid-template-columns: 1fr;
  }

  .catastro-resolve button {
    width: 100%;
  }

  .analysis-coverage,
  .coverage-sources,
  .market-source-facts {
    grid-template-columns: 1fr;
  }

  .market-source-header {
    display: grid;
  }

  .finding-evidence,
  .finding-evidence img {
    min-height: 190px;
  }
}

@media (max-width: 560px) {
  .investigation-hero {
    padding: 24px 20px 28px;
  }

  .case-nav span:last-child {
    display: none;
  }

  .case-heading h1 {
    font-size: 48px;
  }

  .case-conclusion {
    font-size: 28px;
  }

  .confidence-dimensions {
    grid-template-columns: 1fr;
  }

  .next-action {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .confidence-track i,
  .trail-row,
  .state-processing .trail-node span {
    animation: none;
  }

  .finding-evidence img {
    transition: none;
  }

  .finding-evidence:hover img,
  .finding-evidence:focus-visible img {
    transform: none;
  }
}

/* ========================================================================== */
/* RASX operator console                                                       */
/* ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #000;
  --bg-raised: #070809;
  --surface: #101214;
  --surface-2: #181b1e;
  --surface-hover: #202428;
  --line: #2f3336;
  --line-strong: #454b51;
  --text: #f2f4f5;
  --muted: #88939c;
  --soft: #b7c0c7;
  --active: #00ba7c;
  --active-strong: #009c69;
  --info: #1d9bf0;
  --warning: #f5c451;
  --danger: #f04452;
  --shadow: 0 18px 54px rgba(0, 0, 0, .48);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --paper: var(--bg);
  --ink: var(--text);
  --panel: var(--surface);
  --olive: var(--active);
  --clay: var(--danger);
  --sea: var(--info);
  --gold: var(--warning);
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(29, 155, 240, .34);
  color: #fff;
}

a,
button,
summary,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

.app-topbar {
  position: sticky;
  z-index: 1000;
  top: 0;
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr) auto;
  align-items: center;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, .94);
  backdrop-filter: blur(18px) saturate(135%);
}

.console-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  height: 100%;
  padding: 0 18px;
  border-right: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.console-brand i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-style: normal;
  font-weight: 800;
}

.console-brand strong {
  font-size: 15px;
  letter-spacing: -.015em;
}

.console-context {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.console-context b { color: #46505a; font-weight: 400; }
.console-context strong {
  overflow: hidden;
  color: var(--soft);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-state {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-right: 20px;
  color: var(--soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
}

.console-state i,
.sidebar-foot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--active);
  box-shadow: 0 0 0 3px rgba(0, 186, 124, .1);
}

.app-shell {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.app-sidebar {
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100vh - 64px);
  padding: 20px 12px 16px;
  border-right: 1px solid var(--line);
  background: var(--bg-raised);
}

.app-sidebar nav { display: grid; gap: 4px; }
.app-sidebar nav p {
  margin: 20px 10px 6px;
  color: #65717b;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.app-sidebar nav p:first-child { margin-top: 0; }

.app-sidebar nav a {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 520;
  text-decoration: none;
  transition: background-color 120ms ease-out, color 120ms ease-out, transform 100ms ease-out;
}

.app-sidebar nav a:hover {
  background: var(--surface);
  color: var(--text);
}

.app-sidebar nav a:active { transform: scale(.98); }
.app-sidebar nav a[aria-current="page"] {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--text);
}
.app-sidebar nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -13px;
  width: 2px;
  background: var(--info);
}
.app-sidebar nav a span {
  display: grid;
  place-items: center;
  width: 18px;
  color: var(--soft);
  font-size: 18px;
}

.sidebar-foot {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 12px 10px 2px;
  color: var(--muted);
  font-size: 11px;
}

.app-main {
  width: min(1440px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 24px clamp(18px, 2.4vw, 34px) 72px;
}

.app-shell:has(.login-shell) {
  grid-template-columns: 1fr;
}
.app-shell:has(.login-shell) .app-sidebar { display: none; }
.app-shell:has(.login-shell) .app-main { width: 100%; }

.auth-bar {
  min-height: 32px;
  margin: 0 0 14px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12px;
  text-transform: none;
}
.auth-bar a { color: var(--soft); border: 0; text-decoration: none; }
.auth-bar > a { display: none; }
.auth-bar:not(:has(form)) { display: none; }
.auth-bar span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  color: var(--text);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
}
h1 { font-size: clamp(32px, 4vw, 54px); font-weight: 670; line-height: 1.02; letter-spacing: -.035em; }
h2 { font-size: 20px; font-weight: 650; line-height: 1.15; letter-spacing: -.018em; }
h3 { font-size: 15px; font-weight: 640; line-height: 1.25; letter-spacing: -.008em; }

.eyebrow,
.card-kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.lede { color: var(--soft); font-size: 16px; line-height: 1.55; }
.back {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.back::before { content: "←"; margin-right: 7px; }
.back:hover { color: var(--text); }

.hero,
.dashboard-head,
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}

.hero {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 480px);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding: clamp(28px, 4vw, 52px);
  background: var(--surface);
}
.hero > div { padding-top: 4px; }
.hero h1 { max-width: 680px; margin-bottom: 16px; font-size: clamp(34px, 4vw, 50px); }
.hero .lede { max-width: 640px; }

.quick-create,
.login-card,
.upload-panel form,
.details-form {
  gap: 12px;
}
.quick-create {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-raised);
}
.quick-create h2 { margin-bottom: 2px; }
.create-disclosure { display: block; padding: 0; }
.create-disclosure > summary {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  padding: 18px 20px;
  border-radius: 9px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 120ms ease-out, transform 100ms ease-out;
}
.create-disclosure > summary::-webkit-details-marker { display: none; }
.create-disclosure > summary:hover { background: var(--surface); }
.create-disclosure > summary:active { transform: scale(.99); }
.create-disclosure > summary span { display: grid; gap: 3px; }
.create-disclosure > summary small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.create-disclosure > summary strong { font-size: 18px; }
.create-disclosure > summary b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--soft);
  font-size: 20px;
  font-weight: 400;
  transition: transform 160ms ease-out, background-color 120ms ease-out;
}
.create-disclosure[open] > summary b { background: var(--surface-2); transform: rotate(45deg); }
.create-disclosure form {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
  border-top: 1px solid var(--line);
}

label { color: var(--soft); font-size: 12px; font-weight: 520; }
input,
textarea,
select,
button,
.button-link {
  border-color: var(--line-strong);
  border-radius: 8px;
  font-family: var(--font-sans);
}
input,
textarea,
select {
  min-height: 42px;
  padding: 9px 11px;
  background: var(--bg);
  color: var(--text);
  caret-color: var(--info);
  transition: border-color 120ms ease-out, background-color 120ms ease-out, box-shadow 120ms ease-out;
}
input:hover,
textarea:hover,
select:hover { border-color: #56616b; }
input:focus,
textarea:focus,
select:focus {
  border-color: var(--info);
  background: #050708;
  box-shadow: 0 0 0 3px rgba(29, 155, 240, .12);
}
input::placeholder,
textarea::placeholder { color: #59636c; }

button,
.button-link {
  min-height: 42px;
  border-color: #d7dce0;
  background: var(--text);
  color: #050505;
  font-weight: 650;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, transform 100ms ease-out;
}
button:hover,
.button-link:hover { border-color: #fff; background: #fff; color: #000; }
button:active,
.button-link:active,
.missing-upload:active,
.property-card:active,
.next-action:active { transform: scale(.985); }
.danger { border-color: rgba(240, 68, 82, .55); background: rgba(240, 68, 82, .12); color: #ff8b95; }
.danger:hover { border-color: var(--danger); background: var(--danger); color: #fff; }
.table-action {
  min-height: 32px;
  padding: 5px 10px;
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
}
.table-action:hover { border-color: #626c75; background: var(--surface-hover); color: var(--text); }

.property-grid {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}
.property-card {
  grid-template-columns: minmax(180px, .55fr) minmax(260px, 1.4fr) auto auto;
  gap: 22px;
  align-items: center;
  min-height: 112px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, transform 100ms ease-out;
}
.property-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: none;
}
.property-card h2 { margin: 0; font-size: 17px; }
.property-card p {
  display: -webkit-box;
  max-width: 620px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.property-card > strong {
  color: var(--soft);
  font-size: 12px;
  font-weight: 560;
  text-align: right;
}
.card-stats { align-self: center; white-space: nowrap; }
.card-stats span,
.risk-stamp,
.finding-tags span {
  border-color: var(--line);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--muted);
}

.dashboard-head {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  align-items: center;
  padding: 24px;
  margin-bottom: 12px;
}
.dashboard-head h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 44px); }
.dashboard-head p { margin-bottom: 0; color: var(--muted); }
.risk-stamp {
  padding: 14px 16px;
  border-radius: 9px;
  background: var(--bg-raised);
  color: var(--text);
}
.risk-stamp span { color: var(--muted); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; }

.panel { margin-top: 12px; padding: 20px; }
.panel-head { align-items: center; margin-bottom: 16px; }
.panel-head h2 { margin-bottom: 5px; }
.panel-head p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.panel-head > span,
.panel-head > div + span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.settings-grid { gap: 16px; }
.metric-list { gap: 0; }
.metric-list span {
  min-height: 42px;
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
}
.metric-list strong { color: var(--text); font-family: var(--font-mono); font-size: 12px; font-weight: 560; }

.tool-pill,
.parcel-status,
.market-source-count,
.market-source-status,
.finding-tags span,
.explorer-chip {
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .035em;
}
.tool-pill.ok,
.status-succeeded span,
.status-ready span,
.parcel-status.confirmed,
.explorer-chip-aligned { border-color: rgba(0, 186, 124, .45); color: #3dd99d; }
.tool-pill.missing,
.status-failed span { border-color: rgba(240, 68, 82, .48); color: #ff7d88; }
.status-running span,
.status-processing span,
.status-uploaded span { border-color: rgba(245, 196, 81, .46); color: var(--warning); }
.parcel-status.candidate,
.explorer-chip-seeded { border-color: rgba(245, 196, 81, .46); color: var(--warning); }

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-raised);
  scrollbar-color: var(--line-strong) var(--bg-raised);
}
table { background: transparent; font-size: 13px; }
th,
td { padding: 11px 12px; border-color: var(--line); }
th {
  background: #0b0d0f;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
tbody tr { transition: background-color 120ms ease-out; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
td { color: var(--soft); }
.muted-cell,
.file-event span,
.file-event p,
.file-event small { color: var(--muted); }
.artifact-link { border: 0; color: #6ebcf1; font-weight: 540; }
.artifact-link:hover { color: #a5d9fb; text-decoration: underline; text-underline-offset: 3px; }

.market-source-grid { gap: 8px; }
.market-source-card,
.missing-item,
.analysis-coverage,
.event-row,
.frame-card,
[data-pin-display],
.explorer-drone-card {
  border-color: var(--line);
  border-radius: 9px;
  background: var(--bg-raised);
}
.market-source-card { padding: 18px; }
.market-source-facts { gap: 8px; margin: 14px 0; }
.market-source-facts div { border-color: var(--line); border-radius: 7px; background: var(--surface); }
.market-source-facts dt { color: var(--muted); font-family: var(--font-mono); }
.market-source-facts dd { color: var(--soft); }

.upload-panel { grid-template-columns: minmax(0, 1fr) minmax(320px, 520px); }
.upload-panel form { padding-left: 20px; border-left: 1px solid var(--line); }
.empty {
  padding: 22px;
  border-color: var(--line-strong);
  border-radius: 9px;
  background: var(--bg-raised);
  color: var(--muted);
}
.empty p { color: var(--text); }

.event-list { gap: 6px; }
.event-row {
  grid-template-columns: 92px 150px minmax(0, 1fr) 190px;
  min-height: 54px;
  padding: 9px 11px;
}
.event-row span { border-radius: 999px; font-size: 10px; }
.event-row p,
.event-row small { font-size: 12px; }
.disclosure-action { color: var(--info); }
.disclosure-panel > summary:focus-visible { outline-color: var(--info); }

.missing-grid { gap: 8px; }
.missing-item { padding: 16px; border-left-width: 3px; }
.missing-item h3 { font-size: 15px; }
.missing-item p,
.missing-item strong { font-size: 13px; }
.missing-item > span { color: var(--muted); font-family: var(--font-mono); }
.missing-upload {
  min-height: 36px;
  padding: 8px 11px;
  border-color: var(--line-strong);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
}
.missing-upload:hover,
.missing-upload:focus-visible { border-color: var(--info); background: rgba(29, 155, 240, .12); color: #9dd7ff; }
.sev-high,
.sev-critical { border-left-color: var(--danger); }
.sev-medium { border-left-color: var(--warning); }

.frame-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.frame-card { overflow: hidden; }
.frame-meta { color: var(--muted); }
.frame-meta strong { color: var(--soft); }
.star { border-color: rgba(255,255,255,.25); border-radius: 7px; background: rgba(0,0,0,.78); color: #fff; }
.star.active { background: var(--warning); color: #17130a; }

.analysis-coverage { padding: 12px; }
.analysis-coverage > div { border-color: var(--line); border-radius: 7px; background: var(--surface); }
.analysis-coverage summary { color: var(--info); }
.finding-grid { gap: 8px; }
.finding {
  border-color: var(--line);
  border-radius: 9px;
  background: var(--bg-raised);
}
.finding-evidence { border-color: var(--line); background: #050505; }
.finding-copy p,
.finding-copy small { color: var(--muted); }
.finding-evidence-missing > span { background: var(--surface); color: var(--muted); }

.explorer {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.explorer-map { border: 0; background: #141719; }
.explorer-inspector {
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--bg-raised);
  scrollbar-color: var(--line-strong) var(--bg-raised);
}
.inspector-section { border-color: var(--line); }
.layer-control-list label { color: var(--soft); }
.layer-control-list input[type="checkbox"] { accent-color: var(--info); }
.explorer-drone-card.is-active,
.explorer-drone-card.is-selected { outline-color: rgba(29, 155, 240, .65); }
.explorer-poi-row { border-color: var(--line); color: var(--soft); }
.explorer-poi-row:hover { background: var(--surface-hover); }
.explorer-poi-row strong { color: var(--text); }
.explorer-poi-toggle { color: var(--info); }
.parcel-note,
.explorer-pin-hint,
.explorer-empty,
.explorer-selection-empty { color: var(--muted); }
.leaflet-control-layers,
.leaflet-bar a {
  border-color: var(--line) !important;
  background: var(--surface-2) !important;
  color: var(--text) !important;
}
.leaflet-control-attribution { background: rgba(0,0,0,.78) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: #85c9f7 !important; }
.leaflet-popup-content-wrapper {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow);
}
.leaflet-popup-tip { background: var(--surface-2); }
.leaflet-popup-close-button { color: var(--soft) !important; }

.report-freshness {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--bg-raised);
}
.report-freshness.current strong { color: var(--active); }
.report-freshness.stale strong,
.report-freshness.missing strong { color: var(--warning); }
.report-panel textarea { border-radius: 9px; background: #050607; color: #d9e0e5; }
.report-provenance span,
.report-provenance a { border-color: var(--line); border-radius: 6px; background: var(--bg-raised); color: var(--muted); }
.report-provenance a { color: var(--info); }
.report-provenance strong { color: var(--text); }

.login-shell { min-height: calc(100vh - 112px); }
.auth-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
  width: min(980px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 560px;
  padding: clamp(32px, 6vw, 72px);
  border-right: 1px solid var(--line);
}
.auth-intro h1 {
  max-width: 520px;
  margin-bottom: 18px;
  font-size: clamp(38px, 5vw, 62px);
}
.auth-intro > p:not(.eyebrow) { max-width: 540px; color: var(--soft); font-size: 16px; }
.auth-intro dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 38px 0 0; }
.auth-intro dl div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raised); }
.auth-intro dt { color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.auth-intro dd { margin: 6px 0 0; color: var(--text); font-size: 13px; font-weight: 620; }
.login-card {
  align-self: center;
  width: auto;
  margin: 28px;
  padding: 26px;
  box-shadow: none;
}
.login-card h2 { margin-bottom: 6px; font-size: 25px; }
.login-card label small { color: var(--muted); font-size: 11px; font-weight: 450; }
.auth-lede { margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.auth-error {
  margin: 0 0 4px;
  padding: 10px 12px;
  border: 1px solid rgba(240, 68, 82, .42);
  border-radius: 8px;
  background: rgba(240, 68, 82, .09);
  color: #ff9ba4;
  font-size: 12px;
}
.auth-alternate { margin: 8px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-alternate a { color: #78bfea; text-decoration: none; }
.auth-alternate a:hover { color: #b8e1fb; text-decoration: underline; text-underline-offset: 3px; }

/* Investigation command surface */
.investigation-hero {
  overflow: visible;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}
.investigation-hero::after { display: none; }
.case-nav,
.case-meta,
.confidence-score > span,
.confidence-score > p,
.confidence-dimensions,
.next-action > span,
.trail-kicker,
.trail-card-meta,
.trail-axis,
.trail-finish,
.dossier-divider span { font-family: var(--font-mono); }
.case-nav {
  padding-bottom: 12px;
  border-color: var(--line);
  color: var(--muted);
  font-size: 10px;
}
.case-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-top: 22px;
}
.case-location { margin-bottom: 7px; color: var(--muted); font-size: 13px; font-style: normal; }
.case-heading h1 {
  max-width: 900px;
  font-family: var(--font-sans);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 680;
  letter-spacing: -.035em;
  line-height: 1.02;
}
.case-price { margin: 0; font-family: var(--font-mono); font-size: clamp(22px, 2.4vw, 32px); font-weight: 560; }
.case-meta { margin-top: 16px; color: var(--muted); font-size: 10px; }
.case-conclusion {
  max-width: 900px;
  margin: 24px 0 0;
  color: var(--soft);
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 520;
  line-height: 1.28;
  letter-spacing: -.015em;
}
.confidence-grid {
  grid-template-columns: minmax(180px, .48fr) minmax(440px, 1.52fr);
  gap: 34px;
  margin-top: 24px;
  padding-top: 20px;
  border-color: var(--line);
}
.confidence-score > span,
.confidence-score > p { color: var(--muted); font-size: 10px; }
.confidence-score strong { margin: 8px 0 5px; font-size: 48px; font-variant-numeric: tabular-nums; }
.confidence-score small { color: var(--muted); font-size: 17px; }
.confidence-track { margin: 12px 0 10px; background: var(--line); }
.confidence-track i { background: var(--info); }
.confidence-dimensions { gap: 0 28px; }
.confidence-dimensions div { min-height: 42px; border-color: var(--line); font-size: 11px; }
.confidence-dimensions dt { color: var(--muted); }
.confidence-dimensions .good { color: #3dd99d; }
.confidence-dimensions .warn { color: #ff7d88; }
.confidence-dimensions .partial { color: var(--warning); }
.confidence-dimensions .open { color: var(--muted); }
.next-action {
  grid-template-columns: minmax(120px, .35fr) minmax(190px, .75fr) 1.4fr 24px;
  gap: 18px;
  margin-top: 20px;
  padding: 14px 16px;
  border-color: rgba(29, 155, 240, .42);
  border-radius: 9px;
  background: rgba(29, 155, 240, .1);
  color: var(--text);
}
.next-action:hover { border-color: var(--info); background: rgba(29, 155, 240, .16); transform: none; }
.next-action > span { color: #78bfea; }
.next-action strong { font-size: 14px; }
.next-action p { color: var(--muted); font-size: 12px; }
.next-action b { color: var(--info); font-size: 20px; }

.investigation-trail {
  margin-top: 12px;
  padding: 28px 24px 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.trail-title {
  width: auto;
  margin: 0 0 34px;
  text-align: left;
}
.trail-title h2 {
  margin-bottom: 7px;
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 660;
  letter-spacing: -.02em;
}
.trail-title > p:last-child { max-width: 720px; margin: 0; color: var(--muted); font-size: 13px; }
.trail-axis {
  top: 142px;
  bottom: 68px;
  background: var(--line-strong);
}
.trail-axis span {
  top: -25px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
}
.trail-row {
  grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
  max-width: none;
  min-height: 142px;
  margin-bottom: 8px;
}
.trail-card {
  min-height: 118px;
  padding: 16px 18px;
  border-color: var(--line);
  border-radius: 9px;
  background: var(--bg-raised);
}
.trail-card:hover { border-color: var(--line-strong); background: #0c0e10; transform: none; }
.evidence-card::after,
.outcome-card::before { width: 29px; border-color: var(--line-strong); }
.evidence-card::after { right: -30px; }
.outcome-card::before { left: -30px; }
.trail-card h3 { margin-bottom: 6px; font-family: var(--font-sans); font-size: 15px; font-weight: 650; }
.trail-card > p:not(.trail-kicker) { margin-bottom: 11px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.trail-kicker { margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.trail-card-meta { color: #69747d; font-size: 9px; }
.trail-card > a { margin-top: 10px; border: 0; color: var(--info); font-size: 12px; }
.trail-node span {
  width: 13px;
  height: 13px;
  border: 3px solid var(--surface);
  outline-color: var(--line-strong);
  background: var(--active);
}
.state-empty .trail-node span { background: var(--bg); }
.state-processing .trail-node span { background: var(--warning); }
.state-warning .trail-node span { background: var(--danger); outline-color: var(--danger); }
.state-locked .trail-node span { background: #3d4348; outline-color: #596169; }
.state-locked .trail-card { opacity: .56; }
.state-warning .trail-card { border-color: rgba(240, 68, 82, .4); }
.trail-finish {
  width: min(420px, calc(100% - 30px));
  margin-top: 30px;
  padding: 14px;
  border-color: var(--line);
  border-radius: 9px;
  background: var(--bg-raised);
}
.trail-finish span { border-color: var(--surface); background: var(--text); outline-color: var(--text); }
.trail-finish strong { font-size: 10px; }
.trail-finish p { color: var(--muted); font-family: var(--font-sans); font-size: 12px; }
.dossier-divider { margin-top: 32px; border-color: var(--line-strong); }
.dossier-divider p { color: var(--muted); font-size: 12px; }

@media (max-width: 1050px) {
  .app-topbar { grid-template-columns: 74px minmax(0, 1fr) auto; }
  .console-brand { justify-content: center; padding: 0; }
  .console-brand strong { display: none; }
  .app-shell { grid-template-columns: 74px minmax(0, 1fr); }
  .app-sidebar { align-items: center; padding: 18px 9px; }
  .app-sidebar nav { width: 100%; }
  .app-sidebar nav p,
  .app-sidebar nav a:not([aria-current="page"])::after,
  .app-sidebar nav a { font-size: 0; }
  .app-sidebar nav a { justify-content: center; padding: 0; }
  .app-sidebar nav a span { font-size: 19px; }
  .app-sidebar nav a[aria-current="page"]::before { left: -10px; }
  .sidebar-foot span { display: none; }
  .property-card { grid-template-columns: minmax(150px, .6fr) minmax(220px, 1.4fr) auto; }
  .property-card > strong { display: none; }
}

@media (max-width: 760px) {
  .app-topbar { grid-template-columns: 58px minmax(0, 1fr) auto; height: 56px; }
  .console-brand { border-right: 0; }
  .console-brand i { width: 28px; height: 28px; }
  .console-context { padding: 0 8px; }
  .console-context span,
  .console-context b { display: none; }
  .console-state { margin-right: 12px; font-size: 0; }
  .console-state i { width: 8px; height: 8px; }
  .app-shell { display: block; min-height: calc(100vh - 56px); }
  .app-sidebar { display: none; }
  .app-main { padding: 14px 10px 56px; }
  .login-shell { min-height: calc(100vh - 84px); }
  .auth-stage { grid-template-columns: 1fr; }
  .auth-intro { display: none; }
  .login-card { margin: 10px; padding: 22px; }
  .auth-bar { margin-bottom: 8px; }
  .hero,
  .dashboard-head,
  .settings-grid,
  .upload-panel,
  .case-heading,
  .confidence-grid { grid-template-columns: 1fr; }
  .hero { gap: 24px; padding: 20px; }
  .hero h1 { font-size: 36px; }
  .quick-create { padding: 16px; }
  .property-card {
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    min-height: 0;
    padding: 15px;
  }
  .property-card .card-kicker,
  .property-card p { grid-column: 1 / -1; }
  .property-card .card-stats { grid-column: 2; grid-row: 2; }
  .dashboard-head,
  .panel,
  .investigation-hero,
  .investigation-trail { padding: 16px; border-radius: 10px; }
  .panel-head { align-items: start; }
  .upload-panel form { padding: 16px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .event-row { grid-template-columns: 1fr; }
  .explorer { height: auto; }
  .explorer-inspector { border-top: 1px solid var(--line); border-left: 0; }
  .case-heading { gap: 10px; margin-top: 18px; }
  .case-heading h1 { font-size: 30px; }
  .case-price { font-size: 20px; }
  .case-conclusion { margin-top: 20px; font-size: 18px; }
  .confidence-grid { gap: 18px; margin-top: 20px; }
  .confidence-dimensions { grid-template-columns: 1fr; }
  .next-action { grid-template-columns: 1fr 24px; }
  .next-action > span,
  .next-action p { grid-column: 1; }
  .next-action b { grid-column: 2; grid-row: 1 / span 3; }
  .trail-title { margin-bottom: 48px; }
  .trail-axis { top: 172px; bottom: 64px; left: 28px; }
  .trail-axis span { left: 0; transform: none; }
  .trail-row { grid-template-columns: 24px minmax(0, 1fr); gap: 12px; margin-bottom: 24px; }
  .trail-node { grid-column: 1; grid-row: 1 / span 2; align-self: start; padding-top: 20px; }
  .trail-card { grid-column: 2; min-height: 0; }
  .evidence-card { grid-row: 1; }
  .outcome-card { grid-row: 2; border-top-style: dashed; }
  .evidence-card::after,
  .outcome-card::before { display: none; }
  .trail-finish { margin-left: 8px; }
  .market-source-facts { grid-template-columns: 1fr; }
  .report-actions { min-width: 0; grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .case-nav span:last-child { display: block; }
  .property-card .card-stats { display: none; }
  .property-card { grid-template-columns: 1fr; }
  .split,
  .button-row { grid-template-columns: 1fr; }
  .panel-head { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .property-card,
  .trail-card,
  .next-action { transform: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .app-topbar { background: #000; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: #68727b; --line-strong: #88939c; --muted: #b2bcc4; }
  .app-topbar,
  .app-sidebar,
  .panel,
  .hero,
  .investigation-hero,
  .investigation-trail { border-color: var(--line-strong); }
}

/* Public marketing placeholder */
.marketing-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 76% 24%, rgba(29, 155, 240, .13), transparent 28rem),
    radial-gradient(circle at 14% 82%, rgba(0, 186, 124, .06), transparent 24rem),
    #000;
  color: var(--text);
  font-family: var(--font-sans);
}
.marketing-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}
.marketing-nav {
  width: min(1240px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.11);
}
.marketing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
  letter-spacing: -.01em;
}
.marketing-brand i {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}
.marketing-nav nav,
.marketing-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.marketing-login,
.marketing-signup {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, transform 100ms ease-out;
}
.marketing-login:hover { border-color: #69747d; background: rgba(255,255,255,.055); }
.marketing-signup { border-color: #f7f9f9; background: #f7f9f9; color: #050505; }
.marketing-signup:hover { border-color: #d9e0e4; background: #d9e0e4; }
.marketing-login:active,
.marketing-signup:active { transform: scale(.98); }
.marketing-main {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 88px 0 64px;
}
.marketing-hero {
  min-height: 610px;
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(500px, 1.12fr);
  gap: clamp(48px, 7vw, 104px);
  align-items: center;
}
.marketing-copy { padding-bottom: 22px; }
.marketing-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 23px;
  color: #a5afb7;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.marketing-eyebrow span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--active);
  box-shadow: 0 0 0 4px rgba(0, 186, 124, .12);
}
.marketing-copy h1 {
  max-width: 650px;
  margin: 0 0 25px;
  font-family: var(--font-sans);
  font-size: clamp(50px, 6vw, 78px);
  font-weight: 680;
  line-height: .99;
  letter-spacing: -.055em;
}
.marketing-lede {
  max-width: 590px;
  margin: 0 0 31px;
  color: #98a3ab;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.55;
  letter-spacing: -.012em;
}
.marketing-actions .marketing-signup { min-height: 46px; padding: 0 20px; gap: 28px; }
.marketing-actions .marketing-login { min-height: 46px; }
.marketing-note { margin: 17px 0 0; color: #59636b; font-size: 11px; }
.marketing-preview {
  position: relative;
  padding: 24px;
  border: 1px solid #31373c;
  border-radius: 13px;
  background: rgba(8, 9, 10, .91);
  box-shadow: 0 34px 90px rgba(0,0,0,.58), 0 0 0 1px rgba(255,255,255,.025) inset;
}
.marketing-preview::before {
  position: absolute;
  inset: -1px -1px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(120,191,234,.7), transparent);
  content: "";
}
.preview-head { display: flex; justify-content: space-between; gap: 20px; }
.preview-head div { display: grid; gap: 7px; }
.preview-head small,
.preview-trail small,
.preview-next small {
  color: #66717a;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .11em;
}
.preview-head strong { font-size: 17px; letter-spacing: -.02em; }
.preview-head > span {
  align-self: start;
  padding: 6px 8px;
  border: 1px solid rgba(29,155,240,.36);
  border-radius: 6px;
  background: rgba(29,155,240,.09);
  color: #78bfea;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}
.preview-conclusion { max-width: 450px; margin: 20px 0; color: #aab4bb; font-size: 15px; line-height: 1.45; }
.preview-next {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 14px;
  padding: 13px 14px;
  border: 1px solid rgba(29,155,240,.3);
  border-radius: 8px;
  background: rgba(29,155,240,.075);
}
.preview-next small { grid-column: 1; color: #78bfea; }
.preview-next strong { grid-column: 1; font-size: 12px; }
.preview-next > span { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--info); }
.preview-trail { position: relative; display: grid; gap: 0; margin-top: 23px; }
.preview-trail::before {
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 50%;
  width: 1px;
  background: #333a40;
  content: "";
}
.preview-trail > div {
  position: relative;
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr 37px 1fr;
  align-items: center;
}
.preview-trail > div > span { display: grid; gap: 5px; }
.preview-trail > div > span:first-child { padding-right: 18px; text-align: right; }
.preview-trail > div > span:last-child { padding-left: 18px; }
.preview-trail strong { color: #cbd2d7; font-size: 11px; font-weight: 570; }
.preview-trail i {
  z-index: 1;
  width: 11px;
  height: 11px;
  justify-self: center;
  border: 3px solid #08090a;
  border-radius: 50%;
  outline: 1px solid #5b656d;
  background: #08090a;
}
.preview-trail i.complete { background: var(--active); }
.preview-trail i.warning { background: var(--danger); outline-color: var(--danger); }
.preview-trail i.processing { background: var(--warning); }
.marketing-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 76px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.marketing-principles p { min-height: 170px; display: grid; align-content: center; gap: 9px; margin: 0; padding: 26px 32px; }
.marketing-principles p + p { border-left: 1px solid var(--line); }
.marketing-principles small { color: #66717a; font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; }
.marketing-principles strong { font-size: 15px; }
.marketing-principles span { color: #7f8991; font-size: 12px; line-height: 1.55; }
.marketing-footer {
  width: min(1240px, calc(100% - 40px));
  min-height: 90px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #59636b;
  font-size: 11px;
}
.marketing-footer span:first-child { color: #9aa4ab; font-weight: 650; }

@media (max-width: 960px) {
  .marketing-main { padding-top: 62px; }
  .marketing-hero { grid-template-columns: 1fr; gap: 54px; }
  .marketing-copy { max-width: 700px; padding: 0; }
  .marketing-preview { width: min(680px, 100%); }
}

@media (max-width: 640px) {
  .marketing-nav,
  .marketing-main,
  .marketing-footer { width: min(100% - 24px, 1240px); }
  .marketing-nav { min-height: 64px; }
  .marketing-brand strong { display: none; }
  .marketing-nav nav { gap: 6px; }
  .marketing-nav .marketing-login,
  .marketing-nav .marketing-signup { min-height: 38px; padding: 0 12px; }
  .marketing-main { padding: 50px 0 36px; }
  .marketing-hero { min-height: 0; gap: 46px; }
  .marketing-copy h1 { font-size: clamp(43px, 13vw, 60px); }
  .marketing-lede { font-size: 16px; }
  .marketing-preview { padding: 17px 14px; }
  .preview-head { display: grid; }
  .preview-head > span { justify-self: start; }
  .preview-trail > div { grid-template-columns: 1fr 25px 1fr; }
  .preview-trail > div > span:first-child { padding-right: 9px; }
  .preview-trail > div > span:last-child { padding-left: 9px; }
  .preview-trail strong { font-size: 10px; }
  .marketing-principles { grid-template-columns: 1fr; margin-top: 58px; }
  .marketing-principles p { min-height: 132px; padding: 24px 8px; }
  .marketing-principles p + p { border-top: 1px solid var(--line); border-left: 0; }
  .marketing-footer { align-items: start; flex-direction: column; justify-content: center; gap: 6px; }
}

@media (prefers-reduced-transparency: reduce) {
  .marketing-preview { background: #08090a; }
}
