/* Shared additions stay quiet on desktop; phone layout follows the sidebar breakpoint. */
.mobile-navigation, .mobile-settings-chooser, .mobile-filter-toggle { display: none; }
.equipment-filter-fields { display: contents; }
.crew-creator-credit { margin: 12px 0 4px; color: var(--text2); font-size: 13px; line-height: 1.6; }
.crew-creator-credit strong { font-weight: 600; }
#dashboard-local-clock { display: none; }
.event-description-options > summary { cursor: pointer; list-style: none; }
.event-description-options > summary::-webkit-details-marker { display: none; }
.event-description-options > summary::after { content: '+'; margin-left: auto; font-family: var(--font-body); }
.event-description-options[open] > summary::after { content: '−'; }
.event-description-options[open] > summary { margin-bottom: 16px; }

@media (max-width: 900px) {
  html { scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { font-size: 16px; line-height: 1.55; }
  /* All editable controls need readable text before focus, including injected auth forms. */
  body :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: 16px !important; min-width: 0; max-width: 100%; }
  body :is(.form-input, .form-select, .auth-gate-input) { min-height: 48px; padding: 11px 12px; }
  body .form-textarea { min-height: 120px; padding: 12px; }
  :is(input, select, textarea) { scroll-margin: 84px 0 24px; }
  .form-label, .signup-step-title { font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
  .text-muted, .signup-name-help, .signup-role-hint, .signup-entry-sub, .signup-custom-booking-help,
  .equipment-context-hint, .equipment-window-hint, .personal-conflict-hint, .profile-file-note,
  .event-overlap-warning :is(p, li, label) { font-size: 14px; line-height: 1.6; }
  html.crew-mobile-enhanced :is(.btn, .btn-sm, .filter-chip, .tab, .checkbox-label, .notification-choice, .sidebar-choice) { min-height: 44px; }
  html.crew-mobile-enhanced :is(.btn, .btn-sm) { font-family: var(--font-body); font-size: 14px; font-weight: 600; line-height: 1.4; padding: 11px 14px; white-space: normal; letter-spacing: 0; text-transform: none; }
  :is(.quick-search-button, .notification-button, .mob-menu-btn, .modal-close, .crew-date-trigger) { min-width: 44px; min-height: 44px; }
  .modal-close { width: 44px; height: 44px; top: 12px; right: 12px; }
  .modal-close svg { width: 18px; height: 18px; }
  .topbar { --topbar: 64px; height: 64px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: var(--bg2); box-shadow: none; }
  .topbar-title { font-family: var(--font-body); font-size: 18px; font-weight: 600; letter-spacing: -.03em; }
  .topbar-heading, .topbar-actions { gap: 6px; }
  .topbar-actions > .berlin-clock { display: none; }
  .crew-mobile-enhanced .mob-menu-btn { display: none; }
  .quick-search-button, .notification-button { border-radius: 12px; }
  .page { padding: 20px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left)); }
  body.mobile-nav-ready .main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .page-title { font-size: 32px; line-height: 1.1; }
  .page-sub { margin-top: 8px; font-size: 14px; line-height: 1.6; }
  .page-hero { padding: 0 0 20px; margin-bottom: 20px; border: 0; border-bottom: 1px solid var(--border2); border-radius: 0; background: transparent; gap: 14px; }
  .page-hero::before { display: none; }
  .page-kicker { font-size: 11px; margin-bottom: 6px; }
  .page-hero-actions, .page-hero-actions .btn { width: auto; }
  .card { padding: 16px; }
  .mobile-navigation { position: fixed; z-index: 95; bottom: 0; left: 0; right: 0; grid-template-columns: repeat(var(--mobile-nav-count, 5), minmax(0, 1fr)); gap: 2px; padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid var(--border2); background: var(--bg2); box-shadow: 0 -4px 24px rgba(20,20,30,.05); }
  body.auth-ready.mobile-nav-ready .mobile-navigation { display: grid; }
  .mobile-nav-item { display: flex; min-height: 56px; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 5px 2px; border: 0; border-radius: 12px; color: var(--text2); background: transparent; font-family: var(--font-body); font-size: 11px; font-weight: 500; line-height: 1.25; text-align: center; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; }
  .mobile-nav-item.active { background: var(--accent-dim2); color: var(--accent); }
  .mobile-nav-icon { display: flex; align-items: center; justify-content: center; }
  .mobile-nav-icon svg { width: 22px; height: 22px; stroke-width: 1.7; }
  body:is(.modal-open, .quick-search-open, .crew-keyboard-open) .mobile-navigation { visibility: hidden; pointer-events: none; }
  .mobile-menu-link { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 12px; border-radius: 12px; color: var(--text); font-size: 16px; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
  .mobile-menu-link.active { background: var(--accent-dim2); color: var(--accent); }
  .mobile-menu-link:hover { background: var(--bg3); }
  .mobile-menu-link > svg { width: 22px; height: 22px; flex-shrink: 0; }
  .mobile-menu-section { margin: 18px 0; }
  .mobile-menu-section h3 { font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text3); margin: 0 12px 8px; }
  .mobile-menu-other { margin: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .mobile-menu-other summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 12px; font-size: 16px; cursor: pointer; }
  .mobile-menu-other summary span { font-size: 13px; color: var(--text3); }
  .mobile-settings-link { margin-top: 12px; }
  .mobile-workspace-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  /* Dialogs follow the visible viewport when the software keyboard opens. */
  .modal-backdrop { top: var(--crew-visible-top, 0px); bottom: auto; height: var(--crew-visible-height, 100dvh); padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); align-items: center; }
  .modal-backdrop > .modal { position: relative; width: 100%; max-width: 640px !important; max-height: 100%; margin: 0; padding: 22px 16px; border-radius: 20px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .modal-title { padding-right: 48px; min-height: 44px; display: flex; align-items: center; font-size: 26px; line-height: 1.15; }
  .modal-sub { font-size: 14px; line-height: 1.6; margin: 8px 0 22px; }
  #event-modal > .modal, #equip-reserve-modal > .modal { height: 100%; }
  .event-form-section { padding: 16px 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; margin-bottom: 8px; }
  .event-form-section-title { font-family: var(--font-body); font-size: 15px; font-weight: 600; letter-spacing: 0; }
  .event-role-setup :is(p, .event-role-setup-note), .event-custom-roles p, .event-edit-continuity-note { font-size: 14px; line-height: 1.6; }
  .event-role-setup-signal { display: none; }
  .event-role-option { min-height: 52px; }
  .event-role-option > span:nth-of-type(2), .event-role-count strong { font-size: 14px; }
  .event-description-options > summary { min-height: 48px; }
  .form-row2, .form-row3 { grid-template-columns: minmax(0, 1fr); }
  .toast-container { left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; width: 100%; font-size: 14px; }
  body.crew-keyboard-open .toast-container { bottom: 16px; }
  .notification-panel { left: 8px; right: 8px; width: auto; max-height: calc(var(--crew-visible-height, 100dvh) - 150px); }
  #all-pages-popover.quick-search-dialog { top: calc(var(--crew-visible-top, 0px) + 8px); max-height: calc(var(--crew-visible-height, 100dvh) - 16px); padding: 16px; }
  body.auth-locked.crew-keyboard-open .auth-gate { align-items: start; }
  /* Personal next booking comes before dashboard tools and secondary statistics. */
  #page-home.active { display: flex; flex-direction: column; gap: 18px; }
  .dashboard-header { display: contents; }
  .dashboard-header > div:first-child { order: 0; }
  .dashboard-header .page-title { font-family: var(--font-body); font-size: 24px; font-weight: 600; letter-spacing: -.04em; }
  #dashboard-local-clock { display: flex; margin-top: 10px; }
  #dashboard-local-clock .berlin-clock { justify-content: flex-start; gap: 8px; margin-left: 0; }
  #dashboard-local-clock .berlin-clock > div:last-child { display: flex; gap: 8px; align-items: baseline; }
  #dashboard-local-clock .clock-city { display: block; font-size: 12px; }
  #dashboard-local-clock .clock-time { font-size: 12px; color: var(--text2); }
  #dashboard-local-clock .clock-dot { display: block; width: 5px; height: 5px; }
  #dashboard-focus { order: 1; margin: 0; padding: 20px; min-height: 0; border-radius: 18px; gap: 16px; }
  .dashboard-hero-title { font-family: var(--font-body); font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -.04em; }
  .dashboard-eyebrow { font-size: 12px; }
  .dashboard-hero-meta { font-size: 14px; gap: 8px; }
  .dashboard-hero-action, .dashboard-hero-action .btn { width: 100%; }
  .dashboard-header-actions { order: 2; gap: 10px; margin: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .dashboard-quick-actions { flex: 1 1 100%; }
  .dashboard-quick-link { min-height: 44px; }
  #media-pinned-announcement { order: 3; }
  #dashboard-stats { order: 4; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
  #dashboard-modules { order: 5; gap: 14px; }
  .dashboard-stat-card { padding: 16px 12px; }
  .dashboard-stat-label, .dashboard-stat-sub { font-size: 12px; line-height: 1.5; }
  .dashboard-module { padding: 0; }
  .dashboard-module-head { padding: 14px 16px; }
  .dashboard-module-body { padding: 8px 16px 12px; }
  .dashboard-empty { padding: 20px 0; }
  .dashboard-module-title { font-size: 20px; }
  .dashboard-list-title { font-size: 15px; }
  .dashboard-list-meta, .dashboard-empty { font-size: 14px; }
  .dashboard-list-sub { font-size: 12px; line-height: 1.5; white-space: normal; }
  /* Search stays visible; secondary filters are an explicit disclosure. */
  .mobile-filter-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
  .event-browse-toolbar, #equipment-filters { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
  .event-browse-search, #equipment-search { flex: 1 1 180px; min-width: 0; max-width: none !important; }
  .event-browse-search .form-input { min-height: 48px; }
  .crew-mobile-enhanced :is(#event-filters, #equipment-extra-filters):not(.mobile-filters-open) { display: none; }
  #event-filters, #equipment-extra-filters { flex: 1 1 100%; width: 100%; padding: 14px; border: 1px solid var(--border2); border-radius: 14px; background: var(--bg2); }
  #event-filters { display: flex; gap: 8px; }
  .filter-chip { font-size: 14px; padding: 10px 12px; }
  #equipment-extra-filters { display: grid; grid-template-columns: 1fr; gap: 10px; }
  #equipment-extra-filters .form-select { width: 100%; max-width: none !important; }
  .event-browse-summary p { font-size: 13px; }
  .event-card { border-radius: 16px; padding: 16px; gap: 14px; }
  .event-title { font-family: var(--font-body); font-size: 19px; font-weight: 600; line-height: 1.35; letter-spacing: -.025em; }
  .event-primary-meta { gap: 12px; }
  .event-primary-meta small { font-size: 12px; }
  .event-primary-meta strong { font-size: 15px; }
  .event-description, .event-setup-note, .event-open-role-caption, .event-signup-count { font-size: 14px; line-height: 1.6; }
  .event-card-actions { gap: 8px; }
  .event-card-actions > .btn-accent { width: 100%; justify-content: center; }
  .event-card-actions > .btn-ghost, .event-card-actions > .btn-danger { flex: 1 1 auto; justify-content: center; }
  .event-schedule-segment { padding: 10px; }
  .event-schedule-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-schedule-segment span { font-size: 12px; }
  .event-schedule-segment strong { font-size: 15px; }
  .special-event-photo, .special-event-banner.is-compact .special-event-photo { min-height: 120px; max-height: 150px; }
  .special-event-copy, .special-event-banner.is-compact .special-event-copy { padding: 20px; }
  #signup-special-event .special-event-photo { display: none; }
  .special-event-copy h2, .special-event-banner.is-compact .special-event-copy h2 { font-size: 30px; }
  .special-event-meta { font-size: 13px; }
  /* Event → time → role → review; keep independent custom bookings in one form. */
  .signup-entry-card { padding: 0 !important; border-radius: 18px; overflow: hidden; }
  #signup-entry-card > .signup-entry-head { padding: 18px 16px; }
  .signup-entry-title { font-size: 23px; }
  .signup-entry-body { padding: 0 16px 18px; }
  .signup-entry-grid { gap: 20px; }
  .signup-window-picker-head { align-items: flex-start; flex-direction: column; gap: 5px; margin-bottom: 10px; }
  .signup-window-picker-head strong, .signup-step-title { font-size: 16px; }
  .signup-window-picker-head > span { font-size: 12px; }
  .signup-window-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .signup-window-option { min-height: 102px; padding: 12px; }
  .signup-window-option strong, .signup-role-option strong { font-size: 14px; }
  .signup-window-option span { font-size: 18px; }
  .signup-window-option small, .signup-role-option small { font-size: 12px; }
  .signup-role-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .signup-role-option { min-height: 82px; padding: 12px; }
  .signup-role-option-head { align-items: flex-start; flex-wrap: wrap; gap: 6px; }
  .signup-role-option-head > span { font-size: 12px; }
  .signup-commitment { padding: 14px 0; margin-top: 16px; border-radius: 0; border: 0; border-top: 1px solid var(--border); }
  .signup-commitment strong { font-size: 16px; }
  .signup-booking-summary { padding: 16px; }
  .signup-booking-head h3 { font-size: 24px; }
  .signup-booking-details { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 0; }
  .signup-booking-details > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  .signup-booking-details dt { font-size: 12px; }
  .signup-booking-details dd { margin: 0; font-size: 14px; line-height: 1.55; }
  .signup-entry-actions { margin-top: 16px; }
  .signup-entry-actions .btn { min-height: 50px; }
  #signup-submit-status { font-size: 14px; }
  .signup-sheet-heading h2 { font-size: 25px; }
  .responsive-sheet-table td { grid-template-columns: 78px minmax(0, 1fr); font-size: 14px; }
  .responsive-sheet-table td::before { font-size: 11px; }
  .equipment-context-bar { padding: 16px; border-radius: 16px; gap: 12px; }
  .equipment-context-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-equipment-grid { gap: 14px; }
  .equipment-device-name { font-size: 20px; }
  .equip-name { font-size: 18px; line-height: 1.4; }
  .equip-detail { font-size: 14px; line-height: 1.6; }
  #equipment-grid .equipment-device-visual { min-height: 148px; }
  #equipment-grid .equipment-device-visual img { height: 116px; }
  .equipment-device-status { font-size: 13px; }
  .equipment-device-action, .equipment-device-action .btn { min-height: 44px; }
  .reservation-review { font-size: 14px; padding: 16px; }
  .equipment-window-hint { font-size: 14px; }
  .mobile-settings-chooser { display: grid; gap: 8px; margin-bottom: 20px; }
  .mobile-settings-chooser label { font-size: 14px; color: var(--text2); }
  .crew-mobile-enhanced .settings-nav { display: none; }
  .settings-layout { display: block; }
  .settings-content { min-width: 0; }
  .profile-panel-head { padding: 18px 16px; }
  .profile-panel-head h3 { font-size: 23px; }
  .profile-panel-head p { font-size: 14px; line-height: 1.6; }
  .profile-panel-body { padding: 18px 16px; }
  .sidebar-layout-options { grid-template-columns: 1fr; }
  .sidebar-layout-option { padding: 16px; }
  .sidebar-layout-heading strong { font-size: 16px; }
  .sidebar-layout-option > span:last-child, .sidebar-selection-summary, .sidebar-choice { font-size: 14px; }
  .crew-updates-hero { padding: 24px 18px; }
  .crew-creator-credit { font-size: 14px; }
  body .auth-gate { min-height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); }
  body .auth-gate-card { padding: 24px 20px; width: 100%; max-width: 440px; }
  body .auth-gate-label { font-size: 14px; }
  body #auth-gate-submit { min-height: 48px; font-family: var(--font-body); font-size: 16px; font-weight: 600; text-transform: none; }
  body :is(.auth-secondary-button, .auth-password-reset) { min-height: 44px; font-size: 14px; }
}

@media (max-width: 420px) {
  .event-card { padding-top: 76px; }
  .event-date-box { top: 16px; left: 16px; }
  .event-card-badges { top: 18px; left: 82px; right: 16px; }
}
@media (max-height: 500px) and (max-width: 900px) {
  .mobile-navigation { padding-top: 3px; padding-bottom: calc(3px + env(safe-area-inset-bottom)); }
  .mobile-nav-item { min-height: 44px; flex-direction: row; gap: 7px; }
  .modal-backdrop { padding: 4px; }
  .modal-backdrop > .modal { border-radius: 12px; }
}
