/* ============================================================
   NESYLAB — Base styles v2.0
   Shared chrome, theme toggle, new logo mark
   ============================================================ */

/* ============================================================
   nesylab — base.css
   Reset, app shell, chrome, focus, scrollbar + temeljne komponente.
   PISAVE: naloži brand/fonts/fonts.css (self-host) PRED tokens.css.
   Ta datoteka NE @import-a pisav — to je namerno (glej fonts/README.md):
   produkcija naj self-hosta, ne CDN.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin: 0;
  color: var(--fg);
  text-wrap: balance;
}
/* Default heading scale — prevents untargeted headings from collapsing
   to tiny UA defaults (h4/h5 were rendering ~13–16px). */
h1 { font-size: var(--fs-h1); }      /* 36px */
h2 { font-size: var(--fs-h2); letter-spacing: var(--tracking-snug); }  /* 28px */
h3 { font-size: var(--fs-h3); letter-spacing: var(--tracking-snug); }  /* 22px */
h4 { font-size: var(--fs-h4); letter-spacing: var(--tracking-snug); }  /* 18px */
h5 { font-size: var(--fs-body-lg); letter-spacing: 0; }                /* 16px */
h6 { font-size: var(--fs-body); letter-spacing: 0; }                   /* 14px */

p { margin: 0; color: var(--fg); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
hr { border: none; height: 1px; background: var(--border); }
mark {
  background: var(--highlight);
  color: var(--highlight-fg);
  padding: 0.05em 0.28em;
  border-radius: var(--radius-xs);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ============================================================
   PROSE — long-form content typography (articles, docs, help).
   Lives in base.css so it works on every page (foundations.html
   and some brand pages do NOT load components.css). SCOPED on
   purpose: wrap rich text in .prose so component-internal lists
   (pricing, menus, sidebars) keep their list-style:none reset.
   ============================================================ */
.prose {
  color: var(--fg-muted);
  font-size: var(--fs-body-lg);
  line-height: 1.7;
  max-width: var(--measure);
  text-wrap: pretty;
}
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3, .prose h4 { color: var(--fg); line-height: var(--leading-snug); }
.prose h2 { font-size: var(--fs-h3); margin-top: 1.7em; }
.prose h3 { font-size: var(--fs-h4); margin-top: 1.5em; }
.prose h4 { font-size: var(--fs-body-lg); margin-top: 1.3em; }
.prose p { color: var(--fg-muted); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose em { font-style: italic; }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 42%, transparent);
  transition: text-decoration-color var(--dur-fast) var(--ease-out);
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-inline-start: 1.5em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--primary); }
.prose ol > li::marker { color: var(--fg-subtle); font-family: var(--font-mono); font-size: 0.9em; }
.prose li > ul, .prose li > ol { margin-top: 0.45em; }
.prose blockquote {
  margin: 0;
  padding: 2px 0 2px 18px;
  border-inline-start: 3px solid var(--primary);
  color: var(--fg);
}
.prose blockquote p { color: var(--fg); }
.prose code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: var(--tint-2); color: var(--fg);
  padding: 1px 6px; border-radius: var(--radius-xs);
}
.prose hr { margin: 1.7em 0; }
.prose img { border-radius: var(--radius-md); border: 1px solid var(--border); max-width: 100%; }

/* ============================================================
   CHIP — single source of truth (filter pill + choice variant).
   Default = pill (filters/tags, optional ✕ remove).
   .chip.choice = rectangular, for single-select pickers.
   Scoped overrides (.shop-toolbar .chip, .dv-cat .sw) are separate.
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--fg);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip.choice { border-radius: var(--radius-sm); font-weight: 500; color: var(--fg-muted); }
.chip.choice:hover { color: var(--fg); }
.chip.choice.active { color: var(--primary); }

/* ============================================================
   MODAL (dialog) + form fields + action buttons.
   Single source of truth — used by callout/form modals.
   ============================================================ */
.cm-scrim {
  position: fixed; inset: 0; background: var(--bg-overlay);
  display: none; align-items: center; justify-content: center;
  padding: 24px; z-index: var(--z-modal);
}
.cm-scrim.open { display: flex; }
.cm-box {
  width: min(560px, 94vw); background: var(--bg-raised);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); overflow: hidden;
}
.cm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.cm-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.cm-head .cl {
  background: none; border: 0; color: var(--fg-subtle); cursor: pointer;
  padding: 4px; border-radius: var(--radius-sm); display: inline-flex;
}
.cm-head .cl:hover { color: var(--fg); background: var(--tint-2); }
.cm-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.cm-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}

/* form field (label + input) */
.ff { display: flex; flex-direction: column; gap: 7px; }
.ff label { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--fg); }
.ff label .opt { font-weight: 400; color: var(--fg-subtle); }
.ff input, .ff textarea, .ff select {
  font-family: var(--font-body); font-size: 14px; padding: 11px 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--fg); width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.ff input::placeholder, .ff textarea::placeholder { color: var(--fg-subtle); }
.ff input:focus, .ff textarea:focus, .ff select:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--shadow-ring);
}
.ff input:disabled, .ff textarea:disabled, .ff select:disabled {
  background: var(--bg-sunken); color: var(--fg-subtle);
  -webkit-text-fill-color: var(--fg-subtle);
  border-color: var(--border); cursor: not-allowed;
}
.ff input:read-only:not(:disabled), .ff textarea:read-only:not(:disabled) {
  background: var(--bg-sunken); border-color: var(--border);
}
.ff input:read-only:not(:disabled):focus, .ff textarea:read-only:not(:disabled):focus {
  border-color: var(--border-strong); box-shadow: none;
}

/* action button (modal/toolbar) — ghost default, .primary = full mint */
.ac-btn {
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-elevated); color: var(--fg); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.ac-btn:hover { border-color: var(--primary); color: var(--primary); }
.ac-btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.ac-btn.primary:hover { background: var(--primary-hover); color: var(--primary-fg); }

/* ============================================================
   LOGO — adaptivni lockup (temeljna brand chrome, zato v base.css
   → na voljo vsem stranem). Potez (.arch) = currentColor (sledi
   temi/kontekstu), vozel (.node) = --primary. Tri oblike:
     .logo            → znak + napis (privzeto)
     .logo.mark-only  → samo znak
     .logo.word-only  → samo napis
   Velikost: .sm/.md/.lg/.xl ali inline font-size. Na barvni
   podlagi (mint/indigo/gradient) dodaj .on-brand; enobarvno .mono.
   ============================================================ */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  color: var(--fg);
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.logo__mark { width: 1.6em; height: 1.6em; flex: none; display: block; overflow: visible; }
.logo__mark .arch { stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; fill: none; }
.logo__mark .node { fill: var(--primary); }
.logo__word { font-family: var(--font-display); font-weight: 600; font-size: 1.3em; letter-spacing: -0.045em; color: currentColor; }
.logo.mark-only { gap: 0; }
.logo.mark-only .logo__word { display: none; }
.logo.word-only .logo__mark { display: none; }
.logo.sm { font-size: 14px; }
.logo.md { font-size: 20px; }
.logo.lg { font-size: 30px; }
.logo.xl { font-size: 46px; }
.logo.on-brand { color: var(--primary-fg); }
.logo.on-brand .logo__mark .node { fill: var(--primary-fg); }
.logo.mono .logo__mark .node { fill: currentColor; }

/* ============================================================
   INSPEKTOR BACKLINK — „Inspektor ↗" gumb, ki ga inspector-backlink.js
   vstavi v .section-head na izvornih straneh (obratna navezava vira).
   ============================================================ */
.ins-backlink {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: var(--tracking-wide);
  padding: 5px 10px; border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong); background: var(--bg-elevated);
  color: var(--fg-muted); text-decoration: none; white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.ins-backlink:hover { color: var(--primary); border-color: var(--primary); }
.ins-backlink svg { width: 13px; height: 13px; }
.section-head .ins-backlink { margin-top: 2px; }

/* ============================================================
   DROPDOWN / CONTEXT MENU (.dd) — single source of truth.
   240px panel, radius-md, shadow-lg; items radius-sm with tint hover.
   ============================================================ */
.dd {
  width: 240px; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 6px;
}
.dd__title {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-subtle); padding: 8px 10px 5px;
}
.dd__item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--fg);
  font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
}
.dd__item:hover { background: var(--tint-2); }
.dd__item svg { width: 16px; height: 16px; color: var(--fg-subtle); flex: none; }
.dd__item.danger { color: var(--danger); }
.dd__item.danger svg { color: var(--danger); }
.dd__kbd { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); }
.dd__sep { height: 1px; background: var(--border); margin: 4px 0; }
.dd__check { margin-left: auto; color: var(--primary); }

/* ============================================================
   MENU ANCHOR + ICON TRIGGER — kebab (⋮) / meatball (⋯) / hamburger (☰).
   Sprožilec [data-menu] odpre .dd znotraj iste .menu-anchor (js/menu.js).
   Panel privzeto poravnan na inline-end; .start = inline-start (RTL-varno).
   ============================================================ */
.menu-anchor { position: relative; display: inline-flex; }
.menu-anchor > .dd {
  position: absolute; inset-block-start: calc(100% + 6px); inset-inline-end: 0;
  z-index: var(--z-popover); display: none;
}
.menu-anchor > .dd.start { inset-inline-start: 0; inset-inline-end: auto; }
.menu-anchor[data-open="true"] > .dd {
  display: block; animation: ddIn var(--dur-fast) var(--ease-out);
}
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .menu-anchor[data-open="true"] > .dd { animation: none; } }

.icon-trigger {
  width: 38px; height: 38px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--fg); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.icon-trigger:hover { border-color: var(--primary); color: var(--primary); }
.icon-trigger svg { width: 18px; height: 18px; }
.icon-trigger.ghost { border-color: transparent; background: transparent; }
.icon-trigger.ghost:hover { background: var(--tint-2); color: var(--fg); }
.menu-anchor[data-open="true"] > .icon-trigger,
.icon-trigger[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }

code, kbd, .mono {
  font-family: var(--font-mono);
  font-feature-settings: "ss01", "cv01";
}

::selection { background: var(--primary); color: var(--primary-fg); }

/* ============================================================
   FOCUS — visible keyboard ring on every interactive element.
   :focus-visible fires only for keyboard / programmatic focus, so
   mouse users don't get a ring. :where() keeps specificity at 0 so
   component-specific focus styles still win. The transparent outline
   keeps focus visible in Windows High-Contrast (forced-colors) mode,
   where box-shadow is dropped.
   ============================================================ */
:where(a, button, input, select, textarea, summary,
  [role="button"], [role="link"], [role="tab"], [role="menuitem"],
  [role="switch"], [role="checkbox"], [role="radio"], [tabindex]):focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--shadow-ring);
}
/* Kill the UA outline that would otherwise show on mouse click */
:focus:not(:focus-visible) { outline: none; }

@media (forced-colors: active) {
  :where(a, button, input, select, textarea, summary,
    [role="button"], [tabindex]):focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}

/* ============================================================
   A11Y — skip-link + vizualno skrita live regija (js/a11y.js).
   .nl-skip se pokaže ob fokusu (prva Tab postaja); .nl-sr je
   za bralnike (aria-live napovedniki), vizualno odstranjena.
   ============================================================ */
.nl-skip {
  position: fixed; inset-inline-start: 12px; top: -60px; z-index: var(--z-tooltip);
  background: var(--primary); color: var(--primary-fg);
  font-family: var(--font-body); font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  text-decoration: none; transition: top var(--dur-fast) var(--ease-out);
}
.nl-skip:focus-visible { top: 12px; outline: 2px solid var(--primary-fg); outline-offset: 2px; }
.nl-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ============================================================
   FORCED-COLORS (Windows High-Contrast) — ohrani obliko kontrol.
   V tem načinu OS prepiše barve in sence izginejo, zato lahko
   gumbi/polja/kartice „splavajo“ v ozadje. Damo jim sistemsko
   obrobo (CanvasText), da ostanejo razločni. Brand fill pustimo
   sistemu (forced-color-adjust ostane auto).
   ============================================================ */
@media (forced-colors: active) {
  .btn, .input, .textarea, .select-wrap select, .ff input, .ff textarea,
  .ac-btn, .chip, .badge, .card, .ds-card, .ins-card,
  .cm-box, .drawer, .popover, .menu, .dd, .toast {
    border: 1px solid CanvasText;
  }
}

/* ============================================================
   SCROLLBARS — themed, vertical + horizontal. Thin track-less
   look; thumb uses border padding so it reads slim and rounds.
   Firefox uses scrollbar-width/color; WebKit/Blink the pseudo
   elements. Components that opt out (carousels, tab strips) set
   their own scrollbar-width:none locally.
   ============================================================ */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 3px solid var(--bg);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--fg-subtle); background-clip: padding-box; }
*::-webkit-scrollbar-thumb:active { background: var(--fg-muted); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* ============================================================
   PAGE
   ============================================================ */

.ds-page {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 100% -10%, var(--primary-soft), transparent 60%),
    var(--bg);
}

/* ============================================================
   TOPBAR
   ============================================================ */

.ds-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: saturate(140%) blur(var(--blur-lg));
  -webkit-backdrop-filter: saturate(140%) blur(var(--blur-lg));
}

.ds-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-snug);
  font-size: 16px;
  color: var(--fg);
}
.ds-topbar .brand svg { display: block; }

.ds-topbar nav {
  display: flex;
  gap: 2px;
  font-size: 13px;
}
.ds-topbar nav a {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
}
.ds-topbar nav a:hover { background: var(--tint-2); color: var(--fg); }
.ds-topbar nav a.active { color: var(--fg); background: var(--tint-2); }

.ds-topbar .right { display: flex; align-items: center; gap: 12px; }
.ds-topbar .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-wide);
  color: var(--fg-subtle);
  text-transform: uppercase;
}

/* Theme toggle button */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.theme-toggle:hover { border-color: var(--border-strong); background: var(--tint-2); }
/* LTR/RTL toggle — sits beside the theme toggle */
.dir-toggle {
  height: 34px; padding: 0 11px; gap: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg-muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.dir-toggle:hover { border-color: var(--border-strong); background: var(--tint-2); color: var(--fg); }
.dir-toggle[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.dir-toggle svg { flex: none; }
.theme-toggle svg { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease-out); }
.theme-toggle .sun, .theme-toggle .moon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-base) var(--ease-spring), opacity var(--dur-base) var(--ease-out);
}
.theme-toggle .sun { opacity: 0; transform: rotate(-90deg) scale(0.4); }
.theme-toggle .moon { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle .sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle .moon { opacity: 0; transform: rotate(90deg) scale(0.4); }

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-head {
  max-width: var(--container);
  margin: 0 auto;
  padding: 88px 32px 56px;
}
.page-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-head .eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--primary);
  display: inline-block;
}
.page-head h1 {
  font-size: clamp(44px, 6vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
}
.page-head .lede {
  font-size: 19px;
  color: var(--fg-muted);
  max-width: 64ch;
  line-height: 1.55;
}

/* ============================================================
   SECTION
   ============================================================ */

.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 56px 32px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 84px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: 32px;
  letter-spacing: -0.025em;
}
.section-head .kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.section-head .desc { color: var(--fg-muted); max-width: 52ch; margin-top: 6px; }

/* ============================================================
   PRIMITIVES
   ============================================================ */

.ds-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.dot-grid {
  background-image: radial-gradient(circle at 1px 1px, var(--tint-2) 1px, transparent 0);
  background-size: 24px 24px;
}

/* ============================================================
   FOOT
   ============================================================ */

footer.ds-foot {
  max-width: var(--container);
  margin: 96px auto 40px;
  padding: 28px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: 16px;
}

footer.ds-foot .left, footer.ds-foot .right { display: flex; gap: 24px; align-items: center; }

/* ============================================================
   BRAND GLYPH — single source of truth
   Drop in any page with: <span class="brand-mark"></span>
   ============================================================ */

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  position: relative;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }

/* Sizes */
.brand-mark.sm { width: 18px; height: 18px; }
.brand-mark.md { width: 26px; height: 26px; }
.brand-mark.lg { width: 40px; height: 40px; }
.brand-mark.xl { width: 64px; height: 64px; }

/* ============================================================
   LIGHT THEME — extra energy
   Lime stays vivid as FILLS + ambient washes; text-lime stays deep.
   ============================================================ */

/* Livelier page background: layered lime+violet washes over a tinted paper canvas,
   plus an always-present faint lime dot texture so it never reads as flat white */
[data-theme="light"] .ds-page {
  background:
    radial-gradient(1000px 560px at 100% -8%, rgba(99,91,255,0.12), transparent 60%),
    radial-gradient(760px 520px at -6% 6%, rgba(0,229,188,0.10), transparent 62%),
    radial-gradient(680px 680px at 60% 120%, rgba(99,91,255,0.06), transparent 60%),
    radial-gradient(circle at 1px 1px, rgba(99,91,255,0.05) 1px, transparent 0),
    var(--bg);
  background-size: auto, auto, auto, 22px 22px, auto;
}

/* Punchy lime primary buttons (bright fill + dark text) — reads great on white */
[data-theme="light"] .btn.primary,
[data-theme="light"] .btn.glow,
[data-theme="light"] .wd-btn.primary,
[data-theme="light"] .callout .btn-p,
[data-theme="light"] .l-eyebrow,
[data-theme="light"] .and-fab {
  background: var(--primary-bright);
  color: var(--primary-bright-fg);
  border-color: var(--primary-bright);
}
[data-theme="light"] .btn.primary:hover,
[data-theme="light"] .wd-btn.primary:hover,
[data-theme="light"] .callout .btn-p:hover {
  background: var(--indigo-400);
  border-color: var(--indigo-400);
}
/* keep the eyebrow pill text readable on its tint */
[data-theme="light"] .l-eyebrow {
  background: rgba(99,91,255,0.14);
  color: var(--indigo-500);
  border-color: var(--primary-bright);
}

/* Brighter dot-grid texture in light */
[data-theme="light"] .dot-grid {
  background-image: radial-gradient(circle at 1px 1px, rgba(99,91,255,0.16) 1px, transparent 0);
}

/* ============================================================
   APP SHELL v3.0 — collapsible sidebar + responsive main
   One unified navigation for the whole system. Built by nav.js.
   ============================================================ */

.app {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  --rail-w: 76px;
}

/* ----- SIDEBAR ----- */
.app-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: var(--sidebar-w);
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-inline-end: 1px solid var(--border);
  z-index: var(--z-drawer);
  transition: width var(--dur-base) var(--ease-out);
  -webkit-user-select: none;
  user-select: none;
}
.app[data-collapsed] .app-sidebar { width: var(--rail-w); }

.nav-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 14px 0 18px;
  flex: none;
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-snug);
  font-size: 16px;
  color: var(--fg);
  text-decoration: none;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.nav-brand .brand-mark { flex: none; }
.nav-brand .nav-brand-txt { white-space: nowrap; }
.app[data-collapsed] .nav-brand { justify-content: center; }
.app[data-collapsed] .nav-brand .nav-brand-txt { display: none; }

.nav-collapse {
  /* Retired in favor of the persistent topbar toggle (.app-collapse) so only
     one hide/show control shows on desktop. Kept in DOM for nav.js wiring. */
  display: none;
  width: 30px; height: 30px;
  flex: none;
  align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nav-collapse:hover { background: var(--tint-2); color: var(--fg); border-color: var(--border-strong); }
.nav-collapse svg { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease-out); }
.app[data-collapsed] .nav-collapse svg { transform: rotate(180deg); }
/* When collapsed, the in-rail button is hidden — the topbar toggle takes over,
   so the expand affordance never floats inside the icon rail. */
.app[data-collapsed] .nav-collapse { display: none; }

/* topbar sidebar toggle (desktop) — persistent collapse/expand control */
.app-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  flex: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.app-collapse:hover { background: var(--tint-2); color: var(--fg); border-color: var(--border-strong); }
.app-collapse svg { width: 18px; height: 18px; transition: transform var(--dur-base) var(--ease-out); }
.app[data-collapsed] .app-collapse svg { opacity: 0.95; }

/* search */
.nav-search {
  padding: 12px 14px 8px;
  flex: none;
}
.nav-search .nav-search-box {
  display: flex; align-items: center; gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.nav-search .nav-search-box:focus-within { border-color: var(--primary); box-shadow: var(--shadow-ring); }
.nav-search svg { width: 15px; height: 15px; color: var(--fg-subtle); flex: none; }
.nav-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: var(--font-body); font-size: 13px; color: var(--fg);
}
.nav-search input::placeholder { color: var(--fg-subtle); }
.nav-search kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--fg-subtle);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; flex: none;
}
.app[data-collapsed] .nav-search { display: none; }

/* scroll region */
.nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.nav-scroll::-webkit-scrollbar { width: 8px; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--bg-elevated); }

.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 4px; }
.nav-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--fg-subtle);
  padding: 6px 10px 6px;
}
.app[data-collapsed] .nav-group-label { opacity: 0; height: 10px; padding: 0; overflow: hidden; }
.app[data-collapsed] .nav-group { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.app[data-collapsed] .nav-group:first-child { border-top: 0; }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.nav-link:hover { background: var(--tint-2); color: var(--fg); }
.nav-link.active { background: var(--primary-soft); color: var(--primary); }
.nav-link .nav-ico {
  width: 20px; height: 20px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-link .nav-ico svg { width: 18px; height: 18px; }
.nav-link .nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-link .nav-caret {
  margin-inline-start: auto; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-subtle);
  transform: rotate(-90deg);   /* default: collapsed affordance → points right */
  transition: transform var(--dur-base) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav-link .nav-caret svg { width: 15px; height: 15px; }
.nav-link:hover .nav-caret { color: var(--fg-muted); }
.nav-link.active .nav-caret { color: var(--primary); }
.nav-link.sub-open .nav-caret { transform: rotate(0deg); }   /* expanded → points down */
[dir="rtl"] .nav-link .nav-caret { transform: rotate(90deg); }      /* RTL collapsed → points left */
[dir="rtl"] .nav-link.sub-open .nav-caret { transform: rotate(0deg); }
.nav-link .nav-count {
  margin-inline-start: auto;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--fg-subtle);
  background: var(--tint-2);
  padding: 1px 6px; border-radius: var(--radius-full);
}
.app[data-collapsed] .nav-link { justify-content: center; padding: 9px 0; gap: 0; }
.app[data-collapsed] .nav-link .nav-label,
.app[data-collapsed] .nav-link .nav-caret,
.app[data-collapsed] .nav-link .nav-count { display: none; }

/* tooltip when collapsed */
.app[data-collapsed] .nav-link[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  inset-inline-start: calc(100% + 12px);
  top: 50%; transform: translateY(-50%);
  background: var(--neutral-100);
  color: var(--neutral-800);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
  z-index: var(--z-tooltip);
  pointer-events: none;
}
[data-theme="light"] .app[data-collapsed] .nav-link[data-tip]:hover::after {
  background: var(--neutral-100); color: var(--neutral-900);
}

/* in-page sub links */
.nav-sub {
  margin: 2px 0 2px 25px;
  margin-inline: 25px 0;
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  max-height: 60vh;
  opacity: 1;
  transition: max-height var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-out), margin var(--dur-base) var(--ease-out);
}
.nav-sub.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0; margin-bottom: 0;
  pointer-events: none;
}
.nav-sublink {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--fg-subtle);
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nav-sublink:hover { background: var(--tint-2); color: var(--fg); }
.nav-sublink.active { color: var(--primary); background: var(--primary-soft); }
.app[data-collapsed] .nav-sub { display: none; }
.nav-link.is-hidden, .nav-group.is-hidden, .nav-sublink.is-hidden { display: none; }

/* ----- GLOBAL SEARCH RESULTS ----- */
.nav-scroll.searching .nav-group { display: none; }
.nav-results { display: none; flex-direction: column; gap: 1px; padding-top: 4px; }
.nav-results.show { display: flex; }
.nav-results .nr-empty {
  padding: 16px 10px; color: var(--fg-subtle); font-size: 12.5px; line-height: 1.5;
}
.nav-result {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--fg); text-decoration: none;
  border: 1px solid transparent;
}
.nav-result:hover, .nav-result.sel { background: var(--tint-2); }
.nav-result.sel { border-color: var(--border); }
.nav-result .nr-t {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 13px; font-weight: 500;
}
.nav-result .nr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nav-result .nr-name mark { background: var(--primary-soft); color: var(--primary); padding: 0 1px; border-radius: 2px; }
.nav-result .nr-page {
  flex: none; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-subtle);
}
.nav-result .nr-sub { font-size: 11.5px; color: var(--fg-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app[data-collapsed] .nav-results { display: none; }

/* footer */
.nav-foot {
  flex: none;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--fg-subtle);
}
.nav-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px var(--primary); flex: none; }
.app[data-collapsed] .nav-foot { justify-content: center; }
.app[data-collapsed] .nav-foot .nav-foot-txt { display: none; }

/* ----- MAIN ----- */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(var(--blur-lg));
  -webkit-backdrop-filter: saturate(140%) blur(var(--blur-lg));
}
.app-burger {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  color: var(--fg);
  cursor: pointer;
}
.app-burger svg { width: 18px; height: 18px; }
.app-topbar .crumb {
  display: flex; align-items: center; gap: 9px;
  min-width: 0;
}
.app-topbar .crumb .crumb-eyebrow {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: var(--tracking-wider); text-transform: uppercase;
  color: var(--fg-subtle);
}
.app-topbar .crumb .crumb-title {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: var(--tracking-snug); color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-topbar .crumb .crumb-sep { color: var(--fg-subtle); }
.app-topbar .spacer { flex: 1; }
.app-topbar .top-actions { display: flex; align-items: center; gap: 10px; }
.app-topbar .top-meta {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--fg-subtle);
}

/* scrim for mobile drawer */
.app-scrim {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-out), visibility var(--dur-base);
  z-index: var(--z-scrim);
}

/* ----- MOBILE ----- */
@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    top: 0; inset-inline-start: 0;
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease-out);
    box-shadow: var(--shadow-xl);
  }
  [dir="rtl"] .app-sidebar { transform: translateX(100%); }
  .app[data-mobile-open] .app-sidebar { transform: translateX(0) !important; }
  .app[data-mobile-open] .app-scrim { opacity: 1 !important; visibility: visible !important; }
  .app[data-collapsed] .app-sidebar { width: var(--sidebar-w) !important; }
  .app[data-collapsed] .nav-search,
  .app[data-collapsed] .nav-link .nav-label,
  .app[data-collapsed] .nav-link .nav-count,
  .app[data-collapsed] .nav-sub,
  .app[data-collapsed] .nav-group-label,
  .app[data-collapsed] .nav-brand .nav-brand-txt,
  .app[data-collapsed] .nav-foot .nav-foot-txt { display: revert; }
  .app[data-collapsed] .nav-collapse { position: static; transform: none; }
  .nav-collapse { display: none; }
  .app-collapse { display: none; }
  .app-burger { display: inline-flex; }
}

/* ============================================================
   REDUCED TRANSPARENCY (v4.10) — poln, neprosojen chrome.
   Ob sistemski zahtevi po manj prosojnosti glass (backdrop-blur)
   chrome postane poln, brez zamegljenosti (boljša berljivost,
   manj GPU). Page-scoped lepljive vrstice (npr. Inspektor) imajo
   svoj enak popravek.
   ============================================================ */
@media (prefers-reduced-transparency: reduce) {
  .ds-topbar, .app-topbar {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ============================================================
   MOTION CHOREOGRAPHY (v4.10) — ponovno uporabni enter vzorci.
   Privzeti konec = vidno stanje; animiramo IZ skritega, zato so
   varni za print/no-JS. Vsi spoštujejo prefers-reduced-motion
   (responsive.css izniči trajanje). Mapiranje vlog:
     modal           → .motion-scale-in   (scale + fade, spring)
     toast/menu/popover → .motion-slide-up
     drawer/side-sheet  → .motion-slide-end (RTL-zrcaljeno)
     splošno         → .motion-fade
   ============================================================ */
@keyframes nl-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes nl-scale-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes nl-slide-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes nl-slide-end   { from { opacity: 0; transform: translateX(16px); }  to { opacity: 1; transform: none; } }
@keyframes nl-slide-start { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.motion-fade      { animation: nl-fade-in   var(--dur-base) var(--ease-out)    both; }
.motion-scale-in  { animation: nl-scale-in  var(--dur-base) var(--ease-spring) both; }
.motion-slide-up  { animation: nl-slide-up  var(--dur-base) var(--ease-out)    both; }
.motion-slide-end { animation: nl-slide-end var(--dur-slow) var(--ease-out)    both; }
[dir="rtl"] .motion-slide-end { animation-name: nl-slide-start; }

