:root {
  --control-bg:#f3f3fa;
  --soft:#f8f8fc;
  --selected:#f6f3ff;
  --text-secondary:#667085;
}
[data-theme="dark"] {
  color-scheme:dark;
  --bg:#10141d;
  --surface:#191f2b;
  --ink:#edf0f8;
  --muted:#a8b3c7;
  --line:#30394c;
  --accent:#b3a5ff;
  --control-bg:#252c3c;
  --soft:#151b27;
  --selected:#25213b;
  --text-secondary:#b6bfd0;
}
.topbar{gap:14px}
[hidden]{display:none!important}
.source-strip{flex-wrap:wrap;row-gap:8px;font-size:11px}
.source-actions{display:flex;flex-wrap:wrap;gap:13px;align-items:center;margin-left:auto}
.source-actions button{font-size:11px}
.sync-badge{display:inline-flex;align-items:center;gap:6px;font-size:10px;color:var(--text-secondary)}
.sync-badge:before{content:'';width:5px;height:5px;border-radius:50%;background:#9299ad}
.sync-badge[data-state="ok"]:before{background:#68a98d}
.sync-badge[data-state="error"]:before{background:#dc7d90}
.sync-badge[data-state="stale"]:before{background:#d5ad60}
.change-record{padding:18px 0;border-bottom:1px solid var(--line)}
.change-versions{display:grid;grid-template-columns:1fr 1fr;gap:16px;font-size:12px;line-height:1.65}
.change-versions>div{min-width:0;display:flex;flex-direction:column;gap:7px;overflow-wrap:anywhere}
.change-versions small,.change-empty{color:var(--text-secondary)}
.change-caption{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:1px}
.theme-toggle,.focus-toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  padding:9px 11px;border:1px solid var(--line);border-radius:8px;
  background:var(--surface);color:var(--text-secondary);font-size:12px;white-space:nowrap;
}
.theme-toggle svg,.focus-toggle svg{width:16px;height:16px}
.theme-toggle:hover,.focus-toggle:hover{background:var(--control-bg);color:var(--accent)}
.theme-toggle{margin-left:2px}
.top-semester{margin-left:auto}
.calendar-toolbar{flex-wrap:wrap;gap:14px}
.calendar-toolbar .view-switch{margin-left:auto}
.focus-toggle[aria-pressed="true"]{background:var(--selected);color:var(--accent)}
.calendar-viewport{max-height:min(78vh,1100px);scrollbar-color:#777d95 transparent}
.week-grid{isolation:isolate;min-width:1230px;grid-auto-flow:row;align-items:stretch}
.week-grid .day-header,.week-grid .time-header{height:76px;background:var(--surface);z-index:5}
.week-grid .day-header button{padding:0;min-height:52px}
.week-grid .day-header .day-name{font-size:11px}
.time-header{font-size:10px}
.time-label{grid-column:1;align-self:start;padding:7px 8px;font-size:11px;color:var(--text-secondary);font-variant-numeric:tabular-nums;z-index:1}
.calendar-grid-cell{min-width:0;position:relative;border-left:1px solid var(--line);border-top:1px solid var(--line);background:var(--surface)}
.calendar-grid-cell.selected,.day-header.selected{background:var(--selected)}
.calendar-grid-cell.weekend{background:var(--soft)}
.calendar-grid-cell .weekend-label{display:block;text-align:center;margin-top:24px;font-size:10px;color:var(--muted)}
.week-grid>.event-card{
  position:relative;top:auto;left:auto;right:auto;width:auto;height:auto;min-height:min-content;
  margin:5px 6px 7px;padding:12px 11px;gap:7px;border-radius:8px;
  overflow:visible;align-self:stretch;z-index:2;
}
.event-card>*{flex-shrink:0}
.event-card .event-department{font-size:12px;font-weight:700;line-height:1.45;overflow-wrap:anywhere}
.event-card .event-title{
  display:block;font-size:13px;line-height:1.5;font-weight:550;
  -webkit-line-clamp:unset;overflow:visible;white-space:normal;overflow-wrap:anywhere;
}
.event-card .event-time{font-size:11px;line-height:1.4;opacity:1;font-variant-numeric:tabular-nums}
.event-card .event-teacher{font-size:11px;line-height:1.5;white-space:normal;overflow:visible;text-overflow:clip;opacity:.94;overflow-wrap:anywhere}
.event-card .event-label{font-size:10px;line-height:1.45;opacity:.94;margin-top:3px}
.event-card.free .event-title{font-size:12px;line-height:1.5}
.event-card.free .event-time{font-size:11px;opacity:1}
.day-event{padding:17px 18px;gap:9px;overflow:visible}
.day-event .event-title{font-size:15px}
.day-event .event-department{font-size:12px}
.day-event .event-teacher{font-size:12px;white-space:normal;overflow:visible}
.day-event .event-label{font-size:11px}
.group-select select,.search-field input{font-size:12px}
.search-field input{width:155px}
.free-toggle{font-size:11px}
.date-nav h2{font-size:15px}
.view-switch button{font-size:12px}
.today-button{font-size:12px}
.legend{font-size:10px}
.timezone{font-size:10px}
.calendar-focus .sidebar,.calendar-focus .page-heading,.calendar-focus .overview,
.calendar-focus .source-strip,.calendar-focus .context-panel,.calendar-focus .page-footer{display:none}
.calendar-focus .shell{margin-left:0}
.calendar-focus main{max-width:none;padding:16px}
.calendar-focus .content-layout{display:block}
.calendar-focus .topbar{height:54px;padding:0 20px}
.calendar-focus .calendar-viewport{max-height:calc(100vh - 210px)}
.calendar-focus .schedule-panel{width:100%}

[data-theme="dark"] .sidebar,[data-theme="dark"] .topbar,
[data-theme="dark"] .overview,[data-theme="dark"] .schedule-panel,
[data-theme="dark"] .day-summary,[data-theme="dark"] .week-balance,
[data-theme="dark"] dialog,[data-theme="dark"] .source-link,
[data-theme="dark"] .today-button,[data-theme="dark"] .arrows,
[data-theme="dark"] .group-select select,[data-theme="dark"] .day-header,
[data-theme="dark"] .time-header {
  background:var(--surface);color:var(--ink);border-color:var(--line);
}
[data-theme="dark"] .brand-wordmark>span{color:var(--ink)}
[data-theme="dark"] .brand-wordmark{color:var(--muted)}
[data-theme="dark"] .workspace,[data-theme="dark"] .view-switch,
[data-theme="dark"] .search-field,[data-theme="dark"] .tiny-badge,
[data-theme="dark"] .day-quote,[data-theme="dark"] .dialog-note,
[data-theme="dark"] .week-empty-note{background:var(--soft);border-color:var(--line);color:var(--muted)}
[data-theme="dark"] .nav-item{color:var(--text-secondary)}
[data-theme="dark"] .nav-item.active,[data-theme="dark"] .view-switch button[aria-pressed="true"],
[data-theme="dark"] .overview-icon,[data-theme="dark"] .board-number,
[data-theme="dark"] .pill,[data-theme="dark"] .detail-tag,
[data-theme="dark"] .preview-more{background:var(--selected);color:#c9bfff;border-color:var(--line)}
[data-theme="dark"] .small-note{background:linear-gradient(145deg,#262139,#1c2030);border-color:#3b3354}
[data-theme="dark"] .source-card{background:#242035;border-color:#3a3252}
[data-theme="dark"] .source-card h3{color:#e0d8f6}
[data-theme="dark"] .source-symbol{background:#353046;border-color:#48405c;color:#c7b8ed}
[data-theme="dark"] .source-card p,[data-theme="dark"] .snapshot-label,
[data-theme="dark"] .source-card-eyebrow,[data-theme="dark"] .quality-button{color:#beb0d4}
[data-theme="dark"] .snapshot-label{border-color:#423852}
[data-theme="dark"] .breadcrumb strong,[data-theme="dark"] .day-number,
[data-theme="dark"] .overview-status strong,[data-theme="dark"] .balance-row strong,
[data-theme="dark"] .day-time,[data-theme="dark"] .empty-state h3{color:var(--ink)}
[data-theme="dark"] .day-header button,[data-theme="dark"] .time-tick,
[data-theme="dark"] .overview-main div>span:last-child,[data-theme="dark"] .overview-stat>span:last-child,
[data-theme="dark"] .page-heading p,[data-theme="dark"] .overline,
[data-theme="dark"] .aside-caption,[data-theme="dark"] .preview-meta,
[data-theme="dark"] .preview-time,[data-theme="dark"] .day-list-heading,
[data-theme="dark"] .source-strip,[data-theme="dark"] .legend,
[data-theme="dark"] .timezone,[data-theme="dark"] .detail-grid dt,
[data-theme="dark"] .balance-row,[data-theme="dark"] .free-toggle,
[data-theme="dark"] .search-field input,[data-theme="dark"] .view-switch button,
[data-theme="dark"] .page-footer,[data-theme="dark"] .eyebrow{color:var(--muted)}
[data-theme="dark"] .source-strip button{color:#dfc18b}
[data-theme="dark"] .source-card.has-warning .quality-button{color:#dfc18b}
[data-theme="dark"] .event-card{--event:#d8d0ff;--event-bg:#302b49;--event-line:#51466f}
[data-theme="dark"] .event-card.biochemistry{--event:#f0d0a0;--event-bg:#372f25;--event-line:#645039}
[data-theme="dark"] .event-card.biology{--event:#b1e3d3;--event-bg:#203930;--event-line:#3a6151}
[data-theme="dark"] .event-card.behaviour{--event:#e4bedc;--event-bg:#382b3c;--event-line:#60435f}
[data-theme="dark"] .event-card.practical{--event:#b3ddef;--event-bg:#203645;--event-line:#375a70}
[data-theme="dark"] .event-card.exam{--event:#f4bbc3;--event-bg:#402a33;--event-line:#6b434f}
[data-theme="dark"] .event-card.free,[data-theme="dark"] .event-card.holiday,
[data-theme="dark"] .event-card.unknown{--event:#b6bfd0;--event-bg:#1b2230;--event-line:#3b4356}
[data-theme="dark"] .quality-notice{background:#3a3020;border-color:#655331;color:#e2c78e}
[data-theme="dark"] .warning-list{color:#c9bdd4}
[data-theme="dark"] .warning-list li{border-color:var(--line)}
[data-theme="dark"] .error-box{background:#38232e;border-color:#714454;color:#f2c0cc}
[data-theme="dark"] .error-box button{background:var(--surface);border-color:var(--line)}
[data-theme="dark"] .balance-track{background:var(--control-bg)}
[data-theme="dark"] .avatar{background:var(--selected);color:#c3b5ed}
[data-theme="dark"] .day-header.today .day-number{color:#171321}
[data-theme="dark"] .day-header.selected{background:var(--selected)}
[data-theme="dark"] .icon-button:hover{background:var(--control-bg);color:var(--accent)}

@media(max-width:760px){
  .source-strip{font-size:10px}.source-actions{margin-left:0;width:100%;justify-content:space-between;gap:8px}.source-actions button{font-size:10px}
  .change-versions{grid-template-columns:1fr}
  .theme-toggle{padding:8px;margin-left:auto}.theme-toggle .theme-label{display:none}
  .top-semester{margin-left:0}.topbar{gap:9px}
  .calendar-toolbar .view-switch{width:calc(100% - 47px);margin-left:0}
  .focus-toggle{padding:9px;min-width:35px}.focus-toggle .focus-label{display:none}
  .calendar-toolbar{gap:10px}.day-event .event-title{font-size:14px}
  .day-event .event-teacher{font-size:12px}.day-event .event-department{font-size:12px}
  .day-event .event-label{font-size:11px}.search-field input{width:100%;font-size:12px}
  .calendar-focus main{padding:8px}.calendar-focus .calendar-viewport{max-height:calc(100vh - 255px)}
  .calendar-footer .legend{font-size:9px;gap:10px}
}
