/* Shared by the React shell and generated HTML; no desktop visual overrides. */
.phone-header,
.phone-bottom-nav,
.mobile-quick-actions,
.mobile-first-day,
.welcome-mobile-copy,
.mobile-continue {
  display: none;
}

@media screen and (max-width: 767px) {
  :root {
    --phone-ink: #234d47;
    --phone-muted: #52645b;
    --phone-paper: #fbfaf7;
    --phone-border: #dce3da;
    --phone-nav-space: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .site-layout,
  body:has(> .phone-header) {
    padding-bottom: var(--phone-nav-space);
  }
  .desktop-site-header {
    display: none;
  }
  .phone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: calc(8px + env(safe-area-inset-top, 0px))
      max(16px, env(safe-area-inset-right, 0px)) 8px
      max(16px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--phone-border);
    background: var(--phone-paper);
    color: var(--phone-ink);
  }
  .phone-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
    font-family: Georgia, serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
  }
  .phone-brand span {
    font:
      12px/1.5 system-ui,
      sans-serif;
    color: var(--phone-muted);
  }
  .phone-header-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 4px;
  }
  .phone-account {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px;
    border-radius: 10px;
    color: var(--phone-ink);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  @media (max-width: 374px) {
    .phone-header {
      flex-wrap: wrap;
      gap: 0 8px;
    }
    .phone-header-actions {
      margin-left: auto;
    }
  }
  .phone-urgent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f5e9df;
    color: #754534;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
  }
  .phone-bottom-nav {
    position: fixed;
    z-index: 40;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    gap: 2px;
    padding: 6px max(8px, env(safe-area-inset-right, 0px))
      calc(6px + env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--phone-border);
    background: var(--phone-paper);
    box-shadow: 0 -3px 16px #234d4708;
    color: var(--phone-muted);
  }
  .phone-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    width: 100%;
    border-radius: 12px;
    font:
      600 12px/1.25 system-ui,
      sans-serif;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
  }
  .phone-nav-item svg {
    width: 22px;
    height: 22px;
  }
  .phone-nav-item[aria-current],
  .phone-more[open] > summary {
    color: var(--phone-ink);
    background: #e6eee5;
  }
  .phone-nav-item[aria-current] span {
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  .phone-nav-item::-webkit-details-marker {
    display: none;
  }
  .phone-more {
    min-width: 0;
  }
  .phone-more-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    max-height: calc(
      100dvh - var(--phone-nav-space) - env(safe-area-inset-top, 0px) - 24px
    );
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
    border: 1px solid var(--phone-border);
    border-radius: 20px;
    background: var(--phone-paper);
    box-shadow: 0 8px 32px #234d4726;
    color: var(--phone-ink);
  }
  .phone-more-title {
    margin: 4px 8px 8px;
    font-size: 16px;
    font-weight: 700;
  }
  .phone-more-panel a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 16px;
    text-decoration: none;
  }
  .phone-more-panel a + a {
    border-top: 1px solid var(--phone-border);
  }
  .phone-more-panel a[aria-current] {
    background: #e6eee5;
    font-weight: 700;
  }
  .phone-header a:focus-visible,
  .phone-bottom-nav :is(a, summary):focus-visible,
  .welcome-page a:focus-visible {
    outline: 2px solid var(--phone-ink);
    outline-offset: 3px;
  }
  .phone-nav-item:active,
  .phone-more-panel a:active,
  .mobile-action-grid a:active {
    background: #dce8db;
  }
  main [id] {
    scroll-margin-top: 16px;
    scroll-margin-bottom: calc(var(--phone-nav-space) + 16px);
  }
  footer a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Keep the desktop homepage DOM/content while arranging the phone journey. */
  .welcome-page {
    padding-top: 24px;
    padding-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .welcome-page > * {
    margin-block: 0;
  }
  .welcome-hero {
    gap: 28px;
  }
  .welcome-intro {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .welcome-intro > * {
    margin-block: 0;
  }
  .welcome-intro h1 {
    font-size: clamp(27px, 7.2vw, 32px);
    line-height: 1.18;
    color: var(--phone-ink);
  }
  .welcome-intro > p:first-child {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--phone-muted);
  }
  .welcome-intro > p {
    font-size: 16px;
    line-height: 1.55;
  }
  .welcome-desktop-copy {
    display: none;
  }
  .welcome-mobile-copy {
    display: inline;
  }
  .mobile-first-day {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 52px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--phone-ink);
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
  }
  .mobile-first-day svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
  .welcome-setup {
    display: flex;
    justify-content: center;
    min-height: 44px;
    padding: 8px;
    background: transparent;
    color: var(--phone-ink);
    font-size: 15px;
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  .welcome-intro .welcome-account-note {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
  }
  .mobile-quick-actions {
    display: block;
    color: var(--phone-ink);
  }
  .mobile-quick-actions h2 {
    margin: 0 0 14px;
    font-size: 21px;
    line-height: 1.3;
  }
  .mobile-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .mobile-action-grid a {
    min-width: 0;
    padding: 14px 12px;
    border: 1px solid var(--phone-border);
    border-radius: 16px;
    background: #f0f3ed;
    text-decoration: none;
  }
  .mobile-action-grid svg {
    width: 22px;
    height: 22px;
    margin-bottom: 12px;
  }
  .mobile-action-grid strong {
    display: block;
    font-size: 15px;
    line-height: 1.35;
  }
  .mobile-action-grid span span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--phone-muted);
  }
  .mobile-emergency-action {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 72px;
    margin-top: 10px;
    padding: 12px;
    border-radius: 16px;
    background: #f5e9df;
    color: #754534;
    text-decoration: none;
  }
  .mobile-emergency-action svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }
  .mobile-emergency-action svg:last-child {
    margin-left: auto;
  }
  .mobile-emergency-action strong,
  .mobile-emergency-action span span {
    display: block;
  }
  .mobile-emergency-action strong {
    font-size: 16px;
  }
  .mobile-emergency-action span span {
    font-size: 13px;
    margin-top: 2px;
  }
  .welcome-checklist {
    padding: 20px 0 0;
    border: 0;
    border-top: 1px solid var(--phone-border);
    border-radius: 0;
    background: transparent;
  }
  .welcome-checklist h2 {
    font-size: 22px;
    color: var(--phone-ink);
  }
  .welcome-checklist li {
    padding: 8px 0;
    border-radius: 0;
    background: transparent;
    font-size: 16px;
  }
  .welcome-checklist > a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  .mobile-continue {
    display: block;
    padding: 16px;
    border: 1px solid var(--phone-border);
    border-radius: 16px;
    background: #e6eee5;
    color: var(--phone-ink);
    overflow-wrap: anywhere;
  }
  .mobile-continue > p {
    margin: 0 0 4px;
    font-size: 13px;
  }
  .mobile-continue h2 {
    margin: 0;
    font-size: 22px;
  }
  .mobile-continue a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    margin-top: 8px;
    color: inherit;
    text-decoration: none;
  }
  .mobile-continue a strong,
  .mobile-continue a span span {
    display: block;
  }
  .mobile-continue a span span {
    font-size: 13px;
    margin-top: 4px;
  }
  .mobile-continue svg {
    width: 22px;
    flex-shrink: 0;
  }
}

@media print {
  .phone-header,
  .phone-bottom-nav,
  .mobile-quick-actions,
  .mobile-first-day,
  .mobile-continue {
    display: none !important;
  }
}

.static-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.static-skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  width: auto;
  height: auto;
  clip-path: none;
  padding: 12px;
  background: #fbfaf7;
  color: #234d47;
  outline: 2px solid currentColor;
}
@media (prefers-reduced-motion: reduce) {
  .phone-bottom-nav *,
  .welcome-page a {
    transition: none;
  }
}
