:root {
  --ink: #252b2a;
  --muted: #69716e;
  --line: #e0e5e2;
  --field: #aeb9b3;
  --accent: #24634b;
  --font: 'Golos Text', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-bottom: 110px; }
body { margin: 0; color: var(--ink); background: #fff; font: 400 16px/1.5 var(--font); }
button, input, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button { transition: border-color .15s, background-color .15s; }
a { color: inherit; text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:focus-visible, select:focus-visible { outline: none; }
[hidden], .hidden, .sel_imul { display: none !important; }
.disabled { pointer-events: none; opacity: .55; }
.skip-link { position: fixed; top: -80px; left: 20px; background: #fff; padding: 12px 20px; z-index: 10; }
.skip-link:focus { top: 8px; }
.site-header, .page { max-width: 1240px; margin: auto; padding: 0 40px; }
.site-header { height: 80px; display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); }
.header-caption { color: var(--muted); font-size: 14px; }
.toolbar-intro { padding: 38px 0 28px; }
h1 { margin: 0; font-size: 36px; line-height: 1.2; letter-spacing: -1.2px; font-weight: 500; }
.toolbar-intro p { color: var(--muted); margin: 12px 0 0; max-width: 72ch; }
.section-heading h2 { font-size: 16px; font-weight: 500; margin: 0 0 12px; }
.type-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.type-card { display: flex; align-items: center; position: relative; text-align: left; min-height: 64px; padding: 10px 30px 10px 12px; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.type-card > svg { flex: 0 0 36px; width: 36px; height: 36px; color: #737f79; }
.type-card strong { display: block; font-size: 16px; line-height: 1.3; font-weight: 400; }
.type-card small { display: none; }
.type-card:hover { border-color: #7b9487; }
.type-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.type-card.selected strong { font-weight: 500; }
.type-card.selected > svg { color: var(--accent); }
.type-check { display: none; position: absolute; right: 10px; top: 10px; width: 14px; height: 14px; color: var(--accent); }
.selected .type-check { display: block; }
.type-check svg { width: 14px; height: 14px; }
.workspace { display: grid; grid-template-columns: minmax(0,1fr) 352px; gap: 64px; align-items: start; margin-top: 36px; }
.configurator, .parameters-section, #calculator { min-width: 0; }
.calc_params > .row, .calc_left, .calc_right, .calc_inner { display: contents; }
.calc_forms { min-height: 220px; }
.calc-section__head { font-size: 20px; line-height: 1.35; font-weight: 500; margin-bottom: 24px; letter-spacing: -.3px; }
.calc-section__content { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 24px; align-items: start; }
.row_Calculator { min-width: 0; }
.row_Label { margin-bottom: 8px; line-height: 1.4; font-size: 16px; }
.row_Label label { display: block; }
.sel_wrap, .input { width: 100%; }
.parameter-select, .row_Calculator input[type=text] { width: 100%; height: 48px; min-width: 0; border: 1px solid var(--field); border-radius: 6px; background: #fff; padding: 0 12px; font-size: 16px; box-shadow: none; font-variant-numeric: tabular-nums; }
.parameter-select { padding-right: 28px; text-overflow: ellipsis; }
.parameter-select:hover, .row_Calculator input[type=text]:hover { border-color: #788b80; }
input::placeholder { color: #737d77; opacity: 1; }
.field-hint { display: block; color: var(--muted); font-size: 14px; margin-top: 7px; line-height: 1.4; }
.choice-group { display: flex; flex-wrap: wrap; gap: 6px; }
.choice-button { min-height: 48px; flex: 1 0 auto; padding: 8px 12px; font-size: 16px; background: #fff; border: 1px solid var(--field); border-radius: 6px; }
.choice-button:hover { border-color: var(--accent); }
.choice-button[aria-pressed=true] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); font-weight: 500; }
.choice-button:disabled { opacity: .4; cursor: not-allowed; }
.studio-detail { border-top: 1px solid var(--line); margin-top: 32px; }
.studio-detail + .studio-detail { margin-top: 0; }
.studio-detail summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; list-style: none; padding: 22px 0; font-size: 18px; font-weight: 500; cursor: pointer; }
.studio-detail summary::-webkit-details-marker { display: none; }
.studio-detail summary:hover { color: var(--accent); }
.detail-state { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); font-weight: 400; }
.detail-toggle { flex: 0 0 20px; width: 20px; height: 20px; position: relative; }
.detail-toggle::before, .detail-toggle::after { content: ''; position: absolute; top: 9px; left: 4px; width: 12px; height: 1.5px; background: currentColor; }
.detail-toggle::after { transform: rotate(90deg); }
.studio-detail[open] .detail-toggle::after { display: none; }
.studio-detail .calc-section__content { padding: 4px 0 28px; }
.gbtn__wrap { border-top: 1px solid var(--line); padding-top: 24px; }
.calculator-start-btn, #summary-calculate, #mobile-calculate { min-height: 48px; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 6px; padding: 12px 20px; font-weight: 500; }
.calculator-start-btn:hover, #summary-calculate:hover, #mobile-calculate:hover { background: #194d39; }
.form-footnote { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.row_Calculator input.error { border-color: #b63228; }
.row_Calculator label.error { display: block; font-size: 14px; color: #a02b23; margin-top: 6px; }
.summary-card { position: sticky; top: 24px; border: 1px solid var(--line); border-radius: 8px; padding: 24px; background: #fff; }
.summary-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.summary-heading h2 { margin: 0; font-weight: 500; font-size: 20px; letter-spacing: -.3px; }
.summary-status { font-size: 12px; color: var(--muted); }
#summary-type { margin: 0; font-size: 16px; font-weight: 500; }
.type-description { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.fence-scheme { position: relative; margin: 0 auto 16px; max-width: 250px; }
#fence-drawing svg { display: block; width: 100%; height: auto; }
.fence-scheme figcaption { display: none; }
.drawing-dimension { position: absolute; bottom: 0; left: 20%; width: 65%; text-align: center; background: #fff; font-size: 12px; color: var(--muted); }
.drawing-height { position: absolute; right: -4px; top: 45%; padding: 2px 0; background: #fff; font-size: 12px; color: var(--muted); }
.summary-specs { display: grid; grid-template-columns: 1fr 1fr; padding-bottom: 18px; border-bottom: 1px solid var(--line); gap: 16px; }
.summary-specs span { display: block; font-size: 14px; color: var(--muted); }
.summary-specs strong { display: block; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }
#summary-breakdown { margin: 18px 0; }
#summary-breakdown > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-top: 9px; }
#summary-breakdown dt { color: var(--muted); }
#summary-breakdown dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-panel { padding-top: 18px; }
.summary-price { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.summary-price > span { font-size: 14px; color: var(--muted); }
.summary-price > strong { display: block; font-size: 34px; letter-spacing: -1px; line-height: 1.3; font-weight: 500; font-variant-numeric: tabular-nums; margin: 6px 0; }
.summary-price small { font-size: 25px; }
.summary-price p { margin: 0; font-size: 14px; color: var(--muted); }
#summary-calculate { width: 100%; }
.summary-details { display: block; text-align: center; color: var(--accent); padding: 12px 0 0; font-size: 14px; }
.estimate-disclaimer { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.calculator_total { display: none; padding-top: 32px; margin-top: 36px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.result-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.result-heading h2 { font-size: 24px; font-weight: 500; letter-spacing: -.5px; margin: 0; }
.print-button { font-size: 14px; border: 1px solid var(--field); background: #fff; border-radius: 6px; min-height: 44px; padding: 8px 14px; }
.calc_header h3 { font-size: 14px; font-weight: 400; color: var(--muted); margin: 0 0 20px; }
.calculator_results { overflow-x: auto; }
.calc_box { margin: 0 0 28px; min-width: 0; }
.calculator_total table { border-collapse: collapse; table-layout: fixed; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.calculator_total th, .calculator_total td { border-bottom: 1px solid var(--line); padding: 10px 6px; text-align: right; }
.calculator_total th.number { width: 32px; }
.calculator_total th.count { width: 72px; }
.calculator_total th.unit { width: 64px; }
.calculator_total th.price { width: 96px; }
.calculator_total th.total { width: 144px; }
.calculator_total td.left { overflow-wrap: anywhere; }
.calculator_total td.summ b { display: block; white-space: nowrap; font-size: 12px; line-height: 1.5; }
.calculator_total th { font-size: 12px; font-weight: 500; color: var(--muted); }
.calculator_total .left, .calculator_total .name { text-align: left; }
.calculator_total tfoot td { font-weight: 500; }
.calculator_total tfoot td:first-child { text-align: left; }
.calculator_total tfoot i, .calculator_total tfoot b { font-style: normal; font-weight: 500; }
.calculator_total tfoot b { display: block; }
.calculator_total td.summ { white-space: nowrap; }
.calculator_total .plus { float: left; margin-right: 8px; }
.calculator_total .plus button { border: 1px solid var(--field); background: #fff; width: 32px; height: 32px; border-radius: 4px; }
.calculator_total input { width: 100%; min-width: 45px; border: 1px solid var(--field); border-radius: 4px; padding: 6px; font-size: 14px; }
.result-note { color: var(--muted); font-size: 14px; }
.loading { color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; margin-top: 48px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 14px; }
.footer-subtitle { margin-left: 12px; }
.mobile-total { display: none; }
@media (max-width: 1050px) {
  .site-header, .page { padding-left: 28px; padding-right: 28px; }
  .workspace { grid-template-columns: minmax(0,1fr) 310px; gap: 32px; }
  .summary-card { padding: 20px; }
  .type-card { gap: 8px; padding-left: 10px; }
  .type-card strong { font-size: 14px; }
  .type-card > svg { width: 28px; flex-basis: 28px; }
  .calc-section__content { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .site-header, .page { padding-left: 20px; padding-right: 20px; }
  .site-header { height: 68px; gap: 12px; }
  .toolbar-intro { padding: 28px 0 24px; }
  h1 { font-size: 30px; letter-spacing: -.8px; }
  .toolbar-intro p { font-size: 14px; max-width: 48ch; }
  .type-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .type-card { min-height: 66px; padding: 10px 20px 10px 10px; gap: 8px; }
  .type-card strong { font-size: 14px; }
  .type-card > svg { flex-basis: 30px; width: 30px; }
  .type-check { right: 6px; top: 6px; width: 12px; }
  .type-check svg { width: 12px; }
  .workspace { display: block; margin-top: 32px; }
  .calc-section__content { grid-template-columns: 1fr; gap: 22px; }
  .studio-detail { margin-top: 28px; }
  .summary-card { position: static; margin-top: 36px; padding: 24px; }
  .fence-scheme { max-width: 250px; margin-left: auto; margin-right: auto; }
  .calculator-start-btn { width: 100%; }
  .mobile-total { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; background: #fff; border-top: 1px solid var(--line); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
  .mobile-total span { display: block; color: var(--muted); font-size: 12px; }
  .mobile-total strong { display: block; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
  #mobile-calculate { padding: 10px 18px; font-size: 14px; }
  .site-footer { flex-direction: column; gap: 8px; margin-top: 36px; font-size: 12px; }
  .footer-subtitle { margin-left: 6px; }
}
@media screen and (max-width: 760px) {
  .calculator_results { overflow: visible; }
  .calc_box { min-width: 0; }
  .calculator_total table, .calculator_total thead, .calculator_total tbody, .calculator_total tfoot { display: block; }
  .calculator_total thead tr { display: block; }
  .calculator_total thead th { display: none; }
  .calculator_total thead th.name { display: block; width: auto; text-align: left; font-size: 16px; color: var(--ink); padding: 12px 0; }
  .calculator_total tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .calculator_total tbody tr:empty { display: none; }
  .calculator_total tbody td { display: block; border: 0; text-align: left; padding: 0; white-space: normal; font-size: 14px; overflow-wrap: anywhere; }
  .calculator_total tbody td.summ { white-space: nowrap; }
  .calculator_total tbody td:first-child { display: none; }
  .calculator_total tbody td:nth-child(2) { grid-column: 1 / -1; font-size: 16px; padding-bottom: 4px; }
  .calculator_total tbody td:nth-child(n+3)::before { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
  .calculator_total tbody td:nth-child(3)::before { content: 'Кол-во'; }
  .calculator_total tbody td:nth-child(4)::before { content: 'Ед.'; }
  .calculator_total tbody td:nth-child(5)::before { content: 'Цена, ₽'; }
  .calculator_total tbody td:nth-child(6)::before { content: 'Сумма, ₽'; }
  .calculator_total tfoot tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; border-bottom: 1px solid var(--line); padding: 14px 0; }
  .calculator_total tfoot td { min-width: 0; overflow-wrap: anywhere; border: 0; text-align: left; padding: 0; font-size: 14px; }
  .calculator_total .plus { float: none; display: inline-block; vertical-align: middle; }
}
@media (max-width: 360px) {
  .site-header, .page { padding-left: 16px; padding-right: 16px; }
  .type-card { gap: 6px; }
  .type-card strong { font-size: 13px; }
  .type-card > svg { width: 24px; flex-basis: 24px; }
  .mobile-total { padding-left: 16px; padding-right: 16px; gap: 8px; }
  .mobile-total strong { font-size: 20px; }
  .summary-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  body { padding: 0; color: #000; }
  .site-header, .toolbar-intro, .type-section, #calculator_form, .summary-card, .site-footer, .print-button, .mobile-total, .skip-link, .plus { display: none !important; }
  .page { max-width: none; padding: 0; }
  .workspace, .configurator { display: block; margin: 0; }
  .calculator_total { margin: 0; padding: 0; border: 0; }
  .calculator_results { overflow: visible; }
  .calc_box { min-width: 0; break-inside: avoid; }
  .calculator_total table { font-size: 10px; }
  .calculator_total th { font-size: 10px; }
  .calculator_total td, .calculator_total th { padding: 6px; }
}
