/* StudyVault visual system */
:root {
  color-scheme: dark;

  --bg: #1F1F1E;
  --bg2: #262522;
  --bg3: #2D2B27;
  --bg4: #353229;
  --border: rgba(195, 194, 183, .13);
  --border-strong: rgba(195, 194, 183, .22);
  --text: #C3C2B7;
  --text2: #9E9C90;
  --text3: #706E63;
  --accent: #C6613F;
  --accent2: #D4744D;
  --accent3: #E48E66;
  --accent-soft: rgba(198, 97, 63, .14);
  --accent-softer: rgba(198, 97, 63, .08);
  --green: #8DAF73;
  --yellow: #D8AE55;
  --red: #D56E5C;
  --purple: #B295C8;
  --shadow: 0 18px 44px rgba(0, 0, 0, .28);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, .18);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 270px;

  --font-d: 'DM Serif Display', Georgia, serif;
  --font-b: 'DM Sans', Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-m: 'DM Mono', "SFMono-Regular", Consolas, monospace;
  --font-display: var(--font-d);
  --font-body: var(--font-b);
  --font-mono: var(--font-m);
}

[data-theme="light"],
[data-theme=light] {
  color-scheme: light;
  --bg: #EFE9DF;
  --bg2: #FBF7EF;
  --bg3: #E8DFD1;
  --bg4: #DDD1C0;
  --border: rgba(61, 55, 45, .14);
  --border-strong: rgba(61, 55, 45, .24);
  --text: #282623;
  --text2: #625E55;
  --text3: #8C8578;
  --accent: #B95537;
  --accent2: #A8482D;
  --accent3: #C96744;
  --accent-soft: rgba(185, 85, 55, .14);
  --accent-softer: rgba(185, 85, 55, .08);
  --shadow: 0 18px 40px rgba(74, 60, 39, .12);
  --shadow-soft: 0 10px 26px rgba(74, 60, 39, .08);
}

[data-theme=oled] {
  color-scheme: dark;
  --bg: #050505;
  --bg2: #0D0C0B;
  --bg3: #151311;
  --bg4: #1E1A17;
  --border: rgba(195, 194, 183, .12);
  --border-strong: rgba(195, 194, 183, .2);
  --text: #D8D6CB;
  --text2: #A6A398;
  --text3: #6B685F;
  --accent: #C6613F;
  --accent2: #D4744D;
  --accent3: #E48E66;
  --accent-soft: rgba(198, 97, 63, .16);
  --accent-softer: rgba(198, 97, 63, .08);
  --shadow: 0 18px 46px rgba(0, 0, 0, .75);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 15px;
  line-height: 1.5;
  transition: background .25s ease, color .25s ease;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

::selection {
  background: rgba(198, 97, 63, .32);
  color: #fff7ef;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(198, 97, 63, .46);
  background-clip: padding-box;
}

/* Auth */
.auth-page,
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% -20%, rgba(198, 97, 63, .13), transparent 34rem),
    var(--bg);
}

.login-box,
.box {
  width: min(100%, 390px);
  padding: 36px;
  text-align: center;
  background: color-mix(in srgb, var(--bg2) 92%, black);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.login-logo,
.logo,
.sb-logo {
  font-family: var(--font-d);
  letter-spacing: 0;
}

.login-logo,
.logo {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1.1;
}

.login-sub,
.sub {
  margin-bottom: 28px;
  color: var(--text2);
  font-size: .9rem;
}

.login-error,
.login-err {
  min-height: 18px;
  margin-top: 10px;
  color: var(--red);
  font-size: .82rem;
}

.back {
  display: inline-block;
  margin-top: 18px;
  color: var(--text2);
  font-size: .82rem;
  text-decoration: none;
  transition: color .15s ease;
}

.back:hover {
  color: var(--accent);
}

/* App layout */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  background: var(--bg);
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg2) 92%, black);
  border-right: 1px solid var(--border);
  transition: width .25s cubic-bezier(.4,0,.2,1), min-width .25s, transform .3s ease;
}

.sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden;
  border-right: 0;
}

.main {
  transition: none;
}

/* Sidebar */
.sidebar-header,
.sb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 17px 16px 13px;
  border-bottom: 1px solid var(--border);
}

.logo,
.sb-logo {
  flex: 1;
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1.1;
  cursor: pointer;
}

.icon-btn,
.ib,
.menu-toggle,
.menu-tog,
.sb-collapse-btn {
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.icon-btn,
.ib {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 7px;
  font-size: .9rem;
}

.icon-btn:hover,
.ib:hover,
.menu-toggle:hover,
.menu-tog:hover,
.sb-collapse-btn:hover {
  background: var(--accent-soft);
  border-color: rgba(198, 97, 63, .38);
  color: var(--accent3);
}

.sb-collapse-btn {
  position: fixed;
  top: 50%;
  left: var(--sidebar-w);
  z-index: 60;
  width: 20px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  box-shadow: 2px 0 14px rgba(0, 0, 0, .18);
  transform: translateY(-50%);
}

.sb-collapse-btn.col {
  left: 0;
}

.sidebar-actions,
.sb-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px 8px;
}

.btn-new-folder,
.btn-nf {
  flex: 1;
  padding: 8px 11px;
  border: 1px solid rgba(198, 97, 63, .35);
  border-radius: 8px;
  background: var(--accent);
  color: #fff7ef;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}

.btn-new-folder:hover,
.btn-nf:hover {
  background: var(--accent2);
  border-color: rgba(212, 116, 77, .55);
}

.sb-home {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 10px 4px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text2);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.sb-home:hover,
.sb-home.active {
  background: var(--accent-soft);
  color: var(--accent3);
}

.sb-home-icon {
  font-size: 1rem;
}

.folders-list,
.sb-tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px 9px 14px;
}

.folder-item,
.folder-row {
  margin-bottom: 3px;
}

.folder-header,
.folder-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, color .15s ease;
}

.folder-header:hover,
.folder-hd:hover {
  background: var(--bg3);
}

.folder-icon,
.tri {
  flex-shrink: 0;
  color: var(--text3);
  font-size: .72rem;
  transition: transform .18s ease, color .18s ease;
}

.folder-icon.open,
.tri.open {
  transform: rotate(90deg);
  color: var(--accent3);
}

.folder-ic {
  flex-shrink: 0;
  color: var(--text2);
  font-size: .95rem;
}

.folder-name,
.folder-nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .86rem;
  font-weight: 700;
}

.folder-count,
.folder-cnt {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg3);
  color: var(--text3);
  font-size: .68rem;
  font-family: var(--font-m);
}

.folder-menu-btn,
.row-menu {
  opacity: 0;
  padding: 2px 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: .9rem;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}

.folder-header:hover .folder-menu-btn,
.folder-hd:hover .row-menu,
.subj-row:hover .row-menu {
  opacity: 1;
}

.folder-menu-btn:hover,
.row-menu:hover {
  background: var(--accent-soft);
  color: var(--accent3);
}

.subjects-list,
.subjects-ul {
  padding: 2px 0 5px 18px;
}

.subject-item,
.subj-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-bottom: 1px;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-size: .82rem;
  transition: background .15s ease, color .15s ease;
}

.subject-item:hover,
.subj-row:hover {
  background: var(--bg3);
  color: var(--text);
}

.subject-item.active,
.subj-row.active {
  background: var(--accent-soft);
  color: var(--accent3);
}

.subject-dot,
.subj-dot {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--text3);
}

.subject-item.active .subject-dot,
.subj-row.active .subj-dot {
  background: var(--accent);
}

.subj-nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-due,
.due-pip {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(216, 174, 85, .12);
}

.due-today-btn,
.sb-due {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 14px 8px;
  padding: 9px 12px;
  border: 1px solid rgba(216, 174, 85, .28);
  border-radius: 8px;
  background: rgba(216, 174, 85, .09);
  color: var(--yellow);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.due-today-btn:hover,
.sb-due:hover {
  background: rgba(216, 174, 85, .15);
  border-color: rgba(216, 174, 85, .42);
}

.due-badge,
.sb-due-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--yellow);
  color: #211b11;
  font-size: .68rem;
  font-weight: 800;
}

.search-bar {
  display: flex;
  gap: 7px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

.search-wrap {
  position: relative;
}

.search-input {
  flex: 1;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--bg3);
  color: var(--text);
  font-family: var(--font-b);
  font-size: .82rem;
  transition: border-color .15s ease, background .15s ease;
}

.search-input:focus {
  border-color: rgba(198, 97, 63, .52);
  background: var(--bg4);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  max-height: 420px;
  margin-top: 5px;
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.search-group-label {
  padding: 9px 14px 4px;
  color: var(--text3);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.search-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s ease;
}

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

.search-item:hover {
  background: var(--bg3);
}

.search-item-title {
  margin-bottom: 2px;
  color: var(--text);
  font-size: .84rem;
  font-weight: 700;
}

.search-item-sub {
  color: var(--text2);
  font-size: .72rem;
}

.search-item-tag,
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 1px 3px 1px 0;
  padding: 2px 7px;
  border: 1px solid rgba(198, 97, 63, .22);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent3);
  font-size: .66rem;
  font-weight: 700;
}

.search-highlight {
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(216, 174, 85, .32);
  color: var(--text);
}

/* Home and dashboard */
.home-view,
.dash {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 36px 28px 48px;
}

.home-hero,
.dash-hero {
  margin-bottom: 26px;
}

.home-hero {
  text-align: left;
}

.home-hero h1,
.dash-hero h1 {
  max-width: 760px;
  margin-bottom: 6px;
  color: var(--text);
  font-family: var(--font-d);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 400;
  line-height: 1.08;
}

.home-hero p,
.dash-hero p {
  max-width: 620px;
  color: var(--text2);
  font-size: .95rem;
}

.stats-grid,
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.stat-card,
.stat {
  min-height: 106px;
  padding: 17px 16px;
  text-align: left;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.stat-num,
.stat-n {
  margin-bottom: 6px;
  color: var(--accent3);
  font-family: var(--font-m);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
}

.stat-label,
.stat-l {
  color: var(--text2);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.due-list,
.section,
.backup-panel {
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.due-list-header,
.section-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: .86rem;
  font-weight: 800;
}

.section-hd span {
  margin-left: auto;
  color: var(--text2);
  font-size: .75rem;
  font-weight: 500;
}

.due-list-item,
.rev-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s ease;
}

.due-list-item:last-child,
.rev-item:last-child {
  border-bottom: 0;
}

.due-list-item:hover,
.rev-item:hover {
  background: var(--bg3);
}

.due-info,
.rev-info,
.quick-review-info {
  flex: 1;
  min-width: 0;
}

.due-subject,
.rev-lesson {
  color: var(--text);
  font-size: .88rem;
  font-weight: 700;
}

.due-folder,
.rev-path,
.quick-review-sub {
  margin-top: 2px;
  color: var(--text2);
  font-size: .73rem;
}

.due-date,
.rev-date {
  color: var(--yellow);
  font-family: var(--font-m);
  font-size: .72rem;
  white-space: nowrap;
}

.due-overdue {
  color: var(--red);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
}

.badge-red {
  background: rgba(213, 110, 92, .12);
  border: 1px solid rgba(213, 110, 92, .28);
  color: var(--red);
}

.badge-yellow {
  background: rgba(216, 174, 85, .13);
  border: 1px solid rgba(216, 174, 85, .3);
  color: var(--yellow);
}

.badge-green {
  background: rgba(141, 175, 115, .12);
  border: 1px solid rgba(141, 175, 115, .28);
  color: var(--green);
}

.badge-blue {
  background: var(--accent-soft);
  border: 1px solid rgba(198, 97, 63, .26);
  color: var(--accent3);
}

.upcoming-group {
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
}

.upcoming-group:last-child {
  border-bottom: 0;
}

.upcoming-date-hd,
.section-title,
.option-label,
.opt-label,
.form-label,
.form-l,
.card-label,
.fc-label,
.typed-answer-box .answer-label,
.typed-a .alabel,
.answer-reveal .reveal-label,
.reveal-box .rlabel {
  color: var(--text3);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.upcoming-date-hd {
  margin-bottom: 7px;
}

.upcoming-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 2px 4px 2px 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg3);
  color: var(--text2);
  font-size: .76rem;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.upcoming-chip:hover {
  background: var(--accent-soft);
  border-color: rgba(198, 97, 63, .28);
  color: var(--accent3);
}

.quick-review-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 15px 18px;
  border: 1px solid rgba(198, 97, 63, .28);
  border-radius: var(--radius);
  background: var(--accent-softer);
  box-shadow: var(--shadow-soft);
}

.quick-review-title {
  margin-bottom: 2px;
  color: var(--text);
  font-size: .92rem;
  font-weight: 800;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid rgba(216, 174, 85, .28);
  border-radius: 9px;
  background: rgba(216, 174, 85, .09);
  color: var(--yellow);
  font-size: .83rem;
  font-weight: 800;
}

.streak-fire {
  font-size: 1.15rem;
}

/* Subject and lesson screens */
.subject-view,
.subj-view,
.lesson-view {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 28px 28px 44px;
}

.subject-header,
.subj-view-hd,
.lesson-hd {
  margin-bottom: 22px;
}

.subject-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.subject-title,
.lesson-info {
  flex: 1;
  min-width: 0;
}

.subject-title h2,
.subj-view-hd h2,
.lesson-hd h2 {
  color: var(--text);
  font-family: var(--font-d);
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.12;
}

.subject-breadcrumb,
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  color: var(--text2);
  font-size: .76rem;
}

.bc-link {
  cursor: pointer;
  transition: color .15s ease;
}

.bc-link:hover {
  color: var(--accent3);
}

.subject-actions,
.subj-actions,
.lesson-actions,
.lesson-card-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.lesson-date-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 13px;
}

.lessons-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lesson-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.lesson-card:hover {
  background: var(--bg3);
  border-color: rgba(198, 97, 63, .42);
}

.lesson-icon {
  flex-shrink: 0;
  color: var(--accent3);
  font-size: 1.15rem;
}

.lesson-name {
  margin-bottom: 3px;
  color: var(--text);
  font-size: .92rem;
  font-weight: 800;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text2);
  font-size: .73rem;
}

.lesson-rev-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* Tabs */
.tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 3px;
  margin-bottom: 22px;
  padding: 4px;
  overflow-x: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tab {
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text2);
  font-family: var(--font-b);
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.tab.active {
  background: var(--accent);
  color: #fff7ef;
}

.tab:not(.active):hover {
  background: var(--bg3);
  color: var(--text);
}

/* Reviews */
.review-section {
  margin-bottom: 24px;
}

.review-timeline,
.rev-timeline {
  display: flex;
  gap: 8px;
}

.review-timeline {
  flex-wrap: wrap;
  align-items: center;
}

.rev-timeline {
  flex-direction: column;
}

.review-chip,
.rev-chip-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--text2);
  font-family: var(--font-m);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.review-chip {
  padding: 5px 11px;
  font-size: .76rem;
}

.rev-chip-sm {
  padding: 2px 7px;
  font-size: .67rem;
}

.review-chip.done,
.rev-chip-sm.done,
.rev-row.done {
  opacity: .58;
}

.review-chip.done,
.rev-chip-sm.done {
  background: rgba(141, 175, 115, .1);
  border-color: rgba(141, 175, 115, .28);
  color: var(--green);
  text-decoration: line-through;
}

.review-chip.today,
.rev-chip-sm.today,
.rev-row.today {
  background: rgba(216, 174, 85, .1);
  border-color: rgba(216, 174, 85, .36);
  color: var(--yellow);
}

.review-chip.overdue,
.rev-chip-sm.overdue,
.rev-row.overdue {
  background: rgba(213, 110, 92, .1);
  border-color: rgba(213, 110, 92, .32);
  color: var(--red);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216, 174, 85, .24); }
  50% { box-shadow: 0 0 0 5px rgba(216, 174, 85, 0); }
}

.review-chip.today {
  animation: pulse 2s infinite;
}

.chip-btn,
.interval-remove,
.intv-rm,
.tag-pill-rm {
  border: 0;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  transition: color .15s ease, opacity .15s ease;
}

.chip-btn {
  padding: 0 2px;
  font-size: .78rem;
  opacity: .75;
}

.chip-btn:hover,
.interval-remove:hover,
.intv-rm:hover,
.tag-pill-rm:hover {
  color: var(--accent3);
  opacity: 1;
}

.add-review-btn {
  padding: 6px 11px;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text2);
  font-size: .76rem;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.add-review-btn:hover {
  background: var(--accent-softer);
  border-color: rgba(198, 97, 63, .42);
  color: var(--accent3);
}

.rev-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rev-num {
  width: 22px;
  flex-shrink: 0;
  color: var(--text3);
  font-family: var(--font-m);
  font-size: .7rem;
  text-align: center;
}

.rev-row-info {
  flex: 1;
}

.rev-row-date {
  color: var(--text);
  font-size: .86rem;
  font-weight: 800;
}

.rev-row-status {
  margin-top: 1px;
  color: var(--text2);
  font-size: .72rem;
}

.rev-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.reschedule-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: rgba(213, 110, 92, .08);
  border: 1px solid rgba(213, 110, 92, .25);
  border-radius: var(--radius);
}

.reschedule-banner p {
  flex: 1;
  color: var(--text2);
  font-size: .83rem;
}

.reschedule-banner strong {
  color: var(--red);
}

/* Cards */
.cards-toolbar,
.cards-tb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 13px;
}

.cards-count {
  color: var(--text2);
  font-size: .84rem;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.card-item,
.card-it {
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background .15s ease, border-color .15s ease;
}

.card-item:hover,
.card-it:hover {
  background: color-mix(in srgb, var(--bg2) 75%, var(--bg3));
  border-color: rgba(198, 97, 63, .42);
}

.card-item-header,
.card-it-hd {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  cursor: pointer;
}

.card-num,
.card-n {
  width: 24px;
  flex-shrink: 0;
  color: var(--text3);
  font-family: var(--font-m);
  font-size: .69rem;
}

.card-question,
.card-q {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: .88rem;
  line-height: 1.45;
}

.card-chevron,
.card-chev {
  flex-shrink: 0;
  color: var(--text3);
  font-size: .72rem;
  transition: transform .18s ease, color .18s ease;
}

.card-chevron.open,
.card-chev.o {
  transform: rotate(180deg);
  color: var(--accent3);
}

.card-answer,
.card-ans {
  display: none;
  padding: 12px 15px 13px 50px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: .84rem;
  line-height: 1.6;
}

.card-answer.visible,
.card-ans.v {
  display: block;
}

.card-item-actions,
.card-acts {
  display: none;
  gap: 7px;
  padding: 0 15px 12px 50px;
  background: var(--bg3);
}

.card-item-actions.visible,
.card-acts.v {
  display: flex;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}

/* Notes */
.notes-editor,
.notes-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notes-toolbar,
.notes-img-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.notes-textarea,
.notes-ta {
  width: 100%;
  min-height: 430px;
  padding: 18px;
  resize: vertical;
  outline: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-m);
  font-size: .88rem;
  line-height: 1.75;
  tab-size: 2;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.notes-ta {
  position: relative;
}

.notes-textarea:focus,
.notes-ta:focus {
  background: color-mix(in srgb, var(--bg2) 80%, var(--bg3));
  border-color: rgba(198, 97, 63, .48);
  box-shadow: 0 0 0 3px rgba(198, 97, 63, .1);
}

.notes-preview,
.notes-prev {
  min-height: 430px;
  padding: 22px 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  font-size: .92rem;
  line-height: 1.75;
}

.notes-preview h1,
.notes-prev h1 {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-d);
  font-size: 1.7rem;
  font-weight: 400;
}

.notes-preview h2,
.notes-prev h2 {
  margin: 20px 0 8px;
  color: var(--text);
  font-family: var(--font-d);
  font-size: 1.25rem;
  font-weight: 400;
}

.notes-preview h3,
.notes-prev h3 {
  margin: 16px 0 6px;
  color: var(--accent3);
  font-size: 1rem;
  font-weight: 800;
}

.notes-preview p,
.notes-prev p {
  margin-bottom: 10px;
}

.notes-preview blockquote,
.notes-prev blockquote {
  margin: 12px 0;
  padding: 4px 14px;
  border-left: 3px solid var(--accent);
  color: var(--text2);
  font-style: italic;
}

.notes-preview code,
.notes-prev code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg3);
  color: var(--accent3);
  font-family: var(--font-m);
  font-size: .84rem;
}

.notes-preview pre,
.notes-prev pre {
  margin: 12px 0;
  padding: 14px;
  overflow-x: auto;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.notes-preview pre code,
.notes-prev pre code {
  padding: 0;
  background: transparent;
  color: var(--text);
}

.notes-preview ul,
.notes-preview ol,
.notes-prev ul,
.notes-prev ol {
  margin-bottom: 10px;
  padding-left: 22px;
}

.notes-preview li,
.notes-prev li {
  margin-bottom: 4px;
}

.notes-preview strong,
.notes-prev strong {
  color: var(--text);
  font-weight: 800;
}

.notes-preview em,
.notes-prev em {
  color: var(--purple);
}

.notes-preview hr,
.notes-prev hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.notes-prev img {
  display: block;
  max-width: 100%;
  margin: 10px 0;
  border-radius: var(--radius);
}

.notes-prev a {
  color: var(--accent3);
}

.notes-path,
.md-hint,
.paste-hint {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg3);
  color: var(--text3);
  font-family: var(--font-m);
  font-size: .72rem;
}

.notes-saved,
.saved-ind {
  color: var(--green);
  font-size: .74rem;
  opacity: 0;
  transition: opacity .25s ease;
}

.notes-saved.show,
.saved-ind.show {
  opacity: 1;
}

.img-drop-zone {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--text3);
  font-size: .76rem;
  cursor: pointer;
  transition: all .15s ease;
}

.img-drop-zone:hover,
.img-drop-zone.drag {
  background: var(--accent-softer);
  border-color: rgba(198, 97, 63, .46);
  color: var(--accent3);
}

.img-upload-input {
  display: none;
}

.img-uploading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: .86rem;
  pointer-events: none;
}

/* Study mode */
.study-view,
.study-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.study-header,
.study-hd {
  width: 100%;
  margin-bottom: 26px;
  text-align: center;
}

.study-subject,
.study-title {
  margin-bottom: 4px;
  color: var(--text);
  font-family: var(--font-d);
  font-size: 1.4rem;
  font-weight: 400;
}

.study-progress-text,
.study-prog-txt {
  color: var(--text2);
  font-size: .82rem;
}

.progress-bar,
.prog-bar {
  width: 390px;
  max-width: 100%;
  height: 4px;
  margin: 10px auto;
  overflow: hidden;
  background: var(--bg3);
  border-radius: 999px;
}

.progress-fill,
.prog-fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width .35s ease;
}

.flashcard,
.typed-card,
.typed-wrap {
  width: 580px;
  max-width: 100%;
  margin-bottom: 20px;
}

.flashcard {
  cursor: pointer;
  perspective: 1200px;
}

.flashcard-inner,
.fc-inner {
  position: relative;
  width: 100%;
  min-height: 290px;
  transform-style: preserve-3d;
  transition: transform .48s cubic-bezier(.2,.8,.2,1);
}

.flashcard-inner.flipped,
.fc-inner.flip {
  transform: rotateY(180deg);
}

.flashcard-face,
.fc-face,
.typed-question-box,
.typed-answer-box,
.typed-q,
.typed-a {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.flashcard-face,
.fc-face {
  position: absolute;
  width: 100%;
  min-height: 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px;
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flashcard-back,
.fc-back {
  border-color: rgba(198, 97, 63, .42);
  transform: rotateY(180deg);
}

.card-label,
.fc-label {
  margin-bottom: 15px;
}

.card-content,
.fc-text {
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.6;
}

.card-hint,
.fc-hint {
  margin-top: 16px;
  color: var(--text3);
  font-size: .74rem;
}

.typed-question-box,
.typed-q {
  margin-bottom: 14px;
  padding: 30px;
  text-align: center;
}

.typed-answer-box,
.typed-a {
  padding: 20px;
}

.typed-input,
.typed-ta {
  width: 100%;
  min-height: 82px;
  padding: 12px 14px;
  resize: none;
  outline: none;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-b);
  font-size: .96rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.typed-input:focus,
.typed-ta:focus {
  border-color: rgba(198, 97, 63, .52);
  box-shadow: 0 0 0 3px rgba(198, 97, 63, .1);
}

.answer-reveal,
.reveal-box {
  display: none;
  margin-top: 12px;
  padding: 13px 15px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.answer-reveal.show,
.reveal-box.show {
  display: block;
}

.answer-reveal .reveal-text {
  color: var(--text2);
  font-size: .9rem;
  line-height: 1.5;
}

.study-controls,
.study-btns,
.study-result-btns,
.result-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.study-result-btns,
.result-btns {
  margin-top: 14px;
}

.btn-correct,
.btn-corr,
.btn-wrong,
.btn-err {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: .86rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.btn-correct,
.btn-corr {
  background: rgba(141, 175, 115, .14);
  border: 1px solid rgba(141, 175, 115, .35);
  color: var(--green);
}

.btn-correct:hover,
.btn-corr:hover {
  background: rgba(141, 175, 115, .22);
}

.btn-wrong,
.btn-err {
  background: rgba(213, 110, 92, .13);
  border: 1px solid rgba(213, 110, 92, .34);
  color: var(--red);
}

.btn-wrong:hover,
.btn-err:hover {
  background: rgba(213, 110, 92, .22);
}

.study-launch,
.launch-box {
  width: min(100%, 400px);
  padding: 26px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: slideUp .22s ease;
}

.study-launch h3,
.launch-box h3 {
  margin-bottom: 18px;
  color: var(--text);
  font-family: var(--font-d);
  font-size: 1.35rem;
  font-weight: 400;
  text-align: center;
}

.option-row,
.opt-row {
  display: flex;
  gap: 10px;
  margin-bottom: 13px;
}

.option-label,
.opt-label {
  margin-bottom: 7px;
}

.option-btn,
.opt-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg3);
  color: var(--text);
  font-family: var(--font-b);
  font-size: .84rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.option-btn:hover,
.option-btn.selected,
.opt-btn:hover,
.opt-btn.sel {
  background: var(--accent-soft);
  border-color: rgba(198, 97, 63, .42);
  color: var(--accent3);
}

.study-complete,
.study-done {
  text-align: center;
  animation: fadeIn .35s ease;
}

.complete-icon,
.done-icon {
  margin-bottom: 12px;
  font-size: 3.2rem;
}

.complete-title,
.done-title {
  margin-bottom: 7px;
  color: var(--text);
  font-family: var(--font-d);
  font-size: 1.9rem;
  font-weight: 400;
}

.complete-sub,
.done-sub {
  margin-bottom: 24px;
  color: var(--text2);
}

.score-ring {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 20px;
}

.score-ring svg {
  transform: rotate(-90deg);
}

.score-ring-text,
.score-ring-txt {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-pct {
  color: var(--green);
  font-family: var(--font-d);
  font-size: 1.65rem;
}

.score-label,
.score-lbl {
  color: var(--text3);
  font-size: .68rem;
}

/* Buttons and forms */
.btn,
.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font-b);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease, opacity .15s ease;
}

.login-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
}

.btn-primary,
.btn-prim,
.login-btn,
.btn-primary:hover,
.btn-prim:hover {
  background: var(--accent);
  border-color: rgba(198, 97, 63, .42);
  color: #fff7ef;
}

.btn-primary:hover,
.btn-prim:hover,
.login-btn:hover {
  background: var(--accent2);
}

.btn-ghost,
.btn-gh {
  background: var(--bg2);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover,
.btn-gh:hover {
  background: var(--bg3);
  border-color: var(--border-strong);
}

.btn-danger {
  background: rgba(213, 110, 92, .12);
  border-color: rgba(213, 110, 92, .28);
  color: var(--red);
}

.btn-danger:hover {
  background: rgba(213, 110, 92, .2);
}

.btn-warn {
  background: rgba(216, 174, 85, .12);
  border-color: rgba(216, 174, 85, .28);
  color: var(--yellow);
}

.btn-warn:hover {
  background: rgba(216, 174, 85, .2);
}

.btn-sm {
  min-height: 28px;
  padding: 5px 10px;
  font-size: .75rem;
}

.btn-icon {
  min-width: 31px;
  padding: 5px 7px;
}

.btn:disabled,
.login-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.form-group,
.form-g {
  margin-bottom: 14px;
}

.form-label,
.form-l {
  display: block;
  margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-i,
.form-ta,
.pw-input {
  width: 100%;
  padding: 10px 12px;
  outline: none;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-b);
  font-size: .88rem;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.pw-input {
  text-align: center;
  letter-spacing: .16em;
}

.login-box .form-input {
  text-align: center;
  letter-spacing: .12em;
}

.form-input:focus,
.form-textarea:focus,
.form-i:focus,
.form-ta:focus,
.pw-input:focus {
  background: var(--bg4);
  border-color: rgba(198, 97, 63, .52);
  box-shadow: 0 0 0 3px rgba(198, 97, 63, .1);
}

.form-textarea,
.form-ta {
  min-height: 76px;
  resize: vertical;
}

.form-hint {
  margin-top: 5px;
  color: var(--text3);
  font-size: .73rem;
}

.intervals-editor,
.intv-editor {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.interval-tag,
.intv-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text2);
  font-family: var(--font-m);
  font-size: .75rem;
}

.interval-add-row,
.intv-add {
  display: flex;
  gap: 7px;
  margin-top: 7px;
}

.interval-add-row input,
.intv-add input {
  width: 76px;
  padding: 6px 8px;
  outline: none;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--font-m);
  font-size: .82rem;
}

.interval-add-row input:focus,
.intv-add input:focus {
  border-color: rgba(198, 97, 63, .52);
}

.tags-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-height: 39px;
  padding: 7px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: text;
  transition: border-color .15s ease;
}

.tags-input-wrap:focus-within {
  border-color: rgba(198, 97, 63, .52);
}

.tags-input-wrap input {
  min-width: 80px;
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-b);
  font-size: .83rem;
}

/* Modal, menus and feedback */
.modal-overlay,
.modal-ov {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px);
  animation: fadeIn .18s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal {
  width: min(100%, 470px);
  padding: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: slideUp .22s ease;
}

.modal h3 {
  margin-bottom: 17px;
  color: var(--text);
  font-family: var(--font-d);
  font-size: 1.25rem;
  font-weight: 400;
}

.modal-actions,
.modal-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.ctx-menu,
.ctx,
.ctx-sub {
  position: fixed;
  min-width: 170px;
  padding: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 2000;
  animation: fadeIn .12s ease;
}

.ctx-sub {
  z-index: 2001;
  display: none;
}

.ctx-item,
.ctx-it {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  font-size: .8rem;
  transition: background .1s ease, color .1s ease;
}

.ctx-item:hover,
.ctx-it:hover {
  background: var(--bg3);
}

.ctx-item.danger,
.ctx-it.danger {
  color: var(--red);
}

.ctx-item.danger:hover,
.ctx-it.danger:hover {
  background: rgba(213, 110, 92, .1);
}

.ctx-it-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.ctx-it-kbd {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg3);
  color: var(--text3);
  font-family: var(--font-m);
  font-size: .65rem;
}

.ctx-divider,
.ctx-div {
  height: 1px;
  margin: 4px 0;
  background: var(--border);
}

.ctx-it.has-sub::after {
  content: '>';
  margin-left: auto;
  color: var(--text3);
  font-size: .85rem;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 310px;
  padding: 11px 15px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: .82rem;
  animation: slideUp .25s ease;
}

.toast.success {
  border-color: rgba(141, 175, 115, .42);
}

.toast.error {
  border-color: rgba(213, 110, 92, .42);
}

.msg {
  display: none;
  min-height: 18px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .83rem;
}

.msg.error {
  display: block;
  background: rgba(213, 110, 92, .1);
  border: 1px solid rgba(213, 110, 92, .28);
  color: var(--red);
}

.msg.success {
  display: block;
  background: rgba(141, 175, 115, .1);
  border: 1px solid rgba(141, 175, 115, .28);
  color: var(--green);
}

.empty-state,
.empty {
  padding: 46px 20px;
  color: var(--text2);
  text-align: center;
}

.empty-icon {
  margin-bottom: 9px;
  opacity: .58;
  font-size: 2.35rem;
}

.empty-title {
  margin-bottom: 5px;
  color: var(--text);
  font-size: .95rem;
  font-weight: 800;
}

.empty-sub {
  color: var(--text2);
  font-size: .82rem;
}

/* Backup and stats */
.backup-panel {
  padding: 20px;
}

.backup-panel h3 {
  margin-bottom: 14px;
  color: var(--text);
  font-family: var(--font-d);
  font-size: 1.14rem;
  font-weight: 400;
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.backup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .8rem;
}

.backup-item-name {
  flex: 1;
  color: var(--text);
  font-family: var(--font-m);
  font-size: .75rem;
}

.backup-item-size {
  color: var(--text3);
  font-size: .72rem;
}

.stats-lesson-row {
  margin-bottom: 8px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stats-lesson-name {
  margin-bottom: 8px;
  color: var(--text);
  font-size: .88rem;
  font-weight: 800;
}

.stats-bar-wrap {
  height: 8px;
  margin-bottom: 5px;
  overflow: hidden;
  background: var(--bg3);
  border-radius: 999px;
}

.stats-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: inherit;
  transition: width .5s ease;
}

.stats-meta {
  display: flex;
  gap: 12px;
  color: var(--text2);
  font-size: .72rem;
}

/* Print */
@media print {
  body > * {
    display: none !important;
  }

  #printArea {
    position: fixed;
    inset: 0;
    display: block !important;
    padding: 20mm;
    background: #fff;
    color: #000;
    font-family: Georgia, serif;
    font-size: 12pt;
    line-height: 1.6;
  }

  #printArea h1 {
    margin-bottom: 8pt;
    padding-bottom: 4pt;
    border-bottom: 1pt solid #ccc;
    font-size: 20pt;
  }

  #printArea h2 {
    margin: 14pt 0 5pt;
    font-size: 15pt;
  }

  #printArea h3 {
    margin: 10pt 0 4pt;
    font-size: 12pt;
    font-weight: bold;
  }

  #printArea .card-print {
    margin-bottom: 12pt;
    padding: 8pt;
    border: 1pt solid #ddd;
    border-radius: 4pt;
    page-break-inside: avoid;
  }

  #printArea .card-print .cp-q {
    margin-bottom: 4pt;
    font-weight: bold;
  }

  #printArea .card-print .cp-a {
    color: #333;
  }

  #printArea img {
    max-width: 100%;
    page-break-inside: avoid;
  }

  #printArea blockquote {
    padding-left: 8pt;
    border-left: 3pt solid #999;
    color: #555;
    font-style: italic;
  }
}

#printArea {
  display: none;
}

/* Mobile */
.menu-toggle,
.menu-tog {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 0;
}

.menu-toggle::before,
.menu-tog::before {
  content: "";
  width: 16px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.menu-toggle.is-hidden,
.menu-tog.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

.sidebar-overlay,
.sb-ov {
  position: fixed;
  inset: 0;
  z-index: 49;
  display: none;
  background: rgba(0, 0, 0, .5);
}

@media (max-width: 768px) {
  .menu-toggle,
  .menu-tog {
    display: flex;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(86vw, var(--sidebar-w));
    min-width: 0;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible,
  .sb-ov.v {
    display: block;
  }

  .main {
    padding-top: 52px;
  }

  .home-view,
  .dash,
  .subject-view,
  .subj-view,
  .lesson-view {
    padding: 18px 14px 32px;
  }

  .subject-header {
    flex-direction: column;
  }

  .subject-actions,
  .subj-actions,
  .lesson-actions {
    width: 100%;
  }

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

  .due-list-item,
  .rev-item,
  .lesson-card,
  .quick-review-banner,
  .reschedule-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .progress-bar,
  .prog-bar,
  .flashcard,
  .typed-card,
  .typed-wrap {
    width: 100%;
  }

  .flashcard-inner,
  .fc-inner,
  .flashcard-face,
  .fc-face {
    min-height: 300px;
  }

  .card-answer,
  .card-ans,
  .card-item-actions,
  .card-acts {
    padding-left: 15px;
  }

  .modal {
    padding: 22px;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
    max-width: none;
  }

  .sb-collapse-btn {
    display: none;
  }
}

@media (max-width: 480px) {
  .stats-grid,
  .stats-row {
    grid-template-columns: 1fr;
  }

  .login-box,
  .box {
    padding: 30px 24px;
  }

  .option-row,
  .opt-row {
    flex-direction: column;
  }
}
