/* Skupni gradniki videza (glej docs/oblikovanje.md). Barve samo iz spremenljivk v style.css.
   Nove dele aplikacije sestavi iz teh gradnikov, ne iz novih različic istega. */

/* ---------- spustni meni (dropdown.js zamenja vsak <select>) ---------- */
.dd { position: relative; display: inline-flex; min-width: 0; max-width: 100%; }
.dd > select { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dd-btn {
  display: flex !important; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px 9px 14px !important;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-weight: 700; text-align: start; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.dd-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.dd-btn:disabled { opacity: 0.55; cursor: default; }
.dd-btn.placeholder .dd-label { color: var(--muted); font-weight: 600; }
.dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { flex: none; width: 20px !important; height: 20px !important; margin: 0 !important; fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.18s; }
.dd.open .dd-btn { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.dd.open .dd-chev { transform: rotate(180deg); }

.dd-list {
  position: fixed; z-index: 300; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; outline: none;
  animation: dd-in 0.14s ease; transform-origin: top center;
}
.dd-list.up { transform-origin: bottom center; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 700; color: var(--text); line-height: 1.3;
}
.dd-opt.active { background: var(--surface-2); }
.dd-opt[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.dd-opt[aria-disabled="true"] { color: var(--muted); opacity: 0.6; cursor: default; }
.dd-check { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.dd-opt[aria-selected="true"] .dd-check { visibility: visible; }
.dd-group {
  padding: 10px 12px 4px; font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
}
.dd-group:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 12px; }
.dd-opt[hidden], .dd-group[hidden] { display: none; }
/* Iskalnik v dolgem seznamu (npr. jeziki) ostane na vrhu med pomikanjem. */
.dd-search { position: sticky; top: -6px; z-index: 1; margin: -6px -6px 4px; padding: 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.dd-search input { width: 100%; min-height: 40px; }
.dd-search + .dd-group { border-top: 0; margin-top: 0; }

/* Meni čez celo širino (učna pot, obrazci) */
.path-head .dd, .form label .dd, .form .dd { display: flex; width: 100%; }
.path-head .dd-btn { min-height: 50px; font-size: 1.02rem; font-weight: 800; }
.form .dd-btn { background: var(--bg); }

/* ---------- preklopnik (segmented control): .seg > button(.active) ---------- */
.seg {
  display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px;
}
.seg::-webkit-scrollbar { display: none; }
.seg > button {
  flex: 1 1 0; min-width: max-content; border: 0 !important; background: none !important; border-radius: 999px !important;
  padding: 8px 16px !important; min-height: 40px; font-weight: 800; color: var(--muted); white-space: nowrap;
  box-shadow: none; transition: background 0.15s, color 0.15s;
}
.seg > button:hover:not(.active) { color: var(--text); }
.seg > button.active { background: var(--surface) !important; color: var(--accent); box-shadow: var(--shadow); }

/* ---------- filtrirni žetoni: .chip-row > button(.active) ---------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row > a, .chip-row > button {
  flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px !important;
  border: 1.5px solid var(--border) !important; border-radius: 999px !important; background: var(--surface) !important;
  color: var(--text); font-weight: 700; font-size: 0.9rem; text-decoration: none; white-space: nowrap;
}
.chip-row > a:hover, .chip-row > button:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)) !important; }
.chip-row > a.active, .chip-row > button.active { border-color: var(--accent) !important; background: var(--accent-soft) !important; color: var(--accent); }

/* ---------- izbrana možnost (kartica / potrditveno polje) ---------- */
.lp-opt.on, label.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- povezava v obliki gumba ---------- */
a.btn-primary, a.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: var(--radius-sm); font-weight: 800; text-decoration: none;
}
a.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 var(--press) 0 color-mix(in srgb, var(--accent) 65%, #000); }
a.btn-primary:active { transform: translateY(calc(var(--press) * 0.66)); box-shadow: 0 calc(var(--press) / 3) 0 color-mix(in srgb, var(--accent) 65%, #000); }
a.btn-secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
a.btn-secondary:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
a.btn-secondary svg { color: var(--accent); }

@media (max-width: 760px) {
  .seg { display: flex; width: 100%; }
  .seg > button { padding: 8px 12px !important; }
  /* Gumbi na telefonu zapolnijo vrstico, da niso različno široki. */
  .actions > button, .actions > a.btn-primary, .actions > a.btn-secondary { flex: 1 1 auto; }
}

/* ---------- Nastavitve → Videz (appearance.js) ---------- */
.seg > button svg.i { width: 18px; height: 18px; margin-right: 6px; }
.seg > button { display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 480px) { .seg > button svg.i { display: none; } }
.ap-row { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.ap-row .actions { margin-top: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; min-height: 0 !important; padding: 0 !important;
  border-radius: 50% !important; border: 3px solid var(--surface) !important; background: var(--sw) !important; cursor: pointer;
  box-shadow: 0 0 0 1.5px var(--border); transition: transform 0.12s, box-shadow 0.12s; color: #fff;
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 3px var(--accent); }
.swatch.on::after {
  content: ""; width: 12px; height: 7px; border: solid #fff; border-width: 0 0 3px 3px; transform: translateY(-2px) rotate(-45deg);
}
.swatch.custom { background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #ef4444) !important; }
.swatch.custom.on { background: var(--sw) !important; }
.swatch.custom svg.i { width: 18px; height: 18px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.swatch.custom.on svg.i { display: none; }
.swatch input, .color-dot input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.color-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.form .color-row, .color-row {
  display: flex; flex-direction: row; align-items: center; gap: 12px; min-height: 52px; padding: 6px 8px 6px 8px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-weight: 700;
}
.color-row:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.color-dot { position: relative; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--sw); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.12); }
.color-name { flex: 1; }
.color-row button.ghost { min-height: 36px; padding: 6px !important; }

/* ---------- seznam povezav: .list-card > button.list-row ---------- */
.list-card { padding: 6px; }
.list-row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 12px !important;
  border: 0 !important; background: none !important; border-radius: var(--radius-sm) !important; text-align: start; color: var(--text);
}
.list-row:hover { background: var(--surface-2) !important; }
.list-row + .list-row { border-top: 1px solid var(--border) !important; border-radius: 0 !important; }
.list-row .ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.list-row .ic svg.i { width: 22px; height: 22px; }
.list-row .lr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row .lr-text small { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.list-row > svg.i { color: var(--muted); }

/* ---------- Jaz (profil na telefonu) ---------- */
/* Kartica s profilom je gumb: odpre Nastavitve (šola in letnik, račun). */
.me-head { display: flex; align-items: center; gap: 16px; width: 100%; text-align: start; color: var(--text); font: inherit; cursor: pointer; }
.me-head:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.me-head:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.me-head > svg.i { flex: none; color: var(--muted); }
.me-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-name { font-size: 1.55rem; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.me-level { margin-top: 2px; }
.flash-target { animation: flash-target 1.6s ease; }
@keyframes flash-target { 0%, 40% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: var(--shadow); } }
.me-avatar {
  flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; color: #fff; font-size: 1.8rem; font-weight: 900;
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent);
}
.me-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.me-stats .card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; }
.me-stats .stat-ic { grid-row: 1 / 3; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); }
.me-stats .stat-ic svg.i { width: 22px; height: 22px; }
.me-stats .stat-ic.xp svg.i { color: var(--gold); fill: var(--gold); }
.me-stats .stat-ic.streak svg.i { color: #ff7a1a; fill: #ffb21a; }
.me-stats b { font-size: 1.35rem; font-weight: 900; line-height: 1.1; }
.me-stats span:last-child { font-size: 0.82rem; color: var(--muted); font-weight: 700; }

/* ---------- široki zasloni: več stolpcev, da je več informacij hkrati na pregledu ----------
   Enako na tablici ležeče (na dotik, od 1000 px); ožji stolpci zanjo so v touch.css. */
@media (min-width: 1200px), (min-width: 1000px) and (hover: none) and (pointer: coarse) {
  /* Učna pot: levo izbira, trening in načini (ostanejo vidni), desno sklopi in teme. */
  #view-path { max-width: 1320px; display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 0 28px; align-items: start; align-content: start; }
  /* Na nizkem zaslonu stolpec ne sme biti višji od okna, sicer zadnja kartica ni dosegljiva: dobi svoj drsnik. */
  #view-path > .path-side { position: sticky; top: 0; max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin: -6px; padding: 6px; }
  #view-path .hero { grid-template-columns: auto 1fr; }
  #view-path .hero button.primary { grid-column: 1 / -1; width: 100%; }
  #view-path .modes { grid-template-columns: 1fr; gap: 8px; }
  #view-path .modes button { flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; }
  #view-path .modes .ic { margin: 0; }
  #view-path .modes .m-name { flex: none; }
  #view-path .modes .m-sub { margin-inline-start: auto; text-align: end; }
  #path-content .unit { margin-bottom: 16px; }

  /* Tema: levo naloga, desno razlaga, ki ostane vidna med reševanjem. */
  #view-topic:has(.topic-grid) { max-width: 1400px; }
  body:not(.pad-open) .topic-grid {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "head expl" "practice expl"; grid-template-rows: auto 1fr;
    gap: 0 24px; align-items: start;
  }
  body:not(.pad-open) .topic-grid > .topic-head { grid-area: head; }
  body:not(.pad-open) .topic-grid > .explanation { grid-area: expl; position: sticky; top: 0; max-height: calc(100dvh - 150px); overflow-y: auto; }
  body:not(.pad-open) .topic-grid > #practice { grid-area: practice; }
  body:not(.pad-open) .topic-grid > #practice > .task:first-child { margin-top: 0; }

  /* Serija nalog (trening, ponavljanje …): desno razlaga teme trenutne naloge. */
  #view-topic:has(.session-grid > aside:not([hidden])) { max-width: 1400px; }
  body:not(.pad-open) .session-grid:has(> aside:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
  .session-grid > aside { position: sticky; top: 0; max-height: calc(100dvh - 150px); overflow-y: auto; }

  /* Lekcija: besedilo levo, poskusi desno (pritrjeni, da so vidni med branjem). */
  #view-textbook:has(.tb-lesson-grid.has-side) { max-width: 1440px; }
  .tb-lesson-grid.has-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 560px); gap: 0 28px; align-items: start; }
  .tb-lesson-grid.has-side .tb-side { position: sticky; top: 0; max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
  .tb-side .demo-values { grid-template-columns: 1fr 1fr; }
  .tb-lesson-grid.has-side .tb-side .demo-svg { max-width: 100%; max-height: 46dvh; width: auto; display: block; margin: 0 auto; }

  /* Kazalo učbenika: sklopi v dveh stolpcih. */
  #view-textbook:not(:has(.tb-lesson-grid)) { max-width: 1240px; }
  .tb-part { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
  .tb-part > .tb-part-head { grid-column: 1 / -1; }

  /* Ostale strani s karticami: dva stolpca. */
  #view-progress, #view-league, #view-competition { max-width: 1240px; }
  #view-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; align-content: start; }
  #view-progress > h1 { grid-column: 1 / -1; }
}
@media (min-width: 1700px) {
  /* Zelo širok zaslon: razlaga ostane ob nalogi tudi, ko je odprta plošča za vnos. */
  body.pad-open .topic-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "head expl" "practice expl"; grid-template-rows: auto 1fr; gap: 0 24px; align-items: start;
  }
  body.pad-open .topic-grid > .topic-head { grid-area: head; }
  body.pad-open .topic-grid > .explanation { grid-area: expl; position: sticky; top: 0; max-height: calc(100dvh - 150px); overflow-y: auto; }
  body.pad-open .topic-grid > #practice { grid-area: practice; }
}
@media (min-width: 1700px) { body.pad-open #view-topic > #topic-content:has(.topic-grid) { max-width: 1300px; } }
/* Razlaga ob seriji nalog je samo za široke zaslone (na telefonu bi bila predolga). */
@media (max-width: 999px), (max-width: 1199px) and (hover: hover), (max-width: 1199px) and (pointer: fine) { #session-side { display: none !important; } }
body.pad-open #session-side { display: none !important; }
@media (min-width: 1700px) {
  body.pad-open #session-side:not([hidden]) { display: block !important; }
  body.pad-open .session-grid:has(> aside:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
  body.pad-open #view-topic > #topic-content:has(.session-grid > aside:not([hidden])) { max-width: 1300px; }
}

/* ---------- izbira jezika (language.js) ---------- */
.lang-field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.lang-field .dd { display: flex; width: 100%; }
.lang-field .dd-btn { background: var(--bg); }
.lang-field .i { width: 18px; height: 18px; vertical-align: -3px; }
.onb-lang { margin: 4px 0 2px; }
.lang-ui-note { margin: 6px 0 0; }
/* Od desne proti levi (arabščina, perzijščina, urdujščina): puščice nazaj/naprej kažejo v smer branja.
   Izjemi: tipka kazalca v kalkulatorju (izraz je vedno od leve proti desni) in zasukana puščica napredovanja v ligi. */
[dir="rtl"] svg.i-dir { transform: scaleX(-1); }
[dir="rtl"] .gc-key svg.i-dir, [dir="rtl"] .zone-mark svg.i-dir { transform: none; }

/* ---------- Šolski sistem (regijski profili) ---------- */
.system-field { margin-bottom: 8px; }

/* ---------- Brez povezave ---------- */
.offline-banner { border-radius: var(--radius-sm); margin: 0 0 12px; padding: 9px 12px; }
.offline-banner .i { width: 18px; height: 18px; flex: none; }

/* ---------- Lahki način (varčevanje s podatki, šibki telefoni) ----------
   Sistemska pisava (spletna se ne prenese), brez animacij, senc in zamegljevanja. */
html.lite body,
html.lite .fig text,
html.lite .fig .nums text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
html.lite *,
html.lite *::before,
html.lite *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.lite .card,
html.lite .topbar,
html.lite .tabs { box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

/* ---------- Slogi (Nastavitve → Videz → Slog; theme.js nastavi data-style na <html>) ----------
   Čist je privzeti (style.css :root). Igriv: Nunito, bolj zaobljen, »pritisnjeni« gumbi s spodnjo senco.
   Temen: IBM Plex Sans, vedno temen, ostrejši robovi. Barve slogov izračuna theme.js. */
:root[data-style="igriv"] {
  --font: "Nunito Variable", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 22px;
  --radius-sm: 14px;
  --press: 3px;
  --shadow: 0 4px 0 rgba(31, 26, 46, 0.07);
}
:root.dark[data-style="igriv"] { --shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
:root[data-style="temen"] {
  --font: "IBM Plex Sans Variable", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: none;
}
/* Čist in Temen: brez prelivov in senc pod logotipom in kartico Današnji trening. */
:root:not([data-style="igriv"]) .logo { box-shadow: none; }
:root:not([data-style="igriv"]) h1, :root:not([data-style="igriv"]) h2 { font-weight: 700; }

/* Izbira sloga v Nastavitve → Videz */
.style-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.style-card { display: flex !important; justify-content: flex-start !important; align-items: center; gap: 12px; text-align: start; padding: 12px 14px !important; min-height: 64px !important; }
.style-card.on { border-color: var(--accent) !important; background: var(--accent-soft) !important; }
.style-sw { display: flex; flex: none; }
.style-sw i { width: 18px; height: 30px; border: 1px solid var(--border); }
.style-sw i:first-child { border-radius: 8px 0 0 8px; }
.style-sw i:last-child { border-radius: 0 8px 8px 0; }
.style-txt { display: flex; flex-direction: column; line-height: 1.25; }
.style-txt b { font-size: 1.02rem; }
.style-txt small { color: var(--muted); font-weight: 500; }

/* ---------- Klikljive formule (public/formula-info.js) ---------- */
[data-fx][role="button"] { cursor: pointer; border-radius: 3px; box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--accent) 55%, transparent); background-image: none; }
[data-fx][role="button"]:hover, [data-fx].fx-open { background: var(--accent-soft); box-shadow: inset 0 -1.5px 0 var(--accent); }
[data-fx][role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fx-pop {
  position: absolute; z-index: 1200; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 12px 44px 12px 14px; font-size: 0.93rem; line-height: 1.45; display: grid; gap: 6px;
}
.fx-pop .fx-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; color: var(--accent); }
.fx-pop .fx-title b { color: var(--text); font-size: 1rem; }
.fx-pop .fx-title .katex { font-size: 1.25em; color: var(--accent); }
.fx-pop .fx-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fx-pop .fx-k { color: var(--muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; min-width: 62px; }
.fx-pop .fx-un, .fx-pop .fx-sub span { color: var(--muted); }
.fx-pop .fx-sub { padding-left: 70px; font-size: 0.9rem; }
.fx-pop .fx-note { color: var(--muted); font-size: 0.88rem; border-top: 1px solid var(--border); padding-top: 6px; }
.fx-pop .fx-close { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; min-height: 34px !important; padding: 0 !important; border: 0 !important; background: none !important; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.fx-pop .fx-close:hover { color: var(--text); background: var(--surface-2) !important; }
@media (max-width: 760px) { .fx-pop .fx-sub { padding-left: 0; } }

/* ---------- Cilj in opomnik (public/goal.js) ---------- */
.goal-field .goal-box, #settings-goal { display: grid; gap: 10px; margin-top: 8px; }
.goal-chips { flex-wrap: wrap; }
.goal-date-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.goal-date { display: grid; gap: 6px; }
.goal-date input[type="date"] { min-height: 44px; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.goal-countdown { margin: 0; color: var(--accent); font-weight: 700; min-height: 1.2em; }
.goal-countdown:empty { display: none; }
.goal-reminder-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.goal-reminder-row .gr-text { display: grid; gap: 2px; }
/* Stikalo (vklop/izklop): <button class="switch" role="switch" aria-checked> */
.switch { flex: none; position: relative; width: 52px !important; height: 30px; min-height: 30px !important; padding: 0 !important; border: 0 !important; border-radius: 999px !important; background: var(--border) !important; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch[aria-checked="true"] { background: var(--accent) !important; }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.goal-line { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 8px; margin: 0 0 12px; font-weight: 700; line-height: 1.35; }
.goal-line .gl-ic { color: var(--accent); display: inline-flex; }
.goal-line .gl-edit { margin: 0; padding: 4px 0; font-size: 0.92rem; }
.goal-reminder { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; border: 1.5px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--accent-soft); }
.goal-reminder .gr-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-text); }
.goal-reminder .gr-body { flex: 1; display: grid; gap: 4px; min-width: 0; }
.goal-reminder .gr-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.goal-reminder .actions { margin-top: 6px; }
.goal-card { display: grid; gap: 12px; }
.goal-card .goal-line { margin: 0; }
.goal-card .goal-reminder { margin: 0; padding: 12px; border-radius: var(--radius-sm); }
.goal-chip { border: 0; cursor: pointer; color: var(--warm); background: color-mix(in srgb, var(--warm) 12%, var(--surface)); }
.goal-chip b { color: var(--text); font-weight: 700; }
@media (max-width: 1439px) { .goal-chip { display: none !important; } }
@media (max-width: 760px) {
  .goal-reminder-row { align-items: flex-start; }
  .goal-date-row > * { flex: 1 1 100%; }
  .goal-line { font-size: 0.95rem; }
  .goal-reminder .actions { flex-wrap: nowrap; }
  .goal-reminder .actions button.ghost { flex: none !important; width: auto !important; }
}

/* Strežnik ni dosegljiv ob odprtju (public/app.js bootFailed) */
.boot-down { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.boot-down .card { max-width: 360px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.boot-down .card svg { width: 40px; height: 40px; color: var(--muted, #8b949e); }
.boot-down p { margin: 0; }
/* prazna aplikacija pod sporočilom: ne sprejme fokusa (Tab) in je bralnik zaslona ne bere */
body:has(> #boot-down) > :not(#boot-down) { visibility: hidden; }
