@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500&display=swap');

:root {
    --bg: #FAFAF7;
    --bg-2: #F3F3EF;
    --surface: #FFFFFF;
    --surface-2: #F8F8F4;
    --border: #E8E8E2;
    --border-strong: #D4D4CC;
    --ink: #14181C;
    --ink-2: #3A4048;
    --ink-muted: #6B727C;
    --ink-faint: #9AA0A8;
    --accent: #14181C;
    --accent-soft: #FF5B2E;
    --ok: #1F9D55;
    --err: #D93636;
    --font: 'Inter', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --radius: 20px;
    --radius-lg: 32px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(20,24,28,0.04), 0 4px 16px rgba(20,24,28,0.04);
    --shadow-md: 0 4px 24px rgba(20,24,28,0.06), 0 1px 3px rgba(20,24,28,0.04);
    --shadow-lg: 0 20px 60px rgba(20,24,28,0.08), 0 4px 12px rgba(20,24,28,0.04);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: 0; background: none; color: inherit; font: inherit; }
input, textarea { font: inherit; }

/* ---------------------------------------------------------- HEADER */
.hdr {
    position: sticky; top: 0; z-index: 50;
    background: rgba(250,250,247,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.hdr-in {
    max-width: 1440px; margin: 0 auto;
    padding: 18px 48px;
    display: flex; align-items: center; justify-content: space-between;
}
.logo {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.6px;
    color: var(--ink);
}
.logo span { color: var(--ink-faint); font-weight: 600; }
.hdr-phone {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    padding: 10px 22px;
    border: 1.5px solid var(--border-strong);
    border-radius: 100px;
    transition: all 0.25s ease;
}
.hdr-phone:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

/* ---------------------------------------------------------- WRAP */
.wrap {
    max-width: 1440px;
    margin: 100px auto;
    padding: 80px 48px 120px;
}

.hero2 { max-width: 860px; margin-bottom: 64px; }
.hero2 h1 {
    font-size: clamp(38px, 5.5vw, 68px);
    font-weight: 900;
    letter-spacing: -2.5px;
    line-height: 0.98;
    margin: 0 0 24px;
    color: var(--ink);
}
.hero2 h1 em {
    font-style: normal;
    color: var(--accent-soft);
}
.hero2 p {
    color: var(--ink-muted);
    font-size: 18px;
    line-height: 1.65;
    margin: 0;
    max-width: 640px;
}

.studio { max-width: 1440px; }

/* ---------------------------------------------------------- STEPS */
.step-head { margin: 72px 0 28px; }
.step-num {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--ink);
    color: #fff;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.step-head h2 {
    font-size: clamp(28px, 3.5vw, 44px);
    font-weight: 800;
    letter-spacing: -1.2px;
    margin: 16px 0 0;
    line-height: 1.05;
    color: var(--ink);
}

/* ---------------------------------------------------------- ROOF CHOICE */
.roof-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 760px;
    margin-bottom: 40px;
}
.roof-btn {
    display: flex; align-items: center; gap: 20px;
    padding: 24px 28px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink-muted);
    text-align: left;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}
.roof-btn:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.roof-btn[aria-pressed="true"] {
    border-color: var(--ink);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 0 0 4px rgba(20,24,28,0.06), var(--shadow-md);
}
.roof-btn svg { width: 64px; height: 38px; flex-shrink: 0; }
.roof-btn strong { display: block; font-size: 16px; font-weight: 700; color: var(--ink); }
.roof-btn small { display: block; font-size: 13px; color: var(--ink-faint); margin-top: 4px; }

/* ---------------------------------------------------------- WORKSPACE */
.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 24px;
    align-items: start;
}

/* ---------------------------------------------------------- VISUAL / 3D */
.visual {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}
.viewer {
    position: relative;
    height: 580px;
    background:
            radial-gradient(ellipse at 50% 40%, #FFF 0%, #F5F5F0 60%, #EDEDE7 100%);
}
#canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
    cursor: grab;
}
#canvas:active { cursor: grabbing; }

.viewer-top {
    position: absolute; top: 24px; left: 28px; right: 28px;
    z-index: 2;
    display: flex; justify-content: flex-start;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    text-transform: uppercase;
    pointer-events: none;
}
#v-dims { display: none; }

.model-tools {
    position: absolute; top: 56px; left: 28px;
    z-index: 3;
    display: flex; gap: 8px;
}
.seg {
    display: flex;
    background: var(--surface);
    padding: 4px;
    border-radius: 100px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.seg button, .model-tools > button {
    min-height: 34px;
    padding: 0 16px;
    display: flex; align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-muted);
    border-radius: 100px;
    transition: all 0.2s ease;
}
.seg button:hover, .model-tools > button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] {
    background: var(--ink);
    color: #fff;
}
.model-tools > button {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.model-tools > button[aria-pressed="true"] {
    background: var(--ink);
    color: #fff;
}

.view-tools {
    position: absolute; bottom: 20px; left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex; gap: 4px;
    background: var(--surface);
    padding: 6px;
    border-radius: 100px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.view-tools button {
    min-height: 36px;
    padding: 0 18px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-muted);
    border-radius: 100px;
    transition: all 0.2s ease;
}
.view-tools button:hover { color: var(--ink); }
.view-tools button[aria-pressed="true"] {
    background: var(--ink);
    color: #fff;
}

.zoom-tools {
    position: absolute; right: 24px; bottom: 20px;
    z-index: 3;
    display: flex; flex-direction: column; gap: 8px;
}
.zoom-tools button {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--ink-2);
    font-size: 18px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}
.zoom-tools button:hover {
    color: var(--ink);
    border-color: var(--ink);
    transform: translateY(-1px);
}

.viewer-hint {
    position: absolute; right: 28px; top: 24px;
    z-index: 2;
    font-size: 12px;
    color: var(--ink-faint);
    pointer-events: none;
}

.loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(250,250,247,0.9);
    color: var(--ink-muted);
    font-size: 14px;
    z-index: 5;
    transition: opacity 0.4s ease;
}
.loading.hide { opacity: 0; pointer-events: none; }

.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.metrics > div {
    padding: 22px 26px;
    border-right: 1px solid var(--border);
}
.metrics > div:last-child { border-right: 0; }
.metrics small {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}
.metrics strong {
    font-size: 24px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.8px;
}
.metrics strong.ok { color: var(--ok); }
.metrics strong.err { color: var(--err); }

/* ---------------------------------------------------------- PANEL */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: sticky;
    top: 100px;
    box-shadow: var(--shadow-md);
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    color: var(--ink-faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.panel-head button {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--ink-faint);
    transition: all 0.2s ease;
}
.panel-head button:hover {
    color: var(--ink);
    background: var(--surface-2);
}

.p-group { margin-bottom: 32px; }
.p-group h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 16px;
    display: flex; justify-content: space-between;
    letter-spacing: -0.2px;
}
.p-group h3 span {
    font-weight: 500;
    font-size: 11px;
    color: var(--ink-faint);
    text-transform: none;
    letter-spacing: 0;
}

/* Slider */
.slider { display: block; margin-bottom: 22px; }
.slider-row {
    display: flex; align-items: baseline; justify-content: space-between;
    font-size: 14px;
    color: var(--ink-2);
    margin-bottom: 8px;
    font-weight: 600;
}
.slider-row input[type="number"] {
    width: 80px;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 500;
    text-align: right;
    padding: 4px 10px;
    transition: border-color 0.2s ease;
}
.slider-row input[type="number"]:hover { border-color: var(--border-strong); }
.slider-row input[type="number"]:focus { border-color: var(--ink); outline: none; }
.slider input[type="range"] {
    width: 100%;
    accent-color: var(--ink);
    cursor: pointer;
    height: 4px;
}

.note {
    font-size: 12px;
    color: var(--ink-faint);
    margin: 10px 0 0;
    line-height: 1.6;
}
.note b { color: var(--ink-2); font-weight: 700; }

/* Segmented full-width */
.seg-full {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--surface-2);
    gap: 4px;
    margin-bottom: 22px;
}
.seg-full button {
    min-height: 38px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-muted);
    border-radius: 100px;
    transition: all 0.2s ease;
}
.seg-full button:hover { color: var(--ink); }
.seg-full button[aria-pressed="true"] {
    background: var(--ink);
    color: #fff;
    font-weight: 700;
}

/* Advanced */
.adv {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 8px;
}
.adv summary {
    list-style: none;
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    min-height: 40px;
    padding: 0 4px;
}
.adv summary::-webkit-details-marker { display: none; }
.adv summary:hover { color: var(--ink); }
.adv[open] summary { margin-bottom: 20px; }
.adv[open] summary span { transform: rotate(45deg); }
.adv summary span {
    font-size: 18px; color: var(--ink-faint);
    transition: transform 0.2s ease;
}

/* Price card */
.price-card {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 2px solid var(--ink);
}
.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 8px;
}
.total {
    font-size: 40px;
    font-weight: 900;
    color: var(--ink);
    letter-spacing: -2px;
    line-height: 1;
}
.price-card > p {
    font-size: 13px;
    color: var(--ink-muted);
    margin: 8px 0 0;
}
.price-card > p b { color: var(--ink); font-weight: 700; }

.parts {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.parts > div {
    display: flex; justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
    color: var(--ink-muted);
}
.parts > div > span small {
    display: block;
    font-size: 11px;
    color: var(--ink-faint);
    margin-top: 2px;
}
.parts > div > strong { color: var(--ink); font-weight: 700; }

.mounting {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.mounting > div {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 13px; color: var(--ink-muted);
    font-weight: 600;
}
.mounting strong {
    font-size: 22px;
    color: var(--ink);
    font-weight: 800;
    letter-spacing: -0.5px;
}
.mounting p {
    font-size: 11px; color: var(--ink-faint);
    margin: 6px 0 0;
}

.turnkey {
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.turnkey summary {
    list-style: none;
    cursor: pointer;
    min-height: 48px;
    padding: 6px 0;
}
.turnkey summary::-webkit-details-marker { display: none; }
.tk-head {
    display: flex; justify-content: space-between;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--ink-faint); font-weight: 700;
}
.tk-total {
    font-size: 28px;
    font-weight: 900;
    color: var(--ink);
    margin-top: 6px;
    letter-spacing: -1px;
}
.tk-sub {
    font-size: 12px;
    color: var(--ink-faint);
    margin-top: 4px;
}
.tk-body {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}
.ex-row {
    display: flex; justify-content: space-between;
    padding: 6px 0;
    color: var(--ink-muted);
}
.ex-row span:last-child { color: var(--ink); font-weight: 600; white-space: nowrap; }

.btn-dl {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 52px;
    margin-top: 24px;
    border: 1.5px solid var(--border-strong);
    border-radius: 100px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    background: var(--surface);
    transition: all 0.2s ease;
}
.btn-dl:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
    transform: translateY(-1px);
}

.btn-cta {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 56px;
    margin-top: 12px;
    background: var(--ink);
    color: #fff;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}
.btn-cta:hover {
    background: var(--accent-soft);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(255,91,46,0.4);
}

/* ---------------------------------------------------------- REPORT */
.report { margin-top: 24px; }
.rep-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.rep-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}
.rep-card.full { margin-top: 20px; }
.rep-card h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    margin: 0 0 18px;
    font-weight: 700;
}
.rep-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.rep-card td {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--ink-2);
}
.rep-card td:first-child { color: var(--ink-muted); }
.rep-card td.num, .rep-card td:last-child {
    text-align: right;
    color: var(--ink);
    white-space: nowrap;
    font-weight: 700;
    font-family: var(--mono);
    font-size: 13px;
}
.rep-card tr.total td {
    border-top: 2px solid var(--ink);
    border-bottom: 0;
    padding-top: 18px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font);
}

.err-msg {
    color: var(--err);
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    font-size: 14px;
}

/* ---------------------------------------------------------- ENGINEERING */
.engineering {
    margin-top: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.eng-tabs {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.eng-tabs button {
    min-height: 44px;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-muted);
    border-radius: 100px;
    transition: all 0.2s ease;
}
.eng-tabs button:hover { color: var(--ink); }
.eng-tabs button[aria-pressed="true"] {
    background: var(--ink);
    color: #fff;
}

.eng-body {
    padding: 28px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 900px) {
    .eng-body { grid-template-columns: repeat(2, 1fr); }
}

.eng-section {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    min-width: 0;
    overflow: hidden;
}
.eng-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-muted);
    margin: 0 0 16px;
    font-weight: 700;
}
.eng-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.eng-section td {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.eng-section td:first-child {
    color: black;
    padding-right: 12px;
    width: 45%;
}
.eng-section td:last-child {
    text-align: right;
    font-weight: 600;
    font-family: var(--mono);
    font-size: 12px;
    white-space: normal;
}
.eng-section tr:last-child td { border-bottom: 0; }
.eng-note {
    font-size: 12px;
    color: var(--ink-faint);
    margin: 12px 0 0;
    line-height: 1.6;
}
.eng-body .ok { color: var(--ok); font-weight: 700; }
.eng-body .err { color: var(--err); font-weight: 700; }

.cta {
  margin-top: 80px;
  padding: 64px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.cta::before {
  content: '';
  position: absolute;
  top: -40%; right: -15%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,91,46,0.15) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}
.cta-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: start;
}
@media (min-width: 900px) {
  .cta-grid {
    grid-template-columns: 1fr 1.2fr;
    gap: 64px;
  }
}
.cta-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 20px;
}
.cta h2 {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.05;
  margin: 0 0 16px;
  color: #fff;
}
.cta h2 em {
  font-style: normal;
  color: var(--accent-soft);
}
.cta p {
  color: rgba(255,255,255,0.6);
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.6;
  max-width: 480px;
}
.cta-contacts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
@media (min-width: 600px) {
  .cta-contacts {
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }
}
.cta-phone {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  transition: color 0.2s ease;
}
.cta-phone:hover { color: var(--accent-soft); }
.cta-hours {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

/* Форма */
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lf-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 600px) {
  .lf-row { grid-template-columns: 1fr 1fr; }
}
.lf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.lf-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.02em;
}
.lf-optional {
  color: rgba(255,255,255,0.35);
  font-weight: 400;
}
.lf-field input,
.lf-field textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  color: #fff;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.lf-field textarea {
  resize: vertical;
  min-height: 88px;
  max-height: 240px;
  line-height: 1.55;
}
.lf-field input::placeholder,
.lf-field textarea::placeholder {
  color: rgba(255,255,255,0.35);
}
.lf-field input:hover,
.lf-field textarea:hover {
  border-color: rgba(255,255,255,0.22);
}
.lf-field input:focus,
.lf-field textarea:focus {
  border-color: var(--accent-soft);
  background: rgba(255,255,255,0.1);
}
.lf-field.is-error input,
.lf-field.is-error textarea {
  border-color: #FF5B5B;
  background: rgba(255,91,91,0.06);
}
.lf-field.is-valid input,
.lf-field.is-valid textarea {
  border-color: #1F9D55;
}
.lf-err {
  font-size: 12px;
  color: #FF8A8A;
  min-height: 14px;
  line-height: 1.4;
  display: none;
}
.lf-field.is-error .lf-err { display: block; }

.lf-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}
@media (min-width: 600px) {
  .lf-foot {
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }
}
.lf-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  background: var(--accent-soft);
  color: #fff;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.lf-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(255,91,46,0.5);
}
.lf-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.lf-submit-arrow {
  font-size: 18px;
  transition: transform 0.25s ease;
}
.lf-submit:hover:not(:disabled) .lf-submit-arrow {
  transform: translateX(3px);
}
.lf-submit.is-loading .lf-submit-arrow {
  display: none;
}
.lf-agree {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  line-height: 1.5;
  margin: 0;
}
.lf-agree a {
  color: rgba(255,255,255,0.65);
  text-decoration: underline;
  transition: color 0.2s ease;
}
.lf-agree a:hover { color: #fff; }

@media (max-width: 600px) {
  .cta { padding: 40px 24px; }
  .lf-submit { width: 100%; }
  .lf-foot { gap: 16px; }
}

/* ---------------------------------------------------------- FOOTER */
.ftr {
    margin-top: 80px;
    padding: 40px;
    border-top: 1px solid var(--border);
    color: var(--ink-faint);
    font-size: 13px;
    text-align: center;
}

/* ---------------------------------------------------------- RESPONSIVE */
@media (max-width: 1200px) {
    .workspace { grid-template-columns: 1fr; }
    .panel { position: static; }
    .viewer { height: 480px; }
}

@media (max-width: 768px) {
    .wrap { padding: 70px 24px 64px; }
    .hdr-in { padding: 14px 24px; }
    .viewer { height: 360px; }
    .metrics { grid-template-columns: 1fr 1fr; }
    .metrics > div { border-bottom: 1px solid var(--border); }
    .metrics > div:nth-child(2n) { border-right: 0; }
    .rep-grid { grid-template-columns: 1fr; }
    .lead { grid-template-columns: 1fr; }
    .roof-choice { grid-template-columns: 1fr; }
    .model-tools { flex-direction: column; align-items: flex-start; }
    .view-tools { flex-wrap: wrap; justify-content: center; }
    .cta { padding: 40px 24px; }
    .eng-body { padding: 20px; }
    .hero2 h1 { letter-spacing: -1.5px; }
}

.eng-body[hidden] { display: none !important; }

.rep-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
}
.rep-block h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: black;
    margin: 0 0 20px;
    font-weight: 700;
}
.rep-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}
.rep-table th {
    text-align: left;
    padding: 10px 0;
    border-bottom: 2px solid var(--ink);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
    font-weight: 700;
}
.rep-table th.num { text-align: right; }
.rep-table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    color: black;
    vertical-align: top;
}
.rep-table td small {
    color: black;
    font-size: 12px;
    line-height: 1.5;
}
.rep-table td.formula {
    font-family: var(--mono);
    font-size: 12px;
    color: black;
    line-height: 1.6;
}
.rep-table td.num {
    text-align: right;
    font-family: var(--mono);
    font-weight: 600;
    white-space: nowrap;
    color: var(--ink);
}
.rep-table td b { color: var(--ink); font-weight: 700; letter-spacing: normal;}
.rep-table tr.total td {
    border-top: 2px solid var(--ink);
    border-bottom: 0;
    padding-top: 16px;
    font-size: 15px;
    letter-spacing: normal;
}
.rep-table tr.total td b { font-size: 16px; }
.rep-material td:first-child { color: var(--ink); }
.rep-table-wrap { overflow-x: auto; }
.rep-note {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: black;
    line-height: 1.6;
}
.rep-note b { color: var(--ink-2); font-weight: 700; }
.rep-warn {
    margin-top: 16px;
    padding: 16px 20px;
    background: #FEF9EC;
    border: 1px solid #F4E5B8;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    color: #8A6D1F;
    line-height: 1.6;
}
.rep-warn b { color: #6B5415; font-weight: 700; }

/* ---------------------------------------------------------- TOAST */
#toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: var(--ink);
  color: #fff;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 20px 60px rgba(20,24,28,0.25), 0 4px 12px rgba(20,24,28,0.1);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.165,0.84,0.44,1), opacity 0.35s ease;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
}
.toast.ok .toast-icon { background: #1F9D55; }
.toast.err .toast-icon { background: #D93636; }
.toast.info .toast-icon { background: var(--accent-soft); }
.toast-body { flex: 1; min-width: 0; }
.toast-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
}
.toast-text {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.7);
  margin: 0;
  word-break: break-word;
}
.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  font-size: 18px;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.toast-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
@media (max-width: 600px) {
  #toast-root {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
  .toast { min-width: 0; max-width: none; width: 100%; }
}

/* Мобильный спойлер вида 3D */
.view-menu {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 4;
  max-width: 60%;
}
.view-menu summary {
  list-style: none;
  cursor: pointer;
}
.view-menu summary::-webkit-details-marker { display: none; }
.view-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.view-menu-label { color: var(--ink-muted); font-weight: 500; }
.view-menu-arrow {
  font-size: 10px;
  color: var(--ink-faint);
  transition: transform 0.2s ease;
}
.view-menu[open] .view-menu-arrow { transform: rotate(180deg); }

.view-menu .view-tools {
  position: static;
  transform: none;
  margin-top: 8px;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: var(--shadow-md);
  width: max-content;
}
.view-menu .view-tools button {
  justify-content: flex-start;
  padding: 0 14px;
  min-height: 36px;
  border-radius: 8px;
}

/* Десктоп: кнопки по центру снизу, спойлер отключён */
@media (min-width: 769px) {
  .view-menu {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: none;
    display: block;
  }
  .view-menu > summary { display: none !important; }
  .view-menu .view-tools {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    border-radius: 100px;
    padding: 6px;
    margin-top: 0;
    width: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .view-menu .view-tools button {
    justify-content: center;
    padding: 0 18px;
  }
  .view-menu[open] .view-tools { display: flex; }
  .view-menu:not([open]) .view-tools { display: flex; }


}


@media (max-width: 769px) {
    .rep-table td b { color: var(--ink); font-weight: 0; letter-spacing: normal;}
    .rep-table td{font-size: 11px;}
    .rep-table td.formula{font-size: 11px;}
    .rep-table td small{font-size: 11px;}
    .rep-table tr.total td{font-size: 11px;}
    .rep-block{padding: 15px;}
    .mounting strong{font-size: 14px;}
    .eng-section td:last-child{font-weight: 0 !important;}
}
