:root {
  --ink: #10202E; --muted: #4E5D6C; --line: #D8DEE5; --ground: #F3F5F7; --surface: #FFFFFF;
  --brand: #0B4F6C; --brand-dark: #083A50; --tint: #E7F1F5; --red: #B42318; --amber: #8A4B00; --bar: #E3E8ED; --field: #8A97A5; --on-tint: #33424F;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E9EEF2; --muted: #A7B4C0; --line: #33414E; --ground: #0F1A22; --surface: #17242E;
    --brand: #6DB7D4; --brand-dark: #8FCBE3; --tint: #1B3644; --red: #FF9A8E; --amber: #F0B66C; --bar: #2A3843; --field: #6F7F8D; --on-tint: #CCD8E0;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 400 16px/1.45 'IBM Plex Sans', system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
#app { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.page { flex: 1; padding: calc(env(safe-area-inset-top) + 24px) 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.page.plain { background: var(--surface); padding-top: calc(env(safe-area-inset-top) + 32px); padding-bottom: calc(env(safe-area-inset-bottom) + 32px); }
h1 { margin: 4px 0 4px; font-size: 26px; line-height: 1.18; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 12px 0 0; font-size: 17px; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); }
form { display: flex; flex-direction: column; gap: 14px; }
.sub, .muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-weight: 500; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gap { height: 8px; }
.red { color: var(--red); } .amber { color: var(--amber); } .blue { color: var(--brand); }
.bg-red { background: var(--red); } .bg-amber { background: var(--amber); } .bg-blue { background: var(--brand); }
.eyebrow { font: 600 13px 'IBM Plex Mono', monospace; color: var(--muted); text-transform: uppercase; }
.big { font-size: 19px; font-weight: 700; line-height: 1.25; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--brand); margin-bottom: 18px; }
.brand span { color: var(--ink); }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.icon-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; align-self: flex-start; font-weight: 600; text-decoration: none; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
label { font-size: 14px; font-weight: 600; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--field); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
input.mono { font-family: 'IBM Plex Mono', monospace; }
textarea { resize: vertical; line-height: 1.45; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.hint { font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; min-height: 44px; }
.check input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--brand); }
.form-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--red); color: var(--red); font-size: 14px; font-weight: 500; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.vh-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 16px; border: 1px solid var(--brand); border-radius: 8px; background: var(--brand); color: var(--surface); font: 600 16px 'IBM Plex Sans', sans-serif; text-align: center; text-decoration: none; cursor: pointer; width: 100%; position: relative; }
.btn:hover { background: var(--brand-dark); }
.btn.ghost { background: var(--surface); color: var(--brand); }
.btn.ghost:hover { background: var(--tint); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.danger { color: #21100D; } }
.btn:disabled { opacity: .6; cursor: default; }
.small-btn { display: inline-flex; width: auto; min-height: 44px; }
.link { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--brand); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.link.left { text-align: left; display: block; overflow-wrap: anywhere; }
.danger-text { color: var(--red) !important; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.strong { border: 2px solid var(--brand); }
.card.soft { background: var(--ground); border: 0; }
.card.result { background: var(--tint); border: 0; }
.card h2 { margin: 0; }
.card ul { margin: 0; padding-left: 18px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.score { flex-direction: row; align-items: center; gap: 16px; }
.score > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.score svg { flex: none; color: var(--ink); }
.row-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.row-card strong { font-weight: 600; font-size: 15px; }
.row-card.note { background: var(--tint); border: 0; }
.row-card.as-btn { font: inherit; text-align: left; width: 100%; cursor: pointer; }
.done { opacity: .72; }
.note { background: var(--tint); color: var(--on-tint); padding: 12px; border-radius: 8px; }
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.plainlist { margin: 0; padding: 0; list-style: none; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; min-height: 56px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.list-row:last-child, .measure:last-child { border-bottom: 0; }
.list-row strong { font-weight: 600; font-size: 15px; }
.measure { display: grid; grid-template-columns: 22px minmax(0, 1fr) 44px; column-gap: 8px; row-gap: 6px; align-items: center; padding: 10px 14px; min-height: 56px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.measure .name { display: block; font-size: 15px; font-weight: 500; }
.measure .mono.small:last-of-type { text-align: right; }
.bar { grid-column: 2 / 4; height: 5px; border-radius: 3px; background: var(--bar); overflow: hidden; display: block; }
.bar i { display: block; height: 5px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.file { display: flex; align-items: center; gap: 10px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.prose { white-space: pre-wrap; background: var(--surface); padding: 14px; border-radius: 10px; font-size: 15px; }
.chips { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chip { position: relative; display: block; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 8px; border: 1px solid var(--field); border-radius: 8px; background: var(--surface); font-weight: 600; line-height: 1.25; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--surface); }
.chip input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.timer { background: var(--red); color: #fff; border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.timer strong { font-size: 40px; line-height: 1.1; font-weight: 600; }
@media (prefers-color-scheme: dark) { .timer { color: #21100D; } }
.draft { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 400 14px/1.45 'IBM Plex Sans', sans-serif; }
.qr { background: #fff; border-radius: 10px; padding: 6px; width: 220px; max-width: 100%; align-self: center; color: #000; }
.qr svg { display: block; width: 100%; height: auto; }
.key { overflow-wrap: anywhere; font-size: 15px; }
.codes { margin: 0; padding: 14px; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; background: var(--ground); border-radius: 10px; font-size: 13px; }
.tabs { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px); }
.tabs a { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
.tabs a[aria-current] { color: var(--brand); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 84px); transform: translateX(-50%); width: min(92vw, 420px); padding: 12px 14px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 14px; z-index: 10; }
.toast.bad { background: var(--red); color: #fff; }
/* panoul consultantului */
.wide { max-width: 1040px; }
.wide table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
.wide th, .wide td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.wide th { font-size: 13px; color: var(--muted); }
.scrollx { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
