/* Neutral calendar canvas. Controls live exclusively in the side panel. */
:root {
 color-scheme: dark;
 --paper:#17181b; --sidebar:#1e2024; --surface:#202226; --hover:#2c3037;
 --ink:#f1f3f6; --ink2:#ccd1d9; --muted:#a1a9b6; --rule:#34383f; --rule2:#555c68;
 --today:#9bc4ff; --today-bg:#293c57; --accent:var(--today);
 --sat:#f2b594; --sat-bg:#493329; --ap:#c9b8f2; --ap-bg:#3a314c;
 --deadline:#e5ca82; --deadline-bg:#403923; --task:#9bccb7; --danger:#ffafa8;
 --sans:'Segoe UI',system-ui,-apple-system,Arial,sans-serif;
 --serif:var(--sans); --mono:Consolas,monospace;
}
[data-theme='light'] {
 color-scheme:light;
 --paper:#f0f2f5; --sidebar:#e9edf2; --surface:#ffffff; --hover:#e4eaf2;
 --ink:#202a38; --ink2:#425068; --muted:#617087; --rule:#d9dfe8; --rule2:#b0bdcf;
 --today:#225aa5; --today-bg:#deebff; --accent:var(--today);
 --sat:#93451f; --sat-bg:#fff0e5; --ap:#6845a0; --ap-bg:#f0e9fc;
 --deadline:#7a5913; --deadline-bg:#fcf2d5; --task:#347352; --danger:#aa3a35;
}
body,input,button,select,textarea { font-family:var(--sans); }
.brand { font:600 22px/1.2 var(--sans); letter-spacing:-.025em; color:var(--ink); }
.brand .icon { color:var(--today); }
.sidebar { background:var(--sidebar); }
.sidebar-controls { margin-top:10px; position:relative; }
.sidebar-controls .main-header { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.sidebar-controls .calendar-toolbar { display:grid; grid-template-columns:1fr 34px 34px; gap:6px; margin:0; min-width:0; }
.sidebar-controls .year-controls { grid-column:1; grid-row:1; justify-content:space-between; gap:0; }
.sidebar-controls .year-controls select { width:70px; background:transparent; border:0; font-size:20px; padding:2px; font-weight:650; }
.sidebar-controls .year-controls .icon-button { width:24px; min-height:30px; padding:3px; border:0; }
.sidebar-controls #expandCalendarBtn { grid-column:2; grid-row:1; display:inline-flex; }
.sidebar-controls #fullscreenBtn { grid-column:3; grid-row:1; }
.sidebar-controls .icon-button { width:32px; min-height:32px; padding:6px; }
.sidebar-controls .view-switch { grid-column:1/-1; display:flex; border:0; padding:2px; background:var(--paper); }
.sidebar-controls .view-button { flex:1; min-height:29px; font-size:12px; }
.sidebar-controls .search-field { grid-column:1/-1; max-width:none; min-width:0; width:100%; margin:2px 0; gap:6px; }
.sidebar-controls .search-field input { font-size:12px; padding:6px 0; width:100%; background:transparent; }
.sidebar-controls .header-actions { grid-column:1/-1; }
.sidebar-controls .header-actions .button { width:100%; min-height:26px; font-size:11px; padding:3px 7px; }
.sidebar-controls .mobile-only { display:none; }
.sidebar-controls .mobile-month-jump { display:none; }
.calendar-options { margin:5px 0 0; position:static; }
.calendar-options summary { display:flex; align-items:center; justify-content:space-between; gap:7px; list-style:none; cursor:pointer; font-size:12px; padding:4px 7px; border:1px solid var(--rule); border-radius:5px; min-height:27px; }
.calendar-options summary::-webkit-details-marker { display:none; }
.calendar-options summary .icon { width:14px; height:14px; }
.calendar-options[open] { position:static; width:auto; max-height:none; padding:0; border:0; box-shadow:none; background:transparent; overflow:visible; }
.calendar-options[open] summary { border:1px solid var(--rule2); min-height:27px; padding:4px 7px; background:var(--hover); }
.calendar-options .filter-toolbar { display:flex; flex-direction:column; align-items:flex-start; border:0; padding:8px 0; margin:0; gap:9px; }
.calendar-options .filter-buttons { flex-wrap:wrap; gap:3px; }
.calendar-options .filter-button { padding:4px 7px; font-size:11px; }
.calendar-options .display-options { flex-direction:column; align-items:flex-start; gap:7px; }
.calendar-options .calendar-caption { display:block; margin:4px 0 8px; }
.calendar-options .calendar-legend { margin-top:6px; flex-wrap:wrap; }
.calendar-options .overview-hint { display:none; }
.calendar-options .coverage-note { padding:6px; margin:6px 0; font-size:11px; max-height:none; }
.calendar-options .source-footer { margin-top:8px; padding-top:6px; font-size:11px; }
.calendar-options .source-footer p:nth-child(2) { display:block; margin-top:6px; }
.clock { font:600 25px/1.2 var(--sans); letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.today-section { margin-top:12px; }
.selection-section h2 { font-weight:600; }
.selected-date { font:600 17px/1.4 var(--sans); }
.selection-measures strong { font:600 26px/1.15 var(--sans); letter-spacing:-.025em; }
.selection-budget strong { font-size:20px; color:var(--today); }
.selection-events { padding-top:6px; border-top:1px solid var(--rule); color:var(--ink2); font-size:11px; margin:4px 0 7px; }
.selection-section .button { background:var(--today-bg); color:var(--today); border-color:var(--rule2); }
.button.primary { background:var(--today); border-color:var(--today); color:var(--paper); }
.upcoming-date { font-family:var(--sans); }
.month-card { border-radius:8px; background:var(--surface); border:1px solid var(--rule); }
.month-card.current-month { border-color:var(--today); background:var(--surface); }
.month-title { font-family:var(--sans); font-weight:600; letter-spacing:-.025em; color:var(--ink); }
.month-caption { color:var(--muted); }
.day { font-family:var(--sans); color:var(--ink); font-weight:500; border-radius:4px; }
.day.is-weekend:not(.has-event):not(.is-today) { background:color-mix(in srgb,var(--paper) 50%,transparent); }
.day.is-in-range:not(.has-event):not(.is-today) { background:var(--today-bg); color:var(--ink); }
.day.is-today { background:var(--today); color:var(--paper); border-color:var(--today); font-weight:750; }
.day.is-selected { outline:2px solid var(--today); outline-offset:-2px; }
.day.is-reference { box-shadow:inset 0 0 0 1px var(--today); }
.day:hover { background:var(--hover); color:var(--ink); border-color:var(--ink2); }
.day.is-today:hover { background:var(--today); color:var(--paper); }
[data-dim-past='true'] .month-card.is-past-month { background:var(--paper); border-color:var(--rule); }
[data-dim-past='true'] .is-past-month .month-header,[data-dim-past='true'] .is-past-month .weekdays { opacity:.66; }
[data-dim-past='true'] .day.is-past { opacity:.46; }
[data-dim-past='true'] .day.is-past.has-event { opacity:.62; }
[data-dim-past='true'] .day.is-past.is-in-range { opacity:.9; }
[data-dim-past='true'] .day.is-past:is(:hover,:focus-visible,.is-selected,.is-reference) { opacity:1; }
.dialog-header h2,.empty-state strong,.time-stats strong,.calc-result h3 { font-family:var(--sans); }
.restore-panel { display:none; position:fixed; left:10px; bottom:10px; z-index:30; width:38px; height:38px; background:var(--sidebar); border:1px solid var(--rule2); box-shadow:0 3px 12px #0003; }
@media screen and (min-width:981px) {
 .sidebar { width:230px; flex-basis:230px; padding:12px; }
 .main { padding:6px; height:100dvh; }
 .year-grid { height:100%; flex:1; min-height:0; gap:6px; grid-template-columns:repeat(4,minmax(0,1fr)); grid-template-rows:repeat(3,minmax(0,1fr)); }
 .month-card { padding:10px 9px 7px; }
 .month-header { margin:0 2px 7px; min-height:23px; }
 .month-title { font-size:clamp(18px,2.7vh,25px); }
 .month-caption { font-size:11px; }
 .weekdays { font-size:12px; line-height:16px; margin-bottom:5px; }
 .days-grid { gap:3px; }
 .day { font-size:clamp(15px,2.5vh,23px); }
 .month-event-count { display:none; }
 .calendar-expanded > .sidebar { display:none; }
 .calendar-expanded .main { width:100%; }
 .calendar-expanded > .restore-panel { display:inline-flex; }
 .upcoming-section { margin-top:10px; padding-top:9px; }
 .upcoming-list .upcoming-item:nth-child(n+2) { display:none; }
}
@media screen and (min-width:981px) and (max-height:700px) {
 .month-card { padding:6px 7px; }
 .month-header { margin-bottom:4px; min-height:20px; }
 .month-title { font-size:18px; }
 .weekdays { font-size:11px; line-height:13px; margin-bottom:3px; }
 .day { font-size:15px; }
 .days-grid { gap:2px; }
 .upcoming-list { display:none; }
}
@media screen and (max-width:980px) {
 .main { padding:8px; }
 .month-title { font-size:20px; }
}
@media screen and (max-width:700px) {
 .sidebar { display:block; position:relative; padding:14px; }
 .brand { font-size:20px; }
 .sidebar-controls { margin-top:10px; }
 .sidebar-controls .calendar-toolbar { grid-template-columns:1fr 34px 34px; }
 .sidebar-controls .view-switch { grid-column:1; }
 .sidebar-controls .search-field { grid-column:1/-1; }
 .sidebar-controls .mobile-month-jump { display:inline-flex; grid-column:1/-1; }
 .sidebar-controls .header-actions { display:none; }
 .sidebar-controls #expandCalendarBtn { visibility:hidden; }
 .today-section { position:absolute; top:12px; right:14px; margin:0; }
 .today-section .today-button { display:none; }
 .sidebar-bottom { margin-top:5px; padding:0; }
 .sidebar-bottom .button { width:auto; padding:4px 0; }
 .calendar-options .mobile-utilities { display:flex; flex-wrap:wrap; }
 .month-card { padding:15px 12px; }
 .day { font-size:16px; }
}
@media print { .sidebar,.restore-panel { display:none; }.main { padding:0; }.year-grid { height:auto; }.month-card { background:white; } }

/* Independent semantics: time -> brightness, exam -> hue, deadline -> diamond,
   range -> neutral underline, selection -> outline. None replaces another. */
:root {
 --sat:#9fc8ff; --sat-bg:#253b58;
 --ap:#d0b8fa; --ap-bg:#392c50;
 --deadline:#f1ca6c; --deadline-bg:#39301d;
 --today:#89dfca; --today-bg:#23483f;
 --range-line:#a7b0bd; --past-ink:#747c88;
}
[data-theme='light'] {
 --sat:#20599c; --sat-bg:#e4efff;
 --ap:#6b3fa0; --ap-bg:#f1e9fc;
 --deadline:#895e06; --deadline-bg:#fff5d9;
 --today:#14654f; --today-bg:#dcf4e9;
 --range-line:#68788c; --past-ink:#8993a0;
}
#yearMatrixGrid .day {
 opacity:1; background:transparent; color:var(--ink); border:1px solid transparent;
 box-shadow:none; isolation:isolate; overflow:visible; font-weight:500;
}
#yearMatrixGrid .day .day-number { position:relative; z-index:1; opacity:1; }
#yearMatrixGrid .day.is-weekend:not(.has-event):not(.is-today) { background:color-mix(in srgb,var(--paper) 20%,transparent); }
#yearMatrixGrid .day.is-in-range:not(.has-event):not(.is-today) { background:transparent; color:var(--ink); }
#yearMatrixGrid .day.event-sat { background:var(--sat-bg); color:var(--sat); border-color:color-mix(in srgb,var(--sat) 55%,transparent); font-weight:700; }
#yearMatrixGrid .day.event-ap { background:var(--ap-bg); color:var(--ap); border-color:color-mix(in srgb,var(--ap) 55%,transparent); font-weight:700; }
#yearMatrixGrid .day.event-sat.event-ap { background:var(--sat-bg); color:var(--sat); border-color:var(--ap); }
#yearMatrixGrid .day.event-deadline { background:var(--deadline-bg); color:var(--deadline); border-color:color-mix(in srgb,var(--deadline) 32%,transparent); font-weight:600; }
.deadline-mark { position:absolute; width:5px; height:5px; top:3px; right:3px; background:var(--deadline); transform:rotate(45deg); z-index:3; pointer-events:none; }
#yearMatrixGrid .day.is-anticipated { border-style:dashed; }
#yearMatrixGrid .day.is-late-testing:not(.is-anticipated) { border-style:dotted; }
/* Elapsed days remain elapsed even inside a 299-day selected range. */
[data-dim-past='true'] #yearMatrixGrid .day.is-past { background:transparent; color:var(--past-ink); font-weight:400; }
[data-dim-past='true'] #yearMatrixGrid .day.is-past .day-number { opacity:.55; }
[data-dim-past='true'] #yearMatrixGrid .day.is-past.event-sat { background:color-mix(in srgb,var(--sat-bg) 30%,var(--paper)); color:var(--sat); border-color:color-mix(in srgb,var(--sat) 24%,transparent); }
[data-dim-past='true'] #yearMatrixGrid .day.is-past.event-ap { background:color-mix(in srgb,var(--ap-bg) 30%,var(--paper)); color:var(--ap); border-color:color-mix(in srgb,var(--ap) 24%,transparent); }
[data-dim-past='true'] #yearMatrixGrid .day.is-past.event-deadline { background:transparent; color:var(--deadline); border-color:transparent; }
[data-dim-past='true'] #yearMatrixGrid .day.is-past.has-event .day-number { opacity:.65; }
[data-dim-past='true'] #yearMatrixGrid .day.is-past .deadline-mark { opacity:.55; }
#yearMatrixGrid .day.is-today { background:var(--today); color:var(--paper); border-color:var(--today); font-weight:800; }
#yearMatrixGrid .day.is-today .deadline-mark { background:var(--paper); }
#yearMatrixGrid .day.is-selected { outline:2px solid var(--ink); outline-offset:-1px; }
#yearMatrixGrid .day.is-reference::before { content:''; width:4px; height:4px; border-radius:50%; position:absolute; left:3px; top:3px; background:var(--today); pointer-events:none; z-index:2; }
#yearMatrixGrid .day.is-today.is-reference::before { background:var(--paper); }
#yearMatrixGrid .day:is(:hover,:focus-visible) { border-color:var(--ink2); }
[data-dim-past='true'] #yearMatrixGrid .day.is-past:is(:hover,:focus-visible,.is-selected) .day-number { opacity:1; }
#yearMatrixGrid .day:focus-visible { outline:2px solid var(--ink); outline-offset:1px; }
#yearMatrixGrid .day-indicators { position:absolute; inset: auto 3px 3px 3px; height:5px; pointer-events:none; }
#yearMatrixGrid .day-indicators .event-count-mark { position:absolute; right:0; bottom:0; width:auto; height:auto; background:none; color:currentColor; font:600 8px/1 var(--sans); }
#yearMatrixGrid .day-indicators .task-dot { width:4px; height:4px; background:var(--task); margin-right:auto; }
#yearMatrixGrid .day-indicators .ap-mark { width:4px; height:4px; background:var(--ap); margin:auto; }
[data-dim-past='true'] .month-card.is-past-month { background:var(--paper); border-color:color-mix(in srgb,var(--rule) 65%,transparent); }
.month-card:not(.is-past-month) { background:var(--surface); }
.visual-key { display:grid; grid-template-columns:1fr 1fr; gap:7px 8px; padding:0 0 12px; margin-bottom:10px; border-bottom:1px solid var(--rule); }
.visual-key > span { display:flex; gap:7px; align-items:center; color:var(--ink2); font-size:11px; line-height:19px; }
.visual-key i { display:inline-flex; align-items:center; justify-content:center; flex:0 0 22px; height:19px; font:600 11px/1 var(--sans); border-radius:3px; }
.key-past { color:var(--past-ink); opacity:.6; }.key-future { color:var(--ink); }
.key-today { background:var(--today); color:var(--paper); }.key-selected { border:1px solid var(--ink); color:var(--ink); }
.key-sat { background:var(--sat-bg); border:1px solid var(--sat); }.key-ap { background:var(--ap-bg); border:1px solid var(--ap); }
.visual-key .key-deadline { flex-basis:8px; width:8px; height:8px; transform:rotate(45deg); background:var(--deadline); margin:0 7px; border-radius:0; }
.visual-key .key-range { height:2px; background:var(--range-line); border-radius:0; }
/* Weekend labels use position, not an unrelated event color. */
.weekdays abbr:nth-child(6),.weekdays abbr:nth-child(7) { color:var(--muted); }
@media screen and (min-width:981px) and (max-height:700px) { .visual-key { gap:3px 6px; padding-bottom:8px; margin-bottom:8px; }.visual-key > span { font-size:10px; line-height:16px; } }


#yearMatrixGrid .day.is-in-range::after { content:none; }

/* Day workspace: time context stays visible before exam details and personal notes. */
.day-dialog { width:min(720px,calc(100vw - 28px)); padding:22px; }
.day-dialog .dialog-header { align-items:center; }
.day-dialog .dialog-header > div { flex:1; min-width:0; }
.day-status { font-size:11px; border:1px solid var(--rule2); color:var(--muted); border-radius:5px; padding:4px 7px; white-space:nowrap; }
.day-dialog[data-time='today'] .day-status { border-color:var(--today); color:var(--today); }
.day-dialog[data-time='future'] .day-status { color:var(--ink); }
.day-dialog .day-nav { align-items:center; margin-top:13px; padding-bottom:12px; }
.day-date-jump input { padding:5px 7px; font-size:12px; max-width:155px; }
.day-overview { padding:16px 0 13px; border-bottom:1px solid var(--rule); }
.day-summary-range { color:var(--muted); font:12px var(--mono); font-variant-numeric:tabular-nums; }
.day-summary-grid { display:grid; grid-template-columns:1fr 1fr 1.2fr; gap:14px; margin:12px 0 9px; }
.day-summary-grid strong { display:block; font:600 30px/1.2 var(--sans); font-variant-numeric:tabular-nums; letter-spacing:-.025em; color:var(--ink); }
.day-summary-grid > div:last-child strong { color:var(--today); }
.day-summary-grid span { color:var(--muted); font-size:11px; }
.day-summary-note { font-size:11px; color:var(--muted); line-height:1.6; }
.day-summary-actions { display:flex; flex-wrap:wrap; gap:7px 24px; margin-top:5px; }
.day-summary-actions button { min-height:29px; color:var(--today); }
.day-dialog .day-events { margin-top:14px; }
.day-events-heading { font-size:12px; font-weight:600; color:var(--ink2); margin-bottom:6px; }
.day-event-list { max-height:190px; overflow:auto; padding-right:5px; overscroll-behavior:contain; }
.day-event { padding:9px 0; }
.day-event-heading { align-items:center; flex-wrap:wrap; gap:5px 8px; }
.day-event-heading h3 { font-size:13px; line-height:1.5; flex:1 1 240px; min-width:0; }
.day-event-heading .event-meta { font-size:11px; white-space:normal; }
.event-instructions { margin-top:5px; }
.event-instructions summary,.exam-instructions summary { cursor:pointer; color:var(--muted); font-size:11px; padding:4px 0; }
.exam-instructions { margin-top:6px; }
.exam-instructions p { font-size:12px; }
.day-dialog .day-tabs { margin-top:15px; }
.day-dialog .empty-state { padding:23px 14px; }
.day-dialog .task-list { max-height:220px; overflow:auto; }
.day-dialog .task-form input { min-width:0; }
.task-undo { display:flex; justify-content:space-between; align-items:center; gap:12px; color:var(--ink2); font-size:12px; padding:5px 0; }
.task-undo .text-button { color:var(--today); }
.day-dialog .dialog-storage-note { margin-top:13px; padding-top:10px; }
.day-dialog .time-stats { padding-bottom:14px; gap:12px; }
@media screen and (max-width:560px) {
 .day-dialog { padding:16px; width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
 .day-dialog .dialog-header { flex-wrap:wrap; gap:8px; }
 .day-dialog .dialog-header h2 { font-size:21px; }
 .day-status { font-size:10px; }
 .day-dialog .day-nav { gap:5px; }
 .day-dialog .day-nav .text-button { font-size:11px; gap:2px; }
 .day-date-jump input { width:116px; font-size:11px; padding:5px 2px; }
 .day-summary-grid { gap:8px; }
 .day-summary-grid strong { font-size:25px; }
 .day-summary-grid span { font-size:10px; }
 .day-summary-actions { gap:4px 17px; }
 .day-event-heading h3 { flex-basis:65%; }
 .day-event-list { max-height:150px; }
 .day-dialog .day-tabs { gap:19px; }
}

/* Official AP/SAT outlines sourced from College Board; geometry is unchanged. */
.brand-mark { display:inline-block; flex-shrink:0; width:30px; height:14px; fill:currentColor; vertical-align:middle; }
.visual-key .brand-sat { color:var(--sat); width:22px; height:12px; }
.visual-key .brand-ap { color:var(--ap); width:22px; height:12px; }
.day-brands { display:flex; position:absolute; bottom:1px; left:50%; transform:translateX(-50%); align-items:center; gap:2px; pointer-events:none; z-index:2; }
.day-brands .brand-mark { width:25px; height:10px; }
#yearMatrixGrid .day:is(.event-sat,.event-ap) { display:grid; grid-template-rows:minmax(0,1fr) 11px; justify-items:center; gap:0; }
#yearMatrixGrid .day:is(.event-sat,.event-ap) .day-number { align-self:center; transform:none; font-size:clamp(11px,1.8vh,22px); line-height:1; }
#yearMatrixGrid .day.event-sat .day-brands { color:var(--sat); }
#yearMatrixGrid .day.event-ap .day-brands { color:var(--ap); }
#yearMatrixGrid .day.is-today .day-brands { color:var(--paper); }
[data-dim-past='true'] #yearMatrixGrid .day.is-past .day-brands { opacity:.65; }
#yearMatrixGrid .day:is(:hover,:focus-visible,.is-selected) .day-brands { opacity:1; }
.event-tag { min-height:24px; display:inline-flex; gap:6px; align-items:center; }
.event-tag .brand-mark { width:31px; height:15px; }
@media screen and (min-width:981px) and (max-height:700px) { .day-brands { bottom:0; }.day-brands .brand-mark { height:6px; width:18px; } #yearMatrixGrid .day:is(.event-sat,.event-ap) { grid-template-rows:minmax(0,1fr) 7px; } }
.day-dialog .dialog-header { position:sticky; top:0; background:var(--surface); z-index:4; }
@media screen and (max-height:800px) {
 .day-dialog { padding:17px 20px; }
 .day-dialog .dialog-header h2 { font-size:22px; }
 .day-dialog .day-nav { margin-top:9px; padding-bottom:8px; }
 .day-overview { padding:11px 0 8px; }
 .day-summary-grid { margin:8px 0 5px; }
 .day-summary-grid strong { font-size:27px; }
 .day-summary-actions { margin-top:2px; }
 .day-summary-actions .text-button { min-height:25px; }
 .day-dialog .day-events { margin-top:10px; }
 .day-event-list { max-height:130px; }
 .day-event { padding:6px 0; }
 .day-dialog .day-tabs { margin-top:10px; }
 .day-dialog .tab { min-height:36px; padding:8px 0; }
 .day-dialog .tab-panel { padding-top:12px; }
 .day-dialog .empty-state { padding:12px; }
 .day-dialog .empty-state strong { font-size:16px; }
 .day-dialog .task-list { max-height:140px; }
 .day-dialog .dialog-storage-note { margin-top:8px; padding-top:8px; }
}
@media screen and (min-width:850px) {
 .day-dialog:has(.day-events:not(.hidden)) { width:min(920px,calc(100vw - 48px)); }
 .day-workspace { display:grid; grid-template-columns:minmax(0,.95fr) minmax(0,1.1fr); gap:22px; margin-top:15px; align-items:start; }
 .day-workspace:has(.day-events.hidden) { grid-template-columns:1fr; }
 .day-dialog .day-events { margin-top:0; min-width:0; }
 .day-personal { min-width:0; }
 .day-dialog .day-tabs { margin-top:0; gap:17px; }
 .day-event-list { max-height:250px; }
 .day-event-heading h3 { flex-basis:190px; }
 .day-event-heading .event-meta { margin-left:0; font-size:10px; }
 .day-dialog .tab { font-size:12px; }
 .day-dialog .task-list { max-height:190px; }
 .day-dialog .task-form .button { padding:8px 10px; }
 .day-personal .time-stats strong { font-size:23px; }
 .day-dialog .day-summary-grid { max-width:660px; }
}
@media screen and (min-width:850px) and (max-height:800px) {
 .day-event-list { max-height:200px; }
 .day-workspace { margin-top:12px; }
}



/* Selected elapsed dates are red; selected upcoming dates are green. */
:root { --selected-range:#ff8b90; --selected-future:#80dfb0; }
[data-theme='light'] { --selected-range:#b32031; --selected-future:#116b46; }
#yearMatrixGrid .day[data-time='future'] { --selected-range:var(--selected-future); }
[data-dim-past] #yearMatrixGrid .day .day-number {
 color:var(--ink); opacity:1; font-weight:500;
}
[data-dim-past='true'] #yearMatrixGrid .day[data-time='past'] .day-number {
 color:var(--ink); opacity:.3; font-weight:400;
}
[data-dim-past] #yearMatrixGrid .day[data-time][data-visual='range'] .day-number {
 color:var(--selected-range); opacity:1; font-weight:650;
}
[data-dim-past] #yearMatrixGrid .day.is-in-range:not(.has-event):not(.is-today) {
 background:transparent;
}
[data-dim-past] #yearMatrixGrid .day[data-time='today'] .day-number {
 color:var(--paper); opacity:1; font-weight:800;
}
#yearMatrixGrid .day.is-selected:not(.is-today) { outline-color:var(--selected-range); }
#yearMatrixGrid .day[data-time='past']:not([data-visual='range']):is(:hover,:focus-visible) .day-number { opacity:1; }
.visual-key .key-past { color:var(--ink); opacity:.3; font-weight:400; }
.visual-key .key-future { color:var(--ink); opacity:1; font-weight:500; }
.visual-key .key-interval { color:var(--selected-range); opacity:1; font-weight:650; background:none; border:0; }
.visual-key .key-interval-future { --selected-range:var(--selected-future); }

/* Type roles: primary duration, date, secondary values, then supporting labels. */
:root { --type-label:12px; --type-body:14px; --type-heading:22px; --type-duration:34px; }
.clock { font-size:22px; font-weight:500; }
.selected-date { font-size:19px; font-weight:650; line-height:1.35; text-wrap:balance; }
.selection-measures { grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr); align-items:baseline; }
.selection-measures strong { font-size:var(--type-duration); font-weight:700; line-height:1.15; }
.selection-measures > div:nth-child(2) strong { font-size:24px; font-weight:600; }
.selection-measures #selectionDays[data-digits='4'] { font-size:26px; }
.selection-measures #selectionDays[data-digits='5'] { font-size:24px; }
.selection-measures #selectionHours[data-digits='7'] { font-size:22px; }
.selection-budget strong { overflow-wrap:anywhere; }
.selection-measures span,.selection-budget > span,.day-summary-grid span { font-size:var(--type-label); }
.selection-budget strong { font-size:22px; font-weight:600; }
.visual-key > span { font-size:12px; line-height:1.5; }
.month-caption { font-size:13px; font-weight:600; }
.weekdays abbr:nth-child(6),.weekdays abbr:nth-child(7) { color:var(--weekend-label,#8e939b); font-weight:600; font-style:italic; }
[data-theme='light'] { --weekend-label:#747b84; }
#yearMatrixGrid .day.is-weekend:not(.has-event):not(.is-today) { background:transparent; }
.day-status { font-size:13px; font-weight:600; }
.day-event-heading .event-meta { font-size:11px; }
.day-dialog .dialog-header h2 { font-size:var(--type-heading); font-weight:650; text-wrap:balance; }
.day-summary-grid { grid-template-columns:1fr 1fr 1.1fr; align-items:baseline; }
.day-summary-grid strong { font-size:28px; font-weight:600; overflow-wrap:anywhere; }
.day-summary-grid > div:first-child strong { font-size:38px; font-weight:700; }
.day-summary-grid > div:last-child strong { font-size:24px; }
.day-dialog .time-stats strong { font-size:23px; }
.day-dialog .time-stats > div:first-child strong { font-size:28px; font-weight:700; }
.day-event-heading h3,.agenda-event-title { font-size:var(--type-body); font-weight:600; }
.explanation,.day-event p,.exam-instructions p { font-size:var(--type-body); line-height:1.65; max-width:70ch; text-wrap:pretty; }
.day-summary-note { font-size:var(--type-label); line-height:1.55; max-width:70ch; text-wrap:pretty; }
#yearMatrixGrid .day:is(.is-today,.is-selected) .day-number { font-size:1.12em; font-weight:750; }
#yearMatrixGrid .day:is(.event-sat,.event-ap):is(.is-today,.is-selected) .day-number { font-size:clamp(11px,1.8vh,22px); }
@media screen and (max-width:560px) {
 .day-summary-grid { grid-template-columns:1fr 1fr 1fr; }
 .day-summary-grid > div:first-child strong { font-size:32px; }
 .day-summary-grid strong { font-size:23px; }
 .day-summary-grid > div:last-child strong { font-size:21px; }
 .day-summary-grid span { font-size:11px; }
 .day-summary-grid #daySummaryDays[data-digits='5'] { font-size:26px; }
 .day-summary-grid strong[data-digits='7'] { font-size:18px; }
}

/* Keep panel contents at a stable width while the year canvas expands. */
@media screen and (min-width:981px) {
 .sidebar { width:230px; flex-basis:230px; min-width:230px; margin-left:0; transition:margin-left 260ms cubic-bezier(.22,1,.36,1),opacity 160ms ease; }
 .calendar-expanded > .sidebar { display:flex; margin-left:-230px; opacity:0; pointer-events:none; }
 .main { margin-left:0; transition:margin-left 260ms cubic-bezier(.22,1,.36,1); }
 .calendar-expanded .main { width:auto; margin-left:40px; }
 .restore-panel { display:inline-flex; left:4px; top:12px; bottom:auto; width:32px; height:32px; min-height:32px; padding:6px; opacity:0; visibility:hidden; pointer-events:none; box-shadow:none; transition:opacity 160ms ease; }
 .calendar-expanded > .restore-panel { opacity:1; visibility:visible; pointer-events:auto; }
}

/* Color communicates time direction, hours, study budget, and exam identity. */
:root { --past-tone:#f29a9f; --future-tone:#8dd6b0; --hours-tone:#9fc8ff; --study-tone:#d0b8fa; --future-ink:#d8e5ee; }
[data-theme='light'] { --past-tone:#a93140; --future-tone:#116b46; --hours-tone:#20599c; --study-tone:#6b3fa0; --future-ink:#253e50; }
.selection-section,.day-dialog { --direction-tone:var(--today); }
.selection-section[data-time='past'],.day-dialog[data-time='past'] { --direction-tone:var(--past-tone); }
.selection-section[data-time='future'],.day-dialog[data-time='future'] { --direction-tone:var(--future-tone); }
.selected-date,.selection-measures > div:first-child strong,.day-summary-grid > div:first-child strong { color:var(--direction-tone); }
.selection-measures > div:nth-child(2) strong,.day-summary-grid > div:nth-child(2) strong { color:var(--hours-tone); }
.selection-budget strong,.day-summary-grid > div:last-child strong { color:var(--study-tone); }
.day-dialog[data-time] .day-status { color:var(--direction-tone); border-color:color-mix(in srgb,var(--direction-tone) 50%,var(--rule)); background:color-mix(in srgb,var(--direction-tone) 8%,var(--surface)); }
.day-dialog .time-stats > div:nth-child(1) strong { color:var(--direction-tone); }
.day-dialog .time-stats > div:nth-child(2) strong { color:var(--hours-tone); }
.day-dialog .time-stats > div:nth-child(3) strong { color:var(--study-tone); }
.sidebar-controls .year-controls select { color:var(--hours-tone); }
.month-card.is-past-month .month-caption { color:var(--muted); }
.month-card:not(.is-past-month):not(.current-month) .month-caption { color:var(--future-tone); }
.month-card.current-month .month-title,.month-card.current-month .month-caption { color:var(--today); }
.month-card:not(.is-past-month):not(.current-month) .month-title { color:var(--hours-tone); }
[data-dim-past] #yearMatrixGrid .day[data-time='future']:not([data-visual='range']) .day-number { color:var(--future-ink); }
.month-status { display:flex; flex-direction:column; align-items:flex-end; gap:3px; flex-shrink:0; }
.month-time-meter { width:52px; height:5px; overflow:visible; }
.month-meter-track { fill:var(--future-tone); opacity:.15; }
.month-meter-elapsed { fill:var(--past-ink); opacity:.65; }
.month-meter-now { stroke:var(--today); stroke-width:2; }
.year-remaining { margin-top:8px; font-size:14px; font-weight:650; line-height:1.45; color:var(--deadline); font-variant-numeric:tabular-nums; }
.year-time-map { display:block; width:100%; height:auto; margin-top:8px; }
.year-map-past { fill:var(--past-ink); opacity:.45; }
.year-map-future { fill:var(--future-tone); }
.year-map-today { fill:var(--ink); }
[data-dim-past='true'] .month-card.is-past-month { background:var(--paper); }
.month-card:not(.is-past-month):not(.current-month) { background:color-mix(in srgb,var(--future-tone) 3%,var(--surface)); }
.month-card.current-month { background:color-mix(in srgb,var(--deadline) 3%,var(--surface)); }
.today-section progress::-webkit-progress-value { background:var(--past-ink); }
.today-section progress::-moz-progress-bar { background:var(--past-ink); }
[data-dim-past='true'] #yearMatrixGrid .day[data-time='past']:is(.event-sat,.event-ap) { background:color-mix(in srgb,var(--muted) 6%,var(--paper)); border-color:color-mix(in srgb,var(--muted) 22%,transparent); }
[data-dim-past='true'] #yearMatrixGrid .day[data-time='past'] .day-brands { color:var(--muted); opacity:.55; }
[data-dim-past='true'] #yearMatrixGrid .day[data-time='past'] .deadline-mark { background:var(--muted); opacity:.45; }
.calendar-key { margin-top:14px; border-top:1px solid var(--rule); padding-top:9px; }
.calendar-key summary { color:var(--ink2); font-size:12px; font-weight:600; cursor:pointer; }
.calendar-key .visual-key { margin:9px 0 0; padding:0; border:0; }
.pace-presets { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; margin:8px 0; }
.pace-presets button { min-width:0; min-height:30px; border:1px solid var(--rule); border-radius:4px; padding:4px 2px; font-size:12px; font-weight:600; color:var(--ink2); background:transparent; }
.pace-presets button span { display:none; }
.pace-presets button[aria-pressed='true'] { color:var(--study-tone); border-color:var(--study-tone); background:color-mix(in srgb,var(--study-tone) 10%,transparent); }
.pace-presets button:hover { background:var(--hover); }
.day-dialog .pace-presets button span,.calculator-dialog .pace-presets button span { display:inline; }
.upcoming-item[data-group='sat'] .upcoming-title { color:var(--sat); }
.upcoming-item[data-group='ap'] .upcoming-title { color:var(--ap); }
.upcoming-item[data-kind='deadline'] .upcoming-title { color:var(--deadline); }
.upcoming-meta { display:block; font-size:12px; }
.upcoming-list { display:block; }
#resultSummary { grid-column:1/-1; color:var(--hours-tone); font-size:12px; line-height:1.5; }
.sidebar-controls > .coverage-note { font-size:12px; line-height:1.5; padding:8px; margin:8px 0 0; max-height:none; }
@media screen and (min-width:981px) and (max-height:800px) {
 .today-section { display:grid; grid-template-columns:1fr auto; gap:2px 7px; align-items:center; }
 .today-section .clock-label { grid-column:1; grid-row:1; font-size:11px; }
 .today-section .clock { grid-column:2; grid-row:1; font-size:18px; margin:0; }
 .today-section > :not(.clock-label):not(.clock) { grid-column:1/-1; }
 .today-section .today-label { margin-top:0; }
 .today-section .today-button { margin-top:4px; }
 .today-section .year-progress-caption { margin-top:4px; }
 .today-section .year-time-map { margin-top:4px; }
 .today-section progress { margin-top:3px; }
 .today-section .year-remaining { margin-top:4px; font-size:13px; line-height:1.4; }
}
@media screen and (max-width:700px) { .today-section .year-remaining,.year-time-map { display:none; } }
