/* Phone Booking shares the approved index type, spacing and sky, with native
   document flow instead of the desktop's measured composition. */
@media (max-width: 767px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  /* The persistent header is shared by every route. Admin is desktop-only. */
  body > .site-header .admin-button,
  body > .site-header .mobile-nav a:is([href="iida"], [href="iida.html"], [href="/iida"], [href="/iida.html"]) {
    display: none !important;
  }

  body.booking-page {
    --phone-gutter: clamp(20px, 5.6vw, 24px);
    --page-gutter: var(--phone-gutter);
    --header-height: calc(68px + env(safe-area-inset-top));
    --frame-width: calc(100% - 2 * var(--phone-gutter));
    --workspace-gap: 14px;
    --copy-size: 14px;
    overflow-x: clip;
  }
  body.booking-page > .site-header {
    inset: 0 0 auto;
    height: var(--header-height);
    gap: 16px;
    padding: env(safe-area-inset-top) var(--phone-gutter) 0;
    background: rgba(255, 248, 238, .5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  body.booking-page > .site-header .wordmark {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    max-width: calc(100% - 60px);
    font-size: 26px;
    white-space: nowrap;
    overflow-wrap: normal;
  }
  body.booking-page > .site-header .desktop-nav { display: none; }
  body.booking-page > .site-header .menu-toggle { display: flex; width: 46px; height: 46px; }
  body.booking-page > .site-header .mobile-nav {
    inset-inline: var(--phone-gutter);
    top: calc(100% + 8px);
    max-height: calc(100dvh - var(--header-height) - 24px);
    padding: 12px 20px;
    gap: 0;
  }
  body.booking-page > .site-header .mobile-nav:not([hidden]) { display: flex; }
  body.booking-page > .site-header .mobile-nav a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding-block: 10px;
    font-size: 16px;
    line-height: 1.4;
  }

  body.booking-page .workspace-shell {
    display: block;
    width: var(--frame-width);
    height: auto;
    min-height: calc(100svh - 140px);
    margin-inline: auto;
    padding: calc(var(--header-height) + 28px) 0 12px;
    overflow: visible;
  }
  body.booking-page .workspace-heading { margin: 0 0 26px; }
  body.booking-page .workspace-heading h1 {
    font-size: clamp(32px, 9vw, 38px);
    line-height: 1.04;
    letter-spacing: -.045em;
    text-wrap: balance;
  }
  body.booking-page .workspace-heading p { margin-top: 14px; font-size: 14px; line-height: 1.55; }
  body.booking-page .booking-workspace { border-top: 0; min-height: 0; }
  body.booking-page .booking-toolbar { min-height: 44px; padding: 0; margin: -8px 0 18px; }
  body.booking-page .booking-view { flex: none; min-height: 0; gap: 14px; justify-content: flex-start; }
  body.booking-page .booking-view--format { gap: 14px; }
  /* All five cards share one price track sized by the actual price text. */
  body.booking-page .booking-view:has(> .format-grid) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 12px;
  }

  body.booking-page .format-grid {
    --card-scale: 1;
    --copy-size: 14px;
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    grid-auto-rows: 1fr;
    gap: 14px 12px;
  }
  body.booking-page .format-card {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    grid-template-rows: auto 1fr auto;
    height: auto;
    min-height: 0;
    padding: 16px;
    gap: 10px 12px;
    border-radius: 16px;
  }
  body.booking-page .format-card .lesson-title {
    grid-column: 1 / -1;
    min-height: 0;
    font-size: 24px;
    line-height: 1.08;
    white-space: normal;
  }
  body.booking-page .format-card .lesson-title br { display: none; }
  body.booking-page .format-card .lesson-description { grid-column: 1 / -1; align-self: start; font-size: 14px; line-height: 1.55; font-weight: 300; }
  body.booking-page .format-bottom,
  body.booking-page .format-bottom > span:first-child { display: contents; }
  body.booking-page .format-bottom .lesson-price { grid-column: 2; grid-row: 3; align-self: end; font-size: 15px; white-space: nowrap; }
  body.booking-page .format-bottom .lesson-price small { font-size: 12px; }
  body.booking-page .format-bottom > span > small { grid-column: 1; grid-row: 3; align-self: end; margin: 0; font-size: 12px; }
  body.booking-page .format-arrow { grid-column: 2; grid-row: 3; align-self: end; justify-self: end; font-size: 22px; line-height: 1; }
  body.booking-page .booking-view > .yki-block {
    display: grid;
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: subgrid;
    align-items: stretch;
    height: auto;
    min-height: 0;
    padding: 16px;
    border: 1px solid transparent;
    gap: 10px 12px;
    border-radius: 16px;
  }
  body.booking-page .booking-view > .yki-block .yki-heading { grid-column: 1 / -1; padding: 0; font-size: 24px; line-height: 1.08; }
  body.booking-page .booking-view > .yki-block .yki-details,
  body.booking-page .booking-view > .yki-block .yki-overview { display: contents; }
  body.booking-page .booking-view > .yki-block .yki-description { grid-column: 1 / -1; font-size: 14px; line-height: 1.55; }
  body.booking-page .booking-view > .yki-block .yki-price { display: block; grid-column: 2; grid-row: 3; align-self: end; justify-self: start; margin: 0; padding: 0; border: 0; font-size: 15px; text-align: left; }

  body.booking-page :is(.step-heading h2, .calendar-heading h2, .booking-success-content h2) {
    font-size: 28px;
    line-height: 1.08;
    letter-spacing: -.035em;
  }
  body.booking-page :is(.step-heading p, .calendar-heading p, .booking-success-content p) { margin-top: 10px; font-size: 14px; line-height: 1.55; }
  body.booking-page .schedule-options { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 8px; }
  body.booking-page .schedule-option { position: relative; padding: 18px; border: 1px solid #fff; border-radius: 16px; }
  body.booking-page .schedule-option .format-kicker { font-size: 12px; }
  body.booking-page .schedule-option h3 { margin: 10px 0; font-size: 24px; }
  body.booking-page .schedule-option p { font-size: 14px; line-height: 1.55; max-width: none; padding-right: 20px; }
  body.booking-page .schedule-option > span:last-child { position: absolute; right: 18px; bottom: 16px; margin: 0; font-size: 22px; }

  body.booking-page .calendar-heading { flex-direction: column; align-items: stretch; gap: 18px; }
  body.booking-page .week-navigation { justify-content: space-between; gap: 12px; }
  body.booking-page .week-navigation button { width: 44px; height: 44px; }
  body.booking-page .week-navigation > span { font-size: 14px; }
  body.booking-page .week-navigation small { margin-top: 3px; }
  /* Keep the whole week's availability visible, using the desktop calendar's
     same rows, slots and selection behavior inside the phone content frame. */
  body.booking-page .calendar-grid {
    flex: none;
    grid-template-columns: 32px repeat(7, minmax(0, 1fr));
    grid-template-rows: 44px repeat(14, 28px);
    min-height: 0;
    gap: 4px;
    padding: 0;
  }
  body.booking-page .calendar-date { grid-column: auto; margin: 0; padding: 0 0 6px; justify-content: center; gap: 3px; cursor: default; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  body.booking-page .calendar-date span { font-size: 11px; }
  body.booking-page .calendar-date strong { font-size: 16px; }
  body.booking-page .calendar-date.is-day { background: transparent; }
  body.booking-page :is(.calendar-corner, .calendar-hour, .calendar-slot) { display: block; }
  body.booking-page .calendar-hour { font-size: 11px; font-variant-numeric: tabular-nums; }
  body.booking-page .calendar-slot { grid-column: auto; min-height: 28px; margin: 0; border-radius: 999px; }
  body.booking-page .calendar-slot.is-day { grid-column: auto; }
  body.booking-page .calendar-slot .slot-clock { display: none; }
  body.booking-page .slot-mark { margin: 0; font-size: 12px; }
  body.booking-page .booking-view--calendar > .calendar-actions {
    height: 156px;
    min-height: 156px;
    flex: 0 0 156px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 12px;
  }
  body.booking-page .calendar-selection { flex: 1; height: auto; font-size: 13px; line-height: 1.5; }
  body.booking-page .recurring-slot-summary { gap: 2px 12px; }
  body.booking-page .first-lesson { font-size: 12px; }
  body.booking-page .booking-primary { min-height: 48px; min-width: 0; padding: 13px 16px; font-size: 14px; border-radius: 999px; }

  body.booking-page .details-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  body.booking-page .slot-summary { margin: 18px 0 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
  body.booking-page #booking-details label { margin-bottom: 18px; font-size: 13px; }
  body.booking-page #booking-details :is(input, textarea) { min-height: 48px; font-size: 16px; }
  body.booking-page #booking-details textarea { min-height: 90px; max-height: 180px; }
  body.booking-page #booking-details .booking-primary { width: 100%; }
  body.booking-page .booking-status { height: 56px; min-height: 56px; flex: 0 0 56px; margin: 12px 0 0; padding: 0; font-size: 13px; line-height: 18px; }

  /* Keep the introduction alive between review and payment; secure fields
     retain readable size and grow into document flow, never into the footer. */
  body.booking-page .booking-view:has(.checkout-pair) { display: block; margin: 0; }
  body.booking-page .checkout-pair { position: static; width: 100%; grid-template-columns: minmax(0, 1fr); gap: 24px; transform: none; }
  body.booking-page .checkout-card-frame { height: auto !important; min-height: 560px; border-radius: 16px; }
  body.booking-page .checkout-card-frame .checkout-card-inner { position: static; width: 100%; transform: none; }
  body.booking-page .checkout-review-content { padding: 20px; min-height: 558px; display: flex; flex-direction: column; }
  body.booking-page .checkout-review-content > .slot-summary { margin-block: 22px; }
  body.booking-page .order-line { font-size: 15px; gap: 12px; }
  body.booking-page .order-line strong { font-size: 15px; }
  body.booking-page .order-line small { font-size: 13px; }
  body.booking-page .order-total { margin-top: auto; padding: 18px 0; font-size: 14px; }
  body.booking-page .order-total strong { font-size: 24px; }
  body.booking-page .policy-check { font-size: 13px; margin: 8px 0 18px; }
  body.booking-page .policy-check input { flex-shrink: 0; width: 18px; height: 18px; }
  body.booking-page .checkout-note { margin-top: 14px; font-size: 12px; }
  body.booking-page .payment-review { padding: 20px; }
  body.booking-page .payment-identity { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  body.booking-page .payment-identity :is(input, select) { height: 44px; font-size: 16px; }
  body.booking-page .payment-identity label { font-size: 12px; }
  body.booking-page .payment-consent { font-size: 12px; }
  body.booking-page .payment-review .booking-primary { min-height: 48px; }
  body.booking-page .payment-review .checkout-note { font-size: 12px; }
  body.booking-page :is(.booking-view--confirming, .booking-view--success) { min-height: 430px; justify-content: center; }
  body.booking-page :is(.booking-view--confirming, .booking-view--success) > .booking-success-content { position: static; width: 100%; transform: none; margin: auto; }
  body.booking-page .booking-success-content .slot-summary { margin-bottom: 26px; }

  body.booking-page > .contact-footer {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    width: var(--frame-width);
    block-size: auto;
    min-height: 0;
    margin: 12px auto 0;
    padding: 18px 0 max(16px, env(safe-area-inset-bottom));
    font-size: 12px;
  }
  body.booking-page .footer-brand { min-height: 44px; max-width: none; }
  body.booking-page .linkedin-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto; }
  body.booking-page .footer-links { gap: 28px; }
  body.booking-page .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
}
