:root {
  --surface-0: #f4f3ef;
  --surface-1: #eeece5;
  --surface-2: #ffffff;
  --text-primary: #1c1c1a;
  --text-secondary: #5f5e5a;
  --text-muted: #888780;
  --border: #d9d7cf;
  --border-strong: #b4b2a9;
  --bg-accent: #e6f1fb;
  --text-accent: #0c447c;
  --border-accent: #378add;
  --bg-warning: #faeeda;
  --text-warning: #633806;
  --border-warning: #e2b871;
  --bg-success: #eaf3de;
  --text-success: #27500a;
  --border-success: #9dbf6f;
  --bg-danger: #fbe9e7;
  --text-danger: #8a2b1c;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  padding: 3.5rem 2rem;
  font-size: 17px;
  line-height: 1.5;
}
.wrap { width: 100%; max-width: 920px; }
p { margin: 0; }
button {
  font: inherit;
  cursor: pointer;
}
.hidden { display: none !important; }

/* case card */
.case-card {
  background: var(--surface-2);
  border-radius: 14px;
  border: 0.5px solid var(--border);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 16px;
}
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; color: var(--text-accent);
  flex-shrink: 0;
}
.case-name { font-weight: 700; font-size: 21px; }
.case-sub { font-size: 15px; color: var(--text-secondary); margin-top: 3px; }

.jurisdiction-tag {
  font-size: 12px; font-weight: 700; color: var(--text-accent); background: var(--bg-accent);
  padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle;
}

/* identity verification panel */
.identity-panel { background: var(--surface-1); border-color: transparent; }
.identity-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.identity-body { font-size: 15px; color: var(--text-primary); line-height: 1.55; }
.identity-cite { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; font-style: italic; }
.identity-handoff { font-size: 14.5px; color: var(--text-accent); font-weight: 600; margin-top: 12px; }

/* act toggle */
.act-toggle { display: flex; gap: 10px; margin-bottom: 1.5rem; }
.act-btn {
  flex: 1;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}
.act-btn:hover { background: var(--surface-1); }
.act-btn-active {
  background: var(--bg-accent);
  color: var(--text-accent);
  border-color: var(--border-accent);
}

/* panels */
.panel {
  background: var(--surface-2);
  border-radius: 14px;
  border: 0.5px solid var(--border);
  padding: 1.5rem 1.75rem;
  margin-bottom: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); letter-spacing: 0.01em; }

/* act1: graph */
.icon-btn {
  border: 1px solid var(--border-strong);
  background: transparent;
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-primary);
  font-size: 16px;
}
.icon-btn:hover { background: var(--surface-1); }

#graph-svg { width: 100%; height: auto; display: block; }
.graph-node-box {
  fill: var(--surface-1);
  stroke: var(--border-strong);
  stroke-width: 1.2;
}
.graph-node-box.person { fill: var(--bg-accent); stroke: var(--border-accent); }
.graph-node-label { font-size: 16px; font-weight: 700; fill: var(--text-primary); }
.graph-node-sublabel { font-size: 12.5px; fill: var(--text-muted); }
.graph-edge { fill: none; stroke: var(--border-strong); stroke-width: 2; }
.graph-edge.verified { stroke: var(--text-accent); }
.graph-edge.inferred { stroke: var(--text-warning); stroke-dasharray: 6 5; }
.graph-edge-label { font-size: 14px; font-weight: 600; fill: var(--text-secondary); }
.graph-edge-label.verified { fill: var(--text-accent); }
.graph-edge-label.inferred { fill: var(--text-warning); }
.graph-fade-enter { opacity: 0; transition: opacity 0.5s ease; }
.graph-fade-enter.in { opacity: 1; }

.legend { display: flex; gap: 24px; margin-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.legend-swatch { width: 22px; height: 0; border-top: 3px solid var(--text-accent); display: inline-block; }
.legend-swatch.dashed { border-top: 3px dashed var(--text-warning); }

.discovery-log { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.discovery-entry {
  font-size: 15px;
  color: var(--text-secondary);
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-1);
  border-left: 3px solid var(--border-strong);
}
.discovery-entry.annotation { border-left-color: var(--text-accent); background: var(--bg-accent); color: var(--text-accent); }
.discovery-entry-step { font-size: 12.5px; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.discovery-entry.annotation .discovery-entry-step { color: var(--text-accent); opacity: 0.8; }

.threshold-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.threshold-card { border-radius: 14px; padding: 1.25rem 1.4rem; background: var(--surface-1); transition: background 0.3s ease; }
.threshold-card.flag { background: var(--bg-warning); }
.threshold-card.cross { background: var(--bg-danger); }
.threshold-label { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 600; }
.threshold-card.flag .threshold-label { color: var(--text-warning); }
.threshold-card.cross .threshold-label { color: var(--text-danger); }
.threshold-value { font-size: 22px; font-weight: 700; }
.threshold-note { font-size: 14px; color: var(--text-secondary); margin-top: 8px; }

.callout {
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.callout i { font-size: 22px; margin-top: 1px; flex-shrink: 0; }
.callout-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.callout-body { font-size: 14.5px; color: var(--text-secondary); }
.callout-accent { background: var(--bg-danger); }
.callout-accent i, .callout-accent .callout-title { color: var(--text-danger); }
.callout-warning { background: var(--bg-warning); }
.callout-warning i, .callout-warning .callout-title { color: var(--text-warning); }

.claims-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.claim-card {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}
.claim-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.claim-label { font-size: 17px; font-weight: 700; }
.claim-amount { font-size: 14px; color: var(--text-muted); margin-top: 3px; }
.claim-badge { font-size: 13px; padding: 5px 12px; border-radius: var(--radius); white-space: nowrap; font-weight: 700; }
.claim-badge.pending { background: var(--surface-1); color: var(--text-secondary); }
.claim-badge.corroborated { background: var(--bg-success); color: var(--text-success); }
.claim-badge.downgraded { background: var(--bg-danger); color: var(--text-danger); }

.confidence-track { height: 8px; border-radius: 4px; background: var(--surface-1); overflow: hidden; margin-bottom: 8px; }
.confidence-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease, background 0.5s ease; }
.confidence-fill.pending { background: var(--border-strong); }
.confidence-fill.corroborated { background: var(--border-success); }
.confidence-fill.downgraded { background: #d9694f; }
.claim-note { font-size: 14.5px; color: var(--text-secondary); }
.claim-confidence-value { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }

.aggregate-panel { margin-top: 4px; }
.aggregate-bars { display: flex; flex-direction: column; gap: 14px; margin: 14px 0 18px; }
.aggregate-row { display: grid; grid-template-columns: 170px 1fr 130px; align-items: center; gap: 14px; }
.aggregate-row-label { font-size: 14px; color: var(--text-secondary); }
.aggregate-track { height: 12px; border-radius: 6px; background: var(--surface-1); overflow: hidden; }
.aggregate-fill { height: 100%; border-radius: 6px; transition: width 0.6s ease; }
.fill-claimed { background: var(--border-accent); }
.fill-assets { background: var(--text-primary); opacity: 0.75; }
.aggregate-row-value { font-size: 15px; font-weight: 700; text-align: right; }

.claim-history { margin-top: 12px; font-size: 14px; }
.claim-history summary { cursor: pointer; color: var(--text-secondary); font-weight: 600; }
.claim-history-row {
  display: grid;
  grid-template-columns: 170px 110px 55px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 0.5px solid var(--border);
  font-size: 13.5px;
}
.claim-history-time { color: var(--text-muted); }
.claim-history-conf { color: var(--text-secondary); font-weight: 700; }
.claim-history-note { color: var(--text-secondary); }

@media (max-width: 600px) {
  body { padding: 1.5rem 1rem; font-size: 16px; }
  .aggregate-row { grid-template-columns: 120px 1fr 90px; }
  .claim-history-row { grid-template-columns: 1fr; gap: 4px; }
  .threshold-grid { grid-template-columns: 1fr; }
}

/* page shell (case list) */
.page-head { margin-bottom: 1.5rem; }
.page-title { font-size: 30px; font-weight: 800; }
.page-sub { font-size: 15.5px; color: var(--text-secondary); margin-top: 8px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; color: var(--text-secondary); text-decoration: none;
  margin-bottom: 1.25rem;
}
.back-link:hover { color: var(--text-primary); }

.case-list { display: flex; flex-direction: column; gap: 10px; }
.case-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 12px; background: var(--surface-1);
  text-decoration: none; color: var(--text-primary);
}
.case-list-item:hover { background: var(--bg-accent); }
.case-list-name { font-size: 17px; font-weight: 700; }
.case-list-sub { font-size: 14px; color: var(--text-secondary); margin-top: 3px; }
.empty-note { font-size: 15px; color: var(--text-muted); }

/* forms */
.form-grid { display: flex; flex-direction: column; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-secondary); font-weight: 600; }
.form-field input {
  font: inherit; font-size: 16px; padding: 11px 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-0); color: var(--text-primary);
}
.claim-row {
  display: grid; grid-template-columns: 1.3fr 0.8fr 1.3fr 36px; gap: 10px;
  margin-bottom: 10px; align-items: center;
}
.claim-row input {
  font: inherit; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-0); color: var(--text-primary);
  font-size: 15px;
}
.primary-btn {
  background: var(--text-accent); color: var(--surface-2);
  border: none; border-radius: var(--radius); padding: 13px 22px;
  font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
}
.primary-btn:hover { opacity: 0.9; }
.primary-btn:disabled { opacity: 0.5; cursor: default; }
.secondary-btn {
  background: transparent; color: var(--text-accent);
  border: 1px solid var(--border-accent); border-radius: var(--radius); padding: 10px 16px;
  font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
}
.secondary-btn:hover { background: var(--bg-accent); }
.form-error {
  font-size: 14.5px; color: var(--text-danger); background: var(--bg-danger);
  border-radius: 10px; padding: 12px 14px; margin-top: 14px;
}

/* ICIJ external verification */
.icij-row { background: var(--surface-1); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.icij-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.icij-name { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.icij-status { font-size: 12.5px; color: var(--text-muted); margin-left: 10px; }
.icij-result { margin-top: 10px; padding-top: 10px; border-top: 0.5px solid var(--border); }
.icij-result-heading { font-size: 12.5px; font-weight: 700; color: var(--text-accent); margin-bottom: 6px; }
.icij-candidate { font-size: 13px; color: var(--text-secondary); padding: 4px 0; }
.icij-candidate-score { font-weight: 700; color: var(--text-primary); }
.icij-error { font-size: 13px; color: var(--text-danger); }

/* document input */
.doc-input {
  width: 100%; font: inherit; font-size: 16px; padding: 14px 16px;
  border-radius: 12px; border: 1px solid var(--border-strong);
  background: var(--surface-0); color: var(--text-primary); resize: vertical;
  line-height: 1.5;
}
.sample-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sample-btn {
  font-size: 14px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface-1); color: var(--text-secondary);
  font-weight: 600;
}
.sample-btn:hover { background: var(--bg-accent); color: var(--text-accent); border-color: var(--border-accent); }
.doc-submit-row { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.doc-status { font-size: 14px; color: var(--text-muted); }

/* audit export */
.audit-wrap { max-width: 880px; }
.audit-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.audit-header { margin-bottom: 1.5rem; }
.audit-eyebrow { font-size: 13px; font-weight: 700; color: var(--text-accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.audit-section { page-break-inside: avoid; }
.audit-stage-label { font-size: 12.5px; font-weight: 700; color: var(--text-accent); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.audit-section-title { font-size: 19px; color: var(--text-primary); margin-bottom: 14px; }
.audit-p { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.audit-subhead { font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 18px 0 8px; }
.audit-doc-list { display: flex; flex-direction: column; gap: 10px; }
.audit-doc { background: var(--surface-1); border-radius: 10px; padding: 12px 14px; }
.audit-doc-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.audit-doc-time { font-size: 12.5px; color: var(--text-muted); }
.audit-doc-text { font-size: 14px; color: var(--text-primary); line-height: 1.55; }
.audit-redaction { margin-top: 10px; padding-top: 10px; border-top: 0.5px dashed var(--border-strong); }
.audit-redaction-label { font-size: 12.5px; font-weight: 700; color: var(--text-accent); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.audit-redacted-text { background: var(--bg-accent); border-radius: 8px; padding: 8px 10px; }
.audit-redaction-signal { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; }
.audit-rules { display: flex; flex-direction: column; gap: 12px; }
.audit-rule { background: var(--surface-1); border-radius: 10px; padding: 12px 14px; }
.audit-rule-title { font-size: 14.5px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.audit-rule-body { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.audit-table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: 13.5px; }
.audit-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border-strong); }
.audit-table td { padding: 10px; border-bottom: 0.5px solid var(--border); color: var(--text-secondary); vertical-align: top; }
.audit-log { margin-bottom: 18px; }
.audit-claim { margin-bottom: 14px; }
.audit-aggregate { margin-top: 4px; }
.audit-footer { font-size: 12.5px; color: var(--text-muted); text-align: center; margin: 24px 0 8px; }

@media print {
  body { padding: 0; background: white; }
  .no-print { display: none !important; }
  .panel, .claim-card, .audit-doc, .audit-rule { break-inside: avoid; border: 0.5px solid #ccc; }
}
