/* =========================================================================================
   Opta Consent - one design system for every page (staff pages, the person's pages, test page).
   Class names are kept compatible with the older pages: card, msg, tag, btn, grid, row, yn ...
   ========================================================================================= */

:root {
    color-scheme: light;
    --bg: #f4f6fb;
    --bg-2: #eef1f8;
    --card: #ffffff;
    --ink: #0f1a2e;
    --ink-2: #33415c;
    --muted: #64708a;
    --faint: #94a0b8;
    --line: #e3e8f1;
    --line-2: #eef2f8;

    --brand: #2453d4;
    --brand-deep: #1a3fa8;
    --brand-ink: #ffffff;
    --brand-soft: #edf2ff;
    --brand-line: #cbd8fb;
    --navy: #0d1b3d;

    --ok: #12784a;   --ok-bg: #e8f7ef;   --ok-line: #b8e6cc;
    --err: #b42318;  --err-bg: #fdf0ee;  --err-line: #f6c8c2;
    --warn: #8a5300; --warn-bg: #fff6e3; --warn-line: #f6dca4;
    --info: #1d4ed8; --info-bg: #eef4ff; --info-line: #c9d9fd;
    --chip: #f0f3f9;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 26, 46, .05), 0 4px 16px rgba(15, 26, 46, .05);
    --shadow-lg: 0 10px 40px rgba(15, 26, 46, .12);
    --font: "Inter", "Noto Sans Devanagari", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.25; letter-spacing: -.02em; margin: 4px 0 14px; font-weight: 700; }
h2 { font-size: 16.5px; line-height: 1.35; letter-spacing: -.01em; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
code { font-family: var(--mono); font-size: .86em; background: var(--chip); padding: 1px 6px; border-radius: 6px; color: var(--ink-2); }
ul, ol { padding-left: 22px; margin: 6px 0 12px; }
li { margin: 3px 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
::selection { background: var(--brand-soft); }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px; }
.narrow { max-width: 780px; }
.slim { max-width: 560px; }
.muted { color: var(--muted); font-size: 13px; }
.sp { flex: 1; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
.stack > * + * { margin-top: 12px; }
.grid.filters { grid-template-columns: minmax(220px, 2fr) minmax(170px, 1fr) auto; }
@media (max-width: 720px) { .grid.filters { grid-template-columns: 1fr; } }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- app bar */
.appbar {
    position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px);
    border-bottom: 1px solid var(--line);
}
.appbar .in { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: -2px; }
.mark {
    width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff;
    background: linear-gradient(140deg, #4f7cff 0%, #2453d4 55%, #1a3fa8 100%);
    box-shadow: 0 4px 12px rgba(36, 83, 212, .3), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.mark svg { width: 18px; height: 18px; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav > a, .nav details.menu > summary {
    color: var(--ink-2); font-weight: 550; font-size: 14px; padding: 7px 12px; border-radius: 9px; white-space: nowrap;
    transition: background .15s, color .15s;
}
.nav > a:hover, .nav details.menu > summary:hover { background: var(--chip); text-decoration: none; color: var(--ink); }
.nav > a.on, .nav details.menu.on > summary { background: var(--brand-soft); color: var(--brand); }

/* dropdown group (e.g. "Projects") */
.nav details.menu { position: relative; }
.nav details.menu > summary { display: inline-flex; gap: 6px; }
.nav details.menu > summary::before { display: none; }
.nav details.menu > summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; align-self: center; }
.nav details.menu[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.nav details.menu[open] > summary { background: var(--chip); color: var(--ink); }
.nav .panel {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; min-width: 280px; max-width: min(420px, calc(100vw - 32px));
    max-height: 70vh; overflow-y: auto; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.nav .panel a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--ink); }
.nav .panel a b { display: block; font-weight: 600; font-size: 14px; }
.nav .panel a span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.nav .panel a:hover { background: var(--bg); text-decoration: none; }
.nav .panel a.on { background: var(--brand-soft); }
.nav .panel a.on b { color: var(--brand); }

/* phone menu button */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.burger { display: none; margin: 0 0 0 auto; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; place-items: center; cursor: pointer; color: var(--ink-2); }
.burger svg { width: 20px; height: 20px; }
.who { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: linear-gradient(140deg, #dfe8ff, #c7d6fb); color: var(--brand-deep); font-weight: 700; font-size: 13px;
}
.who .name { font-size: 13.5px; font-weight: 600; color: var(--ink-2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subnav { background: var(--card); border-bottom: 1px solid var(--line); }
.subnav .in { max-width: 1120px; margin: 0 auto; padding: 0 20px; display: flex; gap: 2px; overflow-x: auto; }
.subnav a {
    padding: 11px 14px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------------------------------------------------------------- page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 20px; }
.page-head h1 { margin: 0; }
.page-head .lead { color: var(--muted); margin: 4px 0 0; font-size: 14.5px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }

/* ---------------------------------------------------------------- cards */
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card.tight { padding: 14px 16px; }
.card > h2:first-child, .card > .card-head:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 700; margin-right: 10px; vertical-align: 1px; }
.section-title { display: flex; align-items: center; margin: 0 0 14px; font-size: 16.5px; font-weight: 650; }
.section-title .hi { color: var(--muted); font-weight: 500; margin-left: 6px; }

/* feature cards (home) */
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.feature { display: flex; flex-direction: column; gap: 10px; position: relative; transition: transform .15s, box-shadow .15s, border-color .15s; }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-line); }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.feature .ico svg { width: 22px; height: 22px; }
.feature.green .ico { background: var(--ok-bg); color: var(--ok); }
.feature.amber .ico { background: var(--warn-bg); color: var(--warn); }
.feature h2 { margin: 4px 0 0; font-size: 17px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; flex: 1; }
.feature .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.feature a.stretch::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }

/* hero (home) */
.hero {
    position: relative; overflow: hidden; border-radius: 20px; padding: 30px 30px 28px; margin-bottom: 22px; color: #fff;
    background:
        radial-gradient(600px 300px at 90% -20%, rgba(120, 160, 255, .45), transparent 60%),
        radial-gradient(500px 260px at 0% 120%, rgba(56, 189, 248, .25), transparent 60%),
        linear-gradient(135deg, #10235a 0%, #1a3fa8 60%, #2453d4 100%);
    box-shadow: 0 12px 40px rgba(26, 63, 168, .25);
}
.hero h1 { color: #fff; font-size: 27px; margin: 0 0 6px; }
.hero p { color: rgba(255, 255, 255, .8); margin: 0; max-width: 620px; }
.hero .eyebrow { color: #a9c1ff; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.hero .chip { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); color: #fff; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.hero .chip .dot { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); }
.hero .chip.off .dot { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .25); }

/* ---------------------------------------------------------------- messages */
.msg {
    position: relative; display: block; padding: 12px 16px 12px 44px; border-radius: 12px; margin-bottom: 16px;
    border: 1px solid transparent; font-size: 14px;
}
.msg.pre { white-space: pre-line; }
.msg::before { content: ""; position: absolute; left: 15px; top: 14px; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--msg-ico) center / contain no-repeat; mask: var(--msg-ico) center / contain no-repeat; }
.msg > :first-child { margin-top: 0; }
.msg.ok   { background: var(--ok-bg);   color: var(--ok);   border-color: var(--ok-line);   --msg-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E"); }
.msg.err  { background: var(--err-bg);  color: var(--err);  border-color: var(--err-line);  --msg-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 7v6M12 16.5v.5'/%3E%3C/svg%3E"); }
.msg.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); --msg-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20L12 3z'/%3E%3Cpath d='M12 10v4M12 17v.5'/%3E%3C/svg%3E"); }
.msg.info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); --msg-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E"); }
.msg .body { flex: 1; min-width: 0; }
.msg b { color: inherit; }
.msg a { color: inherit; text-decoration: underline; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink-2); margin: 10px 0 6px; }
.grid > div > label:first-child { margin-top: 0; }
input[type=text], input[type=date], input[type=search], input[type=tel], input[type=number], input[type=password],
input[type=email], input[type=file], select, textarea {
    width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid #d5dce8; border-radius: var(--radius-sm);
    font: inherit; font-size: 14.5px; background: #fff; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 70px; resize: vertical; }
select {
    appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364708a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat;
}
input[type=file] { padding: 7px 10px; }
input:hover, select:hover, textarea:hover { border-color: #b9c4d6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(36, 83, 212, .14); }
input[readonly] { background: var(--bg); color: var(--ink-2); font-family: var(--mono); font-size: 13px; }
input[type=radio], input[type=checkbox] { accent-color: var(--brand); width: 17px; height: 17px; vertical-align: -3px; margin: 0 6px 0 0; }
label.check, label.plain { font-weight: 500; color: var(--ink); display: flex; align-items: flex-start; gap: 2px; font-size: 14px; margin: 6px 0; cursor: pointer; }
label.check input, label.plain input { margin-top: 2px; }
.req { color: var(--err); margin-left: 2px; }
.ferr { color: var(--err); font-size: 13px; margin-top: 5px; font-weight: 500; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

/* ---------------------------------------------------------------- buttons */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
    border: 1px solid var(--brand); border-radius: 11px; padding: 9px 18px;
    font: inherit; font-size: 14.5px; font-weight: 600; line-height: 1.2; text-align: center;
    background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 26, 46, .1), 0 4px 12px rgba(36, 83, 212, .2);
    transition: background .15s, box-shadow .15s, transform .05s, border-color .15s, color .15s;
}
button:hover, .btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(36, 83, 212, .25); }
button.ghost, .btn.ghost { background: #fff; color: var(--ink-2); border-color: #d5dce8; box-shadow: 0 1px 2px rgba(15, 26, 46, .05); }
button.ghost:hover, .btn.ghost:hover { background: var(--bg); border-color: #b9c4d6; color: var(--ink); }
button.soft, .btn.soft { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-soft); box-shadow: none; }
button.soft:hover, .btn.soft:hover { background: #e0e9ff; border-color: #e0e9ff; }
button.danger, .btn.danger { background: #fff; color: var(--err); border-color: var(--err-line); box-shadow: none; }
button.danger:hover, .btn.danger:hover { background: var(--err-bg); border-color: #eea89e; }
button.danger.solid { background: var(--err); color: #fff; border-color: var(--err); }
button.small, .btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 9px; }
button.big, .btn.big { min-height: 52px; padding: 12px 26px; font-size: 16px; border-radius: 13px; }
button.block, .btn.block { width: 100%; }
button:disabled, .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
button svg, .btn svg { width: 17px; height: 17px; flex: none; }
form.inline { display: inline; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; background: #f8fafd; border-bottom-color: var(--line); }
tr:first-child th:first-child { border-top-left-radius: 10px; }
tr:first-child th:last-child { border-top-right-radius: 10px; }
tbody tr, table tr { transition: background .12s; }
table tr:hover td { background: #fafbfe; }
table tr:last-child td { border-bottom: 0; }
td .muted { font-size: 12.5px; }
td.num, th.num { text-align: right; }
td.actions { text-align: right; white-space: nowrap; }
.person { font-weight: 600; color: var(--ink); }
table.kv th { width: 36%; text-transform: none; letter-spacing: 0; font-size: 13px; background: transparent; color: var(--muted); font-weight: 500; border-bottom-color: var(--line-2); }
table.kv td { font-weight: 500; }
table.kv tr:hover td { background: transparent; }
.empty { text-align: center; padding: 40px 16px !important; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); display: block; margin: 0 auto 10px; }

/* ---------------------------------------------------------------- tags / pills */
.tag, .pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--chip); color: var(--ink-2); white-space: nowrap; line-height: 1.5; vertical-align: 1px;
}
.tag::before, .pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.tag.Active, .pill.Active { background: var(--ok-bg); color: var(--ok); }
.tag.Withdrawn, .tag.Revoked, .tag.Refused, .tag.Declined, .tag.Failed, .tag.Cancelled,
.pill.Refused, .pill.Revoked { background: var(--err-bg); color: var(--err); }
.tag.Expired, .tag.Superseded, .tag.Open, .tag.Busy, .tag.Waiting, .tag.Pending,
.pill.Withdrawn { background: var(--warn-bg); color: var(--warn); }
.tag.Used { background: var(--info-bg); color: var(--info); }
.pill.Expired, .pill.Superseded { background: var(--chip); color: var(--muted); }
.tag.need { background: var(--err-bg); color: var(--err); }
.tag.need::before, .tag.opt::before { display: none; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); letter-spacing: .02em; vertical-align: 3px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.off { background: var(--err); box-shadow: 0 0 0 3px var(--err-bg); }
.ref { font-family: var(--mono); font-size: 12.5px; font-weight: 600; background: var(--chip); color: var(--ink-2); padding: 3px 8px; border-radius: 7px; white-space: nowrap; }

/* ---------------------------------------------------------------- tabs (segmented) */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; margin-bottom: 20px; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; }
.tabs a { padding: 8px 16px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); background: var(--bg); text-decoration: none; }
.tabs a.on { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(36, 83, 212, .3); }

/* ---------------------------------------------------------------- choice cards (Yes/No, modes) */
.yn, .modes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 10px; }
.modes { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.yn label, .modes label {
    position: relative; margin: 0; display: flex; align-items: flex-start; gap: 10px;
    border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; cursor: pointer; background: #fff;
    font-weight: 600; font-size: 14.5px; color: var(--ink); transition: border-color .15s, background .15s, box-shadow .15s;
}
.yn label { align-items: center; justify-content: center; min-height: 52px; }
.yn label:hover, .modes label:hover { border-color: #b9c4d6; }
.yn input, .modes input { margin: 2px 0 0; flex: none; }
.yn label:has(input:checked), .modes label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(36, 83, 212, .1); }
.yn label.no:has(input:checked) { border-color: #e2685a; background: var(--err-bg); box-shadow: 0 0 0 3px rgba(180, 35, 24, .08); }
.yn label.yes:has(input:checked) { border-color: #2f9e6a; background: var(--ok-bg); box-shadow: 0 0 0 3px rgba(18, 120, 74, .1); }
.modes .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); flex: none; }
.modes .ico svg { width: 19px; height: 19px; }
.modes label:has(input:checked) .ico { background: var(--brand); color: #fff; }
.modes small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.4; }
.modes input { position: absolute; opacity: 0; pointer-events: none; }

/* purposes / questions */
.purpose { border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.purpose .q { font-weight: 650; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.purpose .q .n { color: var(--brand); }
.purpose > .muted { margin-top: 4px; }
.notice-box { background: var(--bg); border: 1px solid var(--line); border-radius: 13px; padding: 16px 18px; }
.notice-box ol li { margin: 6px 0; }
.read-aloud { display: flex; gap: 10px; align-items: center; background: var(--warn-bg); color: var(--warn); border: 1px dashed var(--warn-line); border-radius: 11px; padding: 9px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.read-aloud svg { width: 18px; height: 18px; flex: none; }

/* signature pad */
.pad { width: 100%; height: 200px; border: 2px dashed #c7d0df; border-radius: 13px; background: #fff linear-gradient(transparent calc(100% - 46px), #e3e8f1 calc(100% - 46px), #e3e8f1 calc(100% - 45px), transparent calc(100% - 45px)); touch-action: none; display: block; cursor: crosshair; }
.pad:hover { border-color: var(--brand-line); }

/* big numbers / receipts */
.big { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: .04em; color: var(--ink); }
.receipt-head {
    margin: -22px -22px 18px; padding: 20px 22px; border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(135deg, #f5f8ff, #eaf0ff); border-bottom: 1px solid var(--brand-line);
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap;
}
.receipt-head h1 { margin: 0 0 4px; font-size: 20px; }
.receipt-no { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: .03em; color: var(--brand-deep); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.meta b { color: var(--ink-2); font-weight: 600; }

/* QR + link share */
.share { display: grid; gap: 22px; grid-template-columns: auto 1fr; align-items: center; }
.qr { display: inline-grid; place-items: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); min-width: 160px; min-height: 160px; }
.qr img, .qr canvas { display: block; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.live .dot { animation: pulse 1.6s infinite; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
@keyframes pulse { 50% { opacity: .35; } }

/* history timeline */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 16px 28px; margin: 0; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 1px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.timeline .t { font-weight: 600; font-size: 14px; }
.timeline .when { color: var(--muted); font-size: 12.5px; }

/* details / pre */
details > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 14px; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details[open] > summary::before { transform: rotate(45deg); }
details.panel > summary { font-size: 12.5px; }
details.danger-zone { border: 1px solid var(--err-line); border-radius: 12px; padding: 12px 16px; background: #fffafa; margin-top: 14px; }
details.danger-zone > summary { color: var(--err); }
pre { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; background: #0e1730; color: #dbe4ff; padding: 14px; border-radius: 12px; overflow: auto; max-height: 360px; margin: 8px 0 0; }
.notice pre, .words { white-space: pre-line; }

/* ---------------------------------------------------------------- sign-in */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth .side {
    position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(700px 420px at 10% 0%, rgba(99, 140, 255, .45), transparent 60%),
        radial-gradient(600px 400px at 100% 100%, rgba(56, 189, 248, .22), transparent 60%),
        linear-gradient(160deg, #0d1b3d 0%, #13296b 55%, #1a3fa8 100%);
}
.auth .side .brand { color: #fff; }
.auth .side .brand small { color: rgba(255, 255, 255, .6); }
.auth .side h2 { font-size: 32px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 14px; font-weight: 700; max-width: 460px; }
.auth .side p { color: rgba(255, 255, 255, .75); max-width: 440px; }
.auth .side ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.auth .side li { display: flex; gap: 12px; align-items: center; color: rgba(255, 255, 255, .88); font-size: 14.5px; }
.auth .side li span.tick { width: 24px; height: 24px; border-radius: 50%; background: rgba(74, 222, 128, .18); color: #86efac; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 800; }
.auth .side .foot { font-size: 12.5px; color: rgba(255, 255, 255, .5); }
.auth .main { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth .box { width: 100%; max-width: 400px; }
.auth .box h1 { font-size: 26px; margin-bottom: 6px; }

/* ---------------------------------------------------------------- the person's own pages (public, phone-first) */
.public { min-height: 100vh; background: radial-gradient(900px 380px at 50% -120px, #dfe8ff, transparent 70%), var(--bg); }
.public-head { max-width: 640px; margin: 0 auto; padding: 22px 18px 4px; display: flex; align-items: center; gap: 10px; }
.public .wrap { max-width: 640px; padding-top: 12px; }
.result { text-align: center; padding: 36px 26px 30px; }
.result .badge-ico { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: var(--ok-bg); color: var(--ok); box-shadow: 0 0 0 10px rgba(18, 120, 74, .06); }
.result .badge-ico svg { width: 36px; height: 36px; }
.result.warn .badge-ico { background: var(--warn-bg); color: var(--warn); box-shadow: 0 0 0 10px rgba(138, 83, 0, .06); }
.result.err .badge-ico { background: var(--err-bg); color: var(--err); box-shadow: 0 0 0 10px rgba(180, 35, 24, .06); }
.result h1 { font-size: 22px; margin-bottom: 10px; }
.result p { color: var(--ink-2); }
.result .hi { color: var(--muted); font-size: 14px; }
.result .numbox { margin: 20px auto 6px; display: inline-block; padding: 14px 22px; border: 1.5px dashed var(--brand-line); border-radius: 14px; background: var(--brand-soft); }
.result .numbox .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.sticky-submit { position: sticky; bottom: 0; padding: 14px 0 18px; background: linear-gradient(transparent, var(--bg) 35%); }

/* ---------------------------------------------------------------- test page bits */
.notice { margin-top: 16px; border: 1px solid var(--line); border-radius: 13px; padding: 16px 18px; background: #fbfcfe; }
.notice-title { margin: 0 0 8px; font-size: 16.5px; }
.notice h4 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.words { color: var(--ink-2); margin: 4px 0; }
.question { border-top: 1px dashed var(--line); padding: 10px 0; }
.question label.opt, .purpose label.opt { font-weight: 500; display: inline-flex; gap: 4px; align-items: center; margin: 0 14px 0 0; }
.purpose.row-purpose { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 14px; }
.purpose .name { flex: 1 1 220px; }
.pass { color: var(--ok); font-weight: 700; } .fail { color: var(--err); font-weight: 700; }
.checks td:first-child { width: 38%; font-weight: 600; }
tr.refused td { background: var(--err-bg); color: var(--err); }

/* ---------------------------------------------------------------- footer */
.foot-note { color: var(--faint); font-size: 12.5px; text-align: center; padding: 10px 0 30px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth .side { padding: 28px 24px; }
    .auth .side h2 { font-size: 24px; }
    .auth .side ul, .auth .side .foot { display: none; }
}
@media (max-width: 720px) {
    .wrap { padding: 18px 14px; }
    .card { padding: 18px 16px; border-radius: 14px; }
    .table-wrap { margin: 0 -16px; padding: 0 16px; }
    .receipt-head { margin: -18px -16px 16px; padding: 18px 16px; }
    .appbar .in { padding: 8px 14px; gap: 10px; flex-wrap: wrap; }
    .appbar .who { order: 2; }
    .burger { display: grid; order: 3; margin-left: 0; }
    .appbar .nav { order: 4; width: 100%; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 0 8px; border-top: 1px solid var(--line-2); }
    .nav-toggle:checked ~ .nav { display: flex; }
    .nav-toggle:checked ~ .burger { background: var(--chip); }
    .nav > a, .nav details.menu > summary { padding: 11px 12px; }
    .nav details.menu > summary { display: flex; justify-content: space-between; }
    .nav .panel { position: static; box-shadow: none; border: 0; padding: 0 0 4px 12px; min-width: 0; max-width: none; max-height: none; }
    .who .name { display: none; }
    .brand small { display: none; }
    .share { grid-template-columns: 1fr; justify-items: center; }
    h1 { font-size: 21px; }
    .hero { padding: 24px 20px; }
    .hero h1 { font-size: 22px; }
}

/* ---------------------------------------------------------------- print (receipts) */
@media print {
    .appbar, .subnav, .noprint, form, .tabs { display: none !important; }
    body { background: #fff; font-size: 12pt; }
    .wrap { padding: 0; max-width: none; }
    .card { border: 0; padding: 0; box-shadow: none; }
    .receipt-head { margin: 0 0 16px; border: 1px solid #ccc; border-radius: 10px; }
}

h2 > .muted { display: block; font-weight: 400; margin-top: 4px; font-size: 13px; letter-spacing: 0; }
