/* V15.4: shared phone and tablet rules, loaded after component styles. */
.fd-panel[hidden]{display:none!important}
.fd-close{display:grid;place-items:center;flex:none;width:44px;height:44px;border:1px solid var(--control-edge);border-radius:50%;background:var(--surface);color:var(--ink);font:400 1.6rem var(--sans);line-height:1;cursor:pointer}
.fd-results{min-height:0;overscroll-behavior:contain}
.cards-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr))}
@media(max-width:880px){
 .site-header .container{width:calc(100% - 32px)}
 .site-header .header-inner{gap:10px;padding-block:10px;min-height:64px}
 .site-header .header-tools{gap:8px;flex:none}
 .site-header .icon-btn,.site-header .desk-btn,.site-header .theme-toggle,.site-header .nav-toggle{width:44px;min-width:44px;min-height:44px;height:44px}
 .site-header.menu-open{backdrop-filter:none;-webkit-backdrop-filter:none;transform:none;filter:none;background:var(--cream)}
 .site-header.menu-open .brand-logo img{filter:none}
 html[data-theme=night] .site-header.menu-open .brand-logo img{filter:invert(1) hue-rotate(180deg) saturate(.7) brightness(1.15)}
 .site-header .site-nav{height:100vh;height:100dvh;overflow-y:auto;overscroll-behavior:contain;gap:4px;padding:84px 24px max(24px,env(safe-area-inset-bottom));align-items:stretch;background:var(--cream)}
 .site-header .site-nav>a,.site-header.scrolled .site-nav>a{font-size:clamp(1.25rem,4.5vw,1.8rem);line-height:1.3;min-height:48px;padding:10px 14px;border-radius:10px;flex-shrink:0;font-weight:400;letter-spacing:-.025em}
 .site-header .site-nav>a[aria-current=page]{color:var(--accent-text)!important;background:var(--hover-surface);font-weight:600;box-shadow:inset 3px 0 var(--accent)}
 .site-header .site-nav>a:focus-visible{outline-color:var(--focus-ring);outline-offset:-3px}
 .site-header .site-nav>a:hover{background:var(--hover-surface)}
 .site-header .brand-logo{max-width:clamp(140px,32vw,240px)}
 .fd-panel{top:12px;top:var(--search-top,max(12px,env(safe-area-inset-top)));width:calc(100% - 24px);max-height:calc(100vh - 24px);max-height:calc(var(--search-vh,100dvh) - 24px);display:flex;flex-direction:column}
 .fd-head{flex-shrink:0;gap:10px;padding:12px}
 .fd-input{font-size:16px;min-width:0;min-height:44px}
 .fd-results{overflow-y:auto;max-height:none}
 .fd-foot{display:none}
 body:has(.card-dialog[open]){overflow:hidden}
 .card-dialog{max-height:calc(100dvh - 24px);overscroll-behavior:contain}
 .programme-explorer{max-height:calc(100dvh - 24px)}
 .explorer-header,.card-dialog-head{position:sticky;top:0;z-index:5;background:var(--surface)}
 .explorer-close,.card-close{width:44px;height:44px;min-height:44px}
 .explorer-trail button,.explorer-tabs button,.explorer-paper>button,.explorer-evidence-heading button{min-height:44px}
 .landscape-toolbar button,.journey-nav button{width:44px;height:44px;min-width:44px}
 .circular-programme .orbit-centre .orbit-open{min-height:44px;padding:10px 12px}
 .orbit-actions button,.scene-controls button,.place-tabs button,.evidence-lenses button{min-height:44px}
 .station-paper label{min-height:44px}
}
@media(max-width:620px){
 .container,.p-wrap,.evidence-atlas .container{width:calc(100% - 32px)}
 main{min-width:0}
 .p-hero>*,.section-intro>*,.contact-grid>*,.station-toolbar>*,.explorer-paper>div,.footer-inner>*{min-width:0}
 .site-header .brand-logo{max-width:100%}
 .page-hero h1,.station-intro h1{overflow-wrap:break-word;font-size:clamp(2.25rem,10vw,3.15rem)}
 .pub-entry h3,.explorer-paper a,.station-paper h4,.cite-block,.prose a,.footer-inner a{overflow-wrap:anywhere}
 .pub-search input,.pub-filters select,.cite-format,.contact-form input,.contact-form select,.contact-form textarea,.station-toolbar select,.explorer-trail-choice select,.explorer-notebook textarea{font-size:16px!important;max-width:100%;min-width:0}
 .contact-form input,.contact-form select,.contact-form textarea{width:100%;box-sizing:border-box}
 .form-bottom{flex-direction:column;align-items:stretch;gap:14px}
 .form-bottom .p-button{justify-content:center;width:100%;min-height:48px}
 .pub-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
 .pub-filters label{font-size:.8rem}
 .pub-actions .action-btn,.pub-actions .copy-btn{min-height:44px}
 .orbit-actions{grid-template-columns:1fr 1fr;margin-inline:12px}
 .orbit-actions button{font-size:.75rem;min-width:0;flex-wrap:wrap}
 .circular-programme .scene-controls{flex-wrap:wrap;gap:6px}
 .circular-programme .scene-hint{flex:1 1 100%;max-width:none;text-align:center;font-size:.7rem}
 .scene-controls button{min-width:44px;font-size:.75rem}
 .chain-motion{min-height:44px;font-size:.7rem}
 .chain-controls{flex-wrap:wrap}.chain-controls button{font-size:.75rem;min-width:0;flex:1 1 80px;min-height:52px}
 .chain-inspector>p:not(.eyebrow),.chain-status p{font-size:.88rem;line-height:1.65}
 .chain-inspector a{font-size:.83rem;display:inline-block;padding-block:6px}
 .chain-stops button{font-size:clamp(.66rem,2.7vw,.8rem)}
 .chain-stops small{font-size:.65rem}
 .atlas-views strong{font-size:.85rem}.atlas-views small{font-size:.72rem}
 .atlas-reading,.atlas-sources{padding:24px 18px}
 .atlas-reading h3{overflow-wrap:break-word}
 .station-toolbar select{min-width:0;width:100%}
 .station-card-head,.is-comparing .station-card-head{grid-template-columns:minmax(0,1fr) 65px;padding:24px 18px;gap:12px}
 .station-card-head h2,.is-comparing .station-card-head h2{font-size:clamp(1.9rem,8vw,2.35rem);overflow-wrap:break-word}
 .station-outline,.is-comparing .station-outline{height:100px;min-width:0}
 .station-lenses{flex-wrap:wrap}.station-lenses button{flex:1 1 120px;font-size:.8rem}
 .station-card-body,.is-comparing .station-card-body{padding:24px 18px}
 .station-switcher{grid-template-columns:repeat(2,minmax(0,1fr))}
 .station-switcher button{min-width:0;padding:15px 12px}
 .explorer-tabs{flex-wrap:wrap}.explorer-tabs button{flex:1 1 110px;font-size:.8rem;min-width:0}
 .explorer-evidence-heading{flex-wrap:wrap;gap:6px}
 .explorer-next>button{flex:1;min-width:0;font-size:.8rem}
 .explorer-header h2{font-size:1.35rem}
 .explorer-paper{flex-direction:column;gap:12px}.explorer-paper>button{align-self:flex-start}
 .card-dialog{width:calc(100% - 20px);padding:16px 12px}
 .card-dialog-bar,.card-actions{gap:10px}.card-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}
 .card-save,.card-copy{width:100%;min-width:0;font-size:.8rem;justify-content:center;white-space:normal}
}
@media(max-width:380px){
 .pub-filters{grid-template-columns:1fr}
 .circular-programme .orbit-centre .eyebrow{display:none}
 .circular-programme .orbit-centre strong{font-size:1rem}
 .circular-programme .orbit-centre .orbit-open{font-size:.7rem;margin-top:8px}
 .chain-stops small{font-size:.6rem}
 .station-card-head,.is-comparing .station-card-head{grid-template-columns:minmax(0,1fr) 54px;gap:8px}
}
@media(max-width:480px){html[data-theme=night] .site-header.menu-open .brand-logo img{filter:none}}
@media(max-width:880px) and (max-height:500px){
 .site-header .site-nav{padding-top:70px;padding-bottom:16px;gap:0}
 .site-header .site-nav>a{font-size:1.15rem;min-height:44px;padding-block:9px}
 .programme-explorer,.card-dialog{max-height:calc(100dvh - 12px)}
}
