/* ==========================================================================
   Priručnik za građane Novog Sada – ceo stil sajta
   Sekcije: osnova · raspored · meni · gornja traka · tipografija sadržaja ·
   okviri · tabele · postupci i liste · obrazac · slike i popup · naslovna ·
   pager · pretraga · provera znanja · mapa pojmova · tamna tema · štampa ·
   smanjeno kretanje.
   Boje postoje samo kao promenljive na :root (osim retkih izuzetaka).
   ========================================================================== */

/* ---------- Osnova ---------- */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --text: #1d2126;
  --muted: #5d646e;
  --line: #dcd8cf;
  --accent: #1d4f91;
  --accent-soft: #e6eef9;
  --accent-text: #ffffff;
  --focus: #e0a100;

  --vazno: #b42318;      --vazno-soft: #fdeeec;
  --paznja: #a15c07;     --paznja-soft: #fdf3e2;
  --napomena: #0e6a85;   --napomena-soft: #e5f3f7;
  --primer: #2f7a3e;     --primer-soft: #e9f4eb;
  --aktuelno: #6b3fa0;   --aktuelno-soft: #f2ecf9;

  --hl: #ffe08a;          /* isticanje reči iz pretrage */
  --hl-text: #1d2126;

  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif", serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --sidebar-w: 300px;
  --content-w: 860px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .06);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.6;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

button { font: inherit; color: inherit; }

img { max-width: 100%; height: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Raspored ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.layout > * { min-width: 0; }

.content {
  width: 100%;
  max-width: calc(var(--content-w) + 96px);
  padding: 40px 48px 64px;
}

/* ---------- Meni (bočna traka) ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 16px 28px;
  font-size: 15px;
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.sidebar-sakrij {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin-top: -2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.sidebar-sakrij:hover { background: var(--surface-2); color: var(--text); }

.sidebar .brand {
  flex: 1;
  min-width: 0;
  display: block;
  font-family: var(--font-head);
  font-size: 19px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin: 0 6px 4px;
}
.sidebar .brand-sub {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 0 6px 16px;
}

.sidebar ol, .sidebar ul { list-style: none; margin: 0; padding: 0; }

.sidebar .nav-list a {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
}
.sidebar .nav-list a:hover { background: var(--surface-2); }
.sidebar .nav-list a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.sidebar .nav-num {
  flex: 0 0 1.6em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sidebar a[aria-current="page"] .nav-num { color: var(--accent); }

.sidebar .nav-posebno {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sidebar-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
}
.btn-tool:hover { background: var(--surface-2); }

/* ---------- Gornja traka (samo na uskom ekranu) ---------- */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar .title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

/* sakriven meni na širokom ekranu: sadržaj preko cele širine, gornja traka vraća meni */
@media (min-width: 901px) {
  body.meni-skriven .topbar { display: flex; }
  body.meni-skriven .layout { grid-template-columns: minmax(0, 1fr); }
  body.meni-skriven .sidebar { display: none; }
  body.meni-skriven .content { margin-inline: auto; }
}

@media (max-width: 900px) {
  .topbar { display: flex; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    width: min(86vw, 320px);
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, .35);
  }
  .content { padding: 22px 16px 48px; }
}

/* ---------- Tipografija sadržaja ---------- */
.content h1, .content h2, .content h3, .content h4 {
  font-family: var(--font-head);
  line-height: 1.25;
  scroll-margin-top: 16px;
}
.content h1 { font-size: 2.05rem; margin: .2em 0 .4em; }
.content h2 {
  font-size: 1.5rem;
  margin: 2.1em 0 .6em;
  padding-top: .5em;
  border-top: 1px solid var(--line);
}
.content h3 { font-size: 1.2rem; margin: 1.7em 0 .5em; }
.content h4 { font-size: 1.05rem; margin: 1.4em 0 .4em; }

.content p, .content li { overflow-wrap: break-word; }
.content [id] { scroll-margin-top: 16px; }

@media (max-width: 900px) {
  .content h1 { font-size: 1.65rem; }
  .content h2 { font-size: 1.3rem; }
  .content [id], .content h1, .content h2, .content h3, .content h4 { scroll-margin-top: 64px; }
}

.chapter-kicker {
  display: inline-block;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.lead { font-size: 1.12rem; color: var(--muted); }

.url, .no-wrap-break { overflow-wrap: anywhere; }

.izvor-napomena { color: var(--muted); font-size: .93rem; }

/* privremeni okvir oko bloka na koji vodi rezultat pretrage ili link */
.cilj {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
  transition: outline-color 1.2s ease;
}
.cilj-gasi { outline-color: transparent; }

/* ---------- Okviri ---------- */
.callout {
  --c: var(--napomena);
  --c-soft: var(--napomena-soft);
  margin: 1.3em 0;
  padding: 14px 18px 14px 16px;
  background: var(--c-soft);
  border-left: 5px solid var(--c);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout.vazno    { --c: var(--vazno);    --c-soft: var(--vazno-soft); }
.callout.paznja   { --c: var(--paznja);   --c-soft: var(--paznja-soft); }
.callout.napomena { --c: var(--napomena); --c-soft: var(--napomena-soft); }
.callout.primer   { --c: var(--primer);   --c-soft: var(--primer-soft); }
.callout.aktuelno { --c: var(--aktuelno); --c-soft: var(--aktuelno-soft); }

.callout > .label {
  display: block;
  margin-bottom: 4px;
  color: var(--c);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.callout > :last-child { margin-bottom: 0; }
.callout > p:first-of-type { margin-top: 0; }
.callout ul, .callout ol { padding-left: 1.3em; margin: .4em 0; }

/* ---------- Tabele ---------- */
.table-wrap {
  margin: 1.2em 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
  line-height: 1.45;
}
.table-wrap th, .table-wrap td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.table-wrap th {
  background: var(--surface-2);
  font-weight: 600;
  white-space: nowrap;
}
.table-wrap tbody th { white-space: normal; background: transparent; }
.table-wrap tr:last-child > * { border-bottom: 0; }
.table-wrap caption {
  caption-side: top;
  padding: 10px 12px 0;
  text-align: left;
  font-weight: 600;
}
/* tabele sa mnogo kolona dobijaju minimalnu širinu i skroluju u okviru */
.table-wrap table.siroka { min-width: 640px; }
.table-wrap table.vrlo-siroka { min-width: 760px; }

/* ---------- Postupci i liste ---------- */
ol.steps {
  list-style: none;
  counter-reset: korak;
  margin: 1em 0;
  padding: 0;
}
ol.steps > li {
  counter-increment: korak;
  position: relative;
  padding: 0 0 .8em 2.6em;
  min-height: 2em;
}
ol.steps > li::before {
  content: counter(korak);
  position: absolute;
  left: 0;
  top: .05em;
  width: 1.8em;
  height: 1.8em;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: .9em;
  font-weight: 700;
  line-height: 1.8em;
  text-align: center;
}
ol.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(.9em - 1px);
  top: 2em;
  bottom: .15em;
  width: 2px;
  background: var(--line);
}

ul.check { list-style: none; margin: 1em 0; padding: 0; }
ul.check > li { position: relative; padding: 0 0 .5em 2em; }
ul.check > li::before {
  content: "";
  position: absolute;
  left: .15em;
  top: .3em;
  width: 1.05em;
  height: 1.05em;
  border: 2px solid var(--accent);
  border-radius: 4px;
}

/* ---------- Obrazac i formula ---------- */
.obrazac {
  margin: 1.2em 0;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px dashed var(--muted);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: .9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.obrazac p { margin: 0 0 .7em; }
.obrazac p:last-child { margin-bottom: 0; }
.obrazac .desno { text-align: right; }

.formula {
  margin: 1em 0;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 8px;
  font-family: var(--font-mono);
  overflow-x: auto;
}

/* ---------- Slike i popup ---------- */
.figs { display: flex; flex-wrap: wrap; gap: 10px; }
a.fig {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}
a.fig::before { content: "🖼"; }
a.fig:hover { background: var(--accent-soft); }

.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 16px 16px;
  background: rgba(10, 12, 16, .9);
  color: #f2f2f2;
}
.lb[hidden] { display: none; }
.lb img {
  max-width: min(100%, 1400px);
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 6px;
  touch-action: pan-y pinch-zoom;
}
.lb-cap { max-width: 900px; text-align: center; font-size: 15px; }
.lb-btn {
  position: absolute;
  border: 0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 24px;
  line-height: 44px;
  cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, .28); }
.lb-close { top: 10px; right: 10px; }
.lb-prev { left: 10px; top: 50%; }
.lb-next { right: 10px; top: 50%; }

/* ---------- Naslovna ---------- */
.hero {
  margin: 0 0 28px;
  padding: 28px 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.hero h1 { margin-top: .15em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn:hover { text-decoration: underline; }

.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
  padding: 13px 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 1.05rem;
  text-align: left;
  cursor: text;
}
.hero-search:hover { border-color: var(--accent); }
.hero-search kbd { margin-left: auto; }

kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: .8em;
}

#tocGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin: 1em 0;
}
.toc-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.toc-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.toc-card .toc-num { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.toc-card .toc-title { font-family: var(--font-head); font-size: 1.08rem; font-weight: 700; line-height: 1.3; }
.toc-card .toc-desc { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.toc-card.posebno { background: var(--accent-soft); }

/* ---------- Pager (prethodno / sledeće) ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.pager a {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.pager a:hover { border-color: var(--accent); }
.pager .pager-dir { color: var(--muted); font-size: 13px; }
.pager .pager-title { font-weight: 600; }
.pager .next { grid-column: 2; text-align: right; }
@media (max-width: 520px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}

/* ---------- Pretraga ---------- */
.search-open {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
  text-align: left;
  cursor: text;
}
.search-open:hover { border-color: var(--accent); }
.search-open kbd { margin-left: auto; }

.sd {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  background: rgba(10, 12, 16, .45);
}
.sd[hidden] { display: none; }
.sd-box {
  display: flex;
  flex-direction: column;
  width: min(100%, 720px);
  max-height: 80vh;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
  overflow: hidden;
}
.sd-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.sd-head input {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.08rem;
}
.sd-head input:focus { outline: none; }
.sd-close {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 4px 9px;
  cursor: pointer;
}
.sd-status { padding: 6px 16px; color: var(--muted); font-size: 13px; }
.sd-list { margin: 0; padding: 0 6px 8px; overflow-y: auto; list-style: none; }
.sd-list li a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.sd-list li a:hover, .sd-list li[aria-selected="true"] a { background: var(--accent-soft); }
.sd-where { display: block; color: var(--muted); font-size: 12.5px; }
.sd-snip { display: block; font-size: 14.5px; line-height: 1.45; }
.sd-snip b { background: var(--hl); color: var(--hl-text); font-weight: 600; border-radius: 2px; }
.sd-hint { padding: 8px 16px 12px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

::highlight(pretraga) { background-color: var(--hl); color: var(--hl-text); }

@media (max-width: 900px) {
  .sd { padding: 0; }
  .sd-box { width: 100%; max-height: none; height: 100%; border-radius: 0; }
}

/* ---------- Provera znanja ---------- */
.quiz-card {
  margin: 1.2em 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.quiz-card fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.quiz-card legend { padding: 0; }
.content .quiz-card h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.quiz-progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 6px 0 16px; }
.quiz-progress span { display: block; height: 100%; background: var(--accent); }
.quiz-meta { color: var(--muted); font-size: 14px; }
.quiz-q { font-size: 1.15rem; font-weight: 600; margin: .4em 0 .8em; }
.quiz-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.quiz-opts label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}
.quiz-opts label:hover { background: var(--surface-2); }
.quiz-opts input { margin-top: .35em; flex: 0 0 auto; }
.quiz-opts .ok { border-color: var(--primer); background: var(--primer-soft); }
.quiz-opts .bad { border-color: var(--vazno); background: var(--vazno-soft); }
.quiz-feedback { margin-top: 14px; padding: 12px 14px; border-radius: 9px; background: var(--surface-2); }
.quiz-feedback.ok { background: var(--primer-soft); }
.quiz-feedback.bad { background: var(--vazno-soft); }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.quiz-setup label { display: block; margin: .6em 0 .2em; font-weight: 600; }
.quiz-setup select {
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.quiz-score { font-size: 2.2rem; font-weight: 700; font-family: var(--font-head); }
.quiz-review { list-style: none; padding: 0; margin: 1em 0; display: grid; gap: 10px; }
.quiz-review li { padding: 12px 14px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 8px; background: var(--surface); }
.quiz-review li.ok { border-left-color: var(--primer); }
.quiz-review li.bad { border-left-color: var(--vazno); }
.quiz-review .rq { font-weight: 600; }
.quiz-review .ra { color: var(--muted); font-size: .93rem; }
button.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Mapa pojmova ---------- */
.content.mapa-content { max-width: none; }
.mapa-filteri { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 1em 0; }
.mapa-filteri input[type="search"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.mapa-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
}
.mapa-tip[aria-pressed="false"] { opacity: .45; }
.mapa-tip .dot, .mapa-legend .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

.mapa-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.mapa-platno { position: relative; overflow-x: auto; }
.mapa-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.mapa-svg path { fill: none; stroke: var(--line); stroke-width: 1.5; }
.mapa-svg path.aktivna { stroke: var(--accent); stroke-width: 2.5; }
.mapa-svg path.put { stroke: var(--focus); stroke-width: 3.5; }

.mapa-grid { position: relative; display: grid; grid-template-columns: 150px repeat(4, minmax(150px, 1fr)); gap: 10px 22px; min-width: 820px; }
.mapa-kol-nasl { font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-bottom: 4px; }
.mapa-red-nasl { font-size: 13px; color: var(--muted); padding-top: 6px; border-top: 1px solid var(--line); }
.mapa-red-nasl a { color: inherit; }
.mapa-celija { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); }

.mapa-kartica {
  --c: var(--accent);
  --c-soft: var(--accent-soft);
  position: relative;
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--c);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
.mapa-kartica:hover { background: var(--c-soft); }
.mapa-kartica.izabrana { background: var(--c-soft); border-color: var(--c); box-shadow: 0 0 0 2px var(--c); }
.mapa-kartica.sused { border-color: var(--c); }
.mapa-kartica.prigusena { opacity: .35; }
.mapa-kartica[hidden] { display: none; }
.mapa-kartica .put-br {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--focus);
  color: #1d2126;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
[data-tip="pojam"]    { --c: var(--accent);   --c-soft: var(--accent-soft); }
[data-tip="vazno"]    { --c: var(--vazno);    --c-soft: var(--vazno-soft); }
[data-tip="napomena"] { --c: var(--napomena); --c-soft: var(--napomena-soft); }
[data-tip="paznja"]   { --c: var(--paznja);   --c-soft: var(--paznja-soft); }
[data-tip="primer"]   { --c: var(--primer);   --c-soft: var(--primer-soft); }
[data-tip="aktuelno"] { --c: var(--aktuelno); --c-soft: var(--aktuelno-soft); }

.mapa-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 15px;
}
.mapa-panel h2 { margin: 0 0 .3em; padding: 0; border: 0; font-size: 1.15rem; }
.mapa-panel .mp-tip { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--c); }
.mapa-panel .mp-tekst p { margin: .5em 0; }
.mapa-panel ul { padding-left: 1.1em; margin: .4em 0; }
.mapa-panel .mp-susedi { list-style: none; padding: 0; display: grid; gap: 6px; }
.mapa-panel .mp-susedi button { width: 100%; }
.mapa-panel ol.mp-put { padding-left: 1.4em; }
.mapa-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; margin: .5em 0 1em; }
.mapa-legend span { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 1100px) {
  .mapa-wrap { grid-template-columns: minmax(0, 1fr); }
  .mapa-panel { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .mapa-grid { display: block; min-width: 0; }
  .mapa-kol-nasl { display: none; }
  .mapa-red-nasl { margin-top: 18px; font-size: 15px; font-weight: 700; color: var(--text); }
  .mapa-celija { border-top: 0; padding-top: 8px; }
  .mapa-svg { display: none; }
}

/* ---------- Tamna tema ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171c;
    --surface: #1c2028;
    --surface-2: #262b34;
    --text: #e5e7ea;
    --muted: #a3aab4;
    --line: #343a45;
    --accent: #86b4ff;
    --accent-soft: #1d2b42;
    --accent-text: #0f1520;
    --focus: #f2c14e;
    --vazno: #f4877f;    --vazno-soft: #3a2222;
    --paznja: #f0b55c;   --paznja-soft: #3a2d17;
    --napomena: #63c6dc; --napomena-soft: #15313a;
    --primer: #7fcf8c;   --primer-soft: #1b3322;
    --aktuelno: #c5a4f0; --aktuelno-soft: #2d2442;
    --hl: #7a5d00;
    --hl-text: #fff5d6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171c;
  --surface: #1c2028;
  --surface-2: #262b34;
  --text: #e5e7ea;
  --muted: #a3aab4;
  --line: #343a45;
  --accent: #86b4ff;
  --accent-soft: #1d2b42;
  --accent-text: #0f1520;
  --focus: #f2c14e;
  --vazno: #f4877f;    --vazno-soft: #3a2222;
  --paznja: #f0b55c;   --paznja-soft: #3a2d17;
  --napomena: #63c6dc; --napomena-soft: #15313a;
  --primer: #7fcf8c;   --primer-soft: #1b3322;
  --aktuelno: #c5a4f0; --aktuelno-soft: #2d2442;
  --hl: #7a5d00;
  --hl-text: #fff5d6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* ---------- Štampa ---------- */
@media print {
  .sidebar, .topbar, .pager, .search-open, .hero-search, .hero-actions,
  .sd, .lb, .btn-tool, .sidebar-tools, .quiz-actions { display: none !important; }
  .layout { display: block; }
  .content { max-width: none; padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: inherit; }
  .callout, .table-wrap, ol.steps > li { break-inside: avoid; }
  .table-wrap { overflow: visible; border-color: #999; }
  .table-wrap table.siroka, .table-wrap table.vrlo-siroka { min-width: 0; }
  .content h2 { break-after: avoid; }
}

/* ---------- Smanjeno kretanje ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
