/* Финмодель детейлинг-студии. Система: Текстовые доки/site-docs/DESIGN.md («Ночной бокс под лампой осмотра») */

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/onest-cyrillic.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/onest-latin-ext.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/onest-latin.woff2) format('woff2-variations');
  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: oklch(0.16 0.012 230);
  --s1: oklch(0.20 0.014 230);
  --s2: oklch(0.245 0.016 230);
  --s3: oklch(0.30 0.018 230);
  --hair: oklch(0.34 0.018 230);
  --edge: oklch(0.55 0.02 230);
  --ink: oklch(0.965 0.006 230);
  --ink-2: oklch(0.83 0.012 230);
  --muted: oklch(0.72 0.016 230);
  --cobalt: oklch(0.70 0.135 245);
  --cobalt-ink: oklch(0.79 0.10 245);
  --cobalt-wash: oklch(0.70 0.135 245 / 0.12);
  --cobalt-glint: oklch(0.86 0.09 245 / 0.34);
  --good: oklch(0.76 0.16 150);
  --bad: oklch(0.70 0.17 25);
  --warn: oklch(0.82 0.14 80);
  --warn-wash: oklch(0.82 0.14 80 / 0.10);

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --z-sticky: 10; --z-toast: 30; --z-tip: 20;
  --pad: max(var(--sp-4), env(safe-area-inset-left));
  --bar-h: 112px;

  color-scheme: dark;
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 100%;
  font-kerning: normal;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-padding-top: calc(var(--bar-h) + var(--sp-3)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: var(--r-sm); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--sp-3); top: -100px; z-index: var(--z-toast); background: var(--cobalt); color: var(--bg); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); }
.skip:focus { top: var(--sp-3); }
.num-t { font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }

/* ---------- шапка */
.bar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--s1);
  border-bottom: 1px solid var(--hair);
  padding: max(var(--sp-3), env(safe-area-inset-top)) var(--pad) var(--sp-3);
}
.bar-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 44px; max-width: 32rem; margin: 0 auto; }
.bar-title { font-size: 1rem; font-weight: 650; line-height: 1.2; letter-spacing: 0; }
.btn-reset {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 44px; padding: 0 var(--sp-3);
  border: 1px solid var(--edge); border-radius: 999px; background: var(--s2);
  font-size: 0.875rem; font-weight: 500; color: var(--cobalt-ink);
}
.btn-reset svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-reset:active { background: var(--s3); }

.seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  max-width: 32rem; margin: var(--sp-2) auto 0;
  padding: 4px; border-radius: var(--r-md); background: var(--bg);
  border: 1px solid var(--hair);
}
.seg button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 48px; padding: 4px 6px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-2);
  font-size: 0.9375rem; font-weight: 550; line-height: 1.15;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.seg button small { font-size: 0.75rem; font-weight: 450; color: var(--muted); font-variant-numeric: tabular-nums; transition: color 200ms var(--ease); }
.seg button[aria-checked='true'] { background: oklch(0.70 0.135 245 / 0.2); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--cobalt); }
.seg button[aria-checked='true'] small { color: var(--cobalt-ink); }
.seg button:active { transform: scale(0.97); }

main { max-width: 32rem; margin: 0 auto; padding: 0 var(--pad) max(var(--sp-7), env(safe-area-inset-bottom)); }

/* ---------- первый экран */
.hero { padding: var(--sp-6) 0 var(--sp-4); }
.hero-label { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: 0.875rem; font-weight: 500; color: var(--ink-2); }
.hero-fig {
  margin-top: var(--sp-2);
  font-size: 3rem; font-weight: 750; line-height: 1.02; letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero-fig .u { font-size: 0.55em; font-weight: 550; letter-spacing: -0.01em; color: var(--ink-2); }
.hero-sub { margin-top: var(--sp-3); color: var(--ink-2); font-size: 0.9375rem; line-height: 1.5; text-wrap: pretty; }
.hero-sub b { color: var(--ink); font-weight: 600; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px 2px 7px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; line-height: 1.5; letter-spacing: 0.02em; white-space: nowrap;
  background: var(--s2); color: var(--ink);
  border: 1px solid var(--hair);
}
.chip:empty { display: none; }
.chip i { font-style: normal; font-size: 0.7rem; }
.chip.good i { color: var(--good); }
.chip.bad i { color: var(--bad); }
.chip.warn i { color: var(--warn); }

/* ---------- график */
.chart { padding: var(--sp-2) 0 var(--sp-4); }
.chart-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.chart-note { margin-top: 2px; font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.chart-box { position: relative; margin-top: var(--sp-3); }
#chart { display: block; width: 100%; height: 210px; touch-action: pan-y; user-select: none; -webkit-user-select: none; overflow: visible; }
#chart .grid { stroke: var(--hair); stroke-width: 1; }
#chart .zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
#chart .yr { stroke: var(--hair); stroke-width: 1; }
#chart .ax { fill: var(--muted); font-size: 11px; }
#chart .area { fill: var(--cobalt-wash); }
#chart .line { fill: none; stroke: var(--cobalt); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
#chart .pb-dot { fill: var(--good); stroke: var(--bg); stroke-width: 2; }
#chart .pb-lab { fill: var(--ink); font-size: 11.5px; font-weight: 600; }
#chart .end-dot { fill: var(--cobalt); stroke: var(--bg); stroke-width: 2; }
#chart .end-lab { fill: var(--ink); font-size: 11.5px; font-weight: 600; }
#chart .cross { stroke: var(--ink-2); stroke-width: 1; }
#chart .cross-dot { fill: var(--ink); stroke: var(--cobalt); stroke-width: 2; }
.tip {
  position: absolute; top: 0; z-index: var(--z-tip); pointer-events: none;
  min-width: 9.5rem; padding: var(--sp-2) var(--sp-3);
  background: var(--s3); border: 1px solid var(--edge); border-radius: var(--r-sm);
  font-size: 0.8125rem; line-height: 1.4; font-variant-numeric: tabular-nums;
}
.tip b { display: block; font-size: 0.9375rem; font-weight: 650; }
.tip span { color: var(--ink-2); }

/* ---------- панель показаний: одна панель с волосяными разделителями, не сетка карточек */
.dash {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--hair); border-radius: var(--r-lg);
  background: var(--s1); overflow: hidden;
}
.rd { padding: var(--sp-3) var(--sp-4) var(--sp-4); min-width: 0; }
.rd:nth-child(odd) { border-right: 1px solid var(--hair); }
.rd:nth-child(n + 3) { border-top: 1px solid var(--hair); }
.rd-l { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); line-height: 1.3; }
.rd-v { display: block; margin-top: 6px; font-size: 1.375rem; font-weight: 650; line-height: 1.15; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.rd-s { margin-top: 4px; font-size: 0.8125rem; color: var(--muted); line-height: 1.35; }
.rd-s .chip { margin-top: 6px; }

.banner {
  display: grid; gap: var(--sp-3);
  margin-top: var(--sp-3); padding: var(--sp-4);
  border: 1px solid oklch(0.82 0.14 80 / 0.45); border-radius: var(--r-lg);
  background: var(--warn-wash);
}
.banner p { font-size: 0.9375rem; line-height: 1.5; }
.banner b { font-weight: 650; }
.banner .ic { color: var(--warn); font-weight: 700; margin-right: 4px; }
.btn-solid { min-height: 48px; border: 1px solid var(--edge); border-radius: var(--r-md); background: var(--s2); color: var(--ink); font-size: 0.9375rem; font-weight: 600; }
.btn-solid:active { background: var(--s3); }

.tools-note { margin: var(--sp-7) 0 var(--sp-5); font-size: 0.8125rem; color: var(--muted); line-height: 1.45; text-wrap: pretty; }
.group-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.group-row .group-t { margin: 0; }
.btn-text { flex: none; min-height: 44px; padding: 0 var(--sp-1); border: 0; background: none; color: var(--cobalt-ink); font-size: 0.9375rem; font-weight: 550; }

/* ---------- группы разделов и свёртки */
.group-t { margin: var(--sp-6) 0 var(--sp-2); font-size: 0.875rem; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.group-t:first-child { margin-top: 0; }
.sec { border-top: 1px solid var(--hair); }
.sec:last-child { border-bottom: 1px solid var(--hair); }
.sec-h { font-size: inherit; font-weight: inherit; }
.sec-btn {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 60px; padding: var(--sp-3) 0;
  border: 0; background: none; text-align: left;
}
.sec-t { display: flex; align-items: center; gap: var(--sp-2); font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
.sec-s { max-width: 9.5rem; font-size: 0.875rem; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; line-height: 1.3; text-wrap: balance; }
.badge { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cobalt); }
.badge[hidden] { display: none; }
.chev { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 280ms var(--ease); }
[aria-expanded='true'] > .chev { transform: rotate(180deg); }
.sec-btn:active .sec-t { color: var(--cobalt-ink); }
.panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 300ms var(--ease); }
.panel.open { grid-template-rows: 1fr; }
.panel-in { min-height: 0; overflow: hidden; }
/* колонка minmax(0, 1fr): содержимое не раздвигает панель шире экрана (иначе overflow: hidden молча обрезает правый край) */
.panel-body { padding: var(--sp-1) 0 var(--sp-5); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }

.hint { font-size: 0.875rem; color: var(--ink-2); line-height: 1.5; text-wrap: pretty; }
.hint b { color: var(--ink); font-weight: 600; }

/* подсказка: вводная фраза + пояснения терминов списком */
.notes { display: grid; gap: var(--sp-2); }
.hint-list { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--ink-2); line-height: 1.5; text-wrap: pretty; }
.hint-list li { position: relative; padding-left: var(--sp-4); }
.hint-list li::before { content: ''; position: absolute; left: 3px; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--muted); }
.hint-list b { color: var(--ink); font-weight: 600; }

/* ---------- номер позиции: «блок.позиция» внутри раздела. Нейтральный, не кобальт: кобальт только у действий */
.no {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 1.875rem; height: 1.25rem; padding: 0 4px;
  border: 1px solid var(--hair); border-radius: 6px; background: var(--s2);
  font-size: 0.75rem; font-weight: 600; line-height: 1; letter-spacing: 0.02em;
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}
/* номер блока (и группы услуг): крупнее и светлее, чтобы читался как «глава» для позиций */
.no-blk { min-width: 1.625rem; height: 1.625rem; padding: 0 6px; border-radius: 7px; background: var(--s3); font-size: 0.8125rem; font-weight: 650; color: var(--ink); }

/* ---------- смысловой блок внутри раздела: номер, название, волосяная линия до края */
.blk { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.panel-body > .blk:not(:first-child) { margin-top: var(--sp-3); }
.blk-h { display: flex; align-items: center; gap: var(--sp-2); min-height: 1.75rem; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.blk-h::after { content: ''; order: 1; flex: 1 1 var(--sp-4); height: 1px; background: var(--hair); }
.blk-t { min-width: 0; }
.blk-tag { order: 2; flex: none; font-size: 0.75rem; font-weight: 500; color: var(--muted); }

/* ---------- поля ввода */
.fields { display: grid; gap: var(--sp-3) var(--sp-3); }
.fields.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fld { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; min-width: 0; }
/* подпись: номер, текст, точка «изменено»; номер и точка по первой строке, если подпись в две строки */
.fld > label { display: flex; align-items: flex-start; gap: 6px; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); line-height: 1.3; }
.fld > label .no { margin-top: -1px; }
/* у пронумерованного поля точка «изменено» садится на угол номера и не отнимает ширину у подписи */
.fld > label:not(.sr) { position: relative; }
.fld > label > .no ~ .dot { position: absolute; left: calc(1.875rem - 5px); top: -4px; margin: 0; box-shadow: 0 0 0 2px var(--bg); }
/* длинное слово рвётся только если иначе не влезает в узкую колонку (360 px) */
.fld > label .lbl-t { min-width: 0; overflow-wrap: anywhere; }
.fld > label .dot { width: 7px; height: 7px; margin-top: 5.5px; border-radius: 50%; background: var(--cobalt); flex: none; transform: scale(0); transition: transform 200ms var(--ease); }
/* соседи в паре колонок выровнены по строкам: подпись к подписи, поле к полю, даже если подпись слева в две строки */
@supports (grid-template-rows: subgrid) {
  .fields.two > .fld { grid-row: span 3; grid-template-rows: subgrid; row-gap: 6px; }
  .fields.two > .fld > label { align-self: end; }
}
.fld.changed > label .dot { transform: scale(1); }
.fld .fhint { font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.ctl { display: flex; align-items: stretch; min-width: 0; height: 46px; border: 1px solid var(--edge); border-radius: var(--r-md); background: var(--s2); transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.ctl:focus-within { border-color: var(--cobalt); box-shadow: 0 0 0 1px var(--cobalt); }
.ctl.bad { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.ctl input {
  /* основа 0 и ширина 0: у поля нет собственной ширины (~20 знаков), и узкая колонка не раздвигает карточку */
  flex: 1 1 0; min-width: 0; width: 0; padding: 0 var(--sp-3);
  border: 0; background: none; outline: none;
  font-size: 1rem; font-weight: 550; text-align: right; font-variant-numeric: tabular-nums;
  scroll-margin-top: calc(var(--bar-h) + var(--sp-5));
}
.ctl .unit { display: flex; align-items: center; padding-right: var(--sp-3); font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
.step { flex: none; width: 44px; border: 0; background: none; color: var(--cobalt-ink); font-size: 1.375rem; font-weight: 500; line-height: 1; }
.step:first-child { border-right: 1px solid var(--hair); }
.step:last-child { border-left: 1px solid var(--hair); }
.step:active { background: var(--s3); }
.step:disabled { color: var(--hair); cursor: default; }
.stepper input { text-align: center; }

.name {
  flex: 1 1 0; min-width: 0; width: 0; min-height: 40px; padding: 8px var(--sp-2); resize: none; overflow: hidden; display: block;
  margin-left: calc(-1 * var(--sp-2));
  border: 1px solid transparent; border-radius: var(--r-sm); background: none;
  font-size: 1rem; font-weight: 600; line-height: 1.35;
  scroll-margin-top: calc(var(--bar-h) + var(--sp-5));
}
.name:hover { border-color: var(--hair); }
.name:focus { border-color: var(--cobalt); outline: none; background: var(--s2); }

/* ---------- строки, которые можно удалить (услуга, бокс, статья) */
.rows { display: grid; gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
.row {
  display: grid; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border: 1px solid var(--hair); border-radius: var(--r-lg); background: var(--s1);
}
.row.is-new { border-color: oklch(0.70 0.135 245 / 0.55); }
.row-h { display: flex; align-items: flex-start; gap: var(--sp-2); }
/* номер карточки по центру первой строки названия (поле названия: отступ 8px, строка 21.6px) */
.row-h > .no { margin-top: 9px; }
.row-h > .no + .name { margin-left: calc(-1 * var(--sp-1)); }
.del {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -2px calc(-1 * var(--sp-3)) 0 0;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--muted);
}
.del svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.del:active { background: var(--s3); color: var(--bad); }
/* посчитанное в карточке: под линией, отдельно от полей ввода */
.row-calc { display: grid; gap: 6px; margin: 0; padding-top: var(--sp-3); border-top: 1px solid var(--hair); }
.row-calc > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 var(--sp-3); }
.row-calc dt { font-size: 0.875rem; color: var(--ink-2); line-height: 1.4; }
.row-calc dd { margin: 0 0 0 auto; font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.add {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; border: 1px dashed var(--edge); border-radius: var(--r-lg);
  background: none; color: var(--cobalt-ink); font-size: 0.9375rem; font-weight: 550;
}
.add:active { background: var(--s2); }

/* группа услуг внутри раздела */
.grps { display: grid; gap: var(--sp-3); }
.grp { border: 1px solid var(--hair); border-radius: var(--r-lg); background: oklch(0.18 0.013 230); }
.grp-btn { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: var(--sp-2) var(--sp-4); border: 0; background: none; text-align: left; }
.grp-t { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; font-size: 1rem; font-weight: 600; }
.grp-s { font-size: 0.8125rem; color: var(--ink-2); text-align: right; line-height: 1.35; font-variant-numeric: tabular-nums; }
.grp .panel-body { padding: 0 var(--sp-3) var(--sp-3); gap: var(--sp-3); }
.grp .row { background: var(--s1); }

/* таблица расчёта (только чтение): номер, подпись, цифра; подстроки под своей строкой; итог на подложке */
.sum { display: grid; margin: 0; border: 1px solid var(--hair); border-radius: var(--r-lg); overflow: hidden; }
.sum-r { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px var(--sp-3); padding: var(--sp-3) var(--sp-4); }
.sum-r + .sum-r { border-top: 1px solid var(--hair); }
.sum-r dt { flex: 1 1 10rem; display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; font-size: 0.875rem; color: var(--ink-2); line-height: 1.35; }
.sum-r dd { margin: 0 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
/* подстрока («то же, когда платим НДС») - продолжение строки над ней: без линии, с отступом под текст подписи */
.sum-r.has-sub { padding-bottom: var(--sp-1); }
.sum-r.sub { border-top: 0; padding-top: 0; }
.sum-r.sub dt { padding-left: calc(1.875rem + var(--sp-2)); font-size: 0.8125rem; color: var(--muted); }
.sum-r.sub dd { font-size: 0.875rem; font-weight: 550; color: var(--ink-2); }
.sum-r.key dt { color: var(--ink); font-weight: 600; }
.sum-r.key dd { font-size: 1.0625rem; font-weight: 700; }
.sum-r.total { background: var(--s1); }
.sum-r.total dt { color: var(--ink); font-weight: 600; }
.sum-r.total dd { font-size: 1.0625rem; font-weight: 700; }

/* полоса «спрос против часов мастеров» */
.meter { display: grid; gap: 6px; }
.meter-track { position: relative; height: 10px; margin-right: 2px; border-radius: 999px; background: var(--s3); }
.meter-fill { position: absolute; inset: 0; border-radius: 999px; background: oklch(0.62 0.02 230); transform-origin: 0 50%; transform: scaleX(0); transition: transform 300ms var(--ease); }
.meter-fill.over { background: var(--warn); }
.meter-cap { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); transition: left 300ms var(--ease); }
.meter-l { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* сколько мастеров нужно */
.chips-wrap { display: grid; gap: var(--sp-2); }
.chips-l { font-size: 0.875rem; font-weight: 500; color: var(--ink-2); line-height: 1.3; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 44px; min-width: 52px; padding: 0 var(--sp-3); border: 1px solid var(--edge); border-radius: 999px; background: var(--s2); font-size: 0.875rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.chips button[aria-pressed='true'] { background: oklch(0.70 0.135 245 / 0.2); border-color: var(--cobalt); box-shadow: inset 0 0 0 0.5px var(--cobalt); color: var(--ink); }
.sens { display: grid; gap: 2px; }
.sens-r { display: grid; grid-template-columns: 5.5rem 1fr; gap: 4px var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-3); border-radius: var(--r-md); }
.sens-r.cur { background: var(--s1); box-shadow: inset 0 0 0 1px var(--hair); }
.sens-n { font-size: 0.9375rem; font-weight: 600; line-height: 1.2; }
.sens-n small { display: block; font-size: 0.75rem; font-weight: 450; color: var(--muted); }
.sens-bar { position: relative; height: 22px; }
.sens-bar::before { content: ''; position: absolute; top: -4px; bottom: -4px; left: var(--zero, 0%); width: 1px; background: var(--muted); }
.sens-fill { position: absolute; top: 4px; height: 14px; left: 0; width: 100%; border-radius: 3px; background: oklch(0.58 0.02 230); transform-origin: 0 50%; transition: transform 300ms var(--ease); }
.sens-fill.neg { background: var(--bad); }
.sens-r.cur .sens-fill:not(.neg) { background: var(--cobalt); }
.sens-p { flex-basis: 100%; }
.sens-d { grid-column: 2; display: flex; flex-wrap: wrap; gap: 2px var(--sp-3); font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sens-d b { color: var(--ink); font-weight: 600; }
.sens-d .w { color: var(--warn); }

/* по месяцам */
.mon { display: grid; }
.mon-r { display: grid; grid-template-columns: 3.25rem 1fr auto; gap: 2px var(--sp-3); padding: 10px 0; border-top: 1px solid var(--hair); font-variant-numeric: tabular-nums; }
.mon-r:first-child { border-top: 0; }
.mon-m { font-size: 0.875rem; font-weight: 600; }
.mon-m small { display: block; font-size: 0.75rem; font-weight: 450; color: var(--muted); }
.mon-mid { font-size: 0.8125rem; color: var(--ink-2); line-height: 1.45; }
.mon-end { text-align: right; font-size: 0.875rem; font-weight: 600; line-height: 1.45; }
.mon-end small { display: block; font-size: 0.75rem; font-weight: 450; color: var(--muted); }
.vat { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: var(--s3); color: var(--warn); font-size: 0.6875rem; font-weight: 700; vertical-align: 1px; }

.foot { margin-top: var(--sp-7); font-size: 0.8125rem; color: var(--muted); }
.nojs { padding: var(--sp-5); }

/* ---------- блик пересчёта: полоса света проходит по изменившейся цифре */
.glint {
  background-image: linear-gradient(100deg, transparent 0%, transparent 35%, var(--cobalt-glint) 50%, transparent 65%, transparent 100%);
  background-size: 260% 100%;
  background-repeat: no-repeat;
  border-radius: 4px;
  animation: glint 560ms var(--ease) both;
}
@keyframes glint { from { background-position: 120% 0; } to { background-position: -40% 0; } }

/* ---------- всплывающее сообщение с отменой */
.toast {
  position: fixed; left: 50%; bottom: max(var(--sp-4), env(safe-area-inset-bottom)); z-index: var(--z-toast);
  display: flex; align-items: center; gap: var(--sp-3);
  width: min(30rem, calc(100% - 2 * var(--sp-4))); transform: translateX(-50%);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  border: 1px solid var(--edge); border-radius: var(--r-lg); background: var(--s3);
  font-size: 0.9375rem; line-height: 1.35;
  animation: toast-in 240ms var(--ease-expo) both;
}
.toast span { flex: 1; min-width: 0; }
.toast button { flex: none; min-height: 44px; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-md); background: var(--cobalt); color: var(--bg); font-weight: 650; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (hover: hover) {
  .sec-btn:hover .sec-t, .grp-btn:hover .grp-t { color: var(--cobalt-ink); }
  .seg button:hover:not([aria-checked='true']) { background: var(--s2); color: var(--ink); }
  .add:hover { border-color: var(--cobalt); }
  .del:hover { color: var(--bad); }
}

@media (max-width: 380px) {
  .btn-reset .lbl { display: none; }
  .btn-reset { width: 44px; padding: 0; justify-content: center; }
}

@media (max-width: 359px) {
  .fields.two { grid-template-columns: 1fr; }
  .hero-fig { font-size: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
