/* Розрахунок плитки — спільні стилі для всіх сторінок. Мобільна версія за замовчуванням. */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1f23;
  --muted: #5b636d;
  --line: #dfe2e6;
  --accent: #0f766e;
  --accent-strong: #0b5c56;
  --accent-soft: #e3f3f1;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn-soft: #fff5d6;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 2px 8px rgb(0 0 0 / 0.04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1d2125;
    --text: #e8eaed;
    --muted: #a3abb4;
    --line: #343a40;
    --accent: #3fb8ac;
    --accent-strong: #67cfc4;
    --accent-soft: #17312f;
    --danger: #ff8a80;
    --danger-soft: #3a1e1c;
    --warn-soft: #3a3320;
    --shadow: none;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
}

[hidden] { display: none !important; }

a { color: var(--link, var(--accent)); }
a:hover, a:focus-visible, a:visited { color: var(--link-hover, var(--accent-strong)); }

.container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px;
}
.page-layout{display:block}.toc{margin:16px 0;padding:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius)}.toc h2{font-size:17px;margin:0 0 8px}.toc ul{padding:0;margin:0;list-style:none}.toc-page-row{display:grid;grid-template-columns:1fr 44px;align-items:center}.toc-page-row>a{min-height:44px;display:flex;align-items:center;font-weight:700;text-decoration:none}.toc-toggle{min-height:44px;border:0;background:transparent;color:var(--accent);font-size:20px;cursor:pointer}.toc-sub{padding:0 0 8px 16px!important}.toc-sub a{display:inline-block;margin:3px 3px 3px 0;padding:5px 8px;border:1px solid var(--line);border-radius:999px;background:var(--bg);font-size:13px;line-height:1.3}.toc-sub a:hover,.toc-sub a:focus-visible{border-color:var(--accent);background:var(--accent-soft);outline:2px solid var(--accent)}.toc-js .toc-sub{max-height:0;opacity:0;overflow:hidden;padding-top:0!important;padding-bottom:0!important}.toc-js .toc-group.is-open .toc-sub{max-height:1000px;opacity:1;padding-bottom:8px!important}.toc-group.is-open .toc-toggle{transform:rotate(180deg)}@media(prefers-reduced-motion:no-preference){.toc-sub,.toc-toggle{transition:max-height .8s ease,opacity .45s ease,padding .8s ease,transform .8s ease}}@media(prefers-reduced-motion:reduce){.toc-sub,.toc-toggle{transition:none!important}}@media(min-width:1000px){.page-layout{position:relative;padding-left:312px}.toc{position:absolute;z-index:1;top:16px;left:0;width:280px;max-height:calc(100vh - 32px);margin:0;overflow-y:auto}.content{max-width:80ch}}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 16px;
  top: 8px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}

/* Шапка і підвал */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  min-width: 0;
  white-space: nowrap;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background:
    linear-gradient(var(--surface), var(--surface)) center / 2px 100% no-repeat,
    linear-gradient(var(--surface), var(--surface)) center / 100% 2px no-repeat,
    var(--accent);
}
.site-nav {
  display: flex;
  flex-wrap: nowrap;
  justify-self: center;
  min-width: 0;
  max-width: 100%;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  white-space: nowrap;
}
.site-nav a {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  white-space: nowrap;
}
.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.site-footer {
  margin-top: 48px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }

/* Типографіка */
h1 {
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.2;
  margin: 24px 0 8px;
}
h2 { font-size: 22px; line-height: 1.3; margin: 32px 0 12px; }
h3 { font-size: 18px; margin: 20px 0 8px; }
.lead { font-size: 17px; color: var(--muted); margin: 0 0 20px; }
.intro-banner{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:12px 0 16px;padding:12px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--accent-soft);color:var(--accent-strong)}.intro-banner p{margin:0}.eyebrow{font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.intro-note{font-size:16px;color:var(--text)}.intro-banner svg{width:132px;max-width:34%;height:auto;flex:none}.page-nav{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 20px}.page-nav a{display:inline-flex;align-items:center;min-height:38px;padding:7px 12px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--text);font-weight:650;text-decoration:none}.page-nav a:hover,.page-nav a:focus-visible,.page-nav a[aria-current="page"]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent-strong)}.page-nav a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.breadcrumbs { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.breadcrumbs a { color: inherit; }
.calculator-grid { display: grid; gap: 12px; margin: 20px 0 28px; }
.calculator-link { display: block; color: var(--text); text-decoration: none; }
.calculator-link:hover { border-color: var(--accent); }
.calculator-link h2 { margin: 0 0 6px; font-size: 18px; color: var(--accent); }
.calculator-link p { margin: 0; color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 12px; }
.source { color: var(--muted); font-size: 14px; }

/* Форма */
.calc fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.calc legend { font-weight: 700; margin-bottom: 8px; padding: 0; }

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
}
.segmented label { position: relative; cursor: pointer; }
.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.segmented span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 6px;
  border-radius: 9px;
  text-align: center;
  font-weight: 600;
  line-height: 1.25;
}
.segmented small { font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
.segmented input:checked + span {
  background: var(--accent);
  color: var(--accent-ink, #fff);
}
.segmented input:checked + span small { color: var(--accent-ink, #fff); }
.segmented input:focus-visible + span { outline: 3px solid var(--accent-strong); outline-offset: 1px; }
.segmented-lg span { min-height: 64px; font-size: 16px; }

@media (max-width: 420px) {
  .segmented-lg { grid-auto-flow: row; }
  .segmented-lg span { flex-direction: row; justify-content: flex-start; gap: 8px; min-height: 52px; padding: 8px 14px; }
  .segmented-lg small { margin: 0; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 16px;
}
.card-title { font-size: 18px; margin: 0 0 12px; }
.card-subtitle { font-size: 15px; margin: 18px 0 4px; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; }
.field-narrow { max-width: 260px; }

input[type="text"],
select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-size: 16px; /* без автоматичного збільшення на iOS */
  color: var(--text);
  background: var(--field, var(--bg));
  border: 1px solid var(--line);
  border-radius: 8px;
}
input[type="text"]:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.field-error, .group-error { color: var(--danger); font-size: 13px; }
.group-error { margin: 8px 0 0; font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; align-items: end; }
.row .field label { font-size: 13px; line-height: 1.3; }

.check { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* Списки ділянок */
.row-list .rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.row {
  display: grid;
  grid-template-columns: 24px repeat(var(--cols, 2), minmax(0, 1fr)) 40px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
.row-num {
  align-self: center;
  justify-self: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.row-remove {
  width: 40px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}
.row-remove:hover { color: var(--danger); border-color: var(--danger); }
.row-remove[hidden] { display: block !important; visibility: hidden; }

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink, #fff); font-size: 17px; }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink, #fff); }
.btn-secondary { background: var(--accent-soft); color: var(--accent-strong); margin-top: 12px; }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.7; cursor: default; }
.form-actions { margin: 8px 0 24px; }
.form-error { color: var(--danger); font-weight: 600; margin: 0 0 8px; }

/* Результат */
.results {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
  scroll-margin-top: 12px;
}
.results:focus { outline: none; }
.results > h2 { margin-top: 0; }
.stale-note { display: none; }
.results.is-stale { border-color: var(--line); }
.results.is-stale .stale-note {
  display: block;
  background: var(--warn-soft);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
}
.results.is-stale .result-card { opacity: 0.55; }

.result-card { padding: 4px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.result-card:last-of-type { border-bottom: 0; }
.result-card h3 { margin-top: 4px; }
.result-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}
.result-main div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.result-main dt { font-size: 13px; color: var(--muted); }
.result-main dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-note { margin: 10px 0 0; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.steps { margin-top: 10px; }
.steps summary, .faq summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 32px; }
.steps ol { margin: 8px 0 0; padding-left: 22px; font-size: 15px; font-variant-numeric: tabular-nums; }
.steps li { margin-bottom: 4px; }

.warning {
  background: var(--warn-soft);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
.notice {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
}

/* Текстова частина */
.content { margin-top: 8px; }
.content ul, .content ol { padding-left: 22px; }
.content li { margin-bottom: 8px; }
.formula li { margin-bottom: 6px; }
.example {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 4px 16px 8px;
  margin: 16px 0;
}
.formula-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 17px;
  overflow-x: auto;
}

.table-wrap { overflow-x: auto; margin: 8px 0; }
table { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 15px; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
th { background: var(--bg); }
.table-compact td:not(:first-child), .table-compact th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

.faq { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq p { margin: 8px 0 0; }

.figure { margin: 16px 0; }
.figure svg { width: 100%; height: auto; max-width: 560px; display: block; }
.figure figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }

.measure-list li { margin-bottom: 10px; }

/* Схема фартуха */
.svg-line { stroke: var(--muted); stroke-width: 2; }
.svg-cabinet { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.svg-top { fill: var(--muted); }
.svg-apron { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 4; }
.svg-dim { stroke: var(--text); stroke-width: 1.5; }
.svg-accent { stroke: var(--accent); stroke-width: 3; }
.svg-guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.svg-label { fill: var(--text); font: 15px var(--font); }
.svg-strong { font-weight: 700; fill: var(--accent-strong); }

.computed {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0;
}

@media (min-width: 640px) {
  .card { padding: 20px 24px; }
  .results { padding: 20px 24px; }
  .result-main { grid-template-columns: repeat(4, 1fr); }
  .btn-block { width: auto; min-width: 240px; }
}

/* Final layout corrections: tags are links, lower sections use full main column. */
.toc-sub a,.toc-sub a:hover,.toc-sub a:visited { text-decoration:none; }
.content,.example { max-width:none; }
@media (min-width:1000px) { .page-content > .content { max-width:none; } }
.toc-ready .toc-sub { max-height:0; opacity:0; overflow:hidden; padding-top:0!important; padding-bottom:0!important; }
.toc-ready .toc-group.is-open .toc-sub { max-height:1000px; opacity:1; padding-bottom:8px!important; }
.toc-ready .toc-sub[hidden] { display:none; }
.toc-ready .toc-group.is-open .toc-toggle { transform:rotate(180deg); }
@media (prefers-reduced-motion:no-preference) { .toc-ready .toc-sub,.toc-ready .toc-toggle { transition:max-height .8s ease,opacity .35s ease,padding .8s ease,transform .8s ease; } }

/* Theme tokens are explicit: the site always starts dark until a visitor chooses otherwise. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14171a;
  --surface: #1d2125;
  --text: #e8eaed;
  --muted: #aeb7c0;
  --line: #3a4149;
  --accent: #4ac0b5;
  --accent-strong: #7cddd3;
  --accent-soft: #173431;
  --field: var(--bg);
  --accent-ink: #fff;
  --link: var(--accent);
  --link-hover: var(--accent-strong);
  --danger: #ff938a;
  --danger-soft: #40201e;
  --warn-soft: #40381f;
  --shadow: none;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffc08a;
  --surface: #ffe2ca;
  --text: #3e2415;
  --muted: #5d3824;
  --line: #d47a42;
  --accent: #ff6d01;
  --accent-strong: #c95100;
  --accent-soft: #ffc28d;
  --field: #ffd1aa;
  --accent-ink: #3a1d0b;
  --link: #55301d;
  --link-hover: #3e2415;
  --danger: #9d231b;
  --danger-soft: #fde8e2;
  --warn-soft: #fff0cf;
  --shadow: 0 2px 12px rgb(91 43 20 / 0.10);
}
.header-actions { display:flex; justify-self:end; align-items:center; gap:8px; white-space:nowrap; }
.language-switch { display:flex; gap:2px; padding:3px; border:1px solid var(--line); border-radius:999px; }
.language-switch a { color:var(--text); padding:3px 8px; border-radius:999px; font-size:13px; font-weight:700; text-decoration:none; }
.language-switch a[aria-current="page"] { background:var(--accent); color:var(--accent-ink, #fff); }
.toc-page-row > a,
.toc-sub a,
.toc-sub a:hover,
.toc-sub a:focus-visible,
.toc-sub a:visited { color:var(--text); }
.steps summary,
.faq summary { color:var(--link, var(--accent)); }
.theme-toggle { width:42px; min-height:38px; padding:0; font-size:20px; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--text); cursor:pointer; }
.theme-toggle:hover, .theme-toggle:focus-visible { border-color:var(--accent); outline:2px solid var(--accent); outline-offset:2px; }
.toc-ready .toc-sub { height:0; max-height:none; opacity:1; overflow:hidden; transition:height .56s ease,padding .56s ease; }
.toc-ready .toc-group.is-open .toc-sub, .toc-ready .toc-group.is-closing .toc-sub { padding-bottom:8px!important; }
.toc-ready .toc-group.is-open .toc-sub { height:auto; }
.toc-ready .toc-group.is-open .toc-toggle { transform:rotate(180deg); }
.toc-ready .toc-toggle { transition:transform .56s ease; }
.faq summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:3px; }
.faq > :not(summary) { overflow:hidden; }
.table-wrap table { width:auto; max-width:100%; }
.table-wrap th, .table-wrap td { white-space:nowrap; padding:6px 9px; }
.table-wrap td:not(:first-child), .table-wrap th:not(:first-child) { text-align:right; font-variant-numeric:tabular-nums; }
@media (prefers-reduced-motion:reduce) { .toc-ready .toc-sub, .toc-ready .toc-toggle, .faq > :not(summary) { transition:none!important; } }
@media (max-width: 767px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "nav nav";
    align-items: center;
  }
  .brand { grid-area: brand; }
  .site-nav {
    grid-area: nav;
    justify-self: stretch;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .header-actions { grid-area: actions; }
  .table-wrap { max-width:100%; }
}

/* ---------- Калькулятор і схема поруч (десктоп), схема перед формою (телефон) ---------- */
:root, :root[data-theme="dark"] { --cut: #e7a53c; }
:root[data-theme="light"] { --cut: #9a3f00; }
.calc-layout { display: block; }
@media (min-width: 1180px) {
  .calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 400px); column-gap: 24px; align-items: start; }
  .calc-layout > * { grid-column: 1; min-width: 0; }
  .calc-layout > .scheme { grid-column: 2; grid-row: 1 / span 40; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; overscroll-behavior: contain; }
}

/* ---------- Схеми ---------- */
.scheme { margin: 0 0 16px; padding: 12px 14px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.scheme-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-bottom: 10px; }
.scheme-title { font-size: 15px; font-weight: 700; }
.scheme-badge { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.5; }
.scheme-badge.is-geometry { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.scheme-body { display: grid; gap: 12px; min-width: 0; }
.scheme-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; min-width: 0; }
.scheme svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.scheme-sample, .scheme-surface, .scheme-concept, .scheme-panel { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 0; }
.scheme-sample-title, .scheme-surface-head, .scheme-panel-title { margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.scheme-surfaces { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); min-width: 0; }
.scheme-surfaces.is-single { grid-template-columns: minmax(0, 1fr); }
.scheme-surface-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; }
.scheme-surface-meta { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.scheme-surface-bg { fill: var(--surface); }
.scheme-tile { fill: var(--field, var(--accent-soft)); }
.scheme-tile-edge { fill: none; stroke: var(--accent); stroke-width: 1; }
.scheme-surface-outline { fill: none; stroke: var(--accent); stroke-width: 2; }
.scheme-cut rect { fill: var(--cut); fill-opacity: .42; }
.scheme-dense { fill: var(--accent-soft); }
.scheme-dim { stroke: var(--muted); stroke-width: 1.2; }
.scheme-measure { fill: var(--text); font: 600 13px var(--font); font-variant-numeric: tabular-nums; }
.scheme-sample-tile { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.scheme-sample-tile.is-empty { fill: none; stroke-dasharray: 5 4; }
.scheme-decor-cabinet { fill: var(--surface); stroke: var(--muted); stroke-width: 1.2; }
.scheme-decor-top { fill: var(--muted); }
.scheme-deductions { display: flex; flex-wrap: wrap; gap: 8px; }
.scheme-deduction { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 10px 6px 6px; border: 1px dashed var(--muted); border-radius: 10px; background: var(--bg); }
.scheme-deduction svg { flex: none; }
.scheme-deduction-shape { fill: var(--surface); stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 3 2; }
.scheme-deduction-text { display: grid; font-size: 13px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.scheme-deduction-title { font-weight: 700; }
.scheme-deduction-meta { color: var(--muted); }
.scheme-deduction-area { color: var(--accent-strong); font-weight: 800; }
.scheme-facts { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.scheme-facts p { margin: 0; font-size: 14px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.scheme-facts .scheme-total { font-size: 15px; font-weight: 800; }
.scheme-facts-line { margin: 4px 0 0; font-size: 13px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.scheme-facts-line b { font-size: 14px; }
.scheme-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.scheme-legend li::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -2px; border: 1px solid var(--accent); border-radius: 2px; background: var(--field, var(--accent-soft)); }
.scheme-legend li.is-cut::before { background: color-mix(in srgb, var(--cut) 45%, var(--field, var(--bg))); }
.scheme-legend li.is-deduction::before { border-style: dashed; border-color: var(--muted); background: var(--surface); }
.scheme-note, .scheme-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.scheme-concept-caption { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.35; }

/* Ванна: оглядова мініатюра під кутом */
.bath3d { margin: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.bath3d svg { width: 100%; max-width: 460px; margin: 0 auto; }
.bath3d-plane { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.bath3d-tile { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.bath3d-floor .bath3d-tile { fill: var(--field, var(--accent-soft)); }
.bath3d-label { fill: var(--text); font: 700 13px var(--font); }
.bath3d { --fixture-shell: color-mix(in srgb, #fff 86%, var(--surface)); --fixture-shadow: color-mix(in srgb, #b7c0c5 72%, var(--surface)); --fixture-bowl: color-mix(in srgb, #c6d0d5 74%, var(--surface)); --fixture-line: color-mix(in srgb, #5e6b72 78%, var(--text)); }
.bath3d-fill { stroke: var(--fixture-line); stroke-width: 1.5; stroke-linejoin: round; transition: opacity .35s ease; }
.bath3d-line { fill: none; stroke: var(--fixture-line); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: opacity .35s ease; }
.bath3d-shell { fill: var(--fixture-shell); }
.bath3d-shadow { fill: var(--fixture-shadow); }
.bath3d-bowl { fill: var(--fixture-bowl); }
.bath3d.is-muted .bath3d-fill { opacity: .25; }
.bath3d.is-muted .bath3d-line { opacity: .5; }
.bath-walls-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
@media (max-width: 560px) { .bath-walls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.computed-area { margin: 10px 0 0; padding: 8px 10px; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--accent-soft); font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.computed-area:empty { display: none; }

/* Затирка */
.grout-tile { fill: var(--field, var(--accent-soft)); stroke: var(--accent); stroke-width: 1; }
.grout-joint { fill: var(--accent); fill-opacity: .55; }
.grout-section-tile { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.grout-section-joint { fill: var(--accent); fill-opacity: .7; }
.grout-section-base { fill: var(--muted); fill-opacity: .35; }

/* Результат: що купити */
.result-buy { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.result-buy b { font-size: 18px; }

/* Загальні виправлення */
:root, :root[data-theme="dark"] { --focus: #7cddd3; }
:root[data-theme="light"] { --focus: #3e2415; }
:where(a, button, summary, select, input):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input[type="text"]:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.site-nav { scrollbar-width: thin; scroll-padding-inline: 16px; }
.brand > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.theme-toggle { height: 38px; line-height: 1; }
.link-list { padding-left: 22px; }
.link-list li { margin-bottom: 6px; }
h2[id], h3[id] { scroll-margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .bath3d-fill, .bath3d-line { transition: none; } }

.scheme-decor-label { fill: var(--muted); font: 600 11px var(--font); }
.computed { font-size: 16px; line-height: 1.45; }
/* До запуску toc.js згорнуті всі розділи змісту, крім поточного: без стрибка після завантаження. */
.js:not(.toc-ready) .toc-group:not(:has(.toc-page-row [aria-current="page"])) .toc-sub { display: none; }
