/* Scoped to ?app=1, the Q-P1NG Android viewer: the app draws its own title bar, player and ⋮ menu. */
.app-mode .brand { display: none !important; }
/* With the contract channel (has-native) the app's ⋮ menu hosts the themes, the guide, rotation and lite mode
   (window.qglobeApp.command), and the app shows the loading state until "ready": no second copy here.
   Without the channel (an older app) the page keeps them in its own ⋮. */
.has-native :is(#btnMore, #tools, #btnTheme, #btnGuide, #btnAutoRotate) { display: none !important; }
.has-native .splash { display: none; }
/* The station's own website and sharing go through the app; volume is the phone's. */
.app-mode .volume { display: none; }
.app-mode:not(.has-native) :is(#btnShareStation, #btnExternal) { display: none !important; }
.app-mode #btnRevokeAudio { display: none !important; }

/* The app theme's title font (setTheme fonts.title, js/app-theme.mjs) on the large headings only: sheet, card, dialog
   and guide titles. Body text, list rows, chips, buttons, small labels and numbers stay in the system sans and mono
   for every theme. A fallback face (the system sans size-adjusted to the font) holds the final box until the font has
   loaded, so the swap moves nothing. Sizes: --qg-title-size (titles) and --qg-heading-size (guide sections): pixel
   fonts at integer multiples of their grid, other display fonts 18–22 px. No fake bold or italic, no tracking,
   balanced lines, never broken inside a word unless a single word is wider than the line. */
.app-mode :is(.sheet-title, .dir-card-title, .sheet-dialog h2, .guide-head h2, .native-tv header b) {
    font-family: var(--qg-font-title, var(--font)); font-synthesis: none; font-variation-settings: var(--qg-title-axes, normal);
    letter-spacing: 0; text-wrap: balance; hyphens: manual; overflow-wrap: break-word;
}
.app-mode[data-title-font] :is(.sheet-title, .dir-card-title, .sheet-dialog h2, .guide-head h2, .native-tv header b) { font-size: var(--qg-title-size, 20px); }
/* The sheet title wraps (balanced) rather than cutting words when the font is wide. */
.app-mode[data-title-font] .sheet-title { white-space: normal; }
.app-mode[data-title-font] .sheet-title > span { min-width: 0; text-wrap: balance; hyphens: manual; overflow-wrap: break-word; }
.app-mode[data-title-font] .guide-section h3 { font-family: var(--qg-font-title); font-size: var(--qg-heading-size, 18px); font-synthesis: none;
    font-variation-settings: var(--qg-title-axes, normal); letter-spacing: 0; text-wrap: balance; hyphens: manual; overflow-wrap: break-word; }

/* Live TV: the page lists channels; playback and the four-channel wall open in Q-P1NG. A dialog-like panel. */
.native-tv { position: fixed; z-index: 100; display: flex; flex-direction: column; gap: 12px; padding: 12px 12px calc(12px + var(--inset-b));
    inset: calc(var(--inset-t) + 8px) calc(var(--inset-x) + 8px) 0; max-width: 640px; margin-inline: auto;
    background: var(--surface-2); border: 1px solid var(--outline); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: 0 0 0 100vmax var(--scrim); }
.native-tv[hidden] { display: none; }
.native-tv header { display: flex; align-items: center; gap: 8px; padding-inline-start: 8px; }
.native-tv header b { flex: 1; font: 600 20px/28px var(--font); }
.native-tv .tv-layout { display: flex; padding: 4px; gap: 4px; border-radius: 24px; background: var(--surface-3); }
.native-tv .tv-layout button { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 20px; color: var(--on-surface-variant); font: 500 14px/20px var(--font); }
.native-tv .tv-layout button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.native-tv .tv-layout svg, .native-tv .tv-close svg { width: 20px; height: 20px; }
.native-tv .tv-close { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 24px; color: var(--on-surface); }
.native-tv input { height: 48px; padding: 0 16px; background: var(--surface); color: var(--on-surface); border: 1px solid var(--outline); border-radius: 24px;
    font: 400 16px/24px var(--font); user-select: text; -webkit-user-select: text; outline: none; }
.native-tv input:focus { border-color: var(--primary); }
.native-tv .tv-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 8px; flex: 1; min-height: 0; max-height: none;
    overflow-y: auto; align-content: start; flex-wrap: nowrap; }
.native-tv .tv-chan { position: relative; min-height: 56px; padding: 8px 12px; gap: 2px; border-radius: 12px; text-align: start; white-space: normal; background: var(--surface); }
.native-tv .tv-chan b { font: 600 14px/20px var(--font); padding-inline-end: 24px; overflow-wrap: anywhere; }
.native-tv .tv-chan[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.native-tv .tv-slot { position: absolute; top: 8px; inset-inline-end: 8px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
    background: var(--primary); color: var(--on-primary); font: 600 12px/1 var(--mono); }
.native-tv .tv-wall-go { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 24px; background: var(--primary); color: var(--on-primary); font: 500 14px/20px var(--font); }
.native-tv .tv-wall-go:disabled { background: var(--surface-3); color: var(--on-surface-variant); }
.native-tv .tv-wall-go svg { width: 20px; height: 20px; }
.native-tv p { font: 400 14px/20px var(--font); color: var(--on-surface-variant); }

/* Radio: the app's player shows title, place, format and the controls. The page keeps the mini-player to start a
   station and, while the app plays, only the names of the place's other stations. */
.app-mode :is(#btnPrevStation, #btnNextStation, #playerStatus, .eq) { display: none !important; }
.app-mode[data-native-playback] .player .player-row { display: none; }
.app-mode[data-native-playback] .player:not([data-chips="1"]) { display: none !important; }
.app-mode[data-native-playback] .player { background: none; border: 0; box-shadow: none; }
.app-mode[data-native-playback] .player .player-more { display: grid; padding: 0; }
.app-mode[data-native-playback] .player :is(.player-controls, .player-detail) { display: none; }
.app-mode[data-native-playback] .player .station-tag { background: var(--surface-2); box-shadow: var(--shadow); }

/* Picking a point for the app (Q-Cast): the globe only, with its hint in the sheet. */
.pick-mode :is(.chips, .map-tools) { display: none !important; }
