:root {
  --ink: #17324d;
  --ink-2: #29465f;
  --muted: #566b7c;
  --line: #dce6ec;
  --line-soft: #eaf0f4;
  --paper: #ffffff;
  --page: #f5f8fa;
  --blue: #006f9d;
  --blue-dark: #075a7c;
  --teal: #00a7a5;
  --teal-dark: #0a7271;
  --cyan-soft: #e7f6f6;
  --blue-soft: #eaf4f8;
  --orange: #a65817;
  --orange-soft: #fff2e7;
  --green: #2d7a4b;
  --green-soft: #eaf6ef;
  --red: #a84141;
  --red-soft: #faecec;
  --violet: #6554a4;
  --violet-soft: #f0edfb;
  --shadow: 0 10px 30px rgba(22, 58, 78, .08);
  --shadow-sm: 0 4px 14px rgba(22, 58, 78, .07);
  --radius: 14px;
  --radius-sm: 9px;
  --shell: 1240px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--blue-dark); }
button, input, select { font: inherit; }
button { color: inherit; }
.shell { width: min(var(--shell), calc(100% - 40px)); margin: 0 auto; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 1000; background: var(--ink); color: white; padding: 10px 14px; border-radius: 0 0 8px 8px; }
.skip-link:focus { top: 0; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.header-accent { height: 4px; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.header-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: flex; gap: 15px; align-items: center; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; min-width: 92px; height: 40px; padding: 0 12px; background: var(--ink); border-radius: 7px; color: white; font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.brand-mark span { color: #67d5d2; margin-left: 2px; }
.brand-copy { display: grid; }
.brand-copy strong { font-size: 17px; letter-spacing: -.01em; }
.brand-copy small { color: var(--muted); font-size: 12px; margin-top: 1px; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a { color: var(--ink-2); text-decoration: none; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.main-nav a:hover { background: var(--blue-soft); }
.main-nav a.active { color: var(--blue-dark); background: var(--blue-soft); }
.mobile-nav-toggle { display: none; border: 1px solid var(--line); background: white; border-radius: 8px; padding: 8px 10px; }

.page { min-height: 70vh; padding: 34px 0 58px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header h1 { margin: 0; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.035em; line-height: 1.1; }
.page-header p { color: var(--muted); margin: 8px 0 0; max-width: 760px; }
.eyebrow { display: block; color: var(--teal-dark); font-weight: 800; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }

.hero {
  background: linear-gradient(118deg, #143f5c 0%, #0b6d88 58%, #069797 100%);
  color: white;
  border-radius: 20px;
  padding: 42px 46px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  margin-bottom: 26px;
}
.hero::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; right: -170px; top: -230px; background: rgba(255,255,255,.07); }
.hero::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: 80px; bottom: -190px; border: 1px solid rgba(255,255,255,.18); }
.hero-content { position: relative; z-index: 1; max-width: 860px; }
.hero h1 { margin: 0; font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -.04em; }
.hero p { font-size: 17px; max-width: 760px; color: rgba(255,255,255,.84); margin: 16px 0 24px; }
.hero-search { display: flex; gap: 10px; background: white; padding: 8px; border-radius: 12px; max-width: 780px; box-shadow: 0 10px 25px rgba(0,0,0,.12); }
.hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 10px 12px; color: var(--ink); background: transparent; }
.hero-search button { border: 0; border-radius: 8px; background: var(--teal); color: white; font-weight: 700; padding: 10px 18px; cursor: pointer; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; color: rgba(255,255,255,.8); font-size: 13px; }
.hero-meta strong { color: white; }

.scope-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 18px 0 24px; }
.scope-toggle { display: inline-flex; border: 1px solid var(--line); background: white; padding: 4px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.scope-label { align-self: center; padding: 0 6px 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.scope-toggle button { border: 0; background: transparent; padding: 8px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 13px; }
.scope-toggle button.active { color: white; background: var(--ink); }
.scope-note { color: var(--muted); font-size: 13px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi-card { display: block; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; transition: .15s ease; }
.kpi-card:hover { border-color: #9dc7d7; transform: translateY(-1px); box-shadow: var(--shadow); }
.kpi-card .kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.kpi-card strong { display: block; font-size: 34px; line-height: 1; margin: 8px 0 6px; letter-spacing: -.03em; }
.kpi-card small { color: var(--muted); }
.kpi-card.teal strong { color: var(--teal-dark); }
.kpi-card.blue strong { color: var(--blue); }
.kpi-card.orange strong { color: var(--orange); }
.kpi-card.violet strong { color: var(--violet); }
.kpi-card strong.kpi-date { font-size: 24px; line-height: 1.25; }

.section-grid { display: grid; grid-template-columns: 1.18fr .82fr; gap: 20px; margin-bottom: 22px; }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.panel-header h2, .panel h2 { font-size: 18px; margin: 0; letter-spacing: -.015em; }
.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.text-link { border: 0; background: none; color: var(--blue-dark); font-weight: 700; cursor: pointer; padding: 0; text-decoration: none; }

.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-card { display: block; border: 1px solid var(--line); border-radius: 11px; padding: 14px; background: #fbfdfe; cursor: pointer; text-align: left; transition: .16s ease; color: var(--ink); text-decoration: none; }
.quick-card:hover { border-color: #9dc7d7; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.quick-card strong { display: block; font-size: 14px; }
.quick-card small { color: var(--muted); display: block; margin-top: 3px; }
.quick-icon { width: 33px; height: 33px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 10px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 800; }

.bar-list { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 34px; align-items: center; gap: 10px; font-size: 13px; padding: 5px 6px; border-radius: 8px; color: inherit; text-decoration: none; }
.bar-row:hover { background: var(--blue-soft); }
.bar-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-track { height: 8px; border-radius: 999px; background: #edf2f5; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.bar-value { text-align: right; font-weight: 800; color: var(--ink-2); }

.status-list { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.status-list li { border-bottom: 1px solid var(--line-soft); }
.status-list li:last-child { border-bottom: 0; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 6px; color: inherit; text-decoration: none; border-radius: 8px; }
.status-row:hover { background: var(--blue-soft); }
.status-row strong { font-size: 18px; }

.chip, .badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 750; line-height: 1.2; }
.badge { background: var(--blue-soft); color: var(--blue-dark); }
.badge.teal { background: var(--cyan-soft); color: var(--teal-dark); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.gray { background: #eef2f4; color: #526878; }
.badge.red { background: var(--red-soft); color: var(--red); }

.documents-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.filters { position: sticky; top: 102px; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow-sm); }
.filters-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.filters h2 { font-size: 16px; margin: 0; }
.reset-button { border: 0; background: none; color: var(--blue-dark); font-weight: 700; cursor: pointer; padding: 2px; font-size: 12px; }
.filter-group { margin-bottom: 14px; }
.filter-group label { display: block; color: var(--ink-2); font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.filter-group select, .filter-group input { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 9px 10px; outline: 0; color: var(--ink); }
.filter-group select:focus, .filter-group input:focus, .search-box input:focus { border-color: #71b8c7; box-shadow: 0 0 0 3px rgba(0,167,165,.12); }
.advanced-filters { border-top: 1px solid var(--line-soft); padding-top: 11px; margin-top: 4px; }
.advanced-filters summary { cursor: pointer; font-weight: 750; font-size: 12px; color: var(--blue-dark); margin-bottom: 10px; }

.results-toolbar { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.search-box { flex: 1; position: relative; }
.search-box input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px 10px 38px; outline: 0; }
.search-box::before { content: "⌕"; position: absolute; left: 13px; top: 7px; color: var(--muted); font-size: 20px; transform: rotate(-15deg); }
.sort-select { border: 1px solid var(--line); border-radius: 9px; background: white; padding: 9px 10px; max-width: 180px; }
.mobile-filter-btn { display: none; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 9px 11px; font-weight: 700; }
.result-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 3px; color: var(--muted); font-size: 13px; }
.active-filter-list { display: flex; flex-wrap: wrap; gap: 6px; }
.active-filter { border: 1px solid #bfd8e0; background: var(--blue-soft); color: var(--blue-dark); border-radius: 999px; padding: 5px 8px; font-size: 11px; cursor: pointer; }

.doc-list { display: grid; gap: 12px; }
.doc-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 19px 20px; box-shadow: var(--shadow-sm); transition: .15s ease; }
.doc-card:hover { border-color: #b8d4de; box-shadow: var(--shadow); transform: translateY(-1px); }
.doc-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.doc-card h3 { margin: 4px 0 5px; font-size: 18px; line-height: 1.25; letter-spacing: -.01em; }
.doc-card h3 a { color: var(--ink); text-decoration: none; }
.doc-card h3 a:hover { color: var(--blue-dark); }
.doc-reference { color: var(--blue-dark); font-weight: 800; font-size: 12px; letter-spacing: .01em; }
.doc-description { color: #435c6f; margin: 10px 0 12px; }
.doc-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-meta-line { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.relevance-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; background: #8299a8; }
.relevance-dot.critical { background: var(--red); }
.relevance-dot.high { background: var(--orange); }
.relevance-dot.medium { background: var(--blue); }
.relevance-dot.contextual { background: #8896a1; }
.empty-state { background: white; border: 1px dashed #b9ccd6; border-radius: var(--radius); padding: 42px 24px; text-align: center; color: var(--muted); }

.detail-back { display: inline-flex; align-items: center; gap: 7px; color: var(--blue-dark); text-decoration: none; font-weight: 700; margin-bottom: 18px; }
.detail-hero { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.detail-hero h1 { font-size: clamp(27px, 4vw, 40px); line-height: 1.12; letter-spacing: -.035em; margin: 7px 0 12px; }
.detail-hero .lead { color: #405b6c; font-size: 17px; max-width: 900px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 18px; }
.detail-section { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.detail-section h2 { font-size: 17px; margin: 0 0 12px; }
.important-box { border-left: 4px solid var(--teal); background: var(--cyan-soft); padding: 15px 17px; border-radius: 0 10px 10px 0; color: #275256; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.meta-item { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.meta-item dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.meta-item dd { margin: 0; color: var(--ink-2); }
.source-list { display: grid; gap: 8px; }
.source-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; text-decoration: none; background: #fbfdfe; }
.source-link span { overflow-wrap: anywhere; }
.source-link strong { color: var(--blue-dark); }
.family-flow { display: grid; gap: 8px; }
.family-node { border: 1px solid var(--line); border-radius: 9px; padding: 11px; background: #fbfdfe; }
.family-arrow { color: var(--muted); padding-left: 15px; font-weight: 800; }

.ai-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ai-card { display: block; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); cursor: pointer; transition: .16s ease; color: var(--ink); text-decoration: none; }
.ai-card.selected { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0,111,157,.18); }
.ai-card:hover { transform: translateY(-2px); border-color: #acd0dc; box-shadow: var(--shadow); }
.ai-article { color: var(--blue-dark); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.ai-card h3 { margin: 5px 0 7px; font-size: 17px; }
.ai-card p { color: var(--muted); font-size: 13px; margin: 0; }
.ai-count { margin-top: 13px; display: inline-flex; background: var(--blue-soft); color: var(--blue-dark); border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; }
.ai-detail { margin: 0 0 8px; scroll-margin-top: 96px; }
.ai-detail:focus { outline: none; }
.ai-detail-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.ai-grid-title { font-size: 17px; margin: 26px 0 12px; }
.page-header p.ai-howto { margin-top: 10px; color: var(--ink); font-size: 14px; }
.mapping-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mapping-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); padding: 9px 8px; }
.mapping-table td { border-bottom: 1px solid var(--line-soft); padding: 11px 8px; vertical-align: top; }
.mapping-table a { font-weight: 750; text-decoration: none; }
.mapping-table tr:last-child td { border-bottom: 0; }

.change-list { display: grid; gap: 12px; }
.change-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.change-card .change-ref { color: var(--blue-dark); font-size: 12px; font-weight: 800; }
.change-card h3 { margin: 5px 0 7px; font-size: 16px; }
.change-card p { color: #465e70; margin: 5px 0; }
.change-source { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; }
.pagination button { min-width: 36px; height: 36px; border: 1px solid var(--line); background: white; border-radius: 8px; cursor: pointer; }
.pagination button.active { background: var(--ink); color: white; border-color: var(--ink); }
.pagination button:disabled { opacity: .45; cursor: default; }

.site-footer { background: #15364e; color: rgba(255,255,255,.85); padding: 32px 0; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.site-footer strong { color: white; }
.site-footer p { max-width: 680px; margin: 5px 0 0; font-size: 13px; color: rgba(255,255,255,.68); }
.footer-meta { display: grid; gap: 4px; text-align: right; color: rgba(255,255,255,.72); font-size: 12px; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: 350px; background: var(--ink); color: white; padding: 12px 15px; border-radius: 10px; box-shadow: var(--shadow); transform: translateY(30px); opacity: 0; pointer-events: none; transition: .2s ease; z-index: 100; }
.toast.show { transform: none; opacity: 1; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .section-grid, .detail-grid { grid-template-columns: 1fr; }
  .documents-layout { grid-template-columns: 1fr; }
  .filters { display: none; position: static; }
  .filters.mobile-open { display: block; }
  .mobile-filter-btn { display: inline-block; }
  .ai-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .shell { width: min(100% - 24px, var(--shell)); }
  .header-inner { min-height: 67px; }
  .brand-copy small { display: none; }
  .brand-mark { min-width: 78px; height: 36px; font-size: 17px; }
  .mobile-nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 67px; left: 12px; right: 12px; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
  .main-nav.open { display: flex; }
  .hero { padding: 30px 22px; border-radius: 16px; }
  .hero-search { flex-direction: column; }
  .hero-search button { width: 100%; }
  .scope-row { align-items: flex-start; flex-direction: column; }
  .scope-toggle { width: 100%; }
  .scope-toggle button { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .quick-grid, .ai-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 105px 1fr 30px; }
  .page-header { display: block; }
  .results-toolbar { flex-wrap: wrap; }
  .search-box { flex-basis: 100%; }
  .sort-select { flex: 1; }
  .doc-card-top { display: block; }
  .doc-card-top > .badge { margin-top: 8px; }
  .meta-grid { grid-template-columns: 1fr; }
  .mapping-table thead { display: none; }
  .mapping-table, .mapping-table tbody, .mapping-table tr, .mapping-table td { display: block; width: 100%; }
  .mapping-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .mapping-table td { border: 0; padding: 3px 0; }
  .footer-inner { display: block; }
  .footer-meta { text-align: left; margin-top: 18px; }
}
@media (max-width: 470px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .brand-copy strong { font-size: 14px; }
  .hero h1 { font-size: 34px; }
}

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

/* ---------- dodatki končne verzije ---------- */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid #f2a33a; outline-offset: 2px; border-radius: 6px; }
.hero-eyebrow { color: #9fe5e1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.shell.narrow { width: min(980px, calc(100% - 40px)); }
.highlight-panel { margin-bottom: 22px; border-left: 4px solid var(--teal); }
.harm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.harm-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.harm-list a { font-weight: 800; text-decoration: none; }
.harm-list span { color: var(--ink-2); }
.harm-list small { color: var(--green); font-weight: 700; }
.mini-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mini-changes li { display: grid; gap: 2px; font-size: 13px; color: #465e70; border-bottom: 1px solid var(--line-soft); padding-bottom: 9px; }
.mini-changes li:last-child { border-bottom: 0; }
.mini-changes .change-ref, .change-ref { color: var(--blue-dark); font-weight: 800; font-size: 12px; }
.mini-changes a, .change-ref a { text-decoration: none; }

.filters { max-height: calc(100vh - 120px); overflow-y: auto; }
.toggle-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin: 0 0 12px; cursor: pointer; }
.toggle-line input { margin-top: 3px; }
.facet { border-top: 1px solid var(--line-soft); padding: 9px 0; }
.facet summary { cursor: pointer; font-weight: 800; font-size: 12.5px; color: var(--ink-2); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.facet summary::-webkit-details-marker { display: none; }
.facet summary::after { content: "▾"; color: var(--muted); font-size: 12px; transition: transform .15s ease; }
.facet:not([open]) summary::after { transform: rotate(-90deg); }
.facet fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.facet-selected { margin-left: auto; margin-right: 6px; background: var(--ink); color: white; border-radius: 999px; font-size: 10px; padding: 1px 7px; }
.facet-options { display: grid; gap: 2px; margin-top: 7px; }
.facet-options.scroll { max-height: 230px; overflow-y: auto; padding-right: 4px; }
.facet-option { display: grid; grid-template-columns: 18px 1fr auto; align-items: start; gap: 6px; font-size: 13px; padding: 4px 4px; border-radius: 6px; cursor: pointer; line-height: 1.3; }
.facet-option:hover { background: var(--blue-soft); }
.facet-option input { margin: 2px 0 0; }
.facet-option.zero { color: var(--muted); }
.facet-count { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.year-range { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; }
.year-range select { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: white; min-width: 0; }
.filter-help { font-size: 11.5px; color: var(--muted); margin: 12px 0 0; }
.ghost-button { border: 1px solid var(--line); background: white; border-radius: 9px; padding: 9px 11px; font-weight: 700; font-size: 13px; color: var(--blue-dark); cursor: pointer; white-space: nowrap; }
.ghost-button:hover { background: var(--blue-soft); }
.result-meta { flex-wrap: wrap; }

.legal-note { background: #fff8ec; border: 1px solid #f1dcb7; color: #6b4b16; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px; }
.ai-card h3 { color: var(--ink); }
.table-wrap { overflow-x: auto; }
.sub-heading { font-size: 15px; margin: 22px 0 10px; }
.compact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.compact-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); padding-bottom: 8px; }
.compact-list li:last-child { border-bottom: 0; }
.compact-list a { font-weight: 800; text-decoration: none; }
.compact-list span { color: #465e70; }
.empty-state.flat { border: 0; padding: 20px; }

.detail-ref { display: block; margin-top: 16px; }
.doc-badges.spaced { margin: 12px 0; }
.detail-hero .doc-badges + .doc-badges { margin-top: 16px; }
a.badge { text-decoration: none; }
.meta-grid.one-col { grid-template-columns: 1fr; }
.mapping-mini { margin-top: 14px; }
.mapping-mini h3 { font-size: 13px; margin: 0 0 8px; }
.mapping-item { border: 1px solid var(--line); border-radius: 9px; padding: 11px; margin-bottom: 8px; }
.mapping-item .badge { margin-left: 6px; vertical-align: middle; }
.mapping-note { margin-top: 4px; color: #6b4b16; }
.harmonised-note { background: var(--blue-soft); border: 1px solid #c4dde7; color: var(--ink); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 18px; }
.strength-legend { margin: 12px 0 0; }
.family-node.current { border-color: var(--teal); background: var(--cyan-soft); }
.family-node small { color: var(--muted); }
.note-text { margin: 0; color: #496275; }
.source-list + .meta-grid { margin-top: 10px; }

.diff-panel { margin-bottom: 22px; }
.diff-panel h2 { margin-bottom: 14px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.diff-grid h3 { font-size: 14px; margin: 0 0 10px; }
.change-group { margin-bottom: 26px; }
.change-group > h2 { font-size: 19px; margin: 0 0 12px; }

.prose h2 { font-size: 19px; margin: 26px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose .mapping-table { margin: 8px 0 4px; }
.footer-meta a { color: rgba(255,255,255,.85); }

@media (max-width: 980px) {
  .filters { max-height: none; overflow: visible; }
  .diff-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .results-toolbar .ghost-button { flex: 1; }
  .kpi-card strong.kpi-date { font-size: 20px; }
}
@media print {
  .site-header, .filters, .results-toolbar, .pagination, .site-footer, .toast { display: none !important; }
  body { background: white; }
}
.bar-track, .bar-fill { display: block; }
.bar-row .label { display: block; }
.doc-card-top > .badge { white-space: nowrap; flex-shrink: 0; }

/* Na telefonu pokaži le šest najpogostejših področij; ostala so dosegljiva prek filtra. */
@media (max-width: 760px) {
  .topic-grid .quick-card:nth-child(n+7) { display: none; }
}

/* ---------- Povzetki vsebine (V4) ---------- */
.summary-section h3 { font-size: 14px; margin: 16px 0 6px; color: var(--ink); }
.summary-section h3:first-child { margin-top: 4px; }
.summary-body { font-size: 15px; line-height: 1.65; color: var(--ink-2); max-width: 72ch; }
.summary-body p { margin: 0 0 10px; }
.summary-body.format-strukturiran h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--teal-dark); }
.summary-meta { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); }
.summary-meta a { color: var(--blue-dark); overflow-wrap: anywhere; }
.format-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; padding: 8px; background: var(--blue-soft); border-radius: 10px; }
.format-switch-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-right: 4px; }
.format-switch button { border: 1px solid var(--line); background: white; color: var(--ink-2); border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 13px; cursor: pointer; }
.format-switch button.active { background: var(--ink); border-color: var(--ink); color: white; }
@media print { .format-switch { display: none; } }
