/* Marshall broker portal. Same navy/teal and severity colours as the PDF
   reports (skill/loan-compliance/templates/report.css), and the same faces
   (Georgia headings, Helvetica text) — the CSP allows no outside fonts. */
:root {
  --navy: #0a2e3f; --teal: #0d6b6e; --teal-soft: #e8f4f4;
  --bg: #f5f7f9; --surface: #ffffff; --ink: #1a2530; --muted: #56677a; --line: #d9e1e6;
  --critical: #c0392b; --critical-bg: #fdf1ef; --high: #c26a06; --high-bg: #fef4e8;
  --medium: #9a7c08; --medium-bg: #fdf8e6; --low: #1e8449; --ok: #1e8449; --ok-bg: #edf8f1;
  --na: #6b7b8d; --na-bg: #eef1f4; --fix-bg: #ecf8f4; --fix-line: #a0d4c4; --evid-bg: #f0f3f6;
  --yellow: #fff3cd; --yellow-line: #e8b923; --bar: #0a2e3f; --bar-ink: #ffffff;
  --trial-bg: #fff7ed; --trial-line: #f0c38a; --shadow: rgba(10, 46, 63, .08);
  --display: Georgia, "Times New Roman", serif;
  --body: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #9fd3d6; --teal: #4fb3b6; --teal-soft: #12363a;
    --bg: #0d1820; --surface: #13222c; --ink: #e3ebf0; --muted: #9aabb8; --line: #263b48;
    --critical: #f07466; --critical-bg: #3a1c19; --high: #f0a04b; --high-bg: #3a2812;
    --medium: #e0c25a; --medium-bg: #332c10; --low: #5cc98a; --ok: #5cc98a; --ok-bg: #12301f;
    --na: #9aabb8; --na-bg: #1d2c36; --fix-bg: #10302a; --fix-line: #2f6e60; --evid-bg: #1a2a35;
    --yellow: #4a3d10; --yellow-line: #b8921f; --bar: #071219; --bar-ink: #e3ebf0;
    --trial-bg: #33240f; --trial-line: #8a6430; --shadow: rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* beats display:grid/flex on tabs, progress */
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--body); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: 1.85rem; line-height: 1.2; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--teal); }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-family: var(--mono); font-size: .82em; }
.inline { display: inline; }
.stack { display: grid; gap: 16px; }
.eyebrow { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); font-weight: 700; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.pad { padding: 18px 20px; }

/* top bar */
.bar { background: var(--bar); color: var(--bar-ink); display: flex; flex-wrap: wrap; gap: 10px 20px;
  align-items: center; justify-content: space-between; padding: 12px 24px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--bar-ink); text-decoration: none; }
.brand b { font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.brand span { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.bar nav { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: .9rem; }
.bar nav a.navlink { color: var(--bar-ink); opacity: .85; text-decoration: none; }
.who { opacity: .7; font-size: .82rem; }
.linkbtn { background: none; border: 0; color: var(--bar-ink); opacity: .85; cursor: pointer; padding: 0; font-size: .9rem; text-decoration: underline; }
main { max-width: 1180px; margin: 0 auto; padding-inline: 16px; padding-block: 26px 48px; display: grid; gap: 22px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 6px; padding: 9px 16px;
  cursor: pointer; background: var(--teal); color: var(--surface); font-weight: 600; text-decoration: none; font-size: .92rem; }
.btn.ghost { background: transparent; color: var(--teal); border: 1px solid var(--teal); }
.btn.sm { padding: 6px 11px; font-size: .84rem; }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; }
.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; }

/* sign in */
.signin { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 10px 30px var(--shadow); margin-top: 20px; }
.signin .pitch { background: #0a2e3f; color: #ffffff; padding: 44px 40px; display: grid; align-content: center; gap: 18px; }
.signin .pitch h1 { color: #ffffff; font-size: 2.1rem; }
.signin .pitch p { opacity: .85; max-width: 46ch; }
.signin .pitch .eyebrow { color: #a8d8da; }
.steps { display: grid; gap: 10px; margin: 6px 0 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; opacity: .92; }
.steps b { width: 24px; height: 24px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; font-size: .78rem; }
.signin .form { padding: 44px 40px; display: grid; align-content: center; gap: 16px; background: var(--surface); }
.signin form { display: grid; gap: 10px; }
.signin input[type=email] { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: var(--surface); color: var(--ink); }
.narrow { max-width: 520px; margin: 40px auto 0; }

/* history */
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.search { flex: 1 1 240px; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; background: var(--surface); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: .84rem; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.chip i { font-style: normal; color: var(--muted); margin-left: 4px; }
.scroll { overflow-x: auto; }
table.hist { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 720px; }
.hist th { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.hist td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.hist tr.row:hover td { background: var(--teal-soft); }
.hist tr.version td { background: var(--bg); padding-block: 9px; font-size: .86rem; }
.hist tr.version td:first-child { padding-left: 34px; }
.hist .file a, .hist .file b { font-weight: 600; text-decoration: none; color: var(--ink); }
.hist .file a:hover { color: var(--teal); text-decoration: underline; }
.hist .file small { display: block; color: var(--muted); }
.twist { border: 0; background: none; color: var(--teal); cursor: pointer; font-size: .8rem; padding: 2px 0 0; }
.src { display: inline-block; font-size: .72rem; padding: 2px 7px; border-radius: 4px; background: var(--na-bg); color: var(--na); font-weight: 700; letter-spacing: .04em; }
.src.portal { background: var(--teal-soft); color: var(--teal); }
.empty { padding: 28px 20px; text-align: center; display: grid; gap: 10px; justify-items: center; }

/* status pills and severity counts */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ready { background: var(--ok-bg); color: var(--ok); }
.pill.busy { background: var(--teal-soft); color: var(--teal); }
.pill.attention { background: var(--high-bg); color: var(--high); }
.pill.declined { background: var(--na-bg); color: var(--na); }
.sevs { display: flex; gap: 4px; flex-wrap: wrap; }
.sev { min-width: 26px; text-align: center; font-size: .76rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.sev.critical { background: var(--critical-bg); color: var(--critical); }
.sev.high { background: var(--high-bg); color: var(--high); }
.sev.medium, .sev.low { background: var(--medium-bg); color: var(--medium); }

/* upload */
.upgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field input[type=text] { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: var(--surface); color: var(--ink); }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 34px 20px; text-align: center; display: grid; gap: 8px;
  justify-items: center; background: var(--surface); transition: border-color .15s, background .15s; cursor: pointer; }
.drop.over { border-color: var(--teal); background: var(--teal-soft); }
.drop .icon { width: 46px; height: 46px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }
.drop strong { font-family: var(--display); font-size: 1.15rem; font-weight: 600; }
.drop input[type=file] { max-width: 100%; }
.js .drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.files li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto 28px; gap: 10px; align-items: center;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: .9rem; }
.files li.bad { border-color: var(--critical); background: var(--critical-bg); }
.files .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .kind { font-size: .76rem; padding: 2px 8px; border-radius: 4px; background: var(--teal-soft); color: var(--teal); font-weight: 600; white-space: nowrap; }
.files li.bad .kind { background: transparent; color: var(--critical); }
.files .size { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; white-space: nowrap; }
.files .tick { color: var(--ok); font-weight: 700; }
.files li.bad .tick { color: var(--critical); }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.15rem; line-height: 1; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--teal); transition: width .2s linear; }
.error { color: var(--critical); font-weight: 600; }
.side { padding: 18px; display: grid; gap: 12px; font-size: .9rem; }
.side ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.notice { padding: 14px 18px; border-left: 4px solid var(--teal); display: grid; gap: 6px; }

/* result page */
.qc { padding: 16px 20px; display: grid; gap: 8px; border-left: 4px solid var(--ok); }
.qc.warn { border-left-color: var(--high); }
.qc ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.qc .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.detail > div { display: grid; gap: 16px; min-width: 0; }
.detail aside { display: grid; gap: 16px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; color: var(--muted); padding: 10px 14px; cursor: pointer; font-weight: 600;
  font-size: .92rem; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button i { font-style: normal; font-weight: 400; font-size: .76rem; margin-left: 4px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--teal); }
.tabs button.trial[aria-selected="true"] { border-color: var(--high); }
.explain { font-size: .86rem; color: var(--muted); }
.tabpanel { display: grid; gap: 16px; }
.no-js .tabpanel + .tabpanel { border-top: 2px solid var(--line); padding-top: 16px; }
.summary { padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.summary > div:first-child { display: grid; gap: 4px; }
.summary.trial, .trialbox { background: var(--trial-bg); border: 1px dashed var(--trial-line); }
.trialnote { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--high); }
.tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.tile { min-width: 74px; border-radius: 6px; padding: 8px 10px; text-align: center; }
.tile b { display: block; font-size: 1.45rem; font-family: var(--display); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile span { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.tile.critical { background: var(--critical-bg); color: var(--critical); }
.tile.high { background: var(--high-bg); color: var(--high); }
.tile.medium { background: var(--medium-bg); color: var(--medium); }
.tile.na { background: var(--na-bg); color: var(--na); }
.waiting { padding: 22px 20px; display: grid; gap: 6px; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--teal-soft); border-top-color: var(--teal); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -1px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.finding { border-top: 1px solid var(--line); padding: 16px 20px; display: grid; gap: 10px; }
.finding:first-child { border-top: 0; }
.fhead { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.fhead h3 { font-family: var(--body); font-size: 1rem; font-weight: 600; }
.badge { font-size: .7rem; font-weight: 700; letter-spacing: .08em; padding: 3px 8px; border-radius: 4px; color: var(--surface); background: var(--na); }
.badge.critical { background: var(--critical); }
.badge.high { background: var(--high); }
.badge.medium, .badge.low { background: var(--medium); }
.unsure { font-size: .76rem; font-weight: 700; color: var(--high); }
.evid { background: var(--evid-bg); border-left: 3px solid var(--na); padding: 9px 12px; border-radius: 0 6px 6px 0; font-size: .88rem; display: grid; gap: 6px; }
.evid small { display: block; color: var(--muted); }
.evid small.bad { color: var(--critical); font-weight: 600; }
.fix { background: var(--fix-bg); border: 1px solid var(--fix-line); border-radius: 6px; padding: 12px 14px; font-size: .9rem; display: grid; gap: 8px; }
.fix .lbl { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--teal); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.fix .text { white-space: pre-line; }
.fix .text mark { background: var(--yellow); border: 1px solid var(--yellow-line); border-radius: 3px; padding: 0 3px; color: var(--ink); font-weight: 600; }
.regulation { font-size: .82rem; color: var(--muted); }
.goodshape { padding: 16px 20px; display: grid; gap: 8px; border-left: 4px solid var(--ok); }
.scopebox { padding: 16px 20px; display: grid; gap: 8px; border-left: 4px solid var(--na); border-top: 1px solid var(--line); }
.goodshape ul, .scopebox ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .9rem; }
.timeline { list-style: none; margin: 0; padding: 18px; display: grid; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: .88rem; }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 4px; background: var(--ok); }
.timeline .dot.now { background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.timeline .dot.later { background: var(--line); }
.timeline .dot.off { background: var(--na); }
.reports { padding: 18px; display: grid; gap: 10px; }
.report-link { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 6px; text-decoration: none; color: var(--ink); font-size: .9rem; }
.report-link span { color: var(--teal); font-weight: 600; font-size: .84rem; }
.report-link.trial { background: var(--trial-bg); border-style: dashed; border-color: var(--trial-line); }
.report-link.none span { color: var(--muted); font-weight: 400; }
.side .doclist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .88rem; }
.doclist li { overflow-wrap: anywhere; }
table.cmp { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 760px; }
.cmp th { text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cmp td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cmp td.dash { color: var(--muted); }
.later { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.later div { border: 1px dashed var(--line); border-radius: 8px; padding: 14px; font-size: .86rem; color: var(--muted); display: grid; gap: 4px; }
.later b { color: var(--ink); }

@media (max-width: 860px) {
  .signin, .upgrid, .detail { grid-template-columns: minmax(0, 1fr); }
  .signin .pitch, .signin .form { padding: 30px 22px; }
  .bar { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
