:root {
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  color: #102747;
  background: #f3f6fb;
  font-synthesis: none;
  --ink: #102747;
  --blue: #2559d6;
  --blue-dark: #1949bd;
  --canvas: #f3f6fb;
  --muted: #66778e;
  --teal: #137f74;
  --line: #e1e7f0;
  --red: #af3e42;
  --white: #fff;
}

* { box-sizing: border-box; }
html { min-width: 0; scroll-behavior: smooth; }
body { margin: 0; min-width: 0; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, input, select, textarea { max-width: 100%; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #6da0ff;
  outline-offset: 3px;
}
button { color: inherit; }
button svg, a svg { flex: 0 0 auto; }
svg.icon, .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
.summary-value, .session-duration, .day-number, .workload-label, .capacity-row input { font-variant-numeric: tabular-nums; }
h1 { font-size: clamp(29px, 2.6vw, 39px); font-weight: 700; line-height: 1.18; letter-spacing: -1.35px; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -.45px; line-height: 1.35; }
h3 { font-size: 15px; line-height: 1.4; font-weight: 650; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 264px; z-index: 100; padding: 12px 18px; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.app-shell { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 240px; display: flex; flex-direction: column; padding: 32px 18px 20px; background: #102747; color: #d7e1f0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; margin-bottom: 42px; }
.brand-mark { width: 39px; height: 43px; flex-shrink: 0; display: grid; place-items: center; background: #376dea; color: #fff; border-radius: 10px 10px 16px 10px; font-size: 23px; font-weight: 750; letter-spacing: -2px; }
.brand-mark .icon { width: 24px; height: 24px; }
.brand-name { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: -.55px; line-height: 1.3; }
.brand-caption { display: block; color: #a7bad6; font-size: 11px; line-height: 1.6; letter-spacing: .1px; margin-top: 3px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 7px; }
.nav-link { border: 0; background: none; min-height: 47px; width: 100%; display: flex; align-items: center; gap: 13px; text-align: left; padding: 12px 15px; border-radius: 8px; font-weight: 500; color: #b5c5dc; font-size: 14px; }
.nav-link:hover { color: white; background: #1a355a; }
.nav-link.active { background: #2559d6; color: white; font-weight: 650; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; }
.nav-icon .icon { width: 19px; height: 19px; }
.nav-text { flex: 1; }
.nav-count { display: inline-grid; min-width: 22px; height: 22px; place-items: center; background: #ffffff14; border-radius: 5px; font-size: 11px; font-weight: 650; }
.sidebar-bottom { margin-top: auto; padding-top: 40px; }
.sidebar-note { margin: 24px 11px 3px; padding: 17px 0 0; border-top: 1px solid #ffffff1a; color: #91a6c4; font-size: 11px; line-height: 1.8; }
.sidebar-note strong { display: block; color: #d4dfef; font-weight: 550; font-size: 12px; margin-bottom: 4px; }
.workspace { margin-left: 240px; min-width: 0; }
.topbar { min-height: 77px; padding: 16px 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.breadcrumb strong { color: #3d506a; font-weight: 550; }
.breadcrumb .icon { width: 15px; height: 15px; color: #9ba9ba; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.save-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.save-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.save-state.save-error { color: var(--red); }
.save-state.save-error::before { background: var(--red); }
.save-state.demo-state::before { background: #b98322; }
.icon-button, .close-button { border: 1px solid var(--line); background: #fff; color: #5e7088; width: 44px; height: 44px; min-height: 44px; padding: 10px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.icon-button:hover, .close-button:hover { background: var(--canvas); color: var(--ink); }
.avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; background: #eaf0fe; color: #2559d6; border: 1px solid #dce6fd; border-radius: 50%; font-size: 11px; font-weight: 700; }
.content { max-width: 1360px; margin: auto; padding: 36px 38px 28px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading-copy { min-width: 0; }
.page-heading-copy > p, .page-date { font-size: 13px; color: var(--muted); margin-top: 9px; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 17px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; line-height: 1.5; font-weight: 650; white-space: nowrap; }
.button:hover { border-color: #c1cfe3; background: #f8faff; }
.button.primary { background: var(--blue); color: white; border-color: var(--blue); }
.button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.secondary { background: white; border-color: #d9e1ec; }
.button.quiet { background: transparent; border-color: transparent; color: var(--blue); }
.button.quiet:hover { background: #eaf0fd; }
.button.danger { color: var(--red); }
.button.danger:hover { background: #fff1f0; border-color: #efc4c5; }
.button.small { min-height: 44px; padding: 9px 12px; font-size: 11px; }
.button .icon { width: 17px; height: 17px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; }
.muted { color: var(--muted); }
.full { width: 100%; }
.demo-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; background: #fff8e9; border: 1px solid #f0e1bd; color: #7c6027; border-radius: 8px; padding: 12px 17px; font-size: 12px; }
.demo-banner .button { background: #fff; color: #7c6027; border-color: #e9d7b1; flex-shrink: 0; }
.notice, .inline-notice { padding: 13px 16px; margin-bottom: 20px; border: 1px solid #eed8ba; border-radius: 8px; background: #fff8ed; color: #8c6130; font-size: 12px; line-height: 1.6; }
.inline-notice { margin: 13px 0 0; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(270px, 1fr); gap: 28px; align-items: start; }
.main-column, .aside-column { min-width: 0; }
.next-card { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 248px; border-radius: 12px; background: #2559d6; color: #fff; padding: 30px 32px; margin-bottom: 22px; }
.next-content { position: relative; z-index: 2; flex: 1; min-width: 0; }
.next-label { display: inline-flex; gap: 7px; align-items: center; color: #e2ebff; font-size: 11px; font-weight: 550; margin-bottom: 14px; }
.next-label .icon { width: 15px; height: 15px; }
.next-title { font-size: clamp(22px, 1.9vw, 29px); line-height: 1.23; font-weight: 650; letter-spacing: -.7px; max-width: 430px; margin-bottom: 10px; overflow-wrap: anywhere; }
.next-copy { font-size: 12px; color: #dbe6ff; line-height: 1.65; max-width: 370px; }
.next-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; font-size: 11px; color: #e3ecff; margin-top: 15px; }
.next-meta > span { display: inline-flex; gap: 5px; align-items: center; }
.next-meta .icon { width: 14px; height: 14px; }
.next-card .button { margin-top: 22px; background: #fff; color: #1f50c3; border-color: #fff; padding-inline: 17px; }
.next-card .button:hover { background: #eaf0ff; border-color: #eaf0ff; }
.next-art { display: flex; align-items: center; justify-content: center; width: 170px; flex: 0 0 170px; align-self: stretch; margin: 0 -9px 0 10px; color: white; opacity: .95; }
.next-art > svg { width: 100%; height: auto; max-height: 200px; overflow: visible; }
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px 0 22px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.summary-item { padding: 0 21px; border-left: 1px solid #dce4f0; display: flex; flex-direction: column; gap: 3px; }
.summary-item:first-child { padding-left: 0; border-left: 0; }
.summary-value { font-size: 25px; letter-spacing: -.8px; font-weight: 650; line-height: 1.25; color: var(--ink); }
.summary-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.summary-label { font-size: 12px; color: var(--muted); }
.section { margin-top: 25px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 22px 23px; min-width: 0; }
.aside-column > .section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-title { font-size: 16px; font-weight: 700; letter-spacing: -.35px; }
.section-copy { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.section-head > .button { margin: -8px -10px -8px 0; }
.week-controls { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.week-controls .icon-button { width: 44px; height: 44px; min-height: 44px; padding: 7px; border: 0; background: transparent; }
.week-controls .icon { width: 15px; height: 15px; }
.week-range { font-size: 11px; font-weight: 550; white-space: nowrap; color: #6a7a90; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; margin: 0 0 21px; }
.day-button { min-width: 0; min-height: 75px; padding: 10px 3px 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid transparent; background: #f6f8fc; color: var(--ink); border-radius: 8px; }
.day-button:hover { background: #eaf0fd; }
.day-name { font-size: 10px; color: var(--muted); }
.day-number { font-size: 16px; font-weight: 650; line-height: 1.4; }
.day-dot { height: 4px; width: 4px; border-radius: 50%; background: #9caecb; margin-top: 2px; }
.day-button.is-today { border-color: #afc5f8; }
.day-button.selected { background: var(--blue); border-color: var(--blue); color: white; }
.day-button.selected .day-name { color: #dbe5ff; }
.day-button.selected .day-dot { background: #fff; }
.session-list { display: flex; flex-direction: column; }
.session { display: flex; gap: 16px; align-items: center; padding: 15px 0; border-top: 1px solid #e9edf4; min-width: 0; }
.session:first-child { border-top: 0; padding-top: 0; }
.session:last-child { padding-bottom: 0; }
.session-duration { width: 55px; flex-shrink: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; border-right: 2px solid #bdcef5; font-size: 17px; font-weight: 650; line-height: 1.2; color: #2d558f; }
.session-duration small { font-size: 9px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.session-content { min-width: 0; flex: 1; }
.session-content h3 { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.session-content p { color: var(--muted); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.session-edit { flex-shrink: 0; background: transparent; border: 0; color: #7e8da3; padding: 10px; min-height: 44px; min-width: 44px; border-radius: 8px; }
.session-edit:hover { background: var(--canvas); color: var(--blue); }
.session-edit .icon { width: 16px; height: 16px; }
.assignment-list { min-width: 0; }
.assignment-row { display: flex; align-items: center; gap: 12px; padding: 17px 0; border-top: 1px solid #e9edf4; min-width: 0; }
.assignment-row:first-child { padding-top: 0; border-top: 0; }
.assignment-row:last-child { padding-bottom: 0; }
.course-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--course-color, #7789bd); }
.assignment-copy { flex: 1; min-width: 0; }
.assignment-title { display: block; background: none; border: 0; text-align: left; padding: 5px 0; color: var(--ink); font-size: 15px; line-height: 1.5; font-weight: 650; white-space: normal; overflow-wrap: anywhere; }
button.assignment-title { min-height: 44px; }
button.assignment-title:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.assignment-meta { font-size: 12px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.assignment-trailing { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.assignment-trailing .icon-button { width: 44px; height: 44px; min-height: 44px; border: 0; background: transparent; padding: 9px; }
.assignment-trailing .icon-button .icon { width: 16px; height: 16px; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border-radius: 5px; font-size: 9px; font-weight: 600; line-height: 1.5; color: #67778e; background: #f0f3f8; white-space: nowrap; }
.status-badge[data-status="progress"], .status-badge[data-status="in-progress"], .status-badge[data-status="in_progress"] { background: #edf2ff; color: #3260c4; }
.status-badge[data-status="done"], .status-badge[data-status="complete"], .status-badge[data-status="completed"] { background: #e9f5f1; color: #137f74; }
.status-badge[data-status="overdue"] { background: #fff0ef; color: #b24947; }
.empty-state { padding: 22px 12px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.75; }
.empty-state h3 { color: var(--ink); margin-bottom: 5px; font-size: 13px; }
.empty-state p { max-width: 38ch; margin-inline: auto; }
.empty-state .button { margin-top: 15px; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 13px; border-radius: 50%; background: #edf2fc; color: #7797d7; }
.course-list { display: flex; flex-direction: column; gap: 0; }
.course-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 0; border-top: 1px solid #edf0f6; font-size: 13px; }
.course-row:first-child { border-top: 0; padding-top: 0; }
.course-row:last-child { padding-bottom: 0; }
.course-row > :nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.course-count { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.workload-list { display: flex; flex-direction: column; gap: 15px; }
.workload-row { font-size: 12px; }
.workload-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #596d88; margin-bottom: 6px; }
.workload-label strong { color: #50647e; font-weight: 500; }
.workload-track, .progress-track { height: 6px; border-radius: 4px; background: #edf1f8; overflow: hidden; }
.workload-fill, .progress-fill { height: 100%; width: 0; max-width: 100%; border-radius: inherit; background: #7b9de7; }
.workload-row.is-over .workload-fill, .workload-fill.is-over { background: #d77c6d; }
.workload-row.is-over .workload-label { color: #ac534a; }
.progress-track { margin-top: 12px; }
.progress-fill { background: var(--teal); }
.onboarding { display: flex; flex-direction: column; gap: 1px; }
.onboarding-action { min-height: 59px; display: flex; align-items: center; gap: 12px; padding: 11px 0; background: transparent; border: 0; border-top: 1px solid #e9edf4; color: var(--ink); text-align: left; font-size: 12px; font-weight: 550; }
.onboarding-action:first-child { border-top: 0; padding-top: 0; }
.onboarding-action:last-child { padding-bottom: 0; }
.onboarding-action > span:not(.onboarding-number) { flex: 1; min-width: 0; }
.onboarding-action small { display: block; font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.onboarding-action > .icon { width: 16px; height: 16px; color: #91a3bf; }
.onboarding-number { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #dbe5f7; color: #4b6fb5; border-radius: 50%; flex-shrink: 0; font-size: 11px; font-weight: 650; }

.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.filter-buttons { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.filter-button { min-height: 44px; padding: 10px 13px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 12px; font-weight: 550; }
.filter-button:hover { color: var(--blue); background: #eaf0fc; }
.filter-button.active { color: var(--blue); background: #e8efff; border-color: #dae5fd; }
.search-field { position: relative; min-width: 180px; max-width: 285px; flex: 1; margin: 0; }
.search-field .icon { position: absolute; left: 13px; top: 14px; width: 17px; height: 17px; color: #8697ad; }
.search-input { min-height: 44px; padding: 10px 13px 10px 39px; background: white; font-size: 12px; }
.result-count { font-size: 11px; color: var(--muted); margin-bottom: 16px; }
.task-detail { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 16px; align-items: start; }
.task-notes { font-size: 12px; color: #5d708a; line-height: 1.75; margin-top: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.capacity-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 27px; align-items: start; }
.capacity-layout > .section, .settings-grid > .section { margin-top: 0; }
.capacity-grid { display: grid; gap: 0; }
.capacity-row { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(90px, 140px) minmax(80px, 130px); gap: 20px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); }
.capacity-row:first-child { border-top: 0; padding-top: 0; color: var(--muted); font-size: 11px; }
.capacity-row > * { min-width: 0; }
.capacity-row input { min-height: 44px; padding: 10px 11px; }
.capacity-day { font-size: 12px; font-weight: 600; }
.capacity-day small { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); font-weight: 400; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.settings-panel { min-width: 0; }
.settings-panel > p { font-size: 12px; line-height: 1.75; color: var(--muted); margin-bottom: 17px; max-width: 58ch; }
.settings-panel .row { padding: 14px 0; border-top: 1px solid var(--line); }
.settings-panel .row:first-child { padding-top: 0; border-top: 0; }
.settings-panel .row > div { flex: 1; min-width: 0; }
.settings-panel .row p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.settings-panel .button.full + .button.full { margin-top: 10px; }
.footer-note { font-size: 10px; color: #8190a5; margin-top: 28px; text-align: center; line-height: 1.7; }
.mobile-nav { display: none; }

dialog { width: min(560px, calc(100% - 40px)); max-height: calc(100dvh - 64px); margin: auto; overflow: auto; padding: 28px; border: 1px solid #dbe3f0; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 24px 90px #071a3f35; }
dialog::backdrop { background: #071a3f66; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.dialog-heading h2 { font-size: 23px; letter-spacing: -.7px; }
.dialog-subtitle { font-size: 12px; color: var(--muted); margin-top: 6px; }
.close-button { flex-shrink: 0; width: 44px; height: 44px; min-height: 44px; border: 0; margin: -7px -7px 0 0; }
form { margin-top: 25px; }
label { display: block; margin-bottom: 17px; color: #314964; font-size: 12px; font-weight: 600; }
input, select, textarea { display: block; width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid #d5deeb; border-radius: 7px; background: #fff; color: var(--ink); font-size: 14px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #92a0b3; }
label input, label select, label textarea { margin-top: 7px; font-weight: 400; }
input:hover, select:hover, textarea:hover { border-color: #b6c6de; }
input[type="checkbox"] { width: 18px; min-height: 18px; display: inline-block; accent-color: var(--blue); }
input[type="file"] { font-size: 12px; padding: 10px; }
input[type="color"] { padding: 5px; }
textarea { min-height: 100px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 15px; }
.form-grid .full { grid-column: 1 / -1; }
.help { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.65; margin-top: 6px; }
.form-error { color: #ab3b40; font-size: 12px; background: #fff2f2; border-radius: 7px; padding: 10px 12px; margin-bottom: 16px; }
.form-error:empty { display: none; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; padding-top: 19px; margin-top: 5px; border-top: 1px solid var(--line); }
#toast { position: fixed; z-index: 90; bottom: 28px; left: calc(50% + 120px); transform: translate(-50%, 10px); display: block; width: max-content; max-width: calc(100vw - 40px); padding: 13px 20px; border-radius: 9px; background: #102747; color: #fff; font-size: 12px; box-shadow: 0 8px 24px #0c244d24; opacity: 0; pointer-events: none; visibility: hidden; }
#toast.toast-visible { opacity: 1; transform: translate(-50%, 0); visibility: visible; }

@media (min-width: 1600px) {
  .content { padding-top: 44px; }
  .dashboard-grid { gap: 32px; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
  .next-card { min-height: 264px; padding: 34px 36px; }
  .next-art { width: 200px; flex-basis: 200px; }
  .section { padding: 25px 27px; }
}

@media (max-width: 1200px) {
  .topbar { padding-inline: 28px; }
  .content { padding: 30px 28px 26px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.65fr) minmax(245px, 1fr); gap: 20px; }
  .section { padding: 20px; }
  .next-card { padding: 25px; min-height: 241px; }
  .next-art { width: 115px; flex-basis: 115px; margin-right: -13px; }
  .next-title { font-size: 24px; }
  .summary-item { padding-inline: 15px; }
  .section-head { flex-wrap: wrap; }
  .week-controls { margin-left: auto; }
}

@media (max-width: 1050px) and (min-width: 761px) {
  .content { padding-inline: 24px; }
  .topbar { padding-inline: 24px; }
  .dashboard-grid, .capacity-layout { grid-template-columns: minmax(0, 1fr); }
  .aside-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .aside-column > .section { margin-top: 0; }
  .aside-column > .section:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .next-art { width: 160px; flex-basis: 160px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-bar { flex-wrap: wrap; }
  .search-field { max-width: none; }
  .page-heading { align-items: flex-start; }
  .page-actions { justify-content: flex-end; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 65px; padding: 10px 22px; }
  .breadcrumb { font-size: 11px; }
  .topbar-actions { gap: 9px; }
  .topbar-actions .avatar { display: none; }
  .save-state { font-size: 10px; }
  .content { padding: 26px 22px calc(104px + env(safe-area-inset-bottom)); }
  .page-heading { gap: 15px; margin-bottom: 23px; align-items: flex-start; }
  h1 { font-size: 30px; letter-spacing: -1px; }
  .page-heading-copy > p, .page-date { font-size: 12px; margin-top: 7px; }
  .page-actions { justify-content: flex-end; }
  .page-actions .button { padding-inline: 12px; font-size: 11px; }
  .dashboard-grid, .capacity-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .next-card { min-height: 231px; padding: 26px; margin-bottom: 21px; }
  .next-title { font-size: 26px; max-width: 340px; }
  .next-art { width: 145px; flex-basis: 145px; }
  .summary-strip { padding-bottom: 22px; }
  .summary-item { padding-inline: 18px; }
  .summary-value { font-size: 25px; }
  .summary-label { font-size: 12px; }
  .section { margin-top: 22px; padding: 22px; }
  .aside-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .aside-column > .section { margin-top: 0; }
  .aside-column > .section:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .section-head { margin-bottom: 18px; }
  .week-strip { gap: 7px; }
  .day-button { min-height: 77px; }
  .assignment-title { font-size: 15px; }
  .assignment-meta, .session-content p { font-size: 12px; }
  .session-content h3 { font-size: 14px; }
  .mobile-nav { position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); background: #fffffffa; border-top: 1px solid #dfe6f1; box-shadow: 0 -4px 20px #18396605; backdrop-filter: blur(12px); }
  .mobile-nav-link { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; min-height: 53px; padding: 7px 3px; border: 0; border-radius: 8px; background: transparent; color: #8190a5; font-size: 9px; font-weight: 550; }
  .mobile-nav-link .icon { width: 21px; height: 21px; }
  .mobile-nav-link.active { color: var(--blue); background: #edf2ff; }
  .filter-bar { flex-wrap: wrap; gap: 12px; }
  .filter-buttons { gap: 2px; }
  .filter-button { padding-inline: 12px; font-size: 11px; }
  .search-field { flex-basis: 100%; max-width: none; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .task-detail { grid-template-columns: 8px minmax(0, 1fr); }
  .task-detail > .assignment-trailing { grid-column: 2; justify-content: space-between; width: 100%; }
  .task-actions { justify-content: flex-end; }
  .capacity-row { gap: 15px; }
  .demo-banner { gap: 12px; padding: 12px 14px; font-size: 11px; }
  .demo-banner .button { font-size: 10px; min-height: 44px; padding-inline: 10px; }
  .footer-note { margin-top: 24px; font-size: 9px; }
  #toast { left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); }
  .skip-link { left: 16px; }
}

@media (max-width: 520px) {
  .topbar { padding-inline: 18px; }
  .breadcrumb { max-width: 55%; gap: 6px; }
  .breadcrumb > span:first-child { display: none; }
  .content { padding: 24px 18px calc(100px + env(safe-area-inset-bottom)); }
  .page-heading { gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
  .page-heading-copy { flex: 1 1 190px; }
  .page-heading .page-actions { gap: 5px; }
  .page-heading .page-actions .button { padding-inline: 10px; }
  h1 { font-size: 29px; }
  .next-card { padding: 24px; min-height: 244px; align-items: flex-start; }
  .next-content { max-width: 100%; }
  .next-title { font-size: 25px; max-width: 255px; }
  .next-copy { max-width: 250px; font-size: 11px; }
  .next-label { font-size: 10px; margin-bottom: 13px; }
  .next-meta { font-size: 10px; gap: 6px 12px; padding-right: 35px; }
  .next-card .button { margin-top: 20px; font-size: 11px; }
  .next-art { position: absolute; right: -13px; bottom: 14px; width: 101px; opacity: .34; z-index: -1; }
  .next-art > svg { max-height: 140px; }
  .summary-item { padding-inline: 12px; }
  .summary-value { font-size: 24px; }
  .summary-label { font-size: 12px; line-height: 1.5; }
  .section { padding: 19px 17px; border-radius: 10px; }
  .section-title { font-size: 16px; }
  .section-head { gap: 5px 10px; }
  .section-head > .button { font-size: 10px; padding-inline: 8px; }
  .week-controls { gap: 2px; }
  .week-controls .icon-button { width: 44px; padding-inline: 4px; }
  .week-range { font-size: 10px; }
  .week-strip { gap: 5px; margin-bottom: 19px; }
  .day-button { min-height: 70px; padding: 9px 2px; border-radius: 7px; }
  .day-name { font-size: 9px; }
  .day-number { font-size: 16px; }
  .session { gap: 12px; padding-block: 14px; }
  .session-duration { width: 46px; font-size: 16px; }
  .session-content h3 { font-size: 14px; }
  .session-content p { font-size: 12px; }
  .session-edit { min-width: 44px; padding-inline: 8px; }
  .assignment-row { gap: 10px; padding-block: 15px; }
  .assignment-title { font-size: 15px; }
  .assignment-meta { font-size: 12px; }
  .assignment-trailing { align-items: flex-end; gap: 0; }
  .assignment-trailing .icon-button { width: 44px; padding-inline: 6px; }
  .status-badge { font-size: 8px; padding: 4px 6px; }
  .aside-column { display: flex; flex-direction: column; gap: 22px; }
  .aside-column > .section { width: 100%; }
  .course-row { font-size: 13px; padding-block: 12px; }
  .course-count, .workload-row { font-size: 12px; }
  .workload-list { gap: 17px; }
  .filter-button { padding-inline: 10px; font-size: 11px; }
  .capacity-row { grid-template-columns: minmax(68px, 1fr) 78px 73px; gap: 10px; font-size: 10px; }
  .capacity-row input { padding-inline: 9px; font-size: 13px; }
  .capacity-day { font-size: 11px; }
  .capacity-day small { font-size: 9px; }
  .settings-panel .row { align-items: flex-start; flex-wrap: wrap; }
  .settings-panel .row .button { margin-left: auto; }
  dialog { width: 100%; max-height: calc(100dvh - 18px); margin: auto auto 0; padding: 24px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 17px 17px 0 0; border-bottom: 0; }
  .dialog-heading h2 { font-size: 22px; }
  .dialog-subtitle { font-size: 11px; }
  input, select, textarea { font-size: 16px; }
  .form-grid { gap: 0 11px; }
  .form-actions { position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom)); background: white; padding-bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 2; }
  .form-actions .button { flex: 1; }
  .demo-banner { align-items: flex-start; flex-wrap: wrap; }
  .demo-banner > :first-child { flex: 1 1 180px; }
  .demo-banner .button { margin-left: auto; }
}

@media (max-width: 359px) {
  .content { padding-inline: 14px; }
  .topbar { padding-inline: 14px; }
  .topbar-actions { gap: 6px; }
  .save-state { font-size: 9px; gap: 4px; }
  .topbar .icon-button { width: 44px; padding: 9px; }
  h1 { font-size: 27px; }
  .page-heading-copy { flex-basis: 100%; }
  .page-actions { margin-left: auto; }
  .next-card { padding: 22px; }
  .next-title { font-size: 24px; }
  .section { padding-inline: 14px; }
  .section-head { align-items: flex-start; }
  .section-head .week-controls { width: 100%; justify-content: space-between; }
  .week-strip { gap: 4px; }
  .summary-item { padding-inline: 9px; }
  .summary-value { font-size: 22px; }
  .assignment-row { gap: 8px; }
  .assignment-trailing { flex-direction: column; }
  .filter-button { padding-inline: 7px; font-size: 10px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Follow the actual content hierarchy: one main action, then practical lists. */
.brand { gap: 10px; padding-inline: 8px; }
.sidebar-note { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 19px; font-size: 12px; }
.sidebar-note > .icon { width: 17px; height: 17px; flex-shrink: 0; margin-top: 3px; }
.sidebar-note p, .sidebar-note small { display: block; }
.sidebar-note p { color: #d4dfef; }
.sidebar-note small { margin-top: 4px; color: #9eb0cb; font-size: 11px; }
.save-state::before { content: none; }
.save-state > .icon { width: 14px; height: 14px; color: var(--teal); }
.save-state.demo-state > .icon { color: #aa7b24; }
.save-state.save-error > .icon { color: var(--red); }
.page-heading-copy > .page-date { margin: 0 0 8px; font-size: 12px; }
.page-heading-copy > .section-copy { font-size: 14px; margin-top: 8px; }
.button { font-size: 13px; }
.button.small { font-size: 12px; }
.next-copy { font-size: 14px; }
.next-label { font-size: 12px; }
.next-meta { gap: 10px; margin-top: 20px; padding-right: 0; }
.next-meta .button { margin-top: 0; }
.next-card .button.quiet { background: transparent; color: #fff; border-color: #ffffff65; }
.next-card .button.quiet:hover { background: #ffffff14; border-color: #ffffffa6; }
.section > .section-copy + .session-list { margin-top: 19px; }
.section > .section-title + .workload-list, .aside-column > h3 + .workload-list { margin-top: 20px; }
.section > .workload-list + .help { margin-top: 18px; }
.section > .workload-list + .section-copy { margin-top: 18px; }
.section > .workload-list ~ .button { margin-top: 18px; }
.section > .dashboard-grid > .aside-column { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
.section > .dashboard-grid > .aside-column > .workload-list { margin-top: 0; }
.settings-panel > .section-copy { font-size: 14px; margin-top: 9px; }
.settings-panel > .empty-icon { margin-left: 0; }
.settings-panel > .help { font-size: 12px; }
.status-badge { font-size: 11px; }
.status-badge[data-status="In progress"] { background: #edf2ff; color: #3260c4; }
.status-badge[data-status="Submitted"] { background: #e9f5f1; color: #137f74; }
.status-badge[data-status="Waiting"] { background: #fff5e6; color: #9b6a22; }
.status-badge[data-status="Closed"] { background: #edf0f5; color: #66778e; }
.task-detail > .course-dot { margin-top: 10px; }
.task-detail .assignment-trailing { align-items: flex-end; flex-direction: column; }
.task-detail .assignment-title { font-size: 16px; }
.task-notes { font-size: 13px; }
.assignment-copy details { margin-top: 12px; font-size: 12px; color: var(--muted); }
.assignment-copy summary { cursor: pointer; min-height: 44px; padding-block: 12px; }
.assignment-copy summary:focus-visible { outline: 3px solid #6da0ff; outline-offset: 3px; }
.danger, .help.danger, .assignment-meta.danger { color: #af3e42; }
.onboarding { margin-top: 22px; }
.onboarding-action { justify-content: flex-start; font-size: 14px; white-space: normal; }
.onboarding-action small { font-size: 12px; }
.capacity-row { align-items: end; }
.capacity-row label { margin-bottom: 0; font-size: 12px; }
.capacity-row:first-child { font-size: inherit; }
.capacity-day { align-self: center; }
.capacity-grid + .help { margin-top: 16px; margin-bottom: 18px; }
.capacity-layout > .section > .section-title + .workload-list { margin-top: 20px; }
.week-controls { flex-wrap: wrap; }
.week-controls > .button { flex-shrink: 0; }
.week-strip .button { white-space: normal; }

@media (max-width: 760px) {
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 0; }
  .summary-item { padding-inline: 20px; }
  .summary-item:nth-child(odd) { border-left: 0; padding-left: 0; }
  .summary-item:nth-child(n+3) { border-top: 1px solid var(--line); padding-top: 16px; }
  .task-detail .assignment-trailing { flex-direction: row; align-items: center; }
  .mobile-nav-link { font-size: 11px; }
  .next-copy { font-size: 13px; }
  .next-label { font-size: 12px; }
  .page-actions .button, .next-card .button { font-size: 12px; }
  .section-head > .button { font-size: 12px; }
  .week-range { font-size: 12px; }
  .week-controls { gap: 3px; }
  .status-badge { font-size: 10px; }
  .assignment-trailing { flex-direction: column; align-items: flex-end; }
  .task-detail { gap: 8px 12px; }
  .filter-button { font-size: 12px; }
}

@media (max-width: 520px) {
  .brand-name { font-size: 18px; }
  .summary-label { font-size: 12px; }
  .summary-value { font-size: 26px; }
  .next-meta { flex-wrap: wrap; gap: 9px; }
  .next-meta .button { padding-inline: 11px; }
  .section-head { align-items: center; }
  .section-head > .week-controls { width: 100%; justify-content: space-between; margin-top: 8px; }
  .week-controls .button.quiet { padding-inline: 8px; }
  .day-name { font-size: 10px; }
  .task-detail .assignment-title { font-size: 15px; }
  .session { align-items: flex-start; }
  .session-duration { min-height: 49px; }
  .session-edit { margin-top: 0; }
  .save-state { max-width: 160px; }
  .save-state > span { overflow-wrap: anywhere; }
  .capacity-row { gap: 8px; }
  .capacity-row label { font-size: 11px; }
  .onboarding-action { font-size: 13px; }
  .onboarding-action small { font-size: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  button, a, input, select, textarea { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
  #toast { transition: opacity .18s ease, transform .18s ease, visibility .18s ease; }
  dialog[open] { animation: dialog-enter .16s ease-out; }
  @keyframes dialog-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Keep the product identity visible, even when the full sidebar is hidden. */
@media (max-width: 520px) {
  .breadcrumb { max-width: none; min-width: 0; flex: 1; gap: 0; }
  .breadcrumb > span:first-child { display: block; color: var(--ink); font-size: 13px; font-weight: 700; }
  .breadcrumb > span:not(:first-child), .breadcrumb > strong { display: none; }
  .topbar-actions .save-state { max-width: 105px; }
  .save-state > .icon { display: none; }
  .next-meta { padding-right: 0; }
  .empty-state h3 { font-size: 15px; }
  .empty-state p { font-size: 13px; }
  .capacity-row input { font-size: 16px; padding-inline: 6px; }
}
