:root {
  color-scheme: light;
  --orange: #f26a21;
  --orange-dark: #b84812;
  --anthracite: #292e32;
  --anthracite-2: #3e454a;
  --ink: #1b2227;
  --muted: #626d74;
  --paper: #f3f4f4;
  --white: #fff;
  --line: #d5d9db;
  --green: #16734b;
  --red: #b83232;
  --blue: #0b5d83;
  --radius: 5px;
  --shadow: 0 22px 58px rgba(26, 31, 35, .12);
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-size: .95rem; line-height: 1.48; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 64px;
  padding: 9px clamp(18px, 4vw, 54px);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: .96rem; letter-spacing: .01em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.topbar nav { display: flex; gap: clamp(14px, 2vw, 26px); font-size: .84rem; font-weight: 600; }
.topbar nav a { text-decoration: none; }
.topbar nav a:hover { color: var(--orange-dark); }

.hero {
  display: block;
  align-items: center;
  gap: clamp(30px, 5vw, 78px);
  min-height: min(720px, calc(100vh - 64px));
  padding: clamp(48px, 6vw, 78px) clamp(18px, 4vw, 54px);
  color: var(--white);
  background: linear-gradient(118deg, #1c2125 0%, #343b40 62%, #202529 100%);
}
.hero-copy { max-width: 1080px; }

.eyebrow { margin: 0 0 9px; color: var(--orange); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: normal; word-break: normal; }
h1, h2, h3 { hyphens: none; }
p { hyphens: auto; }
h1 { margin: 0; max-width: 700px; font-size: clamp(2rem, 4vw, 3.65rem); font-weight: 700; line-height: 1.04; letter-spacing: -.025em; }
h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.65rem); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 1.04rem; font-weight: 700; line-height: 1.25; }
.lead { max-width: 720px; margin: 20px 0 0; color: #d6dadd; font-size: clamp(.98rem, 1.4vw, 1.12rem); }
.hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 26px; background: rgba(255, 255, 255, .17); }
.hero-facts div { padding: 12px 14px; background: rgba(255, 255, 255, .07); border-top: 3px solid var(--orange); }
.hero-facts strong, .hero-facts span { display: block; }
.hero-facts strong { font-size: 1.08rem; font-weight: 700; }
.hero-facts span { margin-top: 3px; color: #cdd2d5; font-size: .84rem; }

.section { padding: clamp(48px, 6vw, 78px) clamp(18px, 4vw, 54px); scroll-margin-top: 64px; }
.section-head { max-width: 920px; margin-bottom: 28px; }
.section-head p:not(.eyebrow) { max-width: 820px; margin: 13px 0 0; color: var(--muted); font-size: .98rem; }
.section-head.compact { margin-bottom: 28px; }

.selection-section { background: var(--white); }
.variant-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 1320px; }
.variant-card { position: relative; display: grid; gap: 6px; min-height: 220px; padding: 22px; border: 1px solid var(--line); background: #f8f9f9; cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s; }
.variant-card:hover { border-color: #9ba2a6; transform: translateY(-2px); }
.variant-card.selected { border-color: var(--orange); box-shadow: 0 16px 42px rgba(242, 106, 33, .14); }
.variant-card input { position: absolute; opacity: 0; pointer-events: none; }
.variant-check { position: absolute; top: 20px; right: 20px; width: 22px; height: 22px; border: 2px solid #929a9f; border-radius: 50%; background: var(--white); }
.selected .variant-check { border: 6px solid var(--orange); }
.variant-type { color: var(--orange-dark); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.variant-card > strong { padding-right: 38px; font-size: clamp(1.12rem, 1.7vw, 1.48rem); line-height: 1.18; }
.variant-card > span:not(.variant-check):not(.variant-type):not(.mini-mrb) { color: var(--muted); }
.variant-data { margin-top: 4px; font-size: .84rem; }
.product-preview { display: block; width: 100%; max-width: 520px; height: auto; margin-top: auto; padding-top: 12px; }

.calculator-section { background: #eceeee; }
.calculator-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(420px, 1.15fr); gap: 24px; align-items: stretch; }
.input-card, .result-card { padding: clamp(20px, 2.5vw, 28px); background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); }
.input-card > label { display: block; margin-bottom: 7px; font-weight: 700; }
.input-with-unit { display: grid; grid-template-columns: 1fr auto; }
.input-with-unit input { min-width: 0; height: 50px; padding: 9px 13px; color: var(--ink); border: 2px solid #aeb5b9; border-right: 0; border-radius: var(--radius) 0 0 var(--radius); font-size: 1.05rem; }
.input-with-unit span { display: grid; place-items: center; min-width: 58px; color: var(--white); background: var(--anthracite); border-radius: 0 var(--radius) var(--radius) 0; font-weight: 800; }
.input-with-unit input:focus { outline: 3px solid rgba(242, 106, 33, .22); border-color: var(--orange); }
.field-help { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.fixed-values { display: grid; gap: 1px; margin-top: 25px; background: var(--line); border: 1px solid var(--line); }
.fixed-values div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 13px; background: #f7f8f8; }
.fixed-values span { color: var(--muted); }
.button-row { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 24px; }
button { min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: var(--radius); font-size: .9rem; font-weight: 700; }
.primary { color: var(--white); background: var(--orange-dark); }
.primary:hover { background: #8f360c; }
.secondary { color: var(--ink); background: var(--white); border-color: #aeb5b9; }
.secondary:hover { border-color: var(--anthracite); }
.message { display: none; margin-top: 18px; padding: 13px 15px; border-left: 5px solid var(--blue); background: #eef6fa; font-weight: 700; }
.message.error { display: block; color: #7d2020; border-color: var(--red); background: #fff0f0; }
.message.ok { display: block; color: #125737; border-color: var(--green); background: #eef9f3; }
.message.warning { display: block; color: #7b360a; border-color: var(--orange-dark); background: #fff3e8; }

.result-card { color: var(--white); background: var(--anthracite); }
.result-status { display: inline-flex; margin-bottom: 22px; padding: 6px 10px; color: #d9dddf; border: 1px solid #626a6f; font-size: .86rem; font-weight: 800; }
.result-status.ok { color: #b9f0d2; border-color: #438164; }
.result-status.error { color: #ffd0d0; border-color: #a85b5b; }
.result-status.warning { color: #ffd7be; border-color: #d9783d; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: #555d62; }
.result-grid div { min-height: 78px; padding: 13px; background: #343a3e; }
.result-grid span, .result-grid strong { display: block; }
.result-grid span { color: #bdc4c8; font-size: .82rem; }
.result-grid strong { margin-top: 5px; font-size: 1.08rem; font-weight: 700; }
.formula { margin-top: 20px; padding-top: 18px; color: #cbd0d3; border-top: 1px solid #555d62; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }

.visual-section { background: var(--white); }
.visual-card { border: 1px solid var(--line); box-shadow: var(--shadow); }
.ob-adjuster { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 15px; background: var(--white); border-bottom: 1px solid var(--line); }
.ob-adjuster > div:first-child { display: grid; gap: 3px; }
.ob-adjuster span { color: #596268; font-size: .8rem; }
.ob-stepper { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.ob-stepper output { min-width: 108px; text-align: center; font-size: .86rem; font-weight: 700; color: var(--ink); }
.step-button { min-width: 72px; padding: 8px 11px; color: var(--white); background: var(--anthracite); border: 1px solid var(--anthracite); border-radius: 4px; font-size: .82rem; font-weight: 700; cursor: pointer; }
.step-button:hover:not(:disabled) { background: var(--orange-dark); border-color: var(--orange-dark); }
.step-button:disabled { color: #899095; background: #e7e9ea; border-color: #d5d9db; cursor: not-allowed; }
.visual-legend { display: flex; flex-wrap: wrap; gap: 12px 22px; padding: 12px 15px; background: #f4f5f5; border-bottom: 1px solid var(--line); color: #444c51; font-size: .78rem; font-weight: 600; }
.visual-legend span { display: inline-flex; align-items: center; gap: 8px; }
.visual-legend i { display: inline-block; width: 22px; height: 12px; }
.legend-wall { background: #5e666b; }
.legend-ob { border-radius: 4px; background: #3c4246; }
.legend-mrb { background: var(--orange); }
.legend-gap { border-top: 3px solid var(--blue); }
.visual-scroll { overflow-x: auto; padding: 28px 22px 32px; background: #e8ebec; scrollbar-color: var(--orange-dark) #cfd4d7; }
.visual-track { position: relative; display: flex; align-items: flex-end; min-width: 100%; min-height: 255px; padding: 55px 20px 52px; background: linear-gradient(180deg, #fff, #f5f6f6); }
.visual-track.empty { display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.visual-track::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 50px; height: 8px; background: #c7cdd0; z-index: 0; }
.wall { position: relative; z-index: 2; flex: 0 0 46px; height: 132px; border: 2px solid #4f565a; background: repeating-linear-gradient(0deg, transparent 0 20px, rgba(55,61,65,.65) 21px 23px), repeating-linear-gradient(90deg, #9aa1a5 0 26px, #767e83 27px 29px); box-shadow: 8px 7px 0 #596166, 0 10px 18px rgba(29,34,38,.18); }
.wall::before { content: ""; position: absolute; right: -10px; top: 6px; width: 9px; height: 124px; background: #555d62; transform: skewY(40deg); transform-origin: left top; }
.wall span { position: absolute; left: 50%; bottom: -35px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 800; }
.gap { position: relative; z-index: 5; display: grid; place-items: start center; flex: 0 0 auto; min-width: 95px; height: 132px; margin-bottom: 0; border-top: 3px solid var(--blue); color: #124967; font-size: 12px; font-weight: 800; }
.gap::before, .gap::after { content: ""; position: absolute; top: -8px; width: 2px; height: 13px; background: var(--blue); }
.gap::before { left: 0; }.gap::after { right: 0; }
.gap span { margin-top: -30px; padding: 3px 5px; background: #fff; white-space: nowrap; }
.gap.warning { border-top-color: var(--red); color: #9b1f1f; }
.gap.warning::before, .gap.warning::after { background: var(--red); }
.gap.warning span { color: #9b1f1f; background: #fff0f0; border: 1px solid #d88; font-weight: 900; }
.ob { position: relative; z-index: 8; flex: 0 0 24px; width: 24px; min-width: 24px; max-width: 24px; height: 132px; margin-bottom: 0; overflow: visible; }
.ob-shaft { position: absolute; z-index: 3; left: 50%; bottom: 5px; width: 24px; height: 120px; margin-left: -12px; border: 2px solid #202529; border-radius: 9px 9px 2px 2px; background: linear-gradient(90deg, #282e32, #596166 55%, #252a2e); box-shadow: 4px 7px 9px rgba(28,33,36,.25); box-sizing: border-box; }
.ob-shaft::before { content: ""; position: absolute; left: 2px; right: 2px; top: 4px; height: 10px; border-radius: 50%; background: #697176; opacity: .65; }
.ob-shaft::after { content: ""; position: absolute; z-index: 4; left: 50%; bottom: -6px; width: 34px; height: 12px; transform: translateX(-50%); border: 2px solid #202529; border-radius: 50%; background: radial-gradient(ellipse at center, #4f575c 0 42%, #242a2e 45% 68%, #697176 70% 100%); box-sizing: border-box; }
.ob-base { position: absolute; z-index: 1; left: 50%; bottom: 0; width: 76px; height: 39px; margin-left: -38px; clip-path: polygon(25% 0, 75% 0, 100% 35%, 92% 75%, 68% 100%, 32% 100%, 8% 75%, 0 35%); background: repeating-conic-gradient(from 10deg, #2e3438 0 8deg, #626a6f 9deg 16deg); transform: perspective(80px) rotateX(58deg); transform-origin: center bottom; box-shadow: 0 8px 10px rgba(28,33,36,.25); }
.ob-base::after { content: ""; position: absolute; inset: 10px 22px; border: 3px solid #ef6c22; border-radius: 50%; background: #454c50; }
.ob-label { position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%); font-size: 12px; font-weight: 800; line-height: 1.15; text-align: center; white-space: nowrap; }
.mrb { position: relative; z-index: 2; display: grid; flex: 0 0 auto; min-width: 52px; height: 132px; margin-bottom: 0; align-content: end; justify-items: center; }
.mrb-platform { position: absolute; left: -21px; right: -21px; bottom: 0; height: 58px; clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%); background: linear-gradient(180deg, #7e868b, #4c5357); border-bottom: 3px solid #343a3e; box-shadow: 0 11px 14px rgba(28,33,36,.23); }
.mrb-platform::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 24%, rgba(35,40,43,.65) 24.5% 25.5%, transparent 26% 49%, rgba(35,40,43,.65) 49.5% 50.5%, transparent 51% 74%, rgba(35,40,43,.65) 74.5% 75.5%, transparent 76%), linear-gradient(transparent 48%, rgba(35,40,43,.75) 49% 52%, transparent 53%); }
.mrb-platform i { position: absolute; top: 3px; bottom: 3px; width: 2px; background: rgba(210,214,216,.25); }
.mrb-platform i:nth-child(1) { left: 18%; }.mrb-platform i:nth-child(2) { left: 50%; }.mrb-platform i:nth-child(3) { left: 82%; }
.mrb-plates { position: absolute; z-index: 2; left: 0; right: 0; bottom: 40px; display: flex; align-items: flex-end; justify-content: center; }
.mrb-plate { position: relative; flex: 0 0 auto; height: 78px; border: 2px solid var(--orange-dark); clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%); background: linear-gradient(90deg, #d65315, #fa813d 58%, #c7460b); box-shadow: 4px 5px 7px rgba(34,39,42,.28); }
.mrb-plate b { position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); color: #fff; font-size: 9px; white-space: nowrap; }
.mrb-plate::after { content: ""; position: absolute; left: 8px; right: 8px; top: 11px; bottom: 10px; border: 2px solid rgba(255,183,138,.55); border-bottom-width: 5px; }
.mrb .gap { height: 78px; }
.nearest-ob-dimension { position: absolute; z-index: 10; top: -43px; height: 18px; border-top: 3px solid #8b4b08; color: #713b05; font-size: 12px; font-weight: 900; text-align: center; box-sizing: border-box; }
.nearest-ob-dimension::before, .nearest-ob-dimension::after { content: ""; position: absolute; top: -8px; width: 2px; height: 14px; background: #8b4b08; }
.nearest-ob-dimension::before { left: 0; }.nearest-ob-dimension::after { right: 0; }
.nearest-ob-dimension span { position: relative; top: -31px; display: inline-block; padding: 3px 7px; color: #713b05; background: #fff4e8; border: 1px solid #c47a2d; white-space: nowrap; }
.mrb.din .mrb-platform { left: -98px; right: -98px; clip-path: polygon(8% 0, 43% 0, 43% 14%, 57% 14%, 57% 0, 92% 0, 100% 100%, 0 100%); }
.mrb.din::before, .mrb.din::after { content: ""; position: absolute; z-index: 7; bottom: 1px; width: 48px; height: 43px; border: 2px dashed #f6a574; background: rgba(232,235,236,.5); box-sizing: border-box; }
.mrb.din::before { left: -101px; border-radius: 0 10px 10px 0; }.mrb.din::after { right: -101px; border-radius: 10px 0 0 10px; }
.mrb-label { position: absolute; bottom: -24px; white-space: nowrap; font-size: 12px; font-weight: 800; text-align: center; }
.detail-panel { padding: 16px; background: var(--white); border-top: 1px solid var(--line); font-size: .88rem; }
.detail-panel h3 { margin-bottom: 10px; }
.detail-panel ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 0; padding: 0; list-style: none; }
.detail-panel li { padding: 8px 0; color: #465056; border-bottom: 1px dashed var(--line); }
.detail-panel li.highlight-measure { color: #713b05; background: #fff4e8; border: 1px solid #e2b177; padding-inline: 10px; font-weight: 700; }

.notes-section { background: #eceeee; }
.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.notes-grid article { padding: 20px; background: var(--white); border-top: 3px solid var(--orange); }
.notes-grid article > span { color: var(--orange-dark); font-weight: 800; }
.notes-grid h3 { margin-top: 13px; }
.notes-grid p { margin-bottom: 0; color: var(--muted); font-size: .9rem; }

footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px clamp(18px, 4vw, 54px); color: #cbd0d3; background: var(--anthracite); font-size: .88rem; }
footer p { margin: 0; }
footer a { color: #ffb17f; }
footer button { color: var(--white); background: transparent; border-color: #6c7479; }

@media (max-width: 980px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar nav { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .calculator-layout { grid-template-columns: 1fr; }
  .hero { min-height: 0; }
}

@media (max-width: 720px) {
  h1 { font-size: clamp(1.75rem, 8vw, 2.2rem); line-height: 1.08; }
  .hero-facts, .variant-grid, .notes-grid, .result-grid, .detail-panel ul { grid-template-columns: 1fr; }
  .variant-card { min-height: 0; }
  .calculator-layout { display: block; }
  .result-card { margin-top: 20px; }
  .ob-adjuster { align-items: stretch; flex-direction: column; }
  .ob-stepper { justify-content: space-between; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .topbar { padding-inline: 15px; }
  .topbar nav { gap: 18px; }
  .hero, .section { padding-inline: 15px; }
  .hero-facts { display: none; }
  .button-row button { width: 100%; }
  .fixed-values div { align-items: flex-start; flex-direction: column; gap: 2px; }
}
