/* Pasportys · Zakázky (ukázka) - tokens per _spec/DESIGN.md */
:root {
  --teal: #467E8A;
  --teal-ink: #2F5F69;
  --teal-wash: #E8F0F2;
  --ink: #242424;
  --ink-2: #5B6266;
  --line: #C5C5C5;
  --line-2: #E2E4E5;
  --paper: #FFFFFF;
  --desk: #F6F6F6;
  --warn: #A15C00;
  --warn-wash: #FBF1E3;
  --late: #B3261E;
  --late-wash: #FBEAE8;
  --ok: #2E7D4F;
  --ok-wash: #E7F3EC;
  --font: "Afacad", system-ui, -apple-system, "Segoe UI", sans-serif;
  --rail: 232px;
  --ribbon: 36px;
  --radius: 6px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--desk);
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal-ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 600; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- demo ribbon ---------- */
.ribbon {
  position: sticky; top: 0; z-index: 40;
  height: var(--ribbon);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px;
  background: var(--ink); color: #fff;
  font-size: 14px;
}
.ribbon a { color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ribbon a:hover { text-decoration: underline; }
.ribbon .r-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .86; }

/* ---------- login ---------- */
.login {
  min-height: calc(100vh - var(--ribbon));
  min-height: calc(100svh - var(--ribbon));
  display: grid; place-items: center;
  padding: 32px 16px;
  background:
    linear-gradient(var(--line-2) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--desk);
}
.login-sheet {
  width: min(440px, 100%);
  background: var(--paper);
  border: 1.5px solid var(--ink);
}
.login-sheet .ls-head { padding: 28px 28px 20px; border-bottom: 1px solid var(--line); }
.login-sheet .ls-head img { width: 200px; height: auto; }
.login-sheet form { padding: 22px 28px 26px; display: grid; gap: 14px; }
.login-sheet .ls-foot { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.login-sheet .ls-foot div { padding: 8px 12px; }
.login-sheet .ls-foot div + div { border-left: 1px solid var(--line); }
.login h1 { font-size: 22px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); align-content: start; min-height: calc(100vh - var(--ribbon)); }
.rail {
  position: sticky; top: var(--ribbon);
  height: calc(100vh - var(--ribbon));
  display: flex; flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--line-2);
  padding: 18px 12px 14px;
}
.rail .brand { padding: 4px 10px 18px; }
.rail .brand img { width: 168px; height: auto; }
.rail nav { display: grid; gap: 2px; }
.navlink {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-size: 15px;
}
.navlink svg { width: 20px; height: 20px; flex: none; stroke: var(--ink-2); }
.navlink:hover { background: var(--desk); }
.navlink[aria-current="page"] { background: var(--teal-wash); color: var(--teal-ink); font-weight: 600; }
.navlink[aria-current="page"] svg { stroke: var(--teal-ink); }
.navlink .count {
  margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 4px;
  background: var(--late); color: #fff; font-size: 12px; font-weight: 600; text-align: center; line-height: 20px;
}
.navlink .count.warn { background: var(--warn); }
.rail .rail-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); }

.userchip {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px; border: 0; border-radius: var(--radius); background: transparent; cursor: pointer; text-align: left;
}
.userchip:hover { background: var(--desk); }
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--teal); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.userchip .u-name { font-weight: 600; line-height: 1.2; }
.userchip .u-role { font-size: 13px; color: var(--ink-2); }

.main { min-width: 0; padding: 26px 32px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 30px; letter-spacing: -.01em; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.role-banner {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: -6px 0 18px; padding: 10px 14px;
  background: var(--teal-wash); border-left: 3px solid var(--teal); color: var(--teal-ink);
}
.role-banner button { margin-left: auto; }

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--teal); border-radius: var(--radius);
  background: var(--teal); color: #fff; font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--teal-ink); border-color: var(--teal-ink); }
.btn.secondary { background: var(--paper); color: var(--teal-ink); }
.btn.secondary:hover { background: var(--teal-wash); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--teal-ink); padding: 0 10px; }
.btn.ghost:hover { background: var(--teal-wash); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .label {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--paper);
  font-size: 15px;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal); outline: 2px solid var(--teal-wash); outline-offset: 0; }
.input[readonly], .input:disabled { background: var(--desk); color: var(--ink-2); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--teal); flex: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.hint { font-size: 13px; color: var(--ink-2); }

/* ---------- panels ---------- */
.panel { background: var(--paper); border: 1px solid var(--line-2); border-radius: 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { font-size: 18px; }
.panel-body { padding: 18px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.stack > *, .cols > *, .panel { min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* ---------- razítko (title block) ---------- */
.razitko {
  display: grid; gap: 1px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1.5px solid var(--ink);
  background: var(--line);
}
.razitko > div { padding: 7px 10px 8px; background: var(--paper); min-width: 0; }
.razitko .rz-l { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.razitko .rz-v { display: block; font-size: 15px; overflow-wrap: anywhere; }
.razitko .w2 { grid-column: span 2; } .razitko .w3 { grid-column: span 3; } .razitko .w4 { grid-column: span 4; } .razitko .w6 { grid-column: span 6; }
.razitko .proj .rz-v { font-size: 24px; font-weight: 600; line-height: 1.12; text-transform: uppercase; letter-spacing: .01em; }
.razitko .proj .rz-sub { display: block; font-size: 16px; margin-top: 2px; }
.razitko .big .rz-v { font-size: 22px; font-weight: 600; }

/* ---------- kóta (deadline gauge) ---------- */
.kota-wrap { color: var(--teal-ink); min-width: 0; }
.kota-wrap.warn { color: var(--warn); }
.kota-wrap.late { color: var(--late); }
.kota-label { text-align: center; font-size: 13px; font-weight: 600; line-height: 1; margin-bottom: 1px; }
.kota { display: block; width: 100%; height: 20px; overflow: visible; }
.kota line { vector-effect: non-scaling-stroke; fill: none; stroke: currentColor; }
.kota .k-line, .kota .k-tick { stroke-width: 1.3; }
.kota .k-ext { stroke-width: 1; opacity: .5; }
.kota .k-now { stroke: var(--ink); stroke-width: 2; }
.kota .k-done { stroke-width: 4; opacity: .2; }
.kota-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-2); }

/* ---------- status tags (square, not pills) ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 7px; border-radius: 3px;
  font-size: 12.5px; font-weight: 600; line-height: 20px;
  background: var(--desk); color: var(--ink-2); border: 1px solid var(--line-2);
  white-space: nowrap;
}
.tag.teal { background: var(--teal-wash); color: var(--teal-ink); border-color: transparent; }
.tag.warn { background: var(--warn-wash); color: var(--warn); border-color: transparent; }
.tag.late { background: var(--late-wash); color: var(--late); border-color: transparent; }
.tag.ok { background: var(--ok-wash); color: var(--ok); border-color: transparent; }

/* ---------- board ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { max-width: 300px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.seg button { border: 0; background: transparent; padding: 0 14px; min-height: 38px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--teal-wash); color: var(--teal-ink); font-weight: 600; }

.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.col { background: #EEEFEF; border-radius: 8px; padding: 10px; min-width: 0; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 10px; }
.col-head h2 { font-size: 15px; font-weight: 600; }
.col-head .n { font-size: 13px; color: var(--ink-2); }
.cards { display: grid; gap: 10px; }
.card {
  display: block; position: relative;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 6px;
  padding: 12px 12px 10px; text-decoration: none; color: inherit;
  box-shadow: 0 1px 0 rgba(36, 36, 36, .04);
}
.card:hover { border-color: var(--teal); }
.card .c-id { font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.card h3 { font-size: 16px; font-weight: 600; margin: 3px 0 2px; line-height: 1.22; }
.card .c-place { font-size: 14px; color: var(--ink-2); }
.card .c-tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0 8px; }
.card .c-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.card .c-foot .c-who { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.empty-col { padding: 14px 8px; font-size: 13px; color: var(--ink-2); text-align: center; border: 1px dashed var(--line); border-radius: 6px; }

/* table list */
.table-wrap { position: relative; overflow-x: auto; background: var(--paper); border: 1px solid var(--line-2); border-radius: 8px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.link { cursor: pointer; }
table.t tbody tr.link:hover { background: var(--desk); }
table.t .num { text-align: right; white-space: nowrap; }
table.t tfoot td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }

/* ---------- dashboard ---------- */
.deadlines { display: grid; }
.dl {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 6px 20px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: inherit;
}
.dl:last-child { border-bottom: 0; }
.dl:hover { background: var(--desk); }
.dl .dl-what { font-size: 13px; color: var(--ink-2); }
.dl .dl-title { font-weight: 600; font-size: 16px; line-height: 1.25; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--ink-2); font-size: 13px; }

/* ---------- detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-size: 14px; margin-bottom: 12px; }
.back:hover { color: var(--teal-ink); }
.back svg { width: 16px; height: 16px; }
.dropzone > svg { width: 32px; height: 32px; color: var(--teal); }
/* phase stepper drawn as a dimension chain (kótovací řetězec) */
.stepper { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0 6px; }
.stepper::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; border-top: 1.5px solid var(--line); }
.stepper::after { content: ""; position: absolute; right: 0; top: 0; width: 1.5px; height: 13px; background: var(--ink-2); transform: rotate(45deg); }
.step { position: relative; padding: 18px 8px 0 0; font-size: 14px; color: var(--ink-2); }
.step::before { content: ""; position: absolute; left: 0; top: 0; width: 1.5px; height: 13px; background: var(--ink-2); transform: rotate(45deg); z-index: 1; }
.step.done::after, .step.now::after { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 3px; background: var(--teal); opacity: .4; }
.step.now::after { opacity: 1; }
.step.done::before, .step.now::before { background: var(--teal-ink); }
.step.now { color: var(--ink); font-weight: 600; }
.stage-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 18px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 18px; overflow-x: auto; scrollbar-width: thin; }
.tabs a {
  padding: 10px 14px; text-decoration: none; color: var(--ink-2); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--teal-ink); border-bottom-color: var(--teal); font-weight: 600; }

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 15px; }
.kv dt { color: var(--ink-2); font-size: 14px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.rooms td input { min-height: 34px; padding: 4px 8px; }
.rooms .ozn { width: 76px; } .rooms .pl { width: 110px; text-align: right; }
.rooms .del { width: 40px; }
.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 4px; cursor: pointer; color: var(--ink-2); }
.iconbtn:hover { background: var(--late-wash); color: var(--late); }
.iconbtn svg { width: 18px; height: 18px; stroke: currentColor; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo { background: var(--paper); border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; display: grid; }
.photo .ph-img { aspect-ratio: 4 / 3; background: var(--desk); display: grid; place-items: center; overflow: hidden; }
.photo .ph-img img { width: 100%; height: 100%; object-fit: contain; }
.photo .ph-meta { padding: 8px; display: flex; gap: 6px; align-items: center; }
.photo .ph-meta .input { min-height: 34px; padding: 4px 8px; font-size: 14px; }
.dropzone {
  display: grid; place-items: center; gap: 10px; text-align: center;
  padding: 26px 16px; border: 1.5px dashed var(--line); border-radius: 8px; background: var(--paper);
}
.dropzone.over { border-color: var(--teal); background: var(--teal-wash); }
.dropzone .dz-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.docs-list { list-style: none; margin: 0; padding: 0; }
.docs-list li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.docs-list li:last-child { border-bottom: 0; }
.docs-list .d-ico { width: 34px; height: 40px; flex: none; border: 1px solid var(--line); border-radius: 2px; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.docs-list .d-ico.pdf { color: var(--late); }
.docs-list .d-ico.doc { color: #2B579A; }
.docs-list .d-name { font-weight: 600; }
.docs-list .d-sub { font-size: 13px; color: var(--ink-2); }
.docs-list .d-act { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- calculator ---------- */
.calc-out { position: sticky; top: calc(var(--ribbon) + 16px); }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.sum-row .amt { white-space: nowrap; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0 4px; }
.sum-total .amt { font-size: 30px; font-weight: 600; color: var(--teal-ink); white-space: nowrap; }
.note-demo { font-size: 13px; color: var(--ink-2); padding: 10px 12px; background: var(--desk); border-radius: 4px; }
.note-inline { font-size: 13.5px; padding: 8px 12px; background: var(--warn-wash); color: var(--warn); border-radius: 4px; }

/* ---------- users ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--line); }

/* ---------- dialogs ---------- */
dialog {
  margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  color: var(--ink); background: var(--paper);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
}
dialog::backdrop { background: rgba(36, 36, 36, .45); }
dialog.wide { width: min(940px, calc(100vw - 32px)); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.dlg-head h2 { font-size: 20px; }
.dlg-body { padding: 18px 20px; display: grid; gap: 14px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: var(--paper); flex-wrap: wrap; }
.dlg-close { width: 38px; height: 38px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.dlg-close:hover { background: var(--desk); }
.dlg-close svg { width: 20px; height: 20px; stroke: var(--ink); }
.preview-desk { background: #E9EAEA; padding: 20px; }

/* ---------- A4 sheet (offer / report) ---------- */
.sheet {
  width: 100%; max-width: 794px; margin: 0 auto;
  aspect-ratio: 210 / 297; overflow: hidden;
  background: #fff; color: #1d1d1d;
  padding: 44px 48px 36px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
  display: flex; flex-direction: column;
  font-size: 13px; line-height: 1.45;
}
.sheet.flow { aspect-ratio: auto; overflow: visible; min-height: 0; }
.sheet .sh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 16px; border-bottom: 1.5px solid #1d1d1d; }
.sheet .sh-head img { width: 190px; height: auto; }
.sheet .sh-doc { text-align: right; }
.sheet .sh-doc .t { font-size: 22px; font-weight: 600; line-height: 1.1; }
.sheet .sh-doc .n { color: #555; margin-top: 4px; }
.sheet .sh-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 16px 0; }
.sheet .lbl { font-size: 9.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #666; margin-bottom: 3px; }
.sheet h4 { font-size: 15px; margin: 6px 0 8px; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sheet th { text-align: left; font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: #666; font-weight: 600; padding: 6px 6px; border-bottom: 1px solid #1d1d1d; }
.sheet td { padding: 6px 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
.sheet .num { text-align: right; white-space: nowrap; }
.sheet .total td { border-bottom: 0; border-top: 1.5px solid #1d1d1d; font-weight: 600; font-size: 16px; padding-top: 10px; }
.sheet .sh-notes { margin-top: 16px; display: grid; gap: 4px; color: #333; }
.sheet .sh-foot { margin-top: auto; }
.sheet .razitko { font-size: 12px; border-color: #1d1d1d; background: #bbb; }
.sheet .razitko > div { padding: 5px 8px 6px; background: #fff; }
.sheet .razitko .rz-l { font-size: 8.5px; color: #555; }
.sheet .razitko .rz-v { font-size: 12px; }
.sheet .razitko .proj .rz-v { font-size: 15px; }
.sheet .razitko .proj .rz-sub { font-size: 12px; }
.sheet .razitko .big .rz-v { font-size: 14px; }
.sheet .rep-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet .rep-photos figure { margin: 0; }
.sheet .rep-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f4f4f4; border: 1px solid #ddd; }
.sheet .rep-photos figcaption { font-size: 11px; color: #444; margin-top: 3px; }
.sheet .demo-mark { font-size: 10.5px; color: #777; margin-top: 10px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 0; right: 0; bottom: 24px; z-index: 60;
  margin: 0 auto; width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 16px; border-radius: 8px;
  background: var(--ink); color: #fff; font-size: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: tin .2s ease-out; }
  @keyframes tin { from { opacity: 0; transform: translateY(8px); } }
}

/* ---------- mobile tab bar ---------- */
.tabbar { display: none; }
.mobile-top { display: none; }

/* ---------- responsive ---------- */
@media screen and (max-width: 1180px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .calc-out { position: static; }
  .board { grid-template-columns: repeat(4, minmax(240px, 1fr)); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
}
@media screen and (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .main { padding: 16px 16px 96px; }
  .mobile-top {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: sticky; top: var(--ribbon); z-index: 30;
    padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--line-2);
  }
  .mobile-top img { width: 132px; height: auto; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: var(--paper); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    display: grid; justify-items: center; gap: 2px; padding: 6px 2px;
    min-height: 52px; border: 0; background: transparent; cursor: pointer;
    color: var(--ink-2); text-decoration: none; font-size: 12px; position: relative;
  }
  .tabbar svg { width: 22px; height: 22px; stroke: currentColor; }
  .tabbar [aria-current="page"] { color: var(--teal-ink); font-weight: 600; }
  .tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; padding: 0 4px; border-radius: 9px; background: var(--late); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
  .tabbar .new span.plus { width: 40px; height: 40px; border-radius: 50%; background: var(--teal); display: grid; place-items: center; margin-top: -2px; }
  .tabbar .new { color: var(--teal-ink); }
  .tabbar .new .plus { color: #fff; }
  .page-head h1 { font-size: 25px; }
  .page-head .page-actions [data-action="new-zakazka"] { display: none; }
  .board { grid-template-columns: repeat(4, minmax(78vw, 1fr)); margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .razitko { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .razitko .w2, .razitko .w3, .razitko .w4, .razitko .w6 { grid-column: span 2; }
  .razitko .half { grid-column: span 1; }
  .razitko .proj .rz-v { font-size: 19px; }
        .dl { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stepper .step { font-size: 12.5px; }
  .preview-desk { padding: 10px; }
  .sheet { padding: 22px 20px; aspect-ratio: auto; font-size: 12px; }
  .sheet .sh-head img { width: 130px; }
  .sheet .sh-doc .t { font-size: 17px; }
  .sheet .sh-two { grid-template-columns: 1fr; gap: 10px; }
  .toast { bottom: 84px; }
}
@media screen and (max-width: 560px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .toolbar .input { max-width: none; flex: 1 1 100%; }
  .docs-list li { flex-wrap: wrap; }
  .docs-list .d-act { margin-left: 46px; justify-content: flex-start; }
  .ribbon .r-note { font-size: 13px; }
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .photo .ph-meta { flex-wrap: wrap; }
}

/* ---------- print: only the A4 sheet ---------- */
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  #print-root .sheet { box-shadow: none; max-width: none; width: 210mm; min-height: 297mm; aspect-ratio: auto; overflow: visible; padding: 16mm 16mm 12mm; font-size: 11pt; }
  #print-root .sheet.flow { min-height: 0; }
  #print-root .rep-photos figure { break-inside: avoid; }
}
#print-root { display: none; }
