:root {
  --bg: #fbfaf7;
  --text: #1d1d1b;
  --muted: #6b6a66;
  --line: #e4e1da;
  --accent: #1f5f8b;
  --warn: #9a5b00;
  --card: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --text: #ecebe7;
    --muted: #a3a19b;
    --line: #34332f;
    --accent: #7db7e0;
    --warn: #e2a34a;
    --card: #1e1e1c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.site-header { border-bottom: 1px solid var(--line); background: var(--card); }
.header-row { display: flex; gap: 16px; align-items: center; padding-top: 14px; padding-bottom: 8px; }
.brand { font-weight: 700; font-size: 1.4rem; color: var(--text); }
.search { flex: 1; }
.search input {
  width: 100%; padding: 8px 12px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text);
}
.categories { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; font-size: 0.92rem; }
.categories a { white-space: nowrap; color: var(--muted); }
.categories a[aria-current] { color: var(--text); font-weight: 600; }

main { padding-top: 20px; padding-bottom: 40px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.3em 0 0.5em; }
h2 { font-size: 1.15rem; margin-top: 1.8em; }

.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sort a[aria-current] { font-weight: 600; color: var(--text); }

.stories { list-style: none; padding: 0; margin: 0; }
.card { padding: 14px 0; border-bottom: 1px solid var(--line); }
.card-title { font-size: 1.12rem; font-weight: 600; color: var(--text); }
.card-summary { margin: 6px 0; }
.meta, .note { color: var(--muted); font-size: 0.88rem; }
.importance { white-space: nowrap; }

/* Hiding stories (hide.js): swipe right on a phone, × with a mouse */
.stories[data-hideable] .card { position: relative; touch-action: pan-y; transition: transform 0.2s, opacity 0.2s; }
.card-dragging { transition: none !important; user-select: none; -webkit-user-select: none; }
.card-folding { overflow: hidden; padding-top: 0 !important; padding-bottom: 0 !important; border-bottom-width: 0; transition: height 0.2s, padding 0.2s !important; }
.card-hide {
  position: absolute; top: 12px; right: 0; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.card-hide:hover, .card-hide:focus-visible { background: var(--line); color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  .stories[data-hideable] .card { padding-right: 36px; }
}
@media (hover: none), (pointer: coarse) {
  /* phones swipe instead; the button stays for screen readers and keyboards */
  .card:not(.card-dismissed) .card-hide:not(:focus) {
    clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden;
  }
}
.card-dismissed > :not(.card-hide) { opacity: 0.5; }
.card-dismissed .card-hide {
  position: static; float: right; width: auto; height: auto; margin: 2px 0 4px 12px; padding: 2px 12px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--accent); font-size: 0.85rem;
}
.hidden-note { color: var(--muted); font-size: 0.88rem; margin: 0 0 4px; }
.hidden-note button, .toast button {
  font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer;
}
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; gap: 14px; align-items: baseline; padding: 10px 16px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: 0.95rem; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  white-space: nowrap; z-index: 10;
}
.toast[hidden] { display: none; }
.toast button { color: var(--bg); font-weight: 600; text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
  .stories[data-hideable] .card, .card-folding { transition: none !important; }
}

.summary { font-size: 1.1rem; }
.importance-box { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }

.facts { padding-left: 1.3em; }
.fact { margin-bottom: 12px; }
.fact-type {
  display: inline-block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-right: 6px;
}
.fact-meta { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.fact.disputed .fact-meta strong { color: var(--warn); }
.fact.retracted { color: var(--muted); }

.keywords a {
  display: inline-block; margin: 0 6px 6px 0; padding: 2px 10px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 0.9rem;
}
.sources li { margin-bottom: 8px; }
.pager { display: flex; justify-content: space-between; padding-top: 16px; }
.empty { color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; padding: 18px 0 30px; }

/* Program tracker */
:root {
  --st-none: #b9b5ac; --st-progress: #2f78b7; --st-partly: #c98a1b;
  --st-done: #2e8b57; --st-broken: #b8452f; --st-vague: #dcd8cf; --st-moved: #a9cbe6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --st-none: #6d6a63; --st-progress: #5a9fd8; --st-partly: #d9a13c;
    --st-done: #4fae7a; --st-broken: #d9674f; --st-vague: #3d3c38; --st-moved: #2f5674;
  }
}
.nav-program { border-left: 1px solid var(--line); padding-left: 14px; }
.notice { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 8px 12px; font-size: 0.95rem; }
.status {
  display: inline-block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em;
  border-radius: 4px; padding: 0 6px; margin-right: 6px; white-space: nowrap; color: #fff;
}
.status-bez_pomaka { background: var(--st-none); color: var(--text); }
.status-pomak { background: var(--st-moved); color: var(--text); }
.status-u_toku { background: var(--st-progress); }
.status-delimicno { background: var(--st-partly); color: #1d1d1b; }
.status-ispunjeno { background: var(--st-done); }
.status-odustano { background: var(--st-broken); }
.status-nemerljivo { background: var(--st-vague); color: var(--text); }
.status-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); margin: 6px 0; }
.status-bar span { display: block; height: 100%; }
.status-bar span.status-bez_pomaka { background: var(--st-none); }
.status-totals { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.92rem; }
.points { list-style: none; padding: 0; margin: 0 0 8px; }
.point { padding: 7px 0; border-bottom: 1px solid var(--line); }
.point:last-child { border-bottom: 0; }
.point > a { color: var(--text); }
.point.late .meta strong, .late-label { color: var(--warn); }
.plan-part { margin: 1.4em 0 0.3em; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.plan-point { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.plan-point summary {
  display: flex; flex-direction: column; justify-content: center; min-height: 44px;
  padding: 8px 40px 8px 14px; position: relative; cursor: pointer; list-style: none;
}
.plan-point summary::-webkit-details-marker { display: none; }
.plan-point summary::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
}
.plan-point[open] summary::after { margin-top: -2px; transform: rotate(225deg); }
.plan-title { font-weight: 600; line-height: 1.35; }
.plan-point .points { padding: 0 14px 6px; margin: 0; }
.plan-point .point { border-top: 1px solid var(--line); border-bottom: 0; }
.program-head { position: relative; }
.program-head h1 { margin: 0.1em 0 0; padding-right: 150px; }
.hint summary {
  position: absolute; top: 0; right: 0; display: flex; gap: 6px; align-items: center; min-height: 44px;
  padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  color: var(--accent); font-size: 0.92rem; white-space: nowrap; cursor: pointer; list-style: none;
}
.hint summary::-webkit-details-marker { display: none; }
.hint-panel { margin-top: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: 0.95rem; }
.hint-panel p { margin: 0 0 10px; }
.hint-panel p:last-child { margin-bottom: 0; }
@media (max-width: 520px) {
  .program-head h1 { padding-right: 0; }
  .hint summary { position: static; width: max-content; margin-top: 8px; }
}
.tabs { display: flex; margin-top: 14px; border-bottom: 1px solid var(--line); }
.tabs a {
  flex: 1 1 auto; max-width: 150px; min-height: 44px; display: flex; align-items: center; justify-content: center;
  padding: 0 6px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--muted);
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.tab-panel { padding-top: 18px; }
.tab-panel > h2 { margin-bottom: 6px; }
.tab-panel > h2:first-child { margin-top: 0; }
.tab-head { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: center; justify-content: space-between; margin-top: 20px; }
.tab-head:first-child { margin-top: 0; }
.tab-head h2 { margin: 0; }
.tab-panel .note { margin: 4px 0 8px; }
.chapters { list-style: none; padding: 0; margin: 0; }
.chapters li { display: flex; flex-wrap: wrap; gap: 2px 16px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.chapters a { flex: 1 1 300px; }
.chapters .meta { flex: 0 0 auto; white-space: nowrap; }
.chapters .status-bar { flex: 1 1 100px; max-width: 150px; margin: 0; }
.filters a[aria-current] { font-weight: 600; color: var(--text); }
.filters { display: flex; gap: 14px; align-items: center; min-height: 44px; font-size: 0.9rem; }
.deadline { display: block; font-size: 0.88rem; font-weight: 600; }
.deadline::first-letter { text-transform: uppercase; }
.point.late .deadline strong { color: var(--warn); }
.show-all summary {
  display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--accent); font-size: 0.92rem; cursor: pointer; list-style: none;
}
.show-all summary::-webkit-details-marker { display: none; }
.show-all[open] summary { display: none; }
.news li > a { color: var(--text); font-weight: 600; }
.news .fact-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-panel .importance-box { margin-top: 20px; }
.importance-box h2 { margin: 0 0 2px; font-size: 1rem; }
.importance-box p { margin: 0; font-size: 0.95rem; }
.point-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.point-facts dt { color: var(--muted); }
.point-facts dd { margin: 0; overflow-wrap: anywhere; }
.history li { margin-bottom: 6px; }
.links { list-style: none; padding: 0; }
.links li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.verdict {
  display: inline-block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em;
  border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; margin-right: 6px; white-space: nowrap;
}
.verdict-pominje { color: var(--muted); }
.verdict-slucaj { color: var(--accent); }
.verdict-napredak { color: var(--st-progress); }
.weeks { list-style: none; padding: 0; }
.weeks li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.weeks .meta { display: block; margin-bottom: 2px; }
.week-count { display: inline-block; margin-right: 12px; white-space: nowrap; }
.evidence { display: block; }
.verdict-ispunjeno { color: var(--st-done); }
.verdict-nazadovanje { color: var(--st-partly); }
.verdict-suprotno { color: var(--st-broken); }
