@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .view-switcher {
    display: none;
  }

  .calculator-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(350px, 0.9fr);
  }

  .fiscal-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .site-header {
    position: static;
  }

  main {
    width: min(100% - 32px, 760px);
  }

  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .results-column {
    position: static;
    grid-row: 2;
  }

  .worksheet {
    grid-row: 1;
  }

  .result-panel {
    box-shadow: var(--shadow-sm);
  }

  .waitlist-card {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .calculator-shell.has-mobile-result-summary {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .mobile-result-summary {
    width: 100%;
    min-height: 72px;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.1);
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    backdrop-filter: blur(14px);
  }

  .mobile-result-summary[hidden] {
    display: none;
  }

  .mobile-result-summary__content {
    min-width: 0;
  }

  .mobile-result-summary__content > p {
    margin: 0 0 3px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .mobile-result-summary__values {
    display: flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
  }

  .mobile-result-summary__values strong,
  .mobile-result-summary__values b {
    font-family: var(--mono);
    font-weight: 700;
    letter-spacing: -0.045em;
  }

  .mobile-result-summary__values strong {
    color: var(--ink);
    font-size: clamp(21px, 6.2vw, 25px);
    line-height: 1;
  }

  .mobile-result-summary__values b {
    color: var(--violet);
    font-size: 14px;
  }

  .mobile-result-summary__values span {
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 12px;
  }

  .mobile-result-summary__values > i {
    width: 5px;
    height: 5px;
    margin: 0 2px 2px;
    border-radius: 999px;
    background: var(--line-strong);
  }

  .mobile-result-summary > button {
    min-width: 108px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #ddd6fe;
    border-radius: 15px;
    color: var(--violet);
    background: #f5f3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
  }

  .mobile-result-summary > button:active {
    background: #ede9fe;
    transform: translateY(1px);
  }

  .mobile-result-summary > button .material-symbols-outlined {
    font-size: 20px;
  }

  .site-header {
    padding: 12px 16px;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .header-actions {
    justify-content: stretch;
  }

  .language-switcher {
    flex: 0 0 auto;
  }

  .currency-control {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }

  .header-icon,
  .brand-tag {
    display: none;
  }

  main {
    width: min(100% - 24px, 560px);
    padding-top: 14px;
  }

  .hero-card {
    min-height: 0;
    margin-bottom: 16px;
    padding: 25px 20px;
    border-radius: 16px;
  }

  .hero-card h1 {
    font-size: clamp(35px, 11vw, 48px);
  }

  .hero-card__content > p:not(.kicker) {
    font-size: 14px;
  }

  .preset-row {
    align-items: stretch;
  }

  .preset-row > span {
    width: 100%;
  }

  .preset-button {
    flex: 1 1 100%;
    justify-content: center;
  }

  .calculator-grid,
  .worksheet {
    gap: 16px;
  }

  .studio-card,
  .result-panel {
    padding: 17px;
    border-radius: 14px;
  }

  .studio-card__header,
  .subcontrol-card__heading,
  .tools-teaser {
    align-items: stretch;
    flex-direction: column;
  }

  .status-badge,
  .micro-label {
    width: max-content;
  }

  .range-control__top {
    grid-template-columns: 1fr;
  }

  .range-control__value {
    width: 124px;
    justify-self: end;
  }

  .range-control__scale {
    font-size: 10.5px;
  }

  .select-control {
    grid-template-columns: 1fr;
  }

  .time-map__legend,
  .money-route__legend {
    grid-template-columns: 1fr;
  }

  .reference-rates {
    grid-template-columns: 1fr;
  }

  .result-primary > div > strong {
    font-size: clamp(34px, 12vw, 46px);
  }

  .project-examples > div {
    align-items: flex-start;
  }

  .share-card,
  .youtube-card {
    padding: 18px;
  }

  .share-card h2,
  .youtube-card h2 {
    font-size: 17px;
  }

  .share-card p,
  .youtube-card p {
    font-size: 12px;
  }

  .share-card__primary {
    min-height: 52px;
    font-size: 13.5px;
  }

  .share-card__quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-card__copy-link {
    grid-column: 1 / -1;
  }

  .share-card__action {
    min-height: 42px;
    font-size: 11.5px;
  }

  .tools-teaser {
    padding: 20px;
  }

  .waitlist-card {
    margin-top: 16px;
    padding: 20px 16px;
    border-radius: 16px;
    gap: 22px;
  }

  .waitlist-card__copy h2 {
    font-size: 25px;
  }

  .waitlist-card__copy > p:not(.kicker) {
    font-size: 13px;
  }

  .waitlist-card__benefits li {
    font-size: 12px;
  }

  .waitlist-card__form {
    padding: 18px;
  }

  .subscription-confirmation {
    padding: 14px 16px;
  }

  .tools-teaser > span {
    white-space: normal;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .error-summary {
    width: min(100% - 24px, 560px);
  }
}

@media (max-width: 360px) {
  .mobile-result-summary {
    padding-right: 12px;
    padding-left: 12px;
    gap: 8px;
  }

  .mobile-result-summary__values strong {
    font-size: 21px;
  }

  .mobile-result-summary__values b {
    font-size: 13px;
  }

  .mobile-result-summary > button {
    min-width: 100px;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 14px;
  }
}

@media (min-width: 641px) {
  .mobile-result-summary {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
