/* Калькулятор «товар по размеру». Шрифт свой (Inter, лежит рядом): встроенный на чужой
   сайт калькулятор не ходит к Google Fonts — в Германии это уже стоило сайтам штрафов. */
@font-face { font-family: "Inter var"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-wght-normal.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: "Inter var"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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: "Inter var"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter var"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-cyrillic-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

:root {
  --accent: #2E4038;
  --ink: #161B18;
  --muted: #59635E;
  --line: #E2E7E4;
  --line-strong: #C4CDC8;
  --wash: #F4F6F5;
  --ground: #FFFFFF;
  --err: #B3261E;
  --r: 10px;
  --r-lg: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Inter var", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.55 var(--font); font-feature-settings: "cv05", "cv08"; }
[hidden] { display: none !important; }
button, input, select { font-family: inherit; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 1140px; margin: 0 auto; padding-inline: 20px; padding-block: 18px 56px; }
.fatal { padding-block: 40px; color: var(--err); }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 2px 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.wordmark { font-weight: 700; letter-spacing: .16em; font-size: 14px; white-space: nowrap; }
.sample-tag { font-size: 14px; line-height: 1; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 10px; }
.langs { display: flex; gap: 2px; flex: none; }
.langs button { font: 600 14px/1 var(--font); letter-spacing: .06em; min-width: 40px; min-height: 40px; padding: 0 8px; border: 0; background: none; color: var(--muted); cursor: pointer; transition: transform .18s var(--ease); }
.langs button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.langs button:hover { transform: translateY(-1px); }

/* честная полоса: чья страница и откуда данные */
.notice { margin: 14px 0 0; padding: 12px 16px; border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--wash); color: var(--muted); font-size: 14px; line-height: 1.5; }

/* каталог: позиция из прайса */
.cat-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; }
.cat-price { margin: 0; font-size: 22px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cat-price small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.qty-field { width: 120px; flex: none; }
.ask-tag { font-size: 15px; font-weight: 600; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 6px 12px; display: inline-block; }
.block.ask { border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 14px 16px; }
.asks { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; line-height: 1.45; }

/* заголовок */
.intro { padding-block: 30px 4px; display: grid; gap: 10px; }
h1 { font-size: clamp(28px, 3.6vw, 38px); line-height: 1.1; font-weight: 650; letter-spacing: -.022em; margin: 0; text-wrap: balance; }
.lead { margin: 0; color: var(--muted); font-size: 17px; max-width: 60ch; }

.grid { display: grid; gap: 30px; margin-top: 22px; }
@media (min-width: 1000px) {
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 44px; }
  .result { position: sticky; top: 16px; align-self: start; }
}

/* шаги */
.step { border-top: 1px solid var(--line); padding-block: 24px 28px; display: grid; gap: 16px; }
#profileSteps > .step:first-child { border-top: 0; padding-top: 6px; }
.step h2 { display: flex; align-items: center; gap: 12px; font-size: 19px; line-height: 1.25; font-weight: 620; margin: 0; letter-spacing: -.005em; }
.step-no { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--ink); display: inline-grid; place-items: center; font-size: 14px; font-weight: 650; flex: none; }

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.lbl { font-size: 14px; line-height: 1.35; color: var(--muted); font-weight: 500; }
input[type="text"], select { width: 100%; font: 500 16px/1.2 var(--font); color: var(--ink); background: var(--ground); border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px 14px; min-height: 48px; font-variant-numeric: tabular-nums; transition: border-color .15s; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--ground) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23161B18' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 16px center; }
input:focus-visible, select:focus-visible, button:focus-visible, .check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--err); }
.err { color: var(--err); font-size: 14px; line-height: 1.4; margin: 0; }
.err:empty { display: none; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r); justify-self: start; max-width: 100%; }
.seg button { font: 500 15px/1 var(--font); border: 0; background: none; color: var(--ink); padding: 0 14px; min-height: 40px; min-width: 40px; border-radius: 7px; cursor: pointer; transition: transform .18s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.seg button:hover { transform: translateY(-1px); }

.icon-btn { width: 44px; height: 48px; border: 1px solid var(--line); background: none; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: transform .18s var(--ease); flex: none; }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn svg { width: 14px; height: 14px; }
.link-btn { justify-self: start; font: 600 15px/1 var(--font); color: var(--ink); background: none; border: 0; padding: 10px 0; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; transition: transform .18s var(--ease); }
.link-btn:hover { transform: translateX(3px); }
.check { display: flex; gap: 12px; align-items: center; font-size: 16px; cursor: pointer; justify-self: start; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); flex: none; }
.extras { display: grid; gap: 12px; }

/* терраса: части */
.parts { display: grid; gap: 14px; }
.part { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 12px; align-items: end; }
.part-tag { width: 32px; height: 48px; display: grid; place-items: center; font-weight: 650; font-size: 15px; border: 1px solid var(--line); border-radius: 8px; }
.part .field { align-self: stretch; grid-template-rows: 1fr auto auto; }
.part .lbl { align-self: end; }

/* доска: карточки */
.products { display: grid; gap: 10px; }
.product { position: relative; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px 16px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.product:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(22, 27, 24, .07); }
.product input { position: absolute; opacity: 0; pointer-events: none; }
.product:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.product:has(input:checked):hover { box-shadow: 0 0 0 1px var(--ink), 0 8px 22px rgba(22, 27, 24, .07); }
.product:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.swatch { width: 8px; align-self: stretch; border-radius: 3px; }
.product-text { display: grid; gap: 3px; min-width: 0; }
.product-name { font-weight: 600; font-size: 16px; line-height: 1.3; }
.product-meta { font-size: 14px; line-height: 1.4; color: var(--muted); }
.product-price { text-align: right; font-weight: 650; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; display: grid; gap: 3px; }
.product-price small { font-weight: 500; color: var(--muted); font-size: 14px; }
@media (max-width: 520px) {
  .product { grid-template-columns: 8px minmax(0, 1fr); }
  .product-price { grid-column: 2; text-align: left; display: flex; gap: 10px; align-items: baseline; }
}

/* окна: изделия */
.items { display: grid; gap: 14px; }
.item { border: 1px solid var(--line-strong); border-radius: var(--r); padding: 16px; display: grid; gap: 16px; }
.item-head { display: grid; grid-template-columns: 32px minmax(0, 1fr) 44px; gap: 12px; align-items: end; }
.item-body { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 20px; align-items: start; }
.item-fields { display: grid; gap: 14px; min-width: 0; }
.dims { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .7fr); gap: 10px; align-items: end; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.elev { margin: 0; display: grid; gap: 6px; justify-items: center; align-self: center; }
.elev svg { width: 100%; height: auto; max-height: 210px; display: block; }
.elev .frame, .elev .sash { stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.elev .glass { fill: #E6ECEF; stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.elev .sym { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.elev figcaption, .plan figcaption { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 620px) {
  .item-body { grid-template-columns: minmax(0, 1fr); }
  .elev { order: -1; max-width: 200px; justify-self: center; }
}
@media (max-width: 420px) {
  .dims { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dims .field:last-child { grid-column: 1 / -1; }
  .opts { grid-template-columns: minmax(0, 1fr); }
}

/* результат */
.result { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: grid; gap: 22px; background: var(--ground); min-width: 0; }
.sum { display: grid; gap: 6px; }
.total-label { font-size: 14px; color: var(--muted); margin: 0; }
.total { font-size: clamp(34px, 4.6vw, 44px); font-weight: 680; letter-spacing: -.025em; line-height: 1.05; font-variant-numeric: tabular-nums; margin: 0; }
.total-sub { font-size: 14px; color: var(--muted); margin: 0; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 0; }
.stats div { background: var(--ground); padding: 12px 14px; display: grid; gap: 2px; align-content: start; }
/* Нечётное число показателей: последний занимает строку целиком, пустых клеток не остаётся. */
.stats div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.stats dt { font-size: 14px; color: var(--muted); }
.stats dd { margin: 0; font-size: 18px; font-weight: 620; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stats small { display: block; font-size: 14px; color: var(--muted); font-weight: 500; }
.block { display: grid; gap: 10px; min-width: 0; }
.block h3 { font-size: 15px; font-weight: 620; margin: 0; }
.plans { display: grid; gap: 14px; }
.plan { margin: 0; display: grid; gap: 6px; }
.plan svg { width: 100%; height: auto; max-height: 300px; display: block; }
.plan .jl { stroke: #9AA59F; stroke-width: 1; vector-effect: non-scaling-stroke; }

table.t { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14px; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.t td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.4; }
.t .n { text-align: right; white-space: nowrap; padding-left: 14px; }
.t tr:last-child td { border-bottom: 0; }
.t .sub td { color: var(--muted); font-size: 14px; padding-top: 0; border-bottom: 0; }
.t .item-row td { padding-bottom: 4px; border-bottom: 0; font-weight: 600; }
.t .sep td { border-bottom: 1px solid var(--line); padding: 0; height: 6px; }

.wbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--wash); }
.wbar i { display: block; height: 100%; }
.wbar i:nth-child(1), .dot.d1 { background: var(--ink); }
.wbar i:nth-child(2), .dot.d2 { background: rgba(22, 27, 24, .5); }
.wbar i:nth-child(3), .dot.d3 { background: rgba(22, 27, 24, .22); }
.wlegend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14px; }
.wlegend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.d0 { border: 1.5px solid var(--ink); }
.wlegend .n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.problems { margin: 0; padding: 12px 14px; border: 1px solid var(--err); border-radius: var(--r); color: var(--err); font-size: 14px; display: grid; gap: 4px; }

.cta { width: 100%; font: 600 16px/1 var(--font); background: var(--accent); color: #fff; border: 0; border-radius: var(--r); padding: 0 18px; min-height: 54px; cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .14); }
.fine { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0; }

/* предложение */
.quote-view { padding-block: 22px 40px; display: grid; gap: 22px; }
.qtools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; max-width: 820px; width: 100%; margin: 0 auto; }
.btn { font: 600 15px/1 var(--font); border: 1px solid var(--ink); background: none; color: var(--ink); border-radius: var(--r); padding: 0 18px; min-height: 48px; cursor: pointer; transition: transform .18s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.buyer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 820px; width: 100%; margin: 0 auto; }
@media (max-width: 560px) { .buyer { grid-template-columns: minmax(0, 1fr); } }

.sheet { width: 100%; max-width: 820px; margin: 0 auto; background: #fff; color: #121412; border: 1px solid var(--line); box-shadow: 0 14px 44px rgba(20, 25, 22, .07); padding: clamp(22px, 5.5vw, 60px); display: grid; gap: 30px; }
.sheet-head { display: flex; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; align-items: flex-start; }
.sheet .wordmark { font-size: 16px; }
.co { font-size: 14px; line-height: 1.55; color: #3A403C; text-align: right; }
.qt { font-size: 28px; line-height: 1.15; font-weight: 650; letter-spacing: -.015em; margin: 0; }
.qmeta { display: flex; flex-wrap: wrap; gap: 6px 32px; margin: 12px 0 0; font-size: 14px; }
.qmeta div { display: grid; gap: 1px; }
.qmeta dt { color: #6B736E; }
.qmeta dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; font-size: 14px; line-height: 1.55; }
.parties h3 { font-size: 14px; font-weight: 600; margin: 0 0 4px; letter-spacing: .04em; text-transform: uppercase; color: #6B736E; }
.parties p { margin: 0; }
.tablewrap { overflow-x: auto; }
.sheet table.t { font-size: 14px; min-width: 520px; }
.sheet .t th { color: #6B736E; }
.totals { margin-left: auto; width: min(100%, 330px); display: grid; gap: 6px; font-size: 15px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; gap: 16px; }
.totals .grand { font-size: 19px; font-weight: 680; border-top: 1.5px solid #121412; padding-top: 10px; margin-top: 4px; }
.notes { display: grid; gap: 6px; font-size: 14px; line-height: 1.55; color: #3A403C; }
.notes p { margin: 0; }
.sheet-foot { border-top: 1px solid #DADFDC; padding-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; font-size: 14px; line-height: 1.5; color: #4A514D; }
.sheet-foot p { margin: 0; }
.nw { white-space: nowrap; }
.stamp { font-size: 14px; letter-spacing: .06em; color: #4A514D; border: 1px solid #C9D0CC; border-radius: 4px; padding: 8px 12px; margin: 0; }
@media (max-width: 560px) {
  .co { text-align: left; }
  .parties, .sheet-foot { grid-template-columns: minmax(0, 1fr); }
  /* На телефоне строка предложения — название во всю ширину, под ним количество, цена, сумма. */
  .sheet table.t { min-width: 0; }
  .sheet .t thead { display: none; }
  .sheet .t tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 14px; padding-block: 10px; border-bottom: 1px solid var(--line); }
  .sheet .t tr:last-child { border-bottom: 0; }
  .sheet .t td { padding: 0; border: 0; }
  .sheet .t td:first-child { grid-column: 1 / -1; }
  .sheet .t td.n { padding-left: 0; }
  .sheet .t td:nth-child(2) { text-align: left; color: #6B736E; }
  .sheet .t td:nth-child(3) { color: #6B736E; }
  .sheet .t td:nth-child(4) { font-weight: 600; }
}

@media print {
  @page { size: A4; margin: 14mm 15mm 16mm; }
  html, body { background: #fff; }
  .app { max-width: none; padding: 0; }
  .top, #calc, .qtools, .buyer { display: none !important; }
  .quote-view { display: block !important; padding: 0; }
  .sheet { border: 0; box-shadow: none; padding: 0; max-width: none; gap: 18px; }
  .qt { font-size: 24px; }
  .qmeta { margin-top: 8px; }
  .sheet .t td { padding: 6px 0; }
  .sheet .t .n { padding-left: 18px; }
  .sheet-foot { padding-top: 12px; }
  .stamp { padding: 6px 10px; }
  .co { text-align: right !important; }
  .parties { grid-template-columns: 1fr 1fr !important; }
  .sheet-foot { grid-template-columns: repeat(3, 1fr) !important; }
  .tablewrap { overflow: visible; }
  .sheet table.t { min-width: 0; }
  .t tr, .totals, .notes, .sheet-foot { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
