/* DCU ExamHub — high-contrast, calm light theme. Loaded last on public + admin pages. */
:root{
  --lm-page:#F2F5FA;
  --lm-surface:#FFFFFF;
  --lm-text:#17263D;
  --lm-secondary:#465872;
  --lm-muted:#5B6B82;
  --lm-border:#D5DFEC;
  --lm-link:#174FA6;
  --lm-input:#FFFFFF;
  --lm-focus:#1D65D8;
}
body:not(.theme-dark){background:var(--lm-page)!important;color:var(--lm-text)!important;color-scheme:light}
body:not(.theme-dark) .workspace,
body:not(.theme-dark) main,
body:not(.theme-dark) .view{background:var(--lm-page)!important;color:var(--lm-text)!important}
body:not(.theme-dark) .sidebar,
body:not(.theme-dark) .topbar,
body:not(.theme-dark) .bottom-nav,
body:not(.theme-dark) footer,
body:not(.theme-dark) .header{background:#FFFFFF!important;color:var(--lm-text)!important;border-color:var(--lm-border)!important}

/* Make normal content text consistently dark enough, including small labels. */
body:not(.theme-dark) .workspace :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,th,td,label,legend,summary,figcaption),
body:not(.theme-dark) main :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,th,td,label,legend,summary,figcaption),
body:not(.theme-dark) .header :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,th,td,label,legend,summary,figcaption){color:var(--lm-text)!important}
body:not(.theme-dark) .workspace :is(.muted,.panel-heading small,.paper-main small,.timeline-body p,.journeylegend,.tip p,.metric span,.metric small,.center-caption,.banner-small,.schedule-toolbar,.section-head .muted,.smalltext,.save-feedback,.tiny-note,.side-note small,.brand small,.selectors label,.field,.top-title .eyebrow,.top-greeting p,.datepill,.routine-subline),
body:not(.theme-dark) main :is(.muted,.panel-heading small,.paper-main small,.timeline-body p,.journeylegend,.tip p,.metric span,.metric small,.center-caption,.banner-small,.schedule-toolbar,.section-head .muted,.smalltext,.save-feedback,.tiny-note,.side-note small,.brand small,.selectors label,.field,.routine-subline){color:var(--lm-secondary)!important}
body:not(.theme-dark) .brand strong,
body:not(.theme-dark) .top-title strong,
body:not(.theme-dark) .mini-brand,
body:not(.theme-dark) .paper-main strong,
body:not(.theme-dark) .timeline-body h3,
body:not(.theme-dark) .panel-heading b,
body:not(.theme-dark) .center-name,
body:not(.theme-dark) .metric strong,
body:not(.theme-dark) .section-head h1,
body:not(.theme-dark) .section-head h2{color:var(--lm-text)!important}
body:not(.theme-dark) .eyebrow,
body:not(.theme-dark) .text-btn,
body:not(.theme-dark) footer a{color:var(--lm-link)!important}
body:not(.theme-dark) .navlink,
body:not(.theme-dark) .bottom-nav a{color:#344963!important}
body:not(.theme-dark) .navlink.active,
body:not(.theme-dark) .navlink:hover{background:#E4EEFC!important;color:#124D9E!important}
body:not(.theme-dark) .bottom-nav a.active{background:#E7F0FF!important;color:#124FA8!important}

/* Surface hierarchy: clearer borders and a gentle shadow without washing out text. */
body:not(.theme-dark) .filter-panel,
body:not(.theme-dark) .panel,
body:not(.theme-dark) .center-card,
body:not(.theme-dark) .myroutine-box,
body:not(.theme-dark) .calendar-detail,
body:not(.theme-dark) .tip,
body:not(.theme-dark) .first-visit-card,
body:not(.theme-dark) .notice-panel,
body:not(.theme-dark) .preference-panel,
body:not(.theme-dark) .streak-panel,
body:not(.theme-dark) .extras-panel,
body:not(.theme-dark) .card,
body:not(.theme-dark) .stat,
body:not(.theme-dark) .area,
body:not(.theme-dark) .table-card,
body:not(.theme-dark) .login,
body:not(.theme-dark) .import{color:var(--lm-text)!important;border-color:var(--lm-border)!important;box-shadow:0 8px 24px rgba(35,57,91,.07)!important}
body:not(.theme-dark) .filter-panel,
body:not(.theme-dark) .panel,
body:not(.theme-dark) .center-card,
body:not(.theme-dark) .myroutine-box,
body:not(.theme-dark) .calendar-detail,
body:not(.theme-dark) .tip,
body:not(.theme-dark) .first-visit-card,
body:not(.theme-dark) .notice-panel,
body:not(.theme-dark) .preference-panel,
body:not(.theme-dark) .streak-panel,
body:not(.theme-dark) .extras-panel,
body:not(.theme-dark) .table-card,
body:not(.theme-dark) .login,
body:not(.theme-dark) .import{background:#FFFFFF!important}
body:not(.theme-dark) .paper-row,
body:not(.theme-dark) .timeline-row{color:var(--lm-text)!important;border-color:#E0E7F0!important}
body:not(.theme-dark) .side-note{background:#F7FAFF!important;color:#263F60!important;border-color:#D5E2F2!important}
body:not(.theme-dark) .datebox{background:#E8F0FA!important;color:#1C3657!important}
body:not(.theme-dark) .gapchip{background:#EAF0F7!important;color:#344963!important}
body:not(.theme-dark) .tiny-tag{background:#E5F0FF!important;color:#164C93!important}
body:not(.theme-dark) .center-code{background:#FFF0D8!important;color:#764A10!important}
body:not(.theme-dark) .calendar-day{background:#EAF0F7!important;color:#31445F!important}
body:not(.theme-dark) .calendar-day.has-exam{background:#DDF5EB!important;color:#155D47!important}
body:not(.theme-dark) .calendar-day.selected{outline-color:#1B63B8!important}
body:not(.theme-dark) .progress-track{background:#E2E9F2!important}
body:not(.theme-dark) .progress-track>div{background:linear-gradient(90deg,#2168C7,#1B9A83)!important}

/* Inputs, selects, search, and tables remain legible at small sizes. */
body:not(.theme-dark) input:not([type=checkbox]):not([type=radio]),
body:not(.theme-dark) select,
body:not(.theme-dark) textarea{background:var(--lm-input)!important;color:var(--lm-text)!important;border:1px solid #B8C7DA!important}
body:not(.theme-dark) input::placeholder,
body:not(.theme-dark) textarea::placeholder{color:#66758B!important;opacity:1!important}
body:not(.theme-dark) input:focus,
body:not(.theme-dark) select:focus,
body:not(.theme-dark) textarea:focus{border-color:var(--lm-focus)!important;box-shadow:0 0 0 3px rgba(29,101,216,.16)!important}
body:not(.theme-dark) th{color:#344963!important;border-color:#D9E2EE!important}
body:not(.theme-dark) td{color:#243750!important;border-color:#E1E8F0!important}
body:not(.theme-dark) .secondary,
body:not(.theme-dark) .outline{background:#EAF1FA!important;color:#1E426F!important;border:1px solid #C9D8EA!important}
body:not(.theme-dark) .primary,
body:not(.theme-dark) button.primary{background:#174FA6!important;color:#FFFFFF!important;border-color:#174FA6!important}
body:not(.theme-dark) .danger{background:#FCE9E8!important;color:#922F2B!important;border:1px solid #F0C8C5!important}
body:not(.theme-dark) .tab{color:#3C5069!important}
body:not(.theme-dark) .tab.active{background:#1B426A!important;color:#FFFFFF!important}
body:not(.theme-dark) .pill{color:#754A0D!important;background:#FFF0D6!important}
body:not(.theme-dark) .pill.published{background:#DDF4E8!important;color:#155C43!important}
body:not(.theme-dark) .pill.draft{background:#FFF0D6!important;color:#754A0D!important}
body:not(.theme-dark) td button.delete,
body:not(.theme-dark) .routine-actions button.delete{background:#FCE9E8!important;color:#922F2B!important}
body:not(.theme-dark) .routine-actions button.publish{background:#DDF4E8!important;color:#155C43!important}
body:not(.theme-dark) .routine-actions button.hide{background:#FFF0D6!important;color:#754A0D!important}
body:not(.theme-dark) .routine-actions button.edit{background:#E5F0FF!important;color:#174A87!important}

/* Mood changes remain visible, but every light-mode mood uses dark readable text. */
body:not(.theme-dark) .workspace>.topbar[data-mood="morning"]{background:linear-gradient(108deg,#FFF4D9,#FFF0E7 52%,#F0ECFF)!important;border-bottom-color:#E8D6B6!important}
body:not(.theme-dark) .workspace>.topbar[data-mood="afternoon"]{background:linear-gradient(108deg,#E5F5FF,#E7F8F2 54%,#F4F8E5)!important;border-bottom-color:#C9E0E1!important}
body:not(.theme-dark) .workspace>.topbar[data-mood="evening"]{background:linear-gradient(108deg,#FFE9DF,#FBE7F2 53%,#EEE9FF)!important;border-bottom-color:#E5CCD9!important}
body:not(.theme-dark) .workspace>.topbar[data-mood="night"]{background:linear-gradient(108deg,#E8EDFC,#E9EAFB 53%,#F0E8FA)!important;border-bottom-color:#D2D9F0!important}
body:not(.theme-dark) .topbar .top-greeting,
body:not(.theme-dark) .topbar .top-greeting h1,
body:not(.theme-dark) .topbar .top-greeting[data-mood],
body:not(.theme-dark) .workspace>.topbar[data-mood="night"] .top-greeting,
body:not(.theme-dark) .workspace>.topbar[data-mood="night"] .mini-brand{color:#1B2C48!important}
body:not(.theme-dark) .topbar .top-greeting p,
body:not(.theme-dark) .workspace>.topbar[data-mood="night"] .top-greeting p,
body:not(.theme-dark) .workspace>.topbar[data-mood="night"] .mini-brand small{color:#455873!important}
body:not(.theme-dark) .topbar .datepill,
body:not(.theme-dark) .topbar .connection,
body:not(.theme-dark) .topbar .theme-toggle,
body:not(.theme-dark) .topbar .iconbutton{background:rgba(255,255,255,.88)!important;color:#233B59!important;border-color:#CBD7E7!important}
body:not(.theme-dark) .banner-overlay,
body:not(.theme-dark) .banner-overlay p,
body:not(.theme-dark) .banner-overlay strong{color:#FFFFFF!important}
body:not(.theme-dark) .banner-controls button{background:#FFFFFF!important;color:#174FA6!important;border-color:#D5DFEC!important}
body:not(.theme-dark) .banner-count{background:rgba(255,255,255,.96)!important;color:#243750!important;text-shadow:none!important}
body:not(.theme-dark) .download-app-card{color:#1B2D48!important;border-color:#D5DFEC!important}
body:not(.theme-dark) .download-app-card :is(p,small,span,b,strong){color:inherit}

/* Admin CMS uses the same accessible light palette. */
body:not(.theme-dark) .header .brand strong,
body:not(.theme-dark) .header .brand small,
body:not(.theme-dark) .header>a:last-child,
body:not(.theme-dark) .section-title h2,
body:not(.theme-dark) .dialog-title h2,
body:not(.theme-dark) .stat b{color:var(--lm-text)!important}
body:not(.theme-dark) .welcome p,
body:not(.theme-dark) .section-title p,
body:not(.theme-dark) .login p,
body:not(.theme-dark) .stat span,
body:not(.theme-dark) .routine-count-info,
body:not(.theme-dark) td small,
body:not(.theme-dark) .routine-subline{color:var(--lm-secondary)!important}
body:not(.theme-dark) dialog{background:#FFFFFF!important;color:var(--lm-text)!important;border:1px solid var(--lm-border)!important}
body:not(.theme-dark) dialog :is(h1,h2,h3,p,label,small){color:var(--lm-text)!important}
body:not(.theme-dark) dialog .device-upload-help,
body:not(.theme-dark) dialog .device-upload-slot small{color:var(--lm-secondary)!important}

/* Keyboard focus and reduced-motion support. */
body:not(.theme-dark) button:focus-visible,
body:not(.theme-dark) a:focus-visible,
body:not(.theme-dark) select:focus-visible,
body:not(.theme-dark) input:focus-visible,
body:not(.theme-dark) textarea:focus-visible{outline:3px solid #2168D2!important;outline-offset:2px}
@media(prefers-reduced-motion:reduce){body:not(.theme-dark) *,body:not(.theme-dark) *::before,body:not(.theme-dark) *::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* Smaller status labels and compact routine controls also need explicit contrast. */
body:not(.theme-dark) .sidecaption,
body:not(.theme-dark) .brand small,
body:not(.theme-dark) .mini-brand small,
body:not(.theme-dark) .side-note small{color:#4D6079!important}
body:not(.theme-dark) .routine-chip{background:#FFFFFF!important;color:#1B2D48!important;border-color:#D2DEED!important}
body:not(.theme-dark) .routine-chip-main b{color:#172A45!important}
body:not(.theme-dark) .routine-chip-main small{color:#4B5E77!important}
body:not(.theme-dark) .routine-chip-edit{background:#E6EEFF!important;color:#174B98!important}
body:not(.theme-dark) .myroutine-pill{background:#E5F0FF!important;color:#174A91!important}
body:not(.theme-dark) .myroutine-status{color:#245C49!important}
body:not(.theme-dark) .next-card .next-header{color:#344B68!important}
body:not(.theme-dark) .next-card .next-header>span:first-child{background:#FFE0E9!important;color:#9D2347!important}
body:not(.theme-dark) .next-card .hero-status{background:#E3F0FF!important;color:#174B91!important;border:1px solid #C8DDF7!important}
body:not(.theme-dark) .next-card .next-date{color:#294969!important}
body:not(.theme-dark) .next-card .code,
body:not(.theme-dark) .next-card .time-notice{color:#4A5D75!important}
body:not(.theme-dark) .next-card .count-unit{background:#F1F5FC!important;border:1px solid #D8E2F0!important}
body:not(.theme-dark) .next-card .count-unit strong{color:#174FA6!important}
body:not(.theme-dark) .next-card .count-unit span{color:#4B5E77!important}
body:not(.theme-dark) .empty{background:#F7F9FC!important;color:#52647B!important;border:1px dashed #C9D5E5!important}
body:not(.theme-dark) .check-item:has(input:checked){color:#617188!important}
