/* Shared mobile layout and touch refinements; desktop styles stay in their original files. */
@media (max-width: 980px) {
  .af-refresh .app-header .af-admin-launch { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .af-workspace-shell .app-header .header-actions:has(.af-admin-launch) { flex-basis: 44px; }
  .af-refresh .af-legacy-menu { overflow: visible !important; }
  .af-refresh .app-header:has(.af-legacy-menu[open]) { z-index: 1250; }
  .af-refresh .af-legacy-menu > nav {
    max-height: calc(var(--af-visible-height, 100dvh) - var(--header-h, 58px) - 96px);
    overscroll-behavior: contain;
  }
  .af-refresh .af-legacy-menu nav > a { min-height: 44px; box-sizing: border-box; display: flex; align-items: center; }
  .af-refresh .af-play-mobile > :is(a,button) { font-size: 11px !important; line-height: 1.3; white-space: nowrap; min-height: 52px; }
  .af-refresh .af-play-drawer[open] {
    display: flex; flex-direction: column; padding: 16px;
    max-height: calc(var(--af-visible-height, 100dvh) - 24px);
    overflow: hidden; overscroll-behavior: contain;
  }
  .af-refresh .af-play-drawer header { flex: 0 0 auto; }
  .af-refresh .af-play-drawer nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .af-refresh[data-route="calculate"] #parameters-layer {
    padding-top: calc(var(--header-h) + 10px);
    padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }
  .af-refresh #play-profile-dialog {
    inset: calc(var(--af-visible-top, 0px) + 12px) 12px auto;
    margin: 0 auto; width: calc(100% - 24px); max-width: 560px;
    max-height: calc(var(--af-visible-height, 100dvh) - 24px);
    overscroll-behavior: contain;
  }
  .af-refresh #play-profile-dialog .af-birth-sheet { background: linear-gradient(140deg,#19203bf5,#0a1224f7) !important; }
  .af-refresh .af-birth-sheet .af-unknown-time { min-height: 44px; }
  :is(.af-refresh,.landing-page) .af-control-disclosure { min-height: 44px; box-sizing: border-box; }
  .af-refresh .af-birth-sheet :is(input,.af-birth-field,.af-control-field) { scroll-margin-block: 80px 100px; }
  .af-refresh .af-birth-trigger { min-width: 44px; min-height: 44px; right: 2px; top: 2px; }
  .af-refresh .af-control-field .af-control-picker { width: 44px; height: 44px; right: 1px; }
  .af-refresh .af-birth-picker-popover:not([hidden]), .af-control-calendar {
    display: flex; flex-direction: column; overflow: hidden !important;
  }
  :is(.af-birth-picker-popover,.af-control-calendar) > :is(header,.af-calendar-week,footer) { flex: 0 0 auto; }
  :is(.af-birth-picker-popover,.af-control-calendar) > :is(.af-calendar-days,.af-calendar-choices,.af-time-columns) {
    min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
  }
  :is(.af-birth-picker-popover,.af-control-calendar) .af-time-columns { overflow: hidden; }
  :is(.af-birth-picker-popover,.af-control-calendar) .af-time-columns > section { display: flex; flex-direction: column; min-height: 0; }
  :is(.af-birth-picker-popover,.af-control-calendar) .af-time-columns h3 { flex: 0 0 auto; }
  :is(.af-birth-picker-popover,.af-control-calendar) .af-time-list { flex: 1 1 auto; min-height: 0; }
  :is(.af-birth-picker-popover,.af-control-calendar) .af-calendar-header button { min-height: 40px; }
  :is(.af-birth-picker-popover,.af-control-calendar) .af-calendar-header > button { min-width: 40px; width: 40px; }
  :is(.af-birth-picker-popover,.af-control-calendar) footer > button { min-height: 44px; }
  :is(.af-birth-picker-popover,.af-control-calendar) footer > span { font-size: 11px; }
  .af-refresh .af-birth-picker-popover .af-calendar-day { min-height: 38px; }
  :is(.af-birth-picker-popover,.af-control-calendar) .af-time-list button { flex: 0 0 44px; min-height: 44px; }
}
@media (max-width: 680px) {
  .landing-page:not(.admin-page) .site-header :is(.button-header,.af-admin-launch,.mobile-menu,.mobile-menu>summary) {
    width: 44px; min-width: 44px; height: 44px; min-height: 44px; flex-basis: 44px;
  }
}
@media (max-width: 540px) {
  .af-refresh .app-header .af-profile-copy :is(strong,span) {display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
  .af-refresh .af-profile-bar.af-profile-empty .af-profile-edit {width:44px;min-width:44px;flex:0 0 44px;padding:0;font-size:0!important;display:grid;place-items:center}
  .af-refresh .af-profile-bar.af-profile-empty .af-profile-edit::after {content:'+';font-size:24px;line-height:1}
  .af-refresh .af-profile-bar:not(.af-profile-empty) .af-profile-edit {
    width: 44px; min-width: 44px; flex: 0 0 44px; padding: 0; font-size: 0 !important;
    display: grid; place-items: center;
  }
  .af-refresh .af-profile-bar:not(.af-profile-empty) .af-profile-edit::after {
    content: ''; display: block; width: 19px; height: 19px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 4 4 4M4 20l4-1L20 7a2.8 2.8 0 0 0-4-4L4 16zM4 20h16'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 4 4 4M4 20l4-1L20 7a2.8 2.8 0 0 0-4-4L4 16zM4 20h16'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  }
}
@media (max-width: 980px) and (max-height: 600px) {
  .af-refresh .empty-state { min-height: 0 !important; padding: 20px 16px !important; }
  .af-refresh .empty-state .empty-orbit { width: 72px; height: 72px; margin-bottom: 12px; }
  .af-refresh .empty-state h1 { margin-block: 10px; font-size: clamp(24px,6vw,30px); }
  .af-refresh .empty-state p { margin-block: 10px 16px; }
}
@media (max-width: 980px) and (max-height: 430px) and (orientation: landscape) {
  .af-refresh .empty-state { padding: 12px 16px !important; }
  .af-refresh .empty-state .empty-orbit { width: 48px; height: 48px; margin-bottom: 8px; }
  .af-refresh .empty-state .empty-orbit i { width: 43px; height: 18px; }
  .af-refresh .empty-state .empty-orbit i:nth-child(3) { width: 25px; height: 25px; }
  .af-refresh .empty-state .empty-orbit b { font-size: 19px; }
  .af-refresh:not(.play-app) .empty-state .empty-orbit { display: none; }
  .af-refresh .empty-state h1 { margin-block: 8px; font-size: 24px; }
  .af-refresh .empty-state p { margin-block: 8px 12px; font-size: 13px; line-height: 1.5; }
}
