/*
 * Phone comfort layer for the read-only screen samples (/demo/ and the operator sample).
 * Loaded after demo.css; desktop widths are unchanged.
 */
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { font-size: 15px; }
  input, select, textarea { font-size: 16px !important; }
  .sample-banner { font-size: 12px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .sample-tag { font-size: 13px; }
  .sidebar { padding: 12px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .brand { min-height: 44px; }
  .brand > span { font-size: 15px; letter-spacing: 1px; }
  .brand small { display: none; }
  #primary-nav { gap: 8px; margin: 10px -16px 0; padding: 0 16px 12px; scroll-padding-inline: 16px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: none; }
  #primary-nav::-webkit-scrollbar { display: none; }
  .nav-link { min-height: 44px; padding: 10px 14px; font-size: 14px; gap: 8px; border-color: var(--line); background: #f5f2eb; scroll-snap-align: start; }
  .nav-link .icon { width: 17px; height: 17px; }
  .nav-link .nav-count { font-size: 12px; min-width: 20px; text-align: center; }
  .mode-switch { top: 12px; right: 16px; }
  .mode-switch button { min-height: 44px; font-size: 13px; }
  .topbar { min-height: 0; padding: 10px 16px; }
  .header-actions .button-small, .setup-link { white-space: nowrap; }
  .breadcrumb { font-size: 14px; }
  .header-actions { gap: 12px; }
  .setup-link { min-height: 44px; font-size: 14px; }
  .button { min-height: 44px; font-size: 14px; }
  .button-small { min-height: 44px; padding: 10px 14px; font-size: 14px; }
  .text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
  .main-content { padding: 20px 16px 32px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .eyebrow { font-size: 12px; letter-spacing: 1.6px; }
  .page-intro p { font-size: 14px; line-height: 1.75; }
  .intro-tag, .pill { font-size: 12px; }
  .hero { padding: 22px 18px; }
  .hero-description { font-size: 14px; line-height: 1.75; }
  .balance-label { font-size: 13px; }
  .expiry { font-size: 13px; }
  .hero-bottom p { font-size: 13px; }
  .step-index { font-size: 12px; }
  .card-pad, .next-card { padding: 22px 18px; }
  .next-card p, .featured-event > p, .summary-card p, .session-info p, .perk-body p, .task-card p { font-size: 14px; line-height: 1.75; }
  .reward small, .perk-value small { font-size: 12px; }
  .progress-caption { font-size: 13px; }
  .stat-card p, .stat-caption { font-size: 13px; }
  .stat-number small { font-size: 13px; }
  .list-row h3 { font-size: 15px; }
  .list-row p { font-size: 13px; }
  .date-block small { font-size: 12px; }
  .event-date p { font-size: 13px; }
  .event-date strong { font-size: 14px; }
  .notice, .notice p { font-size: 14px; }
  .filters { gap: 8px; }
  .filter-button, .admin-tab { min-height: 44px; font-size: 14px; }
  .filter-select { min-height: 44px; font-size: 13px; }
  select { min-height: 44px; }
  .result-count { font-size: 13px; }
  .card-index { font-size: 13px; }
  .task-meta > small { font-size: 12px; }
  table { font-size: 13px; }
  td { font-size: 14px; }
  caption, th, th.number-cell { font-size: 12px; }
  .cell-person small { font-size: 12px; }
  .cell-person .avatar { font-size: 12px; }
  .breakdown-row { font-size: 14px; min-height: 44px; }
  .empty-state p { font-size: 14px; }
  .session-card .button { font-size: 14px; }
  .page-footer { font-size: 12px; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
  .dialog-detail { font-size: 13px; }
  .dialog-actions .button { min-height: 44px; font-size: 14px; }
  .icon-button { min-width: 44px; min-height: 44px; }
  .admin-tabs { gap: 8px; }
  .sidebar:has(.mode-switch) #primary-nav { margin-top: 20px; }
  .admin-toolbar p, .form-actions p { font-size: 13px; }
  .field label { font-size: 14px; }
  .field input, .field textarea { min-height: 48px; }
  .field small { font-size: 12px; }
}

@media (max-width: 560px) {
  .stat-grid, .admin-summary { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { align-items: center; padding: 16px; }
  .stat-card .icon-box { display: inline-flex; width: 40px; height: 40px; }
}

@media (max-width: 430px) {
  /* The sample-mode switch moves below the logo so it never covers the brand. */
  .mode-switch { position: static; width: auto; margin: 10px 0 0; }
  .sidebar:has(.mode-switch) #primary-nav { margin-top: 12px; }
  /* The highlighted menu item and page heading already show the current page. */
  .breadcrumb { display: none; }
  .header-actions { flex: 1 1 auto; justify-content: flex-end; }
  .brand { gap: 9px; }
  .brand > span { font-size: 14px; letter-spacing: .5px; }
  .hero-description { font-size: 14px; }
  .expiry { font-size: 13px; }
  .balance-number span { font-size: 15px; }
  .list-row h3 { font-size: 15px; }
  .row-trailing .reward { font-size: 15px; }
  .row-trailing .reward small { font-size: 12px; }
  .stat-caption { font-size: 13px; }
  .hero-bottom { flex-direction: column; align-items: stretch; }
  .hero-bottom .button { width: 100%; }
  dialog { padding: 22px 18px; }
  .dialog-actions .button { padding: 11px 14px; font-size: 14px; }
}

@media (max-width: 360px) {
  .brand > span { font-size: 13px; }
  .mode-switch button { font-size: 12px; }
  .stat-caption { font-size: 12px; }
}
