/*
 * LuLawyer — app.css: the look "Tinta i pečat" (ink and seal) of the Web_UI
 * (cited-qa-agent design §3.11 "Visual design (approved 2026-10-29)", "Responsiveness and
 * motion"; QA Req 11.11, 11.13, 11.14, 11.19–11.22; task 24.1).
 *
 * Contract. Input: none (a static stylesheet; the page and later app.js only add class names
 * and data-statute attributes). Output: the tokens of design §3.11 as custom properties in
 * :root, the two system font stacks (plus one monospace stack for the Upozorenja echo), the
 * desktop layout (rail · thread · reader; the reader overlays the thread below 1280 px), and
 * one rule set per component of the answer view (legalagent_web/view.py: citations, grounding,
 * review, timelines, kind_data). Invariants the static tests hold (tests/unit/web/
 * test_styleguide_refs.py, test_styleguide_coverage.py; the test_css.py of task 26.3): no
 * web address and no url() to anything outside the repository; pane widths and
 * breakpoints are declared once, here in :root, and no other rule sets a width, min-width or
 * max-width in px except through var(…) (rem, ch, % and calc over var() are free); every text
 * colour on its background meets WCAG AA (≥ 4.5:1, measured by the coverage test); meaning is
 * never carried by colour alone (every state has a word, a pattern or a mark as well);
 * :focus-visible is styled; @media (prefers-reduced-motion: reduce) makes the stepper static;
 * light theme only — a dark theme or the deferred 360 px layout are later CSS-only additions.
 *
 * Statute colours are a data map keyed by statute_id ([data-statute="kz"], [data-statute="pz"]);
 * a Statute without an entry falls back to --statute-default, so adding a Statute to the KB
 * needs one line here and no code (design §3.11 "Tokens").
 */

/* ------------------------------------------------------------------ 1. tokens (design §3.11) */

:root {
  /* Palette — the eleven approved tokens. */
  --paper: #f7f4ee;
  --sheet: #ffffff;
  --ink: #1e2433;
  --muted: #5e6573;
  --rule: #e3ddd2;
  --seal-red: #9b2c2c;
  --approved-green: #2f6b4f;
  --pending-amber: #b7791f;
  --statute-kz: #33438c;
  --statute-pz: #1f6f6b;
  --statute-default: #4a5160;
  --marker: #f5e6a3;

  /* Derived shades (task 24.1). --pending-amber reads 3.6:1 on white, so it is used for
     outlines, stripes and marks only; text set in the amber context uses --pending-amber-text
     (7.1:1 on the sheet, 6.5:1 on its tint). The tints are the light backgrounds of the
     Upozorenja band, the pending seal and the compare change tags; --gold is the edge of the
     "Za vašu odluku" cards (a border, never text). */
  --pending-amber-text: #7a4f0e;
  --pending-amber-tint: #fbf3e4;
  --approved-green-tint: #eaf2ec;
  --seal-red-tint: #f8ecec;
  --gold: #a8862b;
  --focus-ring: var(--ink);
  --shadow: 0 0.5rem 1.5rem rgb(30 36 51 / 0.14);
  --backdrop: rgb(30 36 51 / 0.45);

  /* Type — system stacks only (Req 11.13). */
  --font-serif: "Sitka Text", Cambria, Georgia, "Times New Roman", serif;
  --font-ui: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --font-mono: Consolas, "Cascadia Mono", ui-monospace, monospace;
  --text-xs: 0.75rem;
  --text-s: 0.8125rem;
  --text-m: 0.9375rem;
  --text-l: 1.125rem;
  --text-xl: 1.5rem;
  --text-xxl: 2.25rem;
  --lh: 1.55;
  --lh-law: 1.65;

  /* Space and radius. */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --radius-s: 3px;
  --radius: 6px;
  --radius-pill: 999px;

  /* Panes and breakpoints (design §3.11 "Layout", "Responsiveness and motion"). The two
     breakpoints are repeated as literals in the @media rules below, because var() is not
     allowed inside a media query; they are declared here so the value is documented once. */
  --rail-w: 260px;
  --reader-w: 440px;
  --thread-measure: 72ch;
  --topbar-h: 56px;
  --bp-desktop: 1280px;
  --bp-usable: 1024px;
}

/* --------------------------------------------------------------------------- 2. base and type */

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 100%;
  line-height: var(--lh);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
}

/* The page (task 26.1): .app and .login-stage size themselves in percent of the body, so the
   chain html → body needs a definite height; the thread then scrolls internally and the reader
   overlay below 1280 px pins to the app area (the style guide gives its frame a height). */
html,
body {
  height: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 var(--s-3);
  color: var(--ink);
  overflow-wrap: anywhere;
}

h1 {
  font-size: var(--text-xxl);
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-l);
}

p {
  margin: 0 0 var(--s-3);
}

a {
  color: var(--statute-kz);
  text-underline-offset: 0.15em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* The page toggles its stages, dialogs and the stepper with the hidden attribute (task 26.1);
   the author display rules of those components (grid, flex) would otherwise win over the
   user-agent's [hidden] { display: none }. */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  margin: -0.0625rem;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Law text and headings in the serif; everything else in the UI stack. */
.law {
  font-family: var(--font-serif);
  font-size: var(--text-l);
  line-height: var(--lh-law);
}

/* Labels — article labels, kickers, seal text — in small caps with a little tracking. */
.label {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Dates and counts in tabular figures, so columns of dates line up. */
.date,
time,
.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-s);
}

.kicker {
  display: block;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: var(--s-1);
}

/* The statute colour map — keyed by statute_id; a data task, not a code change. */
[data-statute] {
  --statute-color: var(--statute-default);
}

[data-statute="kz"] {
  --statute-color: var(--statute-kz);
}

[data-statute="pz"] {
  --statute-color: var(--statute-pz);
}

/* ---------------------------------------------------------------------------- 3. app layout */

.app {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--reader-w);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  grid-template-areas:
    "topbar topbar topbar"
    "rail thread reader";
  height: 100%;
  min-height: 0;
  background: var(--paper);
  overflow: hidden;
}

.app:not(.has-reader) {
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  grid-template-areas:
    "topbar topbar"
    "rail thread";
}

.app:not(.has-reader) .reader {
  display: none;
}

/* Top bar: app name, the "Na dan" pill, the Statute_Filter chips, the user menu. */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-4);
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: var(--text-l);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--seal-red);
  flex: none;
}

.date-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--sheet);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.date-pill .label {
  color: var(--muted);
}

/* On the page the pill is a <label> around a native date input (task 26.1): the input drops
   its own box and inherits the pill's font and colour. */
.date-pill input {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  min-width: 0;
}

.statute-chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-2);
  padding: 0.1em var(--s-3);
  border: 1px solid var(--statute-color, var(--statute-default));
  border-radius: var(--radius-pill);
  background: var(--sheet);
  color: var(--statute-color, var(--statute-default));
  font-weight: 600;
  font-size: var(--text-s);
  cursor: pointer;
  white-space: nowrap;
}

/* A selected Statute carries a check mark as well as the fill (never colour alone). */
.statute-chip[aria-pressed="true"]::before {
  content: "✓";
  font-weight: 700;
}

.statute-chip[aria-pressed="false"] {
  border-style: dashed;
  color: var(--muted);
}

.statute-chip[aria-pressed="false"]::before {
  content: "";
  display: inline-block;
  width: 0.65em;
  height: 0.65em;
  border: 1px solid var(--muted);
  border-radius: 2px;
  align-self: center;
}

.statute-chip .coverage {
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.user-menu {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  white-space: nowrap;
}

/* Left rail "Razgovori". */
.rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper);
  border-right: 1px solid var(--rule);
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
}

.rail-head h2 {
  margin: 0;
  font-size: var(--text-m);
  font-family: var(--font-ui);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0 var(--s-2) var(--s-2);
  overflow: auto;
  display: grid;
  gap: 2px;
  align-content: start;
}

.rail-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.rail-item:hover {
  background: var(--sheet);
}

.rail-item.is-active {
  background: var(--sheet);
  box-shadow: inset 3px 0 0 var(--ink);
  font-weight: 600;
}

.rail-item-title {
  display: block;
}

.rail-item-meta {
  display: flex;
  gap: var(--s-2);
  align-items: baseline;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-block;
  padding: 0 0.5em;
  border-radius: var(--radius-pill);
  border: 1px dashed var(--pending-amber);
  background: var(--pending-amber-tint);
  color: var(--pending-amber-text);
  font-weight: 600;
}

/* Centre thread: the reading column, the composer, the one-line legal footer (chrome). */
.thread {
  grid-area: thread;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
/* Iustitia as a watermark behind the thread (owner's request at checkpoint 27, 2026-10-31; the
   pattern of the HockeyIQ mascot): the owner's Lady Justice silhouette traced to one path
   (docs/design/2026-10-31_Iustitia-watermark-source.png), tall, faint, standing bottom right
   with her feet above the composer, never in the way. Inline SVG, because app.css loads no file.
   The thread's own children stack above it. */
.watermark {
  position: absolute;
  color: var(--ink);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}
/* Three figures, each whole (never cut off) and clear of the composer and footer (about 10rem at
   the bottom of the thread): one centred while the thread is empty, one in each margin beside
   the output column once a conversation has a Question. The margin figures take the room left
   beside the column (nothing when the column fills the thread). */
.watermark--centre {
  left: 50%;
  top: calc((100% - 10rem) / 2);
  transform: translate(-50%, -50%);
  height: min(calc(100% - 14rem), 36rem);
  width: auto;
}
.watermark--side {
  top: calc((100% - 10rem) / 2);
  transform: translateY(-50%);
  height: min(calc(100% - 14rem), 32rem);
  width: max(0px, calc((100% - var(--thread-measure)) / 2 - 3rem));
}
.watermark--left {
  left: 1.5rem;
}
.watermark--right {
  right: 1.5rem;
}
.thread:has(.question) .watermark--centre,
.thread:not(:has(.question)) .watermark--side {
  display: none;
}
.thread > :not(.watermark) {
  position: relative;
  z-index: 1;
}

.thread-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--s-5) var(--s-4);
}

.thread-inner {
  max-width: var(--thread-measure);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.question {
  align-self: flex-end;
  max-width: 85%;
  padding: var(--s-3) var(--s-4);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  color: var(--muted);
  font-size: var(--text-xs);
  margin-top: var(--s-1);
}

.composer {
  border-top: 1px solid var(--rule);
  background: var(--sheet);
  padding: var(--s-3) var(--s-4);
}

.composer-inner {
  max-width: var(--thread-measure);
  margin: 0 auto;
  display: grid;
  gap: var(--s-2);
}

.composer textarea {
  width: 100%;
  min-height: 3.5rem;
  resize: vertical;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: var(--font-ui);
}

.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  position: relative;
  cursor: pointer;
  font-size: var(--text-s);
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0.0625rem;
  height: 0.0625rem;
}

.switch-track {
  position: relative;
  display: inline-block;
  width: 2.25rem;
  height: 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--rule);
  border: 1px solid var(--muted);
  transition: background 0.15s;
  flex: none;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--sheet);
  border: 1px solid var(--muted);
  transition: transform 0.15s;
}

.switch input:checked + .switch-track {
  background: var(--ink);
  border-color: var(--ink);
}

.switch input:checked + .switch-track::after {
  transform: translateX(1rem);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.switch-state {
  color: var(--muted);
}

.legal-footer {
  padding: var(--s-2) var(--s-4);
  border-top: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted);
  font-size: var(--text-xs);
  text-align: center;
}

/* Right reader "Čitač propisa". */
.reader {
  grid-area: reader;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--sheet);
  border-left: 1px solid var(--rule);
}

.reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--rule);
}

.reader-head h2 {
  margin: 0;
  font-size: var(--text-m);
  font-family: var(--font-ui);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.reader-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--s-4);
}

.reader-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  margin: 0;
}

.reader-heading {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  margin: 0 0 var(--s-2);
}

.reader-path {
  color: var(--muted);
  font-size: var(--text-xs);
  margin-bottom: var(--s-2);
}

.reader-path span + span::before {
  content: " › ";
}

.reader-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s-1) var(--s-3);
  margin: var(--s-3) 0;
  font-size: var(--text-s);
}

.reader-meta dt {
  color: var(--muted);
  font-weight: 600;
}

.reader-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.reader-text {
  font-family: var(--font-serif);
  font-size: var(--text-l);
  line-height: var(--lh-law);
}

.reader-text p {
  margin: 0 0 var(--s-2);
}

/* The quote span highlighted like a marker pen. */
mark,
.marker {
  background: var(--marker);
  color: inherit;
  padding: 0 0.1em;
  border-radius: var(--radius-s);
  box-shadow: 0 0 0 1px var(--marker);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.reader-versions {
  list-style: none;
  margin: var(--s-2) 0;
  padding: 0;
  display: grid;
  gap: var(--s-1);
  font-size: var(--text-s);
}

.reader-versions li {
  display: flex;
  gap: var(--s-2);
  align-items: baseline;
}

.reader-versions .is-current {
  font-weight: 600;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

/* ------------------------------------------------------------------- 4. the answer card */

.answer {
  position: relative;
  min-width: 0;
  padding: var(--s-4) var(--s-5);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.answer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* The status line is always the first line of the artifact (Req 6.1). */
.status-line {
  font-weight: 600;
  margin: 0;
}

.answer-header {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s-1) var(--s-3);
  margin: var(--s-3) 0;
  font-size: var(--text-s);
}

.answer-header dt {
  color: var(--muted);
  font-weight: 600;
}

.answer-header dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.answer-body {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: var(--lh-law);
}

.answer-body h3,
.answer-body h4 {
  font-size: var(--text-l);
  margin: var(--s-4) 0 var(--s-2);
}

.answer-body ul,
.answer-body ol {
  padding-left: var(--s-5);
  margin: 0 0 var(--s-3);
}

.role-line {
  color: var(--muted);
  font-size: var(--text-s);
  margin: var(--s-3) 0 0;
}

.answer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule);
}

.kind-tag {
  display: inline-block;
  padding: 0 0.5em;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ----------------------------------------------------- 5. citation chips and the hover card */

/* A chip is coloured by its Statute and always carries the text label ("KZ 228/1"); the
   [n] marker of the Markdown becomes the chip's number. */
.cite {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  padding: 0 0.45em;
  border: 1px solid var(--statute-color, var(--statute-default));
  border-radius: var(--radius-s);
  background: var(--sheet);
  color: var(--statute-color, var(--statute-default));
  font-family: var(--font-ui);
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-decoration: none;
  vertical-align: 0.1em;
  white-space: nowrap;
  cursor: pointer;
}

.cite::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--statute-color, var(--statute-default));
  align-self: center;
  flex: none;
}

.cite:hover,
.cite:focus-visible,
.cite.is-active {
  background: var(--statute-color, var(--statute-default));
  color: var(--sheet);
}

.cite:hover::before,
.cite:focus-visible::before,
.cite.is-active::before {
  background: var(--sheet);
}

.cite-n {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.cite-n::before {
  content: "[";
}

.cite-n::after {
  content: "]";
}

.cite-wrap {
  position: relative;
  display: inline-block;
}

.cite-card {
  display: none;
  position: absolute;
  z-index: 10;
  left: 0;
  top: calc(100% + var(--s-1));
  width: 22rem;
  max-width: 80vw;
  padding: var(--s-3) var(--s-4);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--statute-color, var(--statute-default));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font-ui);
  font-size: var(--text-s);
  white-space: normal;
  text-align: left;
}

.cite-wrap:hover .cite-card,
.cite-wrap:focus-within .cite-card,
.cite-card.is-open {
  display: block;
}

.cite-card-title {
  font-family: var(--font-serif);
  font-size: var(--text-m);
  margin: 0 0 var(--s-2);
}

.cite-card dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s-1) var(--s-3);
  margin: 0;
}

.cite-card dt {
  color: var(--muted);
}

.cite-card dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------- 6. quotes and notes */

/* A quoted provision: serif block quote with a rule in the statute colour. */
.quote {
  margin: var(--s-3) 0;
  padding: var(--s-2) var(--s-4);
  border-left: 4px solid var(--statute-color, var(--statute-default));
  background: var(--paper);
  font-family: var(--font-serif);
  font-size: var(--text-l);
  line-height: var(--lh-law);
}

.quote p {
  margin: 0;
}

.quote .label {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-s);
  color: var(--statute-color, var(--statute-default));
  margin-bottom: var(--s-1);
}

.quote-source {
  display: block;
  margin-top: var(--s-1);
  font-family: var(--font-ui);
  font-size: var(--text-s);
  color: var(--muted);
}

/* Napomene: small notes with an icon — clock (later version), hourglass (not yet in force),
   map (coverage, or a Statute not in the KB). The sentence carries the meaning; the icon is
   a cue. */
.notes {
  list-style: none;
  margin: var(--s-2) 0;
  padding: 0;
  display: grid;
  gap: var(--s-1);
}

.note {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--radius-s);
  background: var(--paper);
  font-size: var(--text-s);
  color: var(--ink);
}

.note-icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1em;
  color: var(--muted);
}

.note--later .note-icon {
  color: var(--pending-amber-text);
}

.note--pending .note-icon {
  color: var(--statute-kz);
}

.note--coverage .note-icon {
  color: var(--statute-pz);
}

/* Upozorenja o sadržaju: a striped amber band; the text seen is echoed in monospace. */
.warn-band {
  position: relative;
  margin: var(--s-3) 0;
  padding: var(--s-3) var(--s-4) var(--s-3) calc(var(--s-4) + 0.875rem);
  overflow: hidden;
  background: var(--pending-amber-tint);
  border: 1px solid var(--pending-amber);
  border-radius: var(--radius);
  font-size: var(--text-s);
}

.warn-band::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.75rem;
  background: repeating-linear-gradient(
    135deg,
    var(--pending-amber) 0 0.375rem,
    var(--pending-amber-tint) 0.375rem 0.75rem
  );
}

.warn-band-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0 0 var(--s-2);
  color: var(--pending-amber-text);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.warn-icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
}

.warn-item {
  margin: 0 0 var(--s-1);
}

.warn-echo {
  display: block;
  margin-top: var(--s-1);
  padding: var(--s-1) var(--s-2);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  font-family: var(--font-mono);
  font-size: var(--text-s);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------- 7. "Za vašu odluku" (Review_Point) */

.review-point {
  margin: var(--s-3) 0;
  padding: var(--s-3) var(--s-4);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: var(--text-m);
}

.review-point .kicker {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.scale-icon {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.review-point-q {
  font-family: var(--font-serif);
  font-weight: 600;
  margin: 0 0 var(--s-2);
}

/* Alternatives are unranked: no marker, no number, no highlight (B1). */
.alternatives {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-1);
}

.alternatives li {
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-s);
  background: var(--paper);
}

.review-point-decided {
  margin: var(--s-2) 0 0;
  font-size: var(--text-s);
}

.review-point-decided .label {
  color: var(--approved-green);
}

/* ---------------------------------------------------------- 7a. "Prijedlozi" (Suggestion) */

/* The assistant's suggestions to the lawyer (2026-10-31): a sheet card with an ink rule —
 * distinct from the Claims and from the gold "Za vašu odluku" cards — the items unnumbered,
 * the → sign as their marker: the assistant's hand, not a ranking. */
.suggestions {
  margin: var(--s-3) 0;
  padding: var(--s-3) var(--s-4);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: var(--text-m);
}

.suggestions .kicker {
  margin-bottom: 0;
}

.suggestions-list {
  list-style: none;
  margin: var(--s-2) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}

.suggestion {
  position: relative;
  padding-left: 1.4em;
}

.suggestion::before {
  content: "\2192";
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* ---------------------------------------------------------------------------- 8. the seal */

.seal {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.2em 0.7em;
  border: 2px solid currentColor;
  border-radius: var(--radius-s);
  font-family: var(--font-ui);
  font-variant-caps: all-small-caps;
  font-weight: 700;
  font-size: var(--text-m);
  letter-spacing: 0.08em;
  line-height: 1.3;
  white-space: nowrap;
  transform: rotate(-1.5deg);
}

.seal--pending {
  color: var(--pending-amber-text);
  border-color: var(--pending-amber);
  border-style: dashed;
  background: var(--pending-amber-tint);
}

.seal--approved {
  color: var(--approved-green);
  border-style: solid;
  background: var(--sheet);
}

.seal--rejected {
  color: var(--seal-red);
  border-style: solid;
  background: var(--sheet);
}

.seal-icon {
  width: 1em;
  height: 1em;
  flex: none;
}

.seal-detail {
  font-variant-caps: normal;
  font-weight: 500;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.seal-wrap {
  display: inline-grid;
  gap: var(--s-1);
  justify-items: start;
}

.seal-reason {
  font-size: var(--text-s);
  color: var(--ink);
}

.seal-reason .label {
  color: var(--seal-red);
}

/* ----------------------------------------------------------------- 9. the grounding meter */

/* One cell per retrieved Article_Version: outline = pronađeno, hatched = pročitano, filled =
   citirano; the counts are written out beside it. A click opens the sources view. */
.grounding {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 100%;
  gap: var(--s-1);
  padding: var(--s-1) 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.grounding-counts {
  color: var(--muted);
  font-size: var(--text-s);
  font-variant-numeric: tabular-nums;
}

.grounding-counts b {
  color: var(--ink);
}

/* Checkpoint 27 (2026-10-31): the cells shrink to the card's width (forty cells at 0.9rem ran
   past the card's edge); a cell is at most 0.9rem and never narrower than 0.3rem. */
.grounding-bar {
  display: flex;
  gap: 0.125rem;
  height: 0.5rem;
  max-width: 100%;
}

.grounding-cell {
  flex: 1 1 0.9rem;
  min-width: 0.3rem;
  max-width: 0.9rem;
  border: 1px solid var(--muted);
  border-radius: 1px;
  background: var(--sheet);
}

.grounding-cell--read {
  background: repeating-linear-gradient(
    135deg,
    var(--muted) 0 0.1rem,
    var(--sheet) 0.1rem 0.25rem
  );
}

.grounding-cell--cited {
  background: var(--ink);
  border-color: var(--ink);
}

/* ------------------------------------------------------------- 10. buttons and the action bar */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--ink);
  font-size: var(--text-s);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}

.btn:hover {
  background: var(--paper);
}

.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}

.btn--primary:hover {
  box-shadow: inset 0 0 0 10rem rgb(255 255 255 / 0.1);
}

.btn--danger {
  color: var(--seal-red);
  border-color: var(--seal-red);
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-icon {
  width: 1em;
  height: 1em;
  flex: none;
}

.menu-btn::after {
  content: "▾";
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}

.actions-hint {
  color: var(--muted);
  font-size: var(--text-xs);
}

.menu-wrap {
  position: relative;
  display: inline-block;
}

.menu {
  display: none;
  position: absolute;
  z-index: 10;
  right: 0;
  top: calc(100% + var(--s-1));
  min-width: 10rem;
  margin: 0;
  padding: var(--s-1);
  list-style: none;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.menu.is-open {
  display: block;
}

.menu-item {
  display: block;
  width: 100%;
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: var(--text-s);
  cursor: pointer;
}

.menu-item:hover {
  background: var(--paper);
}

/* ------------------------------------------------------------- 11. the validity timeline */

/* Drawn from view.timelines (design §3.10): the label's published versions as segments on a
   thin track from the Coverage_Start to the last valid_from; the version used filled, later
   versions hatched, provisions not yet in force dashed, a deletion crossed; a pin at the
   As_Of_Date. Segment positions come as inline left/width percentages (data, not style). */
.timeline {
  --tl-h: 0.75rem;
  position: relative;
  margin: var(--s-3) 0;
  padding: var(--s-5) 0 var(--s-5);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--muted);
}

.timeline-track {
  position: relative;
  height: var(--tl-h);
  border-radius: var(--radius-pill);
  background: var(--rule);
}

.timeline-seg {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 2px;
}

.timeline-seg--earlier {
  background: var(--sheet);
  border: 1px solid var(--muted);
}

.timeline-seg--used {
  background: var(--ink);
  border: 1px solid var(--ink);
}

.timeline-seg--later {
  background: repeating-linear-gradient(
    135deg,
    var(--muted) 0 0.15rem,
    var(--sheet) 0.15rem 0.4rem
  );
  border: 1px solid var(--muted);
}

.timeline-seg--future {
  background: var(--sheet);
  border: 2px dashed var(--muted);
}

.timeline-seg--deleted {
  background: var(--sheet);
  border: 1px solid var(--seal-red);
}

.timeline-seg--deleted::before,
.timeline-seg--deleted::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1rem;
  height: 0.125rem;
  background: var(--seal-red);
  transform: translate(-50%, -50%) rotate(45deg);
}

.timeline-seg--deleted::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.timeline-date {
  position: absolute;
  top: calc(var(--tl-h) + 0.3rem);
  transform: translateX(-50%);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Labels at the track's ends are aligned inwards so they never leave the card. */
.timeline-date--start {
  transform: none;
}

.timeline-date--end {
  transform: translateX(-100%);
}

.timeline-pin {
  position: absolute;
  top: calc(-1 * var(--s-2));
  bottom: calc(-1 * var(--s-2));
  width: 0.125rem;
  background: var(--seal-red);
  transform: translateX(-50%);
}

.timeline-pin::before {
  content: "";
  position: absolute;
  top: -0.3rem;
  left: 50%;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--seal-red);
  transform: translateX(-50%);
}

.timeline-pin-label {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: var(--seal-red);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* A pin near either end keeps its label inside the track. */
.timeline-pin--late .timeline-pin-label {
  left: auto;
  right: 0;
  transform: none;
}

.timeline-pin--early .timeline-pin-label {
  left: 0;
  transform: none;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin: var(--s-4) 0 0;
  padding: 0;
  list-style: none;
}

.timeline-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.timeline-legend .timeline-seg {
  position: relative;
  display: inline-block;
  width: 1.25rem;
  height: 0.6rem;
}

/* ---------------------------------------------------------------- 12. the compare view */

/* Two columns headed by the two dates; word marks from CompareResult (inserted words
   underlined green inside <ins>, deleted words struck through red inside <del>); unchanged
   stavci folded. */
.compare {
  min-width: 0;
}

.compare-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-4);
  margin: var(--s-3) 0;
}

.compare-date {
  padding-bottom: var(--s-1);
  border-bottom: 2px solid var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.compare-date .muted {
  display: block;
  font-weight: 400;
  font-size: var(--text-xs);
}

.compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-2) var(--s-4);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--rule);
}

.compare-row-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  font-size: var(--text-s);
}

.change-tag {
  display: inline-block;
  padding: 0 0.5em;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
}

.change-tag--nepromijenjen {
  color: var(--muted);
  background: var(--paper);
}

.change-tag--izmijenjen {
  color: var(--pending-amber-text);
  background: var(--pending-amber-tint);
}

.change-tag--dodan {
  color: var(--approved-green);
  background: var(--approved-green-tint);
}

.change-tag--brisan {
  color: var(--seal-red);
  background: var(--seal-red-tint);
}

.compare-cell {
  min-width: 0;
  font-family: var(--font-serif);
  line-height: var(--lh-law);
  overflow-wrap: anywhere;
}

.compare-empty {
  color: var(--muted);
  font-style: italic;
}

ins.word-ins {
  color: inherit;
  background: var(--approved-green-tint);
  text-decoration: underline;
  text-decoration-color: var(--approved-green);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.12em;
}

del.word-del {
  color: inherit;
  background: var(--seal-red-tint);
  text-decoration: line-through;
  text-decoration-color: var(--seal-red);
  text-decoration-thickness: 2px;
}

.compare-folded {
  margin: var(--s-2) 0;
  padding: var(--s-2) var(--s-3);
  border: 1px dashed var(--muted);
  border-radius: var(--radius);
}

.compare-folded summary {
  cursor: pointer;
  color: var(--muted);
  font-size: var(--text-s);
}

.compare-folded[open] summary {
  margin-bottom: var(--s-2);
}

.compare-summary {
  margin: var(--s-2) 0 0;
  color: var(--muted);
  font-size: var(--text-s);
}

/* ------------------------------------------------------- 13. the statute page (lookup) */

.statute-page {
  padding: var(--s-5) var(--s-6);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-serif);
}

.statute-page-label {
  margin: 0;
  font-size: var(--text-xxl);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.statute-page-heading {
  margin: 0 0 var(--s-3);
  font-size: var(--text-l);
  font-style: italic;
  color: var(--muted);
}

.stavci {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stavak;
}

.stavci li {
  counter-increment: stavak;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: var(--s-2);
  margin-bottom: var(--s-2);
  line-height: var(--lh-law);
}

.stavci li::before {
  content: "(" counter(stavak) ")";
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.nn-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-3) 0;
  padding: 0;
  list-style: none;
}

.nn-tag {
  padding: 0.1em 0.6em;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-s);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------- 14. the registry-note card (stop) */

.stop-card {
  position: relative;
  padding: var(--s-4) var(--s-5);
  background: var(--sheet);
  border: 3px double var(--ink);
  border-radius: 2px;
  box-shadow: 0.25rem 0.25rem 0 var(--rule);
}

.stop-card-kicker {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-2);
  color: var(--muted);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stop-card-text {
  font-family: var(--font-serif);
  font-size: var(--text-l);
  margin: 0;
}

/* ------------------------------------------------- 15. not found, clarification, error */

/* A calm neutral card — never the error style (Req 11.11). */
.notfound {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-4);
  align-items: start;
  padding: var(--s-5);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.empty-drawer {
  width: 4.5rem;
  height: 4.5rem;
  color: var(--muted);
}

.notfound h3 {
  margin-top: 0;
}

.searched {
  padding: 0.1em 0.4em;
  border-radius: var(--radius-s);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--text-s);
}

.nearest {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-2) 0 0;
  padding: 0;
  list-style: none;
}

.clarify {
  padding: var(--s-4) var(--s-5);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.clarify-q {
  font-family: var(--font-serif);
  font-size: var(--text-l);
  margin: 0 0 var(--s-2);
}

.clarify-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.error-card {
  padding: var(--s-4) var(--s-5);
  background: var(--sheet);
  border: 1px solid var(--seal-red);
  border-left-width: 6px;
  border-radius: var(--radius);
}

.error-card-title {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0 0 var(--s-2);
  color: var(--seal-red);
  font-weight: 700;
}

.error-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}

.form-error {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-2) 0;
  color: var(--seal-red);
  font-size: var(--text-s);
}

/* --------------------------------------------------------------------- 16. the stepper */

/* Tražim → Čitam → Sastavljam → Provjeravam, bound to the SSE status stages; done = filled
   dot, active = ringed dot (pulsing unless reduced motion), waiting = hollow dot; the words
   "završeno / u tijeku / čeka" are present for assistive technology. */
.stepper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: var(--s-2) 0;
  list-style: none;
  color: var(--muted);
  font-size: var(--text-s);
}

.step {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.step::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: var(--sheet);
  flex: none;
}

.step:not(:last-child)::after {
  content: "→";
  color: var(--muted);
  margin-left: var(--s-1);
}

.step.is-done {
  color: var(--ink);
}

.step.is-done::before {
  background: var(--ink);
  border-color: var(--ink);
}

.step.is-active {
  color: var(--ink);
  font-weight: 600;
}

.step.is-active::before {
  border-color: var(--ink);
  box-shadow: 0 0 0 0.2rem var(--rule);
  animation: step-pulse 1.2s ease-in-out infinite;
}

@keyframes step-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--rule);
  }

  50% {
    box-shadow: 0 0 0 0.35rem var(--rule);
  }
}

.live-status {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-s);
}

/* ------------------------------------------------------------- 17. login card and fields */

/* Checkpoint 27 (2026-10-31): a flex stage with `margin: auto` on the card centres it when it
   fits and scrolls from the top when it does not — `place-items: center` on a full-height grid
   clipped the brand and the first notice title above the viewport on a short window. */
.login-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  overflow: auto;
  padding: var(--s-6);
  background: var(--paper);
}

.login {
  width: 100%;
  max-width: 30rem;
  margin: auto;
  padding: var(--s-6);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.login-brand .brand {
  font-size: var(--text-xl);
}

.login-sub {
  color: var(--muted);
  font-size: var(--text-s);
}

/* The four Legal_Notice titles (design §3.10 "Legal_Notice content"). */
.notice-titles {
  display: grid;
  gap: var(--s-2);
  margin: 0 0 var(--s-5);
  padding: 0;
  list-style: none;
}

.notice-titles li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-left: 3px solid var(--rule);
  font-family: var(--font-serif);
}

.notice-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  margin-top: 0.15em;
  color: var(--seal-red);
}

.field {
  display: grid;
  gap: var(--s-1);
  margin-bottom: var(--s-3);
}

.field label {
  font-size: var(--text-s);
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  background: var(--sheet);
  font-family: var(--font-ui);
}

.field textarea {
  min-height: 4rem;
  resize: vertical;
}

.field-hint {
  color: var(--muted);
  font-size: var(--text-xs);
}

.login .btn--primary {
  width: 100%;
  justify-content: center;
}

/* ------------------------------------------------------------------------- 18. dialogs */

/* role="dialog" aria-modal="true"; the body scrolls internally (design §3.11). */
.dialog-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: var(--s-5);
  background: var(--backdrop);
}

.dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 40rem;
  max-height: 100%;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--rule);
}

.dialog-head h2 {
  margin: 0;
}

.dialog-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--s-4) var(--s-5);
}

.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--rule);
}

.dialog-foot .actions-hint {
  margin-right: auto;
}

.dialog--ack {
  max-width: 44rem;
}

.dialog--review {
  max-width: 40rem;
}

/* The acknowledgement dialog: the four full texts, one confirm button. */
.notice {
  margin-bottom: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-serif);
}

.notice:last-child {
  border-bottom: 0;
}

.notice h3 {
  margin-bottom: var(--s-1);
}

/* The review dialog: one item per Review_Point with prihvati / uredi / ukloni. */
.review-item {
  margin-bottom: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
}

.review-item.is-resolved {
  border-left-color: var(--approved-green);
}

.review-item-q {
  font-family: var(--font-serif);
  font-weight: 600;
  margin: 0 0 var(--s-2);
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin: var(--s-2) 0;
  font-size: var(--text-s);
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  cursor: pointer;
}

.review-choices {
  display: grid;
  gap: var(--s-1);
  margin: var(--s-2) 0 0 var(--s-5);
  padding: 0;
  list-style: none;
  font-size: var(--text-s);
}

.resolved-mark {
  color: var(--approved-green);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* ------------------------------------------------------- 19. responsiveness and motion */

/* Below 1280 px (--bp-desktop) the reader overlays the thread instead of taking a column;
   the grid keeps rail and thread, so nothing scrolls horizontally at 1024 px (--bp-usable). */
@media (max-width: 1279.98px) {
  .app,
  .app.has-reader {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    grid-template-areas:
      "topbar topbar"
      "rail thread";
  }

  .app.has-reader .reader {
    position: absolute;
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    z-index: 5;
    width: var(--reader-w);
    box-shadow: var(--shadow);
  }

  /* The top bar keeps one line: the chips drop their coverage text (it stays in the title). */
  .statute-chip .coverage {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step.is-active::before {
    animation: none;
    box-shadow: 0 0 0 0.2rem var(--rule);
  }

  .btn,
  .switch-track,
  .switch-track::after {
    transition: none;
  }
}
