@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/golos-cyr-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/golos-lat-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/golos-cyr-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/golos-lat-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/golos-cyr-600.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/golos-lat-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Unbounded;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/unbounded-cyr-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Unbounded;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/unbounded-lat-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  /* Цех: холодный бетон, штамп-бирюза, роли — олива и медь */
  --bg: #e4e9e5;
  --bg-deep: #d5ddd7;
  --surface: #f7f9f7;
  --text: #111814;
  --text-muted: #4a554e;
  --border: #c8d2cb;
  --border-strong: #9eaba3;
  --accent: #0c6b54;
  --accent-soft: #d8efe7;
  --ok: #2f5d1a;
  --warn: #9c3d12;
  --fill: #dfe6e1;
  --danger-bg: #f6ebe6;
  --ok-bg: #e4efdc;
  --paper: var(--bg);
  --sheet: var(--surface);
  --ink: var(--text);
  --muted: var(--text-muted);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --oxide: var(--warn);
  --olive: var(--ok);
  --amber: #b45309;
  --role: var(--accent);
  --font: "Golos Text", "Liberation Sans", "Noto Sans", "Segoe UI", sans-serif;
  --display: Unbounded, "Golos Text", sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.85rem;
  --text-2xl: 2.35rem;
  --text-3xl: 3.25rem;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --radius-control: 12px;
  --radius-panel: 16px;
  --ease: 200ms cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
.role-foreman { --role: var(--ok); }
.role-master { --role: var(--warn); }
.role-inspector { --role: var(--accent); }

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 28rem),
    linear-gradient(rgba(17, 24, 20, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 20, 0.035) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, ul, ol, dl, fieldset { margin: 0; }
h1 {
  font-family: var(--display);
  font-size: clamp(1.65rem, 3.5vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.12;
  text-wrap: balance;
}
h2 {
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
h3 { font-size: var(--text-md); font-weight: 600; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted, .meta { color: var(--muted); }
.block { display: block; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-control);
}
.skip:focus { top: 0.5rem; z-index: 6; }

.top {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.35rem var(--space-4);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, white);
  backdrop-filter: blur(10px);
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.045em;
  text-decoration: none;
  flex: 0 0 auto;
}
.mark-stamp {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 6px;
  background: var(--role, var(--accent));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, white 22%, transparent);
  position: relative;
  flex: none;
}
.mark-stamp::after {
  content: "";
  position: absolute;
  inset: 28% 22% 34% 22%;
  border-top: 2px solid color-mix(in srgb, white 85%, transparent);
  border-bottom: 2px solid color-mix(in srgb, white 85%, transparent);
  box-shadow: 0 4px 0 color-mix(in srgb, white 85%, transparent);
}
.mark-word { line-height: 1; }
.who {
  margin-left: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.who > a,
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.55rem;
  text-decoration: none;
  font-weight: 500;
}
.nav-link:hover { color: var(--accent); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.9rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.nav-cta:hover { background: var(--accent); color: #fff; }
.who-role {
  margin: 0;
  min-width: 0;
  text-align: right;
  font-size: 0.8125rem;
  line-height: 1.25;
}
.role-label, .who-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 8.5rem;
}
.role-label { font-weight: 600; }
.who-name { color: var(--muted); font-weight: 400; }

.wrap {
  width: min(100% - 32px, 34rem);
  margin-inline: auto;
  padding: var(--space-6) 0 var(--space-8);
}
.wrap.board { width: min(100% - 2rem, 48rem); }
.wrap.wide { width: min(100% - 2rem, 70rem); }

.kicker {
  margin-bottom: var(--space-2);
  color: var(--role, var(--accent));
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lede { margin-top: 0.7rem; max-width: 38rem; }
.intro h1 {
  font-size: clamp(1.55rem, 4vw, 2.45rem);
  max-width: 16em;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 1.15rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.steps li {
  position: relative;
  min-width: 0;
  padding-top: var(--space-2);
  border-top: 2px solid var(--text);
}
.steps li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -0.55rem;
  top: 1.55rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.step-n, .step-note {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}
.step-name {
  display: block;
  font-weight: 600;
  margin: 0.1rem 0;
}

.catalog {
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.entry {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}
.entry-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}
.entry h2 { font-size: 1.2rem; }
.entry-price { font-weight: 600; font-size: 1.05rem; text-align: right; }
.entry-price span { font-weight: 500; font-size: 0.85rem; color: var(--muted); }
.entry-out { color: var(--muted); }
.pay-note {
  margin-top: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.demo { margin-top: 1.75rem; }
.demo h2 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.demo-pass { margin-top: 0.25rem; }
.demo-list {
  margin-top: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  overflow: hidden;
}
.demo-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
  padding: var(--space-3) var(--space-4);
  min-height: 48px;
  border-top: 1px solid var(--border);
  text-decoration: none;
}
.demo-list .demo-row:first-child { border-top: 0; }
.demo-row:hover { background: var(--fill); }
.demo-role { color: var(--muted); font-size: 0.8rem; grid-column: 1 / -1; }
.demo-name { font-weight: 600; }
.demo-phone { user-select: all; }

.btn, .text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.45rem 1.05rem;
  text-decoration: none;
  cursor: pointer;
}
.btn {
  border-radius: var(--radius-control);
  background: var(--text);
  color: #f4f7f5;
  border: 1px solid var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  font-weight: 500;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.secondary:hover {
  background: var(--fill);
  color: var(--text);
  border-color: var(--text);
}
.role-foreman .btn:not(.secondary):hover,
.home-tile-foreman .btn:not(.secondary):hover {
  background: var(--ok);
  border-color: var(--ok);
}
.role-master .btn:not(.secondary):hover,
.home-tile-master .btn:not(.secondary):hover {
  background: var(--warn);
  border-color: var(--warn);
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .text-btn, .choice, .row, .item, .rooms a, .demo-row, .home-people a,
  .home-tile, .nav-cta, input, textarea, select {
    transition:
      background-color var(--ease),
      border-color var(--ease),
      color var(--ease),
      transform var(--ease),
      box-shadow var(--ease);
  }
  .btn:hover { transform: translateY(-1px); }
  .home-tile:hover { transform: translateY(-3px); }
}
.text-btn {
  background: transparent;
  border: 0;
  padding-inline: 0.2rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  color: var(--muted);
}
.text-btn:hover { color: var(--ink); }
.text-btn.danger, .danger { color: var(--oxide); }
.btn:focus-visible, .text-btn:focus-visible, a:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.actions { display: grid; gap: 0.6rem; margin-top: 1rem; }
.stack { display: grid; gap: 0.85rem; margin-top: 1rem; }
.stack.tight { margin-top: 0.75rem; }
.field { display: grid; gap: 0.35rem; }
label, .label-like, legend { font-weight: 600; }
.hint { color: var(--muted); font-size: 0.92rem; font-weight: 400; }
.hint a { text-underline-offset: 0.15em; }
fieldset, .pick { border: 0; padding: 0; display: grid; gap: 0.4rem; }
legend { margin-bottom: 0.15rem; }
.choice {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  min-height: 48px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--sheet);
  font-weight: 400;
}
.choice input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--ink); flex: 0 0 auto; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--fill); }
.choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.choice input:focus-visible { outline: none; }
.specialty { display: none; }
form:has(input[name="role"][value="master"]:checked) .specialty { display: grid; }

input[type="text"], input[type="tel"], input[type="password"], input[type="file"],
input:not([type]), textarea, select {
  width: 100%;
  min-width: 0;
  background: var(--sheet);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-control);
  padding: 0.6rem 0.85rem;
  min-height: 48px;
  font-size: 1rem;
}
textarea { min-height: 7rem; resize: vertical; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--oxide); background: #fbf6f2; }
.field-error { color: var(--oxide); font-size: 0.92rem; font-weight: 600; }
::placeholder { color: #6d7a72; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  border-color: var(--role, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--role, var(--accent)) 22%, transparent);
}

.banner, .notice {
  padding: 0.75rem 0.95rem;
  border-left: 3px solid var(--ink);
  border-radius: var(--radius-panel);
  background: var(--sheet);
}
.banner { margin: 0 0 1rem; }
.banner.is-error { border-left-color: var(--accent); background: var(--danger-bg); }
.notice, .banner.is-ok { border-left-color: var(--ok); background: var(--ok-bg); }
.notice { margin-top: 0.8rem; }

.price {
  margin-top: var(--space-3);
  font-family: var(--display);
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
.price-unit { margin-top: 0.3rem; color: var(--muted); }

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}
.back { margin: 0 0 0.65rem; }
.back a {
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.back a:hover { color: var(--ink); text-decoration: underline; }
.next-note { margin-top: 0.7rem; font-weight: 600; }
.empty { margin-top: 0.7rem; color: var(--muted); display: grid; gap: 0.75rem; }
.empty p { margin: 0; }

.rows {
  margin-top: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  overflow: hidden;
}
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
  padding: var(--space-3) var(--space-4);
  min-height: 48px;
  border-top: 1px solid var(--border);
  text-decoration: none;
}
.rows .row:first-child { border-top: 0; }
.row:hover { background: var(--fill); }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-meta, .row-next, .row-go { overflow-wrap: anywhere; }
.row-meta, .row-next { color: var(--muted); font-size: 0.92rem; }
.row-next {
  grid-column: 1 / -1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-go { font-weight: 600; }
.row:hover .row-title, .row:hover .row-go { text-decoration: underline; text-underline-offset: 0.15em; }
.money { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.is-due { color: var(--oxide); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--muted);
}
.tag::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 3px;
  background: currentColor;
  flex: 0 0 auto;
}
.tag.lg { font-size: 1.05rem; }
.tag.lg::before { width: 0.62rem; height: 0.62rem; }
.tag-offered, .tag-accepted { color: var(--amber); }
.tag-in_progress { color: var(--olive); }
.tag-done { color: var(--ink); }
.tag-cancelled { color: var(--oxide); }

.status-line { margin-top: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.55rem 0.8rem; align-items: center; }
.facts {
  margin-top: 1rem;
  padding: 0.2rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}
.facts div { padding: 0.7rem 0; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.facts dd { margin: 0.15rem 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
a.tel { text-underline-offset: 0.15em; }

.situation {
  margin-top: 1rem;
  padding: 0.15rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}
.situation div {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}
.situation div:first-child { border-top: 0; }
.situation dt { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.situation dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.next { margin-top: 1.1rem; display: grid; gap: 0.7rem; }
.next > p { font-weight: 600; }
.sec { margin-top: var(--space-6); }
.sec > h2 { margin-bottom: var(--space-3); }
.plain {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  overflow: hidden;
}
.plain > li {
  padding: var(--space-4);
  border-top: 1px solid var(--border);
}
.plain > li:first-child { border-top: 0; }
.item {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}
.plain .item:first-child { border-top: 0; }
.item-title { font-weight: 600; overflow-wrap: anywhere; }
.item-actions { display: grid; gap: 0.45rem; }
.item-actions form { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; align-items: center; }
.item-actions select { flex: 1 1 100%; }

.adder { display: grid; gap: 0.55rem; margin-top: 0.8rem; }
.split { display: grid; gap: 0.7rem; }
.rooms {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  margin: 0.45rem 0 0.7rem;
  max-width: 100%;
}
.rooms a {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: transparent;
}
.rooms a.is-on {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--sheet);
  font-weight: 600;
}
.photos {
  list-style: none;
  padding: 0;
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--line);
  border-radius: var(--radius-panel);
}
.photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.focus {
  margin-top: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-left: 4px solid var(--role, var(--accent));
  border-radius: var(--radius-panel);
  background: var(--surface);
  display: grid;
  gap: var(--space-3);
}
.focus h2 { font-size: 1.35rem; }
.focus h2 a { text-decoration: none; }
.focus h2 a:hover { text-decoration: underline; text-underline-offset: 0.12em; }
.switch {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
}
.obj-head { display: grid; gap: 0.35rem; }
.auth { display: grid; gap: 1.4rem; margin-top: 1rem; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 700px) {
  .entry .btn,
  .stack > .btn,
  .next .btn,
  .empty .btn,
  .actions .btn,
  .focus .btn,
  .adder .btn,
  .page-head .btn,
  .switch .btn:not(.secondary) { width: 100%; }
  .photos { grid-template-columns: 1fr; }
}

@media (min-width: 800px) {
  h1 { font-size: var(--text-2xl); }
  .role-label, .who-name { max-width: 22rem; }
  .actions { display: flex; flex-wrap: wrap; }
  .actions .btn { width: auto; }
  .demo-row { grid-template-columns: 11rem minmax(0, 1fr) auto; }
  .demo-role { grid-column: auto; color: var(--ink); font-size: 1rem; font-weight: 600; }
  .situation {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    display: grid;
    padding: 0.35rem 0.25rem;
  }
  .situation div {
    display: block;
    border-top: 0;
    border-bottom: 0;
    padding: 0.85rem 1rem;
  }
  .situation div + div { border-left: 1px solid var(--line); }
  .situation dd { margin-top: 0.25rem; }
  .split { grid-template-columns: 1.4fr 0.6fr; }
  .adder.inline { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .adder.inline .btn { width: auto; }
  .item-actions select { flex: 1 1 12rem; width: auto; }
  .photos { grid-template-columns: 1fr 1fr; }
  .work {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
    column-gap: 2.75rem;
    align-items: start;
  }
  .work .photo-sec, .work .calls { grid-column: 2; }
  .work .stages { grid-column: 1; grid-row: 1; }
  .work .purchases { grid-column: 1; grid-row: 2; }
  .work .photo-sec { grid-row: 1; }
  .work .calls { grid-row: 2; }
  .work .note, .work .finish { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .catalog {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 0;
    border-bottom: 1px solid var(--border);
  }
  .entry {
    border-bottom: 0;
    padding: var(--space-2) var(--space-4) var(--space-2) 0;
  }
  .entry + .entry { padding-left: var(--space-4); border-left: 1px solid var(--border); }
  .entry .btn { width: auto; justify-self: start; }
  .auth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 2.5rem; align-items: start; }
}


.home {
  width: 100%;
  padding: 0 0 var(--space-8);
  color: var(--text);
  background: transparent;
}
.home > .banner {
  width: min(100% - 32px, 68rem);
  margin: var(--space-3) auto 0;
}
.home-hero,
.home-trust,
.home-close {
  width: min(100% - 32px, 68rem);
  margin-inline: auto;
}
.home-hero {
  display: grid;
  gap: var(--space-3);
  align-items: end;
  padding-top: clamp(1.5rem, 4vw, 3rem);
  min-height: clamp(11rem, 28vh, 16rem);
}
.home-brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(3.2rem, 12vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
  color: var(--text);
  max-width: 10ch;
}
.home-hero-copy { max-width: 36rem; }
.home-hero h1 {
  max-width: 14em;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--accent);
}
.home-lead {
  margin-top: var(--space-3);
  max-width: 34rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}
.home-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.home-price {
  margin-top: var(--space-2);
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--text-xl);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.home-price .num { white-space: nowrap; }
.home-unit {
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
}

.home-trust {
  margin-top: var(--space-7);
  padding: var(--space-5);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: var(--radius-panel);
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 55%),
    var(--surface);
}
.home-trust h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.home-trust p { margin-top: var(--space-2); color: var(--text-muted); max-width: 40rem; }

.home-close {
  margin-top: var(--space-7);
  scroll-margin-top: 4rem;
}
.home-pass { margin-top: var(--space-2); }
.home-pass strong { font-weight: 600; }
.home-people {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  overflow: hidden;
}
.home-people a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-1) var(--space-3);
  align-items: baseline;
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  text-decoration: none;
}
.home-people li:first-child a { border-top: 0; }
.home-people a:hover { background: var(--fill); }
.home-person-role {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.home-person-name { font-weight: 600; }
.home-person-phone { font-variant-numeric: tabular-nums; color: var(--text-muted); }

.home-tiles {
  display: grid;
  gap: var(--space-4);
  width: min(100% - 32px, 68rem);
  margin: var(--space-5) auto 0;
}
.home-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 5px solid var(--tile, var(--text));
  border-radius: var(--radius-panel);
  box-shadow: 0 10px 28px -18px rgba(17, 24, 20, 0.35);
}
.home-tile-foreman { --tile: var(--ok); --role: var(--ok); }
.home-tile-master { --tile: var(--warn); --role: var(--warn); }
.home-tile h2 {
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.home-tile > p { margin-top: var(--space-3); color: var(--text-muted); }
.home-tile .home-price { margin-top: var(--space-4); color: var(--text); }
.home-tile .home-actions {
  margin-top: auto;
  padding-top: var(--space-5);
  width: 100%;
}

.home-story,
.home-help {
  width: min(100% - 32px, 68rem);
  margin: var(--space-8) auto 0;
}
.home-story {
  max-width: 42rem;
  padding-top: var(--space-2);
}
.home-story h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.45rem);
  letter-spacing: -0.04em;
  line-height: 1.12;
  max-width: 14em;
}
.home-story-lead {
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 36rem;
}

.home-help-head { max-width: 36rem; margin-bottom: var(--space-5); }
.home-help-head h2 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.035em;
}
.home-help-grid {
  display: grid;
  gap: var(--space-5);
}
.home-help-block {
  position: relative;
  padding: var(--space-5) 0 var(--space-5) var(--space-5);
  border-left: 3px solid var(--help, var(--accent));
}
.home-help-foreman { --help: var(--ok); --role: var(--ok); }
.home-help-master { --help: var(--warn); --role: var(--warn); }
.home-help-block h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.home-help-block > p {
  margin-top: var(--space-3);
  color: var(--text-muted);
  max-width: 28rem;
}
.home-help-block ul {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
  display: grid;
  gap: var(--space-2);
}
.home-help-block li {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  gap: var(--space-3);
  align-items: baseline;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.home-help-block li::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.4rem;
  border-radius: 2px;
  background: var(--help, var(--accent));
}

@media (prefers-reduced-motion: no-preference) {
  .page-home .home-tile,
  .page-home .home-story,
  .page-home .home-help-block {
    animation: rise-in 700ms var(--ease) both;
  }
  .page-home .home-tile-master { animation-delay: 120ms; }
  .page-home .home-story { animation-delay: 180ms; }
  .page-home .home-help-master { animation-delay: 120ms; }
}

@media (min-width: 800px) {
  .home-help-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-7);
  }
  .home-help-block {
    padding-left: var(--space-6);
  }
}
.draw {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 6 / 5;
  min-height: 240px;
  overflow: hidden;
  background: #2f5d1a;
}
.draw img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.draw-master { background: #9c3d12; }
.draw-inspector { background: #0c6b54; }
.home-tile,
.role-choice { overflow: hidden; }
.home-tile .draw,
.role-choice .draw {
  width: calc(100% + var(--space-5) + var(--space-5));
  max-width: none;
  height: auto;
  aspect-ratio: 6 / 5;
  min-height: 240px;
  margin: calc(var(--space-5) * -1) calc(var(--space-5) * -1) var(--space-4);
}
.role-pick {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-5);
}
.role-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: var(--space-5);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 5px solid var(--tile, var(--text));
  border-radius: var(--radius-panel);
  box-shadow: 0 10px 28px -18px rgba(17, 24, 20, 0.3);
}
.role-choice-foreman { --tile: var(--ok); --role: var(--ok); }
.role-choice-master { --tile: var(--warn); --role: var(--warn); }
.role-choice-inspector { --tile: var(--accent); --role: var(--accent); }
.role-choice:hover { background: var(--surface); }
.role-choice:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.role-choice h2 {
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.role-choice p { margin-top: var(--space-3); color: var(--text-muted); }
.role-screen {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}
.role-figure .draw {
  width: min(100%, 36rem);
  max-width: none;
  height: auto;
  aspect-ratio: 6 / 5;
  min-height: 240px;
  border-radius: var(--radius-panel);
  box-shadow: 0 14px 36px -20px rgba(17, 24, 20, 0.45);
}

.page-head h1 { max-width: 18ch; }
.rows, .facts, .situation, .plain, .demo-list {
  box-shadow: 0 8px 24px -18px rgba(17, 24, 20, 0.28);
}

@media (prefers-reduced-motion: no-preference) {
  .page-home .home-brand {
    animation: brand-in 700ms var(--ease) both;
  }
  .page-home .home-hero-copy {
    animation: rise-in 650ms var(--ease) 120ms both;
  }
  .page-home .home-tile {
    animation: rise-in 700ms var(--ease) both;
  }
  .page-home .home-tile-master { animation-delay: 160ms; }
}
@keyframes brand-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 799px) {
  .home-actions .btn { width: 100%; }
  .home-brand { font-size: clamp(2.8rem, 18vw, 4.2rem); }
}

@media (min-width: 800px) {
  .home-hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--space-6);
    padding-top: var(--space-7);
    min-height: 15rem;
  }
  .home-brand { grid-column: 1 / -1; }
  .home-actions { flex-direction: row; flex-wrap: wrap; }
  .home-actions .btn { width: auto; min-width: 9.5rem; }
  .home-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: var(--space-5);
    margin-top: var(--space-6);
  }
  .role-pick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: var(--space-5);
  }
  .role-screen {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: var(--space-7);
    align-items: center;
  }
  .home-people a { grid-template-columns: 14rem minmax(0, 1fr) auto; }
  .home-person-role {
    grid-column: auto;
    font-size: var(--text-sm);
    color: var(--text);
    letter-spacing: 0;
    text-transform: none;
  }
  .switch {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.cabinet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin: var(--space-4) 0 var(--space-3);
}
.cabinet-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.15rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  border-bottom: 2px solid transparent;
}
.cabinet-nav a:hover { border-bottom-color: var(--accent); }
.master-panel { scroll-margin-top: 4.5rem; }
.master-subhead {
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.master-form {
  margin-top: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
}
.master-form h3 { margin-bottom: 0.15rem; }
.cal-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-4);
}
.cal-nav .btn { min-width: 3rem; padding-inline: 0.7rem; }
.cal-month {
  text-align: center;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.cal-grid {
  margin-top: var(--space-4);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}
.cal-grid > span:nth-child(-n+7) {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0;
}
.cal-empty { min-height: 3rem; }
.cal-day {
  display: grid;
  place-content: center;
  gap: 0.15rem;
  min-height: 3.1rem;
  padding: 0.35rem 0.2rem;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}
.cal-day:hover { background: var(--fill); }
.cal-day.is-today { border-color: var(--accent); }
.cal-day.is-on {
  background: var(--text);
  border-color: var(--text);
  color: #f4f7f5;
}
.cal-day.has-items .cal-num { font-weight: 700; }
.cal-num { font-variant-numeric: tabular-nums; line-height: 1; }
.cal-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--warn);
}
.cal-day.is-on .cal-count { color: #f6d7a8; }

/* —— Приёмка (additive) —— */
.home-tile-inspection {
  --role: var(--accent);
  --tile: var(--accent);
}
.home-help-inspection {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.section { margin-top: 2rem; }
.section > h2 {
  margin: 0 0 var(--space-3);
}
.section h2 .num { color: var(--muted); font-weight: 500; }
.aside {
  margin-top: var(--space-5);
  color: var(--muted);
  font-size: var(--text-sm);
}
.aside a { color: inherit; }
.line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
}
.line .grow { flex: 1 1 14rem; overflow-wrap: anywhere; }
.line form, .inline-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.line select, .inline-add input,
.line input, .inline-add select {
  width: auto;
  min-width: 10rem;
  flex: 1 1 10rem;
}
.inline-add { margin-top: 0.8rem; }
.row-status { text-align: right; align-self: start; }
.row-date { color: var(--muted); font-size: 0.92rem; }
.debt { margin: 0; text-align: left; }
.debt-label { display: block; color: var(--muted); font-size: 0.85rem; }
.debt-sum {
  display: block;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.progress-bar {
  margin-top: 0.45rem;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  max-width: 14rem;
}
.progress-bar > .progress-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
}
.progress-fill.pct-0 { width: 0%; }
.progress-fill.pct-5 { width: 5%; }
.progress-fill.pct-10 { width: 10%; }
.progress-fill.pct-15 { width: 15%; }
.progress-fill.pct-20 { width: 20%; }
.progress-fill.pct-25 { width: 25%; }
.progress-fill.pct-30 { width: 30%; }
.progress-fill.pct-35 { width: 35%; }
.progress-fill.pct-40 { width: 40%; }
.progress-fill.pct-45 { width: 45%; }
.progress-fill.pct-50 { width: 50%; }
.progress-fill.pct-55 { width: 55%; }
.progress-fill.pct-60 { width: 60%; }
.progress-fill.pct-65 { width: 65%; }
.progress-fill.pct-70 { width: 70%; }
.progress-fill.pct-75 { width: 75%; }
.progress-fill.pct-80 { width: 80%; }
.progress-fill.pct-85 { width: 85%; }
.progress-fill.pct-90 { width: 90%; }
.progress-fill.pct-95 { width: 95%; }
.progress-fill.pct-100 { width: 100%; }
.check-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.65rem;
  align-items: center;
}
.check-actions form { margin: 0; min-width: 0; }
.check-actions .btn {
  width: 100%;
  justify-content: center;
  font-size: 0.9rem;
  padding-inline: 0.65rem;
}
.check-actions form:last-child {
  grid-column: 1 / -1;
}
.check-actions .text-btn {
  justify-self: start;
  min-height: 40px;
}
.wrap:has(.sticky-actions) {
  padding-bottom: 7rem;
}
.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 1.75rem;
  margin-inline: -16px;
  padding: 0.85rem 16px calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 94%, white);
  backdrop-filter: blur(12px);
  box-shadow: 0 -10px 28px -18px rgba(17, 24, 20, 0.45);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
.sticky-actions.actions { margin-top: 1.75rem; }
.sticky-actions .btn {
  width: 100%;
  justify-content: center;
}
@media (min-width: 520px) {
  .sticky-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .check-actions {
    grid-template-columns: 1fr 1fr auto;
  }
  .check-actions form:last-child {
    grid-column: auto;
  }
}
.price-sheet { margin-top: var(--space-4); }
.text-btn.danger { color: var(--warn); }
.status { font-weight: 600; }

@media (min-width: 800px) {
  .home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .obj-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    align-items: flex-end;
  }
  .debt { text-align: right; }
}

@media (min-width: 800px) {
  .master-panel .split { grid-template-columns: 1fr 1fr; }
}
