/* Phone shell: header, one scrolling content pane, and navigation are siblings.
   No fixed HUD or bottom navigation can cover the scrolling lesson list. */
@media (max-width: 760px) {
  :root { --phone-height: 100vh; --phone-height: 100dvh; --hud-h: 56px; --glow-a: .18; }
  html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
  body { min-height: 0; background-attachment: scroll; }
  body::before, body::after { display: none; }
  .app { display: flex; flex-direction: column; width: 100%; height: var(--app-height, var(--phone-height)); min-height: 0; overflow: hidden; }
  .side, .rail { display: none; }
  .hud { position: relative; top: auto; flex: 0 0 auto; min-height: 56px; padding: calc(6px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px)); gap: 10px; border-bottom-width: 1px; background: var(--bg); backdrop-filter: none; }
  .hud .brand-mark { width: 30px; height: 30px; filter: none; }
  .hud-lvl { min-width: 0; max-width: none; gap: 7px; }
  .lvl-badge { flex: none; padding: 4px 8px; font-size: .75rem; letter-spacing: 0; }
  .lvl-badge b { font-size: 1rem; }
  .hud .xpbar { height: 22px; min-width: 44px; }
  .hud .xpbar span { font-size: .75rem; }
  .hud-stats { gap: 8px; }
  .hud .ring, .hud .hs.freeze { display: none; }
  .hud .hs { padding: 3px 6px; border: 0; background: transparent; font-size: .9rem; }
  .hud .hs .ic { width: 18px; height: 18px; }
  .hud .icon-btn { width: 42px; height: 42px; box-shadow: none; border-width: 1px; }
  .view { flex: 1 1 0; min-height: 0; width: 100%; padding: 18px max(14px, env(safe-area-inset-right, 0px)) 24px max(14px, env(safe-area-inset-left, 0px)); overflow: auto; overflow-x: hidden; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; scroll-padding-block: 16px; }
  .view > section { min-width: 0; }
  .collection-intro { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 14px; margin-bottom: 14px; }
  .collection-mark { grid-column: 1; grid-row: 1 / 3; }
  .collection-mark .ic { width: 26px; height: 26px; }
  .collection-intro > div { grid-column: 2; min-width: 0; }
  .collection-intro b { font-size: 1rem; }
  .collection-intro p { font-size: .9rem; line-height: 1.5; }
  .collection-intro > .btn { grid-column: 2; justify-self: start; }
  .dock { position: relative; inset: auto; flex: 0 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; gap: 2px; padding: 5px max(6px, env(safe-area-inset-right, 0px)) calc(5px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); border-top-width: 1px; background: var(--bg2); backdrop-filter: none; }
  .dk { min-width: 0; min-height: 52px; padding: 4px 1px; gap: 2px; font-size: .875rem; line-height: 1.3; justify-content: center; }
  .dk .ic { width: 22px; height: 22px; }
  .dk.on { text-shadow: none; }
  .dk .pill { inset-inline-end: 12%; }
  .view-h { align-items: center; gap: 10px; margin-bottom: 16px; }
  .arcade-h { font-size: 1.75rem; text-shadow: none; line-height: 1.25; }
  .arcade-h.sm { font-size: 1.35rem; }
  .eyebrow { font-size: .8rem; letter-spacing: .04em; }
  .view-h .eyebrow { display: none; }
  .panel, .announcer, .mode, .world, .wcard { box-shadow: 0 2px 0 var(--shadow); border-width: 1px; }
  .btn { min-height: 44px; padding: 10px 16px; box-shadow: 0 3px 0 var(--sh); font-size: 1rem; }
  .btn.sm { min-height: 44px; padding: 9px 12px; font-size: .9rem; }
  .chip { min-height: 42px; padding: 7px 12px; font-size: .9rem; border-width: 1px; }
  .chips { gap: 6px; }
  .pool-bar { gap: 6px; margin-bottom: 12px; }
  .pool-bar > span:first-child { width: 100%; font-size: .9rem; }
  .pool-bar > .muted { width: 100%; font-size: .875rem; margin-block: 4px; }
  .modes { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
  .mode { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: start; column-gap: 12px; row-gap: 8px; padding: 16px 14px; border-radius: 16px; }
  .mode > .mode-ic { grid-column: 1; grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 11px; border-width: 1px; box-shadow: none; }
  .mode-ic .ic { width: 23px; height: 23px; }
  .mode > h3 { grid-column: 2 / -1; grid-row: 1; font-size: 1.15rem; line-height: 1.4; }
  .mode > p:not(.best) { grid-column: 2 / -1; grid-row: 2; min-width: 0; font-size: .95rem; line-height: 1.65; flex: none; }
  .mode > .best { grid-column: 2; grid-row: 3; align-self: center; margin: 0; font-size: .875rem; flex-wrap: wrap; gap: 4px; }
  .mode > .btn { grid-column: 3; grid-row: 3; align-self: center; justify-self: end; margin: 2px 0 0; min-width: 84px; }
  .mode > .hiscore { grid-column: 2 / -1; grid-row: 4; margin: 0; }
  .review-card { grid-template-columns: 40px minmax(0, 1fr); }
  .review-card > .mode-ic { grid-row: 1; }
  .review-card > div { grid-column: 2; min-width: 0; }
  .review-card h3 { font-size: 1.1rem; line-height: 1.4; margin-bottom: 4px; }
  .review-card p { font-size: .95rem; line-height: 1.65; }
  .review-card > .btn { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; margin-top: 4px; width: 100%; }
  .meaning-banner { padding: 14px; margin: 14px 0; gap: 10px; }
  .meaning-banner b { font-size: 1rem; }
  .meaning-banner p { font-size: .9rem; line-height: 1.6; }
  .meaning-banner .btn { width: auto; }
  .jtabs { gap: 6px; }
  .jtab { min-width: 0; padding: 10px 6px 12px; box-shadow: none; }
  .jtab b { font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
  .jtab span { font-size: .75rem; }
  .world-head { grid-template-columns: auto minmax(0, 1fr) auto; padding: 12px 10px; }
  .wtitle { white-space: normal; font-size: 1rem; line-height: 1.4; }
  .wnum { font-size: .7rem; letter-spacing: 0; padding: 3px 5px; }
  .node-wrap { width: 80px; }
  .announcer { padding: 12px; gap: 10px; }
  .announcer .ali { width: 44px; }
  .announcer p { font-size: .95rem; line-height: 1.55; }
  .wgrid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .wcard { min-height: 0; padding: 16px; }
  .wc-category { margin-bottom: 10px; }
  .wc-body { gap: 6px; }
  .wc-body b { font-size: 1.35rem; }
  .wc-ar { font-size: 1rem; }
  .wsearch input, textarea, input[type="text"] { font-size: 16px; }
  .profile { gap: 12px; }
  .profile > div { min-width: 0; }
  .profile .ali.big { width: 64px; }
  .set, .tog { gap: 12px; }
  .set > span, .tog > span { min-width: 0; }
  .set .seg { max-width: 100%; }
  .set .seg button { padding-inline: 10px; }
  .achs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achs .ach { min-width: 0; }
  .swatches, .outfits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .swatch, .outfit { min-width: 0; padding: 10px 6px; }
  .quest { gap: 8px; }
  .q-body { min-width: 0; }
  .q-ic { width: 32px; height: 32px; }
  .ltable li { gap: 6px; }
  .ln { overflow-wrap: anywhere; min-width: 0; }
  .bot { font-size: .7rem; }
  .stage { inset: 0 auto auto 0; width: 100%; height: var(--app-height, var(--phone-height)); max-height: var(--app-height, var(--phone-height)); overscroll-behavior: contain; scroll-padding-block: 12px; }
  .st-wrap { min-height: 100%; padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 0; }
  .st-wrap.center { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .st-top { gap: 8px; min-height: 48px; }
  .st-title { font-size: .8rem; margin-block: 8px; }
  .st-body { padding: 10px 0 16px; }
  .st-foot { position: relative; bottom: auto; padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bg); flex-wrap: wrap; }
  .stage:has(.fb:not([hidden])) .st-body { padding-bottom: 12px; }
  .stage:has(.fb:not([hidden])) .st-foot { display: none; }
  .fb { position: relative; inset: auto; max-height: none; width: calc(100% + 28px); margin-inline: -14px; padding: 16px 14px calc(18px + env(safe-area-inset-bottom, 0px)); animation: none; }
  .fb-in { display: flex; flex-direction: column; gap: 12px; }
  .fb-txt { width: 100%; }
  .fb-btns { display: flex; flex-direction: row; align-items: center; gap: 10px; width: 100%; }
  .fb-btns .btn { flex: 1; min-height: 48px; }
  .fb-why { font-size: 1rem; line-height: 1.6; }
  .opts { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .opts .opt { min-height: 54px; padding: 12px 14px; font-size: 1rem; line-height: 1.5; border-width: 2px; box-shadow: 0 3px 0 color-mix(in srgb, var(--line) 80%, #000); }
  .opt-t { overflow-wrap: anywhere; }
  .definition-card { margin-block: 8px 16px; padding: 18px; border-radius: 14px; }
  .definition-card .ex-q { font-size: 1.3rem; line-height: 1.6; }
  .definition-card .sentence { font-size: 1rem; }
  .context-clue { margin-bottom: 18px; padding: 12px 14px; }
  .ex-kicker { font-size: .95rem; letter-spacing: .02em; }
  .learn .term, .wsheet .term { font-size: 1.8rem; line-height: 1.3; }
  .learn-line .meaning { font-size: 1.08rem; line-height: 1.6; }
  .learn-line .example { font-size: 1rem; }
  .term-sm { font-size: 1.6rem; }
  .pairs .card { aspect-ratio: auto; min-height: 112px; }
  .pairs .card .face { font-size: .9rem; line-height: 1.45; }
  .match .mt { min-height: 62px; font-size: .9rem; line-height: 1.5; }
  .inv { height: var(--app-height, var(--phone-height)); min-height: 0; }
  .inv-sky { min-height: 120px; }
  .rh-opt { min-width: 0; }
  .scrim { height: var(--app-height, var(--phone-height)); bottom: auto; }
  .sheet, .sheet.wide { max-height: calc(var(--app-height, var(--phone-height)) - 16px); padding: 56px 16px calc(20px + env(safe-area-inset-bottom, 0px)); border-bottom: 0; border-radius: 20px 20px 0 0; }
  .sheet-x { top: 10px; }
  .sheet-h { margin-inline: 0; }
  .toasts { top: calc(8px + env(safe-area-inset-top, 0px)); }
  .in-stage .toasts { top: calc(60px + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 360px) {
  .hud { gap: 6px; padding-inline: 10px; }
  .hud .hs { display: none; }
  .jtab b { font-size: .8rem; }
  .view { padding-inline: 12px; }
  .mode { column-gap: 10px; }
  .mode > p:not(.best) { grid-column: 1 / -1; }
  .mode > .mode-ic { grid-row: 1; }
}
@media (max-width: 760px) and (max-height: 500px) {
  .hud { min-height: 48px; padding-block: 3px; }
  .dock { padding-block: 3px; }
  .dk { min-height: 42px; flex-direction: row; gap: 6px; }
  .view { padding-top: 12px; }
}
