/* Misia 9 – štýly aplikácie (dizajn schválený 27. 9. 2026)
   Farby sú len v premenných; tmavý režim je predvolený, svetlý cez html[data-rezim="svetly"]. */

@font-face {
  font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(../fonts/manrope-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(../fonts/manrope-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url(../fonts/space-grotesk-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url(../fonts/space-grotesk-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

:root {
  --bg: #0B1020; --surface: #151C30; --surface-2: #1E2740; --sunk: #0F1528;
  --line: #232D48; --line-2: #2B3654; --line-3: #3A4666;
  --text: #F3F5FC; --text-2: #A7B1CC; --text-3: #7C88A8; --text-4: #4A5578;
  --lime: #C6F53F; --on-lime: #0B1020; --lime-t: #C6F53F; --lime-bg: #1F2A10; --lime-line: #3A5214; --lime-soft: #DDFF7A;
  --mat: #5FB9FF; --mat-t: #5FB9FF; --mat-bg: #10233A;
  --sjl: #FF8A5B; --sjl-t: #FF8A5B; --sjl-bg: #3A1F14;
  --amber: #FFB020; --amber-t: #FFB020; --amber-bg: #2A1F0E; --amber-line: #5A4318;
  --err: #FF6B85; --err-t: #FF6B85; --err-bg: #2E1520; --err-line: #5A2434;
  --ok-bg: #1A2A12;
  --focus: #C6F53F;
  --shadow: 0 1px 0 rgba(0,0,0,.2);
  --r-xl: 22px; --r-lg: 18px; --r-md: 16px; --r-sm: 12px; --r-xs: 10px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-d: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
  color-scheme: dark;
}
html[data-rezim="svetly"] {
  --bg: #F4F6FC; --surface: #FFFFFF; --surface-2: #EEF1F9; --sunk: #EEF1F9;
  --line: #D9DFEE; --line-2: #D0D7E8; --line-3: #B9C2D9;
  --text: #0B1020; --text-2: #4D5878; --text-3: #5F6988; --text-4: #8A93AD;
  --lime-t: #4A7600; --lime-bg: #EDF9CF; --lime-line: #C9E88A; --lime-soft: #3E6300;
  --mat-t: #0A64BA; --mat-bg: #E3F1FF;
  --sjl-t: #B23E14; --sjl-bg: #FFE9DF;
  --amber-t: #7F5200; --amber-bg: #FFF1D6; --amber-line: #F2D59A;
  --err-t: #BE1D3B; --err-bg: #FFE3E9; --err-line: #F5B8C5;
  --ok-bg: #EDF9CF;
  --focus: #0A64BA;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--lime-t); }
a:hover { color: var(--lime-soft); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }
.ico-s { width: 16px; height: 16px; flex-shrink: 0; }
.ico-l { width: 24px; height: 24px; flex-shrink: 0; }
h1, h2, h3 { font-family: var(--font-d); letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.d { font-family: var(--font-d); }
.muted { color: var(--text-2); }
.muted-2 { color: var(--text-3); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.caps { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.t-lime { color: var(--lime-t); } .t-mat { color: var(--mat-t); } .t-sjl { color: var(--sjl-t); }
.t-amber { color: var(--amber-t); } .t-err { color: var(--err-t); }
.row { display: flex; align-items: center; gap: 10px; }
.row-sb { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.stack-l { display: flex; flex-direction: column; gap: 18px; }
.grow { flex-grow: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- rozloženie ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex-grow: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 20px 110px; display: flex; flex-direction: column; gap: 16px; }
.main.wide { max-width: 1100px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; max-width: 560px; margin: 0 auto; width: 100%; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--lime); color: var(--on-lime); display: flex; align-items: center; justify-content: center; font-family: var(--font-d); font-weight: 700; font-size: 18px; }
.brand-name { font-family: var(--font-d); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.avatar { width: 36px; height: 36px; border-radius: 12px; color: #0B1020; display: flex; align-items: center; justify-content: center; font-family: var(--font-d); font-weight: 700; font-size: 16px; text-decoration: none; flex-shrink: 0; }
.avatar-l { width: 64px; height: 64px; border-radius: 20px; font-size: 28px; }

.nav-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--sunk); border-top: 1px solid var(--line); padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); }
.nav-bottom ul { list-style: none; margin: 0 auto; padding: 0; max-width: 560px; display: flex; justify-content: space-between; }
.nav-bottom a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 62px; padding: 6px 4px; text-decoration: none; color: var(--text-3); font-size: 11px; font-weight: 700; border-radius: 12px; position: relative; }
.nav-bottom a[aria-current="page"] { color: var(--lime-t); font-weight: 800; }
.nav-bottom .pocet { position: absolute; top: 0; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--err); color: #0B1020; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.sidebar { display: none; }
.desk-only { display: none !important; }
.desk-grid { display: flex; flex-direction: column; gap: 16px; }

@media (min-width: 1024px) {
  .shell.s-nav { flex-direction: row; }
  .sidebar { display: flex; flex-direction: column; gap: 26px; width: 250px; flex-shrink: 0; padding: 26px 18px; border-right: 1px solid var(--line); background: var(--sunk); position: sticky; top: 0; height: 100vh; }
  .sidebar nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: 14px; color: var(--text-2); text-decoration: none; font-weight: 700; font-size: 14px; }
  .sidebar nav a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 800; }
  .sidebar nav a[aria-current="page"] .ico { color: var(--lime-t); }
  .sidebar nav .pocet { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--err-bg); color: var(--err-t); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
  .shell.s-nav .topbar-m { display: none; }
  .nav-bottom { display: none; }
  .desk-only { display: inline-flex !important; }
  .shell.s-nav .nav-bottom { display: none; }
  .shell.s-nav .main { max-width: 1060px; padding: 28px 32px 40px; }
  .desk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
}

/* ---------- karty ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.card-l { border-radius: var(--r-xl); padding: 18px; border-color: var(--line-2); }
.card-sunk { background: var(--sunk); border: 0; border-radius: 14px; padding: 10px 12px; }
.card-lime { background: var(--lime-bg); border: 1px solid var(--lime-line); }
.card-amber { background: var(--amber-bg); border: 1px solid var(--amber-line); }
.card-err { background: var(--err-bg); border: 1px solid var(--err-line); }
.card-dash { background: var(--sunk); border: 1px dashed var(--line-2); }
:where(a.card) { display: block; }
a.card { text-decoration: none; color: var(--text); }
a.card:hover { border-color: var(--line-3); color: var(--text); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

/* ---------- tlačidlá ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--r-md); border: 1.5px solid var(--line-2); background: transparent; color: var(--text); font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--line-3); color: var(--text); }
.btn-primary { background: var(--lime); color: var(--on-lime); border-color: var(--lime); font-weight: 800; font-size: 16px; min-height: 54px; }
.btn-primary:hover { background: #D3FA62; border-color: #D3FA62; color: var(--on-lime); }
.btn-mat { background: var(--mat); border-color: var(--mat); color: #0B1020; font-weight: 800; }
.btn-mat:hover { color: #0B1020; filter: brightness(1.06); }
.btn-sjl { background: var(--sjl); border-color: var(--sjl); color: #0B1020; font-weight: 800; }
.btn-sjl:hover { color: #0B1020; filter: brightness(1.06); }
.btn-amber { background: var(--amber); border-color: var(--amber); color: #0B1020; font-weight: 800; }
.btn-amber:hover { color: #0B1020; filter: brightness(1.06); }
.btn-err { background: var(--err); border-color: var(--err); color: #0B1020; font-weight: 800; }
.btn-soft { background: var(--surface); border: 1px solid var(--line-2); min-height: 46px; font-size: 14px; border-radius: 14px; }
.btn-hint { background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber-t); min-height: 46px; font-size: 14px; border-radius: 14px; }
.btn-hint:hover { color: var(--amber-t); }
.btn-ghost { border-color: transparent; color: var(--text-3); min-height: 44px; font-size: 14px; }
.btn-ghost:hover { color: var(--text-2); border-color: transparent; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- štítky ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
a.chip { text-decoration: none; }
.chip > svg { flex-shrink: 0; }
.chip-dot::before { content: ''; width: 7px; height: 7px; border-radius: 4px; background: var(--amber); }
.chip-streak { background: var(--amber-bg); color: var(--amber-t); border-color: transparent; }
.chip-xp { background: var(--lime-bg); color: var(--lime-t); border-color: transparent; }
.chip-mat { background: var(--mat-bg); color: var(--mat-t); border-color: transparent; }
.chip-sjl { background: var(--sjl-bg); color: var(--sjl-t); border-color: transparent; }
.chip-err { background: var(--err-bg); color: var(--err-t); border-color: transparent; }
.chip-amber { background: var(--amber-bg); color: var(--amber-t); border-color: transparent; }
.subj { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--font-d); font-weight: 700; font-size: 16px; flex-shrink: 0; }
.subj-MAT { background: var(--mat-bg); color: var(--mat-t); }
.subj-SJL { background: var(--sjl-bg); color: var(--sjl-t); font-size: 14px; }
.subj-s { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }

/* ---------- ukazovatele ---------- */
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); position: relative; }
.bar > span { display: block; height: 100%; border-radius: 4px; background: var(--lime); }
.bar.b-mat > span { background: var(--mat); } .bar.b-sjl > span { background: var(--sjl); }
.bar.b-amber > span { background: var(--amber); } .bar.b-err > span { background: var(--err); }
.bar-s { height: 6px; }
.bar .mark { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text); border-radius: 1px; }
.segs { display: flex; gap: 4px; flex-grow: 1; }
.segs span { flex-grow: 1; height: 8px; border-radius: 4px; background: var(--surface-2); }
.segs .ok { background: var(--lime); } .segs .zle { background: var(--err); } .segs .teraz { background: var(--mat); } .segs .hotovo { background: var(--text-3); }
.segs .teraz-sjl { background: var(--sjl); }
.ring { position: relative; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-d); font-weight: 700; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.stat b { font-family: var(--font-d); font-size: 22px; letter-spacing: -0.02em; line-height: 1.1; }
.stat > span { font-size: 11px; color: var(--text-2); font-weight: 700; }

/* ---------- zoznamy ---------- */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
a.list-item:hover { border-color: var(--line-3); color: var(--text); }
.list-item .t1 { font-size: 14px; font-weight: 800; }
.list-item .t2 { font-size: 12px; font-weight: 700; color: var(--text-2); }
.mission-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--sunk); }
.mission-row .t1 { font-size: 14px; font-weight: 800; }
.mission-row .t2 { font-size: 12px; font-weight: 700; color: var(--text-2); }
.chev { color: var(--text-3); }

/* ---------- formuláre ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span:first-child, .label { font-size: 13px; font-weight: 800; color: var(--text-2); }
.input { width: 100%; min-height: 54px; border-radius: var(--r-md); background: var(--surface); border: 2px solid var(--line-2); padding: 0 16px; font-size: 16px; font-weight: 700; color: var(--text); outline: none; }
.input:focus { border-color: var(--lime); }
html[data-rezim="svetly"] .input:focus { border-color: var(--mat-t); }
.input::placeholder { color: var(--text-3); font-weight: 600; }
textarea.input { padding: 12px 14px; min-height: 120px; font-weight: 500; font-size: 14px; line-height: 1.45; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.help { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); cursor: pointer; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--lime); flex-shrink: 0; }
.alert { padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; font-weight: 600; line-height: 1.45; }
.alert-err { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--text); }
.alert-ok { background: var(--lime-bg); border: 1px solid var(--lime-line); color: var(--text); }
.alert-info { background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pw-wrap { display: flex; align-items: center; border-radius: var(--r-md); background: var(--surface); border: 2px solid var(--line-2); padding-right: 6px; }
.pw-wrap:focus-within { border-color: var(--lime); }
.pw-wrap .input { border: 0; background: transparent; min-height: 50px; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 10px; background: var(--text-3); transition: transform .15s; }
.switch input:checked + span { background: var(--lime); border-color: var(--lime); }
.switch input:checked + span::after { transform: translateX(20px); background: #0B1020; }
.settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2px 16px; }
.settings > * { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--surface-2); font-size: 14px; font-weight: 700; }
.settings > *:last-child { border-bottom: 0; }

/* ---------- úloha ---------- */
.run { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; width: 100%; }
.run-top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 0; }
.run-body { flex-grow: 1; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 0; }
.run-foot { position: sticky; bottom: 0; display: flex; flex-direction: column; gap: 8px; padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.task { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-2); }
.task .zadanie { font-size: 18px; line-height: 1.55; font-weight: 600; }
.task .zadanie strong { font-family: var(--font-d); color: var(--mat-t); }
.task.sjl .zadanie strong { color: var(--sjl-t); }
.md p + p { margin-top: 10px; }
.md table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 6px 0; }
.md th, .md td { border: 1px solid var(--line-2); padding: 7px 10px; text-align: left; }
.md th { background: var(--surface-2); font-weight: 800; }
.md ul { margin: 6px 0; padding-left: 22px; }
.passage { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); }
.passage .text { font-size: 15.5px; line-height: 1.65; }
.passage .text p + p { margin-top: 10px; }
.passage.zbalena .text { max-height: 7.5em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 2px solid var(--line-2); color: var(--text); text-align: left; cursor: pointer; font-size: 15px; font-weight: 600; line-height: 1.35; }
.opt:hover { border-color: var(--line-3); }
.opt .l { width: 30px; height: 30px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.opt[aria-pressed="true"] { border-color: var(--mat); }
.opt[aria-pressed="true"] .l { background: var(--mat); color: #0B1020; }
.task.sjl .opt[aria-pressed="true"] { border-color: var(--sjl); }
.task.sjl .opt[aria-pressed="true"] .l { background: var(--sjl); }
.opt.ok { border-color: var(--lime); background: var(--ok-bg); }
.opt.ok .l { background: var(--lime); color: #0B1020; }
.opt.zle { border-color: var(--err); background: var(--err-bg); }
.opt.zle .l { background: var(--err); color: #0B1020; }
.opt[disabled] { cursor: default; }
.ans { display: flex; align-items: center; min-height: 62px; border-radius: var(--r-md); background: var(--sunk); border: 2px solid var(--mat); padding: 0 16px; }
.task.sjl .ans { border-color: var(--sjl); }
.ans input { flex-grow: 1; min-width: 0; background: transparent; border: 0; outline: none; font-family: var(--font-d); font-size: 28px; font-weight: 700; color: var(--text); }
.ans input::placeholder { color: var(--text-3); font-weight: 600; font-size: 22px; }
.ans.txt input { font-family: var(--font); font-size: 20px; }
.ans .unit { font-family: var(--font-d); font-size: 20px; font-weight: 600; color: var(--text-3); }
.ans.ok { border-color: var(--lime); background: var(--ok-bg); }
.ans.zle { border-color: var(--err); background: var(--err-bg); }
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.feedback { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: var(--r-lg); }
.feedback .fh { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.feedback p { font-size: 15px; line-height: 1.5; font-weight: 600; }
.fb-ok { background: var(--ok-bg); border: 1px solid var(--lime-line); } .fb-ok .fh { color: var(--lime-t); }
.fb-hint { background: var(--amber-bg); border: 1px solid var(--amber-line); } .fb-hint .fh { color: var(--amber-t); }
.fb-err { background: var(--err-bg); border: 1px solid var(--err-line); } .fb-err .fh { color: var(--err-t); }
.steps { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .n { width: 26px; height: 26px; border-radius: 8px; background: var(--mat-bg); color: var(--mat-t); display: flex; align-items: center; justify-content: center; font-family: var(--font-d); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.step .h { font-size: 14px; font-weight: 800; }
.step .b { font-size: 15px; line-height: 1.5; color: var(--text-2); }
.step .b strong { color: var(--lime-t); }
.right-ans { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--ok-bg); border: 1px solid var(--lime-line); }
.right-ans b { font-family: var(--font-d); font-size: 22px; color: var(--lime-t); }
.timer { font-family: var(--font-d); font-weight: 700; }
.timer.malo { color: var(--err-t); }
.qnav { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.qnav button { height: 36px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); font-weight: 800; font-size: 12px; cursor: pointer; padding: 0; }
.qnav button.hotovo { background: var(--mat-bg); color: var(--mat-t); border-color: transparent; }
.qnav button[aria-current="true"] { border: 2px solid var(--text); color: var(--text); }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 50; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-3); font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: calc(100% - 32px); }
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(5,8,18,.72); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.sheet { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 20px; display: flex; flex-direction: column; gap: 14px; max-height: 85vh; overflow: auto; }
@media (min-width: 640px) { .overlay { align-items: center; } }
/* Prehľad žiaka v admine má tabuľky, 480 px je na ne málo. Na mobile zostáva šírka obrazovky. */
.sheet-siroky { max-width: 860px; max-height: 92vh; }
.sheet-siroky h3 { font-size: 15px; margin: 0; }
/* prezývka v zozname používateľov: vyzerá ako odkaz, ale je to tlačidlo (otvára okno) */
.odkaz-ziak { background: 0; border: 0; padding: 0; font: inherit; font-weight: 800; color: var(--mat-t); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.odkaz-ziak:hover { color: var(--text); }
/* zadanie úlohy v okne žiaka: celý text je tlačidlo, ale nemá vyzerať ako tlačidlo */
.odkaz-uloha { background: 0; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.odkaz-uloha:hover { text-decoration-color: var(--lime); color: var(--text); }
/* tabuľka „názov → hodnota“ (prehľad žiaka): hlavička je v ľavom stĺpci, veľké písmená by tu prekážali */
.tbl.tbl-udaje th { text-transform: none; letter-spacing: 0; font-size: 13px; width: 42%; }
@media (max-width: 560px) {
  .sheet-siroky .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Na telefóne sa vnútorné rolovanie tabuliek v okne pletie s rolovaním okna – radšej dlhé okno. */
  .sheet-siroky .tbl-wrap { max-height: none !important; }
}
.calc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.calc output { grid-column: 1 / -1; min-height: 56px; border-radius: 14px; background: var(--sunk); display: flex; align-items: center; justify-content: flex-end; padding: 0 14px; font-family: var(--font-d); font-size: 26px; font-weight: 700; overflow-x: auto; }
.calc button { height: 52px; border-radius: 14px; background: var(--surface-2); border: 0; font-weight: 800; font-size: 18px; cursor: pointer; color: var(--text); }
.calc button.op { background: var(--mat-bg); color: var(--mat-t); }
.calc button.eq { background: var(--lime); color: #0B1020; }
.vzorce { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.vzorce h3 { margin-top: 6px; }
.vzorce div { padding: 9px 12px; border-radius: 12px; background: var(--sunk); font-family: var(--font-d); }

/* ---------- mapa tém ---------- */
.seg-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg-tabs a { display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 11px; color: var(--text-2); text-decoration: none; font-weight: 700; font-size: 14px; }
.seg-tabs a[aria-current="page"] { background: var(--mat); color: #0B1020; font-weight: 800; }
.seg-tabs a.sjl[aria-current="page"] { background: var(--sjl); }
.okruh-h { display: flex; align-items: center; gap: 10px; }
.okruh-h .caps { color: var(--mat-t); }
.okruh-h.sjl .caps { color: var(--sjl-t); }
.okruh-h hr { flex-grow: 1; height: 1px; border: 0; background: var(--line); margin: 0; }
.nodes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; }
.node { display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; color: var(--text); text-align: center; }
.node:hover { color: var(--text); }
.node .c { width: 58px; height: 58px; border-radius: 999px; display: flex; align-items: center; justify-content: center; position: relative; }
.node .n-name { font-size: 11px; font-weight: 700; line-height: 1.25; color: var(--text-2); }
.node.zvladnuta .c { background: var(--lime); color: #0B1020; }
.node.nova .c { background: var(--surface); border: 2px dashed var(--line-3); color: var(--text-2); }
.node.zamknuta .c { background: var(--sunk); border: 2px solid var(--surface-2); color: var(--text-4); }
.node.zamknuta .n-name { color: var(--text-3); }
.node.v_procese .n-name { color: var(--text); font-weight: 800; }
.node .boss-dot { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; border-radius: 8px; background: var(--amber); color: #0B1020; display: flex; align-items: center; justify-content: center; }
.boss-node .c { width: 52px; height: 52px; margin: 3px; border-radius: 18px; transform: rotate(45deg); background: var(--sunk); border: 2px solid var(--line-3); color: var(--text-4); }
.boss-node .c svg { transform: rotate(-45deg); }
.boss-node.ready .c { background: var(--amber-bg); border-color: var(--amber); color: var(--amber-t); }
.boss-node.won .c { background: var(--amber); border-color: var(--amber); color: #0B1020; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 11px; font-weight: 700; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 5px; display: inline-block; }

/* ---------- odznaky ---------- */
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.badge .bi { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #0B1020; }
.badge .bn { font-size: 11px; font-weight: 800; line-height: 1.2; }
.badge.lock { background: var(--sunk); border-style: dashed; border-color: var(--line-2); }
.badge.lock .bi { background: var(--surface-2); color: var(--text-4); }
.badge.lock .bn { color: var(--text-3); font-weight: 700; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week .d-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week .d-box { width: 100%; height: 44px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; font-size: 10px; font-weight: 800; color: #0B1020; }
.week .d-box.on { background: var(--lime); }
.week .d-box.save { background: var(--amber); }
.week .d-box.today { background: var(--surface-2); border: 2px dashed var(--line-3); align-items: center; padding: 0; color: var(--text-2); }
.week .d-l { font-size: 11px; font-weight: 700; color: var(--text-2); }

/* ---------- úvod (neprihlásený) ---------- */
.hero h1 { font-size: 38px; line-height: 1.02; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; color: var(--lime-t); }
.feature { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.feature .fi { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feature b { font-size: 14px; display: block; }
.feature span { font-size: 12.5px; color: var(--text-2); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 12px; color: var(--text-3); }
.footer-links a { color: var(--text-3); }

/* ---------- admin ---------- */
.adm { max-width: 1200px; margin: 0 auto; padding: 18px 20px 60px; display: flex; flex-direction: column; gap: 16px; }
.adm-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-nav a { padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); text-decoration: none; font-weight: 700; font-size: 14px; }
.adm-nav a[aria-current="page"] { background: var(--lime); color: #0B1020; border-color: var(--lime); }
/* Na telefóne sa admin menu nezalamuje do troch riadkov, ale roluje vodorovne,
   a návrat do žiackej appky je tlačidlo – drobný odkaz v rohu sa v nainštalovanej
   appke (bez tlačidla Späť v prehliadači) ľahko prehliadne a človek v admine uviazne. */
@media (max-width: 820px) {
  .adm { padding: 14px 14px 40px; }
  .adm > header { gap: 10px; }
  .adm-spat { min-height: 38px; padding: 0 12px; font-size: 13px; }
  .adm-kto { display: none; }
  /* Menu sa zalamuje do riadkov. Vodorovné posúvanie tu bolo horšie: na dotyku
     swipe chytala stránka a na polovicu položiek sa nedalo dostať. */
  .adm-nav { flex-wrap: wrap; gap: 8px; }
  .adm-nav a { flex: 0 0 auto; min-height: 40px; display: inline-flex; align-items: center; padding: 0 13px; }
}
.tbl-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { background: var(--surface); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 800; white-space: nowrap; }
.tbl tr:hover td { background: var(--sunk); }
.tbl a { font-weight: 700; }
.st { display: inline-block; padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.st-navrh { background: var(--surface-2); color: var(--text-2); }
.st-na_kontrolu { background: var(--amber-bg); color: var(--amber-t); }
.st-overena { background: var(--lime-bg); color: var(--lime-t); }
.st-vyradena { background: var(--err-bg); color: var(--err-t); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.filters .input { min-height: 42px; font-size: 14px; border-width: 1.5px; width: auto; }
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--text-3); font-weight: 700; }
.kv dd { margin: 0; }
pre.json { background: var(--sunk); border-radius: 12px; padding: 12px; overflow-x: auto; font-size: 12.5px; margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (min-width: 900px) { .adm-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; } }

/* ---------- spodné menu ako plávajúca kapsula ----------
   Rovnaké správanie ako admin appka prenajmem.si: odsadená kapsula len s ikonami,
   pri rolovaní nadol sa schová, nahor sa vráti. Názov položky v odkaze ostáva
   (font-size: 0 ho skryje oku, čítačka obrazovky ho číta ďalej). */
@media (max-width: 1023px) {
  .nav-bottom {
    /* iPhone hlási v safe-area-inset-bottom 34 px (domovský prúžok). Keby sme ich pripočítali celé,
       kapsula visí vysoko nad hranou; preto z nich väčšinu odoberáme a necháme len toľko, aby sa
       kapsula neocitla pod prúžkom. Na zariadeniach bez prúžku je inset 0 a platí spodných 6 px. */
    left: 12px; right: 12px; bottom: max(6px, calc(env(safe-area-inset-bottom) - 22px));
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
    transition: transform .22s ease;
  }
  /* +40px, aby sa pri schovaní stratil aj tieň */
  .nav-bottom.lista-skryta { transform: translateY(calc(100% + 40px)); }
  .nav-bottom ul { max-width: none; justify-content: space-around; }
  .nav-bottom a {
    min-width: 0; width: 60px; height: 52px; padding: 4px 0 2px; gap: 2px;
    justify-content: center; border-radius: 18px;
    font-size: 10px; line-height: 1.1;
  }
  .nav-bottom a[aria-current="page"] { background: var(--lime-bg); color: var(--lime-t); }
  .nav-bottom a[aria-current="page"] .ico { color: var(--lime-t); }
  .nav-bottom .pocet { top: 0; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; line-height: 1; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
