/* BUKA — design handoff "BUKA visual restyle" (7 Oct 2026).
   Warm paper, charcoal ink, one orange-red accent, one grotesk. Square corners, 1–2 px rules instead of cards
   and shadows. Layout: a 280 px sidebar beside the page; sections are a 240 px head column beside the content.
   Status is never colour only: text, plus a square marker for failures and the verdict. */

/* The @font-face rules of Hanken Grotesk are in Pages/Shared/_Fonts.cshtml: they need the fingerprinted font addresses. */

:root {
    --paper: #EEE5D2;
    --ink: #2A2925;
    --ink-2: #4F4A42;
    --muted: #5E594F;
    --placeholder: #8A8374;
    --rule-light: #CFC4AC;
    --accent: #C8391A;
    /* Only for the verdict of a project that passes (user request; the handoff has no green). */
    --pass: #3B7A3C;
    --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    /* Vertical rhythm: metadata row → hero gap → H1 → content gap → content; sections are apart by the section gap. */
    --gap-hero: 96px;
    --gap-content: 72px;
    --gap-section: 96px;
    --gap-footer: 160px;
    color-scheme: light;
}

.page.hero {
    --gap-hero: 180px;
    --gap-content: 120px;
    --gap-section: 140px;
    --gap-footer: 200px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; transition: color 120ms; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { text-wrap: balance; }
h2 { margin: 0 0 20px; font-size: 30px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; }
h3 { margin: 40px 0 16px; font-size: 18px; font-weight: 500; line-height: 1.3; }
h4 { margin: 24px 0 8px; font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
p { margin: 8px 0; }
ol, ul { padding-left: 1.2em; }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.5; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
.fail-text { color: var(--accent); }
.text-danger { color: var(--accent); }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Text fields show focus with their accent underline (below), not with a box. */
input:not([type="checkbox"]):not([type="radio"]):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* ---------- Shell ---------- */

.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
/* A tool over the whole window (layout ViewData "Tool", the building wizard): one column, the page draws its own bar. */
.shell.tool { grid-template-columns: minmax(0, 1fr); }
.page.tool { padding: 0; }
.page.tool .page-body { margin-top: 0; }

/* The sidebar is as high as the window and stays in place while the page scrolls. A long menu scrolls inside it,
   and the foot (account, sign-out, version) stays at the bottom of the window. */
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; overflow-y: auto; border-right: 1px solid var(--ink); padding: 40px 32px 0; display: flex; flex-direction: column; gap: 64px; min-width: 0; }
.brand-block { display: flex; flex-direction: column; gap: 8px; }
.brand { font-size: 22px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); }
.brand:hover { color: var(--accent); }
.brand-sub { font-size: 12px; line-height: 1.5; color: var(--muted); }

.nav { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule-light); }
/* „← Svi projekti” above the tabs of a project. */
.nav-project { display: flex; flex-direction: column; padding-bottom: 20px; min-width: 0; }
.nav-back { align-self: flex-start; font-size: 15px; color: var(--accent); }
.nav-back:hover { color: var(--ink); }
.nav .tab { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--rule-light); color: var(--ink); font-size: 16px; }
.nav .tab.group { border-top-color: var(--ink); }
.nav .tab .index { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav .tab .count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Errors and failing checks of the project on the tab Rezultati: .sign.error or .sign.fail (section "Message signs"), 12 px here. */
.nav .tab .count.alert { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.nav .tab .count.alert.errors { color: var(--accent); }
.nav .tab .count.alert .sign { width: 12px; height: 12px; font-size: 10px; vertical-align: 0; }
.nav .tab .count.alert .sign.fail::before { width: 8px; height: 8px; }
.nav .tab:hover .label { color: var(--accent); }
/* The current tab: a bold red label, no square (a filled red square is the sign „Ne zadovoljava”, PKP-343). Its count
   stays bold too. */
.nav .tab.active { font-weight: 600; }
.nav .tab.active .index, .nav .tab.active .label { color: var(--accent); font-weight: 600; }
.nav .tab.active:hover .label { color: var(--ink); }
/* „00 Čarobnjak”: the way back to the building wizard, above Info. The wand is in the column of the counts. */
.nav .tab.wizard .icon { margin: 0; align-self: center; color: var(--muted); }
.nav .tab.wizard:hover .icon { color: var(--accent); }

/* The bottom of the sidebar stays in the window: "Imate prijedlog?" (when Sentry is on), then the foot below the rule. */
.sidebar-bottom { position: sticky; bottom: 0; margin-top: auto; background: var(--paper); }
.sidebar-foot { display: flex; flex-direction: column; gap: 6px; padding: 16px 0 32px; border-top: 1px solid var(--rule-light); font-size: 13px; color: var(--muted); }
.sidebar-foot a { color: var(--ink); }
.sidebar-foot a:hover { color: var(--accent); }
.sidebar-foot form { margin: 0; }
/* The mark of a site that is not the main one (Buka:Label, for example „beta”), under the version. */
.sidebar-foot .site-label { align-self: flex-start; padding: 1px 6px; border: 1px solid var(--accent); color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.sidebar-foot button { justify-content: flex-start; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.sidebar-foot button:hover, .sidebar-foot button:focus-visible { background: none; color: var(--accent); }

/* "Imate prijedlog?" (design handoff "Imate prijedlog?", variant C): a speech bubble that lifts on hover, and now and
   then when the user is idle, while three dots "type" in it (wwwroot/js/feedback-nudge.js adds .is-nudging). */
.sidebar-feedback { padding-bottom: 22px; }
.feedback-link { all: unset; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--ink); font-family: inherit; font-size: 17px; font-weight: 500; line-height: 1.2; transition: color .25s ease; }
.feedback-link:hover { background: none; color: var(--accent); }
.feedback-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.feedback-icon { position: relative; display: block; width: 24px; height: 26px; }
.feedback-bubble { position: absolute; left: 0; top: 0; display: block; transform-origin: 30% 100%; transition: transform .25s ease; }
.feedback-shade { position: absolute; left: 3px; bottom: 0; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); opacity: 0; }
.feedback-dot { fill: currentColor; stroke: none; opacity: 0; }
.feedback-link:hover .feedback-bubble { transform: translateY(-3px) rotate(-6deg); }
.feedback-link:hover .feedback-shade { opacity: .18; transform: scaleX(.7); }
.feedback-link:hover .feedback-dot { opacity: 1; }
.feedback-link.is-nudging .feedback-bubble { animation: fb-lift 2.8s ease-in-out; }
.feedback-link.is-nudging .feedback-shade { animation: fb-shade 2.8s ease-in-out; }
.feedback-link.is-nudging .d1 { animation: fb-d1 2.8s ease-in-out; }
.feedback-link.is-nudging .d2 { animation: fb-d2 2.8s ease-in-out; }
.feedback-link.is-nudging .d3 { animation: fb-d3 2.8s ease-in-out; }
@keyframes fb-lift {
    0%, 100% { transform: translateY(0) rotate(0); }
    12%, 76% { transform: translateY(-5px) rotate(-6deg); }
    88% { transform: translateY(-1px) rotate(1deg); }
}
@keyframes fb-shade {
    0%, 100% { opacity: 0; transform: scaleX(1); }
    12%, 76% { opacity: .2; transform: scaleX(.6); }
}
@keyframes fb-d1 { 0%, 18%, 82%, 100% { opacity: 0; } 26%, 70% { opacity: 1; } }
@keyframes fb-d2 { 0%, 29%, 82%, 100% { opacity: 0; } 38%, 70% { opacity: 1; } }
@keyframes fb-d3 { 0%, 41%, 82%, 100% { opacity: 0; } 50%, 70% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .feedback-link .feedback-bubble, .feedback-link .feedback-shade, .feedback-link .feedback-dot { animation: none !important; transition: none; }
    .feedback-link:hover .feedback-bubble { transform: none; }
}

/* ---------- Page ---------- */

.page { padding: 40px 64px 120px; display: flex; flex-direction: column; min-width: 0; }
/* min-height: an empty row (the project list) keeps the vertical rhythm. */
.meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; min-height: 1.5em; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.meta-right { display: flex; gap: 24px; flex-wrap: wrap; }
.meta-end { display: flex; align-items: center; gap: 24px; min-width: 0; margin-left: auto; }
/* With only the button, the end does not shrink: in a narrow window a long project name is cut, and the button stays
   in the window (PKP-282). */
.meta-end:not(:has(.meta-right)) { flex-shrink: 0; }
.meta:has(.help) { flex-wrap: nowrap; align-items: center; }
/* Not .meta-end: on Info the row has no label, the button is then the first child, and a cut box has no upper and lower border (PKP-282). */
.meta:has(.help) > span:first-child:not(.meta-end) { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- Pomoć ---------- */
/* „Pomoć ?” (GuideHelp): an outline button in the upper right corner of a page and in the bar of the wizard. The box of
   the lesson shows below it with the pointer or the focus on the button. In the meta row the button does not make the
   row higher (the negative margins), so the title keeps its place. */
.help { position: relative; flex: none; display: inline-flex; font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.meta .help { margin: -16px 0; }
.help-button { gap: 10px; padding: 12px 14px 12px 18px; font-size: 15px; white-space: nowrap; }
.meta a.help-button { color: var(--ink); }
.meta a.help-button:hover { color: var(--paper); }
.help-sign { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 600; line-height: 1; transition: background-color 120ms, color 120ms; }
.help-button:hover .help-sign { background: var(--paper); color: var(--ink); }
.help-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-hint { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; display: none; width: max-content; max-width: min(320px, 80vw); padding: 10px 12px; border: 1px solid var(--ink); background: var(--paper); font-size: 14px; line-height: 1.4; text-align: left; }
.help:hover .help-hint, .help:focus-within .help-hint { display: block; }
.wz-tool .wz-nav .help-button { padding: 10px 12px 10px 16px; }
/* The bar of the wizard wraps below 1180px: the box opens to the right of the button. On a phone the button is only the
   sign „?”, so the bar keeps its width; the word stays as the name of the link. */
@media (max-width: 1180px) {
    .wz-tool .help-hint { left: 0; right: auto; }
}
@media (max-width: 560px) {
    .wz-tool .wz-nav .help-button { gap: 0; padding: 10px; font-size: 0; }
}
/* The name of the open project (and its group): one line, cut when it is long. */
.meta-project { min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.meta a { color: var(--ink); }
.meta a:hover { color: var(--accent); }
.page-title { margin: var(--gap-hero) 0 0; font-size: clamp(56px, 7.2vw, 104px); font-weight: 500; letter-spacing: -0.04em; line-height: 0.92; max-width: 16ch; }
.page.hero .page-title { max-width: none; }
.lead { margin: 28px 0 0; max-width: 640px; font-size: 18px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.page-body { margin-top: var(--gap-content); min-width: 0; }
.app-footer { margin-top: auto; padding-top: var(--gap-footer); }
.app-footer > div { max-width: 820px; border-top: 1px solid var(--rule-light); padding-top: 12px; font-size: 12px; line-height: 1.6; color: var(--muted); }
/* "Imate prijedlog?" in the page foot only on narrow screens: there the sidebar has no bottom part. */
.app-footer .feedback-footer { display: none; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.app-footer .feedback-footer:hover, .app-footer .feedback-footer:focus-visible { background: none; color: var(--accent); }
/* The feedback form of Sentry (wwwroot/js/sentry.js) in the colors and the font of BUKA. */
#sentry-feedback { --font-family: var(--font); --accent-background: var(--ink); --accent-foreground: var(--paper); --background: var(--paper); --foreground: var(--ink); --border: 1px solid var(--rule-light); --success-color: var(--pass); --error-color: var(--accent); }

/* Lettered sections: a head column (letter, title, sub-label) beside the content, under a 1 px ink rule. */
.section { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; border-top: 1px solid var(--ink); padding-top: 16px; margin-top: var(--gap-section); }
.page-body > .section:first-child { margin-top: 0; }
.section-head { display: flex; flex-direction: column; gap: 10px; }
.section-head h2 { margin: 0; }
.section-letter { font-size: 12px; font-weight: 600; color: var(--accent); }
.section-sub { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.section-body { min-width: 0; }

/* Blocks of the working tabs: a 1 px ink rule on top instead of a card. */
.card { border-top: 1px solid var(--ink); padding-top: 16px; min-width: 0; }
.card + .card, .card + .actions + .card { margin-top: 64px; }
.page-body > .card:first-child { margin-top: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
details.card > summary { cursor: pointer; list-style: none; font-size: 18px; font-weight: 500; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: " ↓"; }
details.card[open] > summary::after { content: " ↑"; }
details.card[open] > summary { margin-bottom: 16px; }

/* Columns that each start under a 2 px ink rule (new project, LLM steps). */
.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
.column { display: flex; flex-direction: column; gap: 20px; border-top: 2px solid var(--ink); padding-top: 16px; min-width: 0; }
.column-title { font-size: 18px; font-weight: 500; }
.column > form { display: flex; flex-direction: column; gap: 20px; flex: 1; }
.column .push { margin-top: auto; padding-top: 8px; }
.column-text { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.section.after-stats { margin-top: calc(var(--gap-hero) - var(--gap-content)); }

/* Plain rows under a 1 px ink rule (lists of text). */
ul.rows { list-style: none; margin: 0; padding: 0; max-width: 820px; }
ul.rows li { padding: 14px 0; border-bottom: 1px solid var(--rule-light); font-size: 16px; line-height: 1.5; }
ul.rows li:first-child { padding-top: 0; }

/* Česta pitanja: one row per question; a click opens the answer. */
.faq-list { max-width: 820px; }
details.faq { border-bottom: 1px solid var(--rule-light); }
details.faq > summary { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 16px 0; cursor: pointer; list-style: none; font-size: 18px; font-weight: 500; line-height: 1.35; }
details.faq:first-child > summary { padding-top: 0; }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after { content: "+"; flex: none; font-weight: 400; color: var(--accent); }
details.faq[open] > summary::after { content: "−"; }
details.faq > summary:hover { color: var(--accent); }
details.faq > p { margin: 0 0 20px; max-width: 680px; color: var(--ink-2); text-wrap: pretty; }
/* A limit of BUKA in a tab (Shared/_LimitNote): an open square, as a warning that is not about the project. */
.limit-note { position: relative; margin: 16px 0 0; padding-left: 22px; max-width: 820px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.limit-note::before { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border: 1px solid var(--ink-2); }

/* A small line icon before the text of a button or link (Shared/_WizardIcon). */
.icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 8px; flex: none; }

/* Novosti: a short text and a screenshot for each version, or a titled line above each of a few screenshots. */
.news { margin: 0; max-width: 820px; text-wrap: pretty; }
.shot + p.news { margin-top: 32px; }
p.news + p.news { margin-top: 12px; } /* titled points without a screenshot between them */
.shot { margin: 24px 0 0; max-width: 820px; }
.shot img { display: block; box-sizing: border-box; max-width: 100%; height: auto; padding: 12px; border: 1px solid var(--rule-light); }
.shot figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* Two signer tables side by side (Dio 9). */
.signers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.signers .column-title { padding-bottom: 16px; }
.signers > p { grid-column: 1 / -1; margin: 8px 0 0; }

/* ---------- Forms ---------- */

.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); column-gap: 32px; row-gap: 32px; }
.fields .wide { grid-column: 1 / -1; }
.fields.six { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 44px; }
.fields.six > .span-2 { grid-column: span 2; }
.fields.six > .span-3 { grid-column: span 3; }
.fields.six > .span-6, .fields.six > .wide { grid-column: span 6; }

/* Field labels keep their case: many hold units and symbols (m³, dB, δ, L′n,w) that uppercase would change.
   Labels of plain words get "caps", as in the design. */
/* space-between: when one label of a row wraps, the inputs of the row still share one line. */
label.field { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; line-height: 1.3; color: var(--ink-2); min-width: 0; }
.caps label.field, label.field.caps, .caps th, th.caps { text-transform: uppercase; letter-spacing: 0.06em; }
.help { margin: 8px 0 0; max-width: 680px; font-size: 14px; line-height: 1.5; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 10px; font-size: 16px; line-height: 1.35; color: var(--ink); cursor: pointer; }
label.check input { flex: none; }
label.check.top { align-items: flex-start; }
label.check.top input { margin-top: 4px; }
label.check .check-hint { display: block; margin-top: 4px; }
/* Podaci projekta (PKP-309): „Zona buke” and „Susjedne zone buke” side by side; the checks sit on the line of the select. */
.zone-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: end; }
.zone-neighbours { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.zone-checks { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 8px 0 11px; border-bottom: 1px solid var(--ink); }
@media (max-width: 720px) { .zone-fields { grid-template-columns: minmax(0, 1fr); } }
/* A room field: the label line also holds "+ Nova" and "Uredi" (the room dialog, _RoomActions). */
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.room-actions { display: inline-flex; gap: 12px; flex: none; }
.room-actions button { padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; }
.room-actions button:hover { background: none; color: var(--ink); }

input, select, textarea { font: inherit; font-size: 18px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 6px 0 10px; min-width: 0; outline: none; width: 100%; transition: border-color 120ms, box-shadow 120ms; }
input:focus, select:focus, textarea:focus { border-bottom-color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[readonly] { color: var(--ink-2); }
select { appearance: none; -webkit-appearance: none; padding-right: 24px; cursor: pointer; }
label.field:has(> select)::after, td:has(> select)::after { content: "↓"; position: absolute; right: 0; pointer-events: none; font-size: 16px; font-weight: 400; color: var(--ink); text-transform: none; }
label.field:has(> select)::after { bottom: 11px; }
textarea { border-top: 1px solid var(--rule-light); padding: 10px 0; resize: vertical; line-height: 1.5; }

input[type="checkbox"], input[type="radio"] { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; padding: 0; margin: 0; border: 1px solid var(--ink); background: transparent; flex: none; cursor: pointer; vertical-align: -2px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--ink); box-shadow: inset 0 0 0 3px var(--paper); }
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }
input[type="checkbox"]:checked:focus { box-shadow: inset 0 0 0 3px var(--paper); }

/* File picker: the native control is hidden; the label shows the file name like an underlined field. */
.field-label { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; line-height: 1.3; text-transform: uppercase; color: var(--ink-2); }
.file-pick { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.file-pick input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-pick .file-field { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ink); padding: 6px 0 10px; font-size: 18px; }
.file-pick .file-name { color: var(--placeholder); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick .file-name.chosen { color: var(--ink); }
.file-pick .file-action { font-size: 15px; white-space: nowrap; }
.file-pick:focus-within .file-field { border-bottom-color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }

/* ---------- Buttons ---------- */

button, .button { font: inherit; font-size: 16px; line-height: 1.25; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; transition: background-color 120ms, border-color 120ms, color 120ms; }
button:hover, .button:hover { background: var(--ink); color: var(--paper); }
/* The display above would show a button with the hidden attribute. */
button[hidden], .button[hidden] { display: none; }
button.primary, .button.primary { background: var(--ink); color: var(--paper); }
button.primary:hover, .button.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
button.danger { border-color: var(--accent); color: var(--accent); }
button.danger:hover { background: var(--accent); color: var(--paper); }
/* Add links: "+ Dodaj …", a row under a table. */
button.link, a.link { display: flex; justify-content: flex-start; width: 100%; padding: 16px 0; border: 0; border-bottom: 1px solid var(--rule-light); background: none; color: var(--accent); }
button.link:hover, a.link:hover { background: none; color: var(--ink); }
a.link { box-sizing: border-box; text-decoration: none; }
button.remove { padding: 4px 6px; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; }
button.remove:hover { background: none; color: var(--accent); }
/* A small text action in a table row (Opozovi, Dopusti …). */
button.inline { padding: 0; margin-left: 12px; border: 0; background: none; color: var(--accent); font-size: 15px; }
button.inline:hover { background: none; color: var(--ink); }
td > form > button.inline:first-child { margin-left: 0; }
details.inline-confirm { display: block; }
details.inline-confirm summary { padding: 2px 0 0; font-size: 15px; }
details.inline-confirm form { margin-top: 8px; }
details.inline-confirm button { padding: 7px 14px; font-size: 15px; }
details.inline-confirm .confirm-note { display: block; max-width: 280px; margin: 0 0 10px auto; text-align: left; white-space: normal; }
/* Narrow forms: sign-in, invitation, password. */
.narrow { max-width: 480px; }
.fields.single { grid-template-columns: minmax(0, 1fr); }
/* Text above a field block (Račun, Brisanje računa). */
.section-body p + .fields { margin-top: 24px; }
.new-link { display: flex; flex-direction: column; gap: 6px; max-width: 820px; margin-bottom: var(--gap-section); padding-top: 16px; border-top: 2px solid var(--ink); }
.new-link input { font-family: var(--mono); font-size: 15px; }
.new-link .actions { margin-top: 16px; }
/* The first submit button of an editor form, so Enter in a field saves and does not remove or add a row.
   Not display:none: some browsers skip such a button for implicit submission. */
button.default-submit { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.actions { display: flex; gap: 16px 24px; flex-wrap: wrap; align-items: center; margin-top: 40px; }
/* Zamijeni i obriši (_ElementForm): after Obriši of a used element. */
.replace-box { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 18px 0 22px; margin: 0 0 28px; }
.replace-box p { margin: 0 0 14px; line-height: 1.45; }
.replace-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; }
.replace-row .field { flex: 1 1 260px; }
details.confirm { display: inline-block; }
details.confirm summary { cursor: pointer; list-style: none; display: inline-block; padding: 13px 0; color: var(--accent); font-size: 15px; }
details.confirm summary::-webkit-details-marker { display: none; }
details.confirm summary:hover { color: var(--ink); }
details.confirm[open] summary { color: var(--muted); margin-right: 16px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule-light); text-align: left; vertical-align: top; }
th:last-child, td:last-child { padding-right: 0; }
th { padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 13px; font-weight: 500; letter-spacing: 0.02em; line-height: 1.3; color: var(--ink-2); white-space: nowrap; vertical-align: bottom; }
th.num { text-align: right; }
.strong-head th { border-bottom-width: 2px; }
tr.unchecked td { color: var(--muted); }
td a { color: var(--accent); }
td a:hover { color: var(--ink); }

/* Inputs in a table are rows of an editor: smaller type and a lighter rule. */
td { position: relative; }
table input, table select { font-size: 15px; padding: 4px 0 6px; }
table select { min-width: 9rem; padding-right: 20px; }
td:has(> select)::after { bottom: 15px; font-size: 14px; right: 16px; }
td:last-child:has(> select)::after { right: 0; }
table input.band { width: 4.2rem; text-align: right; }
table select.material { min-width: 12.5rem; }
table input.layer-name { min-width: 6rem; }
td.row-buttons { white-space: nowrap; text-align: right; }
/* The element form (_ElementForm.cshtml, issue #3): one row per layer, a typed m′ of a layer marked. */
/* .editor-layout comes later in this file: two classes, so this one wins. The narrower side leaves room for the layer table. */
.editor-layout.element-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); grid-template-rows: auto 1fr; grid-template-areas: "main side" "actions side"; gap: 0 32px; }
.element-layout > .editor { grid-area: main; }
.element-layout > .element-side { grid-area: side; }
.element-layout > .actions { grid-area: actions; align-self: start; }
.layers-table th, .layers-table td { padding-right: 8px; }
.layers-table td.layer-what { min-width: 10rem; width: 38%; }
.layers-table td.layer-what input.layer-name { display: block; width: 100%; min-width: 0; }
/* A row without an own name shows its material in the placeholder: it reads as the value, not as a hint. */
.layers-table input.layer-name.from-material::placeholder { color: var(--ink); }
.layers-table input.band { width: 3.2rem; }
.layers-table th.layer-check, .layers-table td.layer-check { width: 1%; padding-right: 10px; vertical-align: middle; }
.layers-table td.layer-no { width: 1%; padding-right: 10px; }
.layers-table td.layer-no input { width: 2rem; text-align: right; -moz-appearance: textfield; }
.layers-table td.layer-no input::-webkit-inner-spin-button, .layers-table td.layer-no input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.layers-table tr.picked td { background: rgba(42, 41, 37, 0.05); }
.layers-table td.layer-role-cell { min-width: 5.5rem; vertical-align: middle; }
.lining-face .fields { margin-top: 12px; }
.layer-role { display: block; font-size: 12px; letter-spacing: 0.02em; line-height: 1.3; color: var(--accent); }
.layer-role:empty { display: none; }
table input.band.override { font-weight: 600; }
table input.band::placeholder { color: var(--ink-2); opacity: 0.75; }
.base-leaf { margin-top: 18px; }
.layer-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--rule-light); }
.layer-foot button.link { width: auto; border-bottom: 0; }
/* The box „Plivajući pod · ΔLw” under the layers of a floor (_FloatingFloorBox, PKP-238): the parts that the estimate
   needs, each with ✓ or the sign of an Upozorenje, and the estimate. */
.floor-box { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--ink); }
.floor-box h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.floor-box h4 span { text-transform: none; }
.floor-box p { margin: 0; }
.floor-box p + p { margin-top: 6px; }
.floor-steps { list-style: none; margin: 0 0 8px; padding: 0 0 8px; border-bottom: 1px solid var(--rule-light); }
.floor-steps li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start; padding: 3px 0; }
.floor-steps .sign { margin-top: 3px; vertical-align: 0; }
.floor-ok { text-align: center; }
.layer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; padding: 10px 12px; background: var(--ink); color: var(--paper); font-size: 15px; }
.layer-bar[hidden] { display: none; }
.layer-bar button { padding: 4px 10px; border-color: var(--paper); color: var(--paper); font-size: 15px; }
.layer-bar button:hover { background: var(--paper); color: var(--ink); }
.layer-bar .bar-to { display: inline-flex; align-items: center; gap: 6px; }
.layer-bar .bar-to input { width: 3rem; padding: 2px 0 4px; border-bottom-color: var(--paper); color: var(--paper); font-size: 15px; text-align: right; }
details.layer-reverse { display: block; margin-top: 8px; }
details.layer-reverse p { max-width: 60ch; margin: 0 0 12px; color: var(--ink-2); }
.note-text { margin: 12px 0 0; color: var(--accent); }
.element-head .catalog-pick { margin-top: 24px; }
/* Element iz primjera… and Element iz kataloga… side by side (a new element); on a phone one under the other. */
.pick-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.pick-buttons .catalog-open { margin-top: 0; }
.element-head .fields + .fields { margin-top: 28px; }
.element-head .head-checks { row-gap: 12px; }
.element-head .head-refs { grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr); }
@media (max-width: 600px) { .element-head .head-refs { grid-template-columns: minmax(0, 1fr); } }
.lining-faces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.lining-faces .lining-face .fields { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
button.link.lining-catalog { width: auto; padding: 0; border: 0; font-size: 15px; }
@media (max-width: 760px) { .lining-faces { grid-template-columns: minmax(0, 1fr); } }

/* C or Ctr of an element in the façade tables (_FacadeTermCell). */
td.term-cell { min-width: 7rem; }
td.term-cell input { width: 5.5rem; }
td.term-cell input.term-missing::placeholder { color: var(--accent); opacity: 1; }
.term-note { display: block; margin-top: 3px; font-size: 12px; line-height: 1.3; color: var(--muted); }

/* Tabs (wwwroot/js/widgets.js): the panels stay in the form; a tab only hides them. */
.tabs.card { padding-top: 0; }
.tab-list { display: flex; gap: 28px; overflow-x: auto; scrollbar-width: none; margin: 0 0 24px; border-bottom: 1px solid var(--rule-light); }
.tab-list::-webkit-scrollbar { display: none; }
.tab-list [role="tab"] { flex: none; position: relative; padding: 14px 0 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font-size: 16px; white-space: nowrap; }
.tab-list [role="tab"]:hover { background: none; color: var(--ink); }
.tab-list [role="tab"][aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }
.tab-list [role="tab"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.tab-list [role="tab"].has-warning::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; vertical-align: 3px; background: var(--accent); }
.tabs > .tab-panel:first-of-type { padding-top: 0; }
.tab-panel[hidden] { display: none; }
.panel-head { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.panel-head h3 { margin: 0; }
.uses-table td { vertical-align: top; }

/* Unutarnja buka (issue #8): the linings of the separating element, shown from the element; an old value typed on the
   partition (an exception) with its button. */
.lining-summary { margin: 28px 0 0; padding: 16px 0 0; border-top: 1px solid var(--rule-light); }
.lining-summary-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.lining-summary-title { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.lining-summary-head button.link-inline { font-size: 15px; }
.lining-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 24px; margin: 12px 0 0; font-size: 15px; }
.lining-list > div { display: contents; }
.lining-list dt { color: var(--ink-2); }
.lining-list dd { margin: 0; font-variant-numeric: tabular-nums; }
.lining-exception { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 10px; }
.lining-exception button.link-inline { font-size: 14px; }
td .lining-exception { margin-top: 4px; gap: 2px 6px; }
@media (max-width: 640px) { .lining-list { grid-template-columns: minmax(0, 1fr); gap: 0; } .lining-list dd { margin-bottom: 8px; } }

/* Više (widgets.js): the rarer fields of a table row, in a row under it. The button is under the name of the row. A wide
   table scrolls: the fields stay in the visible width of the table (a container, cqw) and do not scroll away. */
tr:has(+ tr.more-row:not([hidden])) > td { border-bottom-color: transparent; }
tr.more-row > td { padding-top: 0; }
.table-wrap:has(tr.more-row) { container-type: inline-size; }
.more-fields { position: sticky; left: 0; box-sizing: border-box; width: 100cqw; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 24px; padding: 14px 16px 4px; border-left: 2px solid var(--rule-light); }
.more-fields label.check { font-size: 14px; }
.room-actions button.more-toggle[aria-expanded="true"] { color: var(--ink); }
.room-actions button.more-toggle::after { content: " ↓"; }
.room-actions button.more-toggle[aria-expanded="true"]::after { content: " ↑"; }

/* ⓘ texts and row menus (popover, wwwroot/js/widgets.js). */
button.info-btn { flex: none; width: 18px; height: 18px; padding: 0; border: 1px solid var(--ink-2); border-radius: 50%; background: none; color: var(--ink-2); font-size: 11px; font-weight: 600; font-style: italic; line-height: 1; }
button.info-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.info-pop, .menu-pop, .suggest-pop { padding: 0; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: 0 6px 24px rgba(42, 41, 37, 0.18); }
.info-pop { width: min(360px, calc(100vw - 16px)); padding: 12px 14px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.info-pop p { margin: 0 0 8px; }
.info-pop p:last-child { margin-bottom: 0; }
.info-pop ul { margin: 6px 0 0; padding-left: 18px; }
.info-pop li { margin: 0 0 4px; }
button.row-menu { padding: 2px 8px; border: 0; background: none; color: var(--ink); font-size: 18px; line-height: 1; }
button.row-menu:hover { background: var(--rule-light); color: var(--ink); }
.menu-pop { min-width: 190px; padding: 4px 0; }
.menu-pop button { display: flex; justify-content: flex-start; width: 100%; padding: 9px 14px; border: 0; background: none; color: var(--ink); font-size: 15px; text-align: left; }
.menu-pop button:hover, .menu-pop button:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.menu-pop button.danger-text { color: var(--accent); }
.menu-pop button.danger-text:hover { color: var(--paper); background: var(--accent); }
.suggest-pop { max-height: min(360px, 60vh); overflow-y: auto; padding: 4px 0; }
.suggest-head { padding: 8px 12px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.suggest-item { display: flex; flex-direction: column; gap: 2px; padding: 7px 12px; cursor: pointer; }
.suggest-item:hover, .suggest-item.active { background: var(--ink); color: var(--paper); }
.suggest-name { font-size: 15px; }
.suggest-meta { font-size: 12px; color: var(--muted); }
.suggest-item:hover .suggest-meta, .suggest-item.active .suggest-meta { color: var(--rule-light); }
.suggest-none { max-width: 320px; padding: 10px 12px; font-size: 14px; color: var(--ink-2); }

/* Vrijednosti za proračun beside the element form: the typed values, then the calculated ones (#preview). */
.element-side h2 { margin: 0; font-size: 24px; }
@media (min-width: 1101px) { .element-side { max-height: calc(100vh - 48px); overflow-y: auto; } }
.element-side .side-sub { margin: 4px 0 16px; font-size: 13px; color: var(--muted); }
.element-side .side-fields { display: grid; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--ink); }
.element-side .terms { display: grid; gap: 18px; }
.element-side .terms[hidden] { display: none; }
.field-with-info { display: flex; align-items: flex-end; gap: 10px; }
.field-with-info > label.field { flex: 1; }
.field-with-info > .info-btn { margin-bottom: 12px; }
button.link.terms-open { width: auto; padding: 0; border: 0; font-size: 15px; }
.side-title { margin: 20px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.lining-face { margin: 20px 0 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--rule-light); }
.lining-face legend { padding: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.lining-hint p { margin: 6px 0 0; }
.lining-hint .warn-text, .warn-text { color: var(--accent); }
.estimate-line b { font-variant-numeric: tabular-nums; }
/* Novi element, the first step: the kinds (as the rows of Interakcije). */
.kind-lead { margin: 0 0 18px; max-width: 46rem; }
.kind-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; max-width: 980px; }
.kind-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule-light); color: var(--ink); text-decoration: none; }
.kind-row:hover .kind-name, .kind-row:focus-visible .kind-name { color: var(--accent); }
.kind-name { display: block; font-size: 18px; font-weight: 500; margin-bottom: 4px; }
.kind-text { display: block; }
@media (max-width: 720px) { .kind-list { grid-template-columns: minmax(0, 1fr); } }
/* Element iz primjera… (_PresetDialog, wwwroot/js/element-pick.js): a search as in the list of a field of the 3D wizard,
   then the elements of the project, the most used and all examples of the wizard by group. Scoped to .kind-pick (the
   dialog body and the first step of Novi element): .pick-group and .pick-row are also the rows of Annex C on Nova pregrada. */
.kind-pick .pick-search { display: flex; align-items: center; gap: 10px; max-width: 46rem; margin: 0 0 8px; padding: 6px 0 9px; border-bottom: 1px solid var(--ink); color: var(--ink-2); transition: border-color 120ms, box-shadow 120ms; }
.kind-pick .pick-search:focus-within { border-bottom-color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }
.kind-pick .pick-search svg { flex: none; }
.kind-pick .pick-search input { flex: 1; min-width: 0; padding: 0; border: 0; box-shadow: none; background: none; font-size: 18px; }
.kind-pick .pick-group { margin-top: 0; }
.kind-pick .pick-group[hidden], .kind-pick .pick-presets[hidden], .kind-pick .pick-row[hidden] { display: none; }
.kind-pick .pick-title { margin: 32px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kind-pick .pick-subtitle { margin: 18px 0 6px; font-size: 15px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.kind-pick .pick-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; max-width: 980px; }
.kind-pick .pick-row { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 2px; padding: 10px 0; border-top: 1px solid var(--rule-light); color: var(--ink); text-decoration: none; }
.kind-pick .pick-row:hover .pick-name, .kind-pick .pick-row:focus-visible .pick-name { color: var(--accent); }
/* A row that posts the form (the dialog of the wizard): a button that looks as the link rows. */
.kind-pick button.pick-row { justify-content: stretch; border: 0; border-top: 1px solid var(--rule-light); background: none; text-align: left; }
.kind-pick button.pick-row:hover { background: none; color: var(--ink); }
.kind-pick .pick-name { display: block; font-size: 16px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; transition: color 120ms; }
.kind-pick .pick-meta { display: block; }
.kind-pick .pick-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border: 1px solid var(--accent); border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.5; color: var(--accent); vertical-align: 2px; white-space: nowrap; }
.kind-pick .pick-empty { margin: 20px 0 0; max-width: 46rem; }
.kind-pick [data-pick-kinds] { margin-top: 0; }
/* The dialog: as wide as the catalogue, the rows scroll under the search. */
dialog.buka-dialog.preset-dialog { width: min(760px, calc(100vw - 32px)); }
dialog.preset-dialog .pick-search { max-width: none; margin: 20px 0 0; }
.pick-scroll { max-height: min(52vh, 460px); overflow-y: auto; }
dialog.preset-dialog .pick-title { margin-top: 24px; }
@media (max-width: 720px) { .kind-pick .pick-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .editor-layout.element-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "main" "side" "actions"; row-gap: 48px; } .element-layout > .actions { margin-top: 0; } }
table td:first-child > input:not([type="hidden"]):not([type="checkbox"]) { min-width: 9rem; }
table td:has(> input), table td:has(> select) { padding-top: 8px; padding-bottom: 8px; }
table td:has(> button.remove) { vertical-align: middle; width: 1%; }

/* Project list: the row under the title. Novi projekt on the left; Učitaj JSON on the right. */
.list-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 64px; }
.list-toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.list-toolbar form { display: contents; }
/* A file input in a label that looks like a button: the native control is hidden, the label opens the chooser. */
label.file-button { position: relative; }
label.file-button input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
label.file-button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
ul.warnings.list-error { margin: -32px 0 48px; }
#upload-ask label.field { margin-top: 24px; }

/* The index of a project tab (Građevni dijelovi …): search and filters over a table of the items (wwwroot/js/index.js).
   A row opens its item; on phones each row is a short card. */
.index-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 24px 32px; margin-bottom: 40px; }
.index-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 16px; }
.index-toolbar .index-search { flex: 1 1 280px; }
.index-toolbar label.field:not(.index-search) { flex: 0 1 200px; }
.index-count { margin: 0; font-size: 15px; color: var(--muted); }
.index-actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* „Ručni obrazac” beside a button that opens a 3D wizard (PKP-362): a plain link, in the middle of the height of the buttons. */
.index-manual { align-self: center; margin-right: 8px; font-size: 14px; }
.index-table .index-check { display: block; white-space: nowrap; }
.index-table .index-check + .index-check { margin-top: 4px; }
.index-table .index-check b { font-weight: 500; }
.index-table td.rooms { font-size: 15px; }
/* Građevni dijelovi (PKP-317): the icon of the kind of an element before its name in the column Vrsta (Elements.cshtml). */
.index-table .index-kind { display: inline-flex; align-items: flex-start; gap: 10px; }
.index-table .index-kind .ia-icon { flex: none; width: 24px; height: 24px; }
.index-table a.wizard-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.index-card { margin-bottom: 48px; }
.index-card-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 16px 24px; }
.index-card-head h2 { margin-bottom: 0; }
.index-table td.nowrap { white-space: nowrap; }
.index-table td { padding-top: 16px; padding-bottom: 16px; }
.index-table td.num { text-align: right; white-space: nowrap; }
.index-table tbody tr[data-href] { cursor: pointer; }
.index-table tbody tr[data-href]:hover td { background: color-mix(in srgb, var(--rule-light) 30%, transparent); }
.index-table tbody tr[hidden] { display: none; }
/* The row of the element just saved (Spremi element → the list, PKP-3). */
.index-table tbody tr.is-saved td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
/* PKP-316: the row that the 3D wizard came back to (the anchor red-… in the address), on the lists and on Rezultati: lit, then
   it fades. */
[id^="red-"] { scroll-margin-top: 96px; }
tr[id^="red-"]:target td, tr:has(> td[id^="red-"]:target) td { animation: row-back 6s ease-out; }
@keyframes row-back { 0%, 50% { background: color-mix(in srgb, var(--accent) 12%, transparent); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { tr[id^="red-"]:target td, tr:has(> td[id^="red-"]:target) td { animation: none; background: color-mix(in srgb, var(--accent) 7%, transparent); } }
.index-table a.index-name { display: block; font-size: 17px; font-weight: 500; line-height: 1.3; color: var(--ink); }
.index-table a.index-name:hover { color: var(--accent); }
.index-table .index-sub { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.index-table .estimate { color: var(--muted); }
.index-table td.source { max-width: 280px; font-size: 14px; color: var(--ink-2); }
.index-table .source-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.index-table .source-text.open { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.index-table button.source-more { margin-top: 2px; font-size: 13px; }
/* Unutarnja buka (PKP-308): the small 3D figure of a row in the last column, a button that opens its dialog
   (wwwroot/js/index-figures.js; figure-3d.js draws it as "thumb"). The SVG is as large as its viewBox (132 × 92), and its
   strokes do not scale, so the lines stay about 1 px also where the button is smaller (phone). */
.index-table th.index-fig { width: 134px; }
.index-table td.index-fig { padding-top: 10px; padding-bottom: 10px; }
button.index-figure { display: block; width: 134px; height: 94px; padding: 0; border: 1px solid var(--rule-light); background: transparent; }
button.index-figure:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
button.index-figure svg { width: 100%; height: 100%; pointer-events: none; }
.p3-thumb .p3-box, .p3-thumb .p3-face, .p3-thumb .p3-role, .p3-thumb .p3-opening { vector-effect: non-scaling-stroke; }
.p3-thumb .p3-box.hidden { stroke-dasharray: 2 2; }
.p3-thumb .p3-face { stroke-width: 1; cursor: inherit; }
.p3-thumb .p3-role { stroke-width: 1.25; }
/* Rezultati (PKP-319): the small figure in the last column of Vanjska buka and Unutarnja buka, smaller, as the rows are low.
   The table scrolls sideways in its .table-wrap on a phone, so the column does not widen the page. */
table.caps th.index-fig { width: 92px; }
table.caps td.index-fig { padding-top: 6px; padding-bottom: 6px; vertical-align: middle; }
table.caps button.index-figure { width: 90px; height: 62px; }
/* The patterns of the hatch for the figures of the list and its dialog (figure-3d.js): never display: none, or they do not paint. */
.p3-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
/* Unutarnja buka (PKP-143): the partitions under the rows of Annex C (Partitions.cshtml, wwwroot/js/index.js). A section
   heading as the groups of Nova pregrada, a table title when the rows are of two or more tables, and the heading of each row
   as a fold over the full width: the chevron, the number, the title, the count and the fails sign („Message signs”). */
.index-table tbody[hidden] { display: none; }
.index-table tbody.index-section th { padding: 40px 0 8px; border-bottom: 1px solid var(--ink); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; line-height: 1.3; text-transform: uppercase; white-space: normal; color: var(--ink-2); vertical-align: bottom; }
.index-table tbody.index-table-title th { padding-top: 56px; font-size: 20px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink); }
.index-table tbody.index-table-title + tbody.index-section th { padding-top: 24px; }
.index-table thead + tbody.index-section th { padding-top: 32px; }
.index-table tr.index-group-head th { padding: 0; border-bottom: 1px solid var(--rule-light); font-size: 16px; font-weight: 400; letter-spacing: 0; white-space: normal; vertical-align: middle; }
.index-fold { display: flex; align-items: baseline; justify-content: flex-start; gap: 10px; width: 100%; padding: 18px 0 14px; border: 0; background: none; text-align: left; color: var(--ink); }
.index-fold:hover { background: none; color: var(--ink); }
.index-fold::before { content: ""; flex: none; align-self: center; width: 7px; height: 7px; margin: -3px 4px 0 2px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform 120ms; }
.index-fold[aria-expanded="false"]::before { margin-top: 0; transform: rotate(-45deg); }
.index-fold .ia-number { flex: none; min-width: 20px; }
/* PKP-317: the small drawing of a row of Table C.1.1 (RowPicker.Icon), before its number. */
.index-fold .ia-icon { flex: none; align-self: center; width: 24px; height: 24px; margin-top: -2px; }
.index-fold:hover .ia-icon { color: var(--accent); }
.index-group-title { font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--ink); transition: color 120ms; }
.index-fold:hover .index-group-title { color: var(--accent); }
.index-group-count { flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.index-group-fails { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.index-group-fails .sign { width: 12px; height: 12px; vertical-align: 0; }
.index-group-fails .sign.fail::before { width: 8px; height: 8px; }
@media (prefers-reduced-motion: reduce) { .index-fold::before { transition: none; } }
th button.sort { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
th button.sort:hover { background: none; color: var(--accent); }
th[aria-sort="ascending"] button.sort::after { content: " ↑"; }
th[aria-sort="descending"] button.sort::after { content: " ↓"; }
.index-none { margin-top: 24px; }
button.link-inline { padding: 0; border: 0; background: none; font-size: inherit; color: var(--accent); }
button.link-inline:hover { background: none; color: var(--ink); }
/* The page of one item: the link back to the index above a smaller title (the name of the item). */
.page-back { display: inline-block; margin-top: var(--gap-hero); font-size: 15px; color: var(--accent); }
.page-back:hover { color: var(--ink); }
.page-back + .page-title { margin-top: 20px; }
.page-title.item { max-width: 28ch; font-size: clamp(36px, 4.6vw, 64px); letter-spacing: -0.03em; line-height: 1; }
@media (max-width: 640px) {
    .index-actions, .index-bar .button { width: 100%; }
    .index-table .index-check { white-space: normal; }
    .index-toolbar label.field:not(.index-search) { flex: 1 1 100%; }
    .index-table thead { display: none; }
    .index-table, .index-table tbody, .index-table tr, .index-table td { display: block; }
    .index-table tbody tr { padding: 14px 0; border-bottom: 1px solid var(--rule-light); }
    .index-table tbody tr[hidden] { display: none; }
    .index-table td, .index-table td.num { padding: 2px 0; border: 0; text-align: left; max-width: none; }
    .index-table td[data-label]::before { content: attr(data-label) " "; font-size: 13px; color: var(--muted); }
    .index-table td.blank { display: none; }
    /* The headings of Unutarnja buka stay one full-width line, not a card. */
    .index-table tbody[hidden] { display: none; }
    .index-table tbody th { display: block; }
    .index-table tbody tr.index-group-head, .index-table tbody.index-section tr { padding: 0; border-bottom: 0; }
    .index-table thead + tbody.index-section th { padding-top: 8px; }
    /* The heading of a row as one flow of text: the count follows the title when it wraps. */
    .index-fold { display: block; }
    .index-fold::before { display: inline-block; margin: 0 10px 0 2px; vertical-align: 0.2em; }
    .index-fold[aria-expanded="false"]::before { margin-top: 0; vertical-align: 0.1em; }
    .index-fold > span { margin-right: 8px; }
    .index-fold .ia-icon { display: inline-block; margin: 0 8px 0 0; vertical-align: -0.35em; }
    .index-table .index-kind { vertical-align: top; }
    /* Unutarnja buka (PKP-308): the small figure at the right of the name and the rooms of the card, so the card does
       not get higher. A row without a figure (td.blank) stays one column. The cells touch (no gap, the cell of the
       figure as high as the two lines beside it), so the background of a saved row has no holes. */
    .index-table tbody tr:not([hidden]):has(> td.index-fig:not(.blank)) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
    .index-table tbody tr:has(> td.index-fig:not(.blank)) > td { grid-column: 1 / -1; }
    .index-table tbody tr:has(> td.index-fig:not(.blank)) > td[data-col="naziv"] { grid-column: 1; grid-row: 1; }
    .index-table tbody tr:has(> td.index-fig:not(.blank)) > td.rooms { grid-column: 1; grid-row: 2; }
    .index-table tbody tr:has(> td.index-fig:not(.blank)) > td.index-fig { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; padding: 2px 0 0 12px; }
    button.index-figure { width: 106px; height: 75px; }
}

/* The empty project list: the sample projects as a line of links. */

/* Project list: one row per project; with groups, one table per space. */
.space-title { margin: 56px 0 12px; font-size: 18px; font-weight: 500; }
.page-body > .space-title:first-child { margin-top: 0; }
.project-list td { padding: 20px 32px 20px 0; vertical-align: baseline; }
.project-list .project-name { display: block; font-size: 24px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; color: var(--ink); }
.project-list .project-name:hover { color: var(--accent); }
.project-list .file { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
/* A copy of an old sample (UserSamples.IsOld): "· stari primjer" stands on the line of the name, in one piece. */
.project-list .project-name:has(+ .old-sample) { display: inline; }
.project-list .old-sample { white-space: nowrap; }
/* PKP-168: Kreiran and Izmijenjen on one line each; the name gets the rest of the width. */
.project-list .date { width: 168px; white-space: nowrap; }
.project-list td.date { font-size: 16px; }
.project-list .row-actions { width: 150px; padding-right: 0; text-align: right; white-space: nowrap; font-size: 15px; }
.project-list .row-actions > * { margin-left: 24px; }
.project-list .row-actions a.download { color: var(--ink); }
.project-list .row-actions a.download:hover { color: var(--accent); }
.project-list .row-actions details.confirm summary { padding: 0; }
.project-list .row-actions details.confirm[open] { display: block; margin-top: 8px; }
.project-list .row-actions details.confirm form { display: flex !important; flex-direction: column; align-items: flex-end; gap: 8px; margin-top: 8px; }
.project-list .row-actions details.confirm button { padding: 9px 16px; font-size: 15px; }
/* PKP-313: three actions in a row of the project list. They wrap as a whole, with a gap only between the actions of one line:
   in the column of 150 px Spremi kao predložak has the first line, Preuzmi ↓ and Obriši the second, so the name keeps its
   width. Spremi kao predložak (and Otvori → of Moji predlošci) is a text button in ink, as Preuzmi ↓. */
.project-list .row-actions > .row-action-list { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 4px 24px; margin-left: 0; }
.project-list .row-action-list > details.confirm[open] { flex-basis: 100%; margin-top: 4px; }
.project-list .row-actions button.link-inline { color: var(--ink); }
.project-list .row-actions button.link-inline:is(:hover, :focus-visible) { color: var(--accent); }

/* Novi projekt: three large tiles (3D Čarobnjak zgrade, Uvoz, Ručni unos), then a dialog for the name. Uvoz is a link. The box of an unfinished
   building above them has the same width. */
.new-project, .draft-links { max-width: 1100px; }
.name-ask-fields { margin-top: 24px; row-gap: 24px; }
/* Each tile is three rows: the icon row with a fixed height, the title, the text. So the titles and the texts of both tiles start
   at the same height (a button cannot be a subgrid, so the icon row has the height instead). The free space is under the text. */
.choice-frame { container: tiles / inline-size; }
.choice-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.choice-tile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); row-gap: 0; align-items: start; padding: 24px 28px 28px; border: 1px solid var(--ink); border-top-width: 2px; background: none; color: var(--ink); font: inherit; text-align: left; }
button.choice-tile:hover { background: none; color: var(--ink); }
a.choice-tile, a.choice-tile:hover { color: var(--ink); text-decoration: none; }
/* Hover (and keyboard focus): the storeys of the icon move apart, a red rule grows over the top, "Otvori →" comes in. */
.choice-tile::before { content: ""; position: absolute; top: -2px; left: -1px; right: -1px; height: 6px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 380ms cubic-bezier(.2, .8, .2, 1); }
:is(button, a).choice-tile:is(:hover, :focus-visible)::before { transform: scaleX(1); }
:is(button, a).choice-tile:is(:hover, :focus-visible) .choice-title { color: var(--accent); }
.choice-storey, .choice-arrow { transition: transform 420ms cubic-bezier(.2, .8, .2, 1); }
a.choice-tile:is(:hover, :focus-visible) .choice-arrow { transform: translateY(1.5px); }
:is(button, a).choice-tile:is(:hover, :focus-visible) .choice-storey.s1 { transform: translateY(-5px); }
:is(button, a).choice-tile:is(:hover, :focus-visible) .choice-storey.s2 { transform: translateY(-2.5px); }
.choice-go { flex: none; font-size: 18px; font-weight: 500; color: var(--accent); opacity: 0; transform: translateX(-12px); transition: opacity 240ms, transform 380ms cubic-bezier(.2, .8, .2, 1); }
:is(button, a).choice-tile:is(:hover, :focus-visible) .choice-go { opacity: 1; transform: none; }
.choice-tile[aria-disabled="true"] { border-color: var(--rule-light); border-top-color: var(--ink-2); color: var(--ink-2); cursor: default; }
/* The tile that is not available yet (Uskoro): the two rooms move apart and the wall between them shows red. Nothing says
   "click": the rule is grey, the title keeps its colour, there is no "Otvori →", and the square of Uskoro fills. */
.choice-tile[aria-disabled="true"]::before { background: var(--ink-2); }
.choice-tile[aria-disabled="true"]:hover::before { transform: scaleX(1); }
.choice-room { transition: transform 420ms cubic-bezier(.2, .8, .2, 1); }
.choice-tile:hover .choice-room.ra { transform: translate(-1.3px, -0.75px); }
.choice-tile:hover .choice-room.rb { transform: translate(1.3px, 0.75px); }
.choice-icon .wall { fill: var(--accent); stroke: none; }
.choice-tile[aria-disabled="true"]:hover .choice-tag { color: var(--ink); }
.choice-tile[aria-disabled="true"]:hover .choice-tag::before { background: currentColor; }
@media (prefers-reduced-motion: reduce) {
    .choice-tile::before, .choice-storey, .choice-arrow, .choice-room, .choice-go, .draft-go { transition: none; }
}
/* Uvoz (/projekti/uvoz, PKP-370): the file button under the lead, then the export steps of each program in folds of the
   kind of Česta pitanja, at most 560 px wide. The button is near the lead: the page takes back most of the gap of the page body. */
.import-page { margin-top: calc(36px - var(--gap-content)); }
.import-page > button.primary { font-size: 17px; padding: 13px 22px; }
.import-limits { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.import-status, .import-error { margin: 20px 0 0; max-width: 640px; font-size: 16px; line-height: 1.5; }
.import-status { color: var(--ink-2); }
.import-steps { max-width: 560px; margin-top: 72px; }
.import-steps h2 { margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--ink); font-size: 13px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.import-steps details.faq > summary, .import-steps details.faq:first-child > summary { padding: 14px 0; font-size: 20px; }
.import-steps ol { display: grid; gap: 6px; margin: 0 0 18px; padding-left: 22px; font-size: 17px; color: var(--ink-2); }
.import-steps ol li::marker { color: var(--accent); }
.import-steps details.faq > p { margin: 0 0 18px; font-size: 17px; }
.import-steps .menu { font-weight: 500; color: var(--ink); }
dialog.buka-dialog.import-dialog { width: min(640px, calc(100vw - 32px)); }
.import-dialog p.import-count { max-width: none; font-size: 18px; font-weight: 500; color: var(--ink); }
.import-dialog ul.warnings { max-height: min(32vh, 260px); overflow-y: auto; }
.import-dialog ul.warnings li { padding-top: 9px; padding-bottom: 9px; font-size: 14px; }
.import-dialog ul.warnings li::before { top: 12px; }
@media (max-width: 640px) { .import-steps { margin-top: 56px; } }
/* The icon row holds the empty space of the tile (the old min-height of 300 px). The body is no box: the title and the text are rows of the tile. */
.choice-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; min-height: 148px; }
.choice-body { display: contents; }
/* The size of a title follows the width of the frame, so that „3D Čarobnjak zgrade” stays on one line in its tile. */
.choice-title { display: block; font-size: 24px; font-size: clamp(22px, 2.6cqi, 32px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.08; transition: color 120ms; }
/* Three tiles in a row: "Otvori →" is under the text. A frame of less than 860 px (a phone, or a narrow window beside the
   sidebar) has one column: the title has its large size, and the text and the arrow share the last row, so that the arrow
   never covers the text. */
.choice-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 14px; align-self: start; }
.choice-text { display: block; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
@container tiles (max-width: 859px) {
    .choice-tiles { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .choice-top { min-height: 0; margin-bottom: 32px; }
    .choice-title { font-size: clamp(28px, 2.6vw, 38px); }
    .choice-foot { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 24px; }
    .choice-text { max-width: 44ch; }
}
.choice-icon { width: 72px; height: 72px; overflow: visible; }
.choice-icon path { stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
/* Each storey hides the one behind it, also when they move apart. */
.choice-icon .fill { fill: var(--paper); stroke: none; }
/* Uskoro: muted, with an open square. */
.choice-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.choice-tag::before { content: ""; width: 9px; height: 9px; border: 1px solid currentColor; }
/* Nastavi zgradu: a building that the wizard keeps in this browser, above the tiles (NoviProjekt.cshtml). One row is the
   frame: the link fills it, the trash stands at its right end. The trash asks in the row (draft-ask), with Obriši and Odustani. */
.draft-links { display: grid; gap: 16px; margin-bottom: 56px; }
.draft-links[hidden] { display: none; }
.draft-row { display: flex; align-items: center; min-width: 0; border: 1px solid var(--ink); border-left: 4px solid var(--accent); }
a.draft-link { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; align-items: center; padding: 20px 8px 20px 24px; color: var(--ink); text-decoration: none; }
button.draft-trash { flex: none; width: 40px; height: 40px; padding: 0; margin: 0 16px 0 8px; border: 0; background: none; color: var(--muted); }
button.draft-trash:is(:hover, :focus-visible) { background: none; color: var(--accent); }
button.draft-trash svg { width: 22px; height: 22px; }
.draft-row.asking { flex-wrap: wrap; align-content: center; gap: 8px 24px; padding: 16px 24px; }
.draft-ask { flex: 1 1 320px; min-width: 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.draft-row.asking button.danger { padding: 9px 16px; font-size: 15px; }
.draft-row.asking button.dialog-close { padding: 9px 0; }
.draft-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.draft-title { grid-column: 1; font-size: 24px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; overflow-wrap: anywhere; }
.draft-meta { grid-column: 1; font-size: 15px; color: var(--ink-2); }
.draft-go { grid-column: 2; grid-row: 1 / span 3; font-size: 22px; color: var(--accent); transition: transform 240ms cubic-bezier(.2, .8, .2, 1); }
a.draft-link:hover .draft-title { color: var(--accent); }
a.draft-link:hover .draft-go { transform: translateX(4px); }
a.draft-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Moji predlošci (PKP-313): under the tiles, a table in the look of the project list (one per space with groups). The name
   is no link: Otvori → asks for the name of the new project. */
.template-section { max-width: 1100px; margin-top: 96px; }
.template-section h2 { margin-bottom: 24px; }
.template-section h2 + .space-title { margin-top: 0; }
.template-list .project-name:hover { color: var(--ink); }
.template-list .template-counts { margin-top: 6px; }
.template-list .fail-text { margin-top: 6px; }
.template-list .row-actions { white-space: nowrap; }
.template-list .row-actions button.template-open { font-weight: 500; }

/* ---------- Status ---------- */

/* Pass: text. Small margin: an open square. Fail: the accent square. Not calculated: muted text. */
.pill { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0; font-size: 15px; font-weight: 500; line-height: 1.3; color: var(--ink); white-space: nowrap; }
.pill::before { content: ""; flex: none; width: 10px; height: 10px; }
.pill.pass::before { display: none; }
.pill.low::before { border: 1px solid var(--ink); }
.pill.fail::before { background: var(--accent); }
.pill.none { color: var(--muted); }
.pill.none::before { display: none; }

/* Stats row: label on top, the figure at the bottom; the verdict cell has the accent square. */
.summary { display: flex; border-top: 2px solid var(--ink); margin: 0 0 var(--gap-content); }
.summary + .summary { margin-top: calc(-1 * var(--gap-content) + 48px); }
.summary .tile { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column-reverse; justify-content: space-between; gap: 12px; padding: 14px 20px 0; border-left: 1px solid var(--rule-light); }
.summary .tile:first-child { border-left: 0; padding-left: 0; }
.summary .tile .value { font-size: 72px; font-weight: 400; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.summary .tile .muted { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; line-height: 1.3; text-transform: uppercase; color: var(--ink-2); }
.summary .tile .unit { text-transform: none; }
.summary .tile:has(> .value.small) { flex: 1.4 1 0; flex-direction: column; justify-content: flex-start; padding: 14px 0 0 20px; border-left-color: var(--ink); }
.summary .tile:has(> .value.small):first-child { padding-left: 0; border-left: 0; }
.summary .tile:has(> .value.small)::before { content: "Ocjena"; font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.summary .tile .value.small { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.summary .tile .value.small::before { content: ""; flex: none; width: 12px; height: 12px; background: var(--accent); }
.summary .tile.pass .value.small::before { background: var(--pass); }
.summary .tile:has(> .value.small) .muted { font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.summary .tile .more { font-size: 15px; }

.saved { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 24px; font-size: 15px; font-weight: 500; }
.saved::before { content: ""; width: 8px; height: 8px; background: var(--ink); }

/* ---------- Message signs ----------
   One set of signs for messages and results (AGENTS.md, "Message signs"). Do not add another sign or colour for these kinds.
   Greška: "×" on the filled accent square. Ne zadovoljava: the filled accent square, as .pill.fail. Upozorenje: "!" in an
   accent outline square. Napomena: an italic "i" in a grey (muted) outline square, and grey text.
   In lists: ul.warnings with li.error (or ul.warnings.errors), li (Upozorenje), li.note and li.fail.
   Inline (wizard panel, tab badge, boxes): .sign.error, .sign.warn, .sign.note, .sign.fail. */
ul.warnings { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--ink); }
ul.warnings li { position: relative; margin: 0; padding: 12px 0 12px 28px; border-bottom: 1px solid var(--rule-light); font-size: 15px; line-height: 1.5; }
ul.warnings li::before { content: "!"; position: absolute; left: 0; top: 15px; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid var(--accent); font-size: 12px; font-weight: 700; line-height: 1; color: var(--accent); }
ul.warnings.errors li::before, ul.warnings li.error::before { content: "×"; background: var(--accent); color: var(--paper); }
ul.warnings li.note { color: var(--ink-2); }
ul.warnings li.note::before { content: "i"; border-color: var(--muted); font-family: Georgia, serif; font-style: italic; font-weight: 400; color: var(--muted); }
/* The 10 px square of .pill.fail, in the middle of the place of a 16 px sign. */
ul.warnings li.fail::before { content: ""; top: 18px; left: 3px; width: 10px; height: 10px; border: 0; background: var(--accent); }
.sign { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid var(--accent); font-size: 12px; font-weight: 700; font-style: normal; line-height: 1; color: var(--accent); vertical-align: -3px; }
.sign.warn::before { content: "!"; }
.sign.error { background: var(--accent); color: var(--paper); }
.sign.error::before { content: "×"; }
.sign.note { border-color: var(--muted); font-family: Georgia, serif; font-style: italic; font-weight: 400; color: var(--muted); }
.sign.note::before { content: "i"; }
.sign.fail { border: 0; }
.sign.fail::before { content: ""; width: 10px; height: 10px; background: var(--accent); }
ul.warnings code { font-size: 13px; color: var(--ink-2); }
ul.warnings.conflict { margin: 0 0 40px; }
/* The note above the form of a copy (Kopiraj on Pregrade and Fasade). */
ul.warnings.copy-note { margin: 0 0 40px; }
/* "Provjera projekta" (Rezultati): one heading per tab above its messages. */
.card.messages h3 { margin: 32px 0 0; font-size: 16px; }
.card.messages h3 a { color: var(--ink); }
.card.messages h3 a:hover { color: var(--accent); }
/* „Ne zadovoljava” above it: the wizard link after the result of the check. */
#ne-zadovoljava a.fail-wizard { margin-left: 8px; white-space: nowrap; }
.card.messages ul.entry-messages { list-style: disc; margin: 4px 0 0; padding-left: 18px; }
.card.messages ul.entry-messages li { padding: 2px 0; border: 0; }
.card.messages ul.entry-messages li::before { content: none; }

/* ---------- Results in the editors ---------- */

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 48px; align-items: start; }
.preview { position: sticky; top: 24px; }
/* The partition page: the 3D figure stays at the top of its column and Rezultat sticks below it (partition-figure.js sets
   --fig-h); when Rezultat is longer than the form, it scrolls under the figure. */
.preview-col { align-self: stretch; min-width: 0; }
.preview-col > .part-3d { position: sticky; top: 12px; z-index: 2; box-shadow: 0 -12px 0 var(--paper); }
.preview-col > .preview { top: calc(var(--fig-h, 0px) + 24px); }

/* ---------- The 3D figure of a partition (FigureScene, figure-3d.js, partition-figure.js) ---------- */
.part-3d { margin: 0 0 24px; border: 1px solid var(--ink); background: var(--paper); }
#editor .part-3d { max-width: 480px; margin: 0 0 32px; }
.part-3d-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px 0; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.part-3d-head span + span { text-transform: none; letter-spacing: 0; }
.part-3d-foot { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 0 12px 10px; font-size: 13px; color: var(--ink-2); }
.part-3d-foot a, .part-3d-foot button.link-inline { font-size: 13px; color: var(--accent); }
.p3 { display: block; width: 100%; height: auto; font-family: var(--font); }
/* A drag turns the figure (figure-3d.js); on a touch screen it does not scroll the page. */
.part-3d-view svg { cursor: grab; touch-action: none; }
.part-3d-view svg.dragging, .part-3d-view svg.dragging * { cursor: grabbing; }
.p3-box { stroke: var(--ink); stroke-width: 1; stroke-linecap: round; }
.p3-box.hidden { stroke-dasharray: 3 3; opacity: 0.5; }
.p3-box.other { stroke: var(--muted); opacity: 0.4; }
.p3-box.other.hidden { opacity: 0.2; }
.p3-hatch-line { stroke: var(--muted); stroke-width: 1; }
.p3-hatch-line.on { stroke: var(--accent); }
.p3-face { fill: url(#p3-hatch); stroke: var(--ink); stroke-width: 1.25; opacity: 0.8; cursor: pointer; }
.p3-face.on { fill: url(#p3-hatch-on); stroke: var(--accent); stroke-width: 2; opacity: 1; }
.p3-flank { fill: none; stroke: none; pointer-events: none; }
.p3-flank.on { stroke: var(--accent); stroke-width: 1.25; }
.p3-flank.on.hatch { fill: url(#p3-hatch-on); stroke-width: 1.5; }
.p3-role { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.p3-role.source { stroke: var(--accent); }
.p3-room, .p3-size { font-size: 11px; fill: var(--muted); paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
/* The dialog of the lists: the plan size of a room under its name. */
.p3-size { font-size: 9.5px; }
/* A window or a door of a façade (PKP-240): an outlined rectangle with the paper fill, over its hatched wall. */
.p3-opening { fill: var(--paper); stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; pointer-events: none; }
.p3-edge { cursor: pointer; outline: none; }
.p3-edge .p3-hit { stroke: transparent; stroke-width: 14; }
.p3-edge .p3-line { stroke: var(--ink); stroke-width: 1.75; stroke-linecap: round; }
.p3-edge rect { fill: var(--paper); stroke: var(--muted); stroke-width: 0.8; }
.p3-edge text { font-size: 11.5px; fill: var(--ink); }
.p3-edge:hover .p3-line, .p3-edge:focus-visible .p3-line, .p3-edge.on .p3-line { stroke: var(--accent); stroke-width: 3.5; }
.p3-edge:hover rect, .p3-edge:focus-visible rect { stroke: var(--accent); }
.p3-edge.on rect { fill: var(--accent); stroke: var(--accent); }
.p3-edge.on text { fill: var(--paper); font-weight: 600; }
/* The row or field that the figure lights. */
#panel-spojevi tr.lit > td { background: rgba(200, 57, 26, 0.08); }
#panel-spojevi tr.lit:not(.more-row) > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
label.field.lit { box-shadow: -8px 0 0 var(--paper), -11px 0 0 var(--accent); }
@media (max-width: 700px) { .part-3d { display: none; } }
.preview > h2:first-child, .preview > ul.preview-messages + h2 { font-size: 24px; }
/* The warnings and notes of a partition or façade at the top of its preview, above Rezultat (_PartitionPreview, _FacadePreview). */
.preview > ul.warnings.preview-messages { margin: 0 0 32px; border-top: 0; }
.preview > ul.warnings.preview-messages > li:first-child { padding-top: 0; }
.preview > ul.warnings.preview-messages > li:first-child::before { top: 3px; }
.preview > ul.warnings.preview-messages > li.fail:first-child::before { top: 6px; }
.preview ul.preview-messages button.link-inline { margin-left: 4px; font-size: 14px; white-space: nowrap; }
.result-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px 32px; margin: 0 0 24px; }
.result-row .label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: var(--ink-2); }
.big { font-size: 36px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.key-values { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; border-top: 1px solid var(--ink); }
.key-values dt, .key-values dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--rule-light); }
.key-values dt { padding-right: 24px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.key-values dd { font-variant-numeric: tabular-nums; }
.preview table { font-size: 14px; }
.preview th, .preview td { padding-right: 10px; }

details.trace { margin-top: 24px; }
details.trace > summary { cursor: pointer; list-style: none; padding: 10px 0; border-top: 1px solid var(--rule-light); font-size: 14px; color: var(--muted); }
details.trace > summary::-webkit-details-marker { display: none; }
details.trace > summary::before { content: "→ "; }
details.trace[open] > summary::before { content: "↓ "; }
details.trace > summary:hover { color: var(--ink); }
/* A step per row: the label takes the width, its formula is a line under it, the value is at the right. A long text value
   (an element name) wraps in at most 40 % of the row, so the label does not shrink to one word per line. */
.trace table { font-size: 14px; }
.trace table, .trace tbody { display: block; }
.trace tr { display: grid; grid-template-columns: minmax(0, 1fr) fit-content(40%); column-gap: 24px; border-bottom: 1px solid var(--rule-light); }
.trace tr.note { grid-template-columns: minmax(0, 1fr); }
details.trace td { display: block; padding: 8px 0; border-bottom: 0; }
details.trace td.num { white-space: normal; text-align: right; overflow-wrap: anywhere; }
.trace .formula { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.trace tr.note td { color: var(--muted); }
.trace-title { margin: 48px 0 4px; font-size: 18px; font-weight: 500; }
.trace-ref { margin-bottom: 8px; font-size: 13px; color: var(--muted); }

/* ---------- LLM pages ---------- */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); column-gap: 32px; row-gap: 48px; align-items: start; }
.steps .card { border-top-width: 2px; }
.steps .card + .card { margin-top: 0; }
.steps .card > h2:first-child { font-size: 18px; font-weight: 500; }
.steps .actions { margin-top: 16px; }
textarea.prompt { width: 100%; margin-top: 16px; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
pre.code, pre.notes { margin: 16px 0 0; padding: 12px 0; border-top: 1px solid var(--rule-light); border-bottom: 1px solid var(--rule-light); overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
pre.notes { font-family: var(--font); font-size: 16px; }
.copy-status { font-size: 14px; color: var(--muted); }

/* Statistika (admins): the period links, and the tables of a section one under the other. */
.period-tabs { display: flex; flex-wrap: wrap; gap: 20px; align-items: end; margin: 0 0 var(--gap-content); border-bottom: 1px solid var(--rule-light); }
.period-tabs .lbl { padding-bottom: 10px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.period-tabs a { padding: 8px 0 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 15px; color: var(--ink); text-decoration: none; }
.period-tabs a:hover { color: var(--accent); }
.period-tabs a[aria-current="page"] { border-bottom-color: var(--ink); font-weight: 600; }
.section-body > .table-wrap + .table-wrap, .section-body > p + .table-wrap { margin-top: 32px; }

/* ---------- Documents: report and Iskaznica ---------- */

.doc { max-width: 210mm; border-top: 2px solid var(--ink); padding-top: 32px; }
.doc h1 { margin: 0 0 16px; font-size: 32px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; }
.doc h2 { margin: 48px 0 12px; font-size: 24px; }
.doc h3 { margin: 32px 0 8px; }
.doc table { font-size: 14px; table-layout: auto; }
.doc th { white-space: normal; }
.doc td.num { white-space: nowrap; }
.doc .box th, .doc .box td { padding: 6px 8px; border: 1px solid var(--ink-2); }
.doc .box th { border-bottom-color: var(--ink); }
/* The 3D figure of a partition or a façade under its title (PKP-319, FigureDrawing.Svg), at the size of the figures of the dialogs. */
.doc-figure { margin: 8px 0 16px; }
.doc-figure .p3 { max-width: 400px; }
.doc-figure figcaption { margin-top: 4px; }
/* The small figure (PKP-351) on the right of „Ulazni podaci”; on a phone above it. Its strokes do not scale (.p3-thumb). */
.doc-beside { display: flex; gap: 8px 24px; align-items: flex-start; }
.doc-beside > div { flex: 1; min-width: 0; }
.doc-figure.small { flex: none; width: 176px; margin: 8px 0 0; }
@media (max-width: 640px) { .doc-beside { flex-direction: column-reverse; } }
/* The choice „3D prikazi” above the document (PKP-351): three buttons, the chosen one filled. */
/* Proračun: „Izgled PDF-a” (PKP-351, PKP-352). Closed, it is one line between two rules that says what is set; „Uredi”
   opens the rows in a frame: the 3D figures, the header and the footer of the PDF file, with one „Spremi”. */
.doc-look { max-width: 210mm; border-top: 1px solid var(--rule-light); }
.doc-look[open] { margin: 0 0 24px; padding: 0 20px; border: 1px solid var(--ink); }
.doc-look > summary { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; padding: 12px 0; cursor: pointer; list-style: none; }
.doc-look > summary::-webkit-details-marker { display: none; }
.doc-look > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.look-name { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.look-state { display: flex; flex-wrap: wrap; gap: 2px 18px; min-width: 0; }
.look-state b { font-weight: 500; overflow-wrap: anywhere; }
.doc-look[open] .look-state { display: none; }
/* „Uredi” is a button (PKP-356): a tester did not see where to click. */
.look-edit { margin-left: auto; padding: 4px 12px; border: 1px solid var(--ink); font-size: 13px; color: var(--ink); }
.look-edit::after { content: "Uredi"; }
.doc-look[open] .look-edit::after { content: "Zatvori"; }
.doc-look > summary:hover .look-edit { background: var(--ink); color: var(--paper); }
.look-row { display: grid; grid-template-columns: 130px minmax(0, 1.2fr) minmax(0, 1fr); gap: 6px 24px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule-light); }
.look-row:first-child { border-top-color: var(--ink); }
.look-row input[type="text"] { width: 100%; }
.look-row input[type="number"] { width: 90px; }
.look-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.look-choice input { position: absolute; opacity: 0; pointer-events: none; }
.look-choice span { display: block; padding: 4px 10px; border: 1px solid var(--ink); font-size: 13px; cursor: pointer; }
.look-choice input:checked + span { background: var(--ink); color: var(--paper); }
.look-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.look-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 14px 0 18px; border-top: 1px solid var(--rule-light); }
.look-foot button { padding: 9px 18px; }
@media (max-width: 640px) { .doc-look[open] { padding: 0 12px; } .look-row { grid-template-columns: 1fr; } }
.doc .section-head { font-weight: 600; border-top: 2px solid var(--ink); }
.doc .sign { height: 2.2rem; }
/* Iskaznica (PKP-297): the box „Podaci zaglavlja” above the document. Open while a field of the head is empty; closed it is
   one line with „Uredi”. */
details.doc-head { max-width: 210mm; margin: 0 0 32px; padding: 14px 20px; border: 1px solid var(--ink); }
details.doc-head > summary { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
details.doc-head > summary::-webkit-details-marker { display: none; }
details.doc-head > summary .doc-head-more { letter-spacing: 0; text-transform: none; font-size: 14px; color: var(--accent); }
details.doc-head > summary .doc-head-more::after { content: " ↓"; }
details.doc-head[open] > summary .doc-head-more { display: none; }
details.doc-head[open] > summary { margin-bottom: 20px; }
.fields.six.doc-head-fields { row-gap: 20px; }
.doc-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 20px; }
.doc-actions { max-width: 210mm; margin: 0 0 32px; display: flex; gap: 16px 24px; align-items: center; flex-wrap: wrap; }

/* ---------- Credits (Credits/CreditGate: only users with the flag „Test kredita”) ---------- */

/* The look of the credit screens follows the mock-up (PKP-224). */
/* The icon of a credit (Shared/_CreditIcon): 1em of its text, after a number of credits. */
.credit-icon { display: inline-block; flex: none; width: 1em; height: 1em; margin-left: 0.2em; vertical-align: -0.14em; }
/* The foot of the sidebar: the button „Krediti” with the balance and its icon, the price of the project under it, and the rule
   of the foot under both. */
.sidebar-foot:has(> .sidebar-credits) { padding-top: 0; border-top: 0; }
.sidebar-credits { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; padding-bottom: 16px; border-bottom: 1px solid var(--rule-light); }
.sidebar-foot a.credit-button { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--ink); color: var(--ink); font-size: 14px; }
.sidebar-foot a.credit-button:hover { background: var(--ink); color: var(--paper); }
.credit-button > span { margin-right: auto; }
.credit-button strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.credit-button .credit-icon { width: 18px; height: 18px; margin-left: 2px; }
.credit-price { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
/* Račun and Grupe → Krediti: the balance, large, the small labels „Kupi kredite” and „Povijest”, and the history. */
.credit-body > p { margin: 0; }
.credit-balance { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; font-variant-numeric: tabular-nums; }
.credit-number { font-size: 72px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.credit-word { font-size: 18px; font-weight: 400; }
.credit-body > p.credit-note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.credit-body > h3.credit-label { margin: 40px 0 16px; font-size: 13px; font-weight: 500; letter-spacing: 0.06em; line-height: 1.3; text-transform: uppercase; color: var(--ink-2); }
.credit-body > h3.credit-label.history { margin-top: 48px; }
.credit-body > p.credit-small { margin-top: 16px; font-size: 14px; color: var(--muted); }
.credit-body > p.credit-rules { margin-top: 16px; color: var(--ink-2); }
.credit-body > p.credit-note + p.credit-rules { margin-top: 24px; }
.credit-body > p.muted { margin-top: 0; }
table.credit-history td { padding-top: 14px; padding-bottom: 14px; }
td.credit-date, td.credit-who { white-space: nowrap; }
table.credit-history td .muted { color: var(--muted); }
/* Podaci kupca on Račun and Grupe: the text, the data, „Promijeni” as a button, and the line about the groups. */
.buyer-body { max-width: 640px; }
.buyer-body > p { margin: 0; }
.buyer-body > p.buyer-text { color: var(--ink-2); }
.buyer-body > p.buyer-data { margin: 16px 0 0; }
.buyer-body > p.buyer-change { margin: 16px 0 0; }
.buyer-body > p.buyer-note { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.buyer-body > form { margin-top: 24px; }
p.lost-credits { font-weight: 600; }
/* Korisnici: „Krediti: način test.” above the table, and the flag „Test kredita” as a checkbox that posts its row form. */
.credit-mode { margin: 0 0 16px; }
th.credit-col { white-space: normal; }
button.toggle-check { width: 16px; height: 16px; padding: 0; border: 1px solid var(--ink); background: transparent; vertical-align: -2px; }
button.toggle-check:hover { background: transparent; border-color: var(--accent); }
button.toggle-check[aria-checked="true"], button.toggle-check[aria-checked="true"]:hover { background: var(--ink); box-shadow: inset 0 0 0 3px var(--paper); }
/* The users table with the credit columns fits at 1440 px: closer columns, e-mails broken before „@”, the buttons may wrap. */
table.users-credits th, table.users-credits td { padding-right: 12px; }
table.users-credits th:last-child, table.users-credits td:last-child { padding-right: 0; }
table.users-credits td.user-email { overflow-wrap: normal; }
table.users-credits td { white-space: normal; }
table.users-credits td.row-buttons { white-space: normal; }
/* Korisnici → Dodaj kredite: e-mail and number side by side, the description under them. */
.add-credits { max-width: 640px; }
.add-credits > p { margin: 0; color: var(--ink-2); }
.fields.credit-fields { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* A raised outline button (mock-up): „Kupi” on a pack, „Započnite besplatno” on Cijene. */
.button.pack-buy, .button.raised, button.raised { border-width: 2px; font-weight: 600; box-shadow: 4px 4px 0 var(--ink); }
.button.pack-buy:hover, .button.raised:hover { background: var(--ink); color: var(--paper); }
.button.pack-buy:active, .button.raised:active { box-shadow: 1px 1px 0 var(--ink); transform: translate(3px, 3px); }

/* Proračun and Iskaznica with versions of the documents (Shared/_DocumentVersion, PKP-219). Without a version the page has only
   the head of the document, which fades out at its bottom; the panel „Verzija” is above the document after a version. */
.doc.doc-locked { position: relative; }
.doc.doc-locked::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 160px; background: linear-gradient(to bottom, rgba(238, 229, 210, 0) 0%, rgba(238, 229, 210, 0.8) 55%, var(--paper) 100%); pointer-events: none; }
.version-panel { max-width: 210mm; display: flex; flex-direction: column; gap: 16px; margin: 0 0 56px; padding-top: 16px; border-top: 1px solid var(--ink); }
.version-panel.first { margin: 32px 0 0; padding-top: 0; border-top: 0; }
.version-panel > p, .version-panel > h3 { margin: 0; }
.version-title { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; }
.version-text { max-width: 640px; color: var(--ink-2); }
.version-eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.version-line { font-size: 18px; font-weight: 500; }
.version-panel > .version-left { margin-top: -8px; color: var(--muted); }
.version-actions { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.version-actions form { margin: 0; }
.version-panel button:disabled, .version-panel button:disabled:hover { opacity: 0.45; cursor: default; background: var(--ink); border-color: var(--ink); color: var(--paper); }
.version-confirm { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; border: 1px solid var(--ink); }
.version-confirm > p { margin: 0; }
.version-confirm .version-actions { gap: 16px; }
.version-confirm-title { font-size: 18px; font-weight: 500; }
.version-after { font-size: 14px; color: var(--muted); }
.version-panel > h3.version-head { margin: 24px 0 0; font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.version-table td.version-number { font-weight: 600; }
.version-files { display: flex; flex-wrap: wrap; gap: 4px 16px; }
/* The name of a version with „Preimenuj” (PKP-360): a small button, as „Uredi” of „Izgled PDF-a” (PKP-356); open, its field
   and „Spremi” under the name. */
.version-rename > summary { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; cursor: pointer; list-style: none; }
.version-rename > summary::-webkit-details-marker { display: none; }
.version-rename > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.version-rename .rename-open { padding: 2px 8px; border: 1px solid var(--ink); font-size: 12px; color: var(--ink); white-space: nowrap; }
.version-rename .rename-open::after { content: "Preimenuj"; }
.version-rename[open] .rename-open::after { content: "Zatvori"; }
.version-rename > summary:hover .rename-open { background: var(--ink); color: var(--paper); }
.version-rename form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.version-rename input[type="text"] { width: 190px; max-width: 100%; }
.version-rename button { padding: 6px 14px; font-size: 13px; }
.version-panel > p.version-name-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
ul.warnings.version-messages { margin: 0; }
/* Investitor and Lokacija in the box of the version, with „Spremi” (Shared/_DocumentVersion, Identity). */
.version-identity { display: flex; flex-direction: column; gap: 20px; margin: 0; }
.fields.version-identity-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
@media (max-width: 640px) { .fields.version-identity-fields { grid-template-columns: minmax(0, 1fr); } }
/* Screens 4 and 5: the change of the project as one message without rules, larger; the notes under it keep their list. */
ul.warnings.version-change { border-top: 0; }
ul.warnings.version-change li { padding: 0 0 0 30px; border-bottom: 0; font-size: 16px; }
ul.warnings.version-change li::before { top: 3px; }
ul.warnings.version-change li + li { margin-top: 12px; }
.version-panel > p.version-files-line { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.version-panel > p.version-files-line > .muted { margin-right: -4px; }
.version-panel.offer { gap: 20px; }
.version-confirm-text { color: var(--ink-2); }
/* The head of a document without a version: only its first rows, fading out (mock-up screens 1 and 6). */
.doc.doc-locked { max-height: 320px; overflow: hidden; padding-top: 24px; }
.doc.doc-locked > p:first-child { margin: 0 0 4px; }
.doc.doc-locked h1 { font-size: 30px; }
.doc.doc-locked table.box th, .doc.doc-locked table.box td { padding-top: 8px; padding-bottom: 8px; }
.doc.doc-locked table.box th:first-child { width: 26%; }
ul.warnings.identity-warning { margin: 0 0 24px; }
.doc-version { margin: 0 0 12px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Cijene: the statement under the title, two tiles (free work, paid documents), the table of the bands and the packs. */
/* 48 px under the title (the page body starts 72 px under it), lines filled as in the mock-up, not balanced. */
h2.price-lead { max-width: 760px; margin: -24px 0 32px; font-size: 30px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; text-wrap: wrap; }
.price-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 980px; }
.price-tile { display: flex; flex-direction: column; gap: 8px; padding: 24px; border: 1px solid var(--ink); min-width: 0; }
.price-tile.free { padding: 23px; border-width: 2px; }
.price-tile .actions { margin-top: 16px; }
.price-tile > .price-start { align-self: flex-start; margin: 16px 4px 4px 0; }
.price-label { font-size: 13px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.price-amount { font-size: 56px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.price-list { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--ink); }
.price-list li { padding: 10px 0; border-bottom: 1px solid var(--rule-light); }
.price-text { margin: 8px 0 0; color: var(--ink-2); }
.price-more { margin-top: auto; padding-top: 16px; }
.price-body { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.price-body > p, .price-body > .table-wrap, .price-body > ul, .price-body > .pack-list, .section-body.price-body > p + .table-wrap { margin: 0; }
.price-body > p.price-note { font-size: 14px; color: var(--muted); }
table.price-bands td.price-band { font-weight: 600; white-space: nowrap; }
/* The price by card beside the credits (PKP-241): „1 kredit · 45 €”; on a phone below the credits, so that the column
   Primjer keeps its room. */
table.price-bands td.price-band .price-euros { font-weight: 400; color: var(--muted); }
table.price-bands td.price-band .price-euros::before { content: "· "; }
table.price-bands td.price-example { color: var(--ink-2); }
table.price-bands th.num, table.price-bands td.num { white-space: nowrap; }
@media (max-width: 560px) {
    table.price-bands td.price-band .price-euros { display: block; }
    table.price-bands td.price-band .price-euros::before { content: none; }
    table.price-bands th, table.price-bands th.num { white-space: normal; }
    table.price-bands th, table.price-bands td { padding-right: 12px; }
}
ul.rows.price-rows { border-top: 1px solid var(--ink); }
ul.rows.price-rows li:first-child { padding-top: 14px; }
/* The packs as cards (Shared/_PackList): Cijene, Račun and Grupe → Kupi kredite. */
.pack-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 0; padding: 0; }
.pack-list > li { display: flex; flex-direction: column; min-width: 0; padding: 20px; border: 1px solid var(--ink); }
.pack-list > li.featured { padding: 19px; border-width: 2px; }
.pack-saving { align-self: flex-start; min-height: 24px; padding: 3px 8px; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; line-height: 18px; text-transform: uppercase; }
.pack-saving.none { background: none; padding: 0; }
.pack-credits { margin-top: 6px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.pack-price { margin-top: 6px; font-size: 40px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
/* One plain line (no struck price, PKP-224); on a narrow card it breaks in two even halves, not before the last „45 €”. */
.pack-per { margin-top: 8px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; text-wrap: balance; }
/* The line grows, so that „Kupi” is at the same height on all cards of a row. */
.pack-list > li > .pack-per { flex: 1 0 auto; }
.pack-list .pack-buy { margin: 12px 4px 4px 0; padding: 11px 18px; }

/* Vodič (/vodic, PKP-233): the lessons as rows under a 1 px ink rule, the number in the column of the menu numbers. The title is
   the one link of a row; its ::after covers the row, so the whole row takes the click. */
ol.guide-list { list-style: none; margin: 0; padding: 0; max-width: 820px; border-top: 1px solid var(--ink); }
ol.guide-list > li { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 16px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--rule-light); }
ol.guide-list > li > :not(.guide-n) { grid-column: 2; }
.guide-n { grid-row: 1; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
a.guide-title { font-size: 20px; font-weight: 500; line-height: 1.3; letter-spacing: -0.005em; color: var(--ink); }
a.guide-title::after { content: ""; position: absolute; inset: 0; }
ol.guide-list > li:hover a.guide-title { color: var(--accent); }
ol.guide-list > li:hover .guide-n { color: var(--accent); }
.guide-lead { margin: 6px 0 0; max-width: 680px; color: var(--ink-2); text-wrap: pretty; }
.guide-meta { margin: 10px 0 0; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-wrap: balance; }
.guide-note { margin: 20px 0 0; max-width: 820px; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) {
    ol.guide-list > li { grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; padding: 16px 0; }
    a.guide-title { font-size: 18px; }
}

/* The card payment (Credits/CardPayments, PKP-215). Screens 6 and 6b: the price box, the button and the pack box under it. */
.pay-box { max-width: 560px; margin: 0; border-top: 1px solid var(--ink); }
.pay-box > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule-light); }
.pay-box dt { font-weight: 400; }
.pay-box dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-sub { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.pay-box > div.pay-total { padding: 12px 0; border-bottom: 2px solid var(--ink); font-size: 20px; font-weight: 600; }
.pay-box > div.pay-total dt { font-weight: 600; }
.pay-eyebrow { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
/* Screens 6 and 6b: the raised button „Plati”, and beside it the line to the packs. */
.version-actions > .raised { margin: 0 4px 4px 0; padding: 11px 18px; }
.version-panel button.raised:disabled, .version-panel button.raised:disabled:hover { background: var(--paper); color: var(--ink); }
.version-actions > p.pay-packs { margin: 0; font-size: 15px; }
.pay-packs > span { color: var(--ink-2); }
/* ?paketi=1: the packs in place of the price box, and „← Natrag”. */
.version-panel > p.pay-packs-text { max-width: 640px; color: var(--ink-2); }
.version-panel > .pack-list { max-width: 600px; }
.version-panel > p.pay-note, .pay-note { margin: 0; font-size: 14px; color: var(--muted); }
.buyer-data { margin: 16px 0 8px; }
/* Screen 6a: the step Plaćanje as its own page (Shared/_PaymentLayout and _PaymentStep, PKP-228): a small header with the file
   name of the project or the e-mail, and a box in the middle of the page. */
body.pay-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.pay-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 40px; border-bottom: 1px solid var(--ink); }
.pay-wordmark { flex: none; font-size: 22px; font-weight: 600; letter-spacing: 0.02em; }
.pay-meta { min-width: 0; font-size: 13px; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
.pay-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 64px 16px; }
.pay-step { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 24px; padding: 32px; border: 2px solid var(--ink); }
.pay-step-head { display: flex; flex-direction: column; gap: 8px; }
.pay-step-head > h1 { margin: 0; font-size: 40px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.pay-step-head > p { margin: 0; color: var(--ink-2); }
.pay-step > ul.warnings { margin: 0; }
.pay-step-form { display: flex; flex-direction: column; gap: 24px; margin: 0; }
/* „Način plaćanja”: a real radio for each way (only the card for now), hidden under the square of the board; the chosen way has
   a 2 px border, and the label shows the focus ring of the radio. */
.pay-methods { min-width: 0; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 12px; }
.pay-methods > legend { padding: 0; margin-bottom: 12px; }
.pay-option { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px 17px; border: 1px solid var(--ink); cursor: pointer; }
.pay-option:has(> input:checked) { padding: 15px 16px; border-width: 2px; }
.pay-option:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-option > input[type="radio"] { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.pay-radio { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-top: 3px; border: 1px solid var(--ink); }
.pay-option > input:checked + .pay-radio::after { content: ""; width: 8px; height: 8px; background: var(--ink); }
.pay-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay-option-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pay-option-title > svg { flex: none; }
.pay-option-note { font-size: 14px; color: var(--ink-2); }
.pay-buyer { display: flex; flex-direction: column; gap: 6px; }
.pay-buyer .fields { margin-top: 8px; row-gap: 24px; }
/* „Trebate račun na tvrtku ili obrt (R1)?”: the question opens the three fields of the buyer (Shared/_PaymentStep). */
.pay-r1 > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.pay-r1 > summary::-webkit-details-marker { display: none; }
.pay-r1 > summary::before { content: ""; flex: none; width: 14px; height: 14px; border: 1px solid var(--ink); background: var(--paper); }
.pay-r1[open] > summary::before { background: var(--ink); box-shadow: inset 0 0 0 3px var(--paper); }
.pay-r1 > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.pay-r1[open] > .fields { margin-top: 20px; }
.pay-r1-hint { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.pay-buyer-data { margin: 0; }
.pay-buyer-data a { margin-left: 8px; }
/* „Plati karticom” raised; „Odustani” a plain link with a 44 px target. */
.pay-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.pay-actions > button.raised { margin: 0 4px 4px 0; padding: 11px 18px; }
a.pay-cancel { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--ink); line-height: 1.25; text-decoration: underline; text-underline-offset: 3px; }
a.pay-cancel:hover { color: var(--accent); }

@media (max-width: 640px) {
    .pay-header { padding: 16px; }
    .pay-main { align-items: flex-start; padding: 32px 16px; }
    .pay-step { padding: 20px; }
    .pay-step-head > h1 { font-size: 32px; }
    .pay-box > div { flex-wrap: wrap; }
    .version-confirm { padding: 16px; }
    .version-actions .button, .version-actions > button, .version-actions form, .version-actions form button { width: 100%; }
    .price-tiles { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .price-amount { font-size: 44px; }
    h2.price-lead { margin-top: -16px; font-size: 24px; }
    /* One card in a row; without „Ušteda” no empty line. */
    .pack-list { grid-template-columns: minmax(0, 1fr); }
    .pack-saving.none { display: none; }
    .pack-saving.none + .pack-credits { margin-top: 0; }
    .credit-number { font-size: 56px; }
    /* The history: the date on two lines, so that Opis keeps room; the table scrolls in its box when it must. */
    td.credit-date { white-space: normal; }
    table.credit-history td:nth-child(3) { min-width: 8rem; }
    .fields.credit-fields { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Narrow screens ---------- */

@media (max-width: 1400px) {
    .editor-layout { grid-template-columns: minmax(0, 1fr); }
    .preview, .preview-col > .part-3d { position: static; }
}

@media (max-width: 1100px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; align-self: auto; height: auto; overflow: visible; flex-direction: column; gap: 16px; padding: 20px 24px 0; border-right: 0; border-bottom: 1px solid var(--ink); }
    .brand-block { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
    .nav { flex-direction: row; flex-wrap: wrap; column-gap: 24px; border-bottom: 0; }
    .nav-project { flex: 0 0 100%; flex-direction: row; align-items: baseline; gap: 16px; padding-bottom: 4px; }
    .nav-back { flex: none; }
    .nav .tab { display: flex; gap: 6px; padding: 10px 0; border-top: 0; white-space: nowrap; }
    .nav .tab .index { display: none; }
    .nav .tab.active { box-shadow: inset 0 -2px 0 var(--accent); }
    .sidebar-bottom { display: none; }
    .app-footer .feedback-footer:not([hidden]) { display: inline; }
    .page { padding: 32px 24px 80px; }
    .page.hero { --gap-hero: 96px; --gap-content: 72px; --gap-section: 96px; }
    .section { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .columns { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
    .signers { grid-template-columns: minmax(0, 1fr); }
    .fields.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fields.six > .span-2, .fields.six > .span-3, .fields.six > .span-6, .fields.six > .wide { grid-column: span 2; }
    .summary { flex-wrap: wrap; }
    .summary .tile { flex: 1 1 30%; padding: 14px 20px 20px 0; border-left: 0; border-top: 1px solid var(--rule-light); }
    .summary .tile:has(> .value.small) { flex-basis: 100%; padding-left: 0; border-left: 0; border-top: 1px solid var(--ink); }
    .summary .tile .value { font-size: 56px; }
    .project-list .date, .project-list .row-actions { width: auto; }
}

/* A narrow list keeps the name, Izmijenjen and the actions: Kreiran hides. */
@media (max-width: 700px) {
    .project-list .created { display: none; }
}

@media (max-width: 640px) {
    .fields, .fields.six { grid-template-columns: minmax(0, 1fr); }
    .fields.six > * { grid-column: auto !important; }
    .summary .tile { flex-basis: 45%; }
    .project-list thead { display: none; }
    .project-list tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .project-list td { border-bottom: 0; }
    .project-list td:first-child { grid-column: 1 / -1; padding-bottom: 4px; }
    .project-list tr { border-bottom: 1px solid var(--rule-light); }
    /* The actions have their own line under the date (PKP-313: three of them do not fit beside it). */
    .project-list td.date { padding-bottom: 8px; }
    .project-list .row-actions { grid-column: 1 / -1; padding-top: 0; text-align: left; }
    .project-list .row-actions > * { margin: 0 24px 0 0; }
    .project-list .row-actions > :last-child { margin-right: 0; }
    .project-list .row-actions > .row-action-list { justify-content: flex-start; }
    .project-list .row-actions details.confirm form { align-items: flex-start; }
    .list-toolbar { align-items: stretch; flex-direction: column; }
    .list-toolbar-right .button { flex: 1 1 0; }
    .draft-links { margin-bottom: 40px; }
    a.draft-link { padding: 16px 4px 16px 18px; }
    button.draft-trash { margin: 0 8px 0 4px; }
    .draft-row.asking { padding: 14px 18px; }
    .draft-title { font-size: 20px; }
}

/* ---------- Print: the report and the Iskaznica on white A4 ---------- */

@media print {
    @page { size: A4; margin: 15mm 14mm; }
    :root { --paper: #fff; --ink: #000; --ink-2: #222; --muted: #333; --rule-light: #999; }
    body { background: #fff; font-size: 10pt; }
    .no-print, .sidebar, .meta, .page-title, .lead, .app-footer, .doc-actions, .doc-look { display: none !important; }
    .shell { display: block; }
    .page { padding: 0; }
    .page-body { margin-top: 0; }
    .doc { border: 0; padding: 0; max-width: none; }
    .doc section, .doc table { break-inside: auto; }
    /* On paper a table does not scroll: the whole table prints. */
    .table-wrap { overflow: visible; }
    .doc tr, .doc h2, .doc h3 { break-inside: avoid; break-after: avoid-page; }
    .pill.fail::before, ul.warnings li.fail::before, .sign.fail::before { background: #000; }
    /* Rezultati: the column „3D” is for the screen only (PKP-319). */
    table.caps .index-fig { display: none; }
}

/* ---------- Dialog ---------- */

/* A dialog in the look of the pages: paper, an ink frame with a 2 px top rule, square corners, the accent square for a warning. */
dialog.buka-dialog { width: min(560px, calc(100vw - 32px)); max-width: none; padding: 0; border: 1px solid var(--ink); border-top-width: 2px; border-radius: 0; background: var(--paper); color: var(--ink); }
dialog.buka-dialog::backdrop { background: rgba(42, 41, 37, 0.45); }
.dialog-body { padding: 28px 32px 32px; }
.dialog-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.dialog-eyebrow::before { content: ""; width: 9px; height: 9px; background: var(--accent); }
dialog.buka-dialog h2 { margin: 12px 0 0; font-size: 30px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; }
dialog.buka-dialog p { margin: 12px 0 0; max-width: 46ch; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
dialog.buka-dialog .actions { margin-top: 28px; }
dialog.buka-dialog [hidden] { display: none; }
button.dialog-close { padding: 13px 0; border: 0; background: none; color: var(--accent); font-size: 15px; }
button.dialog-close:hover { background: none; color: var(--ink); }
/* Unutarnja buka (PKP-308): the large 3D figure of a row (index-figures.js; figure-3d.js "dialog"). The figure fills the
   width; a drag turns it, also with a finger. Its edges are only a drawing: no pointer cursor, no hover. */
dialog.buka-dialog.index-figure-dialog { width: min(720px, calc(100vw - 32px)); }
dialog.buka-dialog.index-figure-dialog p.index-figure-rooms { margin-top: 8px; max-width: none; font-size: 15px; }
.index-figure-view { margin-top: 20px; border: 1px solid var(--ink); background: var(--paper); }
.index-figure-view svg { cursor: grab; touch-action: none; }
.index-figure-view svg.dragging, .index-figure-view svg.dragging * { cursor: grabbing; }
.p3-plain .p3-edge, .p3-plain .p3-face { cursor: inherit; pointer-events: none; }
.index-figure-foot { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.index-figure-foot button.link-inline { font-size: 13px; }
dialog.buka-dialog.index-figure-dialog .actions { margin-top: 24px; }
@media (max-width: 640px) {
    dialog.buka-dialog.index-figure-dialog .dialog-body { padding: 20px 16px 24px; }
    dialog.buka-dialog.index-figure-dialog h2 { font-size: 24px; }
    dialog.buka-dialog.index-figure-dialog .actions { gap: 12px 24px; }
}
/* The element form in a frame of the wizard's dialog (Pages/CarobnjakElement): the page without the shell, its own head. */
body.embed .page-body { padding: 24px 32px 40px; }
.embed-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.embed-title { margin: 10px 0 0; font-size: 30px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; }
.embed-lead { margin: 8px 0 0; max-width: 70ch; }
button.embed-close { flex: none; width: 40px; height: 40px; padding: 0; border: 0; background: none; color: var(--ink); font-size: 28px; line-height: 1; }
button.embed-close:hover { background: var(--rule-light); }
@media (max-width: 640px) { body.embed .page-body { padding: 16px; } .embed-title { font-size: 24px; } }
/* The frame is narrower than a page: the preview stays beside the form, and Spremi i odaberi stays in view. */
@media (min-width: 1000px) {
    body.embed .editor-layout.element-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); grid-template-rows: auto 1fr; grid-template-areas: "main side" "actions side"; gap: 0 32px; }
.element-layout > .editor { grid-area: main; }
.element-layout > .element-side { grid-area: side; }
.element-layout > .actions { grid-area: actions; align-self: start; }
    body.embed .preview { position: sticky; top: 24px; }
}
body.embed #editor > .actions { position: sticky; bottom: 0; z-index: 2; margin-bottom: -40px; padding: 16px 0 24px; border-top: 1px solid var(--rule-light); background: var(--paper); }
/* The room dialog: a form with fields, wider than a question. */
dialog.room-dialog { width: min(640px, calc(100vw - 32px)); }
dialog.room-dialog .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; row-gap: 24px; margin-top: 28px; }
@media (max-width: 600px) { dialog.room-dialog .fields { grid-template-columns: minmax(0, 1fr); } }
dialog.room-dialog p.room-dialog-note { font-size: 14px; color: var(--muted); }
dialog.room-dialog ul.warnings { margin: 16px 0 0; }

/* Nova verzija: a dark plate at the bottom when an answer of the server names a newer version than this page
   (wwwroot/js/verzija.js). At the bottom in the middle: the wizard's measure box is at the right, the consent card too. */
.version-bar { position: fixed; left: 50%; bottom: 24px; z-index: 55; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px); padding: 10px 18px; background: var(--ink); color: var(--paper); font-size: 15px; line-height: 1.3; }
.version-bar[hidden] { display: none; }
/* After Spremi element (PKP-3): the same dark bar, for a few seconds (wwwroot/js/index.js). */
.saved-bar { position: fixed; left: 50%; bottom: 24px; z-index: 54; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 10px 10px 10px 18px; background: var(--ink); color: var(--paper); font-size: 15px; line-height: 1.3; animation: saved-bar-in 0.25s ease-out; transition: opacity 0.3s, transform 0.3s; }
.saved-bar.closing { opacity: 0; transform: translate(-50%, 8px); }
.saved-bar-check { color: var(--accent); font-weight: 700; }
.saved-bar button { all: unset; box-sizing: border-box; cursor: pointer; padding: 2px 8px; font-size: 20px; line-height: 1; }
.saved-bar button:hover, .saved-bar button:focus-visible { color: var(--accent); outline: none; }
@keyframes saved-bar-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .saved-bar { animation: none; transition: none; } }
.version-bar button { all: unset; box-sizing: border-box; cursor: pointer; padding: 4px 12px; border: 1px solid var(--paper); font-weight: 600; white-space: nowrap; }
.version-bar button:hover, .version-bar button:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }


/* The numbers and groups of the rows of Table C.1.1 in the pickers (Partitions.cshtml, Facades.cshtml), and the kind icons of Građevni dijelovi. */
.ia-icon { width: 30px; height: 30px; color: var(--ink-2); }
.ia-number { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.ia-group { margin: 24px 0 0; padding: 0; border: 0; }
.ia-group legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.ia-row-title { font-weight: 500; margin-bottom: 6px; }
.ia-row-title .ia-number { margin-right: 6px; }
.ia-row-title .choice-tag { margin-left: 8px; }
/* Nova pregrada, the first step: the rows of Annex C (Partitions.cshtml). */
.pick > p:first-child { margin-top: 0; }
.pick-table { margin-top: 28px; }
.pick-table h2 { margin: 0; font-size: 20px; font-weight: 500; }
.pick-group { margin-top: 20px; }
.pick-group h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.pick-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--rule-light); }
.pick-row .ia-number { padding-top: 4px; }
.pick-row .ia-row-title { margin-bottom: 4px; }
.pick-variant { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; color: var(--ink); }
.pick-variant b { flex: none; min-width: 2.2em; font-weight: 600; color: var(--accent); }
.pick-variant:hover { color: var(--accent); }
/* Table C.1.1 on Nova pregrada and Nova fasada (_RowPicker): a drawing of each row, and its variants with the wand of the 3D wizard. */
.ia-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--rule-light); }
.ia-row.soon { color: var(--muted); }
.ia-row.soon .ia-icon { color: var(--rule-light); }
.ia-variant { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; font-size: 15px; color: var(--ink); }
a.ia-variant:hover { color: var(--accent); }
/* A row with one variant: the link of the variant covers the whole row, so a click on the drawing or the title opens it too. */
.ia-row.one { position: relative; }
.ia-row.one a.ia-variant::before { content: ""; position: absolute; inset: 0; }
.ia-row.one:has(a.ia-variant:hover) .ia-row-title, .ia-row.one:has(a.ia-variant:hover) .ia-icon { color: var(--accent); }
.ia-variant.off { color: var(--muted); }
.ia-go { flex: none; width: 18px; height: 18px; align-self: center; color: var(--accent); }
.pick-worktype { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-top: 12px; }
.pick-worktype .field { min-width: 260px; }
/* Odvoji od čarobnjaka under a partition or façade of the 3D wizard (_InteractionNote). */
details.confirm.detach { display: block; margin-top: 4px; }
details.confirm.detach summary { padding: 6px 0; }
details.confirm.detach p { margin: 4px 0 8px; }
.pick-more { margin-top: 36px; border-top: 1px solid var(--ink); padding-top: 14px; }
.pick-more > summary { cursor: pointer; list-style: none; font-size: 18px; font-weight: 500; }
.pick-more > summary::-webkit-details-marker { display: none; }
.pick-more > summary::after { content: " ↓"; }
.pick-more[open] > summary::after { content: " ↑"; }

/* Izvori podataka (/katalog): the lines of a technical sheet, word for word */
.prov-quotes { margin: 0; padding-left: 16px; font-size: 13px; color: var(--ink-2); }
.prov-quotes li { margin: 2px 0; }
.prov-table td { vertical-align: top; }

/* The manufacturers' catalogue (_CatalogDialog, js/catalog.js): a search, filters and one row per product */
dialog.catalog-dialog { width: min(760px, calc(100vw - 32px)); }
dialog.catalog-dialog .field { margin-top: 20px; }
.catalog-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.catalog-filters button { padding: 4px 10px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.catalog-filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.catalog-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: min(52vh, 460px); overflow-y: auto; border-top: 1px solid var(--rule-light); }
.catalog-list li { border-bottom: 1px solid var(--rule-light); }
.catalog-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; width: 100%; padding: 10px 4px; border: 0; background: none; text-align: left; text-transform: none; letter-spacing: 0; color: var(--ink); }
.catalog-item:hover, .catalog-item:focus-visible { background: var(--paper-2, rgba(0, 0, 0, 0.04)); color: var(--ink); }
.catalog-name { font-weight: 600; font-size: 15px; }
.catalog-meta { grid-column: 1; font-size: 13px; color: var(--muted); }
.catalog-badge { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: 3px 8px; border: 1px solid var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.catalog-badge.tested { border-color: var(--accent); color: var(--accent); }
.catalog-open { margin-top: 8px; }
td > .room-actions { display: flex; margin-top: 4px; }
@media (max-width: 600px) { .catalog-item { grid-template-columns: minmax(0, 1fr); } .catalog-badge { grid-column: 1; grid-row: auto; justify-self: start; } }

/* The element form in a frame (element-frame.js): Detaljni unos of the wizard and Uredi obloge elementa. Almost the whole
   window, on a phone the whole window. */
dialog.element-frame { width: min(1240px, calc(100vw - 32px)); height: calc(100dvh - 32px); max-height: none; overflow: hidden; }
dialog.element-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--paper); }
dialog.element-frame.loading iframe { visibility: hidden; }
/* A post of the form loads into a new frame under the old one (element-frame.js, repost). */
dialog.element-frame iframe.next { position: absolute; inset: 0; visibility: hidden; }
dialog.element-frame.busy { cursor: progress; }
dialog.element-frame.busy iframe { pointer-events: none; }
dialog.element-frame .element-frame-wait { position: absolute; inset: 0; display: none; place-items: center; margin: 0; max-width: none; color: var(--muted); }
dialog.element-frame.loading .element-frame-wait { display: grid; }
@media (max-width: 640px) { dialog.element-frame { width: 100vw; height: 100dvh; border: 0; } }
