/* Layout follows the available viewport, including folded and split-screen use. */
:root {
  --page-gutter: clamp(12px, 3.5vw, 32px);
  --page-left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
  --page-right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
  --header-space: 88px;
  --mobile-action-space: 0px;
}
html {
  scroll-padding-top: calc(var(--header-space) + env(safe-area-inset-top, 0px));
  scroll-padding-bottom: calc(var(--mobile-action-space) + env(safe-area-inset-bottom, 0px) + 16px);
}
body { padding-bottom: env(safe-area-inset-bottom, 0px); }
.opora-home, .service-page {
  padding-bottom: calc(var(--mobile-action-space) + env(safe-area-inset-bottom, 0px));
}
.wrap { --content-max: 1160px; }
.header-inner { --content-max: 1320px; }
.detail-page { --content-max: 960px; }
.wrap, .header-inner {
  width: calc(100% - var(--page-left) - var(--page-right));
  max-width: var(--content-max);
  margin-left: max(var(--page-left), calc((100% - var(--content-max) + var(--page-left) - var(--page-right)) / 2));
  margin-right: auto;
}
.site-header { padding-top: env(safe-area-inset-top, 0px); }
.header-inner { height: auto; min-height: 76px; padding-block: 9px; }
.detail-site-header .header-inner { height: auto; min-height: 72px; }
.header-inner > *, .hero > *, .calculator-card > *, .price-grid > *,
.services-grid > *, .contacts-grid > *, .contact-bottom > *, .form-two > *,
.steps > *, .pile-tables > *, .request-actions > *, .draft-tools > * { min-width: 0; }
.brand { max-width: 100%; min-height: 44px; }
.brand > span { min-width: 0; }
.brand small { font-size: 11px; }
.header-phone { min-height: 44px; }
.header-phone small { font-size: 11px; }
.mobile-nav {
  padding-inline: var(--page-left) var(--page-right);
  max-height: calc(100vh - var(--header-space) - env(safe-area-inset-top, 0px));
  max-height: calc(100dvh - var(--header-space) - env(safe-area-inset-top, 0px));
  overflow: auto;
  overscroll-behavior: contain;
}
.mobile-nav a { min-height: 44px; padding-block: 12px; }
.button, .header-cta, .scene-toggle, .requisite-copy, .service-actions button,
.service-actions a, .note-link, .summary-phone, .dialog-phone,
.detail-back, .related-links a, .contact-phone, .hero-contact-number, .hero-contact-channel {
  min-height: 44px;
  max-width: 100%;
}
.button { white-space: normal; overflow-wrap: anywhere; text-align: center; }
.note-link, .detail-back, .related-links a { display: inline-flex; align-items: center; }
.icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
.requisite-copy { min-height: 44px; }
.scene-toggle { padding-inline: 14px; }
.footer a { display: inline-flex; align-items: center; min-height: 44px; white-space: normal; }
input, select, textarea { font-size: 16px; scroll-margin-block: 18px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { max-width: 100%; }
.checkbox-row, .consent-row { min-height: 44px; align-items: center; }
.checkbox-row input, .consent-row input { flex-shrink: 0; }
.checkbox-row > span, .consent-row > span { min-width: 0; }
.hero h1, .detail-page h1, h2, h3, .breadcrumbs, .detail-page .eyebrow,
.request-status, .request-estimate, .request-callout, .related-links a {
  overflow-wrap: anywhere;
}
.contact-phone { gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.requisite-item, .requisite-item dd, .contact-details, .detail-requisites { min-width: 0; }
.requisite-value, .contact-details .diadoc-id {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}
.service-card { display: flex; flex-direction: column; }
.service-body { min-width: 0; }
.service-media { flex-shrink: 0; }
.estimate-lines dt, .estimate-lines dd { min-width: 0; overflow-wrap: anywhere; }
.estimate-lines dd { flex-shrink: 0; }
.summary-phone { flex-wrap: wrap; line-height: 1.5; }
.total-block strong { max-width: 100%; overflow-wrap: anywhere; }
.pile-tables table { width: 100%; table-layout: fixed; font-variant-numeric: tabular-nums; }
.pile-tables th, .pile-tables td { overflow-wrap: anywhere; }
.pile-tables th:first-child, .pile-tables td:first-child { width: 58%; }
.pile-tables td { padding-block: 12px; }
.simple-prices dd, .simple-prices dd small { white-space: normal; }
.detail-photo { height: auto; }

/* Keep the complete request scrollable when browser chrome or a keyboard changes height. */
dialog {
  width: min(620px, calc(100% - var(--page-left) - var(--page-right)));
  margin-left: max(var(--page-left), calc((100% - 620px + var(--page-left) - var(--page-right)) / 2));
  margin-right: auto;
  max-width: 100%;
  max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  padding: clamp(18px, 4vw, 30px);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 18px;
  -webkit-overflow-scrolling: touch;
}
@supports (height: 100dvh) {
  dialog {
    max-height: calc(var(--request-viewport-height, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  }
}
dialog h2 { font-size: clamp(26px, 5vw, 32px); }
.dialog-top { align-items: center; }
.dialog-top .eyebrow { min-width: 0; line-height: 1.5; }
.request-actions, .draft-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.request-actions > .button, .request-actions > button,
.draft-tools > .button, .draft-tools > button {
  flex: 1 1 210px;
  min-height: 48px;
  margin: 0;
}
.request-alternatives { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.request-alternatives p { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.request-alternatives .button { margin-top: 10px; }
.request-callout {
  padding: 14px 16px;
  border: 1px solid #e9dba5;
  border-radius: 14px;
  background: #fffae7;
  color: #51482b;
  font-size: 15px;
  line-height: 1.6;
}
.request-callout > span { min-width: 0; }
.request-draft {
  display: block;
  width: 100%;
  min-height: 180px;
  max-width: 100%;
  padding: 14px;
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  resize: vertical;
}
.draft-tools > button { max-width: 100%; white-space: normal; }
.draft-tools .button { min-width: 0; }
.hero-contact-brief > * { min-width: 0; }
.hero-contact-channel { overflow-wrap: anywhere; }

@media (min-width: 1101px) {
  .mobile-nav { display: none; }
}

/* The menu collapses before tablet widths can squeeze navigation or phone details. */
@media (max-width: 1100px) {
  .desktop-nav, .header-cta { display: none; }
  .header-inner { gap: 16px; min-height: 72px; }
  .header-phone { margin-left: auto; font-size: 14px; }
  .header-phone > .icon { display: none; }
  .menu-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    padding: 10px;
  }
  .menu-toggle span { width: 22px; margin-block: 3px; }
  .price-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero-visual { margin-right: 0; min-width: 0; }
  .hero h1 { font-size: clamp(40px, 5vw, 55px); }
  .hero-actions .button { flex: 1 1 230px; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .services-grid { gap: 20px; }
  .service-body { padding: 22px; }
  .service-body h3 { font-size: clamp(24px, 2.7vw, 28px); }
  .service-body p { font-size: 16px; }
  .contact-card { padding: 24px; }
  .contact-phone, .detail-contacts .contact-phone { font-size: clamp(23px, 2.65vw, 28px); }
  .contact-actions .button { flex: 1 1 210px; }
}
@media (max-width: 840px) {
  .calculator-card { grid-template-columns: minmax(0, 1fr); }
  .calc-summary { padding: 0; border-left: 0; border-top: 1px solid var(--line); }
  .estimate-scene { aspect-ratio: 2.15 / 1; max-height: 320px; }
  .estimate-content { padding: 12px clamp(19px, 4vw, 32px) 28px; }
  .calc-summary h3 { max-width: none; }
  .form-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero h1 { font-size: clamp(36px, 7.6vw, 58px); }
  .hero-visual { width: 100%; height: clamp(250px, 44vw, 350px); margin: 22px 0 0; }
  .machine-stage { inset: 34px 0 54px; }
  .machine-ghost { top: 0; left: 12%; font-size: clamp(74px, 18vw, 128px); }
  .machine-halo { top: 0; right: auto; left: 50%; margin-left: -125px; width: 250px; height: 250px; }
  .machine-spec { bottom: 40px; flex-wrap: wrap; gap: 6px 16px; }
  .scene-controls { bottom: -10px; flex-direction: row; }
  .scroll-cue { display: none; }
  .hero-note { grid-column: 1; margin-top: 30px; }
  .contacts-grid, .contact-bottom { grid-template-columns: minmax(0, 1fr); }
  .contact-phone, .detail-contacts .contact-phone { font-size: clamp(24px, 5vw, 31px); }
  .contact-actions .button { flex: 0 1 auto; }
  .hero-actions .button { flex: 1 1 230px; }
}

/* A coarse-pointer Fold or tablet can use the same reachable bottom actions as a phone. */
.mobile-actions { display: none; }
@media (max-width: 700px), (max-width: 900px) and (pointer: coarse) {
  :root { --mobile-action-space: 88px; }
  .mobile-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 8px;
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    padding: 10px var(--page-right) calc(10px + env(safe-area-inset-bottom, 0px)) var(--page-left);
    border-top: 1px solid #dedee4;
    background: #fffffff0;
    backdrop-filter: blur(20px);
  }
  .mobile-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 48px;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    background: #f5c518;
    color: #1c1c1e;
  }
  .mobile-actions a:last-child { background: #252527; color: white; }
  .mobile-actions .icon { width: 18px; height: 18px; }
  .copy-toast { bottom: calc(var(--mobile-action-space) + env(safe-area-inset-bottom, 0px) + 8px); }
}
@media (max-width: 600px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button { flex: 0 0 auto; width: 100%; min-height: 52px; font-size: 16px; }
  .hero-actions .button.secondary { font-size: 16px; }
  .hero-note { align-items: flex-start; }
  .hero-note > div { min-width: 0; }
  .hero-note .note-link { margin-left: 0; }
  .service-actions { align-items: stretch; }
  .service-actions a { padding-inline: 4px; }
  .contact-actions .button { flex: 1 1 100%; width: 100%; }
  .contact-card, .contact-details { padding: clamp(18px, 4.8vw, 26px); }
  .contact-details .diadoc-id { font-size: 14px; }
  .partnership-line { align-items: stretch; }
  .partnership-line > div { max-width: 100%; }
  .detail-page h1 { font-size: clamp(30px, 7.4vw, 40px); }
  .detail-page h2 { font-size: clamp(26px, 6vw, 32px); }
  .detail-actions { flex-direction: column; align-items: stretch; }
  .detail-actions .button { width: 100%; min-height: 48px; }
  .detail-figure { margin-inline: 0; }
  .detail-photo { border-radius: 18px; }
  .related-links a { width: 100%; justify-content: space-between; }
  .footer { align-items: flex-start; gap: 6px 18px; }
}
@media (max-width: 480px) {
  .pile-tables { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .pile-tables h4 { min-height: 0; font-size: 16px; }
  .pile-tables table { font-size: 16px; }
  .pile-tables th { font-size: 13px; }
  .simple-prices > div { display: block; }
  .price-group .simple-prices dt { max-width: none; font-size: 15px; }
  .simple-prices dd { margin-top: 8px; text-align: left; font-size: 20px; }
  .simple-prices dd small { display: inline; margin-left: 5px; font-size: 12px; }
  .checkbox-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 7px 10px; }
  .checkbox-row b { grid-column: 2; margin-left: 0; }
  .checkbox-row input { align-self: start; margin-top: 3px; }
}

/* Two header rows keep the complete consultation label and phone legible at 280px. */
@media (max-width: 420px) {
  :root { --header-space: 122px; }
  .opora-home .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    column-gap: 12px;
    row-gap: 2px;
    padding-block: 7px;
  }
  .opora-home .brand { grid-column: 1; grid-row: 1; justify-self: start; gap: 9px; }
  .opora-home .brand-mark { width: 38px; height: 38px; }
  .opora-home .brand b { font-size: 29px; }
  .opora-home .brand small { font-size: 11px; }
  .opora-home .menu-toggle { grid-column: 2; grid-row: 1; }
  .opora-home .header-phone {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    margin: 0;
    font-size: 15px;
    min-height: 44px;
    line-height: 1.3;
  }
  .opora-home .header-phone small { font-size: 11px; margin-bottom: 2px; }
  .detail-site-header .header-inner { gap: 10px; }
  .detail-site-header .brand-mark { width: 34px; height: 34px; }
  .detail-site-header .brand { gap: 7px; }
  .detail-site-header .brand b { font-size: 27px; }
  .detail-site-header .brand small { font-size: 10px; }
  .detail-site-header .detail-back { gap: 4px; font-size: 12px; flex-shrink: 0; }
  .detail-site-header .detail-back .icon { width: 16px; height: 16px; }
  .hero { padding-top: 24px; }
  .hero h1 { font-size: clamp(32px, 9.3vw, 39px); letter-spacing: -.045em; }
  .hero-description { font-size: 16px; }
  .machine-label { font-size: 11px; max-width: 100%; }
  .hero-note { padding: 18px; }
  .hero-note .note-icon { display: none; }
  .hero-note .note-link { margin-left: 0; font-size: 14px; }
  .section-heading h2 { font-size: clamp(29px, 8vw, 36px); }
  .calc-fields { padding: 22px 18px; }
  .estimate-content { padding: 12px 18px 24px; }
  .calc-summary h3 { font-size: 22px; }
  .step-label { font-size: 16px; }
  .quantity-field button { width: 44px; min-width: 44px; }
  .quantity-field input { font-size: 22px; min-width: 0; padding-inline: 3px; }
  .quantity-field > span { padding-right: 7px; font-size: 13px; }
  .service-body { padding: 20px 18px; }
  .service-body h3 { font-size: 25px; }
  .service-body p { font-size: 16px; }
  .service-actions { gap: 6px 10px; }
  .service-actions button { padding-inline: 12px; }
  .contact-phone, .detail-contacts .contact-phone { font-size: clamp(21px, 6.1vw, 26px); letter-spacing: -.04em; }
  .mobile-actions a { font-size: 12px; padding-inline: 8px; }
  .mobile-actions .icon { width: 16px; height: 16px; }
  .request-actions > *, .draft-tools > * { flex-basis: 100%; }
  .hero-contact-brief { grid-template-columns: minmax(0, 1fr) 100px; }
  .hero-contact-number { min-height: 44px; }
  .request-callout { gap: 10px; }
  .request-callout > .icon { width: 20px; height: 20px; }
  .request-callout strong { font-size: clamp(18px, 5.6vw, 22px); letter-spacing: -.03em; }
}
@media (max-width: 350px) {
  .hero-contact-brief { grid-template-columns: minmax(0, 1fr) 82px; gap: 0 7px; }
  .hero-contact-number { font-size: 15px; }
}
@media (max-width: 320px) {
  .hero-price strong { font-size: 35px; }
  .hero-price div > span { font-size: 13px; }
  .hero-visual { height: 235px; }
  .machine-stage { inset: 30px 0 60px; }
  .machine-spec { font-size: 10px; gap: 4px 10px; }
  .machine-spec .icon { width: 16px; height: 16px; }
  .hero-note, .price-group { padding: 18px 16px; }
  .total-block strong { font-size: 43px; }
  .service-actions { flex-direction: column; }
  .service-actions a { justify-content: center; }
  .contact-card h3 { font-size: 28px; }
  .detail-rate { font-size: 25px; padding: 20px 16px; }
  .contact-phone .icon { width: 18px; height: 18px; }
  .hero-contact-brief { grid-template-columns: minmax(0, 1fr) 108px; }
  .hero-contact-label { grid-column: 1; grid-row: 1; align-self: center; }
  .hero-contact-number { grid-column: 1 / -1; grid-row: 2; font-size: 17px; }
  .hero-contact-channel { grid-column: 2; grid-row: 1; font-size: 11px; }
  .mobile-actions { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 6px; }
  .mobile-actions a { gap: 4px; font-size: 12px; padding-inline: 6px; }
  .mobile-actions a:first-child .icon { display: none; }
  dialog { padding: 18px 14px; border-radius: 18px; }
  .dialog-top .eyebrow { font-size: 10px; }
  .request-callout { padding: 12px; }
}

/* Landscape needs usable height more than two permanently fixed bars. */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --header-space: 20px; --mobile-action-space: 0px; }
  .site-header { position: relative; top: auto; }
  .mobile-nav { max-height: 60vh; max-height: 60dvh; }
  .mobile-actions { position: static; }
  .copy-toast { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  dialog { margin-block: 10px; }
  dialog h2 { font-size: 26px; margin-block: 12px 16px; }
  .request-draft { min-height: 140px; }
}

/* A large, top-aligned machine and compact details share the right hero column. */
.hero-showcase { min-width: 0; align-self: start; }
.hero-showcase .hero-visual { width: 100%; height: auto; margin: 0; }
.hero-showcase .machine-stage {
  position: relative;
  inset: auto;
  width: calc(100% + clamp(0px, (100vw - 1160px) / 2 - 20px, 120px));
  height: auto;
  aspect-ratio: 1672 / 941;
  margin-left: 8px;
}
.hero-showcase .machine-ghost { top: 5px; left: 3%; font-size: clamp(76px, 9vw, 134px); }
.hero-showcase .machine-halo { top: 0; right: 0; }
.hero-showcase .machine-spec { position: static; margin-top: 0; gap: 16px; }
.hero-showcase .scene-controls { position: static; margin-top: 9px; gap: 12px; }
.hero-showcase .scene-toggle { min-height: 44px; }
.hero-requisites {
  margin-top: 18px;
  padding: 17px 20px 9px;
  border: 1px solid #e4e4e9;
  border-radius: 20px;
  background: linear-gradient(145deg, #fafafc, #f3f3f6);
}
.hero-requisites-kicker { display: block; font-size: 11px; font-weight: 600; color: #74747c; letter-spacing: .04em; }
.hero-requisites-heading p { margin: 5px 0 13px; font-size: 14px; line-height: 1.45; font-weight: 600; color: #34343b; }
.hero-requisites dl { margin: 0; }
.hero-requisites .requisite-item {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0;
  min-height: 51px;
  padding: 4px 0;
  border-top: 1px solid #e0e0e6;
}
.hero-requisites dt { font-size: 13px; line-height: 1.4; color: #606068; }
.hero-requisites dt > span { display: block; margin-top: 2px; font-size: 10px; color: #7b7b83; }
.hero-requisites dd { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 10px; align-items: center; }
.hero-requisites .requisite-value { font-size: 16px; font-variant-numeric: tabular-nums; color: #32323a; }
.hero-requisites .hero-edo { font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.hero-requisites .requisite-copy { width: 44px; height: 44px; margin: 0; padding: 0; justify-content: center; background: #ffffffc9; }
.hero-requisites .requisite-copy:hover { background: #fff2be; }
@media (min-width: 821px) and (max-width: 1100px) {
  .hero-showcase .machine-stage { width: 100%; margin-left: 8px; }
  .hero-showcase .scene-controls { flex-direction: column; gap: 5px; }
  .hero-showcase .scroll-cue { display: none; }
  .hero-requisites { padding-inline: 15px; }
  .hero-requisites .requisite-item { grid-template-columns: 75px minmax(0, 1fr); gap: 9px; }
}
@media (max-width: 820px) {
  .hero-showcase { width: 100%; max-width: 640px; margin: 20px auto 0; }
  .hero-showcase .machine-stage { width: 100%; margin-left: 0; }
  .hero-showcase .machine-halo { left: 50%; right: auto; margin-left: -125px; }
  .hero-showcase .machine-spec { flex-wrap: wrap; font-size: 12px; gap: 5px 16px; }
  .hero-showcase .scene-controls { flex-direction: row; }
  .hero-requisites { margin-top: 14px; }
}
@media (max-width: 430px) {
  .hero-requisites { padding: 16px 14px 9px; border-radius: 17px; }
  .hero-requisites-heading p { font-size: 13px; }
  .hero-requisites .requisite-item { grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
  .hero-requisites .requisite-value { font-size: 15px; }
  .hero-requisites .hero-edo { font-size: 12px; }
  .hero-requisites dd { gap: 8px; }
}
@media (max-width: 350px) {
  .hero-requisites .requisite-item { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-block: 9px; }
  .hero-requisites dt > span { display: inline; margin-left: 5px; }
  .hero-requisites dd { gap: 10px; }
}
