/* OBSLv2.1: consistent Dark Mode + server-managed sizes, no redraw loops. */
:root{--obsl-news-text-px:20px;--obsl-moments-text-px:20px}
/* Footer: APK and PWA are independent actions, no dismiss X. */
#pwa-install-banner{display:flex!important;align-items:center!important;gap:6px!important;min-width:0!important}
#pwa-install-banner[hidden]{display:none!important}
#pwa-install-banner :is(#pwa-apk-download,#pwa-install-button){display:inline-flex!important;align-items:center;justify-content:center;min-height:30px;min-width:44px;padding:5px 10px!important;border-radius:9px!important;line-height:1.2;text-decoration:none!important;font-weight:800!important}
#pwa-apk-download[aria-disabled="true"]{opacity:.65;cursor:not-allowed}
#pwa-install-close{display:none!important}
#footer-primary-line{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;flex-wrap:nowrap!important;white-space:nowrap!important}
#footer-text{margin:0!important;padding:0!important}
#footer-heart-toggle{margin:0!important;padding:0 1px!important;border:0!important;background:transparent!important;box-shadow:none!important}
#footer-primary-line #footer-admin-editor{position:static!important;display:inline-flex;align-items:center;justify-content:center;min-width:22px!important;min-height:24px!important;border:0!important;background:transparent!important;box-shadow:none!important;margin-left:3px!important;font-size:18px!important;transform:none!important}
#footer-primary-line #footer-admin-editor[hidden]{display:none!important}
.obsl-day-legacy-hidden,[hidden].obsl-day-legacy-hidden{display:none!important}
/* Weather: Admin controls each font size individually. Avoid clipping on small screens. */
#weather-widget :is(#temp,#weather-desc,#feels,#humidity,#wind,#rain,#weather-updated-status,#location-status){overflow:visible;line-height:1.25}
#weather-widget #temp{white-space:nowrap}
/* News: same size title, logo, source and date; allow the text blocks to grow. */
#tech-news-panel :is(.tech-news-title,.tech-news-head-icon,.tech-news-card-title,.tech-news-source-name,.tech-news-source-fallback,.tech-news-card-date){font-size:var(--obsl-news-text-px)!important;line-height:1.15!important}
#tech-news-panel .tech-news-source-row{min-height:calc(var(--obsl-news-text-px) * 1.35)!important;height:auto!important;line-height:1.15!important}
#tech-news-panel :is(.tech-news-source-logo,.tech-news-source-row img){width:var(--obsl-news-text-px)!important;height:var(--obsl-news-text-px)!important;flex-basis:var(--obsl-news-text-px)!important}
#tech-news-panel .tech-news-card-title{min-height:0!important;max-height:none!important;overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2!important;white-space:normal!important}
#tech-news-panel .tech-news-meta{grid-template-rows:auto auto!important;height:auto!important}
#tech-news-panel .tech-news-card-date{min-height:0!important;white-space:normal!important;overflow-wrap:anywhere!important}
#tech-news-panel .obsl-tech-news-viewport{height:auto!important;min-height:270px!important}
#tech-news-panel :is(.obsl-tech-news-track,.tech-news-batch){height:auto!important;min-height:270px!important}
/* Moments: one size for heading, source badge, title/excerpt and date. */
#moments-panel :is(.moments-head,.moments-heading-copy,.moments-head-title,.moment-card-title,.moment-card-excerpt,.moment-card-date,.moment-source-badge,.moments-head-icon){font-size:var(--obsl-moments-text-px)!important;line-height:1.25!important}
#moments-panel :is(.moments-head-icon,.module-brand-logo){width:var(--obsl-moments-text-px)!important;height:var(--obsl-moments-text-px)!important;flex:0 0 var(--obsl-moments-text-px)!important}
#moments-panel .moment-card-body{height:auto!important;min-height:0!important}
#moments-panel :is(.moment-card-title,.moment-card-excerpt,.moment-card-date){white-space:normal!important;overflow-wrap:anywhere!important;max-height:none!important;text-overflow:clip!important}
/* Day Info: title and content each use its own saved font/size and reflow. */
#day-info-panel .day-info-title{font-family:var(--day-info-title-font,system-ui)!important;font-size:var(--day-info-title-size,22px)!important;line-height:1.2!important;max-height:none!important;overflow:visible!important;white-space:normal!important}
#day-info-panel :is(.day-info-content,.day-info-stack,.day-info-line,.day-info-key,.day-info-value){font-family:var(--day-info-content-font,system-ui)!important;font-size:var(--day-info-font-size,16px)!important;line-height:1.3!important}
#obsl-settings-viewport .obsl-app-links-settings{display:grid;gap:13px;padding:14px;max-width:650px}
.obsl-app-links-settings label,.obsl-font-size-card label{display:grid;gap:6px;font-weight:700}
.obsl-app-links-settings input,.obsl-font-size-card input{min-height:42px;max-width:100%;padding:8px;border:1px solid #97a4b8;border-radius:9px;background:var(--panel,#fff);color:var(--text,#111)}
.obsl-font-size-card{display:flex;flex-wrap:wrap;align-items:end;gap:13px;padding:15px}
/* Dark theme palette consistent with header. Preserve user images and theme covers. */
html.dark{color-scheme:dark;--bg:#0b1420;--panel:#131f2c;--text:#f8fafc;--muted:#d4deeb;--line:#5e728a;--obsl-dark-border:#627a96}
html.dark :is(#header-frame,#event-frame,#birthday-event-panel,#weather-widget,#countdown-panel,#tech-news-panel,#moments-panel,#day-info-panel,#market-panel,.market-panel,#footer-frame,.footer-frame,#google-calendar-frame,#calendar-panel,.panel,.obsl-module){border-color:var(--obsl-dark-border)!important;color:#f8fafc!important}
html.dark :is(#header-frame,#event-frame,#birthday-event-panel,#weather-widget,#countdown-panel,#tech-news-panel,#moments-panel,#day-info-panel,#market-panel,.market-panel,#footer-frame,#google-calendar-frame) :is(h1,h2,h3,h4,h5,p,small,strong,b,span,label,div):not(.obsl-bg-layer):not(.cd-theme-background){color:#f8fafc!important}
html.dark :is(#weather-widget,#tech-news-panel,#moments-panel,#day-info-panel,#event-frame,#birthday-event-panel) :is(.tech-news-source-name,.tech-news-card-title,.tech-news-card-date,.moment-source-badge,.moment-card-title,.moment-card-excerpt,.moment-card-date,.weather-metric,.weather-meta,.day-info-value,.day-info-key,.birthday-item,.birthday-name,.birthday-date){color:#f8fafc!important;text-shadow:0 1px 2px rgba(0,0,0,.75)}
html.dark #obsl-notification-inbox{background:rgba(1,7,16,.82)!important;color:#f8fafc!important}
html.dark #obsl-notification-inbox :is(.obsl-inbox-dialog,.obsl-inbox-shell,.obsl-inbox-panel,.obsl-inbox-list,.obsl-inbox-row,.obsl-inbox-open,.obsl-inbox-detail,.obsl-inbox-header,.obsl-inbox-body){background-color:#182636!important;border-color:#5d718a!important;color:#f8fafc!important}
html.dark #obsl-notification-inbox :is(h1,h2,h3,h4,b,strong,span,p,small,div,time,button){color:#f8fafc!important}
html.dark #obsl-notification-inbox .obsl-inbox-meta{color:#ced8e7!important}
html.dark #obsl-settings-viewport :is(input[type="checkbox"],input[type="radio"]){appearance:auto!important;accent-color:#42a5ff!important;color-scheme:dark!important;opacity:1!important;filter:none!important}
html.dark :is(#obsl-settings-viewport,.system-menu) button[aria-pressed="true"],html.dark .system-switch-row input:checked{background-color:#1369b3!important;color:#fff!important;border-color:#77c4ff!important}
html.dark #obsl-settings-viewport :is(.obsl-app-links-settings,.obsl-font-size-card){background-color:#152337!important;border:1px solid #69819c!important;border-radius:12px!important}
/* The artwork itself stays unchanged: no global filters on images/video. */
/* Notification inbox uses .obsl-inbox-card/.obsl-inbox-head, not a generic modal. */
html.dark #obsl-notification-inbox :is(.obsl-inbox-card,.obsl-inbox-head,.obsl-inbox-list,.obsl-inbox-row,.obsl-inbox-open,.obsl-inbox-empty){background:#182636!important;border-color:#526a86!important;color:#f8fafc!important}
html.dark #obsl-notification-inbox :is(.obsl-inbox-head button,.obsl-inbox-open,.obsl-inbox-recall){background:#223449!important;color:#f8fafc!important}
html.dark #obsl-notification-inbox .obsl-inbox-open time{color:#cad6e6!important}
/* No text truncation after increasing the shared module font size. */
#tech-news-panel{min-height:310px!important}
#tech-news-panel :is(.tech-news-card,.tech-news-card-body,.tech-news-meta,.tech-news-source-row,.tech-news-card-date){height:auto!important;max-height:none!important;min-height:0!important;overflow:visible!important}
#tech-news-panel .tech-news-card{min-height:270px!important}
#tech-news-panel .tech-news-card-body{display:flex!important;flex-direction:column!important;justify-content:start!important}
#tech-news-panel .tech-news-card-title{flex:0 0 auto!important;height:auto!important;max-height:none!important;min-height:0!important}
#tech-news-panel .tech-news-meta{flex:0 0 auto!important;grid-template-rows:auto auto!important;gap:5px!important}
#moments-panel .obsl-moments-viewport{height:auto!important;min-height:0!important}
#moments-motion .moment-card{height:auto!important;min-height:0!important;max-height:none!important}

/* OBSLv2.1 - coherent dark surfaces, identical frame rounding, no full-width toast bands. */
:root{--obsl-frame-rounding:17px}
:is(#header-frame,#event-frame,#birthday-event-panel,#weather-widget,#countdown-panel,#tech-news-panel,#moments-panel,#day-info-panel,#market-panel,.market-panel,#footer-frame,#google-calendar-frame,#calendar-panel){border-radius:var(--obsl-frame-rounding)!important;background-clip:padding-box!important}
/* Toast stack is a fixed, viewport-wide positioning LAYER, never a panel. */
#obsl-toast-stack.obsl-module--toast,html.dark #obsl-toast-stack.obsl-module--toast,html.dark #obsl-toast-stack.obsl-module{background:transparent!important;background-image:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;outline:0!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
#obsl-toast-stack .obsl-toast-item{border-radius:12px!important}
/* The Footer is one rounded card; children must not turn into a second full-width strip. */
#footer-frame{border-radius:var(--obsl-frame-rounding)!important}
#footer-frame #site-footer,html.dark #footer-frame #site-footer{background:transparent!important;background-image:none!important;border:0!important;box-shadow:none!important;outline:0!important;backdrop-filter:none!important;min-width:0!important}
html.dark :is(#header-frame,#event-frame,#birthday-event-panel,#weather-widget,#countdown-panel,#tech-news-panel,#moments-panel,#day-info-panel,#market-panel,.market-panel,#footer-frame,#google-calendar-frame,#calendar-panel){border:1px solid #607991!important;border-radius:var(--obsl-frame-rounding)!important;color:#f8fafc!important}
/* Readable section headings and all weather metadata without forcing a solid background on user images. */
html.dark :is(#tech-news-panel,#market-panel,.market-panel,#moments-panel) :is(.tech-news-title,.tech-news-head,.tech-news-head-title,.market-title,.market-head,.market-heading,.market-caption,.moments-head,.moments-head-title,.moments-heading-copy,.moments-head-label),
html.dark #weather-widget :is(#temp,#weather-desc,#feels,#humidity,#wind,#rain,#weather-updated-status,#location-status,.weather-metric,.weather-meta){color:#f8fafc!important;text-shadow:0 1px 2px rgba(0,0,0,.75)!important}
/* SystemHealth nested white cards and controls must also become dark, not just the host panel. */
html.dark #system-health-tools-group :is(.system-health-body,.system-health-grid,.system-health-item,.system-health-devices-card,.system-health-device,.system-health-pipeline-card,.system-health-pipe-stage,.system-health-feature-card,.release-version-tile,.system-module-card,.system-module-preview,.system-health-actions,.system-health-tab-panels,.system-health-subpanel){background-color:#182638!important;color:#f8fafc!important;border-color:#607994!important;box-shadow:none!important}
html.dark #system-health-tools-group :is(strong,small,label,span,p,h3,h4,summary,div,td,th){color:#f8fafc!important}
html.dark #system-health-tools-group :is(button,input:not([type=color]),select,textarea){background-color:#22344c!important;color:#f8fafc!important;border-color:#718ba9!important}
html.dark #system-health-tools-group :is(.system-health-summary.is-good,.is-good small){color:#8df0b4!important}
html.dark #system-health-tools-group :is(.system-health-summary.is-warn,.is-warn small){color:#ffe29a!important}
html.dark #system-health-tools-group #system-health-warning-details{background-color:#3a2c16!important;border:1px solid #bd8c33!important;color:#ffe9c7!important}
html.dark #system-health-tools-group .system-health-subtab:not(.active){background-color:#19283c!important;color:#eff6ff!important;border-color:#617a9b!important}
html.dark #system-health-tools-group .system-health-subtab.active{background-color:#356fb0!important;color:#fff!important;border-color:#9bd0ff!important}
/* Settings viewport owns native scrolling. Never bubble its pull gesture to page refresh. */
#obsl-settings-viewport:not([hidden]){overscroll-behavior:contain!important;touch-action:pan-y!important}
#obsl-settings-body{overscroll-behavior:contain!important;touch-action:pan-y!important;-webkit-overflow-scrolling:touch!important}
