* {
  box-sizing: border-box;
}

:root {
  --ink: #171717;
  --muted: #5b5b62;
  --soft: #f6f7f9;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --line: rgba(24, 24, 27, 0.1);
  --line-strong: rgba(24, 24, 27, 0.18);
  --accent: #0d9488;
  --accent-ink: #042f2e;
  --blue: #2563eb;
  --coral: #f9734c;
  --danger: #b42318;
  --warning: #b45309;
  --success: #047857;
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.09);
  --shadow-soft: 0 8px 30px rgba(15, 23, 42, 0.06);
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.08), transparent 32%),
    linear-gradient(315deg, rgba(249, 115, 76, 0.08), transparent 30%),
    #fafafa;
  letter-spacing: 0;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.85rem, 3vw, 3rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.02rem;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  display: grid;
  gap: 8px;
}

time,
small {
  color: var(--muted);
}

.app-body {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px clamp(14px, 3vw, 32px) 0;
}

.topbar-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px) saturate(1.35);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  padding: 6px 10px 6px 6px;
  border-radius: 18px;
  color: var(--ink);
}

.brand:hover {
  background: rgba(13, 148, 136, 0.08);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2dd4bf, #a3e635);
  color: var(--accent-ink);
  font-weight: 900;
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy small {
  font-size: 0.72rem;
}

.nav {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 999px;
  color: #3f3f46;
  font-size: 0.9rem;
  font-weight: 760;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.14);
}

.logout-form {
  margin: 0;
}

.main {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 54px) 0 54px;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
  padding: 10px 4px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-subtitle {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.panel,
.login-panel,
.auth-panel,
.card,
.stat-card,
.task-card,
.course-card,
.search-result,
.meeting-card,
.kanban-column {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.panel,
.card {
  padding: clamp(16px, 2vw, 24px);
}

.grid,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.dashboard-grid {
  align-items: start;
}

.span-2 {
  grid-column: span 2;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.item-list,
.calendar-list,
.timetable-list {
  display: grid;
  gap: 12px;
}

.item-list li,
.task-card,
.course-card,
.search-result,
.meeting-card {
  padding: 15px;
}

.course-title {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
}

.course-card[data-task-href] {
  cursor: pointer;
}

.course-time-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.course-detail-shell {
  display: grid;
  gap: 14px;
}

.course-detail-summary {
  padding: 16px 18px;
  border-radius: 26px;
}

.course-detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.course-detail-facts article {
  display: grid;
  place-items: center;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.course-detail-facts span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
}

.course-detail-facts strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 870;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.72fr);
  gap: 14px;
  align-items: start;
}

.course-detail-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 28px;
}

.course-detail-schedule {
  grid-row: span 2;
}

.course-detail-panel > header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
}

.course-detail-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.course-detail-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 870;
  letter-spacing: -0.01em;
}

.course-detail-panel > header .button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.course-detail-archive {
  display: grid;
  gap: 10px;
}

.course-detail-archive summary {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 830;
  list-style: none;
}

.course-detail-archive summary::-webkit-details-marker {
  display: none;
}

.course-task-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(680px, calc(100vh - 56px));
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(1.25);
}

.course-task-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.course-task-dialog form[method="dialog"] {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 4px;
}

.course-task-dialog h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 870;
}

body.tahoe-shell .icon-button.danger {
  border-color: rgba(255, 69, 58, 0.32);
  background: rgba(255, 69, 58, 0.13);
  color: #ffb4ad;
  box-shadow: none;
}

body.tahoe-shell .icon-button.danger:hover {
  background: rgba(255, 69, 58, 0.2);
}

body.tahoe-shell .page-actions form {
  margin: 0;
}

.course-detail-list,
.course-detail-sublist {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-detail-meeting,
.course-detail-task,
.course-detail-note,
.course-detail-override {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.course-detail-meeting {
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: start;
}

.course-detail-meeting .meeting-time {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 66px;
  padding: 9px;
  border-radius: 17px;
  background: rgba(10, 132, 255, 0.14);
  color: #d8ecff;
  font-size: 1rem;
  font-weight: 880;
  line-height: 1;
}

.course-detail-meeting .meeting-time small {
  margin-top: 5px;
  color: rgba(216, 236, 255, 0.66);
  font-size: 0.78rem;
}

.course-detail-meeting-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.course-detail-meeting-main > strong,
.course-detail-task strong,
.course-detail-note strong,
.course-detail-override > strong {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1.2;
}

.course-detail-panel .meta-row {
  gap: 7px;
}

.course-detail-panel .meta-row form {
  margin: 0;
}

.course-detail-panel .meta-row .button,
.course-detail-panel .meta-row button {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.course-detail-inline-form,
.course-detail-add-rule {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  align-items: end;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
}

.course-detail-inline-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.course-detail-inline-form label,
.course-detail-add-rule label {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 830;
}

.course-detail-inline-form input,
.course-detail-inline-form select,
.course-detail-add-rule input,
.course-detail-add-rule select {
  min-height: 40px;
  border-radius: 14px;
}

.course-detail-inline-form button,
.course-detail-add-rule button {
  min-height: 40px;
  border-radius: 999px;
}

.course-detail-task > a,
.course-detail-note > a {
  min-width: 0;
  color: inherit;
}

.course-detail-task time,
.course-detail-note time {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 780;
}

.course-material-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: end;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
}

.course-material-upload label {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 830;
}

.course-material-upload input {
  min-height: 40px;
  border-radius: 14px;
}

.course-material-upload button {
  min-height: 40px;
  border-radius: 999px;
}

.semester-setup-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: start;
}

.semester-setup-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 30px;
}

.semester-setup-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.semester-setup-head span,
.semester-setup-note,
.semester-setup-help span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.semester-setup-head h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1;
}

.semester-current-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.12);
  color: #0a66c2 !important;
  font-size: 0.78rem !important;
  font-weight: 840 !important;
  white-space: nowrap;
}

.semester-setup-note {
  max-width: 760px;
  margin: 0;
  line-height: 1.55;
}

.semester-setup-form {
  display: grid;
  gap: 13px;
  margin: 0;
}

.semester-setup-form label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 840;
}

.semester-setup-form input {
  min-height: 46px;
  border-radius: 18px;
}

.semester-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.semester-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.semester-quick-actions button {
  min-height: 34px;
  padding: 7px 11px;
  border-color: rgba(60, 60, 67, 0.12) !important;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--muted) !important;
  font-size: 0.78rem;
  font-weight: 830;
  box-shadow: none !important;
}

.semester-quick-actions button:hover {
  background: rgba(10, 132, 255, 0.13) !important;
  color: #0a66c2 !important;
}

.semester-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 2px;
}

.semester-setup-help {
  display: grid;
  gap: 9px;
  padding: 18px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(1.22);
}

.semester-setup-help strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 860;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pill,
.badge,
.flag-overdue,
.flag-due_today,
.flag-due_soon {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.pill,
.badge {
  color: #3f3f46;
  background: rgba(244, 244, 245, 0.92);
  box-shadow: inset 0 0 0 1px var(--line);
}

.flag-overdue {
  color: #7f1d1d;
  background: #fee2e2;
}

.flag-due_today {
  color: #78350f;
  background: #ffedd5;
}

.flag-due_soon {
  color: #064e3b;
  background: #d1fae5;
}

.course-color {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(24, 24, 27, 0.05);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
}

.kanban-column {
  min-height: 280px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.kanban-column h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-column.is-drop-target {
  border-color: rgba(13, 148, 136, 0.48);
  background: rgba(240, 253, 250, 0.86);
  transform: translateY(-2px);
}

.task-card.is-dragging {
  opacity: 0.55;
}

.calendar-row,
.meeting-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.month-grid,
.week-grid {
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.month-weekdays,
.month-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.month-weekdays {
  background: rgba(244, 244, 245, 0.8);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.month-weekdays div {
  padding: 12px;
  border-right: 1px solid var(--line);
}

.calendar-cell {
  min-height: 132px;
  padding: 12px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.calendar-cell.is-muted {
  background: rgba(244, 244, 245, 0.42);
  color: var(--muted);
}

.calendar-cell.is-today {
  background: #f0fdfa;
}

.calendar-day {
  margin-bottom: 8px;
  font-weight: 900;
}

.calendar-task {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.1);
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.calendar-task span {
  color: var(--accent);
  font-size: 0.74rem;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
}

.week-day {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 360px;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.week-day header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.week-day header span {
  color: var(--muted);
  font-weight: 900;
}

.week-day header strong {
  font-size: 1.4rem;
}

.schedule-event {
  display: grid;
  gap: 7px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(13, 148, 136, 0.1);
  color: var(--accent-ink);
}

.schedule-event time {
  color: var(--accent);
  font-weight: 900;
}

.calendar-date,
.meeting-time {
  display: grid;
  gap: 2px;
  color: var(--accent);
  font-weight: 900;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 14px 0 0;
}

form {
  margin: 0;
}

label {
  display: grid;
  gap: 8px;
  margin-block: 12px;
  color: #3f3f46;
  font-size: 0.92rem;
  font-weight: 800;
}

input,
textarea,
select,
button {
  max-width: 100%;
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

textarea {
  min-height: 240px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: 4px solid rgba(13, 148, 136, 0.16);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid #0f766e;
  border-radius: 999px;
  background: #0f766e;
  color: white;
  cursor: pointer;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(13, 148, 136, 0.18);
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  background: #115e59;
}

.ghost-button,
.button.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: none;
}

.ghost-button:hover,
.button.secondary:hover {
  background: #ffffff;
}

.error,
.field-error {
  color: var(--danger);
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 5px;
  padding: 22px;
  border: 1px dashed rgba(24, 24, 27, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.auth-page,
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.14), transparent 36%),
    linear-gradient(315deg, rgba(249, 115, 76, 0.12), transparent 32%),
    #fafafa;
}

.auth-panel,
.login-panel {
  width: min(460px, 100%);
  padding: 30px;
}

.auth-brand {
  margin-bottom: 18px;
}

.auth-panel h1,
.login-panel h1 {
  margin-bottom: 10px;
}

.auth-subtitle {
  color: var(--muted);
}

.markdown-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.markdown-preview {
  min-height: 240px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 32px));
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(23, 23, 23, 0.92);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(14px);
  font-weight: 800;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-error {
  background: rgba(127, 29, 29, 0.94);
}

/* iOS/macOS-style polish: obvious actions, soft hierarchy, pill controls. */
:root {
  --ink: #111114;
  --muted: #5b5b62;
  --soft: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --line: rgba(60, 60, 67, 0.14);
  --line-strong: rgba(60, 60, 67, 0.22);
  --accent: #007aff;
  --accent-ink: #002f6c;
  --blue: #007aff;
  --danger: #ff3b30;
  --success: #34c759;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.12);
  --shadow-soft: 0 12px 35px rgba(0, 0, 0, 0.08);
}

body {
  background:
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 46%, #ffffff 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1 {
  font-weight: 860;
}

h2 {
  color: #1d1d1f;
  font-weight: 820;
}

.topbar {
  padding-top: 12px;
}

.topbar-inner {
  max-width: 1180px;
  padding: 8px;
  border-color: rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(28px) saturate(1.6);
}

.brand {
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #111114;
  color: white;
}

.brand-copy small {
  color: var(--muted);
}

.nav {
  gap: 6px;
}

.nav-link {
  min-height: 36px;
  padding: 9px 13px;
  color: #5b5b62;
  font-size: 0.88rem;
  font-weight: 760;
}

.nav-link:hover {
  background: rgba(0, 122, 255, 0.08);
}

.nav-link.is-active {
  color: white;
  background: #111114;
  box-shadow: none;
}

.main {
  width: min(1180px, calc(100% - 28px));
}

.page-header {
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.7rem;
}

.page-subtitle {
  color: var(--muted);
}

.panel,
.login-panel,
.auth-panel,
.card,
.stat-card,
.task-card,
.course-card,
.search-result,
.meeting-card,
.kanban-column,
.month-grid,
.week-grid {
  border-color: rgba(60, 60, 67, 0.12);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.panel,
.card {
  padding: clamp(18px, 2.2vw, 26px);
}

.task-card,
.course-card,
.search-result,
.meeting-card,
.stat-card,
.schedule-event,
.calendar-task {
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.task-card:hover,
.course-card:hover,
.search-result:hover,
.meeting-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.stat-card {
  background: rgba(255, 255, 255, 0.66);
}

a.stat-card {
  color: var(--ink);
  cursor: pointer;
}

a.stat-card:hover {
  background: rgba(255, 255, 255, 0.84);
  transform: translateY(-1px);
}

.stat-card strong {
  color: #1d1d1f;
}

.stat-card .stat-label {
  display: block;
}

.stat-card.is-danger {
  border-color: rgba(255, 59, 48, 0.28);
  background: rgba(255, 59, 48, 0.1);
}

.stat-card.is-danger strong {
  color: #b42318;
}

.stat-card.is-success {
  border-color: rgba(52, 199, 89, 0.24);
  background: rgba(52, 199, 89, 0.1);
}

.stat-card.is-success strong {
  color: #047857;
}

.stat-card.is-warning {
  border-color: rgba(255, 149, 0, 0.26);
  background: rgba(255, 149, 0, 0.1);
}

.stat-card.is-warning strong {
  color: #9a4f00;
}

.stat-card.is-muted {
  background: rgba(242, 242, 247, 0.72);
  color: var(--muted);
}

.stat-card.is-muted strong,
.stat-card.is-muted .stat-label {
  color: var(--muted);
}

.quick-add-bar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.35fr) minmax(120px, 0.65fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.quick-add-bar label {
  min-width: 0;
  margin: 0;
  gap: 5px;
  font-size: 0.76rem;
}

.quick-add-bar input,
.quick-add-bar select,
.quick-add-bar button,
.quick-add-bar .button {
  min-height: 38px;
}

.quick-add-note {
  align-self: center;
  color: var(--muted);
  font-weight: 760;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.dashboard-grid.is-balanced {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
}

.dashboard-grid .panel,
.quick-add-bar,
.stat-card {
  backdrop-filter: none;
}

.dashboard-grid .panel {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.panel-today {
  padding: clamp(20px, 2.4vw, 30px);
}

.panel-today .panel-heading h2 {
  font-size: 1.12rem;
}

.dashboard-side-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.panel-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin: 0;
}

.panel-danger {
  border-left: 4px solid var(--danger);
}

.badge-danger {
  color: #8b1a13;
  background: rgba(255, 59, 48, 0.14);
}

.dashboard-list {
  display: grid;
  gap: 0;
}

.dashboard-task-row,
.dashboard-meeting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-task-row:last-child,
.dashboard-meeting-row:last-child {
  border-bottom: 0;
}

.dashboard-row-title {
  display: grid;
  min-width: 0;
  gap: 3px;
  color: var(--ink);
}

.dashboard-row-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-row-title > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-row-title > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.dashboard-row-title:hover strong {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dashboard-course-context {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.dashboard-course-context .course-color {
  flex: 0 0 auto;
  width: 0.62rem;
  height: 0.62rem;
  box-shadow: none;
}

.dashboard-row-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.dashboard-row-meta time {
  font-weight: 760;
}

.dashboard-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.dashboard-row-actions form {
  margin: 0;
}

.inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 999px;
  background: rgba(242, 242, 247, 0.9);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 840;
  white-space: nowrap;
  box-shadow: none;
}

.inline-action:hover {
  background: rgba(229, 229, 234, 0.98);
  transform: translateY(-1px);
}

.inline-action.primary {
  border-color: rgba(0, 122, 255, 0.18);
  background: rgba(0, 122, 255, 0.12);
  color: var(--blue);
}

.dashboard-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-note-row:last-child {
  border-bottom: 0;
}

.dashboard-side-stack .dashboard-task-row {
  grid-template-columns: 1fr;
}

.dashboard-side-stack .dashboard-row-meta,
.dashboard-side-stack .dashboard-row-actions {
  justify-content: flex-start;
}

.pill,
.badge,
.flag-overdue,
.flag-due_today,
.flag-due_soon {
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
}

.pill,
.badge {
  background: rgba(242, 242, 247, 0.92);
  color: #3a3a3c;
}

.flag-overdue {
  color: #8b1a13;
  background: rgba(255, 59, 48, 0.13);
}

.flag-due_today {
  color: #7a3a00;
  background: rgba(255, 149, 0, 0.16);
}

.flag-due_soon {
  color: #12642f;
  background: rgba(52, 199, 89, 0.16);
}

.course-color {
  width: 0.78rem;
  height: 0.78rem;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.76);
}

.toolbar {
  gap: 12px;
  align-items: end;
}

.toolbar label {
  min-width: min(210px, 100%);
  flex: 1 1 170px;
}

label {
  color: #3a3a3c;
  font-size: 0.88rem;
  font-weight: 760;
}

input,
textarea,
select {
  min-height: 46px;
  padding: 12px 15px;
  border-color: rgba(60, 60, 67, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

textarea {
  min-height: 220px;
  border-radius: 24px;
  line-height: 1.5;
}

input[type="file"] {
  padding: 10px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  outline: 4px solid rgba(0, 122, 255, 0.16);
}

button,
.button {
  min-height: 44px;
  padding: 10px 17px;
  border-color: var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 22px rgba(0, 122, 255, 0.18);
}

button:hover,
.button:hover {
  background: #006edb;
}

.ghost-button,
.button.secondary {
  border-color: rgba(60, 60, 67, 0.14);
  background: rgba(242, 242, 247, 0.86);
  color: #1d1d1f;
}

.ghost-button:hover,
.button.secondary:hover {
  background: rgba(229, 229, 234, 0.95);
}

button.danger,
.button.danger {
  border-color: rgba(255, 59, 48, 0.18);
  background: rgba(255, 59, 48, 0.12);
  color: #b42318;
  box-shadow: none;
}

button.danger:hover,
.button.danger:hover {
  background: rgba(255, 59, 48, 0.18);
}

.empty-state {
  border-color: rgba(60, 60, 67, 0.16);
  border-radius: 26px;
  background: rgba(242, 242, 247, 0.72);
}

.month-grid,
.week-grid {
  background: rgba(255, 255, 255, 0.62);
}

.month-weekdays {
  background: rgba(242, 242, 247, 0.86);
}

.calendar-cell {
  background: rgba(255, 255, 255, 0.52);
}

.calendar-cell.is-today {
  background: rgba(0, 122, 255, 0.09);
}

.calendar-task,
.schedule-event {
  border-radius: 18px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--accent-ink);
}

.calendar-task {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.calendar-task .course-color {
  grid-row: span 2;
}

.calendar-task span:not(.course-color),
.schedule-event time {
  color: var(--accent);
}

.toast {
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.9);
}

.toast-error {
  background: rgba(180, 35, 24, 0.94);
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.24);
  opacity: 0;
  transition: opacity 180ms ease;
  backdrop-filter: blur(8px);
}

.confirm-backdrop.is-visible {
  opacity: 1;
}

.confirm-sheet {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  transform: scale(0.97) translateY(8px);
  transition: transform 180ms ease;
  backdrop-filter: blur(28px) saturate(1.5);
}

.confirm-backdrop.is-visible .confirm-sheet {
  transform: scale(1) translateY(0);
}

.confirm-sheet h2 {
  margin-bottom: 8px;
}

.confirm-sheet p {
  margin-bottom: 18px;
  color: var(--muted);
}

/* Flow cleanup: keep global nav small, move utility actions to icons. */
.topbar-inner {
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: max-content;
  max-width: calc(100vw - 28px);
  justify-content: center;
}

.brand {
  gap: 7px;
  min-height: 38px;
  min-width: 0;
  justify-content: center;
  padding: 0 8px;
  background: transparent;
  color: #111114;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: none;
}

.brand:hover {
  background: transparent;
  color: var(--accent);
}

.brand:hover .brand-mark {
  background: var(--accent);
  color: white;
}

.brand-copy,
.logout-form {
  display: none;
}

.topbar .brand-mark {
  display: grid;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #111114;
  color: white;
  font-size: 0.78rem;
  line-height: 1;
}

.auth-brand .brand-mark {
  display: grid;
}

.topbar-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 999px;
  background: rgba(242, 242, 247, 0.86);
  color: #1d1d1f;
  box-shadow: none;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button:hover {
  background: rgba(229, 229, 234, 0.95);
}

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}

.topbar-search-field {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  grid-template-columns: minmax(240px, 320px);
  gap: 8px;
  align-items: center;
  width: max-content;
  padding: 8px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(24px) saturate(1.4);
}

.topbar-search.is-open .topbar-search-field,
.topbar-search:focus-within .topbar-search-field {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.topbar-search-field input {
  min-height: 38px;
  padding: 8px 13px;
}

.topbar-search-results {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}

.topbar-search-result {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 9px 11px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
}

.topbar-search-result:hover {
  background: rgba(0, 122, 255, 0.1);
}

.topbar-search-result span,
.topbar-search-result small,
.topbar-search-empty {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.topbar-search-result strong {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-search-empty {
  padding: 10px 11px;
}

.search-page {
  width: min(920px, calc(100% - 32px));
}

.search-page > .page-header {
  margin-bottom: 14px;
}

.search-panel {
  margin-bottom: 14px;
  padding: 12px;
}

.search-page-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.search-page-form label {
  display: grid;
  gap: 7px;
}

.search-page-form label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.02em;
}

.search-page-form input {
  min-height: 46px;
  border-radius: 16px;
}

.search-page-form button {
  min-height: 46px;
  padding-inline: 18px;
  border-radius: 16px;
}

.search-panel p {
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
}

.search-results-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-results-list li {
  min-width: 0;
}

.search-result {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 15px 16px;
  color: inherit;
  text-decoration: none;
}

.search-result-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.search-result-head span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.14);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 840;
}

.search-result-head time {
  font-size: 0.76rem;
  font-weight: 760;
}

.search-result strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 880;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: rgba(245, 245, 247, 0.62);
  font-size: 0.88rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.page-header {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(1.3);
}

.page-header h1 {
  margin-bottom: 6px;
}

.dashboard-page .page-header {
  padding: 4px 2px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 999px;
  background: rgba(242, 242, 247, 0.86);
}

.segmented-control a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #3a3a3c;
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.segmented-control a.is-active {
  background: white;
  color: #111114;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 16px;
  align-items: start;
}

.account-panel {
  display: grid;
  gap: 14px;
}

@media (max-width: 1100px) {
  .dashboard-grid,
  .dashboard-grid.is-balanced {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .topbar-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    width: min(100%, calc(100vw - 20px));
    border-radius: 28px;
  }

  .nav {
    grid-column: auto;
    order: 0;
    justify-content: flex-start;
  }

  .kanban,
  .markdown-layout,
  .week-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .quick-add-bar {
    grid-template-columns: 1fr 1fr;
  }

  .stat-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .span-2 {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 8px 10px 0;
  }

  .topbar-inner {
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
  }

  .brand {
    min-height: 34px;
    padding: 0 5px;
    font-size: 0.98rem;
  }

  .nav {
    gap: 3px;
  }

  .nav-link {
    min-height: 34px;
    padding: 8px 9px;
    font-size: 0.8rem;
  }

  .topbar-tools {
    gap: 4px;
  }

  .icon-button {
    width: 34px;
    min-height: 34px;
  }

  .icon-button svg {
    width: 16px;
    height: 16px;
  }

  .main {
    width: min(100% - 20px, 1240px);
    padding-top: 22px;
  }

  .page-header {
    grid-template-columns: 1fr;
    border-radius: 26px;
  }

  .dashboard-page .page-header {
    padding-top: 0;
    border-radius: 0;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .topbar-search-field {
    right: -46px;
    grid-template-columns: minmax(170px, 1fr);
    width: min(330px, calc(100vw - 24px));
    border-radius: 24px;
  }

  .search-page {
    width: min(100% - 20px, 920px);
  }

  .search-page-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-page-form button {
    width: 100%;
  }

  .segmented-control {
    width: 100%;
    justify-content: stretch;
  }

  .segmented-control a {
    flex: 1;
  }

  .calendar-row,
  .meeting-card {
    grid-template-columns: 1fr;
  }

  .month-weekdays {
    display: none;
  }

  .month-cells {
    grid-template-columns: 1fr;
  }

  .calendar-cell {
    min-height: auto;
    border-right: 0;
  }

  .quick-add-bar,
  .dashboard-task-row,
  .dashboard-meeting-row {
    grid-template-columns: 1fr;
  }

  .quick-add-bar button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .dashboard-row-meta,
  .dashboard-row-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .stat-row {
    grid-template-columns: 1fr;
  }
}

.theme-icon {
  display: grid;
  place-items: center;
}

.theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: grid;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f7;
  --muted: #c7c7cc;
  --soft: #1c1c1e;
  --panel: rgba(28, 28, 30, 0.74);
  --panel-solid: #1c1c1e;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #0a84ff;
  --accent-ink: #d8ecff;
  --blue: #0a84ff;
  --danger: #ff453a;
  --success: #30d158;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 14px 42px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 50% 0%, rgba(10, 132, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #050506 0%, #101012 52%, #161618 100%);
  color: var(--ink);
}

[data-theme="dark"] h2,
[data-theme="dark"] .empty-state strong,
[data-theme="dark"] .stat-card strong {
  color: #f5f5f7;
}

[data-theme="dark"] a {
  color: #64aaff;
}

[data-theme="dark"] .topbar-inner {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(28, 28, 30, 0.74);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .brand {
  color: #f5f5f7;
}

[data-theme="dark"] .brand:hover {
  color: #64aaff;
}

[data-theme="dark"] .topbar .brand-mark {
  background: #f5f5f7;
  color: #111114;
}

[data-theme="dark"] .nav-link {
  color: #c7c7cc;
}

[data-theme="dark"] .nav-link:hover {
  background: rgba(10, 132, 255, 0.14);
}

[data-theme="dark"] .nav-link.is-active {
  background: #f5f5f7;
  color: #111114;
}

[data-theme="dark"] .icon-button,
[data-theme="dark"] .ghost-button,
[data-theme="dark"] .button.secondary,
[data-theme="dark"] .inline-action,
[data-theme="dark"] .segmented-control,
[data-theme="dark"] .topbar-search-field {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(44, 44, 46, 0.88);
  color: #f5f5f7;
}

[data-theme="dark"] .icon-button:hover,
[data-theme="dark"] .ghost-button:hover,
[data-theme="dark"] .button.secondary:hover,
[data-theme="dark"] .inline-action:hover {
  background: rgba(58, 58, 60, 0.94);
}

[data-theme="dark"] .inline-action.primary {
  border-color: rgba(10, 132, 255, 0.24);
  background: rgba(10, 132, 255, 0.16);
  color: #64aaff;
}

[data-theme="dark"] .page-header,
[data-theme="dark"] .panel,
[data-theme="dark"] .login-panel,
[data-theme="dark"] .auth-panel,
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .task-card,
[data-theme="dark"] .course-card,
[data-theme="dark"] .search-result,
[data-theme="dark"] .meeting-card,
[data-theme="dark"] .kanban-column,
[data-theme="dark"] .month-grid,
[data-theme="dark"] .week-grid,
[data-theme="dark"] .confirm-sheet {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .month-weekdays {
  background: rgba(44, 44, 46, 0.72);
}

[data-theme="dark"] .stat-card.is-muted {
  background: rgba(58, 58, 60, 0.62);
  color: var(--muted);
}

[data-theme="dark"] a.stat-card:hover {
  background: rgba(58, 58, 60, 0.82);
}

[data-theme="dark"] .dashboard-page .page-header {
  border: 0;
  background: transparent;
  box-shadow: none;
}

[data-theme="dark"] .quick-add-bar,
[data-theme="dark"] .dashboard-grid .panel {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(28, 28, 30, 0.7);
}

[data-theme="dark"] .stat-card.is-danger {
  background: rgba(255, 69, 58, 0.14);
}

[data-theme="dark"] .stat-card.is-warning {
  background: rgba(255, 159, 10, 0.14);
}

[data-theme="dark"] .calendar-cell {
  background: rgba(28, 28, 30, 0.6);
}

[data-theme="dark"] .calendar-cell.is-muted {
  background: rgba(28, 28, 30, 0.34);
}

[data-theme="dark"] .calendar-cell.is-today {
  background: rgba(10, 132, 255, 0.16);
}

[data-theme="dark"] .pill,
[data-theme="dark"] .badge {
  background: rgba(58, 58, 60, 0.88);
  color: #e5e5ea;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(28, 28, 30, 0.9);
  color: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #7c7c84;
}

[data-theme="dark"] label,
[data-theme="dark"] .pill,
[data-theme="dark"] .badge {
  color: #d1d1d6;
}

[data-theme="dark"] .segmented-control a {
  color: #d1d1d6;
}

[data-theme="dark"] .segmented-control a.is-active {
  background: #f5f5f7;
  color: #111114;
}

[data-theme="dark"] .schedule-event,
[data-theme="dark"] .calendar-task {
  background: rgba(10, 132, 255, 0.16);
  color: #d8ecff;
}

[data-theme="dark"] .course-color {
  box-shadow: 0 0 0 4px rgba(28, 28, 30, 0.78);
}

[data-theme="dark"] .confirm-backdrop {
  background: rgba(0, 0, 0, 0.46);
}

/* Dashboard: dark-first Liquid Glass layout. */
.dashboard-page {
  padding-top: clamp(30px, 5vw, 58px);
}

.dashboard-page .page-header {
  max-width: 720px;
  margin-bottom: 22px;
  padding: 0;
}

.dashboard-page .page-header h1 {
  margin-bottom: 10px;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 0.92;
}

.dashboard-page .page-subtitle {
  color: color-mix(in srgb, var(--muted) 82%, var(--ink));
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  font-weight: 650;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-card {
  display: grid;
  gap: 4px;
  min-height: 116px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(30px) saturate(1.55);
}

.summary-card:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    var(--panel);
}

.summary-card span,
.summary-card small {
  color: var(--muted);
  font-weight: 760;
}

.summary-card strong {
  color: var(--ink);
  font-size: clamp(1.8rem, 3.2vw, 2.9rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.dashboard-grid,
.dashboard-grid.is-balanced {
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.68fr);
  gap: 14px;
}

.dashboard-grid .panel {
  overflow: hidden;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(34px) saturate(1.5);
}

.panel-today {
  min-height: 560px;
  padding: clamp(22px, 2.8vw, 34px);
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2 {
  color: var(--ink);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.badge {
  min-width: 30px;
  justify-content: center;
}

.panel-danger {
  border-left: 0;
}

.dashboard-list {
  gap: 0;
}

.dashboard-meeting-row {
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  min-height: 76px;
  padding: 14px 0;
}

.dashboard-task-row,
.dashboard-note-row {
  padding: 14px 0;
}

.dashboard-time {
  display: grid;
  place-items: center;
  align-self: center;
  min-height: 54px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--blue) 16%, transparent);
  color: var(--blue);
}

.dashboard-time strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1;
}

.dashboard-time span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.dashboard-row-title {
  align-content: center;
  gap: 5px;
}

.dashboard-row-title strong {
  color: color-mix(in srgb, var(--ink) 92%, var(--blue));
  font-size: 1rem;
  font-weight: 820;
}

.panel-today .dashboard-row-title strong {
  font-size: 1.06rem;
}

.dashboard-row-title > span {
  color: var(--muted);
  font-size: 0.86rem;
}

.dashboard-row-meta {
  justify-content: flex-start;
}

.dashboard-row-meta time {
  color: color-mix(in srgb, var(--ink) 84%, var(--muted));
  font-size: 0.96rem;
}

.dashboard-side-stack {
  gap: 14px;
}

.dashboard-side-stack .panel {
  padding: 22px;
}

.dashboard-side-stack .dashboard-task-row,
.dashboard-side-stack .dashboard-note-row {
  grid-template-columns: 1fr;
}

.dashboard-side-stack .dashboard-row-title strong {
  font-size: 0.98rem;
}

.dashboard-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 820;
}

.dashboard-more:hover {
  background: color-mix(in srgb, var(--blue) 20%, transparent);
}

.flag-overdue,
.flag-due_today,
.flag-due_soon,
.badge {
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 50% -18%, rgba(255, 255, 255, 0.12), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(10, 132, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #070708 0%, #101013 48%, #171719 100%);
}

[data-theme="dark"] .dashboard-summary .summary-card,
[data-theme="dark"] .dashboard-grid .panel {
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(28, 28, 30, 0.68);
}

[data-theme="dark"] .dashboard-time {
  background: rgba(10, 132, 255, 0.14);
}

[data-theme="dark"] .dashboard-row-title:hover strong {
  color: #8ec5ff;
}

@media (max-width: 900px) {
  .dashboard-summary {
    grid-template-columns: 1fr;
  }

  .dashboard-grid,
  .dashboard-grid.is-balanced {
    grid-template-columns: 1fr;
  }

  .panel-today {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .dashboard-page {
    padding-top: 24px;
  }

  .dashboard-meeting-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
  }

  .dashboard-time {
    min-height: 48px;
    border-radius: 16px;
  }
}

/* Dashboard v2: fewer surfaces, stronger content hierarchy. */
.dashboard-page {
  width: min(1120px, calc(100% - 28px));
  padding-top: clamp(28px, 4vw, 46px);
}

.dashboard-page .page-header {
  max-width: none;
  margin-bottom: 12px;
}

.dashboard-page .page-header h1 {
  margin-bottom: 8px;
  font-size: clamp(2.15rem, 4vw, 3.65rem);
  font-weight: 780;
}

.dashboard-page .page-subtitle {
  max-width: 560px;
  color: rgba(245, 245, 247, 0.62);
  font-size: 1rem;
  font-weight: 680;
}

.dashboard-kicker {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(22px) saturate(1.35);
}

.dashboard-kicker span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  color: rgba(245, 245, 247, 0.72);
  font-size: 0.84rem;
  font-weight: 760;
}

.dashboard-kicker span:first-child {
  background: rgba(245, 245, 247, 0.12);
  color: #f5f5f7;
}

.dashboard-grid,
.dashboard-grid.is-balanced {
  grid-template-columns: minmax(0, 1.62fr) minmax(310px, 0.68fr);
  gap: 12px;
}

.dashboard-grid .panel {
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.028)),
    rgba(24, 24, 27, 0.58);
}

.panel-today {
  min-height: 0;
  padding: clamp(18px, 2.2vw, 26px);
}

.panel-heading {
  margin-bottom: 10px;
}

.panel-heading h2,
.panel-heading h2 a {
  color: rgba(245, 245, 247, 0.94);
  font-size: 1rem;
  font-weight: 760;
}

.badge {
  min-height: 26px;
  min-width: 26px;
  padding: 4px 9px;
  background: rgba(245, 245, 247, 0.1);
  color: rgba(245, 245, 247, 0.78);
}

.dashboard-meeting-row {
  grid-template-columns: 66px minmax(0, 1fr);
  min-height: 64px;
  padding: 10px 0;
}

.dashboard-time {
  min-height: 46px;
  border: 1px solid rgba(10, 132, 255, 0.14);
  border-radius: 15px;
  background: rgba(10, 132, 255, 0.08);
}

.dashboard-time strong {
  font-size: 0.92rem;
}

.dashboard-time span {
  font-size: 0.74rem;
}

.dashboard-row-title strong {
  color: rgba(245, 245, 247, 0.9);
  font-size: 0.96rem;
  font-weight: 760;
}

.panel-today .dashboard-row-title strong {
  font-size: 0.98rem;
}

.dashboard-row-title > span,
.dashboard-course-context {
  color: rgba(245, 245, 247, 0.56);
}

.dashboard-side-stack {
  gap: 12px;
}

.dashboard-side-stack .panel {
  padding: 18px 20px;
}

.dashboard-side-stack .dashboard-task-row,
.dashboard-side-stack .dashboard-note-row {
  padding: 11px 0;
}

.dashboard-side-stack .dashboard-row-meta time {
  color: rgba(245, 245, 247, 0.74);
  font-size: 0.88rem;
}

.panel-danger {
  border-color: rgba(255, 69, 58, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 69, 58, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.6);
}

.dashboard-more {
  min-height: 38px;
  background: rgba(10, 132, 255, 0.1);
  font-size: 0.86rem;
}

.empty-state.compact {
  padding: 16px 18px;
  border-style: solid;
  background: rgba(255, 255, 255, 0.045);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 82% -10%, rgba(10, 132, 255, 0.13), transparent 30%),
    linear-gradient(180deg, #08080a 0%, #111114 50%, #171719 100%);
}

[data-theme="dark"] .dashboard-grid .panel {
  border-color: rgba(255, 255, 255, 0.105);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.028)),
    rgba(24, 24, 27, 0.58);
}

[data-theme="dark"] .panel-danger {
  border-color: rgba(255, 69, 58, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 69, 58, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.6);
}

@media (max-width: 900px) {
  .dashboard-page {
    width: min(100% - 20px, 1120px);
  }

  .dashboard-grid,
  .dashboard-grid.is-balanced {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .dashboard-page .page-header h1 {
    font-size: 2.25rem;
  }

  .dashboard-kicker {
    width: 100%;
  }

  .dashboard-kicker span {
    flex: 1;
    justify-content: center;
  }

  .dashboard-meeting-row {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
  }
}

/* Dashboard v3: full redesign, content-first home surface. */
.dashboard-page {
  width: min(1160px, calc(100% - 32px));
  padding-top: clamp(24px, 4vw, 42px);
}

.dashboard-page > .page-header {
  display: none;
}

.today-surface {
  display: grid;
  gap: 14px;
}

.today-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.5fr);
  gap: 16px;
  align-items: center;
  min-height: clamp(132px, 18vh, 176px);
  padding: clamp(18px, 2.5vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 42px;
  background:
    linear-gradient(135deg, rgba(245, 245, 247, 0.11), rgba(245, 245, 247, 0.025) 42%),
    radial-gradient(circle at 82% 12%, rgba(10, 132, 255, 0.24), transparent 34%),
    rgba(18, 18, 20, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(36px) saturate(1.45);
}

.today-hero::before {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: 41px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 32%),
    linear-gradient(300deg, rgba(255, 255, 255, 0.08), transparent 42%);
  mask-image: linear-gradient(#000, transparent 72%);
}

.today-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.today-copy p {
  margin: 0;
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.96rem;
  font-weight: 780;
}

.today-copy h2 {
  max-width: 780px;
  margin: 0;
  color: #f5f5f7;
  font-size: clamp(2rem, 3.25vw, 3.15rem);
  font-weight: 780;
  line-height: 1;
}

.today-copy span {
  max-width: 560px;
  color: rgba(245, 245, 247, 0.7);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 680;
}

.hero-focus {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
  margin: 0;
}

.hero-focus-row {
  display: grid;
  gap: 3px;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.hero-focus-row span,
.hero-focus-row strong,
.hero-focus-row small {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-focus-row span,
.hero-focus-row small {
  color: rgba(245, 245, 247, 0.62);
  font-size: 0.78rem;
  font-weight: 760;
}

.hero-focus-row strong {
  color: #f5f5f7;
  font-size: 0.98rem;
  font-weight: 860;
}

.next-focus,
.focus-strip,
.agenda-board,
.dock-card {
  border: 1px solid rgba(255, 255, 255, 0.105);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.58);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(28px) saturate(1.38);
}

.next-focus {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 70px;
  padding: 14px 18px;
  border-radius: 28px;
}

.next-focus span,
.next-focus small {
  color: rgba(245, 245, 247, 0.55);
  font-size: 0.84rem;
  font-weight: 780;
}

.next-focus strong {
  overflow: hidden;
  color: #f5f5f7;
  font-size: 1.04rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border-radius: 28px;
}

.focus-chip {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: baseline;
  justify-content: center;
  min-height: 52px;
  padding: 11px 14px;
  border-radius: 23px;
  color: #f5f5f7;
  text-align: center;
}

.focus-chip:hover {
  background: rgba(255, 255, 255, 0.055);
}

.focus-chip strong {
  color: #f5f5f7;
  font-size: 1.35rem;
  line-height: 1;
}

.focus-chip span {
  overflow: hidden;
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.85rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(132px, auto));
  gap: 14px;
  align-items: stretch;
  min-height: 560px;
}

#today-agenda,
#today-tasks,
#stale-tasks,
#dashboard-calendar {
  scroll-margin-top: 112px;
}

.today-layout[data-active="today-agenda"] #dashboard-calendar {
  grid-column: 9 / span 4;
  grid-row: 2 / span 2;
}

.today-layout[data-active="today-tasks"] #dashboard-calendar {
  grid-column: 1 / span 3;
  grid-row: 2 / span 2;
}

.today-layout[data-active="dashboard-calendar"] #today-agenda {
  grid-column: 1 / span 3;
  grid-row: 1;
}

.today-layout[data-active="dashboard-calendar"] #today-tasks {
  grid-column: 1 / span 3;
  grid-row: 2;
}

.today-layout[data-active="dashboard-calendar"] #dashboard-calendar {
  grid-column: 4 / span 9;
  grid-row: 1 / span 3;
}

.focus-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  will-change: transform;
  transition:
    opacity 280ms ease,
    box-shadow 420ms ease,
    background 420ms ease;
}

.focus-panel.is-focus-active {
  z-index: 2;
  opacity: 1;
  box-shadow: 0 22px 68px rgba(0, 0, 0, 0.3);
}

.focus-panel.is-focus-compact {
  z-index: 1;
  opacity: 0.82;
}

.focus-panel.is-focusable.is-focus-compact {
  cursor: pointer;
}

.focus-panel.is-focusable.is-focus-compact:hover {
  opacity: 1;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.focus-panel.is-focus-compact .dashboard-list,
.focus-panel.is-focus-compact .dock-list {
  overflow: hidden;
}

.focus-panel.is-focus-compact .agenda-item {
  grid-template-columns: 1fr;
  min-height: 54px;
}

.focus-panel.is-focus-compact .agenda-item:nth-child(n+3) {
  display: none;
}

.focus-panel.is-focus-compact .agenda-item time,
.focus-panel.is-focus-compact .agenda-line,
.focus-panel.is-focus-compact .agenda-main span,
.focus-panel.is-focus-compact .dashboard-course-context {
  display: none;
}

.focus-panel.is-focus-compact .agenda-main,
.focus-panel.is-focus-compact .dock-list .dashboard-row-title,
.focus-panel.is-focus-compact .dock-row a {
  padding: 10px 0;
  border-bottom-color: rgba(255, 255, 255, 0.055);
}

.focus-panel.is-focus-compact .dock-row time {
  display: none;
}

.focus-panel.is-focus-compact .dashboard-row-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.focus-panel.is-focus-compact .dashboard-row-meta time {
  color: rgba(245, 245, 247, 0.64);
  font-size: 0.8rem;
  font-weight: 820;
}

.focus-panel.is-focus-compact .dashboard-task-row:nth-child(n+3) {
  display: none;
}

.focus-panel.is-focus-compact .dock-more {
  display: none;
}

.today-layout[data-active="today-agenda"] #today-agenda {
  grid-column: 1 / span 8;
  grid-row: 1 / span 3;
}

.today-layout[data-active="today-agenda"] #today-tasks {
  grid-column: 9 / span 4;
  grid-row: 1;
}

.today-layout[data-active="today-agenda"] #stale-tasks {
  grid-column: 9 / span 4;
  grid-row: 2;
}

.today-layout[data-active="today-agenda"] #latest-notes {
  grid-column: 9 / span 4;
  grid-row: 3;
}

.today-layout[data-active="today-tasks"] #today-agenda {
  grid-column: 1 / span 3;
  grid-row: 1;
}

.today-layout[data-active="today-tasks"] #today-tasks {
  grid-column: 4 / span 9;
  grid-row: 1 / span 3;
}

.today-layout[data-active="today-tasks"] #stale-tasks {
  grid-column: 1 / span 3;
  grid-row: 2;
}

.today-layout[data-active="today-tasks"] #latest-notes {
  grid-column: 1 / span 3;
  grid-row: 3;
}

.today-layout[data-active="stale-tasks"] #today-agenda {
  grid-column: 1 / span 3;
  grid-row: 1;
}

.today-layout[data-active="stale-tasks"] #today-tasks {
  grid-column: 1 / span 3;
  grid-row: 2;
}

.today-layout[data-active="stale-tasks"] #stale-tasks {
  grid-column: 4 / span 9;
  grid-row: 1 / span 3;
}

.today-layout[data-active="stale-tasks"] #latest-notes {
  grid-column: 1 / span 3;
  grid-row: 3;
}

.focus-chip.is-focus-selected {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.075)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.2);
}

.agenda-board {
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: 36px;
}

.agenda-board > header,
.dock-card > header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.agenda-board h2,
.dock-card h2 {
  margin: 0;
  color: #f5f5f7;
  font-size: 1.02rem;
  font-weight: 820;
}

.agenda-board > header a,
.agenda-board > header span,
.dock-card > header a,
.dock-card > header span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.09);
  color: rgba(245, 245, 247, 0.66);
  font-size: 0.78rem;
  font-weight: 820;
}

.agenda-item {
  display: grid;
  grid-template-columns: 70px 34px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 72px;
}

.agenda-item + .agenda-item {
  margin-top: 2px;
}

.agenda-item time {
  display: grid;
  align-content: center;
  min-height: 54px;
  color: #f5f5f7;
  font-weight: 860;
  line-height: 1.05;
}

.agenda-item time span {
  margin-top: 4px;
  color: rgba(245, 245, 247, 0.45);
  font-size: 0.8rem;
}

.agenda-line {
  position: relative;
  min-height: 72px;
}

.agenda-line::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 16px;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.agenda-line::after {
  content: "";
  position: absolute;
  top: 26px;
  left: 10px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.36);
  box-shadow: 0 0 0 5px rgba(245, 245, 247, 0.055);
}

.agenda-main {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.agenda-item:last-child .agenda-main {
  border-bottom: 0;
}

.agenda-main strong {
  display: flex;
  gap: 18px;
  align-items: center;
  overflow: hidden;
  color: rgba(245, 245, 247, 0.92);
  font-size: 1rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-course-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.agenda-main span,
.agenda-meta span {
  color: rgba(245, 245, 247, 0.52);
  font-size: 0.88rem;
  font-weight: 720;
}

.agenda-room {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.075);
  color: rgba(245, 245, 247, 0.72);
  font-size: 0.68rem;
  font-weight: 860;
  box-shadow: inset 0 0 0 1px rgba(245, 245, 247, 0.1);
}

.agenda-item.is-current,
.agenda-item.is-next {
  margin: 6px 0;
}

.agenda-item.is-current .agenda-main,
.agenda-item.is-next .agenda-main {
  position: relative;
  margin: 2px 0;
  padding: 12px 16px 12px 0;
  overflow: hidden;
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: transparent;
}

.agenda-item.is-current .agenda-main::before,
.agenda-item.is-next .agenda-main::before {
  content: "";
  position: absolute;
  top: -28px;
  right: -26px;
  width: min(62%, 420px);
  height: calc(100% + 56px);
  pointer-events: none;
  background:
    linear-gradient(122deg, transparent 0 22%, rgba(120, 220, 255, 0.26) 23%, transparent 42%),
    linear-gradient(136deg, transparent 0 34%, rgba(255, 255, 255, 0.2) 35%, transparent 55%),
    linear-gradient(151deg, transparent 0 48%, rgba(100, 210, 255, 0.17) 49%, transparent 70%),
    radial-gradient(ellipse at 100% 20%, rgba(10, 132, 255, 0.18), transparent 64%);
  opacity: 0.95;
  filter: blur(0.35px);
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.75) 18%, #000 55%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.75) 18%, #000 55%, transparent 100%);
}

.agenda-item.is-current .agenda-line::after,
.agenda-item.is-next .agenda-line::after {
  width: 12px;
  height: 12px;
  left: 10px;
  background: #64d2ff;
  box-shadow:
    0 0 0 5px rgba(245, 245, 247, 0.06),
    0 0 14px rgba(100, 210, 255, 0.24);
}

.agenda-item.is-past {
  opacity: 0.46;
}

.agenda-item.is-past .agenda-line::after {
  background: rgba(245, 245, 247, 0.18);
  box-shadow: 0 0 0 5px rgba(245, 245, 247, 0.035);
}

.agenda-item.is-past time,
.agenda-item.is-past .agenda-main strong,
.agenda-item.is-past .agenda-room {
  color: rgba(245, 245, 247, 0.34);
}

.agenda-item:not(.is-current):not(.is-next):not(.is-past) .agenda-main strong {
  color: rgba(245, 245, 247, 0.74);
}

.dashboard-dock,
.dashboard-secondary {
  display: grid;
  gap: 14px;
}

.dashboard-secondary {
  grid-template-columns: minmax(0, 1fr);
}

.dock-card {
  padding: 18px;
  border-radius: 32px;
}

.today-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.58);
}

.today-card.is-focus-active {
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.13), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.58);
}

.priority-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.58);
}

.priority-card.is-focus-active {
  background:
    linear-gradient(180deg, rgba(255, 69, 58, 0.11), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.58);
}

.today-empty span {
  display: block;
  margin-top: 4px;
  color: rgba(245, 245, 247, 0.56);
  font-size: 0.86rem;
  font-weight: 720;
}

.dock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dock-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.16);
  color: #b9dcff;
  font-size: 0.82rem;
  font-weight: 820;
}

.calendar-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
}

.dashboard-calendar-weekdays,
.dashboard-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.dashboard-calendar-weekdays span {
  color: rgba(245, 245, 247, 0.42);
  font-size: 0.68rem;
  font-weight: 860;
  text-align: center;
}

.dashboard-calendar-day,
.dashboard-calendar-spacer {
  min-height: 36px;
}

.dashboard-calendar-day {
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 5px 3px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.032);
  color: rgba(245, 245, 247, 0.74);
}

.dashboard-calendar-day strong {
  font-size: 0.78rem;
  font-weight: 840;
  line-height: 1;
}

.dashboard-calendar-day.is-today {
  border-color: rgba(10, 132, 255, 0.34);
  background: rgba(10, 132, 255, 0.14);
  color: #d8ecff;
}

.dashboard-calendar-day.has-events {
  background:
    radial-gradient(circle at 100% 0%, rgba(10, 132, 255, 0.11), transparent 48%),
    rgba(255, 255, 255, 0.04);
}

.calendar-dots,
.dashboard-calendar-legend {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.calendar-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

.calendar-dot.is-schedule {
  background: #64d2ff;
}

.calendar-dot.is-task {
  background: #ffd60a;
}

.calendar-dot.is-note {
  background: #30d158;
}

.calendar-dot.is-event {
  background: #bf5af2;
}

.dashboard-calendar-legend {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.dashboard-calendar-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: rgba(245, 245, 247, 0.52);
  font-size: 0.72rem;
  font-weight: 800;
}

.calendar-card.is-focus-active .dashboard-calendar-day,
.today-layout[data-active="dashboard-calendar"] .dashboard-calendar-day {
  min-height: 54px;
  border-radius: 16px;
}

.dock-list {
  display: grid;
  gap: 8px;
}

.dock-list .dashboard-task-row,
.dock-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.dock-list li:last-child,
.dock-row:last-child {
  border-bottom-color: rgba(255, 255, 255, 0.075);
}

.dock-list .dashboard-row-title,
.dock-row a {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #f5f5f7;
}

.dock-list .dashboard-row-title strong,
.dock-row strong {
  overflow: hidden;
  color: rgba(245, 245, 247, 0.9);
  font-size: 0.92rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-list .dashboard-row-title span,
.dock-row span {
  overflow: hidden;
  color: rgba(245, 245, 247, 0.52);
  font-size: 0.82rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-row time,
.dock-list .dashboard-row-meta time {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.08);
  color: rgba(245, 245, 247, 0.7);
  font-size: 0.82rem;
  font-weight: 820;
}

.today-card .dashboard-task-row {
  border-color: rgba(100, 210, 255, 0.12);
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.13), rgba(255, 255, 255, 0.03)),
    rgba(10, 132, 255, 0.045);
}

.today-card .dashboard-row-meta time {
  background: rgba(10, 132, 255, 0.18);
  color: #c7e5ff;
}

.today-layout[data-active="today-agenda"] #today-tasks {
  background:
    linear-gradient(180deg, rgba(10, 132, 255, 0.12), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.58);
}

.today-layout[data-active="today-agenda"] #stale-tasks {
  background:
    linear-gradient(180deg, rgba(255, 69, 58, 0.1), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.58);
}

.today-layout[data-active="today-agenda"] #today-tasks .dashboard-task-row,
.today-layout[data-active="today-agenda"] #stale-tasks .dashboard-task-row {
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 0;
  background: transparent;
}

.today-layout[data-active="today-agenda"] #today-tasks .dashboard-task-row:nth-child(n+3),
.today-layout[data-active="today-agenda"] #stale-tasks .dashboard-task-row:nth-child(n+3) {
  display: none;
}

.today-layout[data-active="today-agenda"] #today-tasks .dashboard-row-meta time,
.today-layout[data-active="today-agenda"] #stale-tasks .dashboard-row-meta time {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(245, 245, 247, 0.58);
}

.today-card.is-focus-active {
  align-self: start;
  min-height: 360px;
  background:
    radial-gradient(circle at 100% 0%, rgba(10, 132, 255, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(10, 132, 255, 0.075), rgba(255, 255, 255, 0.024)),
    rgba(24, 24, 27, 0.58);
}

.today-card.is-focus-active .dock-list,
.priority-card.is-focus-active .dock-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.today-card.is-focus-active .dashboard-task-row {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(18px) saturate(1.2);
}

.today-card.is-focus-active .course-color {
  display: none;
}

.today-card.is-focus-active .dashboard-row-meta time {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(245, 245, 247, 0.68);
}

.today-card.is-focus-active .dashboard-course-context {
  padding-left: 0;
}

.priority-card.is-focus-active .dashboard-task-row {
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(18px) saturate(1.2);
}

.priority-card.is-focus-active {
  align-self: start;
  min-height: 440px;
}

.priority-card.is-focus-active .dashboard-row-meta {
  display: flex;
  justify-content: flex-start;
}

.priority-card.is-focus-active .dashboard-row-meta time {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(245, 245, 247, 0.68);
}

.priority-card.is-focus-active .flag-overdue {
  display: none;
}

.priority-card.is-focus-active .course-color {
  display: none;
}

.focus-panel.is-focus-compact .dashboard-task-row {
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 0;
  background: transparent;
}

.focus-panel.is-focus-compact .dashboard-row-title {
  gap: 3px;
}

.focus-panel.is-focus-compact .dashboard-row-meta time {
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(245, 245, 247, 0.58);
}

.focus-panel.is-focus-compact .dock-actions {
  display: none;
}

.dock-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.09);
  color: rgba(245, 245, 247, 0.78);
  font-size: 0.86rem;
  font-weight: 820;
}

.dock-more:hover {
  background: rgba(245, 245, 247, 0.13);
}

.today-surface .empty-state {
  border-style: solid;
  background: rgba(255, 255, 255, 0.045);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 78% -14%, rgba(10, 132, 255, 0.22), transparent 32%),
    radial-gradient(circle at 4% 18%, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(180deg, #060607 0%, #0d0d10 44%, #151518 100%);
}

@media (max-width: 980px) {
  .today-layout {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    min-height: 0;
  }

  .focus-panel,
  .focus-panel.is-focus-active,
  .focus-panel.is-focus-compact {
    grid-column: 1 !important;
    grid-row: auto !important;
    min-height: 0;
    max-height: none;
    opacity: 1;
  }

  .focus-panel.is-focus-active {
    order: 1;
  }

  .focus-panel.is-focus-compact {
    order: 2;
  }

  .focus-panel.is-focus-compact .dashboard-list,
  .focus-panel.is-focus-compact .dock-list {
    max-height: 150px;
  }
}

@media (max-width: 720px) {
  .dashboard-page {
    width: min(100% - 20px, 1160px);
    padding-top: 20px;
  }

  .today-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 22px;
    border-radius: 34px;
  }

  .today-copy h2 {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }

  .next-focus {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .focus-strip {
    grid-template-columns: 1fr;
  }

  .agenda-board,
  .dock-card {
    border-radius: 28px;
  }

  .agenda-item {
    grid-template-columns: 56px 14px minmax(0, 1fr);
    gap: 11px;
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    grid-template-columns: auto auto minmax(0, auto);
  }

  .nav {
    overflow: visible;
  }

  .nav-link:not(.is-active) {
    display: none;
  }
}

[data-theme="dark"] body.dashboard-shell {
  color-scheme: dark;
  --ink: #f5f5f7;
  --muted: #c7c7cc;
  --soft: #1c1c1e;
  --panel: rgba(28, 28, 30, 0.74);
  --panel-solid: #1c1c1e;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #0a84ff;
  --accent-ink: #d8ecff;
  --blue: #0a84ff;
  --danger: #ff453a;
  --success: #30d158;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 14px 42px rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(circle at 78% -14%, rgba(10, 132, 255, 0.22), transparent 32%),
    radial-gradient(circle at 4% 18%, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(180deg, #060607 0%, #0d0d10 44%, #151518 100%);
}

[data-theme="dark"] body.dashboard-shell .topbar-inner {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(28, 28, 30, 0.74);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] body.dashboard-shell .brand,
[data-theme="dark"] body.dashboard-shell .nav-link {
  color: #f5f5f7;
}

[data-theme="dark"] body.dashboard-shell .nav-link.is-active {
  position: relative;
  background: transparent;
  color: #ffffff;
}

[data-theme="dark"] body.dashboard-shell .nav-link.is-active::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 6px;
  left: 12px;
  height: 2px;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.78);
}

[data-theme="dark"] body.dashboard-shell .brand.is-dashboard-active {
  position: static;
}

[data-theme="dark"] body.dashboard-shell .brand.is-dashboard-active .brand-mark {
  background: rgba(245, 245, 247, 0.1);
  color: #f5f5f7;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] body.dashboard-shell .brand.is-dashboard-active::after {
  content: none;
}

[data-theme="dark"] body.dashboard-shell .icon-button,
[data-theme="dark"] body.dashboard-shell .topbar-search-field {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(44, 44, 46, 0.88);
  color: #f5f5f7;
}

/* Global Tahoe theme: the dashboard visual language applied app-wide. */
[data-theme="dark"] body.tahoe-shell {
  color-scheme: dark;
  --ink: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.58);
  --soft: #1c1c1e;
  --panel: rgba(24, 24, 27, 0.58);
  --panel-solid: #1c1c1e;
  --line: rgba(255, 255, 255, 0.105);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #0a84ff;
  --accent-ink: #d8ecff;
  --blue: #0a84ff;
  --danger: #ff453a;
  --warning: #ffd60a;
  --success: #30d158;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 18px 54px rgba(0, 0, 0, 0.24);
  background:
    radial-gradient(circle at 78% -14%, rgba(10, 132, 255, 0.22), transparent 32%),
    radial-gradient(circle at 4% 18%, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(180deg, #060607 0%, #0d0d10 44%, #151518 100%);
  color: var(--ink);
}

[data-theme="dark"] body.tahoe-shell.auth-page,
[data-theme="dark"] body.tahoe-shell.login-page {
  background:
    radial-gradient(circle at 72% 0%, rgba(10, 132, 255, 0.22), transparent 34%),
    radial-gradient(circle at 0% 18%, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #060607 0%, #101013 100%);
}

[data-theme="dark"] body.tahoe-shell .topbar-inner {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(28, 28, 30, 0.74);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] body.tahoe-shell .brand,
[data-theme="dark"] body.tahoe-shell .nav-link,
[data-theme="dark"] body.tahoe-shell .course-title,
[data-theme="dark"] body.tahoe-shell a.stat-card {
  color: #f5f5f7;
}

[data-theme="dark"] body.tahoe-shell .nav-link.is-active {
  position: relative;
  background: transparent;
  color: #ffffff;
}

[data-theme="dark"] body.tahoe-shell .nav-link.is-active::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 6px;
  left: 12px;
  height: 2px;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.78);
}

[data-theme="dark"] body.tahoe-shell .brand:hover,
[data-theme="dark"] body.tahoe-shell .nav-link:hover {
  background: rgba(245, 245, 247, 0.09);
  color: #f5f5f7;
}

[data-theme="dark"] body.tahoe-shell .icon-button,
[data-theme="dark"] body.tahoe-shell .ghost-button,
[data-theme="dark"] body.tahoe-shell .button.secondary,
[data-theme="dark"] body.tahoe-shell .inline-action,
[data-theme="dark"] body.tahoe-shell .segmented-control,
[data-theme="dark"] body.tahoe-shell .topbar-search-field {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(44, 44, 46, 0.88);
  color: #f5f5f7;
}

[data-theme="dark"] body.tahoe-shell .main {
  width: min(1160px, calc(100% - 32px));
}

[data-theme="dark"] body.tahoe-shell .page-header {
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.58);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(1.38);
}

[data-theme="dark"] body.tahoe-shell .dashboard-page .page-header {
  display: none;
}

[data-theme="dark"] body.tahoe-shell h1,
[data-theme="dark"] body.tahoe-shell h2,
[data-theme="dark"] body.tahoe-shell h3,
[data-theme="dark"] body.tahoe-shell .empty-state strong,
[data-theme="dark"] body.tahoe-shell .stat-card strong {
  color: #f5f5f7;
}

[data-theme="dark"] body.tahoe-shell .page-subtitle,
[data-theme="dark"] body.tahoe-shell time,
[data-theme="dark"] body.tahoe-shell small,
[data-theme="dark"] body.tahoe-shell .auth-subtitle,
[data-theme="dark"] body.tahoe-shell .stat-card span {
  color: rgba(245, 245, 247, 0.58);
}

[data-theme="dark"] body.tahoe-shell .panel,
[data-theme="dark"] body.tahoe-shell .login-panel,
[data-theme="dark"] body.tahoe-shell .auth-panel,
[data-theme="dark"] body.tahoe-shell .card,
[data-theme="dark"] body.tahoe-shell .stat-card,
[data-theme="dark"] body.tahoe-shell .task-card,
[data-theme="dark"] body.tahoe-shell .course-card,
[data-theme="dark"] body.tahoe-shell .search-result,
[data-theme="dark"] body.tahoe-shell .meeting-card,
[data-theme="dark"] body.tahoe-shell .kanban-column,
[data-theme="dark"] body.tahoe-shell .month-grid,
[data-theme="dark"] body.tahoe-shell .week-grid,
[data-theme="dark"] body.tahoe-shell .confirm-sheet,
[data-theme="dark"] body.tahoe-shell .markdown-preview {
  border-color: rgba(255, 255, 255, 0.105);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(24, 24, 27, 0.58);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(1.38);
}

[data-theme="dark"] body.tahoe-shell .task-card:hover,
[data-theme="dark"] body.tahoe-shell .course-card:hover,
[data-theme="dark"] body.tahoe-shell .search-result:hover,
[data-theme="dark"] body.tahoe-shell .meeting-card:hover,
[data-theme="dark"] body.tahoe-shell a.stat-card:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(34, 34, 38, 0.68);
}

[data-theme="dark"] body.tahoe-shell .empty-state,
[data-theme="dark"] body.tahoe-shell .month-weekdays {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(245, 245, 247, 0.58);
}

[data-theme="dark"] body.tahoe-shell .month-grid,
[data-theme="dark"] body.tahoe-shell .week-grid {
  overflow: hidden;
}

[data-theme="dark"] body.tahoe-shell .calendar-cell,
[data-theme="dark"] body.tahoe-shell .week-day {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
}

[data-theme="dark"] body.tahoe-shell .calendar-cell.is-muted {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] body.tahoe-shell .calendar-cell.is-today {
  background: rgba(10, 132, 255, 0.13);
}

[data-theme="dark"] body.tahoe-shell .week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(170px, 1fr));
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

[data-theme="dark"] body.tahoe-shell .week-day {
  min-width: 170px;
  min-height: 520px;
  overflow: hidden;
}

[data-theme="dark"] body.tahoe-shell .week-day header {
  min-width: 0;
}

[data-theme="dark"] body.tahoe-shell .schedule-event,
[data-theme="dark"] body.tahoe-shell .calendar-task {
  background: rgba(10, 132, 255, 0.14);
  color: #d8ecff;
}

[data-theme="dark"] body.tahoe-shell .schedule-event {
  min-width: 0;
}

[data-theme="dark"] body.tahoe-shell .schedule-event strong,
[data-theme="dark"] body.tahoe-shell .schedule-event time,
[data-theme="dark"] body.tahoe-shell .schedule-event .pill {
  overflow-wrap: anywhere;
}

[data-theme="dark"] body.tahoe-shell .kanban-column.is-drop-target {
  border-color: rgba(10, 132, 255, 0.42);
  background: rgba(10, 132, 255, 0.12);
}

[data-theme="dark"] body.tahoe-shell label,
[data-theme="dark"] body.tahoe-shell .pill,
[data-theme="dark"] body.tahoe-shell .badge {
  color: rgba(245, 245, 247, 0.72);
}

[data-theme="dark"] body.tahoe-shell input,
[data-theme="dark"] body.tahoe-shell textarea,
[data-theme="dark"] body.tahoe-shell select {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(28, 28, 30, 0.76);
  color: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

[data-theme="dark"] body.tahoe-shell input::placeholder,
[data-theme="dark"] body.tahoe-shell textarea::placeholder {
  color: rgba(245, 245, 247, 0.36);
}

[data-theme="dark"] body.tahoe-shell input:focus,
[data-theme="dark"] body.tahoe-shell textarea:focus,
[data-theme="dark"] body.tahoe-shell select:focus {
  border-color: rgba(10, 132, 255, 0.72);
  outline: 4px solid rgba(10, 132, 255, 0.18);
}

[data-theme="dark"] body.tahoe-shell button,
[data-theme="dark"] body.tahoe-shell .button {
  border-color: rgba(10, 132, 255, 0.62);
  background: #0a84ff;
  color: #ffffff;
  box-shadow: 0 12px 34px rgba(10, 132, 255, 0.22);
}

[data-theme="dark"] body.tahoe-shell button:hover,
[data-theme="dark"] body.tahoe-shell .button:hover {
  background: #2997ff;
}

[data-theme="dark"] body.tahoe-shell .button.secondary,
[data-theme="dark"] body.tahoe-shell .ghost-button,
[data-theme="dark"] body.tahoe-shell .inline-action {
  box-shadow: none;
}

[data-theme="dark"] body.tahoe-shell .button.danger,
[data-theme="dark"] body.tahoe-shell button.danger {
  border-color: rgba(255, 69, 58, 0.36);
  background: rgba(255, 69, 58, 0.14);
  color: #ffb4ad;
  box-shadow: none;
}

[data-theme="dark"] body.tahoe-shell .pill,
[data-theme="dark"] body.tahoe-shell .badge {
  background: rgba(245, 245, 247, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] body.tahoe-shell .flag-overdue {
  color: #ffb4ad;
  background: rgba(255, 69, 58, 0.15);
}

[data-theme="dark"] body.tahoe-shell .flag-due_today {
  color: #ffd99a;
  background: rgba(255, 159, 10, 0.15);
}

[data-theme="dark"] body.tahoe-shell .flag-due_soon {
  color: #b8f5c7;
  background: rgba(48, 209, 88, 0.14);
}

[data-theme="dark"] body.tahoe-shell .course-color {
  box-shadow: 0 0 0 4px rgba(28, 28, 30, 0.78);
}

[data-theme="dark"] body.tahoe-shell .confirm-backdrop {
  background: rgba(0, 0, 0, 0.54);
}

[data-theme="dark"] body.tahoe-shell .tasks-page {
  width: min(1240px, calc(100% - 32px));
}

[data-theme="dark"] body.tahoe-shell .tasks-page > .page-header {
  min-height: 112px;
  padding: 22px 26px;
}

[data-theme="dark"] body.tahoe-shell .tasks-page > .page-header h1 {
  font-size: clamp(2.25rem, 4vw, 3rem);
  line-height: 0.95;
}

[data-theme="dark"] body.tahoe-shell .tasks-page > .page-header .page-subtitle {
  margin-top: 8px;
  font-size: 0.96rem;
}

[data-theme="dark"] body.tahoe-shell .tasks-page > .page-header .page-actions {
  align-items: center;
  margin: 0;
}

.tasks-new-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding-inline: 16px;
  white-space: nowrap;
}

.tasks-new-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tasks-view-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(480px, 100%);
  margin: 0 0 16px;
}

.tasks-view-switch a {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(245, 245, 247, 0.62);
  font-size: 0.84rem;
  font-weight: 820;
}

.tasks-view-switch a:hover {
  background: rgba(255, 255, 255, 0.075);
  color: rgba(245, 245, 247, 0.9);
}

.tasks-view-switch a.is-active {
  border-color: rgba(245, 245, 247, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07)),
    rgba(245, 245, 247, 0.08);
  color: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.tasks-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.tasks-overview article,
.tasks-overview .tasks-bucket {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.022)),
    rgba(24, 24, 27, 0.52);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.19);
  backdrop-filter: blur(24px) saturate(1.25);
  transition:
    min-height 420ms cubic-bezier(0.18, 0.86, 0.24, 1),
    padding 420ms cubic-bezier(0.18, 0.86, 0.24, 1),
    border-radius 420ms cubic-bezier(0.18, 0.86, 0.24, 1),
    transform 220ms ease,
    background 220ms ease,
    border-color 220ms ease;
}

.tasks-bucket-active {
  view-transition-name: tasks-bucket-active;
}

.tasks-bucket-done {
  view-transition-name: tasks-bucket-done;
}

.tasks-bucket-overdue {
  view-transition-name: tasks-bucket-overdue;
}

@view-transition {
  navigation: auto;
}

.tasks-overview article.is-blue,
.tasks-overview .tasks-bucket.is-blue {
  background:
    radial-gradient(circle at 100% 0%, rgba(10, 132, 255, 0.17), transparent 38%),
    linear-gradient(180deg, rgba(10, 132, 255, 0.055), rgba(255, 255, 255, 0.022)),
    rgba(24, 24, 27, 0.54);
}

.tasks-overview article.is-red,
.tasks-overview .tasks-bucket.is-red {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 69, 58, 0.15), transparent 38%),
    linear-gradient(180deg, rgba(255, 69, 58, 0.045), rgba(255, 255, 255, 0.022)),
    rgba(24, 24, 27, 0.54);
}

.tasks-overview .tasks-bucket:hover,
.tasks-overview .tasks-bucket.is-selected {
  border-color: rgba(245, 245, 247, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(32, 32, 36, 0.68);
}

.tasks-overview span,
.tasks-overview small {
  color: rgba(245, 245, 247, 0.55);
  font-size: 0.78rem;
  font-weight: 820;
}

.tasks-overview strong {
  color: #f5f5f7;
  font-size: 2rem;
  font-weight: 880;
  line-height: 1;
  transition: font-size 420ms cubic-bezier(0.18, 0.86, 0.24, 1);
}

.task-filter-panel {
  position: relative;
  margin-bottom: 14px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.022)),
    rgba(24, 24, 27, 0.56);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(1.32);
}

.task-filter-panel summary {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 15px;
  cursor: pointer;
  list-style: none;
}

.task-filter-panel summary::-webkit-details-marker {
  display: none;
}

.task-filter-panel summary span {
  color: #f5f5f7;
  font-size: 0.92rem;
  font-weight: 850;
}

.task-filter-panel summary small {
  color: rgba(245, 245, 247, 0.48);
  font-size: 0.74rem;
  font-weight: 820;
}

.task-filter-panel[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.task-filters {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(190px, 0.95fr) minmax(170px, 0.85fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 24px;
  background: rgba(28, 28, 31, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(1.25);
}

.task-filters label {
  gap: 7px;
  min-width: 0;
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.74rem;
  font-weight: 840;
}

.task-filters select,
.task-filters input {
  min-width: 0;
  min-height: 42px;
  border-radius: 999px;
}

.task-filters .button {
  min-height: 42px;
  padding: 9px 14px;
}

.filter-radio-group {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-radio-group legend {
  margin-bottom: 0;
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.74rem;
  font-weight: 840;
}

.filter-radio-group label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  margin: 0;
  color: rgba(245, 245, 247, 0.74);
  font-size: 0.8rem;
}

.filter-radio-group input {
  width: 16px;
  min-height: 16px;
  box-shadow: none;
}

.tasks-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

[data-theme="dark"] body.tahoe-shell .task-card-redesign {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  min-height: 124px;
  padding: 16px;
  overflow: hidden;
  border-radius: 28px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--course-accent) 13%, transparent), rgba(255, 255, 255, 0.026)),
    rgba(24, 24, 27, 0.58);
  cursor: pointer;
}

[data-theme="dark"] body.tahoe-shell .task-card-redesign::before {
  content: none;
}

[data-theme="dark"] body.tahoe-shell .task-card-redesign:hover {
  transform: translateY(-2px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--course-accent) 18%, transparent), rgba(255, 255, 255, 0.04)),
    rgba(30, 30, 34, 0.68);
}

.task-card-main {
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-width: 0;
}

.task-title {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #f5f5f7;
}

.task-title strong {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(245, 245, 247, 0.94);
  font-size: 1rem;
  font-weight: 860;
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-course {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.82rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.task-card-meta > span:not(.flag-overdue):not(.flag-due_today):not(.flag-due_soon):not(.badge) {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.07);
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.74rem;
  font-weight: 820;
}

.task-due {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 86px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--course-accent) 18%, transparent), transparent 54%),
    rgba(255, 255, 255, 0.045);
}

.task-due span {
  color: rgba(245, 245, 247, 0.52);
  font-size: 0.74rem;
  font-weight: 820;
}

.task-due strong {
  margin-top: 3px;
  color: #f5f5f7;
  font-size: 1.28rem;
  font-weight: 880;
  line-height: 1;
}

@media (max-width: 1040px) {
  .course-detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .semester-setup-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .course-detail-schedule {
    grid-row: auto;
  }

  .tasks-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .task-filters button,
  .task-filters .button {
    width: 100%;
  }

  .tasks-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  [data-theme="dark"] body.tahoe-shell .tasks-page {
    width: min(100% - 20px, 1160px);
  }

  [data-theme="dark"] body.tahoe-shell .tasks-page > .page-header {
    align-items: flex-start;
    padding: 20px;
    border-radius: 28px;
  }

  [data-theme="dark"] body.tahoe-shell .tasks-page > .page-header .page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .tasks-view-switch {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .tasks-new-button {
    width: 100%;
    justify-content: center;
  }

  .tasks-overview,
  .task-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-theme="dark"] body.tahoe-shell .task-card-redesign {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-due {
    grid-template-columns: 1fr auto;
    justify-items: start;
    min-width: 0;
  }

  .task-due strong {
    margin-top: 0;
  }
}

[data-theme="dark"] body.tahoe-shell .tasks-page > .page-header {
  min-height: 96px;
  padding: 18px 22px;
}

[data-theme="dark"] body.tahoe-shell .tasks-page > .page-header h1 {
  font-size: clamp(2rem, 3.4vw, 2.65rem);
}

.tasks-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.tasks-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
}

.tasks-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.tasks-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 2px;
}

.tasks-content-header h2 {
  margin: 0;
  color: #f5f5f7;
  font-size: 1.05rem;
  font-weight: 860;
}

.tasks-content-header span {
  display: block;
  margin-top: 2px;
  color: rgba(245, 245, 247, 0.5);
  font-size: 0.78rem;
  font-weight: 760;
}

.tasks-course-section {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--course-accent) 12%, transparent), transparent 46%),
    rgba(255, 255, 255, 0.024);
}

.tasks-course-section > header {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: center;
  min-height: 34px;
  padding: 4px 5px 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.tasks-course-section h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(245, 245, 247, 0.94);
  font-size: 1rem;
  font-weight: 860;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-course-section > header span {
  position: absolute;
  right: 5px;
  bottom: 8px;
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--course-accent) 62%, rgba(245, 245, 247, 0.7));
  font-size: 0.74rem;
  font-weight: 820;
  white-space: nowrap;
}

.tasks-sidebar .tasks-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
}

.tasks-sidebar .tasks-overview article,
.tasks-sidebar .tasks-overview .tasks-bucket {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  min-height: 46px;
  padding: 8px 11px;
  border-radius: 16px;
}

.tasks-sidebar .tasks-overview .tasks-bucket.is-selected {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 8px;
  min-height: 106px;
  padding: 18px 16px;
  border-radius: 26px;
  text-align: center;
}

.tasks-sidebar .tasks-overview .tasks-bucket.is-selected.is-blue {
  background:
    radial-gradient(circle at 50% 0%, rgba(100, 210, 255, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(10, 132, 255, 0.16), rgba(255, 255, 255, 0.034)),
    rgba(24, 24, 27, 0.68);
}

.tasks-sidebar .tasks-overview .tasks-bucket.is-selected.is-red {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 105, 97, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(255, 69, 58, 0.12), rgba(255, 255, 255, 0.034)),
    rgba(24, 24, 27, 0.68);
}

.tasks-sidebar .tasks-overview span {
  grid-column: 1;
  font-size: 0.72rem;
}

.tasks-sidebar .tasks-overview .tasks-bucket.is-selected span {
  color: rgba(245, 245, 247, 0.72);
  font-size: 0.82rem;
}

.tasks-sidebar .tasks-overview strong {
  grid-column: 2;
  font-size: 1.25rem;
}

.tasks-sidebar .tasks-overview .tasks-bucket.is-selected strong {
  grid-column: 1;
  grid-row: auto;
  font-size: 3rem;
}

.task-form-panel {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding: 18px;
}

.task-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.task-form .deadline-picker,
.task-form > label:has(textarea),
.task-form .task-form-existing-attachments,
.task-form .task-form-attachment,
.task-form .page-actions {
  grid-column: 1 / -1;
}

.task-form > label,
.task-form .course-combobox label,
.deadline-picker label {
  margin: 0;
  color: rgba(245, 245, 247, 0.68);
  font-size: 0.78rem;
  font-weight: 840;
}

.course-combobox {
  position: relative;
  display: grid;
  gap: 8px;
}

.course-suggestions {
  position: absolute;
  z-index: 35;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  display: none;
  gap: 6px;
  max-height: 260px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(28, 28, 31, 0.92);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(1.28);
}

.course-suggestions.is-open {
  display: grid;
}

.course-suggestion {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.04);
  color: #f5f5f7;
  text-align: left;
}

.course-suggestion[hidden] {
  display: none !important;
}

.course-suggestion:hover,
.course-suggestion.is-selected {
  border-color: rgba(10, 132, 255, 0.28);
  background: rgba(10, 132, 255, 0.14);
}

.course-suggestion strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 840;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-suggestion span {
  flex: 0 0 auto;
  color: rgba(245, 245, 247, 0.52);
  font-size: 0.74rem;
  font-weight: 820;
}

.deadline-picker {
  position: relative;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: stretch;
  gap: 10px 14px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(10, 132, 255, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.035);
}

.deadline-picker legend {
  padding: 0 4px;
  color: rgba(245, 245, 247, 0.76);
  font-size: 0.78rem;
  font-weight: 860;
}

.deadline-quick-actions {
  display: grid;
  gap: 5px;
  align-content: center;
  align-self: center;
}

.task-form .deadline-quick-actions button {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045) !important;
  color: rgba(245, 245, 247, 0.68);
  font-size: 0.76rem;
  font-weight: 820;
  box-shadow: none;
}

.task-form .deadline-quick-actions button:hover {
  background: rgba(10, 132, 255, 0.12) !important;
}

.deadline-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(92px, 0.42fr);
  gap: 8px;
  align-items: end;
}

.deadline-grid label:first-child {
  position: relative;
}

.deadline-grid label:first-child input {
  padding-right: 52px;
}

.task-form input,
.task-form textarea {
  min-height: 46px;
  border-radius: 18px;
}

.deadline-calendar-button {
  position: absolute;
  right: 8px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 12px;
  background: rgba(10, 132, 255, 0.14) !important;
  color: #d8ecff;
  box-shadow: none;
}

.deadline-calendar-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.deadline-calendar {
  position: absolute;
  z-index: 20;
  right: 12px;
  top: calc(100% - 8px);
  display: grid;
  width: min(100%, 274px);
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 18px;
  background: rgba(18, 18, 21, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(1.22);
}

.deadline-calendar[hidden] {
  display: none;
}

.deadline-calendar-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 7px;
  align-items: center;
}

.deadline-calendar-head button {
  min-height: 27px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055) !important;
  box-shadow: none;
}

.deadline-calendar-head strong {
  color: rgba(245, 245, 247, 0.88);
  font-size: 0.78rem;
  font-weight: 860;
  text-align: center;
}

.deadline-calendar-weekdays,
.deadline-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.deadline-calendar-weekdays span {
  color: rgba(245, 245, 247, 0.42);
  font-size: 0.64rem;
  font-weight: 840;
  text-align: center;
}

.deadline-calendar-grid span,
.deadline-calendar-day {
  min-height: 24px;
}

.deadline-calendar-day {
  padding: 0;
  border-radius: 8px;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.045) !important;
  color: rgba(245, 245, 247, 0.82);
  box-shadow: none;
}

.deadline-calendar-day:hover,
.deadline-calendar-day.is-selected {
  background: rgba(10, 132, 255, 0.22) !important;
  color: #f5f5f7;
}

.deadline-preview {
  grid-column: 2;
  margin: 0;
  color: rgba(245, 245, 247, 0.52);
  font-size: 0.78rem;
  font-weight: 820;
}

.task-form textarea {
  min-height: 150px;
}

.task-attachments-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(10, 132, 255, 0.11), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.024)),
    rgba(24, 24, 27, 0.58);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(26px) saturate(1.22);
}

.task-attachments-panel > header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
}

.task-attachments-panel > header > span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.14);
  color: rgba(199, 229, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 840;
}

.task-attachments-panel h2 {
  margin: 0;
  color: rgba(245, 245, 247, 0.9);
  font-size: 1rem;
  font-weight: 860;
}

.task-attachment-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.09), rgba(255, 255, 255, 0.028)),
    rgba(255, 255, 255, 0.035);
}

.task-attachment-row > a {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 4px 6px;
}

.task-attachment-row strong {
  overflow: hidden;
  color: rgba(245, 245, 247, 0.9);
  font-size: 0.9rem;
  font-weight: 840;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-attachment-row span,
.task-attachment-empty,
.task-attachment-locked {
  color: rgba(245, 245, 247, 0.5);
  font-size: 0.76rem;
  font-weight: 780;
}

.task-attachment-row form {
  margin: 0;
}

.task-attachment-row .button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.task-attachment-empty,
.task-attachment-locked {
  display: grid;
  place-items: center;
  min-height: 76px;
  border: 1px dashed rgba(255, 255, 255, 0.095);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.024);
  text-align: center;
}

.task-attachment-empty strong {
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.82rem;
}

.task-attachment-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.032);
}

.task-attachment-upload.is-inline {
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

.task-attachment-upload label {
  margin: 0;
  color: rgba(245, 245, 247, 0.62);
  font-size: 0.76rem;
  font-weight: 820;
}

.task-attachment-upload input {
  min-height: 42px;
  border-radius: 16px;
}

.task-attachment-upload span {
  color: rgba(245, 245, 247, 0.52);
  font-size: 0.78rem;
  font-weight: 780;
}

.task-attachment-upload button {
  min-height: 42px;
  border-radius: 999px;
}

.task-form-existing-attachments {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.026);
}

.task-form-existing-attachments > header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
}

.task-form-existing-attachments h3 {
  margin: 0;
  color: rgba(245, 245, 247, 0.82);
  font-size: 0.82rem;
  font-weight: 850;
}

.task-form-existing-attachments > header > span {
  color: rgba(245, 245, 247, 0.42);
  font-size: 0.72rem;
  font-weight: 780;
}

.task-form-existing-attachments .task-attachment-row {
  min-height: 52px;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}

.task-form-existing-attachments .task-attachment-row > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
}

.task-detail-shell {
  display: grid;
}

.task-detail-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.105);
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 0%, rgba(10, 132, 255, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.024)),
    rgba(24, 24, 27, 0.62);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(1.24);
}

.task-detail-head {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
}

.task-detail-course {
  display: block;
  margin-bottom: 7px;
  color: rgba(245, 245, 247, 0.56);
  font-size: 0.78rem;
  font-weight: 840;
}

.task-detail-head h2 {
  margin: 0;
  color: #f5f5f7;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1;
}

.task-detail-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.task-detail-actions form {
  margin: 0;
}

.task-detail-actions button,
.task-detail-actions .button {
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 840;
}

.task-detail-head .button {
  flex: 0 0 auto;
}

.task-detail-head .button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.task-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.task-detail-meta > div {
  display: grid;
  gap: 5px;
  min-height: 102px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.035);
}

.task-detail-meta span,
.task-detail-meta small {
  color: rgba(245, 245, 247, 0.5);
  font-size: 0.74rem;
  font-weight: 820;
}

.task-detail-meta strong {
  color: rgba(245, 245, 247, 0.92);
  font-size: 1rem;
  font-weight: 860;
}

.task-detail-section {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.task-detail-section h3 {
  margin: 0;
  color: rgba(245, 245, 247, 0.82);
  font-size: 0.9rem;
  font-weight: 860;
}

.task-detail-section p {
  margin: 0;
  color: rgba(245, 245, 247, 0.68);
  line-height: 1.65;
}

.task-detail-section .muted {
  color: rgba(245, 245, 247, 0.46);
  font-size: 0.78rem;
  font-weight: 760;
}

.task-detail-card .task-attachments-panel {
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.026);
  box-shadow: none;
  backdrop-filter: none;
}

.task-detail-card .task-attachments-panel > header {
  min-height: 30px;
  padding: 0 2px;
}

.task-detail-card .task-attachments-panel h2 {
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.task-detail-card .task-attachments-panel > header > span {
  min-height: 24px;
  padding: 3px 9px;
  background: rgba(245, 245, 247, 0.075);
  color: rgba(245, 245, 247, 0.56);
  font-size: 0.68rem;
}

.task-detail-card .task-attachment-list {
  gap: 7px;
}

.task-detail-card .task-attachment-row {
  grid-template-columns: minmax(0, 1fr);
  min-height: 56px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 17px;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.075), rgba(255, 255, 255, 0.026)),
    rgba(255, 255, 255, 0.032);
}

.task-detail-card .task-attachment-row > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 12px 14px;
  color: inherit;
}

.task-detail-card .task-attachment-row > a:hover {
  background: rgba(255, 255, 255, 0.035);
}

.task-detail-card .task-attachment-row strong {
  font-size: 0.88rem;
  line-height: 1.2;
}

.task-detail-card .task-attachment-row span {
  flex: 0 0 auto;
  color: rgba(245, 245, 247, 0.44);
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}

.task-detail-card .task-attachment-empty {
  min-height: 64px;
  padding: 0 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.024);
}

.task-detail-card .task-attachment-empty strong {
  color: rgba(245, 245, 247, 0.46);
  font-size: 0.78rem;
}

.tasks-sidebar .task-filter-panel {
  margin: 0;
  border-radius: 22px;
}

.tasks-sidebar .task-filters {
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
}

.tasks-sidebar .task-filters select,
.tasks-sidebar .task-filters input,
.tasks-sidebar .task-filters button,
.tasks-sidebar .task-filters .button {
  width: 100%;
  min-height: 39px;
}

.tasks-sidebar .task-filters .filter-radio-group input {
  width: 16px;
  min-height: 16px;
}

.tasks-content .tasks-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

[data-theme="dark"] body.tahoe-shell .tasks-content .task-card-redesign {
  min-height: 82px;
  padding: 13px 14px;
  border-radius: 22px;
  grid-template-columns: minmax(0, 1fr) 78px;
}

.tasks-content .task-card-main {
  gap: 10px;
}

.tasks-content .task-title {
  gap: 0;
}

.tasks-content .task-title strong {
  font-size: 0.96rem;
  line-height: 1.14;
  -webkit-line-clamp: 1;
}

.tasks-content .task-course {
  font-size: 0.78rem;
}

.tasks-content .task-card-meta {
  gap: 6px;
}

.tasks-content .task-card-meta > span:not(.flag-overdue):not(.flag-due_today):not(.flag-due_soon):not(.badge),
.tasks-content .task-card-meta > .flag-overdue,
.tasks-content .task-card-meta > .flag-due_today,
.tasks-content .task-card-meta > .flag-due_soon {
  min-height: 23px;
  padding: 3px 8px;
  font-size: 0.7rem;
}

.tasks-content .task-due {
  min-width: 78px;
  padding: 8px;
  border-radius: 18px;
}

.tasks-content .task-due span {
  font-size: 0.7rem;
}

.tasks-content .task-due strong {
  font-size: 1.08rem;
}

@media (max-width: 1040px) {
  .tasks-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .tasks-sidebar {
    position: static;
  }

  .tasks-sidebar .tasks-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tasks-sidebar .tasks-overview .tasks-bucket.is-selected {
    grid-column: 1 / -1;
  }

  .tasks-sidebar .task-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .course-time-fields,
  .course-detail-facts,
  .course-detail-meeting,
  .course-detail-inline-form,
  .course-detail-add-rule,
  .course-material-upload,
  .semester-date-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .semester-setup-head,
  .semester-setup-actions,
  .semester-quick-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .semester-current-badge,
  .semester-setup-actions .button,
  .semester-setup-actions button,
  .semester-quick-actions button {
    justify-content: center;
    width: 100%;
  }

  .course-detail-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .course-detail-panel > header .button {
    justify-content: center;
    width: 100%;
  }

  .course-detail-header-actions {
    width: 100%;
  }

  .course-detail-header-actions .button,
  .course-detail-header-actions button {
    width: 100%;
    justify-content: center;
  }

  .tasks-sidebar .tasks-overview,
  .tasks-sidebar .task-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  [data-theme="dark"] body.tahoe-shell .tasks-content .task-card-redesign {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .deadline-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .deadline-grid {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.55fr);
  }

  .deadline-preview {
    grid-column: 1;
  }

  .task-detail-head,
  .task-attachment-row {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .task-detail-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-detail-actions {
    width: 100%;
    justify-content: stretch;
  }

  .task-detail-actions form,
  .task-detail-actions .button,
  .task-detail-actions button {
    width: 100%;
    justify-content: center;
  }

  .task-attachment-upload {
    grid-template-columns: minmax(0, 1fr);
  }
}

[data-theme="dark"] body.tahoe-shell .timetable-page {
  width: min(1240px, calc(100% - 32px));
}

[data-theme="dark"] body.tahoe-shell .timetable-page > .page-header {
  display: flex;
  align-items: center;
  min-height: 88px;
  margin-bottom: 14px;
  padding: 20px 24px;
}

[data-theme="dark"] body.tahoe-shell .timetable-page > .page-header h1 {
  font-size: clamp(2rem, 3.1vw, 2.65rem);
  line-height: 0.95;
}

[data-theme="dark"] body.tahoe-shell .timetable-page > .page-header .page-subtitle {
  margin-top: 8px;
  font-size: 0.98rem;
}

[data-theme="dark"] body.tahoe-shell .timetable-page > .page-header .page-actions {
  margin: 0 0 0 auto;
}

.timetable-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.timetable-nav-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
}

.timetable-nav-button svg {
  width: 19px;
  height: 19px;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  overflow: hidden;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.105);
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow: visible;
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.018)),
    rgba(20, 20, 23, 0.74);
  scrollbar-width: none;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day::-webkit-scrollbar {
  width: 0;
  height: 0;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day:first-child {
  border-radius: 29px 0 0 29px;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day:last-child {
  border-radius: 0 29px 29px 0;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day.is-today {
  background:
    radial-gradient(circle at 100% 0%, rgba(10, 132, 255, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(10, 132, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(20, 20, 23, 0.78);
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day header {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  align-items: end;
  justify-content: space-between;
  min-width: 0;
  margin: -12px -12px 0;
  padding: 13px 12px 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(20, 20, 23, 0.88);
  backdrop-filter: blur(20px) saturate(1.22);
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day header div {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day header span {
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.8rem;
  font-weight: 860;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day header strong {
  color: #f5f5f7;
  font-size: 1.55rem;
  font-weight: 880;
  line-height: 1;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day header small {
  overflow: hidden;
  color: rgba(245, 245, 247, 0.42);
  font-size: 0.72rem;
  font-weight: 820;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day.is-today header strong,
[data-theme="dark"] body.tahoe-shell .timetable-page .week-day.is-today header span {
  color: #d8ecff;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .schedule-event {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--course-accent) 18%, transparent), rgba(255, 255, 255, 0.028)),
    rgba(255, 255, 255, 0.04);
  color: #f5f5f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] body.tahoe-shell .timetable-page .schedule-event-top {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .schedule-event time {
  display: flex;
  gap: 4px;
  align-items: baseline;
  overflow: hidden;
  color: rgba(245, 245, 247, 0.7);
  font-size: 0.86rem;
  font-weight: 860;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .schedule-event time span::before {
  content: "-";
  margin-right: 4px;
  color: rgba(245, 245, 247, 0.34);
}

[data-theme="dark"] body.tahoe-shell .timetable-page .schedule-event strong {
  min-width: 0;
  overflow: hidden;
  color: rgba(245, 245, 247, 0.92);
  font-size: 0.92rem;
  font-weight: 840;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: normal;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .schedule-event-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .schedule-event-meta span,
[data-theme="dark"] body.tahoe-shell .timetable-page .schedule-override {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 23px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(245, 245, 247, 0.08);
  color: rgba(245, 245, 247, 0.64);
  font-size: 0.72rem;
  font-weight: 840;
}

[data-theme="dark"] body.tahoe-shell .timetable-page .empty-state {
  display: grid;
  align-content: center;
  min-height: 112px;
  margin-top: 1px;
  border-style: dashed;
  border-radius: 20px;
}

@media (max-width: 980px) {
  [data-theme="dark"] body.tahoe-shell .timetable-page > .page-header {
    align-items: flex-start;
  }

  [data-theme="dark"] body.tahoe-shell .timetable-page > .page-header .page-actions {
    margin-left: 0;
    width: 100%;
  }

  .timetable-actions {
    justify-content: flex-end;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  [data-theme="dark"] body.tahoe-shell .timetable-page .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-theme="dark"] body.tahoe-shell .timetable-page .week-day,
  [data-theme="dark"] body.tahoe-shell .timetable-page .week-day:first-child,
  [data-theme="dark"] body.tahoe-shell .timetable-page .week-day:last-child {
    max-height: 560px;
    border-radius: 0;
  }
}

@media (max-width: 680px) {
  [data-theme="dark"] body.tahoe-shell .main {
    width: min(100% - 20px, 1160px);
  }

  [data-theme="dark"] body.tahoe-shell .timetable-page {
    width: min(100% - 20px, 1160px);
  }

  [data-theme="dark"] body.tahoe-shell .timetable-page > .page-header {
    min-height: 0;
    padding: 20px;
    border-radius: 28px;
  }

  [data-theme="dark"] body.tahoe-shell .timetable-page > .page-header h1 {
    font-size: 2.35rem;
  }

  .timetable-actions .button {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  [data-theme="dark"] body.tahoe-shell .timetable-page .week-grid {
    grid-template-columns: minmax(0, 1fr);
  }

[data-theme="dark"] body.tahoe-shell .timetable-page .week-day {
    max-height: none;
    overflow: visible;
  }
}

[data-theme="light"] body.light-shell {
  color-scheme: light;
  --ink: #171717;
  --muted: #5b5b62;
  --soft: #f6f7f9;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --line: rgba(24, 24, 27, 0.1);
  --line-strong: rgba(24, 24, 27, 0.18);
  --accent: #0d9488;
  --accent-ink: #042f2e;
  --blue: #2563eb;
  --danger: #b42318;
  --success: #047857;
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.09);
  --shadow-soft: 0 8px 30px rgba(15, 23, 42, 0.06);
  background:
    linear-gradient(135deg, rgba(13, 148, 136, 0.08), transparent 32%),
    linear-gradient(315deg, rgba(249, 115, 76, 0.08), transparent 30%),
    #fafafa;
  color: var(--ink);
}

[data-theme="light"] body.light-shell .dashboard-page .page-subtitle,
[data-theme="light"] body.light-shell .dashboard-kicker span,
[data-theme="light"] body.light-shell .dashboard-row-title span,
[data-theme="light"] body.light-shell .agenda-room,
[data-theme="light"] body.light-shell .dock-card small,
[data-theme="light"] body.light-shell time {
  color: var(--muted);
}

[data-theme="light"] body.light-shell .dashboard-grid .panel,
[data-theme="light"] body.light-shell .today-hero,
[data-theme="light"] body.light-shell .agenda-board,
[data-theme="light"] body.light-shell .dock-card,
[data-theme="light"] body.light-shell .dashboard-calendar {
  border-color: rgba(60, 60, 67, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

[data-theme="light"] body.light-shell .panel-heading h2,
[data-theme="light"] body.light-shell .panel-heading h2 a,
[data-theme="light"] body.light-shell .dashboard-row-title strong,
[data-theme="light"] body.light-shell .agenda-main strong,
[data-theme="light"] body.light-shell .today-copy h2,
[data-theme="light"] body.light-shell .dashboard-time,
[data-theme="light"] body.light-shell .dashboard-date {
  color: var(--ink);
}

[data-theme="light"] body.light-shell .dashboard-kicker,
[data-theme="light"] body.light-shell .badge,
[data-theme="light"] body.light-shell .agenda-item,
[data-theme="light"] body.light-shell .calendar-cell {
  border-color: rgba(60, 60, 67, 0.1);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

[data-theme="light"] body.light-shell .dashboard-kicker span:first-child {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

[data-theme="light"] body.light-shell .page-subtitle,
[data-theme="light"] body.light-shell .panel-heading h2,
[data-theme="light"] body.light-shell .panel-heading h2 a,
[data-theme="light"] body.light-shell .course-detail-note strong,
[data-theme="light"] body.light-shell .course-detail-hero h1,
[data-theme="light"] body.light-shell .task-detail-hero h1,
[data-theme="light"] body.light-shell .search-result strong,
[data-theme="light"] body.light-shell .schedule-event strong,
[data-theme="light"] body.light-shell .schedule-event time {
  color: var(--ink);
}

[data-theme="light"] body.light-shell .dashboard-kicker,
[data-theme="light"] body.light-shell .course-detail-list li,
[data-theme="light"] body.light-shell .attachment-card,
[data-theme="light"] body.light-shell .schedule-event,
[data-theme="light"] body.light-shell .calendar-task,
[data-theme="light"] body.light-shell .topbar-search-field {
  border-color: rgba(60, 60, 67, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

[data-theme="light"] body.light-shell .badge,
[data-theme="light"] body.light-shell .pill,
[data-theme="light"] body.light-shell .schedule-event-meta span,
[data-theme="light"] body.light-shell .schedule-override {
  background: rgba(0, 0, 0, 0.055);
  color: var(--muted);
}

[data-theme="dark"] body.tahoe-shell .course-detail-facts article,
[data-theme="dark"] body.tahoe-shell .course-detail-archive summary,
[data-theme="dark"] body.tahoe-shell .course-detail-meeting,
[data-theme="dark"] body.tahoe-shell .course-detail-task,
[data-theme="dark"] body.tahoe-shell .course-detail-note,
[data-theme="dark"] body.tahoe-shell .course-detail-override,
[data-theme="dark"] body.tahoe-shell .course-detail-inline-form,
[data-theme="dark"] body.tahoe-shell .course-detail-add-rule,
[data-theme="dark"] body.tahoe-shell .course-material-upload {
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.032);
}

[data-theme="dark"] body.tahoe-shell .course-detail-panel h2,
[data-theme="dark"] body.tahoe-shell .course-detail-facts strong,
[data-theme="dark"] body.tahoe-shell .course-detail-meeting-main > strong,
[data-theme="dark"] body.tahoe-shell .course-detail-task strong,
[data-theme="dark"] body.tahoe-shell .course-detail-note strong,
[data-theme="dark"] body.tahoe-shell .course-detail-override > strong,
[data-theme="dark"] body.tahoe-shell .course-task-dialog h3 {
  color: #f5f5f7;
}

[data-theme="dark"] body.tahoe-shell .course-detail-facts span,
[data-theme="dark"] body.tahoe-shell .course-detail-archive summary,
[data-theme="dark"] body.tahoe-shell .course-detail-inline-form label,
[data-theme="dark"] body.tahoe-shell .course-detail-add-rule label,
[data-theme="dark"] body.tahoe-shell .course-detail-task time,
[data-theme="dark"] body.tahoe-shell .course-detail-note time,
[data-theme="dark"] body.tahoe-shell .course-material-upload label {
  color: rgba(245, 245, 247, 0.62);
}

[data-theme="dark"] body.tahoe-shell .course-task-dialog {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(24, 24, 27, 0.96);
  color: #f5f5f7;
}

[data-theme="dark"] body.tahoe-shell .semester-setup-head span,
[data-theme="dark"] body.tahoe-shell .semester-setup-note,
[data-theme="dark"] body.tahoe-shell .semester-setup-help span,
[data-theme="dark"] body.tahoe-shell .semester-setup-form label {
  color: rgba(245, 245, 247, 0.62);
}

[data-theme="dark"] body.tahoe-shell .semester-setup-head h2,
[data-theme="dark"] body.tahoe-shell .semester-setup-help strong {
  color: #f5f5f7;
}

[data-theme="dark"] body.tahoe-shell .semester-current-badge {
  background: rgba(10, 132, 255, 0.16);
  color: #c7e5ff !important;
}

[data-theme="dark"] body.tahoe-shell .semester-quick-actions button {
  border-color: rgba(255, 255, 255, 0.095) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: rgba(245, 245, 247, 0.72) !important;
}

[data-theme="dark"] body.tahoe-shell .semester-quick-actions button:hover {
  background: rgba(10, 132, 255, 0.13) !important;
  color: #d8ecff !important;
}

[data-theme="dark"] body.tahoe-shell .semester-setup-help {
  border-color: rgba(255, 255, 255, 0.105);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022)),
    rgba(24, 24, 27, 0.52);
}
