/* WEERA/ICT class LMS - "calm study desk" look (Samsoft demo): warm paper, ink blue, red pen */
:root {
  --bg: #f4f0e6; --s1: #fbf9f3; --s2: #efe9dc; --s3: #e4dccb; --line: #ddd5c4; --line2: #c6bca7;
  --tx: #1b2a4a; --mu: #56607a; --dim: #8b8f9c;
  --ink: #1b2a4a; --paper: #fbf9f3;
  --ac: #c8372d; --ac-soft: rgba(200, 55, 45, .08);
  --ok: #2f7a4b; --bad: #c8372d; --warn: #b7791f;
  --f: 'Instrument Sans', 'Noto Sans Sinhala', system-ui, sans-serif;
  --fs: 'Noto Sans Sinhala', 'Instrument Sans', system-ui, sans-serif;
  --fh: 'Fraunces', 'Noto Serif Sinhala', Georgia, serif;
  --m: 'DM Mono', ui-monospace, Consolas, monospace;
  --pad: clamp(16px, 3.2vw, 40px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 400 15px/1.55 var(--f); min-height: 100vh; display: flex; flex-direction: column; }
body[data-lang="si"] { font-family: var(--fs); }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { display: block; }
h1, h2 { margin: 0; font-family: var(--fh); font-weight: 600; letter-spacing: -0.01em; font-optical-sizing: auto; }
h3 { margin: 0; }
h1 { font-size: clamp(30px, 3.8vw, 46px); line-height: 1.08; }
body[data-lang="si"] h1 { font-size: clamp(24px, 3vw, 36px); line-height: 1.3; }
h2 { font-size: 23px; line-height: 1.2; }
body[data-lang="si"] h2 { font-size: 20px; line-height: 1.4; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--mu); }
body[data-lang="si"] h3 { text-transform: none; letter-spacing: 0; font-size: 14px; }
.meta { color: var(--mu); margin: 6px 0 0; font-size: 14px; }
.dim { color: var(--dim); }
.mono { font-family: var(--m); font-size: 13px; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 28px; height: 66px; padding: 0 var(--pad);
  background: rgba(244, 240, 230, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line2); }
.brand { font-family: var(--fh); font-weight: 700; font-size: 22px; letter-spacing: -.01em; white-space: nowrap; }
.b-s { color: var(--ac); margin: 0 2px; font-style: italic; font-weight: 400; }
.b-i { font-style: italic; font-weight: 500; }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a { display: flex; align-items: center; padding: 0 14px; height: 100%; color: var(--mu); font-weight: 500; font-size: 14.5px; position: relative; white-space: nowrap; }
.nav a:hover { color: var(--tx); }
.nav a.on { color: var(--tx); font-weight: 600; }
.nav a.on::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 16px; height: 2px; background: var(--ac); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.role { display: flex; border: 1px solid var(--line2); height: 34px; background: var(--s1); }
.role button { padding: 0 14px; font-size: 13px; font-weight: 600; color: var(--mu); }
.role button.on { background: var(--ink); color: var(--paper); }
.lang { height: 34px; min-width: 42px; padding: 0 10px; border: 1px solid var(--line2); background: var(--s1); font-weight: 600; font-size: 13px; color: var(--mu); }
.lang:hover, .role button:not(.on):hover { color: var(--tx); }
.who { display: flex; align-items: center; gap: 10px; }
.av { width: 34px; height: 34px; display: grid; place-items: center; background: var(--s3); color: var(--tx); font-family: var(--fh); font-weight: 600; font-size: 14px; border-radius: 50%; }
.av.me { background: var(--ink); color: var(--paper); }
.who-t { display: flex; flex-direction: column; line-height: 1.25; }
.who-t b { font-size: 13px; font-weight: 600; }
.who-t small { font-size: 11px; color: var(--dim); }

/* ---------- layout ---------- */
.view { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 36px var(--pad) 52px; }
.ph { margin-bottom: 26px; }
.ph.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.crumb { display: inline-block; color: var(--mu); font-size: 13px; font-weight: 500; margin-bottom: 10px; }
.crumb:hover { color: var(--ac); }
.sec { margin: 36px 0 12px; }
.kick { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--ac); }
body[data-lang="si"] .kick { text-transform: none; letter-spacing: 0; font-size: 13px; }
.dot { width: 7px; height: 7px; background: var(--ac); border-radius: 50%; animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px var(--pad); border-top: 1px solid var(--line2); color: var(--dim); font-size: 12px; }
.foot img { width: 16px; height: 16px; vertical-align: -3px; margin: 0 2px; }
.foot b { color: var(--mu); }
.linkbtn { color: var(--mu); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.linkbtn:hover { color: var(--ac); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 14px; border: 1px solid var(--ink); white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: #2a3d63; border-color: #2a3d63; }
.btn.ghost { background: transparent; color: var(--tx); border-color: var(--line2); }
.btn.ghost:hover { border-color: var(--tx); background: var(--s1); }
.btn.sm { height: 38px; padding: 0 16px; font-size: 13px; }
.btn.xs { height: 30px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .35; pointer-events: none; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- covers: a ruled exercise-book page ---------- */
.cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background-color: var(--paper);
  background-image: linear-gradient(90deg, transparent 33px, rgba(200, 55, 45, .45) 33px, rgba(200, 55, 45, .45) 34px, transparent 34px),
    repeating-linear-gradient(180deg, transparent 0 21px, rgba(27, 42, 74, .09) 21px 22px);
  border: 1px solid var(--line2); border-top: 4px solid var(--u); }
.cv-num { position: absolute; right: 14px; top: 8px; font-family: var(--fh); font-style: italic; font-weight: 500; font-size: 40px; line-height: 1; color: var(--u); opacity: .85; }
.cv-num::before { content: 'No.'; font-size: .38em; font-style: normal; margin-right: 3px; color: var(--dim); vertical-align: .9em; }
.cv-unit { position: absolute; left: 44px; top: 12px; font-family: var(--m); font-size: 11px; color: var(--u); letter-spacing: .02em; max-width: calc(100% - 150px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-lang="si"] .cv-unit { font-family: var(--fs); }
.cv-title { position: absolute; left: 44px; right: 14px; bottom: 30px; font-family: var(--fh); font-weight: 600; font-size: 18px; line-height: 1.2; color: var(--tx); }
body[data-lang="si"] .cv-title { font-size: 15px; line-height: 1.4; }
.cv-dur { position: absolute; left: 44px; bottom: 10px; font-family: var(--m); font-size: 11px; color: var(--mu); }
.cv-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(27, 42, 74, .1); }
.cv-prog i { display: block; height: 100%; background: var(--ac); }
.cv-play { position: absolute; right: 12px; bottom: 10px; width: 34px; height: 34px; display: grid; place-items: center; background: var(--ink); color: var(--paper); border-radius: 50%;
  opacity: 0; transform: translateY(4px); transition: .18s; }
.cv-play svg { width: 13px; height: 13px; margin-left: 2px; }
a:hover .cv-play, a:focus-visible .cv-play { opacity: 1; transform: none; }
.cover.big { border-top-width: 6px; background-image: linear-gradient(90deg, transparent 63px, rgba(200, 55, 45, .45) 63px, rgba(200, 55, 45, .45) 64px, transparent 64px),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(27, 42, 74, .09) 31px 32px); box-shadow: 0 18px 40px -28px rgba(27, 42, 74, .45); }
.cover.big .cv-num { font-size: clamp(64px, 8vw, 110px); right: 28px; top: 20px; }
.cover.big .cv-title { font-size: clamp(24px, 2.8vw, 36px); bottom: 58px; left: 84px; right: 110px; }
.cover.big .cv-unit { left: 84px; top: 24px; font-size: 13px; }
.cover.big .cv-dur { left: 84px; bottom: 24px; font-size: 13px; }
.cover.big .cv-play { opacity: 1; transform: none; width: 60px; height: 60px; right: 28px; bottom: 24px; background: var(--ac); }
.cover.big .cv-play svg { width: 22px; height: 22px; margin-left: 3px; }
.cover.big .cv-prog { height: 4px; }

.lcard { display: block; min-width: 0; }
.lcard .cover { transition: transform .2s, box-shadow .2s; }
a.lcard:hover .cover { transform: translateY(-2px); box-shadow: 0 12px 24px -18px rgba(27, 42, 74, .5); }
.lc-meta { display: block; margin-top: 9px; font-size: 13px; color: var(--mu); }
.lc-meta b { color: var(--tx); font-weight: 600; }
.lc-meta em { font-style: normal; color: var(--ac); }
.lc-views { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--mu); margin-top: 6px; font-family: var(--m); }
.lc-views .bar-l { flex: 1; margin: 0; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(20px, 3.4vw, 52px); align-items: center; }
.hero-cv { display: block; }
.hero-tx h1 { margin: 14px 0 6px; }
.bar-l { height: 3px; background: var(--s3); margin: 20px 0 0; }
.bar-l i { display: block; height: 100%; background: var(--ac); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 44px; background: var(--s1); border: 1px solid var(--line2); }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 24px 26px 26px; border-left: 1px solid var(--line); }
.tile:first-child { border-left: 0; }
.tile.hot { box-shadow: inset 0 3px var(--ac); }
.t-k { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mu); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
body[data-lang="si"] .t-k { text-transform: none; letter-spacing: 0; font-size: 13px; }
.t-big { font-family: var(--fh); font-weight: 600; font-size: 44px; line-height: 1; margin: 6px 0 2px; }
.t-big small { font-size: 20px; color: var(--mu); font-weight: 500; }
.t-big.sm { font-size: 24px; line-height: 1.2; }
body[data-lang="si"] .t-big.sm { font-size: 20px; line-height: 1.4; }
.t-big.ok, b.ok { color: var(--ok); }
.t-s { font-size: 13px; color: var(--mu); }
.tile .btn { margin-top: auto; transform: translateY(10px); }
.shelf { margin-top: 52px; }
.sh-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line2); }
.sh-h h2 span { font-family: var(--f); font-size: 14px; color: var(--dim); font-weight: 500; margin-left: 12px; }
.more { font-size: 13px; font-weight: 600; color: var(--mu); }
.more:hover { color: var(--ac); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 22%); gap: 20px; overflow-x: auto; padding: 4px 0 14px; scroll-snap-type: x mandatory;
  scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.rail > * { scroll-snap-align: start; }

/* ---------- library ---------- */
.filters { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid var(--line2); }
.filters button { padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--mu); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.filters button:hover { color: var(--tx); }
.filters button.on { color: var(--tx); font-weight: 600; border-color: var(--u, var(--ac)); }
.grid-l { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px 22px; }

/* ---------- player: a whiteboard class video ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0 30px; }
.player { grid-column: 1; background: var(--ink); }
.stage { position: relative; aspect-ratio: 16 / 9; background: radial-gradient(120% 100% at 30% 20%, #fdfcf8, #eceae3 75%); overflow: hidden; cursor: pointer;
  border: 10px solid #d9d4c8; border-bottom-width: 14px; }
.stage::after { content: ''; position: absolute; left: 6%; right: 6%; bottom: 0; height: 6px; background: linear-gradient(90deg, transparent, rgba(27, 42, 74, .08), transparent); }
.st-unit { position: absolute; left: 5%; top: 7%; font-family: var(--m); font-size: clamp(11px, 1.2vw, 14px); color: var(--u); }
body[data-lang="si"] .st-unit { font-family: var(--fs); }
.st-ch { position: absolute; left: 5%; top: 14%; font-family: var(--fh); font-style: italic; font-weight: 500; font-size: clamp(16px, 2.2vw, 28px); color: var(--mu); }
.st-board { position: absolute; left: 5%; right: 5%; top: 50%; transform: translateY(-50%); font-family: var(--m); font-weight: 500; font-size: clamp(20px, 3.4vw, 46px); line-height: 1.25; color: #1f3f8a; }
.st-teacher { position: absolute; left: 5%; bottom: 7%; font-size: 12px; color: var(--dim); }
.st-teacher b { color: var(--mu); }
.st-big { position: absolute; right: 5%; bottom: 7%; width: 68px; height: 68px; display: grid; place-items: center; background: var(--ac); color: #fff; border-radius: 50%; transition: .2s;
  box-shadow: 0 10px 24px -10px rgba(200, 55, 45, .7); }
.st-big svg { width: 26px; height: 26px; margin-left: 3px; }
.playing .st-big { opacity: 0; pointer-events: none; transform: scale(.85); }
.scrub { position: relative; height: 16px; cursor: pointer; background: var(--ink); }
.scrub::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 4px; background: #3a4a6b; }
.sc-fill { position: absolute; left: 0; top: 6px; height: 4px; background: var(--ac); width: 0; }
.sc-knob { position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; background: var(--paper); border-radius: 50%; }
.sc-ch i { position: absolute; top: 6px; width: 2px; height: 4px; background: var(--ink); z-index: 1; }
.ctrls { display: flex; align-items: center; gap: 4px; padding: 6px 10px 10px; background: var(--ink); color: var(--paper); }
.ctrls button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--paper); }
.ctrls button:hover { color: #f0a59f; }
.ctrls svg { width: 22px; height: 22px; }
.ctrls .txt { width: auto; padding: 0 10px; font-family: var(--m); font-size: 13px; border: 1px solid #3a4a6b; height: 30px; }
.time { font-family: var(--m); font-size: 13px; color: #aab3c7; margin-left: 8px; }
.sp { flex: 1; }
.w-side { grid-column: 2; grid-row: 1 / span 2; }
.w-side h3 { margin: 4px 0 10px; }
.w-side h3 + .dlrow { margin-top: 0; }
.chap { list-style: none; margin: 0 0 28px; padding: 0; border-top: 1px solid var(--line2); }
.chap li { border-bottom: 1px solid var(--line); }
.chap button { display: flex; gap: 14px; width: 100%; padding: 12px 4px; text-align: left; font-size: 14px; color: var(--mu); }
.chap button:hover { color: var(--tx); }
.chap li.on button { color: var(--tx); font-weight: 600; box-shadow: inset 2px 0 var(--ac); padding-left: 12px; background: var(--ac-soft); }
.c-t { font-family: var(--m); font-size: 12px; color: var(--dim); min-width: 52px; padding-top: 2px; }
.dlrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; margin-top: 8px; background: var(--s1); border: 1px solid var(--line); text-align: left; }
.dlrow:hover { border-color: var(--line2); background: #fff; }
.dlrow > svg { width: 20px; height: 20px; flex: none; color: var(--ac); }
.dlrow span { flex: 1; display: flex; flex-direction: column; }
.dlrow b { font-size: 14px; font-weight: 600; }
.dlrow small { font-size: 12px; color: var(--dim); font-family: var(--m); }
.w-info { grid-column: 1; padding-top: 22px; }
.w-info h1 { font-size: clamp(24px, 3vw, 36px); }
.w-next { grid-column: 1 / -1; }

/* ---------- papers (student) ---------- */
.plive { display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center; padding: 26px 28px; background: var(--s1); border: 1px solid var(--line2); box-shadow: inset 4px 0 var(--ac); }
.plive.done { box-shadow: inset 4px 0 var(--line2); }
.pl-n { font-family: var(--fh); font-style: italic; font-weight: 500; font-size: 64px; line-height: .9; color: var(--ac); }
.plive.done .pl-n { color: var(--mu); }
.pl-t h2 { margin-top: 6px; font-size: 26px; }
.pl-a { display: flex; align-items: center; gap: 18px; }
.pl-score { font-family: var(--fh); font-weight: 600; font-size: 44px; color: var(--ac); }
.pl-score small { font-size: 20px; color: var(--mu); }
.plist { border-top: 1px solid var(--line2); }
.pr { display: grid; grid-template-columns: 54px 1fr auto 80px; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pr-id { font-family: var(--fh); font-style: italic; font-weight: 500; font-size: 24px; color: var(--dim); }
.pr-t { display: flex; flex-direction: column; min-width: 0; }
.pr-t b { font-size: 15px; font-weight: 600; }
.pr-t small, .pr-d { font-size: 13px; color: var(--mu); }
.pr-m { text-align: right; font-family: var(--fh); font-weight: 600; font-size: 22px; color: var(--ac); }

/* ---------- exam ---------- */
.exam { max-width: 1100px; margin: 0 auto; }
.ex-top { display: flex; align-items: center; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.ex-top .crumb { margin: 0; }
.ex-name { font-weight: 600; flex: 1; min-width: 0; }
.ex-clock { font-family: var(--m); font-size: 24px; font-weight: 500; letter-spacing: .02em; padding: 2px 12px; border: 1px solid var(--line2); background: var(--s1); }
.ex-clock.low { color: var(--bad); border-color: var(--bad); }
.ex-body { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 40px; padding-top: 30px; }
.q-n { display: flex; align-items: center; gap: 10px; font-family: var(--fh); font-style: italic; font-weight: 500; color: var(--ac); font-size: 17px; }
.q-n span { color: var(--dim); }
.flag { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--f); font-style: normal; font-size: 12px; font-weight: 500; color: var(--mu); padding: 6px 10px; border: 1px solid var(--line2); }
.flag svg { width: 14px; height: 14px; }
.flag.on { color: var(--warn); border-color: var(--warn); }
.q-t { font-family: var(--fh); font-size: clamp(21px, 2.4vw, 28px); font-weight: 500; line-height: 1.35; margin: 16px 0 26px; }
body[data-lang="si"] .q-t { line-height: 1.6; font-size: clamp(18px, 2.1vw, 24px); }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 16px; width: 100%; padding: 14px 16px; background: var(--s1); border: 1px solid var(--line); text-align: left; font-size: 16px; font-weight: 500; transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--line2); background: #fff; }
.o-k { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 1px solid var(--line2); border-radius: 50%; font-family: var(--m); font-size: 14px; color: var(--mu); }
.opt.on { border-color: var(--ink); background: #fff; box-shadow: inset 3px 0 var(--ink); }
.opt.on .o-k { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.q-move { display: flex; justify-content: space-between; margin-top: 26px; }
.ex-nav h3 { margin-bottom: 12px; }
.ex-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ex-grid button { aspect-ratio: 1; border: 1px solid var(--line2); background: var(--s1); font-family: var(--m); font-size: 14px; color: var(--mu); position: relative; }
.ex-grid button.ans { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ex-grid button.cur { border-color: var(--ac); color: var(--ac); box-shadow: inset 0 0 0 1px var(--ac); }
.ex-grid button.ans.cur { color: var(--paper); }
.ex-grid button.fl::after { content: ''; position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; background: var(--warn); border-radius: 50%; }

/* ---------- review / score ---------- */
.score { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; padding: 26px 0; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.sc-big { font-family: var(--fh); font-weight: 500; font-size: clamp(76px, 10vw, 128px); line-height: .9; color: var(--ac); }
.sc-big small { font-size: .35em; color: var(--mu); }
.sc-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sc-cells > div, .kpis > div { display: flex; flex-direction: column; gap: 4px; }
.sc-cells b { font-family: var(--fh); font-size: 30px; font-weight: 600; }
.rev { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line2); }
.rev li { display: grid; grid-template-columns: 40px 1fr 30px; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.rv-n { font-family: var(--m); color: var(--dim); font-size: 15px; padding-top: 1px; }
.rev p { margin: 0; font-weight: 600; }
.rev .rv-a { margin-top: 6px; font-weight: 400; color: var(--mu); font-size: 14px; }
.rv-a b { color: var(--tx); }
.rv-a .good { color: var(--ok); }
.rv-i svg { width: 22px; height: 22px; }
.rev li.ok .rv-i { color: var(--ac); }
.rev li.bad .rv-i { color: var(--dim); }
.rev li.bad .rv-a b:first-of-type { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.rev li.bad .rv-a b.good { color: var(--ok); text-decoration: none; }

/* ---------- KPIs / charts / tables ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--s1); border: 1px solid var(--line2); margin-bottom: 28px; }
.kpis > div { padding: 20px 22px; border-left: 1px solid var(--line); }
.kpis > div:first-child { border-left: 0; }
.kpis b { font-family: var(--fh); font-weight: 600; font-size: clamp(26px, 3vw, 38px); line-height: 1.08; }
.kpis b small { font-size: .5em; color: var(--mu); font-weight: 500; }
.kpis > div > small { font-size: 13px; color: var(--mu); }
.kpis.sm b { font-size: 28px; }
.chart, .panel { background: var(--s1); border: 1px solid var(--line2); padding: 20px 22px; }
.chart { margin-bottom: 28px; }
.ch-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.lg { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mu); }
.lg i { display: inline-block; width: 12px; height: 12px; }
.lg .lb { background: var(--ink); }
.lg .la { height: 2px; background: var(--ac); margin-left: 10px; }
.svgc { width: 100%; height: auto; margin-top: 8px; }
.svgc .b { fill: var(--ink); }
.svgc .b.lo { fill: var(--ac); }
.svgc .v { fill: var(--tx); font: 500 13px var(--m); text-anchor: middle; }
.svgc .vi { fill: var(--paper); font: 500 14px var(--m); text-anchor: middle; }
.svgc .l { fill: var(--mu); font: 400 12px var(--m); text-anchor: middle; }
.svgc .g { stroke: var(--line); stroke-width: 1; }
.svgc .gl { fill: var(--dim); font: 400 11px var(--m); text-anchor: end; }
.svgc .al { fill: none; stroke: var(--ac); stroke-width: 2; }
.svgc .ad { fill: var(--s1); stroke: var(--ac); stroke-width: 2; }
.sw { display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: 0; }
.sw.lo { background: var(--ac); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--mu); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line2); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
body[data-lang="si"] .tbl th { text-transform: none; letter-spacing: 0; font-size: 13px; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td small { display: block; color: var(--dim); font-size: 12px; font-family: var(--m); }
.tbl tbody tr:hover td { background: rgba(27, 42, 74, .03); }
.tbl td.lo b { color: var(--bad); }
.spark { width: 84px; height: 24px; }
.spark path { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.fee { min-width: 72px; height: 28px; padding: 0 10px; font-size: 12px; font-weight: 600; border: 1px solid; border-radius: 14px; }
.fee.paid { color: var(--ok); border-color: rgba(47, 122, 75, .4); }
.fee.due { color: var(--bad); border-color: rgba(200, 55, 45, .45); background: var(--ac-soft); }
.fee:hover { border-color: currentColor; }
.toolbar { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .filters { margin: 0; border: 0; }
.toolbar input { height: 42px; width: 280px; max-width: 100%; padding: 0 14px; background: var(--s1); border: 1px solid var(--line2); outline: 0; }
.toolbar input:focus { border-color: var(--ink); }
.empty { color: var(--mu); padding: 30px 0; }

/* ---------- teacher ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.tag-n { font-family: var(--m); font-weight: 500; background: var(--ac); color: #fff; padding: 1px 8px; font-size: 13px; border-radius: 10px; }
.due, .subs, .cls, .rank { list-style: none; margin: 0; padding: 0; }
.due { max-height: 300px; overflow-y: auto; margin-top: 6px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.due li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.due li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.due b { font-size: 14px; font-weight: 600; }
.due small { font-size: 12px; color: var(--dim); font-family: var(--m); }
.subs li, .cls li, .rank li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.subs li > span:first-child, .cls li > span, .rank li > span:nth-child(2) { flex: 1; min-width: 0; }
.subs .dim { font-family: var(--m); font-size: 12px; }
.subs b, .rank b { font-family: var(--m); font-weight: 500; }
.subs li.new span:first-child::after { content: ' ●'; color: var(--ac); }
.cls li.on { font-weight: 600; }
.cls li small { color: var(--ok); font-size: 12px; }
.cls b { font-family: var(--m); font-weight: 500; }
.rank .rk { width: 26px; font-family: var(--m); color: var(--dim); }
.rank li.me { color: var(--ac); font-weight: 600; }
.pp { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; }
.pp-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line2); align-self: start; }
.pp-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.pp-list button:hover { background: var(--s1); }
.pp-list button.on { background: var(--s1); box-shadow: inset 3px 0 var(--ac); }
.pp-list .pr-id { font-size: 22px; min-width: 34px; }
.pp-list button.on .pr-id { color: var(--ac); }
.pp-list .pr-t b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-list small { font-size: 12px; color: var(--mu); }
.live { font-style: normal; color: var(--ac); font-weight: 600; }
.pp-h { display: flex; gap: 20px; align-items: center; margin-bottom: 22px; }
.pp-h .pl-n { font-size: 56px; }
.pp-d .cols { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.pp-d .panel { display: flex; flex-direction: column; }
.qbars { flex: 1; min-height: 170px; display: flex; align-items: flex-end; gap: 4px; margin: 14px 0 10px; padding-bottom: 20px; position: relative; }
.qbars span { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.qbars i { display: block; background: var(--ink); min-height: 3px; }
.qbars span.lo i { background: var(--ac); }
.qbars em { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font: normal 400 11px var(--m); color: var(--dim); }
.qbars.dense { gap: 2px; }
.qbars.dense em { display: none; }
.qbars.dense span:nth-child(5n) em { display: block; }
.prev { padding-left: 20px; }
.prev > li { margin-bottom: 16px; }
.prev p { margin: 0 0 6px; font-weight: 600; }
.prev ul { margin: 0; padding-left: 18px; color: var(--mu); }
.prev li.good { color: var(--ok); font-weight: 600; }

/* ---------- modal / forms / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(27, 42, 74, .45); }
.modal.open { display: flex; }
.m-box { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--s1); border: 1px solid var(--line2); border-top: 4px solid var(--ac); padding: 28px;
  box-shadow: 0 24px 60px -20px rgba(27, 42, 74, .5); }
.m-box.wide { max-width: 640px; }
.m-box h2 { margin-right: 40px; }
.m-box p { color: var(--mu); }
.m-x { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--mu); }
.m-x svg { width: 18px; height: 18px; }
.m-x:hover { color: var(--tx); }
.m-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--mu); font-weight: 500; }
.form input:not([type=radio]):not([type=file]), .form select { height: 42px; padding: 0 12px; background: #fff; border: 1px solid var(--line2); outline: 0; color: var(--tx); font-size: 15px; font-weight: 400; width: 100%; }
.form input:focus, .form select:focus { border-color: var(--ink); }
.form input[readonly] { color: var(--mu); background: var(--s2); }
.form .bad, .drop.bad { border-color: var(--bad) !important; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qb { border: 1px solid var(--line2); padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.qb legend { padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--ac); }
.qb-o { flex-direction: row !important; align-items: center; gap: 10px !important; }
.qb-o input[type=radio] { accent-color: var(--ink); width: 18px; height: 18px; flex: none; }
.drop { position: relative; display: flex !important; align-items: center; justify-content: center; min-height: 120px; border: 1px dashed var(--line2); background: #fff; cursor: pointer; text-align: center; }
.drop:hover { border-color: var(--ink); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop span { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--tx); pointer-events: none; padding: 10px; word-break: break-all; }
.drop svg { width: 26px; height: 26px; color: var(--ac); }
.drop small { color: var(--dim); font-family: var(--m); }
.upbar { position: relative; height: 26px; background: #fff; border: 1px solid var(--line2); }
.upbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); transition: width .12s; }
.upbar span { position: absolute; inset: 0; display: grid; place-items: center; font: 500 12px var(--m); mix-blend-mode: difference; color: #fff; }
.err, .m-box .err { color: var(--bad); margin: 0; min-height: 1em; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); z-index: 70; background: var(--ink); color: var(--paper); padding: 12px 18px; font-weight: 500; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .22s; max-width: calc(100vw - 32px); border-left: 4px solid var(--ac); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.tabbar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .who-t { display: none; }
  .nav a { padding: 0 10px; }
  .nav a.on::after { left: 10px; right: 10px; }
}
@media (max-width: 1000px) {
  .watch { grid-template-columns: minmax(0, 1fr); }
  .w-side { grid-column: 1; grid-row: auto; margin-top: 22px; }
  .w-info { grid-row: 2; }
  .pp { grid-template-columns: minmax(0, 1fr); }
  .pp-list { display: flex; overflow-x: auto; border: 0; gap: 6px; }
  .pp-list li { flex: none; }
  .pp-list button { border: 1px solid var(--line); width: 210px; }
  .cols, .pp-d .cols { grid-template-columns: minmax(0, 1fr); }
  .ex-body { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .ex-nav { order: -1; }
  .ex-grid { grid-template-columns: repeat(10, 1fr); }
  .ex-nav .dim { display: none; }
}
@media (max-width: 820px) {
  .nav { display: none; }
  .who { display: none; }
  .top { gap: 12px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(251, 249, 243, .97); border-top: 1px solid var(--line2);
    padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .tabbar a { flex: 1; text-align: center; padding: 14px 4px 13px; font-size: 12px; font-weight: 600; color: var(--mu); border-top: 2px solid transparent; margin-top: -1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar a.on { color: var(--tx); border-color: var(--ac); }
  .foot { padding-bottom: 76px; }
  .toast { bottom: 80px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile, .tile:first-child { border-left: 0; padding: 20px 20px 30px; border-top: 1px solid var(--line); }
  .tile:first-child { border-top: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > div:nth-child(3) { border-left: 0; }
  .kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .plive { grid-template-columns: auto 1fr; padding: 20px; gap: 16px 20px; }
  .pl-a { grid-column: 1 / -1; }
  .pl-n { font-size: 50px; }
  .hide-s { display: none; }
  .score { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .rail { grid-auto-columns: 72%; }
  .cover.big .cv-title { display: none; }
}
@media (max-width: 520px) {
  .brand { font-size: 18px; }
  .role button { padding: 0 10px; }
  .view { padding-top: 22px; }
  .grid-l { grid-template-columns: minmax(0, 1fr); }
  .pr { grid-template-columns: 40px 1fr auto; }
  .pr-d { display: none; }
  .pr-id { font-size: 20px; }
  .sc-cells { grid-template-columns: 1fr 1fr; }
  .sc-cells b { font-size: 24px; }
  .opt { font-size: 15px; padding: 12px; }
  .ex-clock { font-size: 20px; }
  .ex-top { gap: 10px 14px; }
  .ex-name { order: 5; flex-basis: 100%; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .m-box { padding: 22px 18px; }
  .ctrls button { width: 36px; }
  .toolbar input { width: 100%; }
  .cover.big { background-image: linear-gradient(90deg, transparent 37px, rgba(200, 55, 45, .45) 37px, rgba(200, 55, 45, .45) 38px, transparent 38px),
    repeating-linear-gradient(180deg, transparent 0 23px, rgba(27, 42, 74, .09) 23px 24px); }
  .cover.big .cv-play { width: 48px; height: 48px; right: 16px; bottom: 16px; }
  .cover.big .cv-num { font-size: 56px; right: 16px; top: 14px; }
  .cover.big .cv-unit, .cover.big .cv-dur { left: 50px; }
  .cover.big .cv-unit { top: 16px; }
  .cover.big .cv-dur { bottom: 16px; }
  .st-big { width: 54px; height: 54px; }
  .stage { border-width: 6px; border-bottom-width: 9px; }
  .due li { flex-wrap: wrap; }
  .due li > span { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* big serif numbers: lower optical size so they stay sturdy, not hairline-display */
.sc-big, .cv-num, .pl-n, .pr-id, .t-big, .kpis b, .sc-cells b, .pl-score, .pr-m { font-variation-settings: 'opsz' 36; }
