/* ===== ASP ispit — mobile-first stilovi (izgled kao u P2 projektu) ===== */
:root {
  --page: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #1c2128;
  --text-dim: #5b6472;
  --border: #dde1e7;
  --accent: #2563eb;
  --accent-soft: #dbe7ff;
  --accent-ink: #ffffff;
  --green: #16803c;
  --green-soft: #d9f2e2;
  --red: #c22f2f;
  --red-soft: #fbe1e1;
  --amber: #92600a;
  --amber-soft: #fdf0d4;
  --code-bg: #f1f3f6;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .06);
  --radius: 14px;
  --topbar-h: calc(52px + env(safe-area-inset-top, 0px));
  /* promenljive koje koristi renderer figura (css/figures.css) */
  --fg: var(--text);
  --bg: var(--surface);
  --muted: var(--text-dim);
  --line: #c9cfd6;
  --hl: #d9480f;
  --hl-bg: #ffe8cc;
  --card: #f4f6f9;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #101418;
    --surface: #181e26;
    --surface-2: #212934;
    --text: #e6e9ee;
    --text-dim: #9aa4b2;
    --border: #2c3542;
    --accent: #5b8def;
    --accent-soft: #1e2c47;
    --accent-ink: #0d1117;
    --green: #4cc276;
    --green-soft: #15301f;
    --red: #ef6c6c;
    --red-soft: #3a1c1c;
    --amber: #e0a83f;
    --amber-soft: #33270f;
    --code-bg: #12171d;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
    --line: #3d4652;
    --hl: #ff922b;
    --hl-bg: #4a2d12;
    --card: #1f2630;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #101418;
  --surface: #181e26;
  --surface-2: #212934;
  --text: #e6e9ee;
  --text-dim: #9aa4b2;
  --border: #2c3542;
  --accent: #5b8def;
  --accent-soft: #1e2c47;
  --accent-ink: #0d1117;
  --green: #4cc276;
  --green-soft: #15301f;
  --red: #ef6c6c;
  --red-soft: #3a1c1c;
  --amber: #e0a83f;
  --amber-soft: #33270f;
  --code-bg: #12171d;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  --line: #3d4652;
  --hl: #ff922b;
  --hl-bg: #4a2d12;
  --card: #1f2630;
  color-scheme: dark;
}
/* figures.css ima sopstveni dark blok; ručno izabrana svetla tema ga poništava */
:root[data-theme="light"] .fig, :root[data-theme="light"] .steps, :root[data-theme="light"] .md {
  --f-fg: var(--fg); --f-bg: var(--bg); --f-muted: var(--muted); --f-line: var(--line);
  --f-hl: var(--hl); --f-hl-bg: var(--hl-bg); --f-accent: var(--accent); --f-card: var(--card);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--page);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: var(--accent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.25; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: var(--topbar-h);
  padding: env(safe-area-inset-top, 0px) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--page) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 1.25rem; font-weight: 800; color: var(--text); text-decoration: none; letter-spacing: .01em; white-space: nowrap; }
.brand span { color: var(--accent); }
.brand-sub { font-size: .72rem; color: var(--text-dim); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { margin-left: auto; display: flex; gap: .25rem; align-items: center; }
.icon-btn {
  appearance: none; border: 1px solid transparent; background: transparent; color: var(--text);
  min-width: 44px; min-height: 44px; border-radius: 10px; font: inherit; font-size: 1.15rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.text { font-size: .85rem; font-weight: 600; padding: 0 .6rem; }

main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left));
  min-width: 0;
}
@media (min-width: 1000px) {
  body[data-route="attempt"] main, body[data-route="topic"] main, body[data-route="task"] main,
  body[data-route="drill"] main, body[data-route="exam"] main { max-width: 1280px; }
}
.site-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem max(1.25rem, env(safe-area-inset-right)) calc(2rem + env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left));
  font-size: .74rem;
  color: var(--text-dim);
  text-align: center;
}
.site-footer p { margin: .3rem 0; }
.storage-warn { background: var(--amber-soft); color: var(--amber); font-size: .8rem; padding: .5rem 1rem; text-align: center; }
.loading { text-align: center; color: var(--text-dim); padding: 3rem 0; }
.meta { font-size: .8rem; color: var(--text-dim); }
.dim { color: var(--text-dim); }
.small { font-size: .8rem; }
.center { text-align: center; }
.hint { font-size: .8rem; color: var(--text-dim); margin: .4rem 0; }
.ok-t { color: var(--green); }
.bad-t { color: var(--red); }
.dim-t { color: var(--text-dim); }

.empty {
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.1rem; text-align: center; margin: .8rem 0;
}
.empty h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.empty p { margin: 0 0 .9rem; color: var(--text-dim); font-size: .9rem; }
.empty p:last-child { margin-bottom: 0; }

/* ===== Početna ===== */
.intro h1 { font-size: 1.35rem; margin: .2rem 0 .3rem; }
.intro p { margin: 0 0 1rem; color: var(--text-dim); font-size: .92rem; }
.continue-card {
  display: flex; align-items: center; gap: .8rem; justify-content: space-between; flex-wrap: wrap;
  background: var(--accent-soft); border: 1.5px solid var(--accent); border-radius: var(--radius);
  padding: .9rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.continue-card h2 { margin: .1rem 0; font-size: 1.05rem; }
.cc-kicker { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.cc-text { min-width: 0; flex: 1 1 200px; }
.entry-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; }
@media (min-width: 640px) { .entry-grid { grid-template-columns: 1fr 1fr; } }
.entry-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .6rem;
  border-top: 4px solid var(--accent);
}
.entry-card.entry-i { border-top-color: color-mix(in srgb, var(--accent) 50%, #7c3aed); }
.entry-card h2 { margin: 0; font-size: 1.2rem; }
.entry-card p { margin: 0; font-size: .86rem; color: var(--text-dim); flex: 1; }
.entry-links { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.entry-links .btn { white-space: nowrap; padding-left: .5rem; padding-right: .5rem; gap: .4rem; }
.count { display: inline-block; min-width: 1.6em; padding: 0 .4em; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: .75rem; color: var(--text-dim); }

.hero {
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 60%, #7c3aed) 100%);
  color: #fff; border-radius: var(--radius); padding: 1.1rem 1.2rem 1.3rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 .3rem; font-size: 1.25rem; }
.hero p { margin: 0 0 .9rem; font-size: .9rem; opacity: .92; }
.hero .btn { background: #fff; color: #1d4ed8; border: none; font-weight: 700; }

.section-title {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim);
  margin: 1.6rem 0 .6rem; font-weight: 700;
}
.sub-title { font-size: .85rem; margin: .8rem 0 .45rem; color: var(--text); }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .55rem; }
.topic-card, .tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: .7rem .9rem; text-decoration: none; color: var(--text); font-weight: 600; font-size: .92rem;
  display: flex; flex-direction: column; gap: .2rem; box-shadow: var(--shadow); min-height: 56px;
  transition: transform .06s ease;
}
.topic-card.accent { border-color: var(--accent); background: var(--accent-soft); }
.topic-card:active, .tool-card:active { transform: scale(.98); }
.topic-count { font-size: .76rem; color: var(--text-dim); font-weight: 500; }
.topic-card .progressbar { height: 5px; margin-top: .25rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .6rem; }
.tool-title { font-size: 1rem; }
.tool-text { font-size: .8rem; color: var(--text-dim); font-weight: 400; }

.seg { display: flex; gap: .3rem; background: var(--surface-2); padding: .25rem; border-radius: 12px; margin: .5rem 0; }
.seg-btn { flex: 1; text-align: center; padding: .55rem .4rem; border-radius: 9px; text-decoration: none; color: var(--text-dim); font-weight: 600; font-size: .85rem; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.exam-grid { display: grid; grid-template-columns: 1fr; gap: .7rem; }
@media (min-width: 640px) { .exam-grid { grid-template-columns: 1fr 1fr; } }
.exam-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .5rem;
}
.exam-card .row1 { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.exam-card h3 { margin: 0; font-size: 1.02rem; }
.exam-card .actions { display: flex; gap: .5rem; }
.exam-card .actions .btn { flex: 1; }
.exam-card .meta .pill { margin-right: .35rem; }
.badge { font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: 99px; white-space: nowrap; }
.badge.ai { background: var(--amber-soft); color: var(--amber); }
.badge.prev { background: var(--accent-soft); color: var(--accent); }

/* ===== Dugmad ===== */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: .92rem; font-weight: 600; padding: .55rem 1rem; border-radius: 10px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; transition: transform .06s ease, background .15s ease; touch-action: manipulation; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { font-size: .82rem; padding: .35rem .75rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-row { display: flex; gap: .6rem; margin-top: 1rem; }
.btn-row .btn { flex: 1; }
.btn-row.wrap { flex-wrap: wrap; }
.btn-row.wrap .btn { flex: 1 1 140px; }
.linklike { appearance: none; background: none; border: none; padding: 0; font: inherit; cursor: pointer; }

/* ===== Toolbar ===== */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: .4rem .8rem; margin-bottom: .8rem; flex-wrap: wrap; }
.toolbar h2 { margin: 0; font-size: 1.12rem; flex: 1 1 auto; min-width: 0; }
.back-link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: .9rem; min-height: 44px; display: inline-flex; align-items: center; }
.switch-label { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 600; cursor: pointer; user-select: none; min-height: 44px; position: relative; }
.switch-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 44px; height: 26px; flex: none; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; position: relative; transition: background .15s ease; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s ease; }
.switch-label input:checked + .switch-ui { background: var(--green); border-color: var(--green); }
.switch-label input:checked + .switch-ui::after { transform: translateX(18px); }
.switch-label input:focus-visible + .switch-ui { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

.notes-box { background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; margin: .7rem 0; }
.notes-box p { margin: .2rem 0; }
.notes-box.md { color: var(--text); border-left: 3px solid var(--amber); }
details.notes-box > summary { cursor: pointer; font-weight: 600; color: var(--amber); min-height: 32px; display: flex; align-items: center; }
details.notes-box[open] > summary { margin-bottom: .3rem; }

/* ===== Rad ispita ===== */
.take-bar h2 { font-size: 1rem; order: 3; flex-basis: 100%; }
.take-top { display: flex; align-items: center; gap: .7rem; margin-bottom: .4rem; }
.progressbar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 40px; }
.progressbar > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .2s ease; }
.take-count { font-size: .82rem; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.timer {
  font-size: .9rem; font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums;
  background: var(--surface-2); border-radius: 99px; padding: .2rem .7rem; white-space: nowrap;
}
.timer.warn { background: var(--amber-soft); color: var(--amber); }
.timer.over { background: var(--red-soft); color: var(--red); }

.dots { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0 .9rem; justify-content: center; }
.dot {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text-dim); font-size: .9rem; font-weight: 700; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-family: inherit; padding: 0;
}
.dot.answered { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.dot.ok { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.dot.part { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); }
.dot.bad { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.dot.current { box-shadow: 0 0 0 3px var(--accent); border-color: var(--accent); }
.dot.current:not(.ok):not(.bad):not(.part):not(.answered) { background: var(--accent); color: var(--accent-ink); }
.nav-row { position: sticky; bottom: 0; padding: .6rem 0 calc(.6rem + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--page) 70%, transparent); z-index: 4; }

@media (min-width: 1000px) { .nav-row { position: static; background: none; } }

/* ===== Kartica zadatka ===== */
.task-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow); margin-bottom: .9rem; min-width: 0;
}
.task-layout { min-width: 0; }
.stmt { min-width: 0; }
.stmt-toggle { display: none; }
.task-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; margin-bottom: .3rem; }
.task-num { font-weight: 800; color: var(--accent); font-size: 1rem; }
.task-pts { font-size: .8rem; font-weight: 700; background: var(--surface-2); border-radius: 99px; padding: .05rem .55rem; }
.task-title { font-size: .9rem; font-weight: 600; color: var(--text-dim); flex-basis: 100%; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin-bottom: .5rem; }
.origin { font-size: .78rem; color: var(--text-dim); flex-basis: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.type-tag { font-size: .72rem; color: var(--text-dim); border: 1px solid var(--border); border-radius: 99px; padding: .1rem .5rem; }
.statement { font-size: .95rem; }
.figs { display: flex; flex-direction: column; gap: .4rem; margin: .5rem 0; min-width: 0; }
.part-stmt { margin: .6rem 0; padding-left: .6rem; border-left: 3px solid var(--surface-2); }
.part-stmt .pp { font-size: .8rem; color: var(--text-dim); font-weight: 700; }
.part-stmt .md > p:first-child { margin-top: 0; }
.sheet-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.sheet-link { font-size: .8rem; font-weight: 600; text-decoration: none; padding: .35rem .7rem; border-radius: 8px; border: 1px solid var(--border); min-height: 36px; display: inline-flex; align-items: center; }

.work { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--border); min-width: 0; }
.work[hidden] { display: none; }
.part-work { margin-bottom: .9rem; min-width: 0; }
.part-label { margin: .2rem 0 .4rem; font-size: .95rem; }
.checks { display: flex; flex-direction: column; gap: .7rem; margin: .3rem 0 .6rem; }
.checks-hint { margin: 0; font-size: .8rem; color: var(--text-dim); }
.check { background: var(--surface-2); border: 1.5px solid transparent; border-radius: 10px; padding: .6rem .7rem; min-width: 0; }
.check.ok { border-color: var(--green); background: var(--green-soft); }
.check.bad { border-color: var(--red); background: var(--red-soft); }
.check-prompt { display: block; font-size: .86rem; font-weight: 600; margin-bottom: .35rem; }
.input {
  width: 100%; min-height: 44px; padding: .5rem .65rem; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 9px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.input:disabled { opacity: .85; background: var(--surface-2); }
select.input { font-family: inherit; }
.map-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .5rem; align-items: center; }
@media (min-width: 560px) { .map-grid { grid-template-columns: repeat(2, auto minmax(0, 1fr)); } }
.map-key { font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: .9rem; text-align: right; min-width: 1.5em; }
.choice-list { display: flex; flex-direction: column; gap: .35rem; }
.choice-opt { display: flex; gap: .55rem; align-items: center; padding: .45rem .6rem; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); min-height: 44px; cursor: pointer; }
.choice-opt input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.choice-opt.correct { border-color: var(--green); }
.choice-opt.wrong { border-color: var(--red); }
.check-verdict { font-size: .84rem; margin-top: .35rem; }
.check-verdict code, .check-answers code { background: var(--surface); padding: .05rem .3rem; border-radius: 4px; overflow-wrap: anywhere; }
.check-answers { font-size: .85rem; margin: .2rem 0 .6rem; padding-left: 1.2rem; }

.notes-wrap { margin: .4rem 0; }
.notes-wrap summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--text-dim); min-height: 36px; display: flex; align-items: center; }
.notes { width: 100%; min-height: 80px; font: inherit; font-size: .92rem; padding: .55rem .65rem; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); resize: vertical; }
.reveal-row { margin-top: .6rem; }

/* ===== Progresivno otkrivanje ===== */
.reveal { margin: .3rem 0 .6rem; min-width: 0; }
.lv-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: .3rem; margin-bottom: .5rem; }
.lv-pill {
  appearance: none; font: inherit; font-size: .78rem; font-weight: 700; min-height: 44px; padding: .3rem .4rem;
  border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-dim); cursor: pointer; line-height: 1.15;
}
.lv-pill.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.lv { border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); border-radius: 0 10px 10px 0; padding: .45rem .75rem .55rem; margin: .5rem 0; min-width: 0; }
.lv-title { margin: 0 0 .2rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.lv-2 { border-left-color: color-mix(in srgb, var(--accent) 50%, #7c3aed); }
.lv-3 { border-left-color: var(--green); }
.lv-3 .lv-title { color: var(--green); }
.lv-4 { border-left-color: var(--amber); }
.lv-4 .lv-title { color: var(--amber); }
.lv-next { width: 100%; margin-top: .2rem; border-style: dashed; }
.rubric-static, .pitfalls { margin: .3rem 0; padding-left: 1.2rem; font-size: .88rem; }
.rubric-static { list-style: none; padding-left: 0; }
.rubric-static li { display: flex; gap: .5rem; margin: .2rem 0; }
.pit-title { margin: .5rem 0 .1rem; font-size: .82rem; }
.pitfalls li > p { margin: .1rem 0; }

.rubric { border: 1.5px solid var(--border); border-radius: 12px; padding: .55rem .7rem .7rem; margin: .5rem 0; background: var(--surface); }
.rubric-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.rubric-title { font-weight: 700; font-size: .9rem; }
.rubric-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.rubric-list { list-style: none; margin: .3rem 0; padding: 0; }
.rb-item { display: flex; align-items: flex-start; gap: .55rem; padding: .45rem .1rem; min-height: 44px; cursor: pointer; border-bottom: 1px solid var(--surface-2); font-size: .9rem; }
.rb-item input { width: 22px; height: 22px; flex: none; margin-top: .05rem; accent-color: var(--green); }
.rb-text { flex: 1; min-width: 0; }
.rb-pts { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.auto-tag { font-size: .68rem; font-weight: 700; border-radius: 99px; padding: .05rem .4rem; background: var(--surface-2); color: var(--text-dim); white-space: nowrap; align-self: center; }
.auto-tag.ok { background: var(--green-soft); color: var(--green); }
.auto-tag.bad { background: var(--red-soft); color: var(--red); }
.rubric-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.rubric-actions .btn { flex: 1; }
.task-score { font-weight: 800; font-size: 1rem; text-align: right; margin: .6rem 0; font-variant-numeric: tabular-nums; }
.sources { font-size: .76rem; color: var(--text-dim); margin-top: .7rem; overflow-wrap: anywhere; }
.sources[hidden] { display: none; }
.sources-title { font-weight: 700; }
.validation { margin-top: .2rem; }

/* telefon: posle otkrivanja postavka je lepljiv sažetak koji se skuplja */
@media (max-width: 999.98px) {
  .stmt.sticky {
    position: sticky; top: var(--topbar-h); z-index: 6; background: var(--surface);
    margin: -1rem -1rem 0; padding: 0 1rem; border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--border); max-height: 55dvh; overflow-y: auto; overscroll-behavior: contain;
  }
  .stmt.sticky .stmt-toggle {
    display: flex; width: 100%; justify-content: space-between; align-items: center; gap: .5rem;
    appearance: none; border: 0; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: .88rem;
    min-height: 44px; padding: .4rem 0; cursor: pointer; position: sticky; top: 0; z-index: 1;
  }
  .stmt.sticky .stmt-toggle span:last-child { color: var(--accent); font-size: .8rem; white-space: nowrap; }
  .stmt.sticky.collapsed .stmt-body { display: none; }
  .stmt.sticky:not(.collapsed) { padding-bottom: .6rem; }
  .stmt.sticky + .work { border-top: 0; }
}
/* desktop: postavka | rešenje jedno pored drugog */
@media (min-width: 1000px) {
  .task-layout.revealed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
  .task-layout.revealed .stmt {
    position: sticky; top: calc(var(--topbar-h) + 12px); max-height: calc(100dvh - var(--topbar-h) - 24px); overflow-y: auto; padding-right: .3rem;
  }
  .task-layout.revealed .work { margin-top: 0; padding-top: 0; border-top: 0; border-left: 1px solid var(--border); padding-left: 1.4rem; }
}

/* ===== Modal, toast ===== */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 1.5rem max(1rem, env(safe-area-inset-right)) 1.5rem max(1rem, env(safe-area-inset-left)); z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 1.2rem; max-width: 420px; width: 100%; box-shadow: var(--shadow); max-height: 90dvh; overflow: auto; }
.modal h3 { margin: 0 0 .5rem; }
.modal p { margin: 0 0 1rem; font-size: .9rem; color: var(--text-dim); }
.modal-actions { flex-wrap: wrap; }
.modal-actions .btn { flex: 1 1 120px; }
.toast {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 150%);
  background: var(--text); color: var(--surface); padding: .6rem 1rem; border-radius: 10px; font-size: .88rem; font-weight: 600;
  z-index: 60; max-width: calc(100vw - 2rem); box-shadow: var(--shadow); transition: transform .2s ease; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.toast.warn { background: var(--amber); color: #fff; }
.toast.bad { background: var(--red); color: #fff; }
.toast.ok { background: var(--green); color: #fff; }

/* ===== Rezultat ===== */
.score-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1rem; text-align: center; margin-bottom: 1rem; }
.score-card.compact { padding: .8rem 1rem; }
.score-big { font-size: 2.4rem; font-weight: 800; margin: .1rem 0; font-variant-numeric: tabular-nums; }
.score-big small { font-size: 1.1rem; color: var(--text-dim); font-weight: 600; }
.score-pct { font-size: 1.1rem; font-weight: 800; }
.score-sub { color: var(--text-dim); font-size: .85rem; }
.score-pills { display: flex; justify-content: center; gap: .5rem; margin-top: .8rem; flex-wrap: wrap; }
.pill { display: inline-block; font-size: .76rem; font-weight: 700; padding: .2rem .65rem; border-radius: 99px; white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.skip { background: var(--surface-2); color: var(--text-dim); }
.breakdown, .hist-list, .topic-avg, .weak-list { display: flex; flex-direction: column; gap: .45rem; }
.bd-row, .hist-row, .avg-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label pts" "bar lvl"; align-items: center; gap: .25rem .7rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .6rem .8rem; text-decoration: none; color: var(--text); min-height: 52px;
}
.bd-label { grid-area: label; display: flex; flex-direction: column; min-width: 0; }
.bd-label .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-row .progressbar { grid-area: bar; }
.bd-pts { grid-area: pts; font-weight: 800; font-variant-numeric: tabular-nums; }
.bd-lvl { grid-area: lvl; font-size: .74rem; color: var(--text-dim); text-align: right; white-space: nowrap; }
.hist-row { grid-template-areas: "t p" "m p"; }
.hist-title { grid-area: t; font-weight: 600; font-size: .92rem; min-width: 0; overflow-wrap: anywhere; }
.hist-row .meta { grid-area: m; }
.hist-row .pill { grid-area: p; }
.avg-row { grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto; grid-template-areas: "n b p"; }
.avg-name { grid-area: n; font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avg-row .progressbar { grid-area: b; }
.avg-pct { grid-area: p; font-size: .8rem; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.weak-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .5rem .8rem; }
.weak-name { flex: 1 1 8rem; font-weight: 600; }
.weak-pct { font-weight: 800; color: var(--red); }
.plain-list { padding-left: 1.2rem; font-size: .88rem; }

/* ===== Početni ekran ispita ===== */
.q-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin-bottom: .9rem; min-width: 0; }
.start-card h3 { margin: 0 0 .5rem; font-size: 1rem; }
.section-pick { display: flex; flex-direction: column; gap: .4rem; }
.pick-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border: 1.5px solid var(--border); border-radius: 10px; min-height: 52px; cursor: pointer; }
.pick-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick-row input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.pick-text { display: flex; flex-wrap: wrap; gap: 0 .4rem; align-items: baseline; }
.start-summary { font-size: .95rem; margin: .9rem 0 .6rem; }
.how { margin-top: .9rem; font-size: .86rem; }
.how summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.how ul { padding-left: 1.2rem; margin: .2rem 0; color: var(--text-dim); }
.how li { margin: .3rem 0; }

/* ===== Vežbanje, drilovi ===== */
.practice-bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin: -.4rem 0 .2rem; }
.practice-score { display: flex; flex-direction: column; gap: .3rem; margin: .2rem 0 .1rem; }
.streak { font-size: .86rem; font-weight: 600; color: var(--text-dim); margin: -.3rem 0 .6rem; }
.params-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .2rem .8rem .8rem; margin-bottom: .8rem; }
.params-wrap summary { cursor: pointer; font-weight: 700; font-size: .88rem; min-height: 44px; display: flex; align-items: center; }
.params { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 135px), 1fr)); gap: .6rem; align-items: end; }
.param { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; font-weight: 600; color: var(--text-dim); }
.param input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--accent); }

/* ===== Brza provera ===== */
.q-head { display: flex; gap: .6rem; align-items: baseline; margin-bottom: .4rem; }
.q-head > div { min-width: 0; flex: 1; }
.q-num { flex-shrink: 0; font-weight: 800; color: var(--accent); }
.q-text > p:first-child { margin-top: 0; }
.options { display: flex; flex-direction: column; gap: .5rem; margin: .7rem 0 0; }
.options.tf { flex-direction: row; }
.options.tf .opt { flex: 1; }
.opt {
  display: flex; gap: .65rem; align-items: center; border: 1.5px solid var(--border); border-radius: 10px; padding: .6rem .7rem;
  font-size: .94rem; background: var(--surface); width: 100%; text-align: left; color: var(--text); font-family: inherit; cursor: pointer; min-height: 48px;
}
.opt:disabled { cursor: default; opacity: 1; }
.opt .letter { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: var(--text-dim); }
.opt .opt-body { flex: 1; min-width: 0; }
.opt .opt-body > p { margin: 0; }
.opt.correct { border-color: var(--green); background: var(--green-soft); }
.opt.correct .letter { background: var(--green); border-color: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .letter { background: var(--red); border-color: var(--red); color: #fff; }
.short-form { display: flex; gap: .5rem; margin-top: .7rem; }
.short-form .input { flex: 1; }
.explain { margin-top: .8rem; background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 8px; padding: .6rem .8rem; font-size: .9rem; }
.explain.ok { border-left-color: var(--green); }
.explain.ok > b { color: var(--green); }
.explain.bad { border-left-color: var(--red); }
.explain.bad > b { color: var(--red); }
.explain .md.inline, .explain .md.inline > p { display: inline; margin: 0; }
.explain .src { font-size: .76rem; color: var(--text-dim); margin-top: .35rem; }

/* ===== Podsetnik ===== */
.sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.sheet > h1:first-child { margin-top: 0; font-size: 1.35rem; }
.sheet h2 { font-size: 1.1rem; margin-top: 1.3rem; }
.paper-header { font-size: .9rem; color: var(--text-dim); }
.paper-section { margin-top: 1.8rem; }

.print-only { display: none; }

@media (max-width: 480px) {
  .brand-sub { display: none; }
  main { padding-top: .75rem; }
  .task-card, .q-card { padding: .85rem; }
  .task-card .stmt.sticky { margin: -.85rem -.85rem 0; padding: 0 .85rem; }
  /* telefon: manje ugnježdenih margina da figure u koracima stanu bez skrola */
  .lv { padding-left: .45rem; padding-right: .45rem; }
  .lv .steps { padding-left: .45rem; padding-right: .45rem; }
  .avg-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n p" "b b"; }
  .dot { width: 42px; height: 42px; }
  .weak-row { display: grid; grid-template-columns: 1fr 1fr; }
  .weak-pct { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ===== Štampa: samo postavke, kao pravi rad ===== */
@media print {
  @page { margin: 16mm 14mm; }
  :root { --page: #fff; --surface: #fff; --surface-2: #f2f2f2; --text: #000; --text-dim: #333; --border: #999; --accent: #000; --line: #777; --card: #f4f4f4; --hl: #000; --hl-bg: #eee; color-scheme: light; }
  body { background: #fff; color: #000; font-size: 11pt; display: block; }
  .topbar, .site-footer, .no-print, .btn, .btn-row, .toolbar, .work, .dots, .take-top, .storage-warn, .toast, .modal-back, .stmt-toggle, .sheet-links, .task-meta, .continue-card { display: none !important; }
  main { max-width: none !important; padding: 0 !important; }
  .print-only { display: block; }
  .print-header { border-bottom: 2px solid #000; margin-bottom: 8mm; padding-bottom: 3mm; }
  .print-header h1 { font-size: 16pt; margin: 1mm 0; }
  .ph-course, .ph-meta { font-size: 10pt; }
  .ph-name { margin-top: 4mm; font-size: 10pt; }
  .task-card, .q-card, .sheet { box-shadow: none; border: 0; border-radius: 0; padding: 0; margin: 0 0 7mm; }
  .task-card { break-inside: auto; }
  .task-head { break-after: avoid; }
  .task-num { color: #000; font-size: 12pt; }
  .task-pts { background: none; border: 1px solid #000; }
  .task-title { display: none; }
  .fig, .figs, pre, table, .part-stmt { break-inside: avoid; }
  .stmt.sticky { position: static; max-height: none; overflow: visible; margin: 0; padding: 0; }
  .stmt .stmt-body { display: block !important; }
  .task-layout.revealed { display: block; }
  .paper-section { break-before: page; color: #000; font-size: 12pt; text-transform: none; letter-spacing: 0; }
  .notes-box { background: none; color: #000; border: 1px solid #999; }
  .stmt .notes-box { display: none; }
  a { color: #000; text-decoration: none; }
  pre.code, .md pre.code { white-space: pre-wrap; overflow: visible; }
  .fig-scroll { overflow: visible !important; }
  .md-table { overflow: visible !important; }
  .md-table td { white-space: normal !important; }
  .sheet { padding: 0; }
}
