/* Planicalc — style. Light by default, dark on demand. */
@font-face { font-family: "Inter PC"; src: url("fonts/Inter-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter PC"; src: url("fonts/Inter-SemiBold.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter PC Display"; src: url("fonts/InterDisplay-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --bg: #ffffff;
  --paper: #f4f6f3;
  --paper-2: #eaeee8;
  --ink: #18202a;
  --ink-2: #4b5664;
  --ink-3: #737d89;
  --line: #dde2dc;
  --line-2: #c9d0c8;
  --tape: #f5b700;
  --tape-soft: #fff4cc;
  --tape-ink: #1d1600;
  --blue: #1d5bbf;
  --blue-soft: #e8f0fc;
  --grid: #d3e1f6;
  --ok: #1d7a4c;
  --warn: #a4400a;
  --shadow: 0 1px 2px rgba(24, 32, 42, .06), 0 8px 24px -12px rgba(24, 32, 42, .18);
  --r: 10px;
  --r-s: 6px;
  --wrap: 1160px;
  --font: "Inter PC", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Inter PC Display", "Inter PC", system-ui, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #12161b;
  --paper: #1a2027;
  --paper-2: #222a33;
  --ink: #ebeee9;
  --ink-2: #b2bac4;
  --ink-3: #8a94a0;
  --line: #2b343e;
  --line-2: #3a4550;
  --tape: #f6c22e;
  --tape-soft: #3a3115;
  --tape-ink: #1d1600;
  --blue: #84aef0;
  --blue-soft: #1b2a40;
  --grid: #24364f;
  --ok: #5fcf98;
  --warn: #ffab70;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; line-height: 1.12; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(30px, 4.4vw, 46px); }
h2 { font-size: clamp(22px, 2.4vw, 28px); }
h3 { font-size: 18px; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--ink-3); font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 760px; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--r-s); z-index: 100; }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.top-in { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 20px/1 var(--display); letter-spacing: -.02em; }
.logo-mark { width: 32px; height: 32px; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); background: var(--paper); }
.nav .ic { width: 18px; height: 18px; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ruler {
  height: 7px;
  background:
    repeating-linear-gradient(90deg, var(--tape-ink) 0 1px, transparent 1px 50px) 0 0 / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--tape-ink) 55%, transparent) 0 1px, transparent 1px 10px) 0 0 / 100% 3px no-repeat,
    var(--tape);
  opacity: .95;
}

/* language menu */
.lang { position: relative; }
.lang-btn, .theme-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font: 600 14px var(--font); cursor: pointer; }
.lang-btn:hover, .theme-btn:hover { border-color: var(--line-2); background: var(--paper); }
.lang-btn .ic { width: 16px; height: 16px; transition: transform .2s; }
.lang-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.flag { display: inline-block; width: 24px; height: 16px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); flex: none; }
.flag svg { width: 100%; height: 100%; }
.theme-btn { width: 40px; justify-content: center; padding: 0; }
.theme-btn .i-sun { display: none; }
[data-theme="dark"] .theme-btn .i-sun { display: block; }
[data-theme="dark"] .theme-btn .i-moon { display: none; }
.lang-pop { position: absolute; right: 0; top: calc(100% + 10px); width: min(92vw, 420px); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; transform-origin: top right; animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.lang-title { margin: 2px 6px 10px; font-weight: 600; font-size: 13px; color: var(--ink-3); }
.lang-pop ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.lang-pop a { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.lang-pop a .flag { width: 30px; height: 20px; }
.lang-pop a:hover { background: var(--paper); }
.lang-pop a[aria-current] { background: var(--tape-soft); }
.lm-code { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* ---------- buttons ---------- */
.btn, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; font: 600 15px var(--font); cursor: pointer; text-decoration: none; border: 1px solid transparent; }
.btn { background: var(--ink); color: var(--bg); }
.btn:hover { background: color-mix(in srgb, var(--ink) 85%, var(--blue)); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper); border-color: var(--line-2); }
.btn-big { min-height: 52px; padding: 0 24px; font-size: 16px; background: var(--tape); color: var(--tape-ink); }
.btn-big:hover { background: color-mix(in srgb, var(--tape) 88%, #000); }

/* ---------- home: hero ---------- */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(36px, 5vw, 72px); border-bottom: 1px solid var(--line); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.hero h1 { font-size: clamp(34px, 5.2vw, 60px); line-height: 1.02; letter-spacing: -.035em; max-width: 13ch; }
.hero-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 28px 0 22px; max-width: 520px; }
.hf > span:first-child { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.hf .ctl input { font: 700 26px/1 var(--display); letter-spacing: -.02em; height: 60px; }
.hero-vis { display: grid; gap: 14px; }
.bp-box { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.bp { width: 100%; height: auto; }
.bp-grid { stroke: var(--grid); stroke-width: 1; }
.bp-wall { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linejoin: miter; }
.bp-floor { fill: color-mix(in srgb, var(--tape) 14%, transparent); }
.bp-dim { stroke: var(--blue); stroke-width: 1.2; fill: none; }
.bp-txt { fill: var(--blue); font: 600 13px var(--font); }
.bp-area { fill: var(--ink); font: 700 22px var(--display); letter-spacing: -.02em; }
.bp-sub { fill: var(--ink-3); font: 600 12px var(--font); }
.bp-door { fill: none; stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 3 3; }
.bp-gap { stroke: var(--bg); stroke-width: 9; }
.bp-win { stroke: var(--blue); stroke-width: 2; }
.hero-res { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.hero-res > div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-res > div:nth-child(3n) { border-right: 0; }
.hero-res > div:nth-child(n+4) { border-bottom: 0; }
.hero-res dt { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.hero-res dd { margin: 2px 0 0; font: 700 19px/1.2 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.hero-res .hl { background: var(--tape-soft); }
.hero-res dd small { display: block; font: 600 12px var(--font); color: var(--ink-2); margin-top: 2px; }
.hero-note { font-size: 13px; color: var(--ink-3); margin: 0; }

/* ---------- home: calculators list ---------- */
.all { padding: clamp(40px, 6vw, 72px) 0; }
.all-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.all-head h2 { margin: 0; }
.search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; height: 46px; width: min(100%, 340px); background: var(--bg); color: var(--ink-3); }
.search:focus-within { border-color: var(--blue); }
.search input { border: 0; outline: 0; background: transparent; font: 400 16px var(--font); color: var(--ink); width: 100%; }
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 48px; }
.cat h3 { font-size: 14px; letter-spacing: 0; color: var(--ink-3); font-family: var(--font); font-weight: 600; padding-bottom: 10px; border-bottom: 2px solid var(--ink); margin: 18px 0 0; }
.calc-list { list-style: none; margin: 0; padding: 0; }
.calc-list a, .rel a { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.calc-list a:hover b, .rel a:hover b { color: var(--blue); }
.ci { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--paper); color: var(--ink); flex: none; }
.ci .ic { width: 24px; height: 24px; }
.calc-list a:hover .ci { background: var(--tape); color: var(--tape-ink); }
.ct b, .rel b { display: block; font-weight: 600; font-size: 17px; }
.ct small, .rel small { display: block; color: var(--ink-2); font-size: 14px; line-height: 1.4; margin-top: 2px; }
.nothing { color: var(--ink-2); }

.band { background: var(--ink); color: var(--bg); }
.band-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(28px, 4vw, 44px) 0; flex-wrap: wrap; }
.band h2 { color: var(--bg); margin-bottom: 6px; }
.band p { margin: 0; color: color-mix(in srgb, var(--bg) 78%, var(--ink)); max-width: 60ch; }
.trust { padding: clamp(40px, 6vw, 72px) 0; }
.trust ul { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.trust li b { display: block; font-size: 17px; margin: 12px 0 6px; }
.trust li p { color: var(--ink-2); font-size: 15px; margin: 0; }
.ti { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink); }
.ti .ic { width: 22px; height: 22px; }

/* ---------- calculator page ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 20px 0 22px; font-size: 14px; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-2); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }
.calc-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 24px; }
.calc-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 14px; background: var(--tape); color: var(--tape-ink); flex: none; margin-top: 4px; }
.calc-icon .ic { width: 32px; height: 32px; stroke-width: 1.7; }
.calc-head h1 { margin-bottom: 8px; }
.calc-head .lead { margin: 0; }

.calc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.calc-form { background: var(--paper); border-radius: 14px; padding: clamp(16px, 2.4vw, 26px); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; }
.fld:not(.fld-check) { display: flex; flex-direction: column; justify-content: flex-end; }
.fld label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.fld-check { grid-column: 1 / -1; }
.ctl { position: relative; display: flex; align-items: center; background: var(--bg); border: 1.5px solid var(--line-2); border-radius: var(--r-s); transition: border-color .15s; }
.ctl:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.calc > *, .plan > *, .hero-in > *, .fld { min-width: 0; }
.ctl select { width: 100%; text-overflow: ellipsis; }
.ctl input, .ctl select { appearance: none; -webkit-appearance: none; flex: 1; min-width: 0; height: 50px; border: 0; background: transparent; color: var(--ink); font: 600 18px var(--font); padding: 0 12px; outline: 0; font-variant-numeric: tabular-nums; }
.ctl select { font-size: 16px; padding-right: 36px; cursor: pointer; }
.ctl-sel > .ic { position: absolute; right: 10px; width: 18px; height: 18px; pointer-events: none; color: var(--ink-3); }
.ctl-sel .unit { margin-right: 30px; }
.unit { padding: 0 12px 0 4px; color: var(--ink-3); font-size: 15px; font-weight: 600; white-space: nowrap; }
.ctl.bad { border-color: var(--warn); }
.fld .check, .check { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--ink); min-height: 44px; margin: 0; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 24px; height: 24px; border: 1.5px solid var(--line-2); border-radius: 6px; background: var(--bg); display: grid; place-items: center; flex: none; }
.check input:checked + .box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .box::after { content: ""; width: 12px; height: 7px; border-left: 2.5px solid var(--bg); border-bottom: 2.5px solid var(--bg); transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible + .box { outline: 3px solid var(--blue); outline-offset: 2px; }
.adv { margin-top: 18px; border-top: 1px dashed var(--line-2); padding-top: 14px; }
.adv summary { cursor: pointer; font-weight: 600; color: var(--blue); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 15px; line-height: 1; }
.adv[open] summary::before { content: "−"; }
.adv .fields { margin-top: 16px; }
.form-actions { margin-top: 18px; display: flex; gap: 8px; }

.result { position: sticky; top: 88px; border: 1.5px solid var(--ink); border-radius: 14px; padding: clamp(16px, 2.4vw, 24px); background: var(--bg); }
.res-main { display: grid; gap: 10px; }
.tape { position: relative; display: grid; gap: 2px; padding: 16px 18px 14px; border-radius: 10px; background: var(--tape); color: var(--tape-ink); overflow: hidden; }
.tape::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 9px; background: repeating-linear-gradient(90deg, rgba(29, 22, 0, .75) 0 1.5px, transparent 1.5px 40px), repeating-linear-gradient(90deg, rgba(29, 22, 0, .45) 0 1px, transparent 1px 8px) 0 0 / 100% 5px no-repeat; }
.tape-k { font-size: 14px; font-weight: 600; margin-top: 4px; }
.tape-v { font: 700 clamp(32px, 4vw, 42px)/1.05 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.res-h { font: 600 14px var(--font); color: var(--ink-3); letter-spacing: 0; margin: 20px 0 6px; }
.buy { list-style: none; padding: 0; margin: 0; }
.buy li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.buy li span { color: var(--ink-2); }
.buy li b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.buy li.alt { opacity: .8; }
.buy li em { font-style: normal; color: var(--ink-3); }
.rows { margin: 0; }
.rows div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.rows dt { color: var(--ink-3); }
.rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.warn { color: var(--warn); font-weight: 600; margin: 12px 0 0; }
.res-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.res-actions .btn, .res-actions .btn-ghost { min-height: 42px; padding: 0 14px; font-size: 14px; }
.note { font-size: 13px; color: var(--ink-3); margin: 14px 0 0; }

.article { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; margin: 56px 0 72px; }
.article article h2 { margin-top: 1.6em; }
.article article h2:first-child { margin-top: 0; }
.article article p, .tips li { max-width: 68ch; color: var(--ink); }
.formula { margin: 18px 0 8px; padding: 18px 20px; border-radius: 10px; background: var(--blue-soft); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; background-position: -1px -1px; display: grid; gap: 8px; border-left: 4px solid var(--blue); }
.formula-k { font-weight: 600; font-size: 13px; color: var(--blue); }
.formula code { font: 600 15px/1.5 var(--font); color: var(--ink); background: color-mix(in srgb, var(--bg) 82%, transparent); padding: 4px 8px; border-radius: 4px; justify-self: start; }
.tips { padding-left: 0; list-style: none; display: grid; gap: 10px; }
.tips li { position: relative; padding-left: 30px; }
.tips li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 12px; height: 12px; border-radius: 3px; background: var(--tape); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; color: var(--ink-3); }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--ink-2); margin: -4px 0 16px; }
.report { margin-top: 28px; font-size: 14px; color: var(--ink-3); }
aside h2 { font-size: 18px; margin: 28px 0 4px; }
.promo { display: grid; gap: 6px; padding: 20px; border-radius: 14px; background: var(--ink); color: var(--bg); text-decoration: none; }
.promo b { font: 700 19px/1.2 var(--display); }
.promo span:last-child { color: color-mix(in srgb, var(--bg) 75%, var(--ink)); font-size: 15px; }
.promo-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--tape); color: var(--tape-ink); margin-bottom: 6px; }
.rel { list-style: none; padding: 0; margin: 0; }
.rel b { font-size: 16px; }
.rel .ci { width: 38px; height: 38px; }
.embed-box { margin-top: 28px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.embed-box summary { cursor: pointer; font-weight: 600; display: flex; gap: 8px; align-items: center; list-style: none; }
.embed-box summary::-webkit-details-marker { display: none; }
.embed-box p { font-size: 14px; color: var(--ink-2); margin: 10px 0; }
.embed-box textarea { width: 100%; font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: var(--paper); color: var(--ink); resize: vertical; }
.embed-box .btn-ghost { margin-top: 8px; min-height: 38px; }

/* ---------- plan ---------- */
.plan { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 72px; }
.room { background: var(--paper); border-radius: 14px; padding: clamp(16px, 2.4vw, 24px); margin-bottom: 16px; }
.room-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.room-head input { flex: 1; font: 700 20px var(--display); letter-spacing: -.01em; border: 0; border-bottom: 1.5px dashed var(--line-2); background: transparent; color: var(--ink); padding: 6px 2px; min-width: 0; }
.room-head input:focus { outline: 0; border-bottom-color: var(--blue); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--warn); border-color: var(--warn); }
.room .fields { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.room .ctl input { height: 46px; font-size: 17px; padding: 0 8px; }
.room .unit { padding: 0 8px 0 2px; font-size: 13px; }
.works { margin-top: 16px; display: grid; gap: 12px; }
.work { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.work > span { width: 100%; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.seg { display: inline-flex; border: 1.5px solid var(--line-2); border-radius: 999px; padding: 3px; background: var(--bg); flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-block; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg input:checked + span { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 3px solid var(--blue); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--bg); font-weight: 600; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.chip input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.chip:has(input:checked) { border-color: var(--ink); color: var(--ink); }
.add-room { width: 100%; justify-content: center; border-style: dashed; min-height: 52px; }
.plan-side { position: sticky; top: 88px; display: grid; gap: 16px; }
.list-card { border: 1.5px solid var(--ink); border-radius: 14px; padding: clamp(16px, 2.4vw, 24px); }
.list-card h2 { font-size: 22px; margin-bottom: 4px; }
.list-meta { font-size: 14px; color: var(--ink-3); margin: 0 0 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li b { font-variant-numeric: tabular-nums; text-align: right; }
.list li small { grid-column: 1 / -1; color: var(--ink-3); font-size: 13px; }
.list .total { border-bottom: 0; font-size: 18px; }
.list .total span { font-weight: 600; }
.send { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.send a, .send button { min-height: 40px; padding: 0 14px; font-size: 14px; }
.settings-card { background: var(--paper); border-radius: 14px; padding: 6px 18px; }
.settings-card details { padding: 10px 0; }
.settings-card details + details { border-top: 1px solid var(--line); }
.settings-card summary { cursor: pointer; font-weight: 600; }
.settings-card .fields { margin-top: 12px; }

/* ---------- text pages, root ---------- */
.text-page { padding-bottom: 72px; }
.text-page p { font-size: 17px; }
.p-root { min-height: 100vh; display: grid; }
.root { display: grid; place-items: center; padding: 40px 16px; }
.root-in { width: min(100%, 720px); }
.logo-big { font-size: 30px; gap: 14px; }
.logo-big .logo-mark { width: 48px; height: 48px; }
.root .ruler { margin: 22px 0 26px; border-radius: 2px; }
.root h1 { font-size: 17px; font-family: var(--font); font-weight: 600; color: var(--ink-2); letter-spacing: 0; line-height: 1.6; }
.root-langs { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.root-langs a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.root-langs a:hover { border-color: var(--ink); }
.root-langs a.suggest { border: 2px solid var(--ink); background: var(--tape-soft); }
.root-langs .flag { width: 36px; height: 24px; }
.root-langs b { display: block; font-size: 17px; }
.root-langs small { color: var(--ink-3); font-size: 13px; }
.nf-code { font: 700 96px/1 var(--display); letter-spacing: -.05em; margin: 0 0 20px; }
.nf-item { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--paper); padding: 48px 0 28px; font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(5, minmax(0, 1fr)); gap: 28px; }
.foot h2 { font: 600 14px var(--font); color: var(--ink-3); letter-spacing: 0; margin: 6px 0 10px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot a { color: var(--ink); text-decoration: none; }
.foot a:hover { color: var(--blue); text-decoration: underline; }
.foot-brand p { color: var(--ink-2); margin: 12px 0 0; max-width: 34ch; }
.cur { display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.cur select { font: 600 15px var(--font); border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); color: var(--ink); padding: 6px 10px; }
.copy { margin: 36px 0 0; color: var(--ink-3); font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; z-index: 99; box-shadow: var(--shadow); animation: pop .16s ease-out; }
.sheet { position: fixed; inset: auto 0 0 0; z-index: 90; background: var(--bg); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); display: grid; gap: 8px; animation: pop .16s ease-out; }
.sheet .btn-ghost { justify-content: flex-start; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 89; }
.lang-hint { position: fixed; right: 16px; bottom: 16px; z-index: 80; max-width: 340px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 10px; font-size: 15px; }
.lang-hint div { display: flex; gap: 8px; }
.lang-hint .btn, .lang-hint .btn-ghost { min-height: 38px; font-size: 14px; }

/* compact result bar on phones */
.mini { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 61; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--tape); color: var(--tape-ink); font: 600 14px var(--font); box-shadow: var(--shadow); cursor: pointer; text-align: left; animation: pop .16s ease-out; }
.mini b { font: 700 22px/1 var(--display); letter-spacing: -.02em; white-space: nowrap; }
@media (min-width: 721px) { .mini { bottom: 16px; } }
.embed .mini { display: none; }

/* ---------- embed mode ---------- */
.embed .top, .embed .foot, .embed .article, .embed .crumbs, .embed .skip, .embed .calc-head .lead { display: none; }
.embed .calc-head { margin: 16px 0; }
.embed .result { position: static; }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
  .article { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .trust ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero-in, .calc, .plan { grid-template-columns: minmax(0, 1fr); }
  .result, .plan-side { position: static; }
  .room .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .cats { grid-template-columns: 1fr; }
  .top-in { gap: 12px; height: 58px; }
  .logo { font-size: 18px; }
  .logo-mark { width: 28px; height: 28px; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hero-form { gap: 8px; }
  .hf .ctl input { font-size: 22px; height: 54px; padding: 0 8px; }
  .hf .unit { padding: 0 8px 0 0; }
  .hero-res { grid-template-columns: 1fr 1fr; }
  .hero-res > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .hero-res > div:nth-child(2n) { border-right: 0; }
  .hero-res > div:nth-child(n+4) { border-bottom: 1px solid var(--line); }
  .hero-res > div:nth-child(n+5) { border-bottom: 0; }
  .band-in .btn-big { width: 100%; }
  .btn-big { width: 100%; }
  .calc-head { gap: 14px; }
  .calc-icon { width: 48px; height: 48px; border-radius: 12px; }
  .calc-icon .ic { width: 26px; height: 26px; }
  .root-langs { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .lang-code { display: none; }
  .lang-btn .ic { display: none; }
  .lang-btn { padding: 0 8px; }
  .lang-pop { position: fixed; left: 12px; right: 12px; top: 66px; width: auto; }
  .mobile-nav { display: flex; }
}
@media (max-width: 359px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .room .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust ul { grid-template-columns: 1fr; }
  .lang-pop ul { grid-template-columns: 1fr; }
}
.mobile-nav { display: none; }
@media (max-width: 720px) {
  .mobile-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .mobile-nav a { display: grid; justify-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 4px 10px; border-radius: 10px; min-width: 72px; }
  .mobile-nav a[aria-current] { color: var(--ink); background: var(--paper); }
  body { padding-bottom: 68px; }
  .embed body, .p-root { padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  .top, .foot, .article aside, .res-actions, .form-actions, .mobile-nav, .send, .add-room, .icon-btn, .settings-card, .lang-hint, .skip { display: none !important; }
  body { padding: 0; }
  .calc, .plan { grid-template-columns: 1fr 1fr; }
  .result, .list-card { position: static; border-width: 1px; }
  .tape { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
