:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #1a2230;
  --muted: #5d6878;
  --accent: #0f6b5f;
  --accent-soft: #e3f2ef;
  --normal: #2e8b57;
  --normal-soft: #e5f4ec;
  --low: #2f6fcf;
  --low-soft: #e6eefb;
  --high: #d2552b;
  --high-soft: #fcebe4;
  --crit: #b3122f;
  --crit-soft: #fbe3e7;
  --warn: #b7791f;
  --warn-soft: #fbf1df;
  --unknown: #8a94a3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #171d24;
    --surface-2: #1f262f;
    --border: #2b333d;
    --text: #e6eaef;
    --muted: #97a2b0;
    --accent: #3fb6a3;
    --accent-soft: #163a35;
    --normal: #4cc283;
    --normal-soft: #173527;
    --low: #6aa2f4;
    --low-soft: #182a45;
    --high: #f0875f;
    --high-soft: #432519;
    --crit: #ff6b81;
    --crit-soft: #47161f;
    --warn: #e2b05a;
    --warn-soft: #3d2f15;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- sidebar */
.sidebar { width: 248px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 6px 18px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.brand-name { font-weight: 700; letter-spacing: 0.08em; }
.brand-sub { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
#nav button { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer; color: var(--text); }
#nav button:hover { background: var(--surface-2); }
#nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#nav button:disabled { opacity: 0.4; cursor: default; background: none; }
#nav .ico { width: 18px; text-align: center; opacity: 0.8; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 14px 10px 4px; }
.badge { margin-left: auto; background: var(--high); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; }
.sidebar-foot { font-size: 11px; color: var(--muted); padding: 10px; border-top: 1px solid var(--border); }

/* ---------- main */
main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 19px; margin: 0; }
.patient-chip { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.lang { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.view { flex: 1; overflow: auto; padding: 22px 24px 40px; }
.banner { margin: 12px 24px 0; padding: 10px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }

/* ---------- primitives */
.btn { white-space: nowrap; border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--crit); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
input[type=text], input[type=number], input[type=password], input[type=date], input[type=tel], input[type=email], select, textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; min-width: 0;
}
input:disabled { opacity: 0.75; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h2 { font-size: 15px; margin: 0 0 12px; }
.card h3 { font-size: 13.5px; margin: 0 0 8px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 6px; }

/* ---------- status pills */
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.normal { color: var(--normal); background: var(--normal-soft); }
.pill.low { color: var(--low); background: var(--low-soft); }
.pill.high { color: var(--high); background: var(--high-soft); }
.pill.critical { color: var(--crit); background: var(--crit-soft); }
.pill.unknown { color: var(--unknown); background: var(--surface-2); }
.sev { border-left: 4px solid var(--unknown); }
.sev.urgent, .sev.severe { border-left-color: var(--crit); }
.sev.attention, .sev.moderate { border-left-color: var(--high); }
.sev.watch, .sev.mild { border-left-color: var(--warn); }
.sev.ok, .sev.info { border-left-color: var(--normal); }

/* ---------- ingest */
.dropzone { border: 2px dashed var(--border); border-radius: 14px; padding: 44px 20px; text-align: center; background: var(--surface); transition: 0.15s; cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .big { font-size: 36px; }
.engine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.engine { border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; background: var(--surface); display: flex; gap: 10px; align-items: flex-start; }
.engine input { margin-top: 3px; accent-color: var(--accent); }
.engine:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.engine .t { font-weight: 600; }
.engine .d { font-size: 12px; color: var(--muted); }
.engine .s { font-size: 11px; margin-top: 4px; }
.engine.unavailable { opacity: 0.55; }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.queue-item:last-child { border-bottom: 0; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
td.num { font-variant-numeric: tabular-nums; }
tr.abn-low td:first-child { box-shadow: inset 3px 0 0 var(--low); }
tr.abn-high td:first-child { box-shadow: inset 3px 0 0 var(--high); }
tr.abn-crit td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
tr.excluded { opacity: 0.45; }
.panel-head td { background: var(--surface-2); font-weight: 700; font-size: 12.5px; }
.panel-head.focus td { background: var(--accent-soft); color: var(--accent); }
.verify-table input[type=text], .verify-table input[type=number] { width: 100%; }
.verify-table select { width: 100%; }
.verify-table td { padding: 5px 6px; }
.warn-cell { color: var(--warn); font-size: 11.5px; }
.rangebar { position: relative; height: 6px; background: var(--surface-2); border-radius: 3px; width: 120px; }
.rangebar .ok { position: absolute; top: 0; bottom: 0; background: var(--normal-soft); border: 1px solid var(--normal); border-radius: 3px; }
.rangebar .dot { position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; margin-left: -6px; border: 2px solid var(--surface); }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.raw-text { white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; max-height: 70vh; overflow: auto; background: var(--surface-2); padding: 12px; border-radius: 8px; }

/* ---------- dashboard */
.kpi { padding: 14px 16px; }
.kpi .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi.normal .v { color: var(--normal); }
.kpi.low .v { color: var(--low); }
.kpi.high .v { color: var(--high); }
.kpi.critical .v { color: var(--crit); }
.profile dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; font-weight: 500; }
.chart-box { position: relative; height: 260px; }
.panel-bars .pb { display: grid; grid-template-columns: 170px 1fr 54px; gap: 10px; align-items: center; margin-bottom: 7px; font-size: 12.5px; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.stack span { display: block; height: 100%; }

/* ---------- calculators / analysis */
.calc { padding: 14px 16px; }
.calc .name { font-weight: 600; }
.calc .val { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.calc .val small { font-size: 12px; color: var(--muted); font-weight: 500; }
.calc .band { font-weight: 600; font-size: 12.5px; }
.calc .ref { font-size: 11px; color: var(--muted); margin-top: 8px; }
.obs { padding: 14px 18px; }
.obs h3 { font-size: 14.5px; }
.obs ul { margin: 6px 0 0; padding-left: 18px; }
.obs .ev { font-size: 12px; color: var(--muted); }
.disclaimer { border: 1px solid var(--warn); background: var(--warn-soft); color: var(--text); border-radius: var(--radius); padding: 12px 16px; font-size: 13px; }
.disclaimer b { color: var(--warn); }
.ai-text { white-space: pre-wrap; }
.tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tabs button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; }
.tabs button.active { background: var(--accent); color: #fff; }

/* ---------- trends */
.delta.up { color: var(--high); }
.delta.down { color: var(--low); }
.delta { font-size: 11.5px; margin-left: 4px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.selected td { background: var(--accent-soft); }

/* ---------- toast */
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 480px; z-index: 50; white-space: pre-wrap; }
.toast.error { background: var(--crit); color: #fff; }

.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; }
.form-grid label, .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-grid label input, .form-grid label select { color: var(--text); font-size: 13.5px; }

/* ---------- calculator library */
.lib-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.lib-list { max-height: calc(100vh - 230px); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.lib-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 9px 12px; cursor: pointer; }
.lib-item:hover { background: var(--surface-2); }
.lib-item.active { background: var(--accent-soft); }
.lib-name { font-weight: 600; font-size: 13px; }
.lib-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-detail { max-height: calc(100vh - 230px); overflow: auto; }
.lib-sec { margin-top: 14px; }
.lib-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin: 0 0 6px; }
.lib-sec h4 { font-size: 13px; margin: 10px 0 4px; }
.lib-text { white-space: pre-wrap; font-size: 13px; }
.lib-pre { white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; margin: 0; }
.lib-table td { padding: 5px 8px; font-size: 12.5px; }
.lib-faq { margin-bottom: 8px; }
.lib-version { border-top: 2px solid var(--border); margin-top: 18px; padding-top: 6px; }
.lib-vtag { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 15, 20, 0.55); z-index: 40; display: grid; place-items: center; padding: 30px; }
.modal-wrap { position: relative; width: min(900px, 100%); max-height: 100%; display: flex; flex-direction: column; }
.modal { overflow: auto; max-height: calc(100vh - 100px); }
.modal-close { align-self: flex-end; margin-bottom: 8px; }

/* ---------- doctor questions */
.q-group h3 { font-size: 13px; margin: 14px 0 4px; color: var(--accent); }
.q-group ol { margin: 0; padding-left: 26px; }
.q-group li { margin: 3px 0; }

/* ---------- AI providers */
.provider { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.provider.active { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- patients */
.patient-form h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin: 6px 0 8px; }
.patient-form textarea { width: 100%; resize: vertical; color: var(--text); font-size: 13.5px; }
.patient-form label > textarea { margin-top: 0; }
.cond-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin-bottom: 10px; }
select.small { font-size: 12px; padding: 3px 6px; }

/* local engine installer + tuning */
.engine-actions { gap: 6px; margin-top: 8px; }
.engine-grid.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.install-panel { border: 1px solid var(--accent); border-left-width: 4px; border-radius: 10px; padding: 12px; margin-bottom: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.install-panel .row { gap: 8px; flex-wrap: wrap; }
.progress { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.progress .bar { height: 100%; background: var(--accent); transition: width 0.4s ease; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tune-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.tune-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.tune-row.check { flex-direction: row; align-items: flex-start; gap: 8px; grid-column: 1 / -1; }
.tune-row.check input { margin-top: 2px; accent-color: var(--accent); }
.tune-result { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.raw-preview { max-height: 280px; overflow: auto; font-size: 11px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px; white-space: pre-wrap; }

/* interactive calculator panel (calculator library) */
.pill.scored { color: var(--accent); background: var(--accent-soft); }
.lc { background: var(--surface-2); box-shadow: none; padding: 14px 16px; margin: 4px 0 14px; display: flex; flex-direction: column; gap: 8px; }
.lc-head { gap: 10px; flex-wrap: wrap; }
.lc-head h3 { margin: 0; font-size: 15px; }
.lc-kind { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.lc-kind.verified { color: var(--normal); background: var(--normal-soft); }
.lc-kind.scored { color: var(--accent); background: var(--accent-soft); }
.lc-kind.ai { color: var(--warn); background: var(--surface); border: 1px solid var(--border); }
.lc-from { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 5px; vertical-align: 1px; }
.lc-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.lc-numunit { gap: 6px; flex-wrap: nowrap; }
.lc-numunit input[type=number] { flex: 1; min-width: 0; }
.lc-vers { align-self: flex-start; }
.lc-qs { display: flex; flex-direction: column; gap: 10px; }
.lc-qlabel { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.lc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lc-chip { display: inline-flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; max-width: 100%; }
.lc-chip b { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.lc-chip:hover { border-color: var(--accent); }
.lc-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lc-chip.on b { color: #fff; }
.lc-result { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.lc-result:empty { display: none; }
.lc-value { font-size: 26px; font-weight: 800; line-height: 1.15; }
.lc-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.lc-ai-value { font-size: 18px; }
.lc-band { font-weight: 700; margin: 2px 0 4px; }
.lc-band-table { margin-top: 6px; }
.lc-ai { margin-top: 6px; }
.lc-warn { margin-top: 8px; color: var(--warn); }
.lc-airow { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.lc-airow select { max-width: 340px; }

/* Clinical record: details read from documents, with a link back to their source */
.src-tag { align-self: flex-start; border: 0; background: var(--accent-soft); color: var(--accent); font-size: 11px; padding: 1px 7px; border-radius: 999px; cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-tag:hover { text-decoration: underline; }
span.src-tag.muted { background: var(--surface-2); color: var(--muted); cursor: default; }
span.src-tag.muted:hover { text-decoration: none; }
.printed { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--text); }
.rec-sec { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.rec-sec > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.rec-sec[open] > summary { margin-bottom: 10px; }
.facts-card > summary { gap: 10px; list-style: none; }
.facts-table td { vertical-align: top; }
.facts-table tr.excluded td { opacity: 0.55; }
.raw-text mark { background: #ffe58a; color: #1a2230; border-radius: 3px; padding: 0 2px; }

/* Sponsor & updates */
.sponsor-btn { display: block; width: 100%; margin-bottom: 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: #c2185b; font-weight: 600; font-size: 12.5px; cursor: pointer; text-align: center; }
.sponsor-btn:hover { background: #fce4ec; border-color: #f8bbd0; }
.sponsor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.sponsor-card { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 14px; }
.sponsor-card:hover { border-color: var(--accent); }
.update-bar { margin: 12px 24px 0; padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--text); font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.update-progress { flex: 1; min-width: 160px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.update-progress > div { height: 100%; background: var(--accent); transition: width 0.2s; }
@media (prefers-color-scheme: dark) { .sponsor-btn { color: #f48fb1; } .sponsor-btn:hover { background: rgba(244, 143, 177, 0.12); border-color: #f48fb1; } }
.update-bar[hidden] { display: none; }

/* Share with a doctor */
.share-code { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 10px; background: var(--accent-soft); flex-wrap: wrap; }
.share-code b { font: 700 26px/1 ui-monospace, Menlo, monospace; letter-spacing: 0.08em; color: var(--accent); }
.share-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.share-opts label { gap: 8px; }
.doctor-notes { border-left: 4px solid var(--accent); }
.doctor-notes h2 { font-size: 15px; margin: 0 0 6px; }

/* ---- app lock */
.lock-btn { display: block; width: 100%; margin-bottom: 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 12.5px; cursor: pointer; text-align: center; }
.lock-btn:hover { background: var(--surface-2); }
.lock-btn[hidden] { display: none; }
body.locked > aside, body.locked > main { visibility: hidden; }
.lock-screen { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 24px; overflow: auto; }
.lock-box { width: min(340px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lock-box h1 { font-size: 22px; margin: 10px 0 0; }
.lock-box > p { margin: 0; }
.lock-mark { width: 56px; height: 56px; font-size: 28px; border-radius: 14px; }
.pin-dots { display: flex; gap: 16px; margin: 18px 0 6px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); transition: background 0.1s, border-color 0.1s; }
.pin-dots span.on { background: var(--accent); border-color: var(--accent); }
.lock-msg { min-height: 2.6em; color: var(--crit); font-size: 13px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 68px); gap: 12px; margin-bottom: 14px; }
.pin-key { height: 56px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 22px; cursor: pointer; }
.pin-key:hover { background: var(--surface-2); }
.pin-key:active { background: var(--accent-soft); }
.lock-screen.waiting .pin-key { opacity: 0.4; cursor: not-allowed; }
.lock-screen.shake .pin-dots { animation: pin-shake 0.35s; }
@keyframes pin-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .lock-screen.shake .pin-dots { animation: none; } }
.lock-forgot { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; font-size: 12.5px; text-align: left; }
.lock-forgot p { margin: 0 0 8px; }
.lock-ver { margin-top: 18px !important; }
.pin-input { font-size: 22px; letter-spacing: 0.5em; width: 9ch; padding: 6px 10px; text-align: center; }
.modal-wrap.narrow { width: min(420px, 100%); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 11px ui-monospace, Menlo, monospace; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface-2); }

/* phone menu button and scrim: only used by the Android app (mobile/src/android.css) */
.menu-btn, .nav-scrim { display: none; }
