/* BonchFlow visual system: warm Bonch orange, calm surfaces, two device-local themes. */
:root {
  --ink: #26221f;
  --ink-soft: #756d66;
  --paper: #fff8f1;
  --surface: rgba(255, 255, 255, .93);
  --surface-solid: #ffffff;
  --surface-soft: #fff1e5;
  --line: rgba(79, 48, 25, .11);
  --brand: #ef7617;
  --brand-strong: #cf5800;
  --brand-soft: #ffead8;
  --purple: #ef7617;
  --accent: #ffb05d;
  --accent-dark: #5b2900;
  --peach: #ff9858;
  --mint: #69d3b4;
  --danger: #d95345;
  --shadow: 0 18px 48px rgba(104, 55, 18, .09);
  --shadow-hover: 0 22px 55px rgba(104, 55, 18, .14);
  --radius: 26px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

html { background: var(--paper); }
body {
  background:
    radial-gradient(circle at 4% 0%, rgba(255, 180, 98, .22), transparent 27rem),
    radial-gradient(circle at 96% 8%, rgba(255, 225, 190, .52), transparent 25rem),
    var(--paper);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito Sans", "Segoe UI Variable", "Segoe UI", sans-serif;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  transition: background-color .28s ease, color .28s ease;
}

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.ambient-orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(16px);
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.ambient-orb-one {
  width: min(52vw, 720px);
  aspect-ratio: 1;
  top: -30%;
  right: -15%;
  opacity: .44;
  background: radial-gradient(circle, rgba(255, 157, 66, .58), rgba(255, 187, 111, .13) 58%, transparent 72%);
  animation: ambient-one 22s ease-in-out infinite alternate;
}
.ambient-orb-two {
  width: min(46vw, 640px);
  aspect-ratio: 1;
  left: -18%;
  bottom: -32%;
  opacity: .34;
  background: radial-gradient(circle, rgba(255, 193, 118, .62), rgba(255, 222, 183, .1) 60%, transparent 74%);
  animation: ambient-two 27s ease-in-out infinite alternate;
}
.ambient-orb-three {
  width: min(28vw, 400px);
  aspect-ratio: 1;
  top: 38%;
  left: 38%;
  opacity: .2;
  background: radial-gradient(circle, rgba(239, 118, 23, .42), transparent 70%);
  animation: ambient-three 31s ease-in-out infinite alternate;
}
.shell, .entry-card { position: relative; z-index: 1; }

:is(.topbar, .panel, .study-card, .modal, .summary-card, .mobile-nav, .date-nav, .timeline-content,
    .note-card, .subject-tile, .work-tile, input, select, textarea, button) {
  transition: color .22s ease, background-color .22s ease, border-color .22s ease,
              box-shadow .22s ease, transform .22s var(--ease-out), opacity .22s ease;
}

.topbar {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  box-shadow: 0 1px 0 var(--line);
}
.brand { letter-spacing: -.035em; }
.brand-version { margin-left: 5px; color: var(--brand-strong); font-size: 10px; letter-spacing: .03em; vertical-align: middle; }
.nav-with-badge { position: relative; }
.nav-with-badge > b { min-width: 19px; height: 19px; display: inline-grid; place-items: center; margin-left: 5px; padding: 0 5px; border-radius: 999px; color: #fff; background: var(--brand); font-size: 10px; }
.week-picker { margin: -4px 0 24px; padding: 14px; border: 1px solid var(--line); border-radius: 24px; background: color-mix(in srgb, var(--surface) 90%, transparent); box-shadow: var(--shadow); touch-action: pan-y; }
.week-picker-head { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 10px; margin-bottom: 12px; text-align: center; }
.week-picker-head a { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--brand-strong); background: var(--brand-soft); text-decoration: none; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-days a { min-width: 0; min-height: 62px; display: grid; place-items: center; align-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); text-decoration: none; }
.week-days a strong { font-size: 18px; }
.week-days a span { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; }
.week-days a.is-selected { color: #fff; border-color: var(--brand); background: linear-gradient(145deg, var(--brand-strong), var(--brand)); box-shadow: 0 9px 22px rgba(224,94,0,.2); transform: translateY(-2px); }
.week-days a.is-selected span { color: rgba(255,255,255,.8); }
.week-days a.is-today:not(.is-selected) { border-color: var(--brand); }
.lesson-comment { margin-top: 9px; padding: 9px 11px; border-radius: 12px; color: var(--ink); background: var(--brand-soft); }
.important-board { border-color: color-mix(in srgb, var(--brand) 34%, var(--line)); }
.important-grid, .materials-grid, .headman-lessons { display: grid; gap: 12px; }
.important-item, .group-material, .headman-lesson { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.important-item.is-unread { border-left: 4px solid var(--brand); background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); }
.important-item p { margin: 8px 0; }
.important-item > span, .important-item > small { color: var(--ink-soft); font-size: 12px; }
.important-item form { margin-top: 12px; }
.member-request, .row-actions, .material-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.member-request div:first-child { display: grid; gap: 4px; }
.row-actions, .material-actions { justify-content: flex-start; }
.headman-lesson summary { display: grid; gap: 4px; cursor: pointer; }
.headman-lesson > form { margin-top: 16px; }
.choice-label { display: inline-flex; margin-bottom: 8px; color: var(--brand-strong); }
.student-choice { border-color: var(--brand); box-shadow: 0 12px 35px rgba(224,94,0,.1); }
.like-button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-soft); background: var(--surface); cursor: pointer; }
.like-button.is-liked { color: #fff; border-color: var(--brand); background: var(--brand); }
.material-file-link { display: grid; gap: 3px; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface-soft); text-decoration: none; overflow-wrap: anywhere; }
.material-file-link span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.material-file-link strong { font-size: 14px; }
.group-material.is-removing { opacity: 0; transform: scale(.98); transition: opacity .16s ease, transform .16s ease; }
.pending-shell { min-height: 60vh; place-items: center; }
.registration-mode { min-height: 100dvh; }
.registration-shell { width: min(100% - 32px, 880px); min-height: 100dvh; display: grid; align-items: center; padding-block: max(28px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-bottom)); }
.registration-shell .welcome-shell { width: 100%; margin: 0; }
.welcome-fio { align-content: center; }
.welcome-fio > .fio-field { display: grid; gap: 9px; color: var(--ink); font-weight: 750; cursor: text; }
.welcome-fio > .fio-field > span { padding: 0; border: 0; background: transparent; }
.welcome-fio .fio-field input {
  position: static;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 14px 16px;
  opacity: 1;
  pointer-events: auto;
  color: var(--ink);
  caret-color: var(--brand);
  -webkit-text-fill-color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  border: 2px solid color-mix(in srgb, var(--brand) 45%, var(--line));
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: 0 8px 24px rgba(104, 55, 18, .08);
}
.welcome-fio .fio-field input::placeholder { color: var(--ink-soft); -webkit-text-fill-color: var(--ink-soft); opacity: .7; }
.welcome-fio .fio-field input:focus { outline: 3px solid color-mix(in srgb, var(--brand) 24%, transparent); outline-offset: 2px; border-color: var(--brand); }
.file-size-error { display: block; margin-top: 8px; color: var(--danger); font-size: 13px; font-weight: 750; line-height: 1.4; }
label[data-file-error="1"] { color: var(--danger); }
label[data-file-error="1"] input[type="file"] { border-color: var(--danger); }
.registration-back { min-height: 44px; display: grid; place-items: center; color: var(--ink-soft); text-decoration: none; font-weight: 700; }
.danger { color: var(--danger) !important; }
.brand-mark, .sync-mark, .loader-mark {
  background: linear-gradient(145deg, #ff963b, var(--brand-strong));
  box-shadow: 0 10px 24px rgba(224, 94, 0, .26);
}
.group-button { color: var(--brand-strong); background: var(--brand-soft); }
.live-dot { background: #39a978; box-shadow: 0 0 0 4px rgba(57, 169, 120, .13); }

.theme-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: var(--brand-strong);
  background: var(--surface);
}
.theme-toggle span { font-size: 18px; line-height: 1; }
.theme-toggle:hover { transform: translateY(-2px) rotate(-5deg); background: var(--brand-soft); }

.summary-primary {
  background: linear-gradient(135deg, #d95f08 0%, #f58220 56%, #ffad54 100%);
  box-shadow: 0 20px 45px rgba(221, 91, 0, .22);
}
.summary-primary::after { color: rgba(255, 255, 255, .18); }
.summary-primary .summary-label, .summary-primary small { color: rgba(255, 255, 255, .78); }
.progress span { background: linear-gradient(90deg, var(--brand), #ffc06e); }

.button { position: relative; overflow: hidden; }
.button:hover { transform: translateY(-2px); }
.button:active, .mini-button:active, .text-button:active { transform: translateY(0) scale(.97); }
.button-dark, .mini-button {
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  color: #fff;
  box-shadow: 0 9px 22px rgba(224, 94, 0, .22);
}
.button-dark:hover, .mini-button:hover { box-shadow: 0 13px 28px rgba(224, 94, 0, .28); }
.button-accent { background: linear-gradient(135deg, #ffd18e, #ffae51); }
.button-ghost:hover { border-color: rgba(239, 118, 23, .34); background: var(--brand-soft); }

.date-nav .date-today, .schedule-mode input:checked + span {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: rgba(239, 118, 23, .25);
}
.study-tabs a[aria-current], .stage-choice.selected, .check-row [aria-pressed=true] {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  box-shadow: 0 9px 20px rgba(224, 94, 0, .18);
}
.study-tabs a:hover, .chip-links a:hover { color: var(--brand-strong); border-color: rgba(239, 118, 23, .35); }
.study-tabs a[aria-current]:hover { color: #fff; }

.panel, .study-card, .summary-card { border-color: rgba(255, 255, 255, .82); }
.panel:hover, .study-card:hover { box-shadow: var(--shadow-hover); }
.timeline::before { background: color-mix(in srgb, var(--brand) 18%, var(--line)); }
.timeline-content { background: color-mix(in srgb, var(--surface-solid) 86%, var(--paper)); }
.type-lecture .timeline-content {
  border-color: rgba(71, 105, 211, .2);
  background: linear-gradient(120deg, rgba(235, 240, 255, .92), rgba(255, 255, 255, .92));
}
.type-practice .timeline-content {
  border-color: rgba(239, 118, 23, .25);
  background: linear-gradient(120deg, rgba(255, 237, 220, .94), rgba(255, 255, 255, .92));
}
.type-lab .timeline-content {
  border-color: rgba(29, 151, 117, .22);
  background: linear-gradient(120deg, rgba(229, 248, 241, .94), rgba(255, 255, 255, .92));
}
.legend-lecture { color: #4868ca; background: #edf1ff; }
.legend-practice { color: #ce5c08; background: #ffecdc; }
.legend-lab { color: #137a5d; background: #e5f7f1; }
.lesson-notes summary, .attachment-link, .study-card a:not(.button):not(.work-tile):not(.subject-tile),
.lesson-links a { color: var(--brand-strong); }
.note-count { color: var(--brand-strong); background: var(--brand-soft); }
.note-form textarea:focus, .modal :is(input, select, textarea):focus, .study-form :is(input, select, textarea):focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(239, 118, 23, .11);
  outline: none;
}
.subject-tile:hover, .work-tile:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.stage-chip { color: var(--brand-strong); background: var(--brand-soft); }
.target-lesson-card { border-left-color: var(--brand); }

.modal::backdrop { background: rgba(42, 27, 17, .52); }
.modal[open] { animation: modal-in .3s var(--ease-out) both; }
.modal[open]::backdrop { animation: backdrop-in .22s ease both; }
.modal-close:hover { color: var(--brand-strong); background: var(--brand-soft); transform: rotate(6deg); }

.appearance-settings {
  margin: 0 28px 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--brand-soft) 44%, var(--surface));
}
.appearance-settings h2 { margin-bottom: 10px; }
.theme-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.theme-choices button {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  cursor: pointer;
}
.theme-choices button > span { grid-row: 1 / 3; font-size: 25px; color: var(--brand); }
.theme-choices b { font-size: 13px; }
.theme-choices small { color: var(--ink-soft); overflow-wrap: anywhere; }
.theme-choices button:hover { transform: translateY(-2px); border-color: rgba(239, 118, 23, .35); }
.theme-choices button.is-active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(239, 118, 23, .1); }

.profile-options input[type="radio"]:checked + span, .welcome-choice input[type="radio"]:checked + span {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(239, 118, 23, .1);
}
.sync-intro { background: linear-gradient(135deg, var(--brand-soft), #fff8f1); }
.notification-switch input:checked + .switch-track { background: var(--brand); border-color: var(--brand-strong); }
.campus-action {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-inline: 14px;
  text-align: center;
  white-space: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.campus-search-form .campus-action { justify-self: stretch; }
.campus-official-link { margin-top: 18px; text-decoration: none; }

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(16px);
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.is-booting .app-loader, .app-loader.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}
.loader-card {
  width: min(100%, 340px);
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(96, 47, 13, .16);
  transform: translateY(8px) scale(.98);
}
.is-booting .loader-card, .app-loader.is-active .loader-card { animation: loader-card-in .32s var(--ease-out) forwards; }
.loader-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px 17px 17px 6px; color: #fff; font-size: 14px; font-weight: 900; letter-spacing: -.08em; animation: loader-pulse 1.15s ease-in-out infinite; }
.loader-card strong, .loader-card span { display: block; }
.loader-card strong { margin-bottom: 4px; font-size: 14px; }
.loader-card div > span { color: var(--ink-soft); font-size: 11px; }
.loader-line { grid-column: 1 / -1; position: relative; height: 4px; overflow: hidden; border-radius: 999px; background: var(--brand-soft); }
.loader-line::after { content: ""; position: absolute; inset-block: 0; width: 42%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--brand), #ffbe73, transparent); animation: loader-line 1.05s ease-in-out infinite; }
.app-loader.is-intro .loader-card { width: min(100%, 370px); padding: 21px; }
.app-loader.is-intro .loader-card strong { font-size: 16px; line-height: 1.35; animation: intro-copy .65s var(--ease-out) both; }
.app-loader.is-intro .loader-card div > span { margin-top: 5px; font-size: 12px; line-height: 1.45; animation: intro-copy .65s .12s var(--ease-out) both; }
.app-loader.is-intro .loader-mark { animation: intro-mark 2.3s ease-in-out both; }
.app-loader.is-intro .loader-line::after { width: 100%; animation: intro-progress 2.3s linear both; }

.shell > :is(.study-tabs, .day-header, .summary-grid, .workspace-grid, .tasks-panel, .study-card, .welcome-shell) {
  animation: content-in .42s var(--ease-out) both;
}
.shell > :nth-child(2) { animation-delay: .035s; }
.shell > :nth-child(3) { animation-delay: .07s; }
.timeline-item { animation: item-in .36s var(--ease-out) both; }
.timeline-item:nth-child(2) { animation-delay: .035s; }
.timeline-item:nth-child(3) { animation-delay: .07s; }
.timeline-item:nth-child(4) { animation-delay: .105s; }
.timeline-item:nth-child(5) { animation-delay: .14s; }
.toast {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 14px 34px rgba(207, 88, 0, .28);
  animation: toast-in .32s var(--ease-out) both;
}
.toast-error { background: linear-gradient(135deg, #b9362c, var(--danger)); box-shadow: 0 14px 34px rgba(185, 54, 44, .24); }
.toast-hide { transform: translateY(-10px) scale(.98); opacity: 0; }

.soft-nav-progress {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--brand-strong), var(--brand), #ffc278);
  box-shadow: 0 2px 10px rgba(239, 118, 23, .34);
  transition: width .32s var(--ease-out), opacity .18s ease;
}
.soft-nav-progress.is-active { width: 74%; opacity: 1; }
.soft-nav-progress.is-done { width: 100%; opacity: 0; transition: width .16s ease, opacity .22s .08s ease; }
.shell.soft-nav-leave { opacity: 0; transform: translateY(7px) scale(.995); transition: opacity .16s ease, transform .18s var(--ease-out); }
.shell.soft-nav-leave[data-nav-direction="next"] { transform: translateX(-18px); }
.shell.soft-nav-leave[data-nav-direction="prev"] { transform: translateX(18px); }
.shell.soft-nav-enter { animation: page-soft-in .32s var(--ease-out) both; }
.shell.soft-nav-enter[data-nav-direction="next"] { animation-name: page-soft-in-next; }
.shell.soft-nav-enter[data-nav-direction="prev"] { animation-name: page-soft-in-prev; }
.shell.soft-nav-enter > * { animation: none !important; }
.shell.soft-nav-enter[data-nav-direction="stay"] { animation: none; }
.shell.soft-nav-leave[data-nav-direction="stay"] { opacity: 1; transform: none; transition: none; }
.soft-nav-busy :is(button, a) { -webkit-tap-highlight-color: transparent; }

[data-theme="dark"] {
  --ink: #f7f2ec;
  --ink-soft: #b6aaa0;
  --paper: #11100f;
  --surface: rgba(29, 27, 25, .95);
  --surface-solid: #1d1b19;
  --surface-soft: #2c241e;
  --line: rgba(255, 225, 199, .12);
  --brand: #ff8a2a;
  --brand-strong: #ff9a45;
  --brand-soft: #37251a;
  --purple: #ff8a2a;
  --accent-dark: #1d0d00;
  --shadow: 0 18px 48px rgba(0, 0, 0, .22);
  --shadow-hover: 0 22px 58px rgba(0, 0, 0, .34);
}
[data-theme="dark"] body {
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 126, 27, .12), transparent 26rem),
    radial-gradient(circle at 95% 4%, rgba(128, 67, 26, .12), transparent 24rem),
    var(--paper);
}
[data-theme="dark"] .ambient-orb-one { opacity: .23; background: radial-gradient(circle, rgba(255, 126, 34, .54), rgba(119, 56, 20, .1) 60%, transparent 74%); }
[data-theme="dark"] .ambient-orb-two { opacity: .17; background: radial-gradient(circle, rgba(220, 93, 17, .5), rgba(95, 43, 16, .08) 62%, transparent 75%); }
[data-theme="dark"] .ambient-orb-three { opacity: .12; }
[data-theme="dark"] :is(.topbar, .date-nav, .panel, .study-card, .summary-card, .modal, .mobile-nav,
  .note-card, .session-check, .telegram-connected, .telegram-test-form, .notification-master, .welcome-choice) {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="dark"] :is(.timeline-content, .kind-task .timeline-content, .modal input, .modal textarea,
  .modal select, .note-form textarea, .note-options select, .task-class-picker span, .schedule-mode span,
  .telegram-settings, .sync-intro, .sync-status, .notes-empty, .telegram-next, .file-drop,
  .subject-tile, .work-tile, .material-card, .study-form input, .study-form select, .study-form textarea,
  .profile-options span, .welcome-choice label span, .community-settings) {
  color: var(--ink);
  background: #24211f;
  border-color: var(--line);
}
[data-theme="dark"] .appearance-settings { background: #201b17; border-color: var(--line); }
[data-theme="dark"] .welcome-fio .fio-field input { color: var(--ink); -webkit-text-fill-color: var(--ink); background: #24211f; }
[data-theme="dark"] .theme-choices button { color: var(--ink); background: #27231f; border-color: var(--line); }
[data-theme="dark"] .theme-choices button.is-active { background: var(--brand-soft); border-color: var(--brand); }
[data-theme="dark"] .study-tabs a[aria-current],
[data-theme="dark"] .stage-choice.selected,
[data-theme="dark"] .check-row [aria-pressed=true] {
  color: #fff;
  background: linear-gradient(135deg, #d85c00, #ff8524);
  border-color: transparent;
  box-shadow: 0 9px 20px rgba(224, 94, 0, .2);
}
[data-theme="dark"] .notification-switch input:checked + .switch-track {
  background: var(--brand);
  border-color: var(--brand-strong);
}
[data-theme="dark"] .type-lecture .timeline-content { background: #20283d; border-color: #354b77; }
[data-theme="dark"] .type-practice .timeline-content { background: #35251c; border-color: #73431e; }
[data-theme="dark"] .type-lab .timeline-content { background: #172e28; border-color: #285d4e; }
[data-theme="dark"] .teacher-line { color: var(--ink-soft); }
[data-theme="dark"] .summary-primary { background: linear-gradient(135deg, #b94800, #e96c0c 58%, #f58a2e); }
[data-theme="dark"] .button-dark, [data-theme="dark"] .mini-button { background: linear-gradient(135deg, #d85c00, #ff8524); }
[data-theme="dark"] .button-ghost:hover { background: var(--brand-soft); }
[data-theme="dark"] .note-card.is-important { background: #342d1d; border-color: #806a34; }
[data-theme="dark"] .task-check { background: var(--surface-solid); border-color: var(--line); }
[data-theme="dark"] .empty-state { color: var(--ink); background: linear-gradient(145deg, #211e1b, #171513); border-color: var(--line); }
[data-theme="dark"] .loader-card { background: #211e1b; box-shadow: 0 24px 90px rgba(0, 0, 0, .4); }

@keyframes content-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes item-in { from { opacity: 0; transform: translateX(-7px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes loader-card-in { to { transform: none; } }
@keyframes loader-pulse { 50% { transform: scale(1.055) rotate(-2deg); box-shadow: 0 14px 30px rgba(224, 94, 0, .34); } }
@keyframes loader-line { from { left: -48%; } to { left: 106%; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes page-soft-in { from { opacity: 0; transform: translateY(8px) scale(.995); } to { opacity: 1; transform: none; } }
@keyframes page-soft-in-next { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes page-soft-in-prev { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@keyframes intro-copy { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes intro-mark { 0% { transform: scale(.92); opacity: .7; } 38% { transform: scale(1.06) rotate(-2deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes intro-progress { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes ambient-one { from { transform: translate3d(-3%, -2%, 0) scale(.96); } to { transform: translate3d(-16%, 12%, 0) scale(1.08); } }
@keyframes ambient-two { from { transform: translate3d(0, 4%, 0) scale(1); } to { transform: translate3d(17%, -10%, 0) scale(1.1); } }
@keyframes ambient-three { from { transform: translate3d(-8%, 4%, 0) scale(.9); } to { transform: translate3d(22%, -14%, 0) scale(1.16); } }

@media (max-width: 680px) {
  .topbar-actions > .theme-toggle { display: inline-grid; }
  .topbar { background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(14px); }
  .panel:hover, .study-card:hover { box-shadow: none; }
  .appearance-settings { margin: 0 12px 12px; padding: 14px; }
  .settings-modal > form:first-child .rhythm-form-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
  }
  .settings-modal .rhythm-form-grid > label,
  .settings-modal .rhythm-form-grid input {
    display: block;
    width: 100%;
    inline-size: 100%;
    min-width: 0;
    min-inline-size: 0;
    max-width: 100%;
    max-inline-size: 100%;
    box-sizing: border-box;
  }
  .settings-modal .rhythm-form-grid input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    min-height: 46px;
  }
  .theme-choices button { min-height: 86px; padding: 12px; }
  .campus-action { justify-self: stretch; }
  .mobile-nav .mobile-add { color: var(--brand-strong); }
  .mobile-add span { background: linear-gradient(145deg, var(--brand-strong), var(--brand)); box-shadow: 0 7px 18px rgba(224, 94, 0, .25); }
  .modal[open] { animation-name: sheet-in; }
  .ambient-orb-one { width: 92vw; top: -18%; right: -42%; opacity: .36; }
  .ambient-orb-two { width: 88vw; left: -46%; bottom: -18%; opacity: .28; }
  .ambient-orb-three { width: 58vw; left: 48%; top: 44%; opacity: .15; }
  .app-loader.is-intro .loader-card { padding: 18px; }
}

@keyframes sheet-in { from { opacity: .8; transform: translateY(26px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
