@font-face {
  font-family: "Lexend";
  src: url("assets/Lexend-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --mission-navy: #071b2b;
  --mission-navy-2: #0d2c42;
  --signal-gold: #f1b944;
  --ground-gold: #a66f05;
  --control-off-white: #f5f2ea;
  --orbit-white: #ffffff;
  --ink: #071b2b;
  --muted: #526472;
  --muted-strong: #344c5d;
  --line: #d8d6cf;
  --line-strong: #bbb9b0;
  --canvas: #f5f2ea;
  --card: #ffffff;
  --success: #176b5b;
  --success-soft: #e4f2ed;
  --warning: #8a5b00;
  --warning-soft: #fff2cf;
  --danger: #9c3532;
  --danger-soft: #f9e9e6;
  --info: #315d7a;
  --info-soft: #e7eff4;
  --shadow-card: 0 12px 34px rgb(7 27 43 / 0.07);
  --shadow-float: 0 26px 70px rgb(7 27 43 / 0.2);
  font-family: "Lexend", "Avenir Next", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; overflow-x: clip; background: var(--canvas); font-size: 16px; line-height: 1.55; }
button, a, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, select, textarea { width: 100%; color: var(--ink); }
button:disabled { cursor: wait; }

.skip-link { position: fixed; z-index: 50; top: 10px; left: 10px; padding: 10px 14px; color: var(--mission-navy); background: var(--signal-gold); border-radius: 8px; transform: translateY(-160%); font-weight: 650; }
.skip-link:focus { transform: translateY(0); }

.topbar { min-height: 78px; padding: 12px clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid rgb(241 185 68 / 0.28); color: var(--orbit-white); background: var(--mission-navy); }
.brand { min-width: 0; display: flex; align-items: center; gap: 20px; color: inherit; text-decoration: none; }
.brand-logo { width: 176px; height: auto; display: block; }
.brand-context { padding-left: 20px; border-left: 1px solid rgb(255 255 255 / 0.24); color: #d9e1e6; font-size: 14px; font-weight: 500; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.safety { min-height: 36px; padding: 7px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid rgb(241 185 68 / 0.32); border-radius: 999px; color: #ecf0f2; background: rgb(255 255 255 / 0.06); font-size: 13px; line-height: 1.3; }
.safety span { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--signal-gold); box-shadow: 0 0 0 4px rgb(241 185 68 / 0.13); }

main { width: min(1480px, 100%); margin: 0 auto; padding: 44px clamp(20px, 4vw, 64px) 72px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 8px; color: var(--ground-gold); font-size: 12px; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.section-kicker { margin: 0 0 5px; color: var(--ground-gold); font-size: 13px; font-weight: 600; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 18ch; margin-bottom: 10px; font-size: clamp(34px, 4.5vw, 52px); font-weight: 600; line-height: 1.03; letter-spacing: -.04em; overflow-wrap: anywhere; text-wrap: balance; }
h2 { font-weight: 600; letter-spacing: -.025em; }
.intro p:last-child { max-width: 64ch; margin-bottom: 0; color: var(--muted); }
.intro-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.primary, .secondary { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border-radius: 9px; font-weight: 600; white-space: nowrap; transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease; }
.primary { border: 1px solid var(--signal-gold); color: var(--mission-navy); background: var(--signal-gold); }
.primary:hover:not(:disabled) { border-color: #e2a92d; background: #e2a92d; transform: translateY(-1px); }
.secondary { border: 1px solid var(--line-strong); color: var(--ink); background: var(--orbit-white); }
.secondary:hover:not(:disabled) { border-color: var(--mission-navy); background: #f8f7f3; transform: translateY(-1px); }
.topbar .secondary { color: var(--orbit-white); border-color: rgb(255 255 255 / 0.35); background: transparent; }
.primary:active:not(:disabled), .secondary:active:not(:disabled), .filter:active { transform: translateY(1px); }
.primary:disabled, .secondary:disabled { opacity: .55; transform: none; }
.primary:focus-visible, .secondary:focus-visible, .filter:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--signal-gold); outline-offset: 3px; }
.primary svg, .secondary.action svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.secondary.action { min-height: 48px; }

.case-card, .panel { border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow-card); }
.command-deck { margin-bottom: 18px; overflow: clip; border-color: #cbc8be; }
.panel-head { min-height: 76px; padding: 18px 22px 15px; display: flex; align-items: end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 21px; }
.panel-head > span { color: var(--muted); font-size: 13px; font-weight: 550; }
.intake-grid { padding: 18px 22px 22px; display: grid; grid-template-columns: minmax(220px, .8fr) minmax(300px, 1.2fr) minmax(300px, 1.2fr); gap: 18px; align-items: end; }
.intake label, .authority-panel label, .draft-box label { display: grid; gap: 7px; color: var(--muted-strong); font-size: 13px; font-weight: 550; }
.intake input, .intake select, .authority-panel select, .draft-box textarea { min-height: 48px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--orbit-white); }
.intake input:hover, .intake select:hover, .authority-panel select:hover, .draft-box textarea:hover { border-color: #8f969a; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.selection-box { margin: 0 22px 22px; padding: 16px; border: 1px solid #d7b56b; border-radius: 10px; background: var(--warning-soft); }
.selection-box p { margin: 6px 0 12px; color: var(--muted); }
.selection-box button { margin: 0 8px 8px 0; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.metrics article { min-height: 118px; position: relative; padding: 18px 18px 16px; display: grid; align-content: space-between; overflow: clip; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.metrics article::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--mission-navy); }
.metrics .metric-positive::before { background: var(--success); }
.metrics .metric-critical::before { background: var(--danger); }
.metrics .attention::before { background: var(--signal-gold); }
.metrics span, .metrics small { color: var(--muted); font-size: 12px; }
.metrics strong { font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.metrics .attention { border-color: #dbc58f; background: #fffaf0; }

.filters { display: flex; gap: 8px; padding: 3px 0 16px; overflow-x: auto; scrollbar-width: thin; }
.filter { min-height: 44px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted-strong); background: var(--card); font-weight: 550; white-space: nowrap; transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease; }
.filter:hover { border-color: var(--mission-navy); }
.filter.active { color: var(--orbit-white); border-color: var(--mission-navy); background: var(--mission-navy); }

.workspace { display: grid; grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); gap: 16px; align-items: start; }
.case-card { position: sticky; top: 18px; padding: 23px; color: var(--orbit-white); border-color: var(--mission-navy); background: var(--mission-navy); box-shadow: 0 18px 42px rgb(7 27 43 / 0.18); }
.case-head { display: flex; justify-content: space-between; gap: 14px; }
.case-head > div { min-width: 0; }
.case-head .section-kicker { color: var(--signal-gold); overflow-wrap: anywhere; }
.case-head h2 { margin-bottom: 7px; font-size: 23px; overflow-wrap: anywhere; }
.case-head p:last-child { margin-bottom: 0; color: #bdc9d0; overflow-wrap: anywhere; }
.case-facts { margin: 22px 0 0; display: grid; }
.case-facts div { padding: 13px 0; display: flex; justify-content: space-between; gap: 18px; border-top: 1px solid rgb(255 255 255 / 0.15); }
.case-facts dt { color: #bdc9d0; }
.case-facts dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.notice { margin: 0 0 16px; padding: 14px; border: 1px solid #dfc988; border-radius: 7px; color: var(--mission-navy); background: var(--orbit-white); box-shadow: var(--shadow-card); line-height: 1.48; }
.notice.error { border-color: #dfb5b1; color: var(--danger); background: var(--danger-soft); }

.pill { min-height: 28px; display: inline-flex; align-items: center; align-self: start; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 650; line-height: 1.25; white-space: nowrap; }
.pill.blue { color: var(--info); background: var(--info-soft); }
.pill.amber { color: var(--warning); background: var(--warning-soft); }
.pill.red { color: var(--danger); background: var(--danger-soft); }
.pill.teal { color: var(--success); background: var(--success-soft); }
.pill.gray { color: #44535d; background: #edf0f1; }
.case-card .pill.blue { color: var(--mission-navy); background: var(--signal-gold); }
.case-card .pill.teal { color: var(--mission-navy); background: #bfe4d8; }

.case-history { min-width: 0; overflow: clip; }
.case-list { display: grid; padding: 10px; gap: 8px; }
.google-case { min-width: 0; overflow: clip; border: 1px solid #e2e0d9; border-radius: 10px; background: #fff; }
.google-case-summary { min-width: 0; padding: 15px 16px; display: grid; grid-template-columns: minmax(220px, 1.55fr) repeat(2, minmax(92px, .55fr)) minmax(125px, .72fr); gap: 15px; align-items: center; background: #fcfbf8; }
.google-case-summary > div { min-width: 0; }
.google-case strong { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 650; letter-spacing: -.01em; overflow-wrap: anywhere; }
.google-case small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.datum { padding-left: 13px; border-left: 1px solid var(--line); }
.datum span { display: block; color: var(--muted); font-size: 11px; }
.datum b { font-size: 15px; font-weight: 650; }
.mail-empty { margin: 0 16px 15px; padding: 12px 13px; color: var(--muted); background: var(--control-off-white); border-radius: 8px; font-size: 12px; }
.review-evidence { margin: 0 16px 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--orbit-white); }
.google-case-actions { min-height: 58px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: var(--control-off-white); }
.google-case-actions > div:first-child { min-width: 0; display: grid; gap: 2px; }
.google-case-actions strong { margin: 0; font-size: 12px; }
.google-case-actions span { color: var(--muted); font-size: 11px; }
.google-case-action-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.google-case-actions .case-check { min-height: 38px; padding-inline: 12px; font-size: 11px; }
.review-evidence-list { display: grid; }
.review-evidence-row { min-width: 0; padding: 11px 12px; display: grid; grid-template-columns: minmax(210px, 1.4fr) minmax(155px, .8fr) auto; align-items: center; gap: 14px; }
.review-evidence-row + .review-evidence-row { border-top: 1px solid var(--line); }
.review-identity, .review-observation { min-width: 0; display: grid; gap: 3px; }
.review-identity strong, .review-observation strong { margin: 0; font-size: 12px; }
.review-identity span, .review-observation span { min-height: 15px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.review-identity code { font-size: 10px; color: var(--muted-strong); }
.review-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.review-actions > a { color: var(--info); font-size: 11px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.review-actions > a:hover { text-decoration: underline; }
.review-recheck { min-height: 32px; padding: 7px 9px; font-size: 10px; }
.review-empty { margin: 0; padding: 12px; color: var(--muted); font-size: 11px; }
.mail-timeline { margin: 0 16px 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--orbit-white); }
.mail-event + .mail-event { border-top: 1px solid var(--line); }
.mail-event summary { min-height: 48px; padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.mail-event summary::-webkit-details-marker { display: none; }
.mail-event summary::after { content: "+"; width: 24px; height: 24px; display: grid; place-items: center; color: var(--mission-navy); border-radius: 50%; background: var(--control-off-white); font-weight: 650; }
.mail-event[open] summary::after { content: "−"; }
.mail-direction { padding: 4px 7px; border-radius: 5px; color: var(--info); background: var(--info-soft); font-size: 10px; font-weight: 650; }
.mail-direction.outgoing { color: var(--success); background: var(--success-soft); }
.mail-subject { min-width: 0; overflow: hidden; color: var(--muted-strong); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 550; }
.mail-event time { color: var(--muted); font-size: 11px; }
.mail-details { padding: 0 12px 13px; }
.mail-details p { max-height: 240px; margin: 10px 0 0; padding: 12px; overflow: auto; color: var(--muted-strong); background: var(--control-off-white); border-radius: 7px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.55; }
.event-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.event-chip { padding: 4px 7px; color: var(--mission-navy); background: var(--warning-soft); border-radius: 999px; font-size: 10px; font-weight: 600; }
.empty { padding: 42px; text-align: center; color: var(--muted); }

.closeout-panel, .authority-panel { margin-top: 16px; }
.closeout-panel { border-left: 4px solid var(--signal-gold); }
.closeout-body { padding: 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.closeout-body > div { max-width: 780px; }
.closeout-body > div > p:first-child { margin-bottom: 6px; font-weight: 600; line-height: 1.5; }
.closeout-body .field-note { margin-top: 0; }
.closeout-body > button { flex: 0 0 auto; }
.authority-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr); }
.authority-controls, .draft-box { min-width: 0; padding: 22px; }
.authority-controls { border-right: 1px solid var(--line); background: #fcfbf8; }
.authority-controls > p:first-child { color: var(--muted); line-height: 1.6; }
.authority-controls label + label { margin-top: 14px; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.link-button { text-decoration: none; }
.draft-box textarea { min-height: 320px; resize: vertical; line-height: 1.55; overflow-wrap: anywhere; }
.authority-feedback { margin: 0 0 14px; padding: 11px 13px; border: 1px solid #bad8ce; border-radius: 7px; color: var(--success); background: var(--success-soft); font-size: 13px; line-height: 1.45; }
.authority-feedback.error { border-color: #dfb5b1; color: var(--danger); background: var(--danger-soft); }
.field-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }

.auth-modal { position: fixed; z-index: 20; inset: 0; padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; background: rgb(7 27 43 / 0.72); }
.auth-modal[hidden] { display: none; }
.auth-card { width: min(540px, 100%); min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--orbit-white); box-shadow: var(--shadow-float); overflow-wrap: anywhere; }
.send-confirm { width: min(580px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 14px; background: transparent; }
.send-confirm::backdrop { background: rgb(7 27 43 / 0.72); }
.send-confirm .auth-card { width: 100%; }
.confirm-details { padding: 14px; border-left: 3px solid var(--signal-gold); border-radius: 7px; color: var(--ink); background: var(--control-off-white); white-space: pre-line; overflow-wrap: anywhere; }
.auth-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.auth-head h2 { margin-bottom: 8px; }
.close { width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--orbit-white); font-size: 24px; }

@media (max-width: 1100px) {
  .intake-grid { grid-template-columns: 1fr 1fr; }
  .intake-grid > label:first-child { grid-column: 1 / -1; }
  .google-case-summary { grid-template-columns: minmax(190px, 1.35fr) repeat(2, minmax(82px, .5fr)); }
  .google-case-summary > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  main { padding-top: 34px; }
  .topbar { align-items: flex-start; }
  .intake-grid { grid-template-columns: 1fr; }
  .intake-grid > label:first-child { grid-column: auto; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .workspace { grid-template-columns: 1fr; }
  .case-card { position: static; }
  .google-case-summary { grid-template-columns: minmax(0, 1fr) minmax(90px, .35fr) minmax(90px, .35fr); }
  .authority-grid { grid-template-columns: 1fr; }
  .authority-controls { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .topbar { min-height: 0; padding: 14px 16px; flex-direction: column; gap: 12px; }
  .brand { width: 100%; justify-content: space-between; gap: 14px; }
  .brand-logo { width: 160px; }
  .brand-context { padding-left: 14px; font-size: 12px; }
  .top-actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; }
  .safety { width: 100%; justify-content: center; border-radius: 8px; }
  main { padding: 26px 14px 48px; }
  .intro { align-items: stretch; flex-direction: column; gap: 20px; margin-bottom: 20px; }
  h1 { font-size: clamp(32px, 11vw, 42px); }
  .intro-actions { display: grid; justify-content: stretch; }
  .intro-actions > * { width: 100%; }
  .panel-head { min-height: 70px; padding: 16px; align-items: flex-start; }
  .panel-head h2 { font-size: 19px; }
  .intake-grid { padding: 16px; gap: 16px; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form button { width: 100%; }
  .selection-box { margin: 0 16px 16px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metrics article { min-height: 106px; padding: 14px; }
  .metrics strong { font-size: 29px; }
  .case-card { padding: 19px; }
  .case-head { align-items: flex-start; flex-direction: column-reverse; }
  .google-case-summary { grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
  .google-case-summary > div:first-child, .google-case-summary > div:last-child { grid-column: 1 / -1; }
  .datum { padding-left: 0; border-left: 0; }
  .mail-timeline, .mail-empty { margin-inline: 12px; }
  .review-evidence { margin-inline: 12px; }
  .google-case-actions { align-items: stretch; flex-direction: column; }
  .google-case-action-buttons { display: grid; width: 100%; }
  .google-case-actions .case-check { width: 100%; }
  .review-evidence-row { grid-template-columns: 1fr; gap: 8px; }
  .review-actions { justify-content: flex-start; }
  .mail-event summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .mail-event time { display: none; }
  .closeout-body { align-items: stretch; flex-direction: column; padding: 18px; }
  .closeout-body > button { width: 100%; }
  .authority-controls, .draft-box { padding: 18px; }
  .button-row { display: grid; }
  .button-row > * { width: 100%; }
  .draft-box textarea { min-height: 280px; }
}

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

/* 0.4 workflow hierarchy */
main { padding-top: 30px; }
.control-row { margin-bottom: 18px; display: grid; grid-template-columns: minmax(280px, 1fr) auto; align-items: end; gap: 26px; }
.control-row h1 { margin-bottom: 7px; font-size: clamp(32px, 3.2vw, 42px); }
.control-row > div:first-child > p:last-child { margin: 0; color: var(--muted); }
.controls { display: flex; align-items: end; gap: 9px; }
.case-picker-field { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 600; }
.case-picker-field select { min-width: 285px; min-height: 48px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--orbit-white); font-weight: 560; }
#case-scope { width: auto; min-height: 48px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--orbit-white); font-size: 12px; font-weight: 560; }

.next-step { margin-bottom: 14px; padding: 17px 19px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; border: 1px solid #d8b96f; border-radius: 12px; background: #fff9e9; box-shadow: var(--shadow-card); }
.next-step[data-kind="completed"] { border-color: #a6c9bd; background: var(--success-soft); }
.next-step[data-kind="visible"], .next-step[data-kind="unclear"] { border-color: #d8a9a6; background: var(--danger-soft); }
.next-step[data-kind="error"] { border-color: #d8a9a6; background: var(--danger-soft); }
.next-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--signal-gold); }
.next-icon svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 2; }
.next-step .section-kicker { margin-bottom: 2px; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
.next-step h2 { margin: 0 0 2px; font-size: 17px; }
.next-step p:last-child { margin: 0; color: var(--muted); font-size: 12px; }

.metrics { gap: 10px; margin-bottom: 14px; }
.metrics article { min-height: 84px; padding: 14px 16px; grid-template-columns: 1fr auto; align-items: center; align-content: center; }
.metrics span { font-size: 11px; }
.metrics strong { font-size: 27px; }
.metrics small { grid-column: 1 / -1; font-size: 11px; font-weight: 560; }
.metrics .metric-info::before { background: var(--info); }

.workspace { grid-template-columns: 310px minmax(0, 1fr); gap: 14px; }
.rail { position: sticky; top: 14px; display: grid; gap: 12px; }
.case-card { position: static; padding: 20px; }
.case-card h2 { font-size: 21px; }
.case-facts { margin-top: 18px; }
.case-facts div { padding: 10px 0; font-size: 13px; }
.freshness { margin: 14px 0 0; color: #adbec7; font-size: 10px; line-height: 1.5; }
.action-card { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); box-shadow: var(--shadow-card); }
.action-card-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.action-card h3 { margin: 0 0 4px; font-size: 14px; }
.action-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.compact { width: 100%; min-height: 40px; margin-top: 13px; font-size: 12px; }

.case-history .panel-head { min-height: 72px; padding: 15px 18px; align-items: center; }
.panel-meta { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.filters { max-width: 62%; padding: 0; gap: 6px; }
.filter { min-height: 36px; padding: 0 11px; font-size: 11px; }
.case-list { padding: 9px; gap: 7px; }
.google-case { background: #fcfbf8; }
.google-case-summary { min-height: 68px; padding: 11px 13px; grid-template-columns: minmax(170px, 1.45fr) repeat(4, minmax(82px, .5fr)) minmax(110px, .65fr) 28px; gap: 12px; cursor: pointer; list-style: none; }
.google-case-summary::-webkit-details-marker { display: none; }
.google-case-summary .datum { padding-left: 10px; }
.case-chevron { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--control-off-white); transition: transform .18s ease; }
.google-case[open] .case-chevron { transform: rotate(45deg); }
.mail-caption { margin: 0; padding: 9px 12px 5px; color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.mail-history { border-top: 1px solid var(--line); }
.mail-history > summary { padding: 10px 12px; color: var(--muted-strong); cursor: pointer; font-size: 11px; font-weight: 600; }
.mail-history .mail-event { border-top: 1px solid var(--line); }
.load-error strong { display: block; margin-bottom: 6px; color: var(--danger); }
.load-error p { margin: 0; }

.closeout-panel, .authority-panel { scroll-margin-top: 16px; }
.importer { margin-top: 16px; box-shadow: none; background: rgb(255 255 255 / .55); }
.importer > summary { padding: 14px 18px; cursor: pointer; font-size: 12px; font-weight: 600; }
.importer .intake { border-top: 1px solid var(--line); }
.importer .intake h2 { margin: 0; padding: 18px 22px 0; font-size: 18px; }
.importer .intake-grid { grid-template-columns: 1fr 1fr; }

@media (max-width: 1180px) {
  .control-row { grid-template-columns: 1fr; }
  .controls { flex-wrap: wrap; }
  .google-case-summary { grid-template-columns: minmax(180px, 1.3fr) repeat(3, minmax(78px, .5fr)) 28px; }
  .google-case-summary > .datum:nth-of-type(5), .google-case-summary > div:nth-last-of-type(1) { grid-column: auto; }
  .google-case-summary > div:first-child { grid-column: span 2; }
  .filters { max-width: 58%; }
}

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .rail { position: static; grid-template-columns: 1fr 1fr; }
  .case-card { grid-row: span 2; }
  .case-history .panel-head { align-items: flex-start; flex-direction: column; }
  .filters { max-width: 100%; width: 100%; }
  .importer .intake-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  main { padding-top: 26px; }
  .control-row { gap: 20px; }
  .controls { display: grid; }
  .case-picker-field select, #case-scope, .controls > button { width: 100%; min-width: 0; }
  .next-step { grid-template-columns: auto 1fr; }
  .next-step > button { grid-column: 1 / -1; width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics article { min-height: 92px; }
  .rail { grid-template-columns: 1fr; }
  .case-card { grid-row: auto; }
  .filters { overflow-x: auto; flex-wrap: nowrap; }
  .google-case-summary { position: relative; grid-template-columns: 1fr 1fr; gap: 10px; }
  .google-case-summary > div:first-child, .google-case-summary > div:nth-last-of-type(1) { grid-column: 1 / -1; }
  .case-chevron { position: absolute; right: 13px; top: 12px; }
  .google-case-summary .datum { padding-left: 0; border-left: 0; }
}
