/* R10: visual cards, one in-card player, real named controls, and opaque chrome. */
.ttb-media-host{display:flex!important;flex-direction:column;gap:16px;min-width:0;}
.ttb-media-card{overflow:hidden;padding:0!important;min-width:0;width:100%;}
.ttb-media-stage:empty{display:none;}
.ttb-media-stage{position:relative;width:100%;aspect-ratio:16/9;min-height:200px;overflow:hidden;background:#000;}
.ttb-media-stage iframe{position:absolute;inset:0;width:100%;height:100%;min-height:200px;min-width:200px;border:0;display:block;}
.ttb-media-body{padding:12px 14px;}
.ttb-media-body .toolbar,.ttb-media-listbar,.ttb-media-cardbody .toolbar{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;}
.ttb-media-body p:empty{display:none;}
.ttb-media-listbar p{flex:1 1 240px;}
.ttb-media-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:18px;align-items:start;}
#sermonGrid .ttb-media-list{grid-template-columns:1fr;}
.ttb-media-row{display:block!important;overflow:hidden;min-width:0;padding:0!important;scroll-margin-top:calc(var(--ttb-header-height,72px) + 12px);}
.ttb-media-pick{position:relative;display:block;width:100%;padding:0;border:0;border-radius:0;aspect-ratio:16/9;overflow:hidden;background:#112a45;color:#fff;text-align:center;cursor:pointer;}
.ttb-media-thumbnail{display:block;width:100%;height:100%;object-fit:cover;}
.ttb-media-play{position:absolute;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:62px;height:46px;display:grid;place-items:center;border-radius:14px;background:#c00;color:#fff;font-size:25px;line-height:1;box-shadow:0 3px 12px #0005;pointer-events:none;}
.ttb-preview-missing{display:block;padding:16px 16px 65px;font-size:.9rem;}
.ttb-media-pick:focus-visible{outline:3px solid var(--navy);outline-offset:-4px;}
.ttb-media-pick[aria-pressed="true"]{outline:3px solid var(--gold);outline-offset:-4px;}
.ttb-media-cardbody{padding:14px;min-width:0;}
.ttb-media-title{margin:0 0 12px;font-size:1.06rem;line-height:1.5;color:var(--navy);overflow-wrap:anywhere;}
.ttb-media-cardbody .toolbar>*{font-size:.86rem;flex:1 1 120px;text-align:center;min-height:44px;}
.ttb-voice-shortcut{width:auto!important;gap:6px;padding:8px 10px!important;max-width:100%;}
.ttb-voice-shortcut .ttb-voice-label{display:inline!important;font:inherit;line-height:1.2;white-space:normal;}
.ttb-voice-shortcut svg{flex:none;}
.ttb-media-host button{min-height:44px;}
.ttb-media-host [hidden]{display:none!important;}
#sermonMediaSwitch{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;}
#sermonMediaSwitch button{min-width:0;white-space:normal;overflow-wrap:anywhere;min-height:48px;line-height:1.35;padding:10px 6px;}
/* Auto-height prevents controls being clipped by fixed pixel heights with large
   Android text settings. The existing ResizeObserver measures the real height. */
html[data-header-mode] .topbar{height:auto!important;min-height:62px;align-items:center;padding-top:calc(8px + env(safe-area-inset-top,0px));padding-bottom:8px;background:var(--cream)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;}
.bottomnav{background:var(--paper,var(--cream))!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;}
@media(max-width:900px){.main{padding-bottom:calc(var(--ttb-bottom-height,158px) + 20px + env(safe-area-inset-bottom,0px))!important;}html{scroll-padding-bottom:calc(var(--ttb-bottom-height,158px) + 20px);}}
@media(max-width:380px){.ttb-media-body .toolbar>*{flex:1 1 100%;}.ttb-media-cardbody .toolbar{gap:6px;}}

/* R10 release identity and runtime guard. No translucent navigation panels. */
.ttb-media-host > [hidden],.ttb-media-host [hidden]{display:none!important;}
.ttb-release-stamp{display:inline-flex;align-items:center;justify-content:center;padding:2px 7px;border:1px solid var(--line);border-radius:7px;background:var(--paper);color:var(--navy);font-size:11px;line-height:1.4;font-weight:800;letter-spacing:.03em;vertical-align:middle;}
.topbar .brand{position:relative;flex-shrink:0;}
.topbar .brand .ttb-release-stamp{position:absolute;inset-inline-end:-5px;bottom:-5px;font-size:9px;line-height:1.3;padding:1px 3px;z-index:1;}
html .topbar{height:auto!important;max-height:none!important;overflow:visible!important;flex-wrap:wrap;align-content:center;background:var(--cream)!important;opacity:1!important;}
html .bottomnav{background:var(--paper)!important;opacity:1!important;}
.topbar .top-select-wrap{min-width:0;}
.topbar .language-control-label{line-height:1.3!important;}
.ttb-runtime-warning{padding:20px;border:2px solid var(--gold);background:var(--paper);border-radius:16px;overflow-wrap:anywhere;}
.ttb-runtime-warning code{display:block;margin:12px 0;}
@media(max-width:520px){
 html .topbar{display:grid!important;grid-template-columns:34px minmax(100px,1fr) minmax(60px,88px) 44px 44px;gap:6px!important;padding:10px 8px!important;}
 .topbar .grow,.topbar .brand>span:not(.ttb-release-stamp){display:none!important;}
 .topbar .brand img{width:32px;height:32px;}
 .topbar .language-control{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:2px!important;}
 .topbar .language-control-label{font-size:11px!important;white-space:normal;}
 .topbar #languageTop{max-width:none!important;width:100%!important;min-width:0;font-size:14px!important;padding:8px 5px!important;}
 .topbar #translationTop{max-width:none!important;width:100%;min-width:0;font-size:14px!important;padding:8px 4px!important;}
 .topbar .iconbtn{min-width:0;width:44px;min-height:44px;padding:6px!important;}
 .topbar #installBtn:not([hidden]){grid-column:2 / -1;width:auto;grid-row:2;}
}

:root{--ttb-r10-style:10;}
/* Reset legacy flex-basis/margins on grid controls. */
html .topbar .brand>span.ttb-release-stamp{display:inline-flex!important;}
@media(max-width:520px){
 html .topbar{grid-template-columns:32px minmax(84px,1fr) 64px 44px 44px!important;}
 html .topbar .top-select-wrap.language-control{margin:0!important;width:100%!important;justify-self:stretch;justify-content:center!important;flex:none!important;}
 html .topbar #languageTop,html .topbar #translationTop{flex:none!important;height:44px!important;min-height:44px!important;max-height:44px!important;width:100%!important;max-width:100%!important;border-radius:12px!important;}
 html .topbar #globalSearchBtn,html .topbar #settingsBtn{width:44px!important;max-width:44px!important;min-width:44px!important;}
}

/* R10: catalogue diagnostics stay compact; Shorts remain true portrait cards. */
.ttb-media-diagnostics{margin-block:18px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--paper);min-width:0;}
.ttb-media-diagnostics summary{cursor:pointer;color:var(--navy);font-weight:700;}
.ttb-media-diagnostics pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.75rem;direction:ltr;text-align:left;max-width:100%;}
.ttb-media-host[data-media-variant="shorts"] .ttb-media-pick{aspect-ratio:9/16;max-height:72vh;}
.ttb-media-host[data-media-variant="shorts"] .ttb-media-stage:not(:empty){aspect-ratio:9/16;min-height:200px;max-height:72vh;}

/* R10: two intentionally packed rows at normal phone widths, not a fixed empty row. */
.topbar .language-control-label{font-size:clamp(14px,3.4vw,17px)!important;font-weight:800!important;line-height:1.3!important;white-space:normal!important;}
#musicMediaSwitch,#audioBibleMediaSwitch,#academicMediaSwitch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;}
#musicMediaSwitch button,#audioBibleMediaSwitch button,#academicMediaSwitch button{min-height:48px;min-width:0;padding:10px 6px;white-space:normal;overflow-wrap:anywhere;line-height:1.35;}
.ttb-support-invite{padding:18px 20px;margin:24px 0;border:1px solid var(--line);border-inline-start:4px solid var(--gold);border-radius:16px;background:var(--paper);}
.ttb-support-invite p{margin:0 0 8px;font-size:.95rem;line-height:1.6;}
.ttb-support-link{display:inline-flex;align-items:center;min-height:44px;font-weight:700;color:var(--navy);text-underline-offset:4px;}
#giving-options{scroll-margin-top:calc(var(--ttb-header-height,80px) + 16px);scroll-margin-bottom:calc(var(--ttb-bottom-height,144px) + 16px);}
#giving-options:focus{outline:2px solid var(--gold);outline-offset:6px;}
.ttb-media-background-note{font-size:.82rem!important;line-height:1.5;}
.ttb-install-panel{position:fixed;inset-inline:12px;bottom:calc(var(--ttb-bottom-height,0px) + 10px);margin-inline:auto;width:min(620px,calc(100vw - 24px));max-height:48dvh;overflow:auto;box-sizing:border-box;padding:16px 18px;background:var(--paper);border:1px solid var(--line);border-radius:20px;box-shadow:0 8px 32px #0003;z-index:90;}
.ttb-install-panel[hidden]{display:none!important;}
.ttb-install-panel p{font-size:.93rem;line-height:1.5;margin:8px 0 12px;}
.ttb-install-panel .toolbar,.ttb-install-dialog .toolbar{display:flex;gap:10px;flex-wrap:wrap;}
.ttb-install-panel button,.ttb-install-dialog button,.ttb-install-dialog a{min-height:44px;}
.ttb-install-dialog{border:1px solid var(--line);border-radius:22px;background:var(--paper);color:var(--ink);width:min(650px,calc(100vw - 32px));max-height:82dvh;overflow:auto;padding:24px;box-sizing:border-box;}
.ttb-install-dialog::backdrop{background:#0008;}
@media(min-width:901px){.ttb-install-panel{bottom:20px;}}
@media(max-width:900px){
 html .bottomnav{display:grid!important;grid-template-columns:repeat(12,minmax(0,1fr))!important;grid-auto-rows:minmax(62px,auto);height:auto!important;min-height:0!important;max-height:none!important;gap:3px 0!important;padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px))!important;align-items:stretch;}
 html .bottomnav button{grid-column:span 2;min-width:0;min-height:56px;padding:5px 2px!important;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:10px!important;line-height:1.2!important;overflow-wrap:anywhere;white-space:normal;height:auto!important;}
 html .bottomnav button:nth-child(7){grid-column:2 / span 2;}html .bottomnav button:nth-child(8){grid-column:4 / span 2;}html .bottomnav button:nth-child(9){grid-column:6 / span 2;}html .bottomnav button:nth-child(10){grid-column:8 / span 2;}html .bottomnav button:nth-child(11){grid-column:10 / span 2;}
 html .bottomnav button>span:first-child:not(.nav-label){font-size:19px!important;line-height:1.1!important;display:block;margin:0!important;}
 html .bottomnav button .nav-label{font-size:10px!important;line-height:1.2!important;max-width:100%;}
}
@media(max-width:350px){html .bottomnav button:nth-child(n){grid-column:span 3;min-height:48px;}html .bottomnav button:nth-child(n+9){grid-column:span 4;}}
