:root {
  color-scheme: light;
  --ink: #102720;
  --muted: #5d6e68;
  --paper: #f6f8f5;
  --surface: #ffffff;
  --line: #dce4df;
  --green: #0b6b4f;
  --green-dark: #074d3a;
  --green-pale: #e6f4ee;
  --amber: #a65e0a;
  --red: #a33b32;
  --shadow: 0 18px 55px rgba(25, 50, 42, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); min-height: 100vh; }
button, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { height: 68px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); }
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 11px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--green); border-radius: 9px 9px 9px 2px; }
.status { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.status-dot, .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #18a473; box-shadow: 0 0 0 4px rgba(24,164,115,.12); display: inline-block; }
.status.local .status-dot { background: #7b8984; box-shadow: 0 0 0 4px rgba(93,110,104,.12); }
.tabs { display: flex; gap: 26px; padding: 0 clamp(20px, 5vw, 72px); height: 52px; align-items: end; border-bottom: 1px solid var(--line); background: var(--surface); }
.tab { border: 0; border-bottom: 3px solid transparent; padding: 0 2px 13px; color: var(--muted); background: transparent; font-weight: 650; }
.tab.active { color: var(--green); border-color: var(--green); }
.view { display: none; }
.view.active { display: block; }
.workspace { width: min(1380px, calc(100% - 40px)); margin: 42px auto; display: grid; grid-template-columns: minmax(340px, .86fr) minmax(420px, 1.14fr); gap: 28px; align-items: stretch; }
.report-panel, .result-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(24px, 3vw, 42px); box-shadow: var(--shadow); min-height: 600px; }
.eyebrow, .result-source { margin: 0 0 12px; color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.035em; line-height: 1.08; }
h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3.6rem); }
.intro { color: var(--muted); line-height: 1.6; max-width: 600px; }
form { margin-top: 30px; }
.review-back { padding: 9px 0; border: 0; background: transparent; color: var(--green); font-weight: 750; }
.review-back:hover, .review-back:focus-visible { text-decoration: underline; }
label, legend { font-weight: 700; font-size: .9rem; }
textarea { margin-top: 9px; width: 100%; resize: vertical; min-height: 170px; padding: 17px; border: 1px solid #bac9c1; border-radius: 10px; color: var(--ink); background: #fcfdfc; font-size: 1rem; line-height: 1.55; }
textarea:focus { outline: 3px solid rgba(11,107,79,.15); border-color: var(--green); }
.review-context { align-self: start; padding: 8px 10px 8px 2px; }
.review-context h1 { margin-top: 28px; font-size: clamp(1.8rem, 3vw, 2.7rem); }
.review-context p { max-width: 380px; color: var(--muted); line-height: 1.65; }
.workspace.review-mode { grid-template-columns: minmax(260px, .62fr) minmax(520px, 1.38fr); }
.field-meta { min-height: 24px; display: flex; justify-content: space-between; gap: 16px; padding-top: 5px; color: var(--muted); font-size: .78rem; }
.field-error { color: var(--red); }
.examples { border: 0; padding: 0; margin: 19px 0 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { padding: 8px 11px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; font-size: .78rem; }
.chip:hover, .chip:focus-visible { border-color: var(--green); color: var(--green); }
.danger-chip { color: var(--red); }
.primary-button { width: 100%; min-height: 52px; border: 0; border-radius: 10px; background: var(--green); color: white; font-weight: 750; display: flex; align-items: center; justify-content: center; gap: 10px; }
.primary-button:hover { background: var(--green-dark); }
.primary-button:disabled { cursor: wait; opacity: .72; }
.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
.primary-button.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-panel { position: relative; overflow: hidden; background: linear-gradient(145deg, #fff 0%, #f4f8f5 100%); }
.empty-result, .loading-result, .error-result { height: 100%; min-height: 510px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.empty-result h2, .loading-result h2, .error-result h2 { color: var(--ink); font-size: clamp(1.7rem, 3vw, 2.7rem); }
.empty-result p, .loading-result p, .error-result p { max-width: 480px; line-height: 1.6; }
.empty-glyph { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 50%; background: var(--green-pale); color: var(--green); font-size: 1.8rem; }
.pulse-ring { width: 58px; height: 58px; margin-bottom: 28px; border: 3px solid var(--green); border-radius: 50%; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(11,107,79,.3); } 100% { box-shadow: 0 0 0 22px rgba(11,107,79,0); } }
.error-label { color: var(--red); }
.request-reference { font-family: ui-monospace, monospace; font-size: .76rem; }
.decision-result { padding-top: 4px; }
.result-kicker { margin: 0 0 9px; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.understood-section { padding: 24px 0; border-top: 1px solid var(--line); }
.understood-section h3 { margin: 0; color: var(--ink); font-size: clamp(1.35rem, 2.5vw, 1.9rem); letter-spacing: -.025em; }
.understood-section > p:last-child { margin: 9px 0 0; color: var(--muted); line-height: 1.55; }
.next-section { padding: 24px 0 0; border-top: 1px solid var(--line); }
.decision-subheadline { margin: 12px 0 0; color: var(--green); font-size: 1.1rem; font-weight: 700; line-height: 1.5; }
.why-section { margin: 24px 0 28px; padding: 19px 21px; background: var(--green-pale); border-left: 4px solid var(--green); border-radius: 4px 10px 10px 4px; }
.decision-explanation { max-width: 680px; margin: 0; font-size: 1rem; line-height: 1.6; color: #354a43; }
.original-report { margin: 18px 0 24px; padding: 18px 20px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.original-report span { color: var(--muted); text-transform: uppercase; font-size: .68rem; font-weight: 800; letter-spacing: .08em; }
.original-report p { margin: 9px 0 8px; color: var(--ink); line-height: 1.55; }
.original-report time { color: var(--muted); font-size: .78rem; }
.trace-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 12px; background: white; }
.trace-grid > div { padding: 18px; }
.trace-grid > div + div { border-left: 1px solid var(--line); }
.trace-grid span { color: var(--muted); text-transform: uppercase; font-size: .68rem; font-weight: 800; letter-spacing: .08em; }
.trace-grid p { margin: 8px 0 0; font-size: .88rem; line-height: 1.45; }
details { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 17px; }
summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.technical-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 18px; }
.technical-grid div { min-width: 0; }
dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
dd { margin: 4px 0 0; font: .78rem/1.4 ui-monospace, monospace; overflow-wrap: anywhere; }
.landlord-shell { width: min(1100px, calc(100% - 40px)); margin: 42px auto; }
.landlord-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.secondary-button { padding: 10px 15px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
.local-note { color: var(--muted); }
.landlord-intro { margin: 12px 0 0; color: var(--muted); font-size: 1.05rem; }
.history-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 28px 0; }
.history-summary div { padding: 22px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.history-summary strong, .history-summary span { display: block; }
.history-summary strong { font-size: 2rem; }
.history-summary span { color: var(--muted); margin-top: 5px; }
.history-empty { padding: 50px; text-align: center; color: var(--muted); border: 1px dashed #bac9c1; border-radius: 12px; }
.history-empty strong { display: block; color: var(--ink); font-size: 1.15rem; }
.history-empty p { max-width: 570px; margin: 9px auto 0; line-height: 1.55; }
.history-item { display: grid; grid-template-columns: 160px 1fr auto auto; gap: 18px; align-items: center; padding: 18px 20px; margin-bottom: 10px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.history-item time, .history-item small { color: var(--muted); }
.history-item p { margin: 4px 0; }
.history-decision { font-weight: 800; color: var(--green); }
.history-action { padding: 7px 0; border: 0; background: transparent; color: var(--green); font-weight: 700; white-space: nowrap; }
.history-action:hover, .history-action:focus-visible { text-decoration: underline; }
.history-action:disabled { color: var(--muted); cursor: default; font-weight: 500; text-decoration: none; }
.evidence-link { display: inline-block; margin-top: 24px; color: var(--green); font-weight: 700; }
.evidence-page { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 60px; }
.back-link { color: var(--green); font-weight: 700; text-decoration: none; }
.back-link:hover, .back-link:focus-visible { text-decoration: underline; }
.evidence-hero { padding: 64px 0 36px; max-width: 820px; }
.evidence-hero h1 { max-width: 760px; }
.evidence-lead { max-width: 680px; margin: 20px 0 0; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.evidence-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.evidence-metrics article { min-height: 150px; padding: 25px; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(25,50,42,.06); }
.evidence-metrics strong { color: var(--green-dark); font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.05em; }
.evidence-metrics span { color: var(--muted); line-height: 1.4; font-weight: 650; }
.evidence-qualification { margin-top: 18px; padding: 22px 25px; background: var(--green-pale); border-left: 4px solid var(--green); border-radius: 4px 10px 10px 4px; }
.evidence-qualification p { margin: 7px 0 0; color: #354a43; line-height: 1.6; }
.hardening-section { margin-top: 52px; padding: 34px; display: grid; grid-template-columns: minmax(230px, .65fr) 1.35fr; gap: 44px; align-items: center; background: var(--ink); color: white; border-radius: 16px; }
.hardening-section .eyebrow { color: #84d9ba; }
.hardening-section h2 { font-size: clamp(2.7rem, 6vw, 4.8rem); }
.hardening-label { margin: 8px 0 0; color: #c7d6d1; font-weight: 650; }
.hardening-section > p { margin: 0; color: #e5ece9; font-size: 1.05rem; line-height: 1.7; }
.evidence-footer { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
[hidden] { display: none !important; }

@media (max-width: 850px) {
  .workspace { grid-template-columns: 1fr; margin-top: 24px; }
  .workspace.review-mode { grid-template-columns: 1fr; }
  .review-context { padding: 4px 4px 0; }
  .review-context h1 { margin-top: 18px; }
  .report-panel, .result-panel { min-height: auto; }
  .empty-result, .loading-result, .error-result { min-height: 360px; }
  .trace-grid { grid-template-columns: 1fr; }
  .trace-grid > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .evidence-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .topbar { height: auto; padding-top: 14px; padding-bottom: 14px; align-items: flex-start; }
  .brand > span:last-child { max-width: 140px; }
  .status { max-width: 120px; text-align: right; justify-content: flex-end; }
  .workspace, .landlord-shell { width: min(100% - 24px, 1380px); }
  .report-panel, .result-panel { padding: 22px 18px; border-radius: 13px; }
  .technical-grid, .history-summary { grid-template-columns: 1fr; }
  .history-item { grid-template-columns: 1fr; gap: 5px; }
  .landlord-heading { align-items: flex-start; flex-direction: column; }
  .evidence-page { width: min(100% - 24px, 1120px); padding-top: 24px; }
  .evidence-hero { padding: 42px 0 28px; }
  .evidence-metrics { grid-template-columns: 1fr; }
  .evidence-metrics article { min-height: 125px; }
  .hardening-section { margin-top: 34px; padding: 25px 22px; grid-template-columns: 1fr; gap: 24px; }
}
