:root {
  --bg: #f6f5f1; --surface: #ffffff; --ink: #1c2230; --muted: #5d6677; --line: #e2e0d8; --accent: #2f6fdb; --accent-ink: #fff;
  --c-jls: #8e5bd1; --c-grad: #2f6fdb; --c-zup: #e8833a; --c-tv: #2a9d8f; --c-x: #8a8f9c; --hover: #f0eee7; --warn-bg: #fff6e0; --warn-ink: #6b4a00;
  --radius: 10px; --shadow: 0 1px 2px rgba(20,24,40,.06), 0 4px 14px rgba(20,24,40,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171d; --surface: #1c2029; --ink: #e8eaf0; --muted: #9aa3b5; --line: #2c3240; --accent: #6b9bf2; --accent-ink: #0d1117;
    --c-jls: #b390f0; --c-grad: #6b9bf2; --c-zup: #f0a066; --c-tv: #4cc2b2; --c-x: #8a8f9c; --hover: #242a36; --warn-bg: #3a3118; --warn-ink: #f0d58a;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.45; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 1.5rem; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 0 0 8px; }
p { margin: 0 0 8px; }
a { color: var(--accent); }
.top { background: var(--surface); border-bottom: 1px solid var(--line); padding-top: 18px; }
.brand p { color: var(--muted); margin-bottom: 12px; }
#tabs { display: flex; gap: 2px; overflow-x: auto; }
#tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer; white-space: nowrap; }
#tabs button:hover { color: var(--ink); }
#tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

.filters { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 0 8px; z-index: 20; }
@media (min-height: 820px) { .filters { position: sticky; top: 0; } }
.f-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 8px; }
.f-group { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.f-group.grow { flex: 1 1 220px; }
.f-group label, .check { font-size: .78rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 6px; padding-bottom: 7px; cursor: pointer; }
select, input[type=search], input[type=text], input[type=number] { font: inherit; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); min-width: 0; }
select:focus, input:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .82rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip.on { color: var(--ink); border-color: var(--ink); background: var(--surface); }
.chip:not(.on) i { opacity: .35; }
.chip.sep { border: 0; background: none; cursor: default; padding: 3px 2px; color: var(--line); }
button.ghost, button.btn { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.ghost:hover, button.btn:hover { background: var(--hover); }
button.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.f-sum { color: var(--muted); font-size: .85rem; }
.f-sum b { color: var(--ink); }

main { padding-top: 18px; padding-bottom: 60px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 900px) { .g2, .g3, .g4, .g-main { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .v { font-size: 1.6rem; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .82rem; }
.kpi .s { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.chart { width: 100%; height: 320px; }
.chart.tall { height: 460px; }
.chart.sm { height: 240px; }
.note { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 9px 12px; font-size: .86rem; margin-bottom: 14px; }
.muted { color: var(--muted); }
.row-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.row-h h2, .row-h h3 { margin: 0; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 6px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .78rem; white-space: nowrap; user-select: none; position: sticky; top: 0; background: var(--surface); }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--ink); }
th .arr { opacity: .8; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: var(--hover); }
tr.click { cursor: pointer; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--muted); font-size: .85rem; gap: 10px; flex-wrap: wrap; }
.pager .btns { display: flex; gap: 6px; }
.tag { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.bar { height: 6px; border-radius: 3px; background: var(--accent); opacity: .75; min-width: 1px; }
.cell-bar { display: flex; flex-direction: column; gap: 2px; min-width: 90px; }
.name-cell b { font-weight: 600; }
.name-cell small { display: block; color: var(--muted); font-size: .76rem; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

.drawer { position: fixed; inset: 0 0 0 auto; width: min(760px, 100vw); transform: translateX(105%); transition: transform .22s ease; z-index: 40; background: var(--bg); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.18); overflow-y: auto; }
.drawer.open { transform: none; }
.drawer-in { padding: 18px 18px 40px; position: relative; }
.close { position: absolute; top: 8px; right: 12px; font-size: 1.8rem; line-height: 1; background: none; border: 0; color: var(--muted); cursor: pointer; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; display: none; }
.scrim.on { display: block; }
.loading { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 100; color: var(--muted); }
.loading.hide { display: none; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: .88rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--muted); margin-bottom: 8px; }


@media (max-width: 700px) {
  .brand p { display: none; }
}

.foot { color: var(--muted); font-size: .8rem; padding-bottom: 40px; }
.foot p { max-width: 900px; }

.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.srcbar { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.srcbtns { display: inline-flex; gap: 5px; margin-left: 6px; flex-wrap: wrap; }
.srcpanel { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; max-height: 190px; overflow: auto; }
.srcpanel[hidden] { display: none; }
.chip.partial { color: var(--ink); border-style: dashed; border-color: var(--ink); background: var(--surface); }
.chip.partial i { opacity: .65; }
.chip.empty { font-style: italic; opacity: .7; }
.ghost-chip { background: none; border-style: dotted; }

.srcpanel { align-content: flex-start; align-items: flex-start; }
.srcpanel .chip, .srcbar .chip { align-self: flex-start; flex: 0 0 auto; }
.chip.empty { padding: 3px 10px; text-align: left; opacity: .7; border-style: dotted; }

/* navigacija po cjelinama */
.brand-row{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:4px}
.gsearch{position:relative;flex:0 1 360px;min-width:220px}
.gsearch input{width:100%;font-size:.95rem;padding:8px 12px;border-radius:999px}
.gs-res{position:absolute;right:0;left:0;top:calc(100% + 4px);background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);z-index:60;max-height:60vh;overflow:auto}
.gs-res a{display:block;padding:8px 12px;color:var(--ink);text-decoration:none;border-bottom:1px solid var(--line);font-size:.88rem;cursor:pointer}
.gs-res a:hover{background:var(--hover)} .gs-res small{display:block;color:var(--muted);font-size:.76rem}
.gs-res .none{padding:10px 12px;color:var(--muted);font-size:.86rem}
.groups{display:flex;gap:6px;flex-wrap:wrap;margin:4px 0 0}
.groups button{border:1px solid var(--line);background:var(--bg);color:var(--muted);font:inherit;font-weight:600;border-radius:999px;padding:6px 16px;cursor:pointer}
.groups button.on{background:var(--ink);color:var(--surface);border-color:var(--ink)}
.groups button:hover:not(.on){color:var(--ink)}
#tabs{margin-top:6px}
#tabs button{padding:8px 12px;font-size:.92rem}
.tabhelp{color:var(--muted);font-size:.86rem;margin:2px 0 8px}
.star{cursor:pointer;color:var(--muted);font-size:1.05rem;background:none;border:0;padding:0 4px;line-height:1}
.star.on{color:#e0a100}
.lead{color:var(--muted);margin:0 0 12px;max-width:90ch}
@media (max-width:700px){.groups button{padding:5px 11px;font-size:.88rem}.tabhelp{display:none}}

/* animacija učitavanja */
.ld{text-align:center;width:min(360px,86vw)}
.ld-ring{width:46px;height:46px;margin:0 auto 14px;border-radius:50%;border:4px solid var(--line);border-top-color:var(--accent);animation:ldspin .9s linear infinite}
.ld-t{font-weight:600;color:var(--ink);margin-bottom:10px;font-variant-numeric:tabular-nums}
.ld-bar{height:6px;border-radius:3px;background:var(--line);overflow:hidden}
.ld-bar i{display:block;height:100%;width:3%;background:var(--accent);border-radius:3px;transition:width .2s ease}
.ld-s{margin-top:10px;font-size:.82rem;color:var(--muted)}
@keyframes ldspin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.ld-ring{animation-duration:3s}}

.f-sum.on { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 6px 10px; }
.f-sum.on b { color: inherit; }
.f-sum .badge { background: var(--c-zup); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .04em; }
.f-sum button.ghost { padding: 2px 10px; font-size: .8rem; }

/* kompaktni filteri */
.f-top { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.f-top input { flex: 1 1 auto; }
#f-toggle.act { border-color: var(--c-zup); }
#f-toggle .cnt { font-weight: 700; color: var(--c-zup); }
#f-more { margin-top: 6px; }
#f-more[hidden] { display: none; }
.gtools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
/* rječnik */
.q { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: .68rem; font-weight: 700; cursor: help; vertical-align: middle; margin-left: 3px; line-height: 1; }
.q:hover, .q:focus-visible { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
#tip { position: absolute; z-index: 200; background: var(--ink); color: var(--bg); padding: 8px 11px; border-radius: 8px; font-size: .82rem; line-height: 1.4; box-shadow: var(--shadow); }
#tip[hidden] { display: none; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: .86rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 300; max-width: 92vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
/* brzi start */
.qs-head h2 { margin-bottom: 2px; } .qs-head p { margin-bottom: 10px; }
.qs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.qs-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.qs-card:hover, .qs-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.qs-card .ic { font-size: 1.4rem; line-height: 1; } .qs-card b { font-size: 1rem; } .qs-card .muted { font-size: .84rem; } .qs-card small { color: var(--accent); margin-top: 4px; font-size: .78rem; }
.qs-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.note.neutral { background: var(--hover); color: var(--ink); }
.ins { display: flex; flex-wrap: wrap; gap: 8px; }
.ins-chip { display: flex; flex-direction: column; gap: 1px; background: var(--hover); border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; text-decoration: none; color: var(--ink); font-size: .85rem; max-width: 100%; }
a.ins-chip:hover { border-color: var(--accent); } .ins-chip small { color: var(--muted); }
@media (max-width: 900px) { .qs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .qs-grid { grid-template-columns: 1fr; } }
/* mobitel: tablice kao kartice */
@media (max-width: 700px) {
  .brand-row { flex-direction: column; align-items: stretch; }
  .gtools { justify-content: stretch; } .gsearch { flex: 1 1 100%; }
  .tbl-wrap { overflow: visible; }
  .tbl-wrap table, .tbl-wrap tbody, .tbl-wrap tr, .tbl-wrap td { display: block; width: 100%; }
  .tbl-wrap thead { display: none; }
  .tbl-wrap tr { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin-bottom: 10px; background: var(--surface); }
  .tbl-wrap td { display: flex; justify-content: space-between; gap: 12px; text-align: right; border: 0; border-bottom: 1px dashed var(--line); padding: 5px 0; }
  .tbl-wrap td:last-child { border-bottom: 0; }
  .tbl-wrap td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; text-align: left; flex: 0 0 38%; padding-top: 2px; }
  .tbl-wrap td.num { text-align: right; } .tbl-wrap td > * { text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .tbl-wrap td .name-cell { text-align: left; }
  .tbl-wrap td:first-child { font-weight: 600; }
  #tabs { flex-wrap: nowrap; }
}
@media (max-width: 700px) { .gtools { flex-wrap: nowrap; } #share .lbl { display: none; } #share { padding: 8px 12px; } .brand h1 { font-size: 1.25rem; } .gsearch { min-width: 0; } }
