/* සත්කාර O/L · same white theme as the A/L app (light.css): cool neutrals, amber + royal blue, per-subject accents. */
:root {
  --bg: #f5f7fc; --bg-2: #eef2f9; --surface: #ffffff; --surface-2: #eef2f9; --line: #e2e7f1; --line-2: #cbd5e6;
  --text: #0f172a; --muted: #55607a;
  --accent: #ffc53d; --accent-ink: #1a1300; --accent-text: #b86e00; --accent-2: #2563eb;
  --t1: #f1f5ff; --t2: #fff7e3; --bd: #c7d6fb; --glow: rgba(255, 197, 61, .35);
  --good: #16a34a; --good-soft: #dcfce7; --bad: #dc2626; --bad-soft: #fee2e2;
  --grid: #e5eaf3; --axis: #64748b; --wire: #334155; --code-bg: #0f172a; --code-fg: #e2e8f0; --hl: rgba(255, 197, 61, .22);
  --f-head: "Space Grotesk", "Noto Sans Sinhala", system-ui, sans-serif;
  --f-body: "Inter", "Noto Sans Sinhala", system-ui, sans-serif;
  --f-si: "Noto Sans Sinhala", "Inter", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 26px -18px rgba(15, 23, 42, .22);
  color-scheme: light;
}
/* Subject colours: set on <body> while inside a subject, and on each home card */
[data-s="sci"]  { --accent: #34d399; --accent-ink: #022c1e; --accent-text: #047857; --accent-2: #2563eb; --t1: #ecfbf4; --t2: #eef4ff; --bd: #bfe9d6; --glow: rgba(52, 211, 153, .28); }
[data-s="math"] { --accent: #818cf8; --accent-ink: #1e1b4b; --accent-text: #4338ca; --accent-2: #d97706; --t1: #eef0ff; --t2: #fff7e3; --bd: #cfd3fb; --glow: rgba(129, 140, 248, .3); }
[data-s="hist"] { --accent: #fb923c; --accent-ink: #431407; --accent-text: #c2410c; --accent-2: #7c3aed; --t1: #fff3e8; --t2: #f5f1ff; --bd: #fbd5b5; --glow: rgba(251, 146, 60, .28); }
[data-s="ict"]  { --accent: #a78bfa; --accent-ink: #2e1065; --accent-text: #6d28d9; --accent-2: #0891b2; --t1: #f5f1ff; --t2: #ecfeff; --bd: #ddd0fb; --glow: rgba(167, 139, 250, .3); }
[data-s="sin"]  { --accent: #fb7185; --accent-ink: #4c0519; --accent-text: #be123c; --accent-2: #d97706; --t1: #fff1f3; --t2: #fff7e3; --bd: #fbcbd3; --glow: rgba(251, 113, 133, .26); }
[data-s="eng"]  { --accent: #38bdf8; --accent-ink: #082f49; --accent-text: #0369a1; --accent-2: #e11d48; --t1: #ecf8ff; --t2: #fff1f3; --bd: #bfe3f7; --glow: rgba(56, 189, 248, .28); }
[data-s="elit"] { --accent: #2dd4bf; --accent-ink: #042f2e; --accent-text: #0f766e; --accent-2: #9333ea; --t1: #ecfdfa; --t2: #f8f0ff; --bd: #b9ece4; --glow: rgba(45, 212, 191, .28); }

* { box-sizing: border-box; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
.shell { max-width: 560px; margin: 0 auto; padding-block: max(14px, env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 14px; }
#app { display: grid; gap: 14px; min-width: 0; }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
[lang="si"] { font-family: var(--f-si); }
h2 { margin: 0; font: 700 21px/1.3 var(--f-head); letter-spacing: -.02em; text-wrap: balance; }
h2[lang="si"] { font-family: var(--f-si); font-size: 19px; letter-spacing: 0; }
svg { display: block; max-width: 100%; height: auto; }
svg.sicon { flex: none; overflow: hidden; background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }

/* ---------- header (A/L hub-brand) ---------- */
.top { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; min-width: 0; }
.brand .logo { width: clamp(34px, 11vw, 42px); height: clamp(34px, 11vw, 42px); flex: none; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.brand .si { display: block; font: 700 clamp(20px, 6.6vw, 25px)/1.5 var(--f-si); padding: .16em .1em .04em; margin: -.16em 0 -.1em -.1em;
  background: linear-gradient(90deg, #d97706, #f59e0b 40%, #2563eb); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.brand .si span { font-family: var(--f-head); }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand small b { color: var(--text); font-weight: 600; }
.seg { margin-left: auto; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; flex: none; }
.seg button { border: 0; background: none; padding: 6px clamp(8px, 3vw, 12px); border-radius: 9px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: #ffc53d; color: #1a1300; }

/* ---------- shared ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.eyebrow[lang="si"] { letter-spacing: .02em; }
.sub { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sub[lang="si"] { letter-spacing: .02em; }
.hub-q { margin: 4px 0 -2px; font: 700 21px/1.35 var(--f-head); }
.hub-q[lang="si"] { font-family: var(--f-si); font-size: 19px; }
.btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.main { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.wide { width: 100%; padding: 14px 16px; font-size: 15.5px; border-radius: 14px; }
.btn:disabled { opacity: .4; cursor: default; }
.back { justify-self: start; display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; padding: 4px 8px 4px 0; color: var(--accent-2); font-weight: 600; cursor: pointer; }
.back svg, .chev, .x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mring { width: 40px; height: 40px; flex: none; transform: rotate(-90deg); }
.mring.big { width: 54px; height: 54px; }
.mring circle { fill: none; stroke-width: 4.5; }
.mring .tr { stroke: var(--surface-2); } .mring .fg { stroke: var(--accent); stroke-linecap: round; }
.foot { text-align: center; font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.7; }
.link { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 12px; cursor: pointer; padding: 4px; }

/* ---------- home ---------- */
.rev { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rev.due { border-color: #ffc53d; background: linear-gradient(135deg, #ffffff, #fff8e6); }
.rev-ic { width: 44px; height: 44px; flex: none; border-radius: 13px; display: grid; place-items: center; background: #fff3cf; color: #b86e00; font-size: 22px; }
.rev-t { display: grid; gap: 2px; flex: 1; min-width: 180px; }
.rev-t b { font-size: 15.5px; } .rev-t small { color: var(--muted); font-size: 13px; }
.rev .btn { flex: none; }
.subj { position: relative; overflow: hidden; border-radius: 22px; padding: 16px; border: 1.5px solid var(--bd); background: linear-gradient(135deg, #ffffff, var(--t1) 55%, var(--t2)); box-shadow: var(--shadow); display: grid; gap: 12px; }
.subj::after { content: ""; position: absolute; right: -50px; top: -50px; width: 170px; height: 170px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, var(--glow), transparent 70%); }
.subj-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; width: 100%; }
.subj-top svg.sicon { width: 54px; height: 54px; }
.subj-top .nm { flex: 1; min-width: 0; display: grid; gap: 1px; }
.subj-top .nm b { font: 700 19px/1.3 var(--f-head); letter-spacing: -.01em; }
.subj-top .nm b[lang="si"] { font-family: var(--f-si); font-size: 17.5px; letter-spacing: 0; }
.subj-top .nm small { color: var(--muted); font-size: 12.5px; }
.subj-top .pct { flex: none; text-align: center; font: 700 18px/1.1 var(--f-head); color: var(--accent-text); }
.subj-top .pct small { display: block; font: 500 10.5px var(--f-body); color: var(--muted); }
.subj-status { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); }
.subj-status > span { display: grid; gap: 1px; min-width: 0; }
.subj-status b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subj-status small { color: var(--muted); font-size: 12.5px; }
.subj-status .btn { flex: none; padding: 9px 14px; font-size: 14px; white-space: nowrap; }
.bar { display: block; height: 6px; border-radius: 9px; background: rgba(15, 23, 42, .08); overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 9px; }

/* ---------- subject + topic ---------- */
.shero { position: relative; overflow: hidden; border-radius: 22px; padding: 16px; border: 1.5px solid var(--bd); background: linear-gradient(135deg, #ffffff, var(--t1) 55%, var(--t2)); box-shadow: var(--shadow); display: grid; gap: 14px; }
.shero::after { content: ""; position: absolute; right: -50px; top: -50px; width: 170px; height: 170px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, var(--glow), transparent 70%); }
.shero > * { position: relative; z-index: 1; }
.shero .hd { display: flex; align-items: center; gap: 12px; }
.shero svg.sicon { width: 54px; height: 54px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 14px; padding: 8px 6px; text-align: center; }
.stat b { display: block; font: 700 19px/1.2 var(--f-head); color: var(--accent-text); }
.stat small { color: var(--muted); font-size: 11.5px; }
.tlist { display: grid; gap: 10px; }
.trow { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 12px 12px 14px; cursor: pointer; min-width: 0; width: 100%; }
.trow-t { display: grid; gap: 2px; min-width: 0; flex: 1; }
.trow-t b { font-size: 15.5px; } .trow-t small { color: var(--muted); font-size: 12.5px; }
.chev { color: var(--muted); flex: none; }
.ttl { margin-top: -6px; }
.note { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; font-size: 15px; }
.note li::marker { color: var(--accent-text); }
.acts { display: grid; gap: 10px; }
.act { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; cursor: pointer; width: 100%; }
.act > span:last-child { display: grid; gap: 2px; min-width: 0; }
.act b { font-size: 16px; } .act small { color: var(--muted); font-size: 13px; }
.act.main { border: 1.5px solid var(--bd); background: linear-gradient(135deg, #ffffff, var(--t1)); }
.act .tic { width: 54px; height: 54px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--t1); color: var(--accent-text); }
.act .tic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dummy { font-size: 12.5px; color: var(--muted); text-align: center; margin: 0; }

/* ---------- quiz ---------- */
.qbar { display: flex; align-items: center; gap: 10px; }
.x { border: 0; background: var(--surface-2); width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; }
.prog { flex: 1; height: 8px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); border-radius: 9px; transition: width .3s; }
.qbar small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qcard { display: grid; gap: 10px; }
.qp { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.5; }
.qp[lang="si"] { font-size: 16px; }
.qcode { margin: 0; background: var(--code-bg); color: var(--code-fg); border-radius: 12px; padding: 12px 14px; font: 500 14.5px/1.65 var(--f-mono); overflow-x: auto; }
.opts { display: grid; gap: 9px; }
.opt { display: flex; gap: 11px; align-items: flex-start; text-align: left; width: 100%; border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 14px; padding: 12px 13px; cursor: pointer; font-size: 15px; }
.opt b { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-size: 13px; }
.opt span { padding-top: 1px; min-width: 0; }
.opt:disabled { cursor: default; }
.opt:disabled:not(.okc):not(.badc) { opacity: .75; }
.opt.okc { border-color: var(--good); background: var(--good-soft); } .opt.okc b { background: var(--good); color: #fff; }
.opt.badc { border-color: var(--bad); background: var(--bad-soft); } .opt.badc b { background: var(--bad); color: #fff; }
.fb { border-radius: 14px; padding: 11px 13px; font-size: 14.5px; display: grid; gap: 4px; }
.fb small { color: var(--muted); font-size: 13px; }
.fb.ok { background: var(--good-soft); border: 1px solid var(--good); } .fb.no { background: var(--bad-soft); border: 1px solid var(--bad); }
.done { justify-items: center; text-align: center; padding-block: 22px; }
.done p { margin: 0; color: var(--muted); }
.done .big { font-size: 18px; font-weight: 700; color: var(--text); }

/* ---------- explore tools ---------- */
.tool h2 { font-size: 19px; }
.lesson { font-size: 14.5px; background: var(--surface-2); border-radius: 12px; padding: 11px 13px; }
.progs { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.pill.on { border-color: var(--accent-text); background: var(--t1); }
.code { background: var(--code-bg); color: var(--code-fg); border-radius: 12px; padding: 10px 0; font: 500 14px/1.75 var(--f-mono); overflow-x: auto; }
.ln { display: flex; gap: 12px; padding: 0 14px; white-space: pre; border-left: 4px solid transparent; }
.ln i { font-style: normal; color: #64748b; width: 1.2em; text-align: right; flex: none; }
.ln.cur { background: var(--hl); border-left-color: #ffc53d; }
.kw { color: #f472b6; } .fn { color: #60a5fa; } .num { color: #fbbf24; } .str { color: #86efac; }
.panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.pane { border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; min-height: 84px; }
.vars { display: grid; gap: 4px; font: 600 15px var(--f-mono); }
.vars div { display: flex; justify-content: space-between; gap: 8px; }
.vars .chg { color: var(--accent-text); }
.out { font: 600 15px/1.5 var(--f-mono); white-space: pre-wrap; }
.say { font-size: 14.5px; border-left: 4px solid var(--accent); padding: 6px 12px; background: var(--t1); border-radius: 0 10px 10px 0; min-height: 52px; }
.ctrls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.count { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.slider { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.slider label { font: 700 16px var(--f-mono); width: 1.4em; }
.slider output { font: 700 15px var(--f-mono); min-width: 4.2em; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent-text); height: 28px; }
.eq { font: 700 22px var(--f-mono); text-align: center; }
.eq .m { color: var(--accent-text); } .eq .c { color: var(--accent-2); }
.gridl { stroke: var(--grid); stroke-width: 1; } .axis { stroke: var(--axis); stroke-width: 1.6; }
.tick { font: 500 10px var(--f-body); fill: var(--muted); }
.plot { stroke: var(--accent-2); stroke-width: 3; stroke-linecap: round; fill: none; }
.icpt { fill: var(--accent-2); } .tri { fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-dasharray: 5 4; }
.trilbl { font: 700 11px var(--f-mono); fill: var(--accent-text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.target { fill: var(--surface); stroke: var(--good); stroke-width: 2.5; }
.tasks { display: grid; gap: 8px; }
.task { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; font-size: 14px; }
.task .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.task.done { border-color: var(--good); background: var(--good-soft); }
.task.done .dot { background: var(--good); border-color: var(--good); color: #fff; }
.obs { font-size: 14px; color: var(--muted); min-height: 2.6em; }
.wire { stroke: var(--wire); stroke-width: 3; fill: none; }
.cell { stroke: var(--wire); stroke-width: 3; }
.res { fill: var(--surface); stroke: var(--wire); stroke-width: 2.5; }
.meter { fill: var(--surface); stroke: var(--wire); stroke-width: 2.5; }
.mlbl { font: 700 15px var(--f-head); fill: var(--text); }
.clbl { font: 700 13px var(--f-mono); fill: var(--text); }
.e { fill: #f59e0b; }
.readout { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.rd { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; text-align: center; min-width: 88px; }
.rd small { display: block; font-size: 11.5px; color: var(--muted); }
.rd b { font: 700 19px var(--f-mono); font-variant-numeric: tabular-nums; }
.rd.cur b { color: var(--accent-text); }
.tblwrap { overflow-x: auto; }
table.rec { border-collapse: collapse; font: 500 13.5px var(--f-mono); font-variant-numeric: tabular-nums; width: 100%; }
table.rec th, table.rec td { border: 1px solid var(--line); padding: 4px 8px; text-align: center; }
table.rec th { background: var(--surface-2); font-family: var(--f-body); font-weight: 600; }
.pt { fill: var(--accent-2); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- accounts, forms, sheets (same feel as the A/L app) ---------- */
.me { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #ffc53d; background: #fff8e6; color: #b86e00; font: 700 15px var(--f-head); cursor: pointer; display: grid; place-items: center; }
.me.on { background: #ffc53d; color: #1a1300; }
.me[hidden] { display: none; }
.top .me { margin-left: auto; }
/* Sinhala | English switch next to the learning content */
.cseg { display: inline-flex; justify-self: end; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2px; flex: none; }
.cseg button { border: 0; background: none; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.cseg button.on { background: var(--t1); color: var(--accent-text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
@media (max-width: 359px) { .brand .logo { display: none; } }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .center { text-align: center; justify-self: center; }
.hello { margin: 0 0 -6px; color: var(--muted); font-size: 14px; }
.btn.amber { background: #ffc53d; color: #1a1300; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { padding: 8px 13px; font-size: 13.5px; border-radius: 10px; }
.link.rep { justify-self: center; text-decoration: none; color: var(--muted); font-size: 13px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: #ffc53d; animation: spin .8s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-head { display: grid; place-items: center; margin-top: 6px; }
.auth-logo { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.welcome { text-align: center; justify-items: center; }
.welcome p { margin: 0; }
.pts { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 8px; text-align: left; width: 100%; }
.pts li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.pts i { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--good-soft); color: var(--good); font-style: normal; font-weight: 700; font-size: 12px; display: grid; place-items: center; margin-top: 1px; }
.form { display: grid; gap: 12px; }
.form h2 { margin-bottom: 2px; }
.form label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form input:not([type=radio]):not([type=checkbox]), .form select, .form textarea, .filters input, .filters select {
  width: 100%; padding: 12px 13px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 400 16px var(--f-body); }
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 18%, transparent); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.seg2 { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg2 legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; padding: 0; }
.seg2 label { display: block; position: relative; }
.seg2 input { position: absolute; opacity: 0; }
.seg2 span { display: block; text-align: center; padding: 11px; border-radius: 12px; border: 1.5px solid var(--line-2); font-size: 15px; color: var(--text); cursor: pointer; }
.seg2 input:checked + span { border-color: #ffc53d; background: #fff8e6; font-weight: 700; }
.seg2 input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); font-size: 13.5px; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: #f59e0b; }
.err { color: var(--bad); font-size: 14px; margin: 0; min-height: 2px; }
.radios { display: grid; gap: 8px; }
.form .radio { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border: 1.5px solid var(--line-2); border-radius: 12px; color: var(--text); font-weight: 500; font-size: 14.5px; cursor: pointer; }
.radio input { accent-color: #f59e0b; width: 18px; height: 18px; }
.row-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 90; max-width: min(92vw, 480px);
  background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; box-shadow: 0 10px 30px -10px rgba(15, 23, 42, .5); transition: opacity .3s; }
.toast.out { opacity: 0; }
.sheet-bd { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 12px; }
.sheet h3 { margin: 0; font: 700 19px var(--f-head); }
.sheet[lang="si"] h3 { font-family: var(--f-si); font-size: 17.5px; }
.tip { display: flex; gap: 12px; align-items: flex-start; background: linear-gradient(135deg, #ffffff, #fff8e6); border: 1px solid #ffe2a3; border-radius: 18px; padding: 14px 34px 14px 14px; font-size: 14px; position: relative; }
.tip-ic { font-size: 22px; } .tip .btn { margin-top: 10px; }
.close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 22px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #fff8e6; border: 2px solid #ffc53d; color: #b86e00; font: 700 21px var(--f-head); }
.avatar.sm { width: 38px; height: 38px; font-size: 16px; }
.prof-hd { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prof-hd small { color: var(--muted); }
.dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; overflow-wrap: anywhere; }
.adm-chip { display: flex; align-items: center; gap: 12px; text-align: left; border: 1.5px dashed #c7d6fb; background: #f1f5ff; border-radius: 16px; padding: 10px 14px; cursor: pointer; }
.adm-chip > span:nth-child(2) { display: grid; flex: 1; } .adm-chip small { color: var(--muted); font-size: 12.5px; }

/* ---------- admin ---------- */
.tabs3, .seg3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.tabs3 button, .seg3 button { border: 0; background: none; padding: 9px 4px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs3 button.on { background: #ffc53d; color: #1a1300; } .seg3 button.on { background: var(--surface-2); color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); }
.tile b { display: block; font: 700 22px var(--f-head); } .tile small { color: var(--muted); font-size: 12px; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.filters select { width: auto; }
.stu-list { display: grid; gap: 8px; }
.stu-row { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; cursor: pointer; width: 100%; }
.stu-t { flex: 1; min-width: 0; display: grid; } .stu-t small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stu-r { flex: none; color: var(--muted); font-size: 11.5px; }
.pill { display: inline-block; font: 700 10.5px var(--f-body); padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); vertical-align: 2px; }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.reps { display: grid; gap: 10px; }
.rep-card { gap: 6px; } .rep-card p { margin: 0; } .rep-card .q { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
