/* Phone layout (700px and below): app-style bottom tab bar, one section per tab.
   Desktop is untouched: nothing here applies above 700px.
   The tab bar shows on phones even without JavaScript (its links are plain anchors).
   html.app (set by mobile-app.js) turns on the one-section-at-a-time view. */

.app-tabbar,
.app-home,
.app-leg-switch,
.app-map-toggle { display: none; }

@media (max-width: 700px) {
  /* ---------- Bottom tab bar ---------- */
  .app-tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
    background: rgba(11, 11, 13, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
  }
  .app-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 48px;
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    -webkit-tap-highlight-color: transparent;
  }
  .app-tabbar svg { width: 22px; height: 22px; display: block; }
  .app-tabbar a[aria-current="page"] { color: var(--accent); }

  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }

  /* The bottom bar replaces the burger menu. */
  .nav-burger,
  .nav nav { display: none; }
  .nav { padding: 0.6rem 1.25rem; }
  .nav-mark { height: 36px; }
}

@media (max-width: 700px) {
  /* ---------- One section at a time ---------- */
  html.app [data-panel]:not(.is-active) { display: none !important; }
  html.app [data-panel].is-active { animation: app-in 0.2s ease-out; }
  @keyframes app-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce) {
    html.app [data-panel].is-active { animation: none; }
  }

  /* Music and Photos live in the shared .top-grid; let each fill the screen on its own. */
  html.app .top-grid { padding: 0; border-bottom: 0; display: block; }
  html.app .grid-music,
  html.app .grid-photos { padding: 2rem 1.25rem; margin: 0; border-top: 0; }
  html.app .section,
  html.app .mini-signup { border-bottom: 0; }

  /* ---------- Home tab ---------- */
  html.app .hero { border-bottom: 0; }
  html.app .app-home { display: grid; gap: 0.6rem; padding: 1.25rem 1.25rem 1.5rem; }
  .app-home a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 56px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-alt);
    color: var(--fg);
    text-decoration: none;
  }
  .app-home a.is-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
  .app-home .app-home-label { display: flex; flex-direction: column; gap: 0.15rem; }
  .app-home strong { font-size: 1rem; font-weight: 700; }
  .app-home small { font-size: 0.8rem; color: var(--fg-muted); }
  .app-home a.is-primary small { color: inherit; opacity: 0.75; }
  .app-home .app-chev { font-size: 1.2rem; line-height: 1; opacity: 0.7; }

  /* ---------- Live tab ---------- */
  /* The tab is the "Live" title and the switch names the leg, so drop the repeats. */
  html.app #paper-sails-tour { margin-top: 0; padding-top: 0; border-top: 0; }
  html.app .tour-heading { margin-bottom: 0.9rem; }
  html.app .tour-heading-sub,
  html.app .tour-leg-heading { display: none; }
  html.app #live > h2 { margin-bottom: 1rem; }
  html.app .app-leg-switch {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 3px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-alt);
  }
  .app-leg-switch button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-height: 48px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--fg-muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
  }
  .app-leg-switch small { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.02em; opacity: 0.8; }
  .app-leg-switch button[aria-selected="true"] { background: var(--accent); color: var(--accent-contrast); }
  html.app .tour-shows-list [data-leg]:not(.is-leg) { display: none; }

  /* Compact show rows: date and place on the left, ticket button on the right. */
  html.app .tour-shows-list { gap: 0; }
  html.app .show-row {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: none;
    margin: 0;
  }
  html.app .show-main { min-width: 0; flex: 1; }
  html.app .show-main > a,
  html.app .show-kicker { display: none; }
  html.app .show-info { gap: 0.15rem; min-width: 0; }
  /* City-first rows (see .show-city in style.css), a little smaller on phones. */
  html.app .show-city { font-size: 1.45rem; }
  html.app .show-sub { font-size: 0.85rem; }
  html.app .show-actions { width: auto; flex-shrink: 0; align-items: flex-end; }
  html.app .show-tickets {
    width: auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 0.95rem;
    font-size: 0.72rem;
  }
  html.app .show-more-links summary { text-align: right; font-size: 0.72rem; }
  html.app .show-more-links a { text-align: right; }

  /* Map and hotels fold away behind one button. */
  html.app .app-map-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-alt);
    color: var(--fg);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
  }
  html.app #venues-map:not(.is-open) { display: none; }
  html.app #venues-map.is-open { margin-top: 1rem; }
}
