/* Contrast and calendar refinements. Loaded last: supports both themes. */
body.theme-dark :is(.next-card,.duo-grid > .panel,.tip,.calendar-detail,.calendar-controls,.calendar-day) { color:#edf4ff!important; }
body.theme-dark .next-card {background:linear-gradient(128deg,#263253,#3b304f)!important;border:1px solid #657294!important}
body.theme-dark .next-card :is(.next-header,.next-date,.code,.time-notice,h2,p,small,span:not(.live-dot),.count-unit span) {color:#e5edfc!important;opacity:1!important}
body.theme-dark .next-card .next-header>span:first-child{background:#503b60!important;color:#fff!important}
body.theme-dark .next-card .hero-status {background:#34476b!important;color:#fff!important}
body.theme-dark .next-card .count-unit {background:#354363!important;border:1px solid #64789b!important;color:#fff!important}
body.theme-dark .next-card .count-unit :is(strong,span){color:#fce2ef!important;opacity:1!important}
body.theme-dark .duo-grid > .panel:nth-child(2) {background:linear-gradient(145deg,#203a40,#1c3045)!important;border:1px solid #456c75!important}
body.theme-dark .duo-grid > .panel:nth-child(2) :is(h2,small,p,span,b,.eyebrow,.journeylegend,.journeylegend *,#journeyCount,#dashboardTip){color:#e6f7f4!important;opacity:1!important}
body.theme-dark .duo-grid > .panel:nth-child(2) .tip {background:#254750!important;border:1px solid #496d76!important;color:#edfaff!important}
body.theme-dark .duo-grid > .panel:nth-child(2) .tip :is(b,p,small,span){color:#effcff!important;opacity:1!important}
body.theme-dark .duo-grid > .panel:nth-child(2) .progress-track{background:#436273!important}
body.theme-dark :is(.metric span,.metric small,.stats .stat span,.stats .stat small,.center-caption,.center-code){color:#dbe9fa!important;opacity:1!important}
body.theme-dark :is(.calendar-detail,.tip,.empty){background:#223b53!important;color:#eaf4ff!important;border:1px solid #476684!important}
body.theme-dark :is(.calendar-detail,.tip) :is(b,strong,p,small,span){color:#eef6ff!important;opacity:1!important}
/* Modern responsive calendar: preserve existing calendar events and click handlers */
#calendar > .panel{padding:clamp(16px,2.8vw,30px)!important}
.calendar-controls{justify-content:space-between!important;gap:12px!important;max-width:570px;margin:0 auto 24px!important;padding:8px;background:#f0f5fe;border-radius:18px}
.calendar-controls h2{font-size:clamp(17px,2vw,24px)!important;min-width:0!important;flex:1;text-align:center;letter-spacing:-.025em}
.calendar-controls .iconbutton{width:45px;height:45px;min-width:45px;border-radius:13px!important;font-size:26px!important;display:grid;place-items:center;background:#fff!important;color:#1554a6!important;border:1px solid #dbe8fb!important;box-shadow:0 3px 12px #1c438412}
.weekdays,.calendar-grid{gap:clamp(3px,.8vw,9px)!important}
.weekdays span{font-size:clamp(11px,1.1vw,13px)!important;letter-spacing:.02em;color:#40587d!important;padding:8px 0!important}
.calendar-day{position:relative;min-width:0;min-height:clamp(46px,6.4vw,79px)!important;border:1px solid #e1eafb!important;border-radius:14px!important;font-size:clamp(13px,1.5vw,17px)!important;font-weight:700;transition:transform .16s,box-shadow .16s;background:#f6f9ff!important;color:#263c5c!important}
.calendar-day:not(.blank):hover{transform:translateY(-2px);box-shadow:0 8px 18px #3a69bc18}
.calendar-day.has-exam{background:linear-gradient(135deg,#dff9ef,#eefcf7)!important;border-color:#9be0c4!important;color:#106448!important}
.calendar-day.has-exam small{color:#106448!important;font-size:clamp(9px,.95vw,12px)!important;font-weight:750}
.calendar-day.selected{outline:3px solid #2975e2!important;outline-offset:-3px;box-shadow:0 0 0 2px #fff inset}
.calendar-day.is-today:not(.has-exam){background:#e6f0ff!important;color:#164ba2!important;border-color:#9bc0ff!important}
.calendar-day.is-today:after{content:'TODAY';font-size:9px;letter-spacing:.04em;font-weight:850;color:#1758a9}
.calendar-day.blank{border:0!important;background:transparent!important;box-shadow:none!important}
.calendar-detail{margin-top:20px!important;padding:20px!important;border-radius:16px!important;background:#edf6ff!important;color:#24466d!important;line-height:1.7}
.calendar-detail :is(p,b){color:#24466d!important}
body.theme-dark .calendar-controls{background:#1e304b!important}
body.theme-dark .calendar-controls h2{color:#f4f8ff!important}
body.theme-dark .calendar-controls .iconbutton{background:#314765!important;color:#e7f2ff!important;border-color:#546d91!important}
body.theme-dark .weekdays span{color:#d7e5ff!important}
body.theme-dark .calendar-day{background:#273b56!important;border-color:#415d80!important;color:#f3f8ff!important}
body.theme-dark .calendar-day.has-exam{background:linear-gradient(135deg,#1e554b,#234944)!important;border-color:#4bb99b!important;color:#dcfff3!important}
body.theme-dark .calendar-day.has-exam small{color:#d0ffed!important}
body.theme-dark .calendar-day.is-today:not(.has-exam){background:#29466f!important;color:#fff!important;border-color:#83b2ff!important}
body.theme-dark .calendar-day.is-today:after{color:#b6d4ff!important}
body.theme-dark .calendar-day.selected{outline-color:#b8d1ff!important;box-shadow:0 0 0 2px #243650 inset}
body.theme-dark .calendar-day.blank{background:transparent!important;border:0!important}
body.theme-dark .calendar-detail :is(p,b){color:#ecf4ff!important}
@media(max-width:480px){.calendar-controls .iconbutton{width:40px;height:40px;min-width:40px}.calendar-day{border-radius:10px!important}.calendar-day.is-today:after{font-size:7px}.calendar-day.has-exam small{font-size:9px!important}}
@media(prefers-reduced-motion:reduce){.calendar-day{transition:none!important}}
