/* The investigation workspace shares the landing page's restrained palette. */

:root {
  --bg: #f5f5f3;
  --card: #fff;
  --line: #d8d8d6;
  --line-soft: #e9e9e8;
  --tint: #eeeeec;
  --navy: #171717;
  --navy-2: #303030;
  --navy-3: #626262;
  --blue: #171717;
  --blue-soft: #ebebea;
  --blue-text: #171717;
  --sky: #f2f2f1;
  --text: #171717;
  --muted: #626262;
  --faint: #707070;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --amber-soft: #fef3c7;
  --amber: #92400e;
  --radius: 10px;
  --sans: 'Instrument Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --num: 'Instrument Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
button { font: inherit; }
a, button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid #555555; outline-offset: 3px; }
main:focus { outline: none; }
.skip-link { position: fixed; top: 8px; left: 16px; z-index: 100; padding: 12px 16px; background: var(--navy); color: white; border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 16px 32px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.topbar-left { display: flex; align-items: center; gap: 32px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; text-decoration: none; color: var(--text); white-space: nowrap; letter-spacing: -.03em; }
.brand svg { flex: none; }
.brand span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.nav a:hover { background: var(--bg); color: var(--navy); }
.nav a.active { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.pill { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: var(--tint); color: var(--muted); white-space: nowrap; }
.pill.on { background: var(--ok-soft); color: var(--ok); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }

.view { max-width: 1320px; margin: 0 auto; padding: 32px 40px 64px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.view > *, .card, .hero-main, .clock { min-width: 0; }

/* ---------- building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 2px 8px rgba(11,27,63,.025); }
.card h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.025em; }
.review-summary { margin: 16px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.claim-item { border-top: 1px solid var(--line); padding: 15px 0 13px; }
.claim-item > p { margin: 0 0 10px; }
.claim-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.claim-status { margin-right: auto; color: var(--faint); font-size: 12px; font-weight: 650; }
.claim-controls button { border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--muted); padding: 6px 9px; font: 650 11px var(--sans); cursor: pointer; }
.claim-controls button:hover { border-color: var(--navy-3); color: var(--text); }
.claim-item[data-review="approved"] .claim-status, .claim-approve[aria-pressed="true"] { color: var(--ok); }
.claim-item[data-review="flagged"] .claim-status, .claim-flag[aria-pressed="true"] { color: var(--danger); }
.claim-approve[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-soft); }
.claim-flag[aria-pressed="true"] { border-color: var(--danger); background: var(--danger-soft); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-title { display: flex; gap: 8px; align-items: center; }
.section-count { border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font: 600 12px/24px var(--num); color: var(--muted); }
.section-description { margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--faint); }
.table-hint { display: none; }
@media (min-width: 721px) and (max-width: 1180px) { .table-hint { display: block; color: var(--faint); font-size: 12px; margin: -8px 0 16px; } }
.kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--tint); color: var(--muted); white-space: nowrap; }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.blue { background: var(--blue-soft); color: var(--blue-text); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 8px; cursor: pointer; min-height: 44px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-size: 15px;
  transition: transform .1s, background .15s;
}
.btn:hover { background: var(--tint); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .chip:focus-visible, .linkbtn:focus-visible { outline: 3px solid #555555; outline-offset: 2px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; box-shadow: 0 2px 3px rgba(23,42,32,.12); }
.btn.primary:hover { background: var(--navy-2); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.white { background: #fff; border-color: #fff; color: var(--navy); font-weight: 800; }
.btn.ghost-dark { background: transparent; border-color: var(--navy-3); color: #fff; }
.btn.ghost-dark:hover { background: var(--navy-2); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 700; font-size: 13px; cursor: pointer; }

.banner { padding: 12px 16px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-text); font-size: 14px; }
.banner.warn { background: var(--danger-soft); color: var(--danger); }

/* ---------- queue ---------- */
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.page-kicker { display: block; margin-bottom: 8px; color: var(--blue); }
.q-head h1 { margin: 0; font-size: 36px; line-height: 1.2; font-weight: 700; letter-spacing: -0.045em; text-wrap: balance; }
.q-head p { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { border-radius: var(--radius); padding: 24px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.stat .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat .value { font-family: var(--num); font-size: 38px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; }
.stat-unit { font: 500 13px var(--sans); color: var(--faint); letter-spacing: 0; }
.stat .sub { font-size: 13px; color: var(--muted); }
.stat.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.stat.navy .label { color: #bcd4c1; }
.stat.navy .sub { color: var(--sky); }
.stat.red .label, .stat.red .value { color: var(--danger); }
.stat-loading > * { display: block; background: var(--tint); border-radius: 4px; animation: skeleton-pulse 1.5s ease-in-out infinite; }
.stat-loading span { width: 55%; height: 16px; }
.stat-loading b { width: 70%; height: 40px; }
@keyframes skeleton-pulse { 50% { opacity: .4; } }
.queue-failure { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.queue-awaiting .queue-card, .queue-awaiting .deadline-card, .queue-awaiting .studio-card { display: none; }
#paypal-banner:empty { display: none; }
.queue-card .card-head { margin-bottom: 24px; }
.search-wrap { position: relative; display: flex; align-items: center; color: var(--faint); }
.search-wrap svg { position: absolute; left: 12px; pointer-events: none; }
.search-wrap .search { padding-left: 40px; border-radius: 8px; background: var(--bg); }
.studio-card { background: var(--card); }
.studio-card .kicker { display: block; margin-bottom: 4px; }
.studio-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#studio-hint { margin: 0; max-width: 760px; font-size: 14px; line-height: 1.7; }
#studio-panel:not(.hidden) { margin-top: 20px; }
.grid-empty { padding: 24px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.grid-empty span { color: var(--faint); font-size: 13px; }
.timeline-scroll { overflow-x: auto; border-radius: 12px; }

#timeline { height: 280px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.tl-fallback { font-size: 14px; color: var(--muted); padding: 12px 0; }

#studio-panel:not(.hidden) { height: 560px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }

/* AG Grid: light quartz theme in our colors */
.grid { width: 100%; }
.grid.ag-theme-quartz {
  --ag-background-color: #ffffff;
  --ag-header-background-color: #edf1ea;
  --ag-odd-row-background-color: #ffffff;
  --ag-row-hover-color: #e9efe7;
  --ag-border-color: var(--line);
  --ag-row-border-color: var(--line-soft);
  --ag-foreground-color: var(--text);
  --ag-header-foreground-color: var(--faint);
  --ag-font-family: var(--sans);
  --ag-font-size: 14px;
  --ag-wrapper-border-radius: 12px;
  --ag-header-height: 44px;
  --ag-cell-horizontal-padding: 16px;
}
/* Use SVGs for common grid controls instead of private-use icon-font glyphs.
   Some browser/font combinations render those glyphs as filled squares. */
.grid .ag-icon-filter::before,
.grid .ag-icon-asc::before,
.grid .ag-icon-desc::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background: transparent center / 16px 16px no-repeat;
}
.grid .ag-icon-filter::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M2 4h12M4 8h8M6.5 12h3'/%3E%3C/svg%3E");
}
.grid .ag-icon-asc::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 7 5-5 5 5M8 2v12'/%3E%3C/svg%3E");
}
.grid .ag-icon-desc::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 9 5 5 5-5M8 2v12'/%3E%3C/svg%3E");
}
.grid .ag-header-cell-text { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.grid .ag-row { cursor: pointer; }
.grid .ag-cell { display: flex; align-items: center; line-height: 1.4; }
.grid .tag { line-height: 1.3; }
.grid .ag-cell-wrapper, .grid .ag-cell-value { width: 100%; }
.grid .ag-cell-value { display: flex; align-items: center; }
.grid .ag-cell-value > .tag { flex: none; }
.cell-stack { display: flex; flex-direction: column; justify-content: center; line-height: 1.35; min-width: 0; }
.cell-stack .main { font-weight: 700; font-size: 15px; }
.cell-stack .sub { color: var(--faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tleft { font-family: var(--num); font-weight: 700; font-size: 16px; }
.tleft.urgent { color: var(--danger); }
.amt { font-family: var(--num); font-weight: 700; font-size: 16px; }

/* ---------- case: hero ---------- */
.case-nav { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--faint); }
.case-nav a { color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
.case-nav a:hover { color: var(--blue); }
.case-nav-divider { color: #d8d8d6; }
#case-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-nav-note { margin-left: auto; font-size: 12px; white-space: nowrap; }
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; }
.hero-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.hero-main .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.amount-label { margin-top: 8px; }
.hero-main .amount { margin: -8px 0 0; font-family: var(--num); font-size: 64px; line-height: 1.05; font-weight: 700; letter-spacing: -0.05em; }
.hero-main .lede { margin: 0; font-size: 17px; line-height: 1.6; color: #3f4c54; max-width: 560px; }
.hero-main .who { font-size: 14px; color: var(--faint); }

.clock { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; justify-content: space-between; }
.clock .label { font-size: 14px; font-weight: 700; color: #bbbbbb; }
.boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.box { background: var(--navy-2); border-radius: 14px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.box b { font-family: var(--num); font-size: 32px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.box span { font-size: 12px; color: var(--sky); font-weight: 600; }
.lines { display: flex; flex-direction: column; gap: 10px; }
.line .row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.line .row span { color: #f2f2f1; font-weight: 600; }
.line .row b { font-family: var(--num); font-weight: 700; }
.line .bar { height: 8px; display: flex; margin-top: 5px; }
.line .bar i { border-radius: 4px; background: #657d89; }
.line.you .row span, .line.you .row b { color: #fecaca; }
.line.you .bar i { background: #f87171; min-width: 6px; transition: width 1s linear; }
.clock .src { font-size: 11px; color: #b5c6ca; }
.clock .src a { color: #f2f2f1; }

/* ---------- case: the three cards ---------- */
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.three > div { border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 12px; background: var(--card); border: 1px solid var(--line); }
.three .big { margin: 0; font-size: 17px; line-height: 1.55; font-weight: 600; }
.three .note { font-size: 13px; color: var(--muted); }
.three .real { background: var(--blue); border-color: var(--blue); color: #fff; }
.three .real .kicker { color: var(--sky); }
.three .real .note { color: #f2f2f1; }
.summary-clipped:not(.expanded) .big, .summary-clipped:not(.expanded) .note { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.summary-clipped:not(.expanded) .big { -webkit-line-clamp: 5; }
.summary-clipped:not(.expanded) .note { -webkit-line-clamp: 2; }
.summary-more { align-self: flex-start; padding: 4px 0; border: 0; background: none; color: #fff; font: 600 13px var(--sans); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; min-height: 44px; }
.three .waiting .big { color: var(--faint); font-weight: 600; }
.meter { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #f2f2f1; }
.meter .track { flex: 1; height: 6px; border-radius: 3px; background: #607783; display: flex; }
.meter .track i { border-radius: 3px; background: #fff; width: 0; transition: width .8s ease-out; }
mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- case: run controls ---------- */
.runbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--card); padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.runbar .hint { margin-left: auto; font-size: 12px; color: var(--faint); line-height: 1.7; }
.sandbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 10px 14px; border-radius: 14px; background: var(--tint); }
.sandbox .btn { padding: 8px 12px; font-size: 13px; border-radius: 10px; }

/* ---------- case: agent trail + evidence ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.stage { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px 16px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.stage:last-child { border-bottom: 0; }
.stage .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--num); font-size: 13px; font-weight: 700; background: var(--tint); color: var(--faint); }
.stage.running .dot { background: var(--blue-soft); color: var(--blue); border: 3px solid var(--blue); border-right-color: transparent; animation: spin .9s linear infinite; font-size: 0; }
.stage.done .dot { background: var(--blue); color: #fff; }
.stage.done.final .dot { background: var(--ok); }
.stage.awaiting .dot { background: var(--amber-soft); color: var(--amber); }
@keyframes spin { to { transform: rotate(360deg); } }
.stage .title { font-weight: 700; font-size: 16px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stage .sum { font-size: 14px; color: var(--muted); font-weight: 500; }
.stage.pending .title { color: var(--faint); font-weight: 600; }
.stage .more { display: none; margin-left: auto; font-size: 13px; font-weight: 700; color: var(--blue); }
.stage.done:not(.final) .title { cursor: pointer; }
.stage.done:not(.final) .more { display: inline; }
.stage.done:not(.collapsed) .more { color: var(--faint); }
.stage.collapsed .stage-body { display: none; }
.stage-body { grid-column: 2; display: flex; flex-direction: column; gap: 8px; }
.stage-body:empty { display: none; }
.stage-body > * { animation: rise .25s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.panel { border-radius: 16px; background: var(--bg); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.panel h4 { margin: 0; font-size: 13px; font-weight: 800; color: var(--muted); }
.evidence-gaps { display: grid; gap: 16px; scroll-margin-top: 88px; }
.evidence-gaps p { margin: 0; line-height: 1.6; }
.evidence-gaps .panel { padding: 16px; gap: 8px; }
.evidence-gaps .panel h3 { margin: 0; font-size: 16px; }
.evidence-gaps > .btn { justify-self: start; }
@media (max-width: 720px) { .evidence-gaps { scroll-margin-top: 200px; } }
.step-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.step-line b { color: var(--text); font-weight: 600; }
.finding { border-radius: 14px; background: var(--bg); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.finding .f-text { font-size: 15px; font-weight: 600; }
.finding .f-why { font-size: 13px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--blue); background: var(--blue-soft); border: 0; }
.chip:hover { background: #e2e8e9; }
.chip.paypal { color: #075985; background: #e0f2fe; }
.chip.against { color: var(--danger); background: var(--danger-soft); }
.vague { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 14px; font-size: 14px; }
.vague .ph { font-weight: 700; }
.vague .mean { color: var(--muted); }
.qlist { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.hyp { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 6px 16px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hyp:first-of-type { border-top: 0; }
.hyp .h-label { font-weight: 700; font-size: 14px; }
.hyp .h-exp { font-size: 13px; color: var(--muted); }
.hyp .h-bar { height: 8px; border-radius: 4px; background: var(--line); display: flex; }
.hyp .h-bar i { border-radius: 4px; background: #94a3b8; width: 0; transition: width .8s ease-out; }
.hyp.top .h-bar i { background: var(--blue); }
.hyp .h-pct { font-family: var(--num); font-weight: 700; font-size: 13px; text-align: right; }
.plan-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 80px; gap: 12px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.plan-row:first-of-type { border-top: 0; }
.strength { font-size: 12px; font-weight: 800; text-align: right; }
.strength.STRONG { color: var(--ok); }
.strength.MODERATE { color: var(--amber); }
.strength.WEAK { color: var(--danger); }
.verify-big { font-family: var(--num); font-size: 30px; font-weight: 700; color: var(--ok); }
.raw-toggle { background: none; border: 0; padding: 0; font-size: 12px; color: var(--faint); cursor: pointer; text-align: left; font-weight: 600; }
.raw { font-size: 12px; color: var(--faint); white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 10px 12px; max-height: 0; overflow: hidden; padding-block: 0; transition: max-height .2s; }
.raw.open { max-height: 480px; overflow: auto; padding-block: 10px; }
.pacing { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); }
.pacing .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; }

/* PayPal APIs used this run (intake stage) */
.pp-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.pp-row b { font-weight: 700; min-width: 170px; }
.pp-row .pp-src { color: var(--muted); }
.pp-row .pp-dot { width: 8px; height: 8px; border-radius: 50%; background: #d8d8d6; flex: none; }
.pp-row.live .pp-dot { background: var(--ok); }
.pp-row.live .pp-src { color: var(--ok); font-weight: 600; }

/* Explain this to me (plain-English letter) */
/* A real button, not a small text link - this is a genuine feature (plain language for the
   freelancer, not the bank), not a footnote, so it needs to actually be seen. */
.explain-toggle { margin: 2px 0 4px; align-self: flex-start; background: var(--blue-soft); border-color: var(--blue-soft); color: var(--blue-text); font-size: 14px; padding: 10px 16px; }
.explain-toggle:hover { background: #e2e8e9; }
.explain { margin: 4px 0 14px; border: 1px dashed var(--blue); background: var(--blue-soft); font-size: 15px; line-height: 1.55; }
.explain p + p { margin-top: 10px; }

.evidence { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100dvh - 112px); overflow-y: auto; scrollbar-width: thin; }
.doc { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; color: inherit; }
.doc:hover { background: var(--bg); }
.doc .ld { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background .3s, box-shadow .3s; }
.doc .lt { font-size: 14px; font-weight: 600; line-height: 1.3; }
.doc .ls { font-size: 12px; color: var(--faint); }
.doc.opened .ld { background: #bbbbbb; }
.doc.cited .ld { background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.doc.pulse { animation: pulse .9s ease-out; }
@keyframes pulse { from { background: var(--blue-soft); } to { background: transparent; } }
.src-paypal { font-size: 11px; font-weight: 800; color: #075985; }

/* ---------- case: the response ---------- */
.result { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
#result { scroll-margin-top: 96px; }
#result > * + * { margin-top: 24px !important; }
.letter h3 { margin: 6px 0 4px; font-size: 24px; line-height: 1.25; font-weight: 800; letter-spacing: -0.02em; }
.letter .lmeta { font-size: 13px; color: var(--faint); margin-bottom: 12px; }
.letter p { margin: 0 0 12px; font-size: 16px; line-height: 1.6; }
.letter p.removed { color: var(--faint); text-decoration: line-through; }
.letter .fn { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; margin-left: 4px; background: var(--blue-soft); color: var(--blue); border: 0; cursor: pointer; vertical-align: 2px; }
.files { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.files a { color: var(--navy); padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: var(--bg); }
.files a:hover { border-color: #aebbc0; }
.msg { white-space: pre-wrap; font-size: 15px; line-height: 1.55; }
.action { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.action:first-of-type { border-top: 0; }
.action .a-label { font-weight: 700; font-size: 15px; }
.action .a-note { font-size: 13px; color: var(--faint); }
.ok { color: var(--ok); font-weight: 700; font-size: 13px; }
.bad { color: var(--danger); font-weight: 700; font-size: 13px; }
pre.req { width: 100%; margin: 6px 0 0; padding: 12px; border-radius: 10px; background: var(--bg); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); max-height: 260px; overflow: auto; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-radius: 10px; background: var(--navy); color: #fff; padding: 20px 24px; }
.cta .t { font-size: 20px; font-weight: 800; }
.cta .s { font-size: 14px; color: var(--sky); }
.cta .btns { display: flex; gap: 10px; flex-wrap: wrap; }
/* After sending, the bar itself shows the real outcome - colour plus an icon, not just text. */
.cta.sent .t::before { margin-right: 8px; }
.cta.sent.ok { background: #065f46; }
.cta.sent.ok .t::before { content: '✓'; }
.cta.sent.ok .s { color: #a7f3d0; }
.cta.sent.warn { background: var(--amber, #92400e); }
.cta.sent.warn .t::before { content: '⚠'; }
.cta.sent.warn .s { color: #fde68a; }
.cta.sent.bad { background: var(--danger, #b42318); }
.cta.sent.bad .t::before { content: '✗'; }
.cta.sent.bad .s { color: #fecaca; }

/* ---------- drawer ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100vw); z-index: 40; background: var(--card); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .2s ease-out; display: flex; flex-direction: column; box-shadow: -16px 0 48px rgba(11,27,63,.08); }
.drawer.open { transform: none; }
.scrim { position: fixed; inset: 0; background: rgba(11, 27, 63, .35); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; justify-content: space-between; gap: 16px; padding: 24px; border-bottom: 1px solid var(--line); background: #fff; }
.drawer-kicker { font-size: 12px; font-weight: 800; color: var(--blue); }
.drawer-title { font-size: 18px; font-weight: 800; }
.icon-btn { background: var(--tint); border: 0; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 16px; color: var(--muted); flex: none; }
.drawer-body { padding: 24px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.sec { padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.sec .sh { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.sec .st { font-size: 14px; color: var(--muted); line-height: 1.55; }
.sec.hl { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); }
.sec.hl .st { color: var(--text); }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 420px; padding: 12px 16px; border-radius: 14px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(8px); transition: all .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .work, .result { grid-template-columns: 1fr; }
  .evidence { position: static; max-height: none; }
  .topbar-left { gap: 16px; }
  .topbar-right .pill { display: none; }
  .case-nav-note { display: none; }
}
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .view { padding: 24px 16px 48px; gap: 20px; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .topbar-left { display: contents; }
  .brand { grid-column: 1; font-size: 14px; min-width: 0; }
  .brand svg { width: 22px; }
  .topbar-right { grid-column: 2; grid-row: 1; }
  .topbar-right .who-name { max-width: 72px; }
  .topbar-right .btn.pp-btn { font-size: 11px; padding: 8px; }
  .nav { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--line-soft); padding-top: 8px; }
  .nav a { min-height: 40px; display: inline-flex; align-items: center; }
  .topbar-right .pill { display: none; }
  .three { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 20px; gap: 8px; }
  .stat.navy { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .stat.navy .value { grid-column: 2; grid-row: 1 / 3; }
  .stat .value { font-size: 30px; }
  .stat-unit { display: block; margin-top: 4px; }
  .stat .sub { font-size: 12px; }
  .card, .three > div { padding: 20px; }
  .hero-main { padding: 24px; }
  .hero-main .amount { font-size: 56px; }
  .hero-main .lede { font-size: 16px; }
  .q-head h1 { font-size: 30px; }
  .q-head { gap: 16px; }
  .search-wrap { width: 100%; }
  .search-wrap .search { width: 100%; min-width: 0; }
  .table-hint { display: block; color: var(--faint); font-size: 12px; margin: -8px 0 16px; }
  .timeline-scroll #timeline { min-width: 680px; }
  .runbar { padding: 16px; }
  .runbar > .btn { flex: 1; }
  .runbar .hint { width: 100%; margin-left: 0; }
  .runbar .hint br { display: none; }
  .runbar .hint br::after { content: ' '; }
  .studio-actions { width: 100%; }
  .studio-actions .btn { flex: 1; padding: 12px; font-size: 13px; }
  .drawer-head, .drawer-body { padding: 20px; }
  .case-nav { font-size: 12px; }
  #result { scroll-margin-top: 144px; }
  .evidence-gaps { scroll-margin-top: 144px; }
  .vague, .hyp, .plan-row { grid-template-columns: 1fr; }
}

/* Short-by-default letter and focused source drawer */
.letter > .linkbtn { display: block; margin: 2px 0 14px; }
.drawer-why { font-size: 14px; color: var(--muted, #475569); }
.drawer-body > .linkbtn { align-self: flex-start; margin-top: 4px; }

.concern { padding: 8px 0; border-top: 1px solid var(--line, #e5e7eb); }
.concern:first-of-type { border-top: 0; }

/* Label/value list for structured records (e.g. PayPal payments) */
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 6px 0 0; font-size: 15px; }
.fields dt { color: var(--faint); font-weight: 600; }
.fields dd { margin: 0; color: var(--ink, #171717); overflow-wrap: anywhere; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--faint); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
/* Short bars: let the "time left" label run past the end of the bar instead of being cut off */
#timeline .b-sch-event, #timeline .b-sch-event-wrap, #timeline .b-sch-event-content { overflow: visible !important; }
#timeline .b-sch-event-content { white-space: nowrap; }

/* The freelancer's own evidence */
.nudge { background: #ebebea; border: 1px solid #f2f2f1; color: var(--navy); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; margin: 6px 0 10px; }
.src-you { color: #047857; font-weight: 700; }
.doc { cursor: pointer; }
.icon-btn.sm { width: 26px; height: 26px; font-size: 12px; flex: none; align-self: center; }
.add-ev { width: 100%; margin-top: 10px; }
.ev-form { display: flex; flex-direction: column; gap: 14px; }
.ev-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; color: var(--navy); }
.ev-form label.linkbtn { display: inline; }
.ev-form input, .ev-form select, .ev-form textarea { font: inherit; font-weight: 400; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); }
.ev-form textarea { resize: vertical; min-height: 180px; }
.ev-form input:focus, .ev-form select:focus, .ev-form textarea:focus { outline: 3px solid #bbbbbb; outline-offset: 0; border-color: var(--blue); }
.ev-file { font-size: 14px; color: var(--faint); }
.doc:has(.icon-btn) { grid-template-columns: 10px minmax(0, 1fr) 26px; }
.src-you { font-size: 11px; font-weight: 800; }

/* Evidence card tabs + dispute search */
.tabs { display: flex; gap: 6px; margin: 14px 0 12px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 4px; margin-right: 14px; font: inherit; font-weight: 700; font-size: 14px; color: var(--faint); cursor: pointer; }
.tab.on { color: var(--navy); border-bottom-color: var(--blue); }
.count { font-weight: 800; color: var(--blue); }
.search { font: inherit; font-size: 14px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; min-width: 280px; background: #fff; color: var(--navy); }
.search:focus { outline: 3px solid #bbbbbb; outline-offset: 0; border-color: var(--blue); }
.grid .ag-row-pinned { background: var(--tint, #f5f7fb); font-weight: 700; }
@media (max-width: 640px) { .search { min-width: 0; width: 100%; } }

/* Deadline bars: black with white text; urgent ones (due within 2 days) get a white dot.
   Disputes not worked out yet are outlined instead of filled. */
#timeline .b-sch-event { border-radius: 6px !important; background: var(--navy) !important; }
#timeline .b-sch-event.tl-todo { background: #fff !important; box-shadow: inset 0 0 0 1.5px var(--navy); }
#timeline .b-sch-event-content { color: #fff !important; font-weight: 700; padding-left: 6px; }
#timeline .tl-todo .b-sch-event-content { color: #111 !important; }
#timeline .tl-urgent .b-sch-event-content::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; margin-right: 7px; flex: none; }
#timeline .tl-todo.tl-urgent .b-sch-event-content::before { background: #111; }
.tl-legend .chip-dot { width: 22px; height: 12px; border-radius: 4px; background: var(--navy); position: relative; }
.tl-legend .chip-dot::after { content: ''; position: absolute; left: 5px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.tl-legend .chip { width: 22px; height: 12px; border-radius: 4px; background: var(--navy); }
.tl-legend .chip.hollow { background: #fff; box-shadow: inset 0 0 0 1.5px #111; }
/* The "Now" marker sits under the timeline, pointing up at the current time */
.card:has(#timeline) { position: relative; }
.now-marker { position: absolute; transform: translateX(-50%); margin-top: 8px; background: #111; color: #fff; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.card:has(#timeline) { padding-bottom: 44px; }

.btn.small { padding: 7px 12px; font-size: 13px; text-decoration: none; }
.who-signed { display: inline-flex; align-items: center; gap: 8px; }
.who-name { font-weight: 700; font-size: 14px; color: var(--navy); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
/* Toast at the top, clear of the send bar */
.toast { top: auto; bottom: 24px; right: 24px; transform: translateY(8px); max-width: min(420px, calc(100vw - 32px)); }
.toast.show { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Developer tools for the sandbox, folded away */
details.sandbox > summary { cursor: pointer; font-weight: 700; color: var(--faint); font-size: 13px; }
details.sandbox[open] { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
details.sandbox[open] > summary { width: 100%; }
.stage .title:focus-visible { outline: 3px solid #bbbbbb; outline-offset: 2px; border-radius: 8px; }

.pp-btn { gap: 7px; }
.pp-btn .pp-logo { width: 16px; height: 16px; flex: none; }

/* "Aha" moment: the real-complaint card pops, rings gold once, and its words arrive in order */
.three .real.reveal { animation: aha-pop .7s cubic-bezier(.2,.9,.3,1.3), aha-ring 1.6s ease-out .2s; }
.three .real.reveal .w { display: inline-block; opacity: 0; transform: translateY(6px); animation: aha-word .35s ease-out forwards; animation-delay: calc(.25s + var(--i) * 45ms); }
@keyframes aha-pop { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: none; } }
@keyframes aha-ring { 0% { box-shadow: 0 0 0 0 rgba(255,196,57,.9); } 100% { box-shadow: 0 0 0 22px rgba(255,196,57,0); } }
@keyframes aha-word { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .three .real.reveal, .three .real.reveal .w { animation: none; opacity: 1; transform: none; } }

/* First-visit tour */
#tour { position: fixed; inset: 0; z-index: 80; }
.tour-spot { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(5,13,34,.62); transition: all .35s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.tour-tip { position: fixed; width: min(340px, calc(100vw - 32px)); background: #fff; border-radius: 16px; padding: 18px 20px; box-shadow: 0 24px 60px rgba(5,13,34,.35); transition: top .35s, left .35s; }
.tour-tip h4 { margin: 6px 0 6px; font-size: 18px; color: var(--navy); }
.tour-tip p { margin: 0 0 14px; color: var(--muted); line-height: 1.45; }
.tour-btns { display: flex; justify-content: space-between; align-items: center; }
/* Automatic judge-mode stage explanations, independent of the first-visit tour. */
.stage-narration { position: fixed; inset: 0; z-index: 79; pointer-events: none; }
.stage-narration-spot { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(5,13,34,.62); }
.stage-narration-tip { position: fixed; width: min(340px, calc(100vw - 32px)); max-height: calc(100dvh - 96px); overflow: auto; pointer-events: auto; background: #fff; border-radius: 16px; padding: 18px 20px; box-shadow: 0 24px 60px rgba(5,13,34,.35); }
.stage-narration-tip h4 { margin: 6px 0; font-size: 18px; color: var(--navy); }
.stage-narration-tip p { margin: 0; color: var(--muted); line-height: 1.45; }
.big-btn { padding: 13px 20px; font-size: 15px; }

.demo-playback { position: sticky; top: 76px; z-index: 80; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 4px 16px #17171712; }
.demo-playback > div:first-child { flex: 1; min-width: 180px; }
.demo-playback span { display: block; font-size: 13px; color: var(--muted); }
.demo-playback-buttons { display: flex; gap: 8px; }
.demo-playback small { flex-basis: 100%; color: var(--muted); }
.demo-playback .btn { min-height: 44px; }
@media(max-width: 600px) { .demo-playback { top: 112px; padding: 12px; } .demo-playback-buttons { width: 100%; } .demo-playback-buttons .btn { flex: 1; padding: 8px; } }
