/* Extends the existing TVTECH theme and preserves CMS color choices. */
html, body { overflow: auto; overscroll-behavior: auto; }
.app { min-height: 100dvh; height: auto; overflow: visible; }
.header { position: sticky; top: 0; z-index: 10; }
.header-inner, .footer-inner, .main-inner { width: min(100% - 32px, 960px); }
.main { overflow: visible; padding: 20px 0 24px; }
.main-inner { overflow: visible; gap: 18px; }
.gps-panel { background: #fff; color: #182d2a; border: 1px solid #ccd9d5; border-radius: 16px; padding: clamp(18px, 4vw, 28px); }
.gps-panel h1 { margin: 0 0 10px; font-size: clamp(24px, 5vw, 34px); font-weight: 750; letter-spacing: -.025em; line-height: 1.18; text-wrap: balance; }
.gps-panel p { margin: 0 0 16px; max-width: 65ch; line-height: 1.6; color: #445d57; }
.gps-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.gps-primary, .gps-secondary { min-height: 48px; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 650; cursor: pointer; }
.gps-primary { background: #17594c; color: #fff; border: 1px solid #17594c; }
.gps-primary:hover { background: #104638; }
.gps-secondary { background: #fff; color: #17594c; border: 1px solid #8aa59c; }
.gps-primary:disabled { opacity: .6; cursor: wait; }
.gps-status { margin-top: 18px; padding-top: 16px; border-top: 1px solid #dce5e1; font-size: 15px; line-height: 1.6; }
.gps-status strong { display: block; color: #17594c; }
.gps-status[data-error="true"] strong { color: #972f20; }
.gps-panel .gps-note { margin: 12px 0 0; font-size: 13px; color: #4c625d; }
.gps-panel details { margin-top: 16px; }
.gps-panel summary { cursor: pointer; padding: 8px 0; font-weight: 650; }
.gps-points { margin: 8px 0 0; padding-left: 24px; line-height: 1.8; }
.media-zone, .audio-zone, .content-zone { flex-shrink: 0; }
.content-zone { min-height: 160px; }
.content-card { overflow: auto; max-height: 45vh; line-height: 1.75; }
.audio-actions { flex-wrap: wrap; }
.audio-btn, .tab-btn { min-height: 44px; }
.footer { position: sticky; bottom: 0; z-index: 9; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.fbtn { min-height: 56px; }
.ficon { width: 42px; height: 42px; }
.footer-inner { align-items: center; }
button:focus-visible, summary:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #d79a40; outline-offset: 4px; }
::selection { background: #cbe2d5; color: #123b31; }
input { caret-color: #17594c; }
#audioTime { font-variant-numeric: tabular-nums; }
@media (min-width: 800px) { .gps-panel { display: grid; grid-template-columns: 1fr auto; column-gap: 32px; } .gps-panel h1, .gps-panel > p { grid-column: 1; } .gps-controls { grid-column: 2; grid-row: 1 / 3; align-content: center; justify-content: flex-end; max-width: 225px; } .gps-status, .gps-panel details, .gps-panel .gps-note { grid-column: 1 / -1; } }
@media (max-width: 480px) { .header-inner, .footer-inner, .main-inner { width: calc(100% - 24px); } .audio-row { flex-wrap: wrap; } .audio-progress-wrap { flex-basis: 100%; } .gps-controls > button { flex: 1; } .title { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

.footer { position: fixed; left:0; right:0; bottom:0; }
.app { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.ficon { color:#fff; }
.ficon:has(img[src]) svg { display:none; }
/* Four equal footer actions; GPS state is explicit in text and aria-pressed. */
.footer-inner { grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; }
#btnPick {grid-column:1;justify-self:stretch;}
#btnScan {grid-column:2;justify-self:stretch;}
#btnGps {grid-column:3;justify-self:stretch;}
#btnLang {grid-column:4;justify-self:stretch;}
.fbtn {min-width:0;width:100%;border-radius:10px;padding:4px 2px;gap:2px;}
.flabel {font-size:clamp(10px,2.5vw,12px);line-height:1.4;}
#btnGps.gps-on {background:#e2f2e8;}
#btnGps.gps-on .flabel,#btnGps.gps-on .ficon {color:#123f36;}
#btnGps[aria-pressed="false"] .ficon {opacity:.75;}
#btnGps:disabled {opacity:.6;cursor:wait;}
.playback-source {font-size:13px;color:#445d57;margin-bottom:6px;font-weight:600;}
.gps-conflict {width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow:auto;border:0;border-radius:16px;padding:24px;color:#182d2a;background:#fff;box-shadow:0 16px 50px #0004;}
.gps-conflict::backdrop {background:#102c28b3;}
.gps-conflict h2 {font-size:22px;line-height:1.3;margin:0 0 14px;}
.gps-conflict p {font-size:16px;line-height:1.7;margin:0 0 22px;}
.gps-conflict-actions {display:flex;flex-direction:column;gap:10px;}
/* TVTECH_N3DL reference: white surfaces, ink text, brick action, deep green audio. */
:root {--guide-ink:#141923;--guide-red:#b33320;--guide-green:#285c47;}
html,body {background:#fff;color:var(--guide-ink);}
.header {display:none;}
.main {padding:10px 0 16px;}
.main-inner {width:min(calc(100% - 24px),1060px);gap:12px;}
.gps-panel {padding:0 2px;display:flex;align-items:center;gap:10px;border:0;background:transparent;border-radius:0;min-height:28px;}
.gps-panel h1,.gps-panel > p,.gps-panel details,#gpsStart,#gpsStop {display:none;}
.gps-panel .gps-controls {display:contents;}
.gps-status {margin:0;padding:0;border:0;min-width:0;flex:1;font-size:12px;line-height:1.4;}
.gps-status strong {display:inline;color:var(--guide-green);font-weight:650;}
#gpsStatusDetail {display:inline;margin-left:6px;color:#616772;}
#gpsResume {min-height:32px;padding:6px 10px;font-size:12px;}
.media-zone {padding:0;background:transparent;border-radius:12px;overflow:hidden;}
.media-box {background:#eef2ec;border-radius:12px;aspect-ratio:16/10;height:clamp(200px,34dvh,330px);}
.media-tabs {margin:0;gap:0;border-bottom:1px solid #e3e6e9;justify-content:stretch;}
.tab-btn {flex:1;justify-content:center;min-height:42px;padding:10px;border-radius:0;background:white;color:#60656e;font-weight:650;}
.tab-btn.is-active {background:white;color:var(--guide-red);box-shadow:inset 0 -3px var(--guide-red);}
.navBtn {backdrop-filter:none;}
.audio-zone {background:#edf4ef;border-radius:12px;padding:10px 12px;}
.audio-row {gap:10px;flex-wrap:wrap;}
.audio-actions {gap:6px;}
.audio-btn {border:1px solid #b9cabc;color:var(--guide-green);background:white;font-size:13px;font-weight:650;min-height:36px;padding:8px 12px;border-radius:8px;}
.audio-btn.is-active {background:var(--guide-green);color:white;border-color:var(--guide-green);}
.audio-time {color:#40554a;font-size:12px;}
.audio-progress {accent-color:var(--guide-green);}
.content-zone {padding:2px 2px 14px;background:white;min-height:0;border-radius:0;}
.content-title {font-size:24px;line-height:1.2;font-weight:750;color:var(--guide-ink);margin:2px 0 12px;}
.content-card {padding:0;color:#444b56;line-height:1.7;font-size:15px;overflow:visible;max-height:none;}
.content-card p {margin:0 0 12px;}
.playback-source {font-size:12px;color:#606872;margin-bottom:5px;}
.footer {background:white;border-top:1px solid #e0e4e7;padding:5px 0 max(5px,env(safe-area-inset-bottom));}
.footer-inner {width:min(calc(100% - 16px),1060px);}
.ficon {color:#5d636d;width:32px;height:32px;}
.ficon svg {width:25px;height:25px;}
.flabel {color:#5d636d;font-size:10px;}
.fbtn {min-height:52px;padding:3px 2px;border-radius:8px;}
.fbtn:hover {background:#f5f3f0;}
#btnGps.gps-on {background:#edf4ef;}
#btnGps.gps-on .flabel,#btnGps.gps-on .ficon {color:var(--guide-green);}
.app {padding-bottom:calc(74px + env(safe-area-inset-bottom));}
.demo-tools {font-size:12px;color:#656b75;}
.demo-tools summary {cursor:pointer;padding:5px 0;color:#9b301f;}
.demo-tools-body {padding:12px;background:#faf7f0;border:1px solid #e2d8c4;border-radius:10px;}
.demo-tools select {width:100%;min-height:38px;margin:6px 0 10px;background:#fff;border:1px solid #c8cdd1;border-radius:6px;padding:6px;}
.demo-actions {display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.demo-actions button {padding:9px 12px;min-height:38px;border:1px solid #b33320;border-radius:8px;background:white;color:#982d1b;cursor:pointer;}
.demo-actions a {color:#982d1b;}
.demo-tools p {margin-bottom:0;line-height:1.6;}
.tour-map-dialog {border:0;border-radius:14px;padding:16px;width:min(860px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;}
.tour-map-dialog::backdrop {background:#14192399;}
.tour-map-dialog .tour-map-section {border:0;padding:12px 0 0;border-radius:0;scroll-margin-top:0;}
.map-close {display:block;margin-left:auto;border:1px solid #b9c1c7;background:#fff;color:#333e48;border-radius:8px;padding:8px 14px;min-height:40px;cursor:pointer;}
@media(min-width:850px){.main-inner{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:14px 24px;align-items:start;}.gps-panel{grid-column:1/-1;}.demo-tools{grid-column:1/-1;}.media-zone{grid-column:1;grid-row:3/span 3;}.audio-zone{grid-column:2;grid-row:3;}.content-zone{grid-column:2;grid-row:4;}.media-box{height:420px;}.content-card{max-height:410px;overflow:auto;}}
@media(max-width:480px){.audio-progress-wrap{flex-basis:100%;}.audio-time{margin-right:auto;}.content-title{font-size:23px;}.gps-status strong{display:block;}#gpsStatusDetail{display:block;margin:2px 0 0;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.gps-status{max-width:100%;}.gps-panel{gap:6px;}}
.is-embedded .main-inner {width:min(calc(100% - 20px),1060px);}

.content-card {white-space:pre-line;}
#btnAudioPlay {background:var(--guide-green);border-color:var(--guide-green);color:white;}
#btnAudioStop.is-active {background:white;color:var(--guide-green);border-color:#b9cabc;}
.media-box .navBtn:disabled {visibility:hidden;}
.media-box[data-tab="3d"] .navBtn,.media-box[data-tab="vid"] .navBtn {display:none;}
