:root {
  --ink: #17211d;
  --ink-soft: #405049;
  --paper: #f5f4ed;
  --surface: #fffef9;
  --surface-2: #ecebe3;
  --line: #d9d9cf;
  --line-strong: #bfc4b9;
  --accent: #1f7656;
  --accent-dark: #155a40;
  --accent-soft: #dcebe3;
  --blue-soft: #e3ebef;
  --green: #247650;
  --green-soft: #e1efe7;
  --amber: #a4650a;
  --amber-soft: #fff0ce;
  --red: #b13a34;
  --red-soft: #fae3df;
  --shadow: 0 16px 50px rgba(23, 33, 29, 0.08);
  --radius: 14px;
  --radius-lg: 22px;
  --focus: 0 0 0 3px rgba(31, 118, 86, 0.22);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 75% 8%, rgba(214, 228, 217, 0.5), transparent 27rem),
    var(--paper);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img,
video,
canvas {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3,
h4 {
  line-height: 1.12;
  letter-spacing: -0.026em;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 3.4vw, 3.45rem);
  max-width: 18ch;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}

h3 {
  margin-bottom: 0;
  font-size: 1.3rem;
}

h4 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px clamp(18px, 4vw, 56px);
  color: white;
  background: rgba(23, 33, 29, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand > span:last-child {
  display: grid;
}

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

.brand small {
  color: rgba(255, 255, 255, 0.57);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.27);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
  background: #91d5ae;
}

.brand-mark::before {
  width: 14px;
  height: 1px;
}

.brand-mark::after {
  width: 1px;
  height: 14px;
}

.brand-mark span {
  width: 7px;
  height: 7px;
  border: 2px solid white;
  border-radius: 50%;
}

.topbar-actions,
.service-state {
  display: flex;
  align-items: center;
}

.monitor-panel { margin: 0 0 24px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.monitor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.monitor-heading h2 { margin-bottom: 6px; font-size: 1.35rem; }
.monitor-heading p:last-child { max-width: 760px; margin: 0; color: var(--ink-soft); }
.monitor-summary { margin-top: 16px; padding: 10px 12px; color: var(--green); background: var(--green-soft); border-radius: 9px; font-size: 13px; }
.monitor-summary.is-error { color: var(--red); background: var(--red-soft); }


.topbar-actions {
  gap: 20px;
}

.service-state {
  gap: 9px;
  color: rgba(255, 255, 255, 0.72);
}

.service-state > span:last-child {
  display: grid;
}

.service-state strong {
  color: #e7f4eb;
  font-size: 12px;
  font-weight: 650;
}

.service-state small {
  font-size: 10px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: #67c38e;
  border: 2px solid rgba(103, 195, 142, 0.25);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(103, 195, 142, 0.12);
}

.page-shell {
  width: min(1500px, calc(100% - clamp(28px, 7vw, 96px)));
  margin: 0 auto;
  padding: clamp(38px, 7vw, 78px) 0 80px;
}

.queue-tabs {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 24px;
  padding: 5px;
  background: #e7e7df;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.queue-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  justify-content: center;
  padding: 9px 15px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 700;
}

.queue-tab span { min-width: 22px; padding: 1px 6px; background: rgba(23, 33, 29, .09); border-radius: 999px; font-size: 11px; }
.queue-tab.is-active { color: var(--ink); background: var(--surface); box-shadow: 0 3px 12px rgba(23, 33, 29, .09); }
.queue-tab.is-active span { color: white; background: var(--accent); }

.handout-origin { margin: 18px 0; padding: 18px; background: var(--blue-soft); border: 1px solid #cbd9df; border-radius: var(--radius); }
.handout-origin h3 { margin: 3px 0 10px; }
.handout-origin > p { margin: 12px 0 0; color: var(--ink-soft); font-size: 13px; }
.handout-origin-meta, .handout-origin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.handout-origin-actions { margin-top: 12px; }

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.intro-copy {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.isolation-note {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  margin-bottom: 18px;
  color: #24523f;
  background: var(--accent-soft);
  border: 1px solid #c4ddcf;
  border-radius: 12px;
}

.isolation-note p {
  margin: 0;
  font-size: 13px;
}

.shield-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 7px 7px 10px 10px;
  font-size: 12px;
  font-weight: 800;
}

.workspace {
  display: grid;
  min-height: 650px;
  grid-template-columns: 290px minmax(0, 1fr);
  overflow: clip;
  background: rgba(255, 254, 249, 0.76);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.case-sidebar {
  display: flex;
  min-width: 0;
  padding: 24px 18px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(239, 239, 231, 0.74);
}

.sidebar-heading,
.section-heading,
.case-detail-head,
.media-card-head,
.subheading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.sidebar-heading h2 {
  font-size: 1.22rem;
}

.sidebar-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.archive-link {
  padding: 3px 0;
  color: var(--accent-dark);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(31, 118, 86, 0.35);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 720;
}

.archive-link:hover,
.archive-link.is-active {
  color: var(--accent);
  border-bottom-color: currentColor;
}

.count-pill {
  display: inline-grid;
  min-width: 28px;
  min-height: 28px;
  padding: 3px 8px;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  margin: 8px 0 16px;
  color: #758078;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.search-field input {
  width: 100%;
  min-height: 40px;
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}

.case-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.case-list-row {
  position: relative;
  display: grid;
}

.case-list-empty {
  padding: 28px 13px;
  color: #778078;
  text-align: center;
  font-size: 13px;
}

.case-list-button {
  width: 100%;
  padding: 13px 72px 13px 13px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  text-align: left;
}

.case-list-archive {
  position: absolute;
  top: 9px;
  right: 9px;
  min-height: 28px;
  padding: 5px 8px;
  color: #6f5b2f;
  background: #fff8e7;
  border: 1px solid #dbc994;
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.case-list-button:hover {
  background: rgba(255, 255, 255, 0.62);
}

.case-list-button[aria-current="true"] {
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: 0 5px 18px rgba(23, 33, 29, 0.06);
}

.case-list-button strong,
.case-list-button small {
  display: block;
}

.case-list-button strong {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0 8px;
  font-size: 13px;
  font-weight: 670;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.case-list-button small {
  color: #768078;
  font-size: 11px;
}

.case-number {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.case-pane {
  min-width: 0;
  background: var(--surface);
}

.blank-state {
  display: flex;
  min-height: 650px;
  padding: 72px 28px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.blank-state h2 {
  margin-bottom: 10px;
}

.blank-state > p:not(.eyebrow) {
  max-width: 540px;
  margin-bottom: 24px;
  color: var(--ink-soft);
}

.blank-illustration {
  position: relative;
  width: 120px;
  height: 104px;
  margin-bottom: 24px;
}

.frame-shape {
  position: absolute;
  inset: 0 12px 8px 0;
  background: var(--accent-soft);
  border: 1px solid #bad4c5;
  border-radius: 16px;
  transform: rotate(-4deg);
}

.frame-shape::before {
  position: absolute;
  inset: 11px;
  content: "";
  border: 1px dashed rgba(31, 118, 86, 0.45);
  border-radius: 10px;
}

.scan-line {
  position: absolute;
  top: 20px;
  right: 0;
  width: 2px;
  height: 76px;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(177, 58, 52, 0.08);
}

.case-detail {
  padding: clamp(23px, 4vw, 42px);
}

.case-detail-head {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.case-title-wrap {
  min-width: 0;
}

.case-kicker {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-title {
  max-width: 26ch;
  overflow-wrap: anywhere;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--ink-soft);
  background: var(--surface-2);
  border-radius: 7px;
  font-size: 11px;
}

.meta-chip strong {
  margin-right: 4px;
  color: var(--ink);
}

.case-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.case-notice {
  padding: 16px 18px;
  margin: 22px 0 32px;
  background: #f2f1ea;
  border-left: 3px solid var(--ink);
  border-radius: 0 10px 10px 0;
}

.case-notice strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case-notice p {
  margin: 0;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.case-context {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 10px;
  background: var(--amber-soft);
}

.case-context.status-green { border-left-color: var(--green); background: var(--green-soft); }
.case-context.status-red { border-left-color: var(--red); background: var(--red-soft); }

.case-context-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.case-context-badge {
  padding: 5px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 760;
}

.case-context-text {
  margin: 9px 0 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.objective-news {
  margin: 22px 0 32px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 12px;
}

.objective-news-head,
.objective-news-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.objective-news-content {
  margin-top: 18px;
}

.objective-news-title {
  display: block;
  margin-bottom: 8px;
  font-size: 1.12rem;
}

.objective-news-description {
  margin-bottom: 12px;
  color: var(--ink-soft);
  white-space: pre-wrap;
}

.objective-news-location {
  display: inline-flex;
  padding: 5px 9px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.objective-news-empty {
  margin: 14px 0 0;
  color: var(--ink-soft);
}

.objective-news-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.objective-news-form[hidden] { display: none; }

.objective-news-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.objective-news-form input,
.objective-news-form textarea {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.objective-news-actions { justify-content: flex-end; }

.objective-news-message {
  margin: 0;
  color: var(--red);
}

.section-heading {
  align-items: center;
  margin-bottom: 16px;
}

.section-heading .eyebrow {
  margin-bottom: 5px;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.safe-media-label {
  padding: 6px 9px;
  color: #24523f;
  background: var(--accent-soft);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.media-heading {
  grid-column: 1 / -1;
}

.media-card {
  min-width: 0;
  overflow: hidden;
  background: #f0f0e9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.media-card-head {
  padding: 14px 15px;
  align-items: center;
}

.media-card-head strong,
.media-card-head small {
  display: block;
}

.media-card-head strong {
  font-size: 13px;
}

.media-card-head small {
  margin-top: 2px;
  color: #6e786f;
  font-size: 10px;
}

.media-kind {
  color: #8a918b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.image-stage,
.video-stage {
  position: relative;
  display: grid;
  min-height: 250px;
  overflow: hidden;
  place-items: center;
  color: #839088;
  background:
    linear-gradient(45deg, rgba(255,255,255,.025) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.025) 75%),
    #202723;
  background-size: 24px 24px;
}

.image-stage img,
.video-stage video {
  width: 100%;
  max-height: 360px;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #1d2420;
}

.missing-media {
  position: absolute;
  inset: 0;
  display: grid;
  padding: 18px;
  place-items: center;
  color: #9eaaa3;
  font-size: 12px;
  text-align: center;
}

.has-media .missing-media {
  display: none;
}

.card-actions {
  display: flex;
  min-height: 59px;
  padding: 11px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-actions small {
  color: #747e76;
  font-size: 10px;
  text-align: right;
}

.capture-status,
.search-job {
  padding: 10px 13px;
  color: var(--ink-soft);
  background: var(--blue-soft);
  font-size: 12px;
}

.capture-status.is-error,
.search-job.is-error {
  color: #792a25;
  background: var(--red-soft);
}

.search-job {
  margin: -2px 0 16px;
  border-radius: 9px;
}

.search-disclosure {
  padding-left: 12px;
  margin: -5px 0 16px;
  color: #717b73;
  border-left: 2px solid var(--line-strong);
  font-size: 10px;
}

.frames-section,
.sources-section {
  padding-top: 34px;
  margin-top: 34px;
  border-top: 1px solid var(--line);
}

.frame-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.frame-list {
  display: contents;
}

.thumbnail-frame-media {
  position: relative;
  background: #202723;
}

.thumbnail-card:not(.has-media) .frame-image {
  visibility: hidden;
}

.frame-strip .frames-empty {
  grid-column: 2 / -1;
}

.frame-card {
  overflow: hidden;
  background: #f0f0e9;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.frame-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #202723;
}

.frame-card-body {
  display: grid;
  padding: 9px;
  gap: 8px;
}

.frame-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #667168;
  font-size: 10px;
}

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

.frame-actions .button {
  min-height: 32px;
  padding: 6px 8px;
  flex: 1;
  font-size: 10px;
}

.frame-actions .icon-button {
  width: 32px;
  height: 32px;
}

.frames-empty,
.sources-empty {
  padding: 27px;
  color: #717c73;
  background: #f2f1eb;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-size: 13px;
  text-align: center;
}

.suggestions {
  margin-bottom: 16px;
  background: #eef1ed;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.suggestions > summary {
  display: flex;
  padding: 13px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  list-style: none;
}

.suggestions > summary::-webkit-details-marker { display: none; }
.suggestions > summary::before { content: "＋"; color: var(--accent); }
.suggestions[open] > summary::before { content: "−"; }
.suggestions > summary > span:first-child { margin-right: auto; }
.suggestion-count { color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.suggestions-body { padding: 0 16px 16px; border-top: 1px solid var(--line); }
.suggestions-body .subheading { padding-top: 14px; }

.vision-result {
  padding: 17px;
  margin: 0 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 12px;
}

.vision-result.status-green { border-left-color: var(--green); background: var(--green-soft); }
.vision-result.status-red { border-left-color: var(--red); background: var(--red-soft); }
.vision-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.vision-result-head h4 { margin: 2px 0 0; font-size: 15px; }
.vision-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.vision-metrics span { display: grid; padding: 10px; color: var(--ink-soft); background: rgba(255, 255, 255, 0.58); border: 1px solid rgba(86, 99, 90, 0.14); border-radius: 8px; font-size: 10px; }
.vision-metrics strong { color: var(--ink); font-size: 18px; line-height: 1; }
.vision-result-copy { margin: 14px 0 0; color: var(--ink); font-size: 12px; line-height: 1.55; }
.vision-result-note { margin: 8px 0 0; color: var(--ink-soft); font-size: 10px; }

@media (max-width: 760px) {
  .vision-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.subheading p {
  margin: 1px 0 0;
  color: #69736c;
  font-size: 11px;
}

.suggestion-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.suggestion-provider-section + .suggestion-provider-section {
  padding-top: 15px;
  margin-top: 15px;
  border-top: 1px solid var(--line);
}

.provider-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.provider-heading h5 {
  margin: 0;
  font-size: 12px;
}

.provider-heading span {
  color: #6f7971;
  font-size: 9px;
}

.suggestion-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 11px;
  padding: 10px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.suggestion-card img,
.suggestion-placeholder {
  width: 56px;
  height: 42px;
  object-fit: cover;
  background: #dfe2dc;
  border-radius: 5px;
}

.suggestion-copy {
  min-width: 0;
}

.suggestion-copy strong,
.suggestion-copy a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-copy strong {
  font-size: 12px;
}

.suggestion-copy a {
  color: var(--accent);
  font-size: 10px;
}

.suggestion-match {
  display: inline-block;
  padding: 3px 6px;
  margin-top: 5px;
  color: #405a4e;
  background: var(--accent-soft);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
}

.provider-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.provider-badge {
  display: inline-flex;
  padding: 3px 6px;
  color: #3d4e46;
  background: #e8ebe7;
  border: 1px solid #d5dad4;
  border-radius: 99px;
  font-size: 8px;
  font-weight: 720;
  letter-spacing: .025em;
  white-space: nowrap;
}

.provider-badge.is-cross {
  color: #714d0b;
  background: var(--amber-soft);
  border-color: #e8cd96;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 7px;
  color: #687269;
  font-size: 11px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.compatible {
  background: var(--green);
}

.legend-dot.uncertain {
  background: var(--amber);
}

.legend-dot.conflict {
  background: var(--red);
}

.status-rule {
  margin: 0 0 17px;
  color: #747d76;
  font-size: 11px;
}

.source-list {
  display: grid;
  gap: 11px;
}

.source-card {
  position: relative;
  padding: 18px 18px 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 12px;
}

.source-card.status-green {
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(225, 239, 231, .68), transparent 140px), var(--surface);
}

.source-card.status-amber {
  border-left-color: var(--amber);
  background: linear-gradient(90deg, rgba(255, 240, 206, .62), transparent 140px), var(--surface);
}

.source-card.status-red {
  border-left-color: var(--red);
  background: linear-gradient(90deg, rgba(250, 227, 223, .82), transparent 170px), var(--surface);
}

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

.source-card-title {
  min-width: 0;
}

.source-platform {
  margin-bottom: 3px;
  color: #667168;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-url {
  display: block;
  max-width: min(70ch, 100%);
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 670;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  min-height: 26px;
  padding: 5px 9px;
  align-items: center;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 730;
  white-space: nowrap;
}

.status-green .status-badge {
  color: #215a40;
  background: var(--green-soft);
}

.status-amber .status-badge {
  color: #7a4b08;
  background: var(--amber-soft);
}

.status-red .status-badge {
  color: #8b2d28;
  background: var(--red-soft);
}

.source-dates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 15px 0 12px;
}

.date-box {
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.57);
  border: 1px solid rgba(191, 196, 185, 0.75);
  border-radius: 8px;
}

.date-box small,
.date-box strong {
  display: block;
}

.date-box small {
  margin-bottom: 2px;
  color: #747e76;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.date-box strong {
  font-size: 12px;
}

.source-summary {
  margin: 0 0 11px;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: pre-wrap;
}

.evidence-comparison {
  margin: 0 0 12px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(191, 196, 185, 0.82);
  border-radius: 10px;
}

.evidence-comparison-head {
  display: flex;
  margin-bottom: 9px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}

.evidence-confirmation {
  padding: 4px 7px;
  color: #7a4b08;
  background: var(--amber-soft);
  border-radius: 99px;
  font-size: 9px;
  font-weight: 720;
}

.evidence-confirmation.is-confirmed {
  color: #215a40;
  background: var(--green-soft);
}

.evidence-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.evidence-pair figure {
  min-width: 0;
  margin: 0;
}

.evidence-pair img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #17211c;
  border-radius: 7px;
}

.evidence-pair figcaption {
  margin-top: 5px;
  overflow: hidden;
  color: #667168;
  font-size: 9px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-notes {
  margin-top: 11px;
}

.source-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-facts span {
  padding: 4px 7px;
  color: #5d685f;
  background: rgba(239, 239, 232, 0.78);
  border-radius: 5px;
  font-size: 10px;
}

.source-facts .provider-badge {
  color: #2e4e3f;
  background: var(--accent-soft);
  border: 1px solid #c7ddcf;
  border-radius: 99px;
  font-weight: 720;
}

.source-assessments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.assessment {
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 11px;
  letter-spacing: 0.01em;
}

.assessment-compatible { color: #215a40; background: var(--green-soft); }
.assessment-conflict { color: #8b2d28; background: var(--red-soft); }
.assessment-uncertain,
.assessment-not_compared { color: #7a4b08; background: var(--amber-soft); }

.source-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 13px;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.button {
  padding: 10px 15px;
  font-size: 12px;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.button-primary {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-secondary:hover:not(:disabled) {
  border-color: #8d988f;
}

.button-archive {
  color: #5e4a1f;
  background: #fff3cf;
  border-color: #d7bd73;
  font-weight: 750;
}

.button-archive:hover:not(:disabled) {
  background: #f7e4ad;
  border-color: #bc9a40;
}

.button-quiet {
  color: var(--ink-soft);
  background: transparent;
  border-color: var(--line);
}

.topbar .button-quiet {
  color: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.2);
}

.button-small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11px;
}

.button-block {
  width: 100%;
}

.icon-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border-color: var(--line);
  font-size: 20px;
}

.icon-button:hover {
  background: var(--surface-2);
}

.danger-hover:hover {
  color: var(--red);
  background: var(--red-soft);
  border-color: #e2aaa5;
}

.dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: min(880px, calc(100vh - 34px));
  padding: 0;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(12, 19, 16, 0.28);
}

.dialog::backdrop {
  background: rgba(13, 20, 17, 0.66);
  backdrop-filter: blur(3px);
}

.dialog-card {
  padding: clamp(22px, 4vw, 34px);
}

.dialog-card-wide {
  width: 100%;
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialog-head {
  padding-bottom: 18px;
  margin-bottom: 21px;
  border-bottom: 1px solid var(--line);
}

.dialog-actions {
  justify-content: flex-end;
  padding-top: 20px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.field-stack {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
  align-content: start;
}

.field > span {
  font-size: 12px;
  font-weight: 680;
}

.field b {
  color: var(--red);
}

.field small {
  color: #747e76;
  font-size: 10px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  color: var(--ink);
  background: #fbfbf7;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
}

.field input,
.field select {
  min-height: 43px;
  padding: 9px 11px;
}

.field textarea {
  min-height: 86px;
  padding: 10px 11px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.field input:user-invalid,
.field textarea:user-invalid,
.field select:user-invalid {
  border-color: var(--red);
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.form-message,
.proof-warning {
  padding: 10px 12px;
  color: #295340;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 12px;
}

.form-message.is-error,
.error-message,
.proof-warning {
  color: #7b2c27;
  background: var(--red-soft);
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(370px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  padding: 12px 14px;
  color: white;
  background: var(--ink);
  border-radius: 10px;
  box-shadow: 0 12px 38px rgba(12, 20, 16, 0.25);
  font-size: 12px;
  animation: toast-in .2s ease-out;
}

.toast.is-error {
  background: #852f2a;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Login */

.login-page {
  background: var(--ink);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
}

.login-context {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: clamp(28px, 5vw, 70px);
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 12% 92%, rgba(74, 157, 111, 0.28), transparent 29rem),
    linear-gradient(145deg, #18231e, #111914);
  flex-direction: column;
}

.login-context::after {
  position: absolute;
  top: 9%;
  right: -100px;
  width: 320px;
  height: 520px;
  content: "";
  border: 1px solid rgba(141, 211, 171, 0.13);
  border-radius: 50%;
  transform: rotate(24deg);
}

.login-intro {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: auto 0;
  padding: 60px 0;
}

.login-intro h1 {
  max-width: 14ch;
  margin-bottom: 20px;
  font-size: clamp(2.5rem, 5vw, 5.2rem);
  letter-spacing: -0.055em;
}

.login-intro > p:last-child {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 17px;
}

.login-principles {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 760px;
  margin-bottom: 42px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.login-principles > div {
  padding: 18px 18px 0 0;
}

.login-principles > div + div {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.login-principles span {
  color: #78c69a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.login-principles p,
.login-principles strong {
  display: block;
}

.login-principles p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.login-principles strong {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
}

.server-footnote {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
}

.server-footnote p {
  margin: 0;
}

.server-footnote strong {
  color: rgba(255, 255, 255, 0.78);
}

.login-panel {
  display: grid;
  min-height: 100vh;
  padding: clamp(24px, 6vw, 90px);
  place-items: center;
  background: var(--paper);
}

.login-card {
  display: grid;
  width: min(430px, 100%);
  gap: 26px;
}

.login-card h2 {
  max-width: 13ch;
  margin-bottom: 10px;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
}

.muted {
  color: var(--ink-soft);
}

.access-boundary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: #37604e;
  background: var(--accent-soft);
  border-radius: 9px;
}

.access-boundary p {
  margin: 0;
  font-size: 10px;
}

@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 240px minmax(0, 1fr);
  }

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

  .media-heading {
    grid-column: auto;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr);
  }

  .login-principles {
    grid-template-columns: 1fr;
  }

  .login-principles > div {
    display: grid;
    padding: 11px 0;
    grid-template-columns: 32px 1fr;
  }

  .login-principles > div + div {
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
    border-left: 0;
  }

  .login-principles p {
    margin: 0;
  }
}

@media (max-width: 780px) {
  .topbar {
    min-height: 64px;
  }

  .service-state {
    display: none;
  }

  .page-shell {
    width: min(100% - 24px, 720px);
    padding-top: 32px;
  }

  .intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro .button {
    width: 100%;
  }

  .workspace {
    display: block;
  }

  .case-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .case-list {
    display: flex;
    padding-bottom: 4px;
    overflow-x: auto;
  }

  .case-list-button {
    width: 210px;
    flex: 0 0 210px;
  }

  .blank-state {
    min-height: 460px;
  }

  .case-detail-head,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .case-head-actions {
    width: 100%;
  }

  .case-head-actions .button {
    flex: 1;
  }

  .source-dates {
    grid-template-columns: 1fr;
  }

  .evidence-pair {
    grid-template-columns: 1fr;
  }

  .login-shell {
    display: block;
  }

  .login-context {
    min-height: auto;
    padding-bottom: 34px;
  }

  .login-intro {
    margin: 54px 0 36px;
    padding: 0;
  }

  .login-intro h1 {
    font-size: clamp(2.55rem, 12vw, 4.4rem);
  }

  .login-principles {
    display: none;
  }

  .login-panel {
    min-height: auto;
    padding: 48px 24px 60px;
  }
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }

  .form-grid,
  .inline-field {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .case-detail {
    padding: 22px 16px;
  }

  .case-head-actions {
    flex-wrap: wrap;
  }

  .section-heading,
  .section-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .safe-media-label {
    white-space: normal;
  }

  .image-stage,
  .video-stage {
    min-height: 190px;
  }

  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .card-actions small {
    text-align: left;
  }

  .suggestion-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .suggestion-card img,
  .suggestion-placeholder {
    width: 44px;
    height: 38px;
  }

  .suggestion-card .button {
    grid-column: 1 / -1;
  }

  .source-card-head {
    flex-direction: column;
  }

  .dialog-actions .button {
    flex: 1;
  }
}

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