/* =========================================================================
   DI naudojimo vadovas Lietuvos mokykloms — svetainės stilius
   ========================================================================= */

/* ---------- Spalvų žetonai ---------- */
:root {
  --bg: #faf8f4;
  --bg-elev: #ffffff;
  --bg-soft: #f3f0e9;
  --bg-sunk: #ede8de;
  --text: #1b2230;
  --text-2: #465061;
  --text-3: #6b7383;
  --border: #e6e0d4;
  --border-strong: #d4ccbc;
  --accent: #86652f;
  --accent-strong: #6b4f23;
  --accent-soft: #f4ecdc;
  --accent-line: #c9ad7c;
  --ink: #16202c;
  --focus: #b08d57;
  --shadow-sm: 0 1px 2px rgba(22, 32, 44, .06);
  --shadow: 0 1px 2px rgba(22, 32, 44, .05), 0 8px 24px -8px rgba(22, 32, 44, .12);
  --shadow-lg: 0 24px 64px -16px rgba(22, 32, 44, .28), 0 2px 6px rgba(22, 32, 44, .06);

  --st-red-bg: #f8e4df;   --st-red-fg: #7c2d20;   --st-red-dot: #c2543f;
  --st-yellow-bg: #f7eed0; --st-yellow-fg: #684f0e; --st-yellow-dot: #c49a1c;
  --st-green-bg: #e2eedc; --st-green-fg: #2d5a27; --st-green-dot: #4d8f43;
  --st-gray-bg: #ecebe8;  --st-gray-fg: #3f4450;  --st-gray-dot: #8a8f99;

  --header-h: 60px;
  --sidebar-w: 292px;
  --toc-w: 240px;
  --content-w: 46rem;
  --radius: 14px;
  --radius-sm: 9px;
  --fs: 17px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1620;
    --bg-elev: #141e2a;
    --bg-soft: #1a2532;
    --bg-sunk: #0b121a;
    --text: #e9e5dd;
    --text-2: #bac0c9;
    --text-3: #8d96a3;
    --border: #243242;
    --border-strong: #324357;
    --accent: #d2b074;
    --accent-strong: #e2c68f;
    --accent-soft: rgba(203, 168, 106, .12);
    --accent-line: #8a7248;
    --ink: #e9e5dd;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .4);
    --st-red-bg: rgba(226, 112, 90, .15);  --st-red-fg: #f3b9ab;  --st-red-dot: #e2705a;
    --st-yellow-bg: rgba(222, 184, 74, .14); --st-yellow-fg: #ecd38b; --st-yellow-dot: #deb84a;
    --st-green-bg: rgba(121, 186, 108, .14); --st-green-fg: #b5dca9; --st-green-dot: #79ba6c;
    --st-gray-bg: rgba(255, 255, 255, .07); --st-gray-fg: #cdd2d9; --st-gray-dot: #9aa1ab;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1620;
  --bg-elev: #141e2a;
  --bg-soft: #1a2532;
  --bg-sunk: #0b121a;
  --text: #e9e5dd;
  --text-2: #bac0c9;
  --text-3: #8d96a3;
  --border: #243242;
  --border-strong: #324357;
  --accent: #d2b074;
  --accent-strong: #e2c68f;
  --accent-soft: rgba(203, 168, 106, .12);
  --accent-line: #8a7248;
  --ink: #e9e5dd;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .4);
  --st-red-bg: rgba(226, 112, 90, .15);  --st-red-fg: #f3b9ab;  --st-red-dot: #e2705a;
  --st-yellow-bg: rgba(222, 184, 74, .14); --st-yellow-fg: #ecd38b; --st-yellow-dot: #deb84a;
  --st-green-bg: rgba(121, 186, 108, .14); --st-green-fg: #b5dca9; --st-green-dot: #79ba6c;
  --st-gray-bg: rgba(255, 255, 255, .07); --st-gray-fg: #cdd2d9; --st-gray-dot: #9aa1ab;
  color-scheme: dark;
}

:root[data-size="s"] { --fs: 15.5px; }
:root[data-size="l"] { --fs: 18.5px; }
:root[data-size="xl"] { --fs: 20.5px; }

/* ---------- Bazė ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 20px);
  background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.7;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Turinio kopijavimo apsauga */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
input, textarea { -webkit-user-select: text; user-select: text; }
img, svg { display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
kbd {
  font-family: var(--font-mono);
  font-size: .72em;
  padding: .1em .45em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text-2);
}
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 10px; }

/* ---------- Viršutinė juosta ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .topbar { background: var(--bg); }
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); min-width: 0; overflow: hidden; }
.brand:hover { text-decoration: none; }
.brand-mark {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--bg);
  font-weight: 800; font-size: 14px; letter-spacing: .02em;
  position: relative;
}
.brand-mark { padding-right: 3px; }
.brand-mark::before { content: attr(data-mark); }
.brand-mark::after {
  content: ""; position: absolute; right: 4px; bottom: 4px; width: 4px; height: 4px;
  border-radius: 1px; background: var(--accent-line);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { font-size: 12px; color: var(--text-3); white-space: nowrap; }

.search-trigger {
  margin-left: auto; margin-right: auto;
  display: flex; align-items: center; gap: 10px;
  width: min(440px, 40vw); height: 40px; padding: 0 8px 0 12px;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--bg-elev); color: var(--text-3);
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search-trigger:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.search-trigger svg { width: 18px; height: 18px; flex: none; }
.st-label { flex: 1; text-align: left; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-kbd { flex: none; }
.top-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.icon-btn svg { width: 21px; height: 21px; }
.menu-btn { display: none; margin-left: -6px; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .i-sun { display: none; }
  :root[data-theme="auto"] .i-moon { display: block; }
}

.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent-line), var(--accent));
}

/* nustatymai */
.settings-pop {
  position: fixed; z-index: 45; top: calc(var(--header-h) + env(safe-area-inset-top) + 8px); right: 16px;
  width: 300px; padding: 16px; border-radius: var(--radius);
  background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: grid; gap: 16px;
}
.sp-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-3); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.seg { display: flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--bg-soft); border: 1px solid var(--border); }
.seg button {
  flex: 1; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2);
  cursor: pointer; font-size: 14px; font-weight: 600;
}
.seg button[aria-pressed="true"] { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button[data-size="s"] { font-size: 12px; }
.seg button[data-size="m"] { font-size: 14.5px; }
.seg button[data-size="l"] { font-size: 17px; }
.seg button[data-size="xl"] { font-size: 19.5px; }

/* ---------- Išdėstymas ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
  min-height: 100vh;
}
.sidebar {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top));
  height: calc(100vh - var(--header-h) - env(safe-area-inset-top));
  height: calc(100dvh - var(--header-h) - env(safe-area-inset-top));
  border-right: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}
.sidebar-inner {
  height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 12px 40px 16px;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.main { min-width: 0; outline: none; }
.scrim { display: none; }

/* ---------- Šoninis meniu ---------- */
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 9px;
  color: var(--text-2); font-size: 14.5px; line-height: 1.35;
  transition: background .12s, color .12s;
}
.nav-link:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav-link svg { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.nav-group { margin-top: 18px; }
.nav-group-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; margin-bottom: 4px; border: 0; background: none; cursor: pointer;
  font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3);
}
.nav-group-btn svg { width: 16px; height: 16px; transition: transform .2s; }
.nav-group-btn[aria-expanded="false"] svg { transform: rotate(-90deg); }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list[hidden] { display: none; }
.nav-item > .nav-link { align-items: flex-start; }
.nav-num {
  flex: none; min-width: 26px; height: 22px; margin-top: 0; padding: 0 5px;
  display: inline-grid; place-items: center;
  border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums;
}
.nav-link[aria-current="page"] .nav-num { background: var(--accent); border-color: var(--accent); color: var(--bg-elev); }
.nav-title { flex: 1; padding-top: 1px; }
.nav-seen {
  flex: none; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%;
  background: var(--accent-line); opacity: .8;
}
.nav-sub { list-style: none; margin: 2px 0 8px 22px; padding: 0 0 0 14px; border-left: 1px solid var(--border); }
.nav-sub a {
  display: block; padding: 4px 8px; margin-left: -1px; border-left: 2px solid transparent;
  font-size: 13.5px; line-height: 1.4; color: var(--text-3);
}
.nav-sub a:hover { color: var(--text); text-decoration: none; }
.nav-sub a.active { color: var(--accent); border-left-color: var(--accent); }
.nav-foot { margin: 26px 10px 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

/* ---------- Įkėlimas ---------- */
.loading { display: grid; place-items: center; gap: 14px; padding: 18vh 20px; color: var(--text-3); }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.noscript, .fatal { max-width: 560px; margin: 16vh auto; padding: 20px; text-align: center; color: var(--text-2); }

/* ---------- Skyriaus puslapis ---------- */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-w);
  gap: 56px;
  --pad: 48px;
  max-width: calc(var(--content-w) + var(--toc-w) + 56px + 96px);
  padding: 40px var(--pad) 80px;
  margin: 0 auto;
}
.article { min-width: 0; max-width: var(--content-w); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-3); margin-bottom: 18px; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 14px; height: 14px; }
.eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
}
.eyebrow .meta { color: var(--text-3); font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.eyebrow .meta svg { width: 15px; height: 15px; }
.article h1 {
  margin: 10px 0 28px; padding-bottom: 22px;
  font-size: clamp(1.85rem, 1.25rem + 2.2vw, 2.55rem); line-height: 1.15; letter-spacing: -.025em; font-weight: 750;
  border-bottom: 1px solid var(--border);
  text-wrap: balance;
  position: relative;
}
.article h1::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 64px; height: 2px; background: var(--accent);
}

/* turinio tipografija */
.prose { font-size: 1rem; }
.prose :where(p, ul, ol) { margin: 0; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.05em; }
.prose p { text-wrap: pretty; hyphens: manual; }
.prose ol ol, .prose ul ul, .prose li > ol, .prose li > ul { margin-top: .5em; }
.prose p.small { font-size: .94em; color: var(--text-2); }
.prose h2 {
  margin-top: 2.4em; margin-bottom: -.1em;
  font-size: 1.42em; line-height: 1.3; letter-spacing: -.018em; font-weight: 700;
  scroll-margin-top: calc(var(--header-h) + 24px);
  text-wrap: balance;
}
.prose > h2:first-child { margin-top: .4em; }
.prose h3 {
  margin-top: 1.9em; margin-bottom: -.25em;
  font-size: 1.12em; line-height: 1.4; font-weight: 700; letter-spacing: -.008em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h2 + h3 { margin-top: 1.1em; }
.prose h2 { position: relative; }
.h-link {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: 1.5em; height: 1.5em; margin-left: .35em; padding: 0;
  border: 0; border-radius: 7px; background: transparent; color: var(--text-3);
  opacity: 0; cursor: pointer; transition: opacity .15s, background .15s;
}
.h-link svg { width: .8em; height: .8em; }
.prose h2:hover .h-link, .h-link:focus-visible { opacity: 1; }
.h-link:hover { background: var(--bg-soft); color: var(--accent); }
@media (hover: none) { .h-link { display: none; } }
.c-gap { margin-top: 22px !important; }
.nav-ico svg { width: 13px; height: 13px; }
.hnum { color: var(--accent); font-variant-numeric: tabular-nums; margin-right: .1em; }
.prose strong { font-weight: 650; color: var(--text); }
.prose ol, .prose ul { padding-left: 0; list-style: none; }
.prose ol { counter-reset: li; }
.prose ol > li { counter-increment: li; position: relative; padding-left: 2.3em; }
.prose ol > li + li, .prose ul > li + li { margin-top: .55em; }
.prose ol > li::before {
  content: counter(li);
  position: absolute; left: 0; top: .2em;
  min-width: 1.6em; height: 1.6em; padding: 0 .35em;
  display: grid; place-items: center;
  border-radius: 7px; background: var(--accent-soft); color: var(--accent);
  font-size: .78em; font-weight: 700; font-variant-numeric: tabular-nums;
}
.prose ul.dash > li { position: relative; padding-left: 1.5em; }
.prose ul.dash > li::before {
  content: ""; position: absolute; left: .35em; top: .78em;
  width: .45em; height: 2px; border-radius: 2px; background: var(--accent);
}
.prose a.xref { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.prose a.xref:hover { text-decoration: none; border-bottom-color: var(--accent); }
.prose em { font-style: italic; }

.cite { font-size: .68em; line-height: 0; vertical-align: super; margin-left: .15em; color: var(--text-3); white-space: nowrap; font-weight: 600; }
.cite a { color: var(--accent); padding: 0 .1em; }
.cite a:hover { text-decoration: none; background: var(--accent-soft); border-radius: 3px; }

/* informaciniai blokai */
.callout {
  position: relative;
  padding: 1.05em 1.25em 1.1em 3.15em;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  font-size: .96em;
}
.callout::before {
  content: ""; position: absolute; left: 1.05em; top: 1.2em; width: 1.25em; height: 1.25em;
  background: var(--accent);
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.callout > * + * { margin-top: .6em; }
.callout-title { font-weight: 700; color: var(--text); }
.callout.note { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E"); }
.callout.warn {
  background: var(--bg-soft); border-color: var(--border-strong);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20L12 3Z'/%3E%3Cpath d='M12 10v4M12 17v.5'/%3E%3C/svg%3E");
}
.callout.warn::before { background: var(--st-red-dot); }
.callout.good {
  background: var(--bg-elev); border-color: var(--border);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E");
}
.callout.good::before { background: var(--st-green-dot); }
.callout ol > li::before { background: var(--bg-elev); }

/* praktinės situacijos */
.case {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev); box-shadow: var(--shadow-sm);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose .case-title {
  margin: 0; padding: .95em 1.2em; display: flex; gap: .8em; align-items: flex-start;
  font-size: 1.02em; line-height: 1.45;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
}
.case-n {
  flex: none; min-width: 1.9em; height: 1.9em; padding: 0 .3em; margin-top: -.1em;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--ink); color: var(--bg-elev); font-size: .85em; font-variant-numeric: tabular-nums;
}
.case-body { padding: .9em 1.2em 1.05em; font-size: .96em; }
.case-body p + p { margin-top: .5em; }
.case-body p > strong:first-child { color: var(--accent); }

/* lentelės */
.table-wrap {
  position: relative;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}
.prose > .table-wrap { margin-top: 1.3em; }
.prose > .table-wrap + p, .prose > .table-wrap + .table-wrap { margin-top: 1.3em; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88em; line-height: 1.5; }
table.t th, table.t td { padding: .7em .9em; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
table.t th + th, table.t td + td { border-left: 1px solid var(--border); }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t thead th {
  background: var(--bg-soft); font-weight: 700; color: var(--text);
  font-size: .94em; position: sticky; top: 0;
}
table.t th strong { font-weight: 700; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--bg-soft) 55%, transparent); }
table.t td.blank { background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--border) 45%, transparent) 7px 8px); }
table.t td p + p { margin-top: .4em; }
table.t td ol, table.t td ul { margin: .3em 0 0; }
td[class*="st-"] { font-weight: 600; }
td.st-red { background: var(--st-red-bg); color: var(--st-red-fg); }
td.st-yellow { background: var(--st-yellow-bg); color: var(--st-yellow-fg); }
td.st-green { background: var(--st-green-bg); color: var(--st-green-fg); }
td.st-gray { background: var(--st-gray-bg); color: var(--st-gray-fg); }
td[class*="st-"] strong { color: inherit; }
table.t tbody tr:hover td[class*="st-"] { filter: brightness(.98); }
.table-wrap.scrolls {
  background:
    linear-gradient(to right, var(--bg-elev) 30%, transparent) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--bg-elev) 30%, transparent) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .16), transparent) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .16), transparent) right center / 14px 100% no-repeat scroll;
  background-color: var(--bg-elev);
}
.scroll-hint { display: flex; align-items: center; gap: 6px; font-size: .78em; color: var(--text-3); margin-bottom: -.6em !important; }
.scroll-hint svg { width: 14px; height: 14px; }
.table-note { font-size: .82em; color: var(--text-3); margin-top: .5em !important; display: flex; align-items: center; gap: 6px; }
.table-note svg { width: 14px; height: 14px; }

/* kontrolinis sąrašas */
td.chk-cell { width: 1%; white-space: nowrap; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 28px; }
.chk input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chk-box {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border-strong); background: var(--bg-elev);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.chk-box::after {
  content: ""; width: 11px; height: 6px; border: 2.2px solid transparent; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}
.chk input:checked + .chk-box { background: var(--st-green-dot); border-color: var(--st-green-dot); }
.chk input:checked + .chk-box::after { border-color: #fff; }
.chk input:focus-visible + .chk-box { outline: 2px solid var(--focus); outline-offset: 2px; }
.chk-date { font-size: .9em; color: var(--text-3); font-variant-numeric: tabular-nums; }
tr.done td:not(.chk-cell) { color: var(--text-3); }

/* režimų kortelės */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mode {
  padding: 1.1em 1.2em 1.2em; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-elev); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.mode::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--mode-c); }
.mode-0 { --mode-c: var(--st-gray-dot); }
.mode-1 { --mode-c: var(--st-green-dot); }
.mode-2 { --mode-c: var(--st-yellow-dot); }
.mode-3 { --mode-c: var(--accent); }
.mode-code { font-size: 1.7em; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--text); }
.mode-name { font-size: .8em; font-weight: 700; letter-spacing: .08em; color: var(--text-3); margin: .25em 0 .7em; }
.mode p { font-size: .95em; }
.mode p + p { margin-top: .35em; }

/* sprendimų medis */
.tree-wizard {
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: .9em 1.25em; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.tw-title { font-weight: 700; font-size: .95em; display: flex; align-items: center; gap: 8px; }
.tw-title svg { width: 18px; height: 18px; color: var(--accent); }
.tw-steps { display: flex; gap: 5px; }
.tw-steps span { width: 22px; height: 5px; border-radius: 3px; background: var(--border-strong); transition: background .2s; }
.tw-steps span.on { background: var(--accent); }
.tw-steps span.cur { background: var(--accent-line); }
.tw-body { padding: 1.4em 1.35em 1.35em; }
.tw-count { font-size: .8em; font-weight: 700; color: var(--text-3); letter-spacing: .07em; text-transform: uppercase; }
.tw-q { font-size: 1.28em; font-weight: 700; line-height: 1.35; letter-spacing: -.012em; margin-top: .35em; text-wrap: balance; }
.tw-hint { color: var(--text-2); margin-top: .5em; font-size: .95em; }
.tw-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.25em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 1.25em; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text);
  font-weight: 650; font-size: .95em; cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg-elev); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--accent)); }
.btn-yes, .btn-no { min-width: 120px; font-size: 1em; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-soft); }
.tw-out {
  margin-top: 1.2em; padding: 1em 1.15em; border-radius: var(--radius-sm);
  font-weight: 600; line-height: 1.55;
}
.tw-out.st-red { background: var(--st-red-bg); color: var(--st-red-fg); }
.tw-out.st-yellow { background: var(--st-yellow-bg); color: var(--st-yellow-fg); }
.tw-out.st-green { background: var(--st-green-bg); color: var(--st-green-fg); }
.tw-out .tw-out-k { display: block; font-size: .78em; letter-spacing: .08em; text-transform: uppercase; opacity: .85; margin-bottom: .25em; }
.tw-path { margin-top: 1.2em; padding-top: 1em; border-top: 1px dashed var(--border-strong); font-size: .86em; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 6px 8px; }
.tw-path span { padding: .15em .55em; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--border); }
.tw-anim { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tree-all { border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-elev); }
.tree-all > summary {
  cursor: pointer; list-style: none; padding: .85em 1.2em; font-weight: 700; font-size: .95em;
  display: flex; align-items: center; gap: 8px;
}
.tree-all > summary::-webkit-details-marker { display: none; }
.tree-all > summary::before {
  content: ""; width: .5em; height: .5em; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(-45deg); transition: transform .2s;
}
.tree-all[open] > summary::before { transform: rotate(45deg); }
.tree-static { list-style: none; margin: 0; padding: .2em 1.2em 1.3em; counter-reset: none; }
.prose .tree-static > li { padding: 0; counter-increment: none; }
.prose .tree-static > li::before { display: none; }
.tree-step {
  display: grid; grid-template-columns: minmax(0, 1.15fr) 58px minmax(0, 1fr);
  grid-template-areas: "q b o" "d . .";
  align-items: stretch;
}
.tree-q { grid-area: q; display: flex; gap: .7em; padding: .8em .9em; border-radius: 11px; background: var(--bg-soft); border: 1px solid var(--border-strong); }
.tree-n { flex: none; width: 1.7em; height: 1.7em; border-radius: 7px; background: var(--ink); color: var(--bg-elev); display: grid; place-items: center; font-size: .8em; font-weight: 700; }
.tree-qt { font-weight: 700; font-size: .93em; line-height: 1.4; }
.tree-hint { font-size: .82em; color: var(--text-2); margin-top: .25em; line-height: 1.45; }
.tree-branch { grid-area: b; display: flex; align-items: center; justify-content: center; position: relative; }
.tree-branch::before { content: ""; position: absolute; left: 0; right: 4px; top: 50%; height: 1.5px; background: var(--text-3); }
.tree-branch::after { content: ""; position: absolute; right: 0; top: calc(50% - 4px); border: 4.5px solid transparent; border-left: 7px solid var(--text-3); border-right: 0; }
.tree-lbl { position: relative; z-index: 1; font-size: .7em; font-weight: 800; letter-spacing: .06em; padding: .1em .45em; border-radius: 5px; background: var(--bg-elev); color: var(--text-2); }
.tree-branch .tree-lbl { transform: translateY(-.95em); background: transparent; }
.tree-out { grid-area: o; padding: .8em .9em; border-radius: 11px; font-size: .86em; line-height: 1.5; font-weight: 550; }
.tree-out.st-red { background: var(--st-red-bg); color: var(--st-red-fg); }
.tree-out.st-yellow { background: var(--st-yellow-bg); color: var(--st-yellow-fg); }
.tree-out a { color: inherit; border-bottom-color: currentColor !important; }
.tree-down { grid-area: d; height: 36px; position: relative; display: flex; align-items: center; padding-left: calc(1.35em + 14px); }
.tree-down::before { content: ""; position: absolute; left: 1.4em; top: 0; bottom: 5px; width: 1.5px; background: var(--text-3); }
.tree-down::after { content: ""; position: absolute; left: calc(1.4em - 3.8px); bottom: 0; border: 4.5px solid transparent; border-top: 7px solid var(--text-3); border-bottom: 0; }
.tree-final { margin-top: 0; padding: .95em 1.1em; border-radius: 11px; border: 1.5px solid var(--st-green-dot); max-width: calc(53.5% - 20px); font-size: .93em; line-height: 1.5; }
.tree-final.st-green { background: var(--st-green-bg); color: var(--st-green-fg); }
.tree-final strong { color: inherit !important; }

/* šaltiniai */
.sources { list-style: none; padding: 0; margin-top: 1.2em; display: grid; gap: 4px; }
.prose .sources > li { padding: .7em .9em; border-radius: 11px; display: flex; gap: .9em; font-size: .9em; line-height: 1.55; scroll-margin-top: calc(var(--header-h) + 24px); transition: background .4s; }
.prose .sources > li::before { display: none; }
.prose .sources > li + li { margin-top: 0; }
.sources li:hover { background: var(--bg-soft); }
.sources li.flash { background: var(--accent-soft); }
.src-n {
  flex: none; min-width: 2.2em; height: 1.9em; padding: 0 .4em;
  display: grid; place-items: center; border-radius: 7px;
  background: var(--bg-soft); border: 1px solid var(--border);
  font-size: .82em; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.src-t { min-width: 0; color: var(--text-2); }
.src-t a.ext, .cite-pop a.ext { word-break: break-all; overflow-wrap: anywhere; color: var(--accent); font-size: .94em; }

/* paryškinimas po paieškos */
mark.hit { background: color-mix(in srgb, #f5c542 45%, transparent); color: inherit; border-radius: 3px; padding: 0 .06em; box-shadow: 0 0 0 1px color-mix(in srgb, #f5c542 30%, transparent); }
mark.hit.cur { background: #f5c542; color: #1b1b1b; }
.flash-target { animation: flash 1.8s ease; }
@keyframes flash { 0%, 30% { background: var(--accent-soft); box-shadow: 0 0 0 8px var(--accent-soft); } 100% { box-shadow: 0 0 0 8px transparent; } }

/* navigacija tarp skyrių */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pager a {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-elev);
  color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pager a:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.pager small { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pager small svg { width: 14px; height: 14px; }
.pager span { font-weight: 650; line-height: 1.35; font-size: 15px; }
.pager .next { text-align: right; align-items: flex-end; grid-column: 2; }

/* dešinysis turinys */
.toc { position: sticky; top: calc(var(--header-h) + 36px); align-self: start; max-height: calc(100vh - var(--header-h) - 60px); overflow-y: auto; padding-bottom: 20px; scrollbar-width: thin; }
.toc-title { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); margin: 4px 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a {
  display: block; padding: 5px 10px 5px 14px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 13.5px; line-height: 1.4; color: var(--text-3);
  transition: color .12s, border-color .12s;
}
.toc a.l3 { padding-left: 26px; font-size: 13px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc .toc-top { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 13px; color: var(--text-3); padding-left: 14px; }
.toc-top svg { width: 14px; height: 14px; }

/* mažų ekranų skyriaus turinio juosta */
.toc-bar {
  display: none;
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 20;
  margin: -1px calc(-1 * var(--pad)) 22px; padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.toc-bar button {
  width: 100%; height: 46px; display: flex; align-items: center; gap: 10px;
  border: 0; background: none; cursor: pointer; padding: 0; text-align: left;
  font-size: 14px; color: var(--text-2);
}
.toc-bar .tb-k { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.toc-bar .tb-v { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--text); }
.toc-bar svg { width: 18px; height: 18px; flex: none; color: var(--text-3); }

/* ---------- Pradžios puslapis ---------- */
.home { max-width: 1120px; margin: 0 auto; padding: 36px 48px 80px; }
.hero {
  position: relative; overflow: hidden;
  padding: 56px 56px 48px; border-radius: 24px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-elev), var(--bg-elev));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 320px; height: 320px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: 0 0 0 40px color-mix(in srgb, var(--accent) 4%, transparent), 0 0 0 80px color-mix(in srgb, var(--accent) 3%, transparent);
  pointer-events: none;
}
.hero-kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.hero h1 {
  margin: 14px 0 0; max-width: 16em;
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.3rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 800;
  text-wrap: balance;
}
.hero-sub { margin: 18px 0 0; max-width: 42em; font-size: 1.06em; color: var(--text-2); line-height: 1.6; text-wrap: pretty; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip {
  display: inline-block;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 13px; color: var(--text-2);
}
.chip svg { display: inline-block; vertical-align: -2px; margin-right: 6px; width: 14px; height: 14px; color: var(--text-3); }
.chip b { color: var(--text); font-weight: 650; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; position: relative; z-index: 1; }
.hero-actions .btn { min-height: 48px; padding: 0 1.4em; }
.hero-search {
  display: flex; align-items: center; gap: 10px; width: min(420px, 100%);
  min-height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text-3);
  cursor: pointer; font-size: 15px;
}
.hero-search:hover { border-color: var(--accent-line); }
.hero-search svg { width: 18px; height: 18px; }
.hero-search span { flex: 1; text-align: left; }

.resume {
  display: flex; align-items: center; gap: 14px; margin-top: 18px;
  padding: 14px 18px; border-radius: var(--radius);
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text);
}
.resume:hover { text-decoration: none; box-shadow: var(--shadow); }
.resume svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.resume small { display: block; font-size: 12px; color: var(--text-3); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.resume span { font-weight: 650; }

.h-section { margin-top: 56px; }
.h-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.h-head h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; line-height: 1.25; }
.h-head p { margin: 4px 0 0; color: var(--text-3); font-size: .95rem; }

.roles { display: flex; flex-wrap: wrap; gap: 8px; }
.role-btn {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev);
  font-size: 14px; font-weight: 550; color: var(--text-2); cursor: pointer; text-align: left;
  transition: all .15s;
}
.role-btn:hover { border-color: var(--border-strong); color: var(--text); }
.role-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg-elev); }
.role-panel { margin-top: 16px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-elev); }
.role-panel p.rp-src { font-size: 13.5px; color: var(--text-3); margin: 0 0 14px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.role-card {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  transition: border-color .15s, background .15s;
}
.role-card:hover { text-decoration: none; border-color: var(--accent-line); background: var(--bg-elev); }
.role-card .nav-num { margin-top: 1px; }
.role-card span { font-size: 14.5px; line-height: 1.4; font-weight: 550; }

.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tool {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tool:hover { text-decoration: none; border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tool-ico svg { width: 21px; height: 21px; }
.tool small, .tool strong { display: block; }
.tool small { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }
.tool strong { font-size: 16.5px; line-height: 1.35; letter-spacing: -.01em; }

.contents { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; }
.c-col h3 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.c-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); overflow: hidden; }
.c-list li + li { border-top: 1px solid var(--border); }
.c-list a { display: flex; align-items: flex-start; gap: 12px; padding: 11px 16px; color: var(--text); font-size: 15px; line-height: 1.4; }
.c-list a:hover { text-decoration: none; background: var(--bg-soft); }
.c-list .c-t { flex: 1; }
.c-list .c-m { flex: none; font-size: 12.5px; color: var(--text-3); padding-top: 2px; font-variant-numeric: tabular-nums; }
.c-list .nav-seen { margin-top: 8px; }

.notice {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 18px;
  padding: 16px 18px; border-radius: var(--radius); border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 14.5px;
}
.notice svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 2px; }

/* poraštė */
.foot {
  margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  font-size: 13px; color: var(--text-3); line-height: 1.55;
}
.foot p { margin: 0; max-width: 46em; }

/* ---------- Paieška ---------- */
.search { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-backdrop { position: absolute; inset: 0; background: rgba(10, 16, 24, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .15s ease; }
.search-panel {
  position: relative; width: min(680px, 100%); max-height: min(72vh, 680px);
  display: flex; flex-direction: column;
  border-radius: 18px; background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: pop .18s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
.search-head { display: flex; align-items: center; gap: 12px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--border); }
.search-head > svg { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.search-head input {
  flex: 1; min-width: 0; height: 60px; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 17px;
}
.search-head input::placeholder { color: var(--text-3); }
.search-head input::-webkit-search-cancel-button { display: none; }
.search-close { flex: none; height: 28px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--bg-soft); color: var(--text-3); font-size: 12px; font-weight: 600; cursor: pointer; }
.search-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.search-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); background: var(--bg-soft); }
.search-foot kbd { margin-right: 3px; }
.s-group { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 12px 12px 6px; }
.s-item { display: flex; gap: 12px; padding: 11px 12px; border-radius: 11px; color: var(--text); cursor: pointer; scroll-margin: 8px; }
.s-item:hover { text-decoration: none; }
.s-item[aria-selected="true"] { background: var(--accent-soft); }
.s-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-3); margin-top: 1px; }
.s-ico svg { width: 16px; height: 16px; }
.s-item[aria-selected="true"] .s-ico { background: var(--accent); border-color: var(--accent); color: var(--bg-elev); }
.s-main { min-width: 0; flex: 1; }
.s-title, .s-path { display: block; }
.s-title { font-weight: 650; font-size: 15px; line-height: 1.35; }
.s-path { font-size: 12.5px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-snip { font-size: 13.5px; color: var(--text-2); margin-top: 4px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.s-item mark, .s-title mark { background: color-mix(in srgb, #f5c542 50%, transparent); color: inherit; border-radius: 3px; padding: 0 .05em; }
.s-empty { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 14.5px; }
.s-sugg { padding: 6px 10px 12px; }
.s-sugg p { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 6px 2px 10px; }
.s-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.s-chips button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); font-size: 13.5px; cursor: pointer; }
.s-chips button:hover { border-color: var(--accent-line); color: var(--text); }
.s-count { padding: 4px 12px 2px; font-size: 12.5px; color: var(--text-3); }

/* paieškos atitikmenų juosta */
.hitbar {
  position: fixed; z-index: 35; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 5px 5px 5px 14px; border-radius: 999px;
  background: var(--ink); color: var(--bg-elev); box-shadow: var(--shadow-lg);
  font-size: 13.5px; max-width: calc(100vw - 32px);
}
.hb-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 6px; }
.hb-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; flex: none; }
.hb-btn:hover { background: rgba(255, 255, 255, .12); }
:root[data-theme="dark"] .hb-btn:hover { background: rgba(0, 0, 0, .1); }
.hb-btn svg { width: 17px; height: 17px; }

/* citatos iššokantis langas */
.cite-pop {
  position: absolute; z-index: 50; width: min(380px, calc(100vw - 24px));
  padding: 14px 16px; border-radius: 13px;
  background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 13.5px; line-height: 1.55; color: var(--text-2);
  animation: pop .15s ease;
}
.cite-pop .cp-item + .cp-item { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cite-pop .cp-n { display: inline-block; font-weight: 700; color: var(--text); margin-right: 4px; }
.cite-pop .cp-all { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12.5px; font-weight: 600; }
.cite-pop .cp-all svg { width: 13px; height: 13px; }

/* apatinis lapas (mobilus turinys) */
.sheet { position: fixed; inset: 0; z-index: 55; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 16, 24, .45); animation: fade .15s ease; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0; background: var(--bg-elev); box-shadow: var(--shadow-lg);
  animation: up .22s cubic-bezier(.2, .9, .3, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 4px auto 12px; }
.sheet-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 4px 8px; }
.sheet-panel ul { list-style: none; margin: 0; padding: 0; }
.sheet-panel a { display: block; padding: 11px 12px; border-radius: 10px; color: var(--text); font-size: 15px; line-height: 1.4; }
.sheet-panel a.l3 { padding-left: 28px; font-size: 14px; color: var(--text-2); }
.sheet-panel a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sheet-panel a:hover { text-decoration: none; background: var(--bg-soft); }

/* į viršų, pranešimai */
.to-top {
  position: fixed; z-index: 30; right: max(18px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom));
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-2); box-shadow: var(--shadow);
  display: grid; place-items: center; cursor: pointer; animation: fade .2s ease;
}
.to-top:hover { color: var(--text); border-color: var(--border-strong); }
.to-top svg { width: 19px; height: 19px; }
.toast {
  position: fixed; z-index: 70; left: 50%; top: calc(var(--header-h) + env(safe-area-inset-top) + 14px);
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 11px; background: var(--ink); color: var(--bg-elev);
  font-size: 14px; font-weight: 550; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Slapukų sutikimas ---------- */
.consent {
  position: fixed; z-index: 58; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom)); width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto;
  padding: 18px 20px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg);
  font-size: 14.5px; line-height: 1.55; user-select: text; -webkit-user-select: text;
}
.consent[hidden] { display: none; }
.consent-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.consent-text, .consent-details { margin: 0 0 12px; }
.consent-details { font-size: 13.5px; color: var(--text-2); }
.consent-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.consent-choice { display: flex; gap: 10px; }
.consent-choice .btn { min-width: 120px; justify-content: center; }
.consent-more { border-color: transparent; background: transparent; color: var(--text-2); padding-left: 0; padding-right: 0; }
.consent-more:hover { background: transparent; text-decoration: underline; }
.link-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 480px) {
  .consent-choice { width: 100%; }
  .consent-choice .btn { flex: 1; min-width: 0; }
}

/* ---------- Adaptyvumas ---------- */
@media (max-width: 1240px) {
  .page { grid-template-columns: minmax(0, 1fr); max-width: calc(var(--content-w) + 96px); gap: 0; }
  .toc { display: none; }
  .toc-bar { display: block; }
}
@media (max-width: 1024px) {
  :root { --header-h: 58px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; height: 100%;
    width: min(340px, 88vw);
    padding-top: env(safe-area-inset-top);
    transform: translateX(-102%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
    box-shadow: var(--shadow-lg); border-right: 1px solid var(--border);
    background: var(--bg-elev);
  }
  .sidebar.open { transform: none; }
  .sidebar-inner { padding-top: 14px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(10, 16, 24, .45); animation: fade .15s ease; }
  .page { --pad: 32px; padding: 28px var(--pad) 64px; }
  .home { padding: 24px 32px 64px; }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --fs: 16.5px; --header-h: 56px; }
  :root[data-size="s"] { --fs: 15px; }
  :root[data-size="l"] { --fs: 18px; }
  :root[data-size="xl"] { --fs: 20px; }
  .topbar { gap: 4px; }
  #themeBtn { display: none; }
  .role-btn { border-radius: 12px; font-size: 14px; }
  .chip { font-size: 12.5px; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 14.5px; }
  .brand-mark { width: 32px; height: 32px; }
  .search-trigger { width: 40px; height: 40px; margin-left: auto; margin-right: 0; flex: none; padding: 0; justify-content: center; border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
  .search-trigger:hover { background: var(--bg-soft); }
  .search-trigger svg { width: 21px; height: 21px; }
  .st-label, .st-kbd { display: none; }
  .page { --pad: 18px; padding: 20px var(--pad) 56px; }
  .toc-bar { margin-bottom: 18px; }
  .home { padding: 16px 16px 56px; }
  .hero { padding: 30px 22px 26px; border-radius: 20px; }
  .hero::after { width: 200px; height: 200px; right: -80px; bottom: -90px; }
  .hero-actions .btn, .hero-search { width: 100%; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .tool { flex-direction: row; align-items: center; padding: 14px 16px; gap: 14px; }
  .tool small { display: none; }
  .tool strong { font-size: 15.5px; }
  .contents { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
  .modes { grid-template-columns: minmax(0, 1fr); }
  .tw-title { white-space: nowrap; }
  .tw-steps { gap: 3px; }
  .tw-steps span { width: 11px; }
  .tw-head { padding: .8em 1em; }
  .tw-body { padding: 1.2em 1.1em 1.15em; }
  .search { padding: 0; align-items: stretch; }
  .search-panel { max-height: none; height: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); }
  .search-foot { display: none; }
  .search-head input { height: 56px; font-size: 16px; }
  .settings-pop { left: 12px; right: 12px; width: auto; }
  .case-title { padding: .85em 1em; }
  .case-body { padding: .85em 1em 1em; }
  .callout { padding: 1em 1em 1em 2.85em; }
  .callout::before { left: .9em; }

  /* lentelės su 2–3 stulpeliais: kortelių vaizdas */
  table.t.c2, table.t.c3 { font-size: .9em; }
  table.t.c2 colgroup, table.t.c3 colgroup, table.t.c2 thead, table.t.c3 thead { display: none; }
  table.t.c2, table.t.c2 tbody, table.t.c2 tr, table.t.c2 td,
  table.t.c3, table.t.c3 tbody, table.t.c3 tr, table.t.c3 td { display: block; width: 100%; }
  table.t.c2 tr, table.t.c3 tr { padding: .75em .95em; border-bottom: 1px solid var(--border); }
  table.t.c2 tr:last-child, table.t.c3 tr:last-child { border-bottom: 0; }
  table.t.c2 td, table.t.c3 td { border: 0 !important; padding: .15em 0; background: none; }
  table.t.c2 td + td, table.t.c3 td + td { margin-top: .35em; }
  table.t.c2 td[data-label]::before, table.t.c3 td[data-label]::before {
    content: attr(data-label); display: block; font-size: .74em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: .1em;
  }
  table.t.c2 td[class*="st-"], table.t.c3 td[class*="st-"] { display: inline-block; width: auto; padding: .2em .6em; border-radius: 7px; }
  table.t.c2 td[class*="st-"][data-label]::before, table.t.c3 td[class*="st-"][data-label]::before { display: none; }
  table.t.c2 td.st-red, table.t.c3 td.st-red { background: var(--st-red-bg); }
  table.t.c2 td.st-yellow, table.t.c3 td.st-yellow { background: var(--st-yellow-bg); }
  table.t.c2 td.st-green, table.t.c3 td.st-green { background: var(--st-green-bg); }
  table.t.c2 td.st-gray, table.t.c3 td.st-gray { background: var(--st-gray-bg); }
  table.t.c2 td.st-red + td, table.t.c3 td.st-red + td,
  table.t.c2 td.st-yellow + td, table.t.c3 td.st-yellow + td,
  table.t.c2 td.st-green + td, table.t.c3 td.st-green + td,
  table.t.c2 td.st-gray + td, table.t.c3 td.st-gray + td { display: block; }
  table.t.c2 td.blank, table.t.c3 td.blank { min-height: 2.2em; margin-top: .3em; border-radius: 7px; border: 1px dashed var(--border-strong) !important; }
  table.t.c2 td.blank::before, table.t.c3 td.blank::before { display: none; }
  table.t tbody tr:hover td { background: none; }
  table.t.c2 td.chk-cell, table.t.c3 td.chk-cell { white-space: normal; }
  table.t:not(.c2):not(.c3) { min-width: 620px; }

  .tree-step { grid-template-columns: minmax(0, 1fr); grid-template-areas: "q" "b" "o" "d"; }
  .tree-branch { height: 34px; justify-content: flex-start; padding-left: calc(1.35em + 14px); }
  .tree-branch::before { left: 1.4em; right: auto; top: 0; bottom: 5px; width: 1.5px; height: auto; }
  .tree-branch::after { left: calc(1.4em - 3.8px); right: auto; top: auto; bottom: 0; border: 4.5px solid transparent; border-top: 7px solid var(--text-3); border-bottom: 0; }
  .tree-branch .tree-lbl { transform: none; }
  .tree-out { border-left: 3px solid currentColor; }
  .tree-down { height: 40px; }
  .tree-final { max-width: none; }
  .tree-static { padding: .2em .9em 1.1em; }
}
@media (max-width: 380px) {
  .brand-text strong { font-size: 13.5px; }
}

@media (hover: none) {
  .tool:hover, .pager a:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Spausdinimas išjungtas ---------- */
@media print {
  body > * { display: none !important; }
  body::before {
    content: "Šio vadovo spausdinti ar išsaugoti negalima. Dirbtinio intelekto naudojimo vadovas Lietuvos mokykloms © 2026 Artūras Kubilius-Dauginis.";
    display: block; padding: 40px; font: 14px/1.5 sans-serif; color: #000;
  }
}

/* ---------- Kalbos perjungiklis ---------- */
.lang-btn {
  height: 34px; min-width: 40px; padding: 0 10px; margin: 3px 2px 0; flex: none;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 9px;
  font-size: 12.5px; font-weight: 750; letter-spacing: .06em; color: var(--text-2); background: var(--bg-elev);
}
.lang-btn:hover { text-decoration: none; color: var(--text); border-color: var(--accent-line); }
.seg-link {
  flex: 1; height: 34px; display: grid; place-items: center; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.seg-link:hover { text-decoration: none; color: var(--text); }
.seg-link.on { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); pointer-events: none; }

/* ---------- Statinis turinys (kol įkeliamas vadovas ar be JavaScript) ---------- */
.article .lead { font-size: 1.06em; color: var(--text-2); margin: -8px 0 26px; }
.static-toc { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); padding: 18px 22px; }
.static-toc h2 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.static-toc ul { list-style: none; margin: 0; padding: 0; }
.static-toc li { padding: 3px 0; font-size: 15px; }
.static-toc li.l3 { padding-left: 18px; font-size: 14px; }
.static-list { margin: 8px 0 18px; padding-left: 1.3em; line-height: 1.8; }
.home h3 { margin: 18px 0 4px; }
p.hero-meta { color: var(--text-2); font-size: 14px; }
p.hero-actions { margin: 26px 0 0; }
.fatal { margin: 16px auto; max-width: 720px; padding: 14px 18px; border-radius: var(--radius); background: var(--st-red-bg); color: var(--st-red-fg); font-weight: 600; }
.main > noscript .noscript { margin: 0 auto 40px; }

/* ---------- 404 ---------- */
body.nf { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.nf-box { max-width: 560px; text-align: center; }
.nf-code { font-size: 72px; font-weight: 800; letter-spacing: -.04em; color: var(--accent); margin: 0; line-height: 1; }
.nf-box h1 { margin: 12px 0 8px; font-size: 26px; }
.nf-box h2 { margin: 12px 0 8px; font-size: 20px; }
.nf-box hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

/* ---------- Formų kopijavimas į Word ---------- */
.form-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.form-bar p { flex: 1; min-width: 220px; margin: 0; font-size: .9em; color: var(--text-2); line-height: 1.5; }
.copy-row { display: flex; justify-content: flex-end; }
.prose > .copy-row { margin-top: 1.2em; }
.prose > .copy-row + .table-wrap, .prose > .copy-row + .scroll-hint { margin-top: .5em; }
.copy-table {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-elev);
  font-size: .8em; font-weight: 600; color: var(--text-2);
}
.copy-table:hover { color: var(--text); border-color: var(--accent-line); }
.copy-table svg { width: 14px; height: 14px; }
@media (max-width: 760px) { .form-bar .btn { width: 100%; } }
.copy-buffer { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
