/* Final mobile polish. Loaded after page styles so existing desktop layouts stay intact. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.site-header .mobile-menu nav a:focus-visible,
.site-header .mobile-menu summary:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* Reliable touch feedback and readable contact form on the lime background. */
.home .contact-section .contact-form { max-width: 100%; min-width: 0; }
.home .contact-section .contact-form label { min-width: 0; }
.home .contact-section .contact-form .contact-hint,
.home .contact-section .contact-form .contact-count,
.home .contact-section .contact-form .contact-privacy {
  font: 12px/1.55 Manrope, Arial, sans-serif;
  color: #40582d;
  letter-spacing: 0;
  text-transform: none;
}
.home .contact-section .contact-form .contact-privacy {
  margin: 0;
  max-width: 510px;
  color: #365029;
}
.home .contact-section .contact-form .contact-help {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}
.home .contact-section .contact-form .contact-count {
  flex: none;
  font-variant-numeric: tabular-nums;
}
.home .contact-section .contact-form .contact-button {
  min-height: 54px;
  max-width: 100%;
  text-align: left;
}
.home .contact-section .contact-form .contact-button-text { min-width: 0; }
.home .contact-section .contact-form .contact-button:disabled { opacity: .65; }
.home .contact-section .contact-status.is-success { color: #173d1c; font-weight: 800; }
.home .contact-section .contact-status.is-error { color: #70251c; font-weight: 800; }
.home .contact-section .contact-form input:not([type=hidden]),
.home .contact-section .contact-form textarea { min-width: 0; }
.home .contact-section .contact-form input:not([type=hidden]):focus-visible,
.home .contact-section .contact-form textarea:focus-visible { outline-color: #173d1c; }

@media (max-width: 850px) {
  /* Five public navigation links no longer fit safely in the desktop header
     at tablet widths. Switch to the existing details menu before overflow. */
  .site-header .main-nav { display: none; }
  .site-header .mobile-menu {
    display: block;
    margin-left: auto;
    margin-right: 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }
  .site-header .mobile-menu summary {
    cursor: pointer;
    padding: 12px 8px;
    list-style: none;
  }
  .site-header .mobile-menu summary::-webkit-details-marker { display: none; }
  .site-header .mobile-menu[open] nav {
    position: absolute;
    top: 95px;
    left: 0;
    right: 0;
    background: var(--paper);
    border: 1px solid var(--ink);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 6px 6px 0 var(--ink);
  }
  .site-header .mobile-menu nav a {
    display: block;
    padding: 14px 8px;
    border-bottom: 1px solid var(--line);
  }
  .site-header .mobile-menu nav a:last-child { border-bottom: 0; }
  .site-header .mobile-menu[open] { z-index: 21; }
  .home .hero-utility,.home .hero-foot,.home .section-rail {
    min-width: 0;
  }
  .home .hero-showcase { max-width: calc(100% - 10px); }
  .home .featured-card,.home .archive-card,.home .integration-lab-links a { min-width: 0; }
  .home .featured-body h3,.home .archive-title h3 { overflow-wrap: anywhere; }
  .home .hero-showcase img { height: auto; }
  .home .contact-section h2 { overflow-wrap: anywhere; }
  .home .contact-section .contact-layout { gap: clamp(22px, 5vw, 40px); }
  .lab .onec-response,.lab .onec-editor,.lab .tg-flow { min-width: 0; }
  .lab .onec-panel-head code { overflow-wrap: anywhere; }
  .report-playground .currency-inputs>* { min-width: 0; }
}

@media (max-width: 740px) {
  .site-header .mobile-menu[open] nav { top: 72px; }
  .site-header .mobile-menu summary,
  .site-header .mobile-menu nav a,
  .site-header .header-contact { min-height: 44px; }
  .site-header .mobile-menu summary { display: flex; align-items: center; }
  .site-header .mobile-menu[open] nav { max-height: min(70svh, 430px); overflow-y: auto; }
  .site-header .mobile-menu[open] nav a { display: flex; align-items: center; }
  .home .hero .hero-actions .action { min-height: 48px; }
  .home .showcase-demo-link { min-height: 48px; }
  .home .featured-visual .visual-tag { line-height: 1.35; }
  .home .archive-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home .contact-section .contact-button { width: 100%; gap: 24px; padding-inline: 16px; }
  .home .contact-section .contact-form .contact-hint { font-size: 12px; }
  .home .contact-section .contact-form .contact-privacy { font-size: 11px; }
  .lab .onec-editor-actions>* { min-height: 48px; }
  .lab .tg-scenarios button, .lab .onec-scenarios button { min-height: 48px; }
  .calc-page .calc-field-grid input { min-height: 48px; }
  .calc-page .calc-presets button { min-height: 44px; }
  .report-playground .scenario-buttons button { min-height: 44px; }
  .case .case-hero h1 { overflow-wrap: anywhere; }
  .case .case-next a { overflow-wrap: anywhere; }
}

@media (max-width: 430px) {
  .site-header { gap: 8px; }
  .site-header .brand { font-size: clamp(16px, 4.7vw, 20px); }
  .site-header .mobile-menu { margin-left: auto; margin-right: 0; }
  .site-header .header-contact { gap: 6px; padding-inline: 8px; }
  .site-header .header-contact span { font-size: 15px; }
  .home .hero h1 { font-size: clamp(35px, 10.7vw, 45px); letter-spacing: -.077em; }
  .home .hero-stage { gap: 30px; }
  .home .hero-showcase { box-shadow: 5px 5px 0 #1b2b20; }
  .home .showcase-flow { flex-wrap: wrap; row-gap: 4px; }
  .home .featured-visual .visual-tag { font-size: 8px; }
  .home .archive-grid { gap: 9px; }
  .home .archive-copy { padding: 10px; min-height: 115px; }
  .home .archive-title { gap: 5px; }
  .home .archive-title h3 { font-size: clamp(12px,3.5vw,17px); }
  .home .section-intro h2,.home .method-grid h2,.home .expertise-section h2 {
    font-size: clamp(37px, 9.5vw, 49px);
    letter-spacing: -.07em;
  }
  .home .contact-section h2 {
    font-size: clamp(36px, 10vw, 45px);
    letter-spacing: -.075em;
  }
  .home .contact-section { padding-inline: 14px !important; }
  .home .contact-section .contact-form .contact-help { flex-wrap: wrap; }
  .home .contact-section .contact-form .contact-button { font-size: 12px; }
  .home .hero-foot { flex-wrap: wrap; }
  .home .section-rail { flex-wrap: wrap; row-gap: 6px; }
  .home .calculator-teaser-copy h2 { font-size: clamp(41px,10vw,53px); }
  .lab .lab-intro h1 { font-size: clamp(38px,10vw,49px); overflow-wrap: anywhere; }
  .lab .lab-rail { flex-wrap: wrap; }
  .lab .tg-phone-top { padding: 14px 9px; }
  .lab .tg-phone-top strong { font-size: 11px; }
  .lab .tg-phone-top small { font-size: 9px; }
  .lab #onec-payload { padding: 10px; }
  .report-playground .playground-heading h1 { font-size: clamp(34px,10vw,45px); }
  .report-playground .currency-inputs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-playground .showcase-top { flex-wrap: wrap; }
  .calc-page .calc-hero h1 { font-size: 10.2vw; }
  .calc-page .calc-field-grid input { font-size: 18px; }
  .case .case-hero h1 { font-size: clamp(38px,10.5vw,50px); }
  .case .case-breakdown h2,.case .case-showcase h2 { font-size: clamp(36px,9vw,46px); }
}

@media (max-width: 355px) {
  .site-header .header-contact { display: none; }
  .site-header .mobile-menu { margin-left: auto; }
  .home .hero h1 { font-size: 10.8vw; }
  .home .hero-foot>span { max-width: 100%; }
  .home .featured-meta { flex-wrap: wrap; }
  .home .archive-grid { grid-template-columns: 1fr; }
  .home .archive-image { aspect-ratio: 1.7 / 1; }
  .home .archive-copy { min-height: 95px; }
  .home .contact-section h2 { font-size: 10.5vw; }
  .home .calculator-teaser-art>strong { font-size: 10vw; }
  .lab .onec-scenarios { grid-template-columns: 1fr; }
  .report-playground .currency-inputs { grid-template-columns: 1fr; }
  .calc-page .calc-field-grid { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
}
