/* SY-Compliance — checks upgrade (2 Oct 2026): app shell (left rail / bottom tab bar), the Checks home,
   the four checks, the queue, receipts, team, guided onboarding and guided gates. Builds on the site.css /
   portal.css / counterparties.css tokens (dark navy, orange accent, Inter). Mobile first: one column,
   16px gutter, 44px tap targets below 768px. */

/* ── shell ─────────────────────────────────────────────────────────────────── */
.app-body { display: block; }
.app-rail { display: none; }
.app-tabs { display: none; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 10000; background: #e8712a; color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0; font-weight: 700; }
.skip-link:focus { left: 0; }
.nav-i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 9px 14px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-muted, #8aa); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; text-decoration: none; }
.nav-i:hover { color: var(--text, #eef); background: rgba(255,255,255,.04); }
.nav-i[aria-current="page"] { color: #fff; background: rgba(232,113,42,.16); box-shadow: inset 3px 0 0 #e8712a; }
.nav-i .nav-ico { width: 20px; text-align: center; font-size: 15px; line-height: 1; }
.nav-i:focus-visible { outline: 2px solid var(--accent, #e8712a); outline-offset: 2px; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #e8712a; color: #fff;
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge:empty, .nav-badge[data-n="0"] { display: none; }
.rail-sep { height: 1px; background: var(--border, rgba(255,255,255,.08)); margin: 8px 6px; }
.rail-l { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-dim, #6c7c90); padding: 10px 14px 4px; }

@media (min-width: 768px) {
  .app-body { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: calc(100vh - 60px); }
  .app-rail { display: flex; flex-direction: column; gap: 2px; padding: 16px 10px; border-right: 1px solid var(--border, rgba(255,255,255,.08));
    position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; }
  .app-body > .cw-wrap { max-width: 1100px; width: 100%; margin: 0 auto; }
}
@media (max-width: 767.98px) {
  .app-tabs { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: rgba(10,22,40,.97); border-top: 1px solid var(--border, rgba(255,255,255,.1)); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    backdrop-filter: blur(10px); }
  .app-tabs .nav-i { flex-direction: column; gap: 2px; justify-content: center; text-align: center; font-size: 11px; padding: 6px 2px; min-height: 52px; position: relative; }
  .app-tabs .nav-i[aria-current="page"] { box-shadow: inset 0 3px 0 #e8712a; background: rgba(232,113,42,.10); }
  .app-tabs .nav-i .nav-ico { font-size: 18px; width: auto; }
  .app-tabs .nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
  /* engine status, role pill, name and sign-out live in More on a phone */
  .app-header #engine-status, .app-header #role-pill, .app-header .user, .app-header #btn-logout { display: none !important; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ── common pieces ──────────────────────────────────────────────────────────── */
.scr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.scr-head h2 { font-size: 24px; margin: 0; }
.scr-head .sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px;
  border: 1px solid var(--border, rgba(255,255,255,.14)); color: var(--text-muted); background: rgba(255,255,255,.03); white-space: nowrap; }
.chip.ok { color: #3ecf8e; border-color: rgba(62,207,142,.4); background: rgba(62,207,142,.08); }
.chip.warn { color: #f0b429; border-color: rgba(240,180,41,.45); background: rgba(240,180,41,.08); }
.chip.bad { color: #ff8f8f; border-color: rgba(255,90,90,.45); background: rgba(255,90,90,.08); }
.chip.info { color: #9fd2ff; border-color: rgba(159,210,255,.4); background: rgba(159,210,255,.07); }
.chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 0 0 2px; min-width: 24px; min-height: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kv { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 4px 12px; font-size: 13px; margin: 6px 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; word-break: break-word; }
.req { color: #f0b429; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.note-box { margin: 10px 0; padding: 10px 14px; border-radius: 10px; font-size: 13px; border: 1px solid var(--border); background: rgba(255,255,255,.03); }
.note-box.warn { border-color: rgba(240,180,41,.4); background: rgba(240,180,41,.07); color: #f6d58a; }
.note-box.bad { border-color: rgba(255,90,90,.45); background: rgba(255,90,90,.08); color: #ffb3b3; }
.note-box.ok { border-color: rgba(62,207,142,.35); background: rgba(62,207,142,.07); color: #a6efcb; }
.note-box strong { color: inherit; }
.loading-line { color: var(--text-muted); font-size: 13px; padding: 10px 0; }
.empty-line { color: var(--text-muted); font-size: 13px; padding: 6px 0; font-style: italic; }
.out-footer { margin-top: 16px; }
.out-footer .psn { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; padding-left: 13px; }

/* ── readiness banner ──────────────────────────────────────────────────────── */
.ready-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin-bottom: 18px;
  border: 1px solid rgba(240,180,41,.45); background: rgba(240,180,41,.08); color: #f6d58a; font-size: 14px; }
.ready-banner .rb-ico { font-size: 18px; line-height: 1.2; }
.ready-banner a, .ready-banner button.linkish { color: #ffd27a; font-weight: 700; }
button.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; min-height: 0; }

/* ── home tiles ─────────────────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 18px; border-radius: 16px; cursor: pointer; min-height: 132px;
  background: rgba(17,29,50,.7); border: 1px solid var(--border, rgba(255,255,255,.08)); color: var(--text, #eef); font: inherit; transition: border-color .15s, transform .15s; }
.tile:hover:not([disabled]) { border-color: var(--accent, #e8712a); transform: translateY(-2px); }
.tile:focus-visible { outline: 2px solid var(--accent, #e8712a); outline-offset: 2px; }
.tile .t-ico { font-size: 22px; }
.tile .t-name { font-size: 16px; font-weight: 700; }
.tile .t-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }
.tile .t-meta { margin-top: auto; font-size: 12px; color: var(--accent-light, #f3a463); font-weight: 600; }
.tile[disabled], .tile.is-locked { opacity: .5; cursor: not-allowed; transform: none; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tiles { gap: 10px; } .tile { padding: 14px; min-height: 120px; } .tile .t-desc { font-size: 12px; } }

/* ── lists: waiting-for-me, needs attention, recent checks ────────────────── */
.sec { margin-bottom: 22px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.sec-h h3 { font-size: 15px; margin: 0; letter-spacing: .2px; }
.sec-h .muted { font-size: 12px; }
.grp-l { font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--accent-light, #f3a463); margin: 14px 0 4px; }
.q-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(17,29,50,.6);
  border: 1px solid var(--border, rgba(255,255,255,.07)); margin-bottom: 8px; }
.q-row .att-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted, #8aa); }
.q-row.sev-red .att-dot { background: #ff5b5b; box-shadow: 0 0 8px rgba(255,91,91,.55); }
.q-row.sev-amber .att-dot { background: #f0b429; }
.q-main { flex: 1; min-width: 0; }
.q-title { font-size: 14px; line-height: 1.35; word-break: break-word; }
.q-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.q-row .btn { flex: 0 0 auto; }
.q-row.muted-row { opacity: .72; background: transparent; border-style: dashed; }
.q-row.muted-row .q-why { font-size: 12px; color: #f0b429; }
@media (max-width: 640px) {
  .q-row { flex-wrap: wrap; }
  .q-row .btn { width: 100%; }
}
.chk-card { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ico ref right" "ico subj right"; gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: 12px;
  background: rgba(17,29,50,.6); border: 1px solid var(--border, rgba(255,255,255,.07)); margin-bottom: 8px; cursor: pointer; color: inherit; text-align: left; width: 100%; font: inherit; }
.chk-card:hover { border-color: var(--accent, #e8712a); }
.chk-card:focus-visible { outline: 2px solid var(--accent, #e8712a); outline-offset: 2px; }
.chk-card .k-ico { font-size: 18px; grid-area: ico; }
.chk-card .c-ref { grid-area: ref; word-break: break-all; font-size: 12px; color: var(--accent-light, #f3a463); font-family: ui-monospace, Menlo, Consolas, monospace; }
.chk-card .c-subj { grid-area: subj; font-size: 14px; font-weight: 600; word-break: break-word; }
.chk-card .c-right { grid-area: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
@media (max-width: 640px) { .chk-card { grid-template-columns: auto 1fr; grid-template-areas: "ico ref" "subj subj" "right right"; } .chk-card .c-right { flex-direction: row; align-items: center; flex-wrap: wrap; } }

/* outcome chips */
.oc { font-size: 11px; font-weight: 800; letter-spacing: .4px; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.oc-clear, .oc-false_positive, .oc-ACCEPT { color: #062c1c; background: #3ecf8e; }
.oc-escalated, .oc-HOLD_EDD { color: #3a2a05; background: #f0b429; }
.oc-true_match, .oc-BLOCK { color: #fff; background: #b8383a; }
.oc-QUARANTINE { color: #fff; background: #e0722a; }
.oc-none, .oc-pending { color: var(--text-muted); background: rgba(255,255,255,.08); }

/* ── two-person strip ─────────────────────────────────────────────────────── */
.tp-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px;
  border: 1px solid var(--border, rgba(255,255,255,.1)); background: rgba(255,255,255,.03); margin: 10px 0; }
.tp-strip .tp-dot { font-size: 13px; }
.tp-strip .tp-arrow { color: var(--text-muted); }
.tp-strip .tp-why { flex-basis: 100%; font-size: 12px; color: #f0b429; }
.tp-strip .tp-note { flex-basis: 100%; font-size: 12px; }
.tp-strip .tp-act { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tp-waiting { border-color: rgba(240,180,41,.4); }
.tp-confirmed { border-color: rgba(62,207,142,.45); background: rgba(62,207,142,.06); }
.tp-confirmed .tp-second { color: #3ecf8e; font-weight: 700; }
.tp-disputed { border-color: rgba(255,90,90,.5); background: rgba(255,90,90,.07); }
.tp-disputed .tp-second { color: #ff8f8f; font-weight: 800; }
.tp-restricted { border-style: dashed; color: var(--text-muted); }
.tp-row { font-size: 12px; padding: 0; border: 0; background: none; margin: 2px 0 0; }

/* ── outcome strip (sticky on a phone) ─────────────────────────────────────── */
.outcome-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; margin: 12px 0;
  border: 1px solid var(--border); background: rgba(17,29,50,.92); font-size: 14px; }
.outcome-strip .os-label { font-weight: 800; letter-spacing: .5px; font-size: 12px; padding: 3px 10px; border-radius: 6px; }
.outcome-strip.tone-green { border-color: rgba(62,207,142,.5); } .tone-green .os-label { background: #3ecf8e; color: #062c1c; }
.outcome-strip.tone-amber { border-color: rgba(240,180,41,.55); } .tone-amber .os-label { background: #f0b429; color: #3a2a05; }
.outcome-strip.tone-red { border-color: rgba(255,90,90,.6); } .tone-red .os-label { background: #b8383a; color: #fff; }
.outcome-strip .os-head { flex-basis: 100%; font-size: 13px; color: var(--text-muted); }
@media (max-width: 767.98px) { .outcome-strip.sticky { position: sticky; top: 0; z-index: 20; } }

/* ── coverage line ─────────────────────────────────────────────────────────── */
.cov-line { font-size: 12.5px; color: var(--text-muted); padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--border, rgba(255,255,255,.14)); margin: 10px 0; line-height: 1.55; }
.cov-line strong { color: var(--text, #eef); font-weight: 600; }
.cov-line .stale { color: #f0b429; font-weight: 700; }
.cov-line .nc { color: #f6d58a; }
.cov-line.cov-bad { border-color: rgba(240,180,41,.6); border-style: solid; }
.cov-line .cov-why { margin: 2px 0 4px 18px; color: #f0b429; }
.cov-line .cov-lists summary { cursor: pointer; }
.cov-line .cov-lists .file-list { margin-top: 4px; }

/* ── hit groups + hit cards ─────────────────────────────────────────────────── */
.hit-group { margin: 14px 0; }
.hg-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--border, rgba(255,255,255,.08)); }
.hg-head .hg-n { margin-left: auto; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.hg-1 .hg-head { color: #ff9b9b; } .hg-2 .hg-head { color: #ffb27a; } .hg-3 .hg-head { color: #9fd2ff; } .hg-4 .hg-head { color: #f0c96a; } .hg-5 .hg-head { color: #c9c0b0; }
.hit-card { border: 1px solid var(--border, rgba(255,255,255,.1)); border-radius: 12px; padding: 12px 14px; margin: 8px 0; background: rgba(10,22,40,.45); }
.hit-card.v-not_match { border-color: rgba(159,210,255,.35); }
.hit-card.v-possible { border-color: rgba(240,180,41,.55); }
.hit-card.v-true_match { border-color: rgba(255,90,90,.65); background: rgba(255,90,90,.05); }
.hit-card.is-missing { box-shadow: 0 0 0 1px rgba(240,180,41,.6); }
.hc-top { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.hc-name { font-weight: 700; font-size: 15px; word-break: break-word; flex: 1; min-width: 160px; }
.hc-type { font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.str { font-size: 11px; font-weight: 800; border-radius: 5px; padding: 2px 8px; letter-spacing: .3px; white-space: nowrap; }
.str-exact { background: #4a1414; color: #ff9b9b; } .str-strong { background: #4a2a14; color: #ffb27a; } .str-partial { background: rgba(255,255,255,.08); color: #c9c0b0; }
.hc-matched { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.hc-why { margin: 6px 0 0 18px; padding: 0; font-size: 12.5px; line-height: 1.5; }
.hc-why li { margin: 1px 0; }
.hc-why li.neg { color: #9fd2ff; } .hc-why li.pos { color: #ffd0a0; }
.hc-src { font-size: 12px; color: var(--text-muted); margin-top: 6px; word-break: break-word; }
.hc-src a { color: var(--accent-light, #f3a463); }
.hc-verdict { margin-top: 10px; display: grid; gap: 8px; }
.hc-verdict .seg { width: max-content; max-width: 100%; flex-wrap: wrap; }
.seg-b[data-v="not_match"].active { background: rgba(90,160,255,.75); }
.seg-b[data-v="possible"].active { background: rgba(240,180,41,.9); color: #3a2a05; }
.seg-b[data-v="true_match"].active { background: rgba(214,72,74,.95); }
.hc-recorded { margin-top: 8px; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.04); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(159,210,255,.06); border: 1px solid rgba(159,210,255,.25); margin: 8px 0; font-size: 13px; }
@media (max-width: 640px) {
  .hc-verdict .seg { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .hc-verdict .seg-b { min-height: 44px; }
}

/* ── PDPA block ─────────────────────────────────────────────────────────────── */
.pdpa-block { border: 1px solid rgba(159,210,255,.3); border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: rgba(159,210,255,.04); }
.pdpa-block .pd-h { font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #9fd2ff; margin-bottom: 6px; }
.pdpa-block .pd-notice { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }
.pdpa-block .pd-chipline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.pdpa-block .pd-draft { font-size: 11px; color: #f0b429; }

/* ── forms: one column on a phone ─────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 14px; margin: 10px 0; }
.form-grid .full { grid-column: 1 / -1; }
.toggle { display: inline-flex; border: 1px solid var(--border, rgba(255,255,255,.14)); border-radius: 10px; overflow: hidden; }
.toggle button { background: transparent; color: var(--text-muted); border: 0; padding: 9px 16px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; min-height: 40px; }
.toggle button + button { border-left: 1px solid var(--border, rgba(255,255,255,.12)); }
.toggle button[aria-pressed="true"] { background: rgba(232,113,42,.85); color: #fff; }
.toggle button:focus-visible { outline: 2px solid var(--accent, #e8712a); outline-offset: -2px; }
details.acc { border: 1px solid var(--border, rgba(255,255,255,.1)); border-radius: 14px; margin: 10px 0; background: rgba(17,29,50,.5); }
details.acc > summary { cursor: pointer; list-style: none; padding: 14px 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; min-height: 48px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::before { content: '▸'; color: var(--accent-light, #f3a463); transition: transform .15s; }
details.acc[open] > summary::before { transform: rotate(90deg); }
details.acc > summary { flex-wrap: wrap; }
details.acc > summary > span:first-of-type { flex: 1 1 0; min-width: 0; }
details.acc > summary .acc-sum { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-muted); text-align: right; }
details.acc > .acc-body { padding: 0 16px 16px; }
.party-card { border: 1px solid var(--border, rgba(255,255,255,.1)); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.party-card h4 { margin: 0 0 6px; font-size: 14px; }
.acct-match { font-size: 12.5px; margin-top: 6px; }
.acct-match.ok { color: #3ecf8e; } .acct-match.bad { color: #ff8f8f; } .acct-match.warn { color: #f5c26b; } .acct-match.unk { color: var(--text-muted); }
.file-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.file-btns input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; }
.file-list li { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.05); word-break: break-all; }

/* ── payment result ────────────────────────────────────────────────────────── */
.disp-chip { display: inline-block; font-size: 22px; font-weight: 900; letter-spacing: .5px; padding: 8px 20px; border-radius: 12px; }
.disp-ACCEPT { background: #3ecf8e; color: #062c1c; } .disp-HOLD_EDD { background: #f0b429; color: #3a2a05; }
.disp-QUARANTINE { background: #e0722a; color: #fff; } .disp-BLOCK { background: #7a1416; color: #fff; border: 1px solid #ff5b5b; }
.disp-none { background: rgba(255,255,255,.08); color: var(--text-muted); font-size: 16px; }
.rule-list { list-style: none; margin: 10px 0; padding: 0; }
.rule-list li { display: grid; grid-template-columns: 28px 1fr; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px; }
.rule-list .r-mark { font-weight: 900; font-size: 15px; text-align: center; }
.r-pass .r-mark { color: #3ecf8e; } .r-fail .r-mark { color: #ff8f8f; } .r-na .r-mark, .r-not_evaluated .r-mark { color: var(--text-muted); } .r-not_decidable .r-mark { color: #f0b429; }
.rule-list .r-title { font-weight: 700; }
.rule-list .r-detail { grid-column: 2; color: var(--text-muted); font-size: 12.5px; }
.rule-list .r-eff { font-size: 11px; font-weight: 800; margin-left: 6px; }
.hold-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--border); font-size: 13px; margin: 10px 0; }
.ntm { font-size: 12.5px; color: #a6efcb; border-left: 3px solid rgba(62,207,142,.6); padding: 4px 10px; margin: 10px 0; }

/* site.css sets overflow-x:hidden on BOTH html and body: body then becomes a scroll container that
   never scrolls, and every position:sticky bar / strip in the app stays in place instead of sticking.
   overflow-x:clip prevents the sideways scroll without creating a scroll container (app pages only). */
@supports (overflow: clip) { html, body { overflow-x: clip; } }

/* ── sticky action bar ─────────────────────────────────────────────────────── */
.action-bar { position: sticky; bottom: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 0;
  background: linear-gradient(to top, rgba(10,22,40,.98) 70%, rgba(10,22,40,0)); margin-top: 12px; }
.action-bar .msg { font-size: 13px; flex-basis: 100%; }
@media (max-width: 767.98px) {
  .action-bar { bottom: calc(60px + env(safe-area-inset-bottom)); padding: 10px 0; }
  .action-bar .btn-primary { flex: 1 1 100%; }
}

/* a payment preview computed on earlier inputs: greyed out until the check is run again */
#pay-result.is-stale > section { opacity: .45; filter: grayscale(.6); }
#pay-result .stale-note { position: sticky; top: 0; z-index: 21; }

/* ── confirmation sheet ────────────────────────────────────────────────────── */
.sheet-backdrop { position: fixed; inset: 0; z-index: 9990; background: rgba(5,10,20,.7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet { width: min(560px, 100%); max-height: 88vh; overflow-y: auto; background: #111d32; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 20px 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55); }
.sheet h3 { font-size: 18px; margin: 0 0 10px; }
.sheet .sh-list { margin: 8px 0 12px 18px; font-size: 13.5px; line-height: 1.55; }
.sheet .sh-meta { font-size: 12.5px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 8px; }
.sheet .sh-meta div { margin: 3px 0; }
.sheet .sh-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
@media (max-width: 767.98px) {
  .sheet-backdrop { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 18px 18px 0 0; width: 100%; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .sheet .sh-btns .btn { flex: 1 1 100%; min-height: 48px; }
}

/* ── guided onboarding ─────────────────────────────────────────────────────── */
.wiz-steps { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; margin-bottom: 8px; scrollbar-width: thin; }
.wiz-step { flex: 0 0 auto; border: 1px solid var(--border, rgba(255,255,255,.12)); background: transparent; color: var(--text-muted); border-radius: 999px;
  padding: 7px 12px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; min-height: 36px; }
.wiz-step[aria-current="step"] { background: rgba(232,113,42,.85); color: #fff; border-color: transparent; }
.wiz-step.done::after { content: ' ✓'; color: #3ecf8e; }
.score-chip { position: sticky; top: 0; z-index: 25; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px;
  background: rgba(17,29,50,.96); border: 1px solid var(--border, rgba(255,255,255,.14)); font-size: 13px; }
.score-chip .sc-main { font-weight: 800; }
.score-chip .sc-blk { flex-basis: 100%; font-size: 12px; color: #f0b429; }
.score-chip .sc-blk ul { margin: 4px 0 0 18px; }
.score-chip.hard { border-color: rgba(255,90,90,.6); }
.score-chip .sc-pill, .score-chip .sc-close { display: none; }
/* phone: a one-line pill fixed above the tab bar; tap to expand (it then overlays the page until tapped
   again). The wizard's action bars sit above the pill, offset by its measured height (--chip-h). */
@media (max-width: 767.98px) {
  .score-chip { position: fixed; top: auto; bottom: calc(60px + env(safe-area-inset-bottom)); left: 8px; right: 8px; margin: 0; z-index: 80; max-height: 50vh; overflow-y: auto; cursor: pointer; padding: 8px 12px; }
  .score-chip:not(.open) > * { display: none; }
  .score-chip:not(.open) > .sc-pill { display: block; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 800; line-height: 26px; }
  .score-chip.open { box-shadow: 0 -8px 30px rgba(0,0,0,.5); }
  .score-chip.open > .sc-close { display: block; flex-basis: 100%; text-align: right; }
  #wiz-stage .action-bar { bottom: calc(60px + var(--chip-h, 44px) + 6px + env(safe-area-inset-bottom)); }
  .wiz-pad { height: calc(var(--chip-h, 44px) + 24px); }
}
.q-item { border: 1px solid var(--border, rgba(255,255,255,.1)); border-radius: 14px; padding: 14px 16px; margin: 12px 0; background: rgba(17,29,50,.5); }
.q-item.is-unset { box-shadow: 0 0 0 1px rgba(240,180,41,.45); }
.q-item .qi-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.q-item .qi-q { font-size: 15px; font-weight: 600; margin: 6px 0; line-height: 1.4; }
.q-item .qi-why { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; }
.q-item .seg-b[data-v="YES"].active { background: rgba(62,207,142,.85); color: #062c1c; }
.q-item .seg-b[data-v="NO"].active { background: rgba(226,66,66,.85); }
.q-item .seg-b[data-v="NA"].active { background: rgba(120,130,150,.85); }
.proposal { font-size: 12.5px; padding: 8px 10px; border-radius: 8px; border-left: 3px solid #9fd2ff; background: rgba(159,210,255,.06); margin: 6px 0; }
.person-card { border: 1px solid var(--border, rgba(255,255,255,.1)); border-radius: 12px; padding: 12px; margin: 8px 0; background: rgba(10,22,40,.35); }
.person-card .pc-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; font-size: 13px; }
.item-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.item-tile { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12px; }
.item-tile.t-PASS { border-color: rgba(62,207,142,.45); } .item-tile.t-FAIL { border-color: rgba(255,90,90,.55); } .item-tile.t-NA { border-color: rgba(120,130,150,.5); }
.item-tile .it-r { font-weight: 800; }

/* ── guided gates ──────────────────────────────────────────────────────────── */
.cyc-card { border: 1px solid var(--border, rgba(255,255,255,.1)); border-radius: 14px; padding: 14px 16px; margin: 10px 0; background: rgba(17,29,50,.6); }
.cyc-card .cc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.progress9 { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; margin: 10px 0 6px; }
.progress9 span { height: 8px; border-radius: 3px; background: rgba(255,255,255,.08); }
.progress9 span.go { background: #3ecf8e; } .progress9 span.nogo { background: #d6484a; } .progress9 span.next { background: #e8712a; }
.crit { border: 1px solid var(--border, rgba(255,255,255,.1)); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.crit.locked { background: rgba(255,255,255,.025); }
.crit .cr-q { font-size: 14px; margin: 4px 0 8px; line-height: 1.4; }
.crit .cr-eng { font-size: 12.5px; padding: 6px 10px; border-radius: 8px; margin: 6px 0; }
.cr-eng.pass { background: rgba(62,207,142,.08); color: #a6efcb; } .cr-eng.fail { background: rgba(255,90,90,.08); color: #ffb3b3; } .cr-eng.not_evaluated { background: rgba(255,255,255,.05); color: var(--text-muted); }

/* ── team ──────────────────────────────────────────────────────────────────── */
.member { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border, rgba(255,255,255,.08)); margin-bottom: 8px; background: rgba(17,29,50,.5); }
.member .m-name { font-weight: 700; word-break: break-word; }
.member .m-meta { font-size: 12px; color: var(--text-muted); grid-column: 1 / -1; }
.member .m-clash { grid-column: 1 / -1; font-size: 12px; color: #ff9b9b; }
.check-li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 13.5px; }
.check-li .ck { font-weight: 900; } .check-li.ok .ck { color: #3ecf8e; } .check-li.no .ck { color: #ff8f8f; }
.copy-box { white-space: pre-wrap; word-break: break-word; font-size: 13px; padding: 12px; border-radius: 10px; background: rgba(10,22,40,.75); border: 1px solid var(--border); }

/* ── More page ─────────────────────────────────────────────────────────────── */
.more-list { list-style: none; margin: 0; padding: 0; }
.more-list li { border-bottom: 1px solid var(--border, rgba(255,255,255,.06)); }
.more-list .nav-i { padding: 14px 6px; font-size: 15px; color: var(--text, #eef); }
.more-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }

/* ── mobile: one column, 16px gutter, 44px targets ─────────────────────────── */
@media (max-width: 767.98px) {
  .btn, .seg-b, .toggle button, select.inp, input.inp, .role-pill { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 6px; }
  .scr-head h2 { font-size: 21px; }
  details.acc > summary .acc-sum { margin-left: 22px; flex-basis: 100%; text-align: left; }
}

/* ── print: receipts read on paper ─────────────────────────────────────────── */
@media print {
  .app-rail, .app-tabs, .action-bar, .sheet-backdrop, .tp-act, .hc-verdict, .bulk-bar, .no-print, .skip-link { display: none !important; }
  .app-body { display: block !important; }
  body { padding: 0 !important; }
  .hit-card, .q-row, .chk-card, .tp-strip, .cov-line, .outcome-strip, .note-box, .pdpa-block, .rule-list li { background: #fff !important; color: #000 !important; border-color: #bbb !important; break-inside: avoid; }
  .hit-card *, .tp-strip *, .cov-line *, .outcome-strip *, .note-box *, .rule-list *, .kv *, .receipt * { color: #000 !important; }
  .oc, .str, .disp-chip, .os-label, .chip { background: #fff !important; color: #000 !important; border: 1px solid #000 !important; }
  .receipt a[href]::after { content: ' (' attr(href) ')'; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .tile, .chk-card, details.acc > summary::before { transition: none; } }
