/* Stable small-viewport sizing. Browser toolbar movement never changes the layout. */
@media (max-width: 760px) {
  :root {
    --gutter: clamp(16px, 5vw, 28px);
    --screen: 100svh;
    --screen-unit: 1svh;
    --screen-space: clamp(20px, calc(var(--screen-unit) * 3), 32px);
    --mobile-header: calc(56px + env(safe-area-inset-top, 0px));
    --mobile-footer: calc(112px + env(safe-area-inset-bottom, 0px));
    scroll-padding-top: 0;
    scroll-behavior: auto;
  }
  body { -webkit-text-size-adjust: 100%; }
  .topbar {
    min-height: 0;
    height: var(--mobile-header);
    padding-top: env(safe-area-inset-top, 0px);
    gap: 12px;
  }
  .topbar .wordmark { font-size: clamp(27px, 7vw, 32px); }
  .topbar .wordmark .brand-star { display: block; width: 34px; height: 34px; }
  .header-cta { padding: 8px 0 8px 8px; font-size: 15px; border: 0; gap: 5px; }
  .header-cta svg { width: 20px; height: 20px; }
  .topbar nav, .brand-star { display: none; }
  main > section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: clamp(14px, calc(var(--screen-unit) * 2.6), 26px);
    height: var(--screen);
    min-height: 0;
    margin-block: 0;
    padding-top: max(var(--screen-space), env(safe-area-inset-top, 0px));
    padding-bottom: max(var(--screen-space), env(safe-area-inset-bottom, 0px));
    scroll-margin-top: 0;
  }
  .section-label { font-size: 14px; line-height: 1.4; }
  .section-intro {
    flex: none;
    width: 100%;
    padding-block: 0;
    gap: 12px;
  }
  .section-intro h2, .control-copy h2, .faq > h2 {
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.08;
  }
  .section-intro > p, .business-intro > p {
    font-size: 16px;
    line-height: 1.4;
  }
  .button { min-height: 46px; padding: 12px 18px; font-size: 16px; gap: 14px; }
  .button svg { width: 23px; height: 23px; }

  /* No vertical centering: the headline starts directly below the header. */
  main > .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "title" "visual" "actions";
    height: calc(var(--screen) - var(--mobile-header));
    min-height: 0;
    padding-top: 4px;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
    gap: clamp(8px, calc(var(--screen-unit) * 1.3), 12px);
    text-align: center;
  }
  .hero h1 {
    font-size: min(clamp(24px, 7.1vw, 34px), calc(var(--screen-unit) * 4.6));
    line-height: 1.07;
    letter-spacing: -.025em;
  }
  .hero-phrase { display: block; }
  .hero h1 .hero-condensed { font-size: 1.17em; line-height: .97; margin: .06em 0; }
  .hero-description { margin: 0; font-size: clamp(12px, 3.35vw, 15px); line-height: 1.4; max-width: 430px; }
  .hero-description > span { display: inline; }
  .hero-description br { display: none; }
  .hero-actions { margin: 0; width: 100%; align-self: stretch; align-items: center; flex-direction: column; gap: 5px; }
  .hero-actions .button { width: 100%; max-width: 430px; min-height: 48px; padding: 13px 18px; font-size: 16px; justify-content: space-between; }
  .hero-actions .text-button { min-height: 36px; padding: 4px 0; font-size: 14px; gap: 10px; }
  .hero-actions .text-button .icon { width: 19px; height: 19px; }
  .hero-visual { width: min(100%, 330px); max-width: 330px; justify-self: center; }
  .phone-frame { padding: 6px 6px 0; border-radius: 37px 37px 0 0; }
  .phone-screen { border-radius: 30px 30px 0 0; }
  .phone-status { height: 30px; padding-inline: 20px; }
  .phone-status b { font-size: 10px; }
  .phone-status > svg { width: 39px; height: 10px; }
  .phone-island { top: 5px; width: 76px; height: 21px; margin-left: -38px; }
  .phone-island::after { top: 7px; }
  .phone-heading { min-height: 42px; padding: 3px 11px 6px; gap: 7px; }
  .phone-avatar, .phone-avatar img { width: 28px; height: 28px; }
  .phone-heading b { font-size: 12px; }
  .phone-heading small { font-size: 9px; }
  .phone-example-label { height: 21px; font-size: 8px; }
  .phone-stack { inset: 23px 10px 20px; }
  .phone-tender { padding: 9px; }
  .phone-tender h2 { font-size: 14px; }
  .phone-tender-actions button { min-height: 36px; }
  .decor-orbit { top: 38%; left: -18%; width: 138%; height: 35%; border-width: 1.5px; }
  .decor-spark { width: 36px; height: 36px; top: 29%; right: -8px; }
  .decor-plane { width: 36px; height: 36px; top: auto; bottom: 14%; left: -12px; }
  .decor-knot { width: 100px; height: 100px; left: -42px; bottom: 37%; }
  .decor-pebble { width: 76px; height: 90px; right: -35px; top: 49%; }
  .decor-steps { width: 76px; height: 70px; bottom: 1%; left: -26px; opacity: .65; }

  .manifesto { text-align: left; }
  .manifesto h2 { margin: 0; font-size: clamp(28px, 7.7vw, 44px); line-height: 1.13; }
  .manifesto-description { margin: 0; max-width: 460px; font-size: 16px; line-height: 1.5; }
  .workflow-strip {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr auto 1fr auto 1fr;
    gap: 5px;
    margin: 0;
    text-align: left;
  }
  .workflow-strip > span { width: 100%; padding: 9px 18px; border: 1px solid #101116; border-radius: 15px; font: 400 clamp(24px, 6vw, 34px)/1.1 var(--display); }
  .workflow-strip small { font: 400 11px/1.4 var(--body); color: #4E5362; }
  .workflow-strip svg { justify-self: center; width: 20px; height: 12px; transform: rotate(90deg); }

  /* The title, stage, artwork and navigation share a fixed viewport budget. */
  main > .workflow-section { justify-content: flex-start; gap: 12px; }
  .workflow-section > .section-intro h2 { font-size: clamp(26px, 7.2vw, 38px); }
  .workflow-section > .section-intro > p { display: none; }
  .showcase-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: calc(100% - 20px);
    margin: 0 auto;
    border-radius: 24px;
  }
  .showcase-top { flex: none; padding: 12px 14px 6px; gap: 8px; }
  .show-tabs { width: 100%; gap: 6px; }
  .show-tab { flex: 1; padding: 9px 4px; font-size: 13px; min-height: 38px; }
  .showcase-count { display: none; }
  .showcase-stage { flex: 1; min-height: 0; }
  .feature-slide {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    padding: 8px 18px;
    align-content: stretch;
  }
  .slide-copy { padding: 0; }
  .slide-title { font-size: clamp(25px, 7vw, 38px); line-height: 1.08; }
  .slide-title br { display: none; }
  .slide-description { margin-top: 8px; font-size: 14px; line-height: 1.4; max-width: 500px; }
  .slide-extra { margin-top: 8px; font-size: 13px; line-height: 1.35; }
  .slide-extra br { display: none; }
  .slide-link { margin: 0; padding: 4px 0; font-size: 14px; line-height: 1.4; gap: 8px; }
  .slide-link .icon { width: 18px; height: 18px; }
  .slide-art { height: 100%; min-height: 0; align-self: stretch; }
  .art-float { display: grid; place-items: center; }
  .courier, .editor {
    top: auto;
    bottom: 0;
    left: -18%;
    width: 115%;
    height: 100%;
    max-height: 360px;
    object-fit: contain;
    object-position: left bottom;
  }
  .notification-orbit { top: 12%; height: 65%; }
  .sample-notification, .summary-paper {
    position: relative;
    inset: auto;
    justify-self: end;
    width: min(84%, 320px);
    max-width: none;
    padding: 12px;
    border-radius: 13px;
  }
  .sample-label { font-size: 11px; line-height: 1.25; }
  .sample-notification strong { font-size: 22px; line-height: 1.04; margin-top: 7px; }
  .sample-notification p { font-size: 13px; margin-top: 5px; }
  .sample-budget { font-size: 23px; margin-top: 6px; }
  .sample-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
  .sample-actions button { padding: 7px 5px; min-height: 40px; font-size: 11px; gap: 3px; }
  .sample-actions .icon { width: 15px; height: 15px; }
  .summary-paper h4 { font-size: 26px; margin: 7px 0 9px; }
  .summary-paper dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; }
  .summary-paper dl > div { display: block; padding: 6px 0 0; }
  .summary-paper dt { font-size: 11px; }
  .summary-paper dd { font-size: 14px; line-height: 1.25; margin-top: 3px; }
  .summary-paper dd br { display: none; }
  .paper-check { width: 43px; height: 43px; padding: 7px; bottom: -16px; right: 12px; }
  .draft-preview {
    top: auto;
    width: min(92%, 360px);
    margin: 0 auto;
    padding: 14px;
    border-radius: 13px;
    transform: rotate(-3deg);
  }
  .draft-preview-top { font-size: 25px; padding-bottom: 8px; }
  .draft-preview-top svg { width: 21px; height: 21px; }
  .draft-preview > p { font-size: 14px; line-height: 1.4; margin-top: 8px; }
  /* Full wording is available through the visible "Посмотреть черновик" button. */
  .draft-preview > p:first-of-type, .draft-signature, .draft-preview .button { display: none; }
  .draft-back-sheet { inset: 10% 7%; width: auto; height: 80%; max-height: 270px; }
  .draft-spark { width: 40px; height: 40px; right: -4px; bottom: 0; }
  .word-track { font-size: 90px; top: 15%; }
  .word-track-back { top: auto; bottom: 8%; }
  .showcase-controls { flex: none; padding: 2px 14px 8px; gap: 8px; }
  .showcase-controls > button { width: 58px; height: 40px; padding: 6px; }
  .showcase-controls > button svg { width: 43px; height: 27px; }
  .showcase-controls > p { max-width: none; font-size: 12px; line-height: 1.2; }

  main > .business-section { justify-content: flex-start; gap: 14px; }
  .business-intro { align-items: center; gap: 12px; }
  .business-intro > p { font-size: 15px; }
  .business-intro > p br { display: none; }
  .carousel-arrows { margin: 0; gap: 6px; }
  .carousel-arrows button { width: 40px; height: 40px; }
  .carousel-arrows svg { width: 24px; height: 24px; }
  .business-carousel { flex: 1; min-height: 0; padding-block: 4px 8px; gap: 14px; }
  .business-card {
    display: flex;
    flex-direction: column;
    flex-basis: calc(100vw - 2 * var(--gutter) - 14px);
    height: 100%;
    min-height: 0;
    padding: 18px;
    border-radius: 22px;
  }
  .card-category { font-size: 14px; }
  .business-card h3 { font-size: clamp(29px, 8vw, 42px); margin-top: 7px; }
  .business-card > p { font-size: 15px; line-height: 1.4; }
  .trade-art { flex: 1; height: auto; min-height: 100px; max-height: 270px; margin: auto -8px; transform: scale(.7); }

  main > .control-section { align-items: stretch; gap: clamp(18px, calc(var(--screen-unit) * 3), 30px); }
  .control-copy { order: -1; }
  .control-symbol { flex: none; width: min(calc(var(--screen-unit) * 34), 250px); height: min(calc(var(--screen-unit) * 34), 250px); margin-block: auto; }
  .control-copy .section-label { margin-bottom: 14px; }
  .control-copy > p:last-child { margin-top: 18px; font-size: 17px; line-height: 1.5; }

  main > .start-section { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .start-section > .section-intro { align-items: flex-start; }
  .start-section > .button { justify-self: start; margin: 0; min-height: 46px; padding: 12px 18px; font-size: 16px; }
  .start-steps { min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(3,minmax(0,1fr)); gap: 0; margin: 0; }
  .start-steps article { display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; column-gap: 12px; padding: 12px 0; }
  .start-steps article > span { grid-row: 1 / 3; margin: 0; font-size: 30px; }
  .start-steps h3 { font-size: clamp(23px, 6vw, 30px); line-height: 1.1; }
  .start-steps h3 br { display: none; }
  .start-steps p { margin-top: 8px; max-width: none; font-size: 15px; line-height: 1.45; }

  main > .faq { gap: 24px; }
  .faq-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
  .faq details { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .faq details[open] { flex: 2; }
  .faq summary { font-size: 17px; line-height: 1.35; padding: 18px 0; gap: 12px; min-height: 56px; }
  .faq summary > span { width: 24px; height: 24px; font-size: 25px; }
  .faq details > p { font-size: 15px; line-height: 1.5; padding: 0 10px 18px 0; }

  main > .closing { height: calc(var(--screen) - var(--mobile-footer)); padding-block: 0; gap: 0; }
  .closing > .wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    padding-block: 20px;
  }
  .closing .section-label { font-size: 26px; }
  .closing h2 { font-size: clamp(28px, 7.6vw, 42px); line-height: 1.08; margin: 0; }
  .closing h2 span { font-size: 1.22em; }
  .closing > .wrap > p:not(.section-label) { margin: 0; font-size: 16px; line-height: 1.4; max-width: 350px; }
  .closing .button { margin: 0; padding: 12px 18px; min-height: 48px; font-size: 16px; gap: 12px; }
  .closing-spark { width: 50px; height: 50px; right: 0; top: 8px; }
  .brand-ribbon { flex: none; font-size: 46px; padding-block: 10px 14px; margin-block: 10px -5px; }
  footer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: center;
    align-items: center;
    gap: 4px 12px;
    height: var(--mobile-footer);
    padding-top: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    font-size: 13px;
  }
  footer .wordmark { font-size: 30px; }
  footer > a:not(.wordmark) { display: inline-flex; align-items: center; gap: 4px; }
  footer > button { grid-column: 1 / -1; justify-self: start; min-height: 36px; padding-block: 6px; font-size: 13px; }
}

/* Short portrait phones retain the same navigation and readable body text. */
@media (max-width: 760px) {
  :root[data-compact-screen] { --screen-space: 14px; --mobile-header: calc(54px + env(safe-area-inset-top, 0px)); }
  :root[data-compact-screen] main > .hero { gap: 8px; padding-top: 6px; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
  :root[data-compact-screen] .hero h1 { font-size: min(7vw, calc(var(--screen-unit) * 4.5)); }
  :root[data-compact-screen] .hero-description { font-size: 12px; line-height: 1.35; }
  :root[data-compact-screen] .hero-actions .text-button { display: inline-flex; min-height: 34px; font-size: 13px; }
  :root[data-compact-screen] .phone-status { height: 27px; }
  :root[data-compact-screen] .phone-heading { min-height: 37px; padding-block: 2px 5px; }
  :root[data-compact-screen] .phone-example-label { height: 18px; }
  :root[data-compact-screen] .phone-stack { inset: 18px 9px 18px; }
  :root[data-compact-screen] .phone-tender { padding: 8px; }
  :root[data-compact-screen] .phone-tender-meta { display: none; }
  :root[data-compact-screen] .phone-tender > p { font-size: 10px; }
  :root[data-compact-screen] .phone-tender-facts { margin-top: 5px; }
  :root[data-compact-screen] .phone-tender-facts strong { font-size: 16px; }
  :root[data-compact-screen] .phone-tender-actions { margin-top: 6px; }
  :root[data-compact-screen] .phone-tender-actions button { min-height: 32px; padding-block: 7px; }
  :root[data-compact-screen] .hero-actions .button { min-height: 44px; padding-block: 11px; font-size: 15px; }
  :root[data-compact-screen] .manifesto h2 { font-size: 27px; }
  :root[data-compact-screen] .manifesto-description { font-size: 14px; }
  :root[data-compact-screen] .workflow-strip > span { font-size: 24px; padding-block: 6px; }
  :root[data-compact-screen] .workflow-strip small { font-size: 10px; }
  :root[data-compact-screen] .faq summary { font-size: 15px; padding-block: 13px; }
  :root[data-compact-screen] .faq details > p { font-size: 13px; }
  :root[data-compact-screen] .workflow-section > .section-intro h2 { font-size: 25px; }
  :root[data-compact-screen] .showcase-top { padding-top: 8px; }
  :root[data-compact-screen] .slide-title { font-size: 25px; }
  :root[data-compact-screen] .slide-description { font-size: 13px; }
  :root[data-compact-screen] .slide-extra { margin-top: 6px; }
  :root[data-compact-screen] .sample-notification, :root[data-compact-screen] .summary-paper { padding: 10px; }
  :root[data-compact-screen] .sample-notification strong { font-size: 20px; }
  :root[data-compact-screen] .summary-paper h4 { display: none; }
  :root[data-compact-screen] .draft-preview { padding: 11px; }
  :root[data-compact-screen] .draft-preview-top { font-size: 22px; }
  :root[data-compact-screen] .draft-preview > p { font-size: 13px; }
  :root[data-compact-screen] .control-symbol { width: 135px; height: 135px; }
  :root[data-compact-screen] .control-copy > p:last-child { font-size: 15px; }
  :root[data-compact-screen] .start-steps { gap: 0; }
  :root[data-compact-screen] .start-steps article { padding-block: 8px; }
  :root[data-compact-screen] .start-steps article > span { font-size: 25px; }
  :root[data-compact-screen] .start-steps h3 { font-size: 21px; }
  :root[data-compact-screen] .start-steps p { font-size: 13px; }
  :root[data-compact-screen] .closing > .wrap { gap: 12px; padding-block: 16px; }
  :root[data-compact-screen] .closing .section-label { font-size: 23px; }
  :root[data-compact-screen] .closing h2 { font-size: 26px; }
  :root[data-compact-screen] .closing > .wrap > p:not(.section-label) { font-size: 14px; }
  :root[data-compact-screen] .brand-ribbon { font-size: 37px; padding-block: 7px 10px; }
}

/* Small portrait viewports keep the illustration and primary action visible. */
@media (max-width: 760px) {
  :root[data-short-screen] { --mobile-header: calc(48px + env(safe-area-inset-top, 0px)); }
  :root[data-short-screen] main > .hero { gap: 6px; padding-block: 6px; }
  :root[data-short-screen] .hero h1 { font-size: min(6.7vw, 23px); }
  :root[data-short-screen] .hero-description { font-size: 11px; }
  :root[data-short-screen] .hero-actions .button { min-height: 42px; padding-block: 10px; }
}

/* Landscape and extreme text zoom may need more room; never cut off controls. */
@media (max-width: 760px) {
  :root[data-overflow-screen] main > section, :root[data-overflow-screen] main > .hero, :root[data-overflow-screen] main > .closing { height: auto; min-height: var(--screen); }
  :root[data-overflow-screen] .hero-visual { height: 260px; }
  :root[data-overflow-screen] main > .hero { grid-template-rows: auto 260px auto; }
  :root[data-overflow-screen] .workflow-strip { min-height: 260px; }
  :root[data-overflow-screen] .start-steps { min-height: 400px; }
  :root[data-overflow-screen] .control-symbol { margin-block: 30px; }
  :root[data-overflow-screen] .showcase-shell { flex: none; }
  :root[data-overflow-screen] .showcase-stage { flex: none; }
  :root[data-overflow-screen] .slide-art { height: 230px; }
  :root[data-overflow-screen] .business-carousel { flex: none; }
  :root[data-overflow-screen] .business-card { height: 440px; }
}

/* One action row returns its former second row to the phone. */
@media (max-width: 760px) {
  main > .hero .hero-actions {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    align-items: center; gap: 12px; width: 100%; max-width: 430px;
  }
  main > .hero .hero-actions .button,
  main > .hero .hero-actions .text-button {
    height: 46px; min-height: 46px; min-width: 0; margin: 0;
    box-sizing: border-box; white-space: nowrap;
    font-size: clamp(12px, 3.3vw, 14px);
  }
  main > .hero .hero-actions .button { padding: 10px 14px; gap: 6px; }
  main > .hero .hero-actions .text-button { padding: 10px 0; gap: 6px; }
  main > .hero .hero-actions .icon { width: 16px; height: 16px; flex: none; }
}
