@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap");

:root {
  --bg: #0f172a;
  --primary: #38bdf8;
  --primary-deep: #0ea5e9;
  --secondary: #818cf8;
  --secondary-deep: #6366f1;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --radius-card: 24px;
  --radius-pill: 50px;
  --motion: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(ellipse 70% 50% at 20% 30%, rgba(56, 189, 248, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 70%, rgba(129, 140, 248, 0.08) 0%, transparent 60%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.28));
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
  box-shadow: none !important;
}

.auth-page,
.share-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card,
.loading-text,
.placeholder-card,
.shell-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.35);
}

.auth-card {
  position: relative;
  width: min(100%, 450px);
  padding: 28px;
  overflow: hidden;
}

.auth-card::before,
.placeholder-card::before,
.loading-text::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), transparent 42%, rgba(129, 140, 248, 0.08));
  opacity: 0.85;
}

.auth-logo-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.auth-logo-row:hover {
  opacity: 0.7;
}

.brand-logo,
.nav-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(56, 189, 248, 0.28));
}

.brand-wordmark,
.nav-title {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.eyebrow,
.page-eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-card h1,
.page-heading {
  position: relative;
  margin: 0;
  color: var(--text);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.auth-card h1 {
  max-width: 340px;
  font-size: clamp(1.5rem, 4.5vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.auth-card .login-title {
  max-width: 340px;
  font-size: clamp(1.5rem, 4.5vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.auth-card h1 span,
.page-heading span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-card p {
  position: relative;
  margin: 16px 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-subtitle {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.auth-card .field {
  margin-bottom: 10px;
}

.auth-card .field input,
.auth-card .field select,
.auth-card .field textarea {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
}

.auth-card .field label {
  font-size: 0.75rem;
}

.auth-card .primary-button {
  padding: 10px 28px;
}

.auth-card .auth-link {
  margin: 12px 0 0;
  font-size: 0.82rem;
}

.field {
  position: relative;
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.field label,
.checkbox-field {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  outline: none;
  line-height: 1;
  transition: border-color 0.25s var(--motion), box-shadow 0.25s var(--motion), background 0.25s var(--motion);
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.toolbar select:focus,
.inline-form select:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.13);
}

.field select,
.field textarea,
.toolbar select,
.inline-form input,
.inline-form select,
.chip-input,
.chip-time-input {
  min-height: 40px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  outline: none;
  appearance: none;
  line-height: 1;
}

.field select {
  width: 100%;
  min-width: 0;
}

.field textarea {
  min-height: 96px;
  padding: 12px 14px;
  line-height: 1.45;
  resize: vertical;
}

.checkbox-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.checkbox-field input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.day-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s var(--motion);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  user-select: none;
}

.day-check:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--primary);
}

.day-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.day-check:has(input:checked) {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.days-selector {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form .days-selector {
  margin-left: 8px;
}

body.theme-light .day-check,
html[data-app-theme="light"] body .day-check {
  background: rgba(15, 23, 42, 0.045);
  border-color: rgba(100, 116, 139, 0.22);
  color: #475569;
}

body.theme-light .day-check:hover,
html[data-app-theme="light"] body .day-check:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.4);
  color: #2563eb;
}

body.theme-light .day-check:has(input:checked),
html[data-app-theme="light"] body .day-check:has(input:checked) {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

body.theme-dark .day-check,
html[data-app-theme="dark"] body .day-check {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--glass-border);
}

.primary-button,
.logout-button,
.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.3s var(--motion), box-shadow 0.3s var(--motion), border-color 0.3s var(--motion), background 0.3s var(--motion), color 0.3s var(--motion);
}

.primary-button {
  position: relative;
  width: 100%;
  padding: 11px 28px;
  color: var(--bg);
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border: 0;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.3);
}

.primary-button:hover {
  transform: scale(1.02);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.5);
}

.auth-link {
  margin: 16px 0 0;
  color: var(--muted);
  text-align: center;
}

.auth-link a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.app-footer {
  display: grid;
  gap: 4px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.app-footer p {
  margin: 0;
}

.app-footer p:first-of-type {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}

.app-footer p:nth-of-type(2) {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.78;
}

.app-footer div {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  gap: 12px;
  flex-wrap: wrap;
}

.app-footer a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.donate-cta {
  margin: 10px auto 6px;
  max-width: 620px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text);
  text-align: left;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--primary) 12%, transparent),
      color-mix(in srgb, var(--secondary) 8%, transparent)),
    var(--glass-bg);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--glass-strong) 55%, transparent) inset,
    0 10px 30px color-mix(in srgb, var(--text) 16%, transparent);
}

.donate-cta-heart {
  flex-shrink: 0;
  color: var(--primary);
}

.donate-cta-text {
  flex: 1;
  min-width: 200px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.45;
}

.donate-cta-text strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 800;
}

.donate-cta-button {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 0 20px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: transform 0.3s var(--motion), box-shadow 0.3s var(--motion);
}

.donate-cta-button:hover {
  transform: scale(1.03);
  box-shadow: 0 0 32px color-mix(in srgb, var(--primary) 55%, transparent);
}

body.theme-light .donate-cta,
html[data-app-theme="light"] body .donate-cta {
  background: #ffffff;
  border-color: color-mix(in srgb, var(--primary) 38%, transparent);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.12);
}

body.theme-light .donate-cta-text,
html[data-app-theme="light"] body .donate-cta-text {
  color: #334155;
}

body.theme-light .donate-cta-text strong,
html[data-app-theme="light"] body .donate-cta-text strong {
  color: #0f172a;
}

body.theme-light .donate-cta-button,
html[data-app-theme="light"] body .donate-cta-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

body.theme-light .donate-cta-button:hover,
html[data-app-theme="light"] body .donate-cta-button:hover {
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.3);
}

.testing-setup-button {
  margin: 8px auto 0;
}

.subtle-auth-link {
  margin-top: 10px;
  font-size: 0.84rem;
}

.pending-notice {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 18px;
}

.pending-notice[hidden] {
  display: none;
}

.pending-notice h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.1rem;
}

.pending-notice p {
  margin: 0;
}

.not-found-card {
  text-align: left;
}

.not-found-copy {
  position: relative;
  margin: 14px 0 24px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.error-message {
  min-height: 0;
  margin: 0;
  padding: 0 0 10px;
  color: #f87171;
  font-weight: 800;
  font-size: 0.82rem;
}

.error-message:empty {
  display: none;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 62px;
  padding: 0 24px;
  background: rgba(15, 23, 42, 0.82);
  border-bottom: 1px solid var(--glass-border);
  transform: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 36px rgba(2, 6, 23, 0.22);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.nav-logo {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links form {
  margin: 0;
}

.nav-links a,
.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  appearance: none;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-links a.nav-icon-link,
.logout-button.nav-icon-link {
  width: 38px;
  padding: 0;
}

.nav-action-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-links a.active {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.09);
  border-color: rgba(56, 189, 248, 0.16);
}

.nav-links a:hover,
.logout-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-strong);
}

.logout-button {
  margin-left: 4px;
  color: var(--secondary);
  border-color: rgba(129, 140, 248, 0.26);
}

.page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 92px 0 48px;
}

.page-header {
  margin-bottom: 20px;
}

.dashboard-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-add-button {
  flex: 0 0 auto;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.current-class-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}

.current-class-pill[hidden] {
  display: none;
}

.current-class-pill span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.current-class-pill strong {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 800;
}

.page-heading {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.page-subtitle {
  max-width: 650px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

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

.dashboard-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--banner-color, var(--primary)) 16%, var(--glass-bg));
  border: 1px solid color-mix(in srgb, var(--banner-color, var(--primary)) 42%, transparent);
  border-left: 5px solid var(--banner-color, var(--primary));
  border-radius: 18px;
  box-shadow: 0 16px 40px color-mix(in srgb, var(--banner-color, var(--primary)) 14%, transparent);
}

.dashboard-banner[hidden] {
  display: none;
}

.dashboard-banner p {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.45;
}

.placeholder-card {
  position: relative;
  min-height: 126px;
  padding: 20px;
  overflow: hidden;
  transition: transform 0.3s var(--motion), border-color 0.3s var(--motion), box-shadow 0.3s var(--motion);
}

.placeholder-card:hover {
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.42), 0 0 32px rgba(56, 189, 248, 0.08);
  transform: translateY(-3px);
}

.placeholder-card h2 {
  position: relative;
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.placeholder-card p,
.placeholder-text,
.loading-text {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.placeholder-card .tag,
.tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-top: 14px;
  padding: 5px 12px;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 30px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.placeholder-text {
  display: inline-flex;
  padding: 20px 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.loading-text {
  position: relative;
  display: grid;
  min-width: min(100%, 360px);
  min-height: 180px;
  place-items: center;
  padding: 32px;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 700;
}

.share-brand {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.share-brand img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 0 34px rgba(56, 189, 248, 0.36));
}

.reveal {
  animation: none;
}

.app-panel {
  padding: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 52px rgba(2, 6, 23, 0.28);
}

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

.filter-group,
.field {
  display: grid;
  gap: 7px;
}

.control-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compact-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  line-height: 1;
  white-space: nowrap;
}

.compact-button {
  width: auto;
  padding: 0 18px;
}

.secondary-button,
.icon-button {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.16);
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.secondary-button {
  padding: 0 16px;
}

.secondary-button:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.16);
  transform: translateY(-1px);
}

.icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  appearance: none;
}

.icon-button.danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.24);
}

.section-error {
  min-height: 20px;
  margin: 8px 0;
  color: #f87171;
  font-size: 0.84rem;
  font-weight: 700;
}

.empty-state,
.muted-copy {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}

.assignment-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  transition: opacity 0.4s var(--motion), transform 0.4s var(--motion), border-color 0.2s var(--motion);
}

.assignment-card:hover {
  border-color: rgba(56, 189, 248, 0.2);
}

.assignment-card.completing {
  opacity: 0;
  transform: translateY(20px);
}

.card-top-row,
.assignment-meta,
.section-heading-row,
.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading-row {
  flex-wrap: wrap;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.assignment-card h2,
.app-panel h2,
.modal-panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.assignment-card h2 {
  margin-top: 14px;
}

.assignment-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.class-badge,
.status-pill,
.time-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.class-badge {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--class-color, var(--primary));
  background: color-mix(in srgb, var(--class-color, var(--primary)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--class-color, var(--primary)) 26%, transparent);
}

.class-badge-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-badge.no-class {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.15);
}

.status-pill {
  border: 1px solid transparent;
}

.time-badge {
  border: 1px solid transparent;
}

.test-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.secondary-button .button-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.due-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.due-today {
  color: #fb7185;
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.24);
}

.due-overdue {
  gap: 6px;
  color: #fecdd3;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(248, 113, 113, 0.44);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.08), 0 0 18px rgba(239, 68, 68, 0.22);
  text-transform: uppercase;
}

.due-overdue::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #450a0a;
  background: #fca5a5;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 950;
}

.due-tomorrow {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.24);
}

.due-upcoming {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.22);
}

.time-low {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.2);
}

.time-mid {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.time-high {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.2);
}

.status-not_started {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.15);
}

.status-in_progress {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.22);
}

.status-almost_done {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.22);
}

.status-completed {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.22);
}

.status-select {
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 50%,
    calc(100% - 10px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

body.theme-light .status-select,
html[data-app-theme="light"] body .status-select {
  background-image:
    linear-gradient(45deg, transparent 50%, #0f172a 50%),
    linear-gradient(135deg, #0f172a 50%, transparent 50%);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.68);
}

.modal-panel {
  width: min(100%, 620px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow: 0 28px 90px rgba(2, 6, 23, 0.55);
}

.modal-header {
  margin-bottom: 18px;
}

.universal-add-panel {
  width: min(100%, 660px);
}

.add-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.add-tab {
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
}

.add-tab.active {
  color: var(--bg);
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
}

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

.time-selector,
.pill-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  width: max-content;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}

.time-selector button,
.pill-selector button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 0;
  border-right: 1px solid var(--glass-border);
  line-height: 1;
}

.time-selector button:last-child,
.pill-selector button:last-child {
  border-right: 0;
}

.time-selector button.selected {
  color: var(--bg);
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  font-weight: 800;
}

.pill-selector button.selected {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.24);
}

.assignment-description {
  display: -webkit-box;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.link-preview-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  overflow: hidden;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-preview-card:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: 0 14px 28px rgba(2, 8, 23, 0.18);
}

.link-preview-card.pending {
  border-style: dashed;
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.05);
}

.link-preview-card.pending:hover {
  border-color: rgba(251, 191, 36, 0.85);
}

.link-preview-card.pending .link-preview-site {
  color: #f59e0b;
}

.link-preview-media-pending {
  color: #0f172a;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.link-preview-media-pending svg {
  width: 40px;
  height: 40px;
}

.link-preview-media {
  display: grid;
  place-items: center;
  min-height: 82px;
  overflow: hidden;
  color: #0f172a;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-size: 1.3rem;
  font-weight: 900;
}

.link-preview-media-google {
  background: #fff;
  padding: 14px;
}

.link-preview-media-google svg {
  width: 100%;
  height: 100%;
  max-width: 48px;
  max-height: 48px;
}

.link-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-preview-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 12px 14px 12px 0;
}

.link-preview-site {
  overflow: hidden;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.link-preview-body strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-preview-body span:not(.link-preview-site) {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.time-badge-icon {
  width: 13px;
  height: 13px;
  margin-right: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.verified-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34,197,94,0.12);
  color: #22c55e;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.gc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  text-decoration: none;
  cursor: pointer;
  background: rgba(15, 157, 88, 0.08);
  border: 1px solid rgba(15, 157, 88, 0.2);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.gc-badge:hover {
  background: rgba(15, 157, 88, 0.16);
  border-color: rgba(15, 157, 88, 0.35);
  box-shadow: 0 0 0 3px rgba(15, 157, 88, 0.15);
  transform: scale(1.1);
}
.gc-badge:focus-visible {
  outline: 2px solid #0F9D58;
  outline-offset: 2px;
  border-radius: 50%;
}

.gc-badge img {
  width: 14px;
  height: 14px;
  display: block;
}

.gc-view-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.875rem;
  color: #0F9D58;
  text-decoration: none;
  border: 1px solid #0F9D58;
  border-radius: 4px;
  padding: 4px 10px;
  transition: background 0.15s;
}
.gc-view-button:hover {
  background: rgba(15, 157, 88, 0.08);
}

.status-select {
  min-height: 34px;
  padding: 0 30px 0 12px;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 50%,
    calc(100% - 10px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

body.theme-light .status-select,
html[data-app-theme="light"] body .status-select {
  background-image:
    linear-gradient(45deg, transparent 50%, #0f172a 50%),
    linear-gradient(135deg, #0f172a 50%, transparent 50%);
}

.modal-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  row-gap: 8px;
  margin-top: 16px;
}

.settings-grid {
  display: grid;
  gap: 16px;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-stat-card {
  padding: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.2);
}

.admin-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1;
}

.admin-grid {
  display: grid;
  gap: 16px;
}

.admin-table-wrap {
  width: 100%;
  margin-top: 16px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--glass-border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-table td {
  color: var(--text);
  font-size: 0.88rem;
}

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

.preset-form {
  margin-top: 16px;
}

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

.preset-class {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.preset-class-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preset-class-head input[name="class_name"] {
  flex: 1;
  min-width: 160px;
}

.preset-row > input,
.preset-row > select {
  flex: 1;
  min-width: 120px;
}

.preset-row .days-selector {
  flex: 0 0 auto;
  min-width: fit-content;
}

.preset-actions {
  flex-wrap: wrap;
}

.preset-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.preset-card,
.preset-sync-box {
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.preset-card h3,
.preset-sync-box h3 {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.preset-card p,
.preset-sync-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.preset-row-list,
.preset-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.preset-row-list span,
.preset-preview-list span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.preset-sync-box {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.banner-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.banner-toggle {
  margin-bottom: 0;
}

.banner-color-row {
  display: grid;
  grid-template-columns: minmax(140px, 180px) 1fr;
  gap: 14px;
  align-items: end;
}

.banner-color-row input[type="color"] {
  width: 100%;
  min-height: 44px;
  padding: 4px;
}

.banner-preview {
  min-height: 44px;
  padding: 12px 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--banner-color, var(--primary)) 16%, var(--glass-bg));
  border: 1px solid color-mix(in srgb, var(--banner-color, var(--primary)) 42%, transparent);
  border-left: 5px solid var(--banner-color, var(--primary));
  border-radius: 16px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}

.preset-sync-form {
  margin-top: 0;
}

.preset-preview-title {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.settings-panel {
  padding: 0;
  overflow: hidden;
}

.settings-panel-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 18px;
  padding: 20px 22px;
  color: var(--text);
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
}

.settings-panel-trigger h2 {
  margin: 0;
}

.settings-panel-trigger p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.settings-panel-cue {
  flex: 0 0 auto;
  padding: 5px 11px;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}

.settings-panel-body {
  padding: 0 22px 22px;
}

.settings-panel-body[hidden] {
  display: none !important;
}

.section-heading-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.inline-form input,
.inline-form select {
  flex: 1;
  min-width: 120px;
}

.inline-form .days-selector {
  flex: 0 0 auto;
  min-width: fit-content;
}

[data-class-form].inline-form {
  flex-wrap: wrap;
}

.preset-class.inline-form {
  flex-wrap: nowrap;
}

[data-class-form].inline-form input[name="name"] {
  flex: 1 1 200px;
}

.task-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 170px) auto auto;
  align-items: center;
  gap: 10px;
}

.task-create-row input[name="task"] {
  min-width: 0;
}

.task-due-input {
  min-width: 0;
}

.task-row small,
.dashboard-task small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .task-create-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .task-create-row .task-due-input {
    grid-column: 1 / -1;
  }
}

.class-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.class-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  padding: 4px 6px 4px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  max-width: 100%;
}

.class-chip .days-selector {
  max-width: 100%;
}

.class-slot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
}

.class-slot-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.class-slot-row .days-selector {
  flex: 1 1 auto;
  min-width: 200px;
}

.class-slot-row input[type="time"] {
  min-width: 120px;
}

.container-inner .class-chip {
  max-width: 100%;
  box-sizing: border-box;
}

.class-chip-details {
  display: grid;
  gap: 2px;
}

.class-chip-details small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.chip-actions {
  display: inline-flex;
  gap: 6px;
}

.chip-input {
  width: 180px;
  max-width: 100%;
}

.chip-time-input {
  width: 116px;
  max-width: 100%;
}

.settings-stack {
  display: grid;
  gap: 16px;
}

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

.settings-form-row .field {
  margin-bottom: 0;
}

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

.settings-password-form {
  display: grid;
  gap: 12px;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  user-select: none;
}

.settings-toggle-row span:first-child {
  flex: 1;
  color: var(--text);
  font-weight: 700;
  font-size: 0.84rem;
}

.settings-toggle-row input {
  display: none;
}

.toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  background: var(--glass-border);
  border-radius: 12px;
  transition: background 0.2s;
}

.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  content: "";
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.settings-toggle-row input:checked + .toggle-track {
  background: var(--primary);
}

.settings-toggle-row input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: #fff;
}

.share-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.share-link-box input {
  min-height: 42px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  outline: none;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.share-card-settings-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.share-card-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  will-change: transform;
}

.share-card-setting .checkbox-field {
  margin: 0;
  color: var(--text);
  font-weight: 800;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.theme-switcher {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.theme-choice-button {
  gap: 8px;
}

.theme-choice-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-switcher .active,
.theme-choice-button.active {
  color: #0f172a;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-color: transparent;
}

.onboarding-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.onboarding-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.onboarding-card {
  position: relative;
  width: min(100%, 1080px);
  min-height: 680px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 18px;
  padding: 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: 0 32px 100px rgba(2, 6, 23, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.onboarding-progress {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.onboarding-progress span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.onboarding-progress span.active,
.onboarding-progress span.done {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.11);
  border-color: rgba(56, 189, 248, 0.22);
}

.onboarding-stage {
  opacity: 0;
  transform: translateY(10px) scale(0.99);
  transition: opacity 0.28s var(--motion), transform 0.28s var(--motion);
}

.onboarding-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  background: var(--card-bg, rgba(255,255,255,0.02));
  border-radius: 28px;
}

.onboarding-loading-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  animation: onboarding-spin 0.7s linear infinite;
}

@keyframes onboarding-spin {
  to { transform: rotate(360deg); }
}

.onboarding-loading-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding: 0 24px;
}

.onboarding-stage.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.onboarding-grid,
.onboarding-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 24px;
  align-items: stretch;
}

.onboarding-copy,
.onboarding-panel,
.onboarding-demo-card,
.onboarding-finish {
  min-height: 500px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
}

.onboarding-copy,
.onboarding-feature > div:first-child,
.onboarding-finish {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.onboarding-title {
  max-width: 640px;
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 4.2rem);
  font-weight: 850;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.onboarding-subtitle {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.65;
}

.onboarding-theme-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.onboarding-panel {
  display: grid;
  align-content: start;
  gap: 18px;
}

.onboarding-section h2,
.onboarding-demo-card h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.15rem;
}

.onboarding-preset-row {
  margin: 18px 0;
}

.onboarding-class-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.onboarding-class-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 16px;
}

.onboarding-class-row div {
  display: grid;
  gap: 3px;
}

.onboarding-class-row strong {
  color: var(--text);
}

.onboarding-class-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.onboarding-class-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 130px 130px auto;
  gap: 10px;
}

.onboarding-class-form input,
.onboarding-preset-row select {
  min-height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
}

.onboarding-demo-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: 18px;
  overflow: hidden;
}

.onboarding-demo-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 20px;
  pointer-events: none;
}

.onboarding-demo-card > * {
  position: relative;
}

.onboarding-demo-stat {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  color: var(--bg);
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-radius: 24px;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.28);
  font-size: 1.2rem;
  font-weight: 900;
}

.onboarding-demo-card ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-demo-card li {
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font-weight: 750;
}

.onboarding-finish {
  min-height: 500px;
  text-align: center;
  align-items: center;
}

.onboarding-finish-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.onboarding-finish-grid span {
  padding: 9px 14px;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
}

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

.dashboard-module {
  min-height: 220px;
}

.mini-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mini-assignment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--class-color, var(--glass-border));
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.mini-assignment:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.14);
}

.mini-assignment.due-soon {
  border-left: 3px solid #f97316;
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.14);
}

.mini-assignment.overdue,
.assignment-card.overdue-card {
  border-color: rgba(248, 113, 113, 0.36);
  border-left-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.08), 0 18px 46px rgba(127, 29, 29, 0.24);
}

.mini-assignment.overdue {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.12), rgba(255, 255, 255, 0.025) 38%);
}

.assignment-card.overdue-card {
  background:
    linear-gradient(90deg, rgba(239, 68, 68, 0.12), transparent 42%),
    var(--glass-bg);
}

.mini-assignment strong,
.mini-assignment span {
  display: block;
}

.mini-assignment > div {
  min-width: 0;
}

.mini-assignment strong {
  margin-bottom: 3px;
  font-size: 0.86rem;
}

.mini-assignment span {
  color: var(--muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.weekly-dashboard {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.weekly-dashboard-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.weekly-dashboard-row:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(56, 189, 248, 0.24);
}

.weekly-dashboard-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.weekly-dashboard-row strong {
  color: var(--text);
  font-size: 0.86rem;
}

.weekly-reset-note {
  margin: 10px 0 8px;
  padding: 9px 11px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
}

.weekly-row-cue {
  padding: 4px 9px;
  color: var(--primary) !important;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 999px;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
}

.calendar-module {
  grid-column: 1 / -1;
}

.calendar-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-module-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.calendar-module-cta,
.calendar-page-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-module-cta span {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.calendar-page-panel {
  padding: 24px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.calendar-page-grid {
  gap: 8px;
  margin-top: 18px;
}

.calendar-week-grid .calendar-cell {
  min-height: 92px;
}

.calendar-month-label {
  grid-column: 1 / -1;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.calendar-header {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.calendar-cell {
  min-height: 104px;
  padding: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

.calendar-page-grid .calendar-cell {
  min-height: 132px;
  padding: 10px;
}

.calendar-cell.today {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.22);
}

.calendar-cell.past {
  opacity: 0.58;
}

.calendar-cell.outside-month {
  opacity: 0.42;
}

.calendar-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 24px;
  margin-bottom: 6px;
  padding: 0 6px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.calendar-date:hover {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
}

.calendar-cell.today .calendar-date {
  color: var(--bg);
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
}

.calendar-chip {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  margin-top: 4px;
  padding: 4px 6px;
  color: var(--class-color, var(--primary));
  background: color-mix(in srgb, var(--class-color, var(--primary)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--class-color, var(--primary)) 24%, transparent);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
}

.calendar-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.calendar-chip.overdue-chip {
  color: #fecdd3;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.38);
  box-shadow: inset 3px 0 0 #ef4444, 0 0 14px rgba(239, 68, 68, 0.16);
}

.calendar-chip.weekly-chip {
  --class-color: #fbbf24;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.22);
  text-decoration: none;
}

.calendar-chip.weekly-chip::before {
  content: "W";
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  color: #0f172a;
  background: #fbbf24;
  border-radius: 4px;
  font-size: 0.54rem;
  font-weight: 900;
}

.assignment-chip {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.22);
}

.assignment-chip::before {
  content: "HW";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 14px;
  margin-right: 4px;
  color: #0f172a;
  background: #4ade80;
  border-radius: 4px;
  font-size: 0.54rem;
  font-weight: 900;
}

.test-chip {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.35);
}

.test-chip::before {
  content: "Test";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 14px;
  margin-right: 4px;
  color: #0f172a;
  background: #fbbf24;
  border-radius: 4px;
  font-size: 0.54rem;
  font-weight: 900;
}

.calendar-more {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 4px 6px;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: left;
}

.calendar-day-panel {
  max-width: 520px;
}

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

.calendar-day-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.calendar-day-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.detail-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.assignment-detail-panel,
.assignment-detail-panel * {
  min-width: 0;
}

.assignment-detail-panel h2,
.assignment-detail-panel .muted-copy,
.calendar-day-item strong,
.calendar-day-item span {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.confirm-panel {
  max-width: 420px;
}

.typed-confirm-field {
  margin: 16px 0 0;
}

.detail-status-label {
  display: grid;
  gap: 8px;
  max-width: 260px;
}

.detail-status-label select {
  min-height: 42px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font: inherit;
}

.project-marker {
  align-self: flex-start;
  padding: 5px 10px;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
}

.progress-block {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-radius: inherit;
}

.progress-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.task-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.task-list,
.edit-stack {
  display: grid;
  gap: 10px;
}

.task-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.88rem;
}

.dashboard-task-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.dashboard-task {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  text-align: left;
}

.dashboard-task input,
.dashboard-reminder input,
.reminder-check input,
.task-row input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.check-control {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--bg);
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(56, 189, 248, 0.34);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.check-control::after {
  width: 8px;
  height: 5px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: "";
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.8);
}

input:checked + .check-control {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-color: transparent;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.22);
}

input:checked + .check-control::after {
  opacity: 1;
}

.task-form {
  margin-top: 12px;
}

.note-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.note-form textarea,
.edit-stack textarea,
.spelling-row input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font: inherit;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.note-card {
  position: relative;
  min-height: 120px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
}

.reminder-card.completed,
.dashboard-reminder.completed {
  opacity: 0.68;
}

.reminder-card.completed .reminder-check span,
.dashboard-reminder.completed strong {
  text-decoration: line-through;
}

.reminder-check,
.dashboard-reminder {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  cursor: pointer;
}

.reminder-check span:not(.check-control) {
  padding-right: 30px;
  white-space: pre-wrap;
}

.note-card .icon-button {
  position: absolute;
  top: 10px;
  right: 10px;
}

.note-card p {
  margin: 0 28px 18px 0;
  white-space: pre-wrap;
}

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

/* Apple-style Reminders app */

.reminders-app {
  width: 100%;
}

.reminders-add-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 4px;
}

.reminders-add-card textarea {
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.5;
}

.reminders-add-card textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.reminders-add-options {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.reminders-bell-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}

.reminders-bell-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.reminders-bell-btn.active {
  color: var(--primary);
  background: rgba(56,189,248,0.1);
  border-color: var(--primary);
}

.reminders-datetime-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reminders-datetime-wrapper input[type="datetime-local"] {
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  color-scheme: dark;
}

.reminders-optional-tag {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  opacity: 0.6;
  white-space: nowrap;
}

.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reminders-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  transition: 0.12s;
  cursor: default;
}

.reminders-item:hover {
  background: rgba(255,255,255,0.03);
}

.reminders-item.completed {
  opacity: 0.55;
}

.reminders-circle {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
  position: relative;
}

.reminders-circle:hover {
  border-color: var(--primary);
}

.reminders-circle.checked {
  background: #22c55e;
  border-color: #22c55e;
}

.reminders-circle.checked::after {
  content: "";
  display: block;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.reminders-item-content {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.reminders-item-text {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.reminders-item.completed .reminders-item-text {
  text-decoration: line-through;
  color: var(--muted);
}

.reminders-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.reminders-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56,189,248,0.08);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.reminders-meta-badge.sent {
  background: rgba(34,197,94,0.1);
  color: #22c55e;
}

.reminders-meta-time {
  color: var(--muted);
  font-size: 0.7rem;
  opacity: 0.7;
}

.reminders-item-delete {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reminders-item:hover .reminders-item-delete {
  opacity: 0.5;
}

.reminders-item-delete:hover {
  opacity: 1 !important;
  color: #ef4444;
  background: rgba(239,68,68,0.08);
}

.reminders-item.fading {
  animation: reminder-fade 0.4s ease-out forwards;
}

.dashboard-reminder-row.fading {
  animation: dashboard-fade 0.4s ease-out forwards;
}

.dashboard-reminder-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
}

.dashboard-reminder-row.completed {
  opacity: 0.55;
}

.dashboard-reminder-circle {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
  padding: 0;
}

.dashboard-reminder-circle:hover {
  border-color: var(--primary);
}

.dashboard-reminder-circle.checked {
  background: #22c55e;
  border-color: #22c55e;
}

.dashboard-reminder-circle.checked::after {
  content: "";
  display: block;
  width: 5px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.dashboard-reminder-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dashboard-reminder-text {
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.4;
}

.dashboard-reminder-row.completed .dashboard-reminder-text {
  text-decoration: line-through;
  color: var(--muted);
}

.dashboard-reminder-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(56,189,248,0.08);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  width: fit-content;
}

.dashboard-reminder-badge.sent {
  background: rgba(34,197,94,0.1);
  color: #22c55e;
}

@keyframes reminder-fade {
  0% {
    opacity: 1;
    transform: scaleY(1);
    max-height: 80px;
    margin-bottom: 2px;
    padding: 12px 16px;
  }
  100% {
    opacity: 0;
    transform: scaleY(0.5);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
  }
}

@keyframes dashboard-fade {
  0% {
    opacity: 1;
    max-height: 60px;
    margin-bottom: 0;
    padding: 8px 0;
  }
  100% {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
  }
}

.reminders-clear-row {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.verse-card {
  margin: 14px 0 0;
  padding: 16px 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--primary);
  border-radius: 16px;
  line-height: 1.6;
}

.bible-pull {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 96px auto auto;
  gap: 10px;
  margin: 12px 0 8px;
}

.bible-pull .custom-dropdown {
  min-width: 96px;
  width: 96px;
}

.bible-pull .custom-dropdown-trigger {
  min-height: 42px;
}

.bible-pull input,
.bible-pull select {
  min-height: 42px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font: inherit;
}

.helper-text {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.verse-editor {
  min-height: 132px;
  width: 100%;
}

.edit-stack .inline-form {
  align-items: stretch;
}

.edit-stack .inline-form textarea {
  flex: 1 1 auto;
}

.weekly-table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.weekly-table th,
.weekly-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--glass-border);
  text-align: left;
}

.weekly-table th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spelling-row {
  display: grid;
  grid-template-columns: clamp(140px, 30%, 220px) minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
}

.spelling-row .spelling-definition {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spelling-row .spelling-definition input {
  min-width: 0;
  flex: 1 1 auto;
}

.cycle-definition {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
}

.cycle-definition:hover {
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.cycle-definition:focus-visible {
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
  outline: none;
}

.cycle-definition[hidden] {
  display: none;
}

.spelling-row.pulling .spelling-definition input {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  animation: spelling-pull-pulse 1.1s ease-in-out infinite;
}

@keyframes spelling-pull-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.spelling-helper {
  margin: 0 0 10px;
}

.spelling-actions {
  margin-top: 12px;
  flex-wrap: wrap;
}

.spelling-actions .spelling-actions-flex {
  flex: 1;
}

.archive-week-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.archive-week-button:hover {
  color: var(--primary);
}

.archive-week-button svg,
.archive-week-button .archive-week-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.archive-toggle,
.archive-row {
  width: 100%;
  min-height: 40px;
  color: var(--text);
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.archive-row {
  margin-top: 10px;
  padding: 10px 12px;
  color: var(--primary);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}

.archive-detail {
  padding: 10px 12px 0;
}

.danger-button {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.24);
}

.project-chip {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.24);
}

.project-chip::before {
  content: "P";
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  color: #0f172a;
  background: #c084fc;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 900;
}

.project-task-chip {
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.11);
  border-color: rgba(34, 211, 238, 0.24);
}

.project-task-chip::before {
  content: "T";
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  color: #0f172a;
  background: #67e8f9;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 900;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 220px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--primary);
  border-radius: 14px;
  box-shadow: 0 16px 45px rgba(2, 6, 23, 0.34);
  font-size: 0.86rem;
  font-weight: 800;
}

.toast-error {
  border-left-color: #f87171;
}

body.theme-light {
  --bg: #f6f8fb;
  --primary: #2563eb;
  --primary-deep: #1d4ed8;
  --secondary: #0891b2;
  --secondary-deep: #0e7490;
  --text: #172033;
  --muted: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.96);
  --glass-border: rgba(100, 116, 139, 0.18);
  --glass-strong: rgba(37, 99, 235, 0.18);
}

html[data-app-theme="light"] {
  --bg: #f6f8fb;
  --primary: #2563eb;
  --primary-deep: #1d4ed8;
  --secondary: #0891b2;
  --secondary-deep: #0e7490;
  --text: #172033;
  --muted: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.96);
  --glass-border: rgba(100, 116, 139, 0.18);
  --glass-strong: rgba(37, 99, 235, 0.18);
}

body.theme-dark {
  --bg: #030712;
  --primary: #93c5fd;
  --primary-deep: #3b82f6;
  --secondary: #64748b;
  --secondary-deep: #475569;
  --text: #f8fafc;
  --muted: #94a3b8;
  --glass-bg: rgba(8, 13, 24, 0.92);
  --glass-border: rgba(148, 163, 184, 0.1);
  --glass-strong: rgba(148, 163, 184, 0.18);
}

html[data-app-theme="dark"] {
  --bg: #030712;
  --primary: #93c5fd;
  --primary-deep: #3b82f6;
  --secondary: #64748b;
  --secondary-deep: #475569;
  --text: #f8fafc;
  --muted: #94a3b8;
  --glass-bg: rgba(8, 13, 24, 0.92);
  --glass-border: rgba(148, 163, 184, 0.1);
  --glass-strong: rgba(148, 163, 184, 0.18);
}

body.theme-wesley {
  --bg: #0f172a;
  --primary: #38bdf8;
  --primary-deep: #0ea5e9;
  --secondary: #818cf8;
  --secondary-deep: #6366f1;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.12);
}

html[data-app-theme="wesley"] {
  --bg: #0f172a;
  --primary: #38bdf8;
  --primary-deep: #0ea5e9;
  --secondary: #818cf8;
  --secondary-deep: #6366f1;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.12);
}

body.theme-light,
html[data-app-theme="light"] body {
  background: var(--bg);
}

body.theme-light::before,
html[data-app-theme="light"] body::before {
  background:
    radial-gradient(ellipse 70% 48% at 14% 10%, rgba(37, 99, 235, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 48% 54% at 86% 80%, rgba(8, 145, 178, 0.06) 0%, transparent 62%);
}

body.theme-light::after,
html[data-app-theme="light"] body::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(241, 245, 249, 0.5));
}

body.theme-dark,
html[data-app-theme="dark"] body {
  background: var(--bg);
}

body.theme-dark::before,
html[data-app-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 65% 45% at 18% 25%, rgba(30, 41, 59, 0.34) 0%, transparent 64%),
    radial-gradient(ellipse 46% 56% at 82% 74%, rgba(15, 23, 42, 0.54) 0%, transparent 68%);
}

body.theme-dark::after,
html[data-app-theme="dark"] body::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.62));
}

body.theme-light .top-nav,
body.theme-light .modal-panel,
body.theme-light .toast,
html[data-app-theme="light"] body .top-nav,
html[data-app-theme="light"] body .modal-panel,
html[data-app-theme="light"] body .toast {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(100, 116, 139, 0.16);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

body.theme-dark .top-nav,
body.theme-dark .modal-panel,
body.theme-dark .toast,
html[data-app-theme="dark"] body .top-nav,
html[data-app-theme="dark"] body .modal-panel,
html[data-app-theme="dark"] body .toast {
  background: rgba(3, 7, 18, 0.96);
}

body.theme-light .field input,
body.theme-light .field select,
body.theme-light .field textarea,
body.theme-light .toolbar select,
body.theme-light .inline-form input,
body.theme-light .inline-form select,
body.theme-light .chip-input,
body.theme-light .chip-time-input,
body.theme-light .reminders-datetime-wrapper input,
body.theme-light .reminders-add-card,
body.theme-light .reminder-datetime-row input,
body.theme-light .share-link-box input,
body.theme-light .note-form textarea,
body.theme-light .edit-stack textarea,
body.theme-light .spelling-row input,
body.theme-light .onboarding-class-form input,
body.theme-light .onboarding-preset-row select {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.22);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  color-scheme: light;
}

html[data-app-theme="light"] body .reminders-datetime-wrapper input,
html[data-app-theme="light"] body .reminders-add-card,
html[data-app-theme="light"] body .reminder-datetime-row input,
html[data-app-theme="light"] body .field input,
html[data-app-theme="light"] body .field select,
html[data-app-theme="light"] body .field textarea,
html[data-app-theme="light"] body .toolbar select,
html[data-app-theme="light"] body .inline-form input,
html[data-app-theme="light"] body .inline-form select,
html[data-app-theme="light"] body .chip-input,
html[data-app-theme="light"] body .chip-time-input,
html[data-app-theme="light"] body .share-link-box input,
html[data-app-theme="light"] body .note-form textarea,
html[data-app-theme="light"] body .edit-stack textarea,
html[data-app-theme="light"] body .spelling-row input,
html[data-app-theme="light"] body .onboarding-class-form input,
html[data-app-theme="light"] body .onboarding-preset-row select {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.22);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  color-scheme: light;
}

body.theme-dark .field input,
body.theme-dark .field select,
body.theme-dark .field textarea,
body.theme-dark .toolbar select,
body.theme-dark .inline-form input,
body.theme-dark .inline-form select,
body.theme-dark .chip-input,
body.theme-dark .chip-time-input,
body.theme-dark .reminders-datetime-wrapper input,
body.theme-dark .reminders-add-card,
body.theme-dark .reminder-datetime-row input,
body.theme-dark .share-link-box input,
body.theme-dark .note-form textarea,
body.theme-dark .edit-stack textarea,
body.theme-dark .spelling-row input,
body.theme-dark .onboarding-class-form input,
body.theme-dark .onboarding-preset-row select,
html[data-app-theme="dark"] body .field input,
html[data-app-theme="dark"] body .field select,
html[data-app-theme="dark"] body .field textarea,
html[data-app-theme="dark"] body .toolbar select,
html[data-app-theme="dark"] body .inline-form input,
html[data-app-theme="dark"] body .inline-form select,
html[data-app-theme="dark"] body .chip-input,
html[data-app-theme="dark"] body .chip-time-input,
html[data-app-theme="dark"] body .reminders-datetime-wrapper input,
html[data-app-theme="dark"] body .reminders-add-card,
html[data-app-theme="dark"] body .reminder-datetime-row input,
html[data-app-theme="dark"] body .share-link-box input,
html[data-app-theme="dark"] body .note-form textarea,
html[data-app-theme="dark"] body .edit-stack textarea,
html[data-app-theme="dark"] body .spelling-row input,
html[data-app-theme="dark"] body .onboarding-class-form input,
html[data-app-theme="dark"] body .onboarding-preset-row select {
  background: rgba(15, 23, 42, 0.68);
  border-color: rgba(148, 163, 184, 0.1);
}

body.theme-light .placeholder-card,
body.theme-light .app-panel,
body.theme-light .assignment-card,
body.theme-light .note-card,
body.theme-light .admin-stat-card,
body.theme-light .preset-card,
body.theme-light .preset-sync-box,
body.theme-light .calendar-cell,
body.theme-light .mini-assignment,
body.theme-light .weekly-dashboard-row,
body.theme-light .class-chip,
body.theme-light .settings-panel,
body.theme-light .share-card-setting,
body.theme-light .calendar-day-item,
body.theme-light .modal-panel,
body.theme-light .onboarding-card,
body.theme-light .onboarding-copy,
body.theme-light .onboarding-panel,
body.theme-light .onboarding-demo-card,
body.theme-light .onboarding-finish,
html[data-app-theme="light"] body .placeholder-card,
html[data-app-theme="light"] body .app-panel,
html[data-app-theme="light"] body .assignment-card,
html[data-app-theme="light"] body .note-card,
html[data-app-theme="light"] body .admin-stat-card,
html[data-app-theme="light"] body .preset-card,
html[data-app-theme="light"] body .preset-sync-box,
html[data-app-theme="light"] body .calendar-cell,
html[data-app-theme="light"] body .mini-assignment,
html[data-app-theme="light"] body .weekly-dashboard-row,
html[data-app-theme="light"] body .class-chip,
html[data-app-theme="light"] body .settings-panel,
html[data-app-theme="light"] body .share-card-setting,
html[data-app-theme="light"] body .calendar-day-item,
html[data-app-theme="light"] body .modal-panel,
html[data-app-theme="light"] body .onboarding-card,
html[data-app-theme="light"] body .onboarding-copy,
html[data-app-theme="light"] body .reminders-add-card,
html[data-app-theme="light"] body .onboarding-panel,
html[data-app-theme="light"] body .onboarding-demo-card,
html[data-app-theme="light"] body .onboarding-finish {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.16);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 24px rgba(15, 23, 42, 0.045);
}

body.theme-light .placeholder-card:hover,
body.theme-light .assignment-card:hover,
body.theme-light .mini-assignment:hover,
body.theme-light .weekly-dashboard-row:hover,
body.theme-light .calendar-day-item:hover,
html[data-app-theme="light"] body .placeholder-card:hover,
html[data-app-theme="light"] body .assignment-card:hover,
html[data-app-theme="light"] body .mini-assignment:hover,
html[data-app-theme="light"] body .weekly-dashboard-row:hover,
html[data-app-theme="light"] body .calendar-day-item:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.045), 0 12px 28px rgba(37, 99, 235, 0.07);
}

body.theme-light .link-preview-card,
html[data-app-theme="light"] body .link-preview-card {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.16);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 18px rgba(15, 23, 42, 0.045);
}

body.theme-light .link-preview-card:hover,
html[data-app-theme="light"] body .link-preview-card:hover {
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.045), 0 12px 28px rgba(37, 99, 235, 0.07);
}

body.theme-light .link-preview-site,
html[data-app-theme="light"] body .link-preview-site {
  color: #2563eb;
}

body.theme-dark .placeholder-card:hover,
body.theme-dark .assignment-card:hover,
html[data-app-theme="dark"] body .placeholder-card:hover,
html[data-app-theme="dark"] body .assignment-card:hover {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
}

body.theme-light .auth-card,
html[data-app-theme="light"] body .auth-card {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(100, 116, 139, 0.16);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 40px rgba(15, 23, 42, 0.08);
}

body.theme-light .auth-card::before,
body.theme-light .placeholder-card::before,
body.theme-light .loading-text::before,
html[data-app-theme="light"] body .auth-card::before,
html[data-app-theme="light"] body .placeholder-card::before,
html[data-app-theme="light"] body .loading-text::before {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.045), transparent 48%, rgba(8, 145, 178, 0.035));
  opacity: 1;
}

body.theme-light .top-nav,
html[data-app-theme="light"] body .top-nav {
  background: rgba(255, 255, 255, 0.9);
}

body.theme-light .nav-links a.active,
html[data-app-theme="light"] body .nav-links a.active {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.16);
}

body.theme-light .nav-links a:hover,
body.theme-light .logout-button:hover,
html[data-app-theme="light"] body .nav-links a:hover,
html[data-app-theme="light"] body .logout-button:hover {
  color: var(--text);
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.14);
}

body.theme-light .primary-button,
html[data-app-theme="light"] body .primary-button {
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

body.theme-light .primary-button:hover,
html[data-app-theme="light"] body .primary-button:hover {
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}

body.theme-light .secondary-button,
body.theme-light .icon-button,
body.theme-light .settings-panel-cue,
body.theme-light .weekly-row-cue,
body.theme-light .add-tabs,
html[data-app-theme="light"] body .secondary-button,
html[data-app-theme="light"] body .icon-button,
html[data-app-theme="light"] body .settings-panel-cue,
html[data-app-theme="light"] body .weekly-row-cue,
html[data-app-theme="light"] body .add-tabs {
  background: rgba(37, 99, 235, 0.055);
  border-color: rgba(37, 99, 235, 0.18);
}

body.theme-light .add-tab.active,
html[data-app-theme="light"] body .add-tab.active {
  color: #ffffff;
}

body.theme-light .modal-overlay,
html[data-app-theme="light"] body .modal-overlay {
  background: rgba(15, 23, 42, 0.28);
}

body.theme-light .calendar-cell.today,
html[data-app-theme="light"] body .calendar-cell.today {
  background: rgba(37, 99, 235, 0.065);
  border-color: rgba(37, 99, 235, 0.26);
}

body.theme-light .calendar-cell.past,
html[data-app-theme="light"] body .calendar-cell.past {
  opacity: 0.72;
}

body.theme-light .calendar-cell.outside-month,
html[data-app-theme="light"] body .calendar-cell.outside-month {
  background: rgba(248, 250, 252, 0.72);
  opacity: 0.68;
}

body.theme-light .mini-assignment,
body.theme-light .weekly-dashboard-row,
body.theme-light .calendar-cell,
body.theme-light .class-chip,
body.theme-light .share-card-setting,
body.theme-light .pending-notice,
body.theme-light .preset-card,
body.theme-light .preset-sync-box,
html[data-app-theme="light"] body .mini-assignment,
html[data-app-theme="light"] body .weekly-dashboard-row,
html[data-app-theme="light"] body .calendar-cell,
html[data-app-theme="light"] body .class-chip,
html[data-app-theme="light"] body .share-card-setting,
html[data-app-theme="light"] body .pending-notice,
html[data-app-theme="light"] body .preset-card,
html[data-app-theme="light"] body .preset-sync-box {
  background: rgba(255, 255, 255, 0.86);
}

body.theme-light .note-card,
html[data-app-theme="light"] body .note-card {
  background: #ffffff;
}

body.theme-light .check-control,
html[data-app-theme="light"] body .check-control {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

body.theme-light input:checked + .check-control,
html[data-app-theme="light"] body input:checked + .check-control {
  color: #ffffff;
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.16);
}

body.theme-light input:checked + .check-control::after,
html[data-app-theme="light"] body input:checked + .check-control::after {
  border-color: #ffffff;
  opacity: 1;
}

body.theme-light .calendar-chip,
html[data-app-theme="light"] body .calendar-chip {
  background: color-mix(in srgb, var(--class-color, var(--primary)) 10%, white);
  border-color: color-mix(in srgb, var(--class-color, var(--primary)) 22%, white);
}

body.theme-light .field input:focus,
body.theme-light .field textarea:focus,
body.theme-light .field select:focus,
body.theme-light .toolbar select:focus,
body.theme-light .inline-form select:focus,
html[data-app-theme="light"] body .field input:focus,
html[data-app-theme="light"] body .field textarea:focus,
html[data-app-theme="light"] body .field select:focus,
html[data-app-theme="light"] body .toolbar select:focus,
html[data-app-theme="light"] body .inline-form select:focus {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

body.theme-light .weekly-table,
body.theme-light .spelling-table,
html[data-app-theme="light"] body .weekly-table,
html[data-app-theme="light"] body .spelling-table {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.16);
}

body.theme-light .weekly-table th,
body.theme-light .spelling-table th,
html[data-app-theme="light"] body .weekly-table th,
html[data-app-theme="light"] body .spelling-table th {
  background: #f8fafc;
  color: #64748b;
}

body.theme-light .weekly-table td,
body.theme-light .spelling-table td,
html[data-app-theme="light"] body .weekly-table td,
html[data-app-theme="light"] body .spelling-table td {
  border-color: rgba(100, 116, 139, 0.12);
}

body.theme-light .task-panel,
html[data-app-theme="light"] body .task-panel {
  border-color: rgba(100, 116, 139, 0.14);
}

body.theme-light .progress-track,
html[data-app-theme="light"] body .progress-track {
  background: rgba(100, 116, 139, 0.16);
}

body.theme-light .verse-card,
body.theme-light .archive-row,
body.theme-light .share-link-box input,
html[data-app-theme="light"] body .verse-card,
html[data-app-theme="light"] body .archive-row,
html[data-app-theme="light"] body .share-link-box input {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.16);
}

body.theme-light .auth-card,
body.theme-light .placeholder-card,
body.theme-light .loading-text,
body.theme-light .shell-panel,
body.theme-light .modal-panel,
html[data-app-theme="light"] body .auth-card,
html[data-app-theme="light"] body .placeholder-card,
html[data-app-theme="light"] body .loading-text,
html[data-app-theme="light"] body .shell-panel,
html[data-app-theme="light"] body .modal-panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.theme-light .project-chip,
html[data-app-theme="light"] body .project-chip {
  color: #7e22ce;
  background: rgba(168, 85, 247, 0.09);
  border-color: rgba(126, 34, 206, 0.18);
}

body.theme-light .project-chip::before,
html[data-app-theme="light"] body .project-chip::before {
  color: #ffffff;
  background: #8b5cf6;
}

body.theme-light .project-task-chip,
html[data-app-theme="light"] body .project-task-chip {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.09);
  border-color: rgba(3, 105, 161, 0.18);
}

body.theme-light .project-task-chip::before,
html[data-app-theme="light"] body .project-task-chip::before {
  color: #ffffff;
  background: #0284c7;
}

body.theme-light .assignment-chip,
html[data-app-theme="light"] body .assignment-chip {
  color: #15803d;
  background: rgba(22, 163, 74, 0.09);
  border-color: rgba(22, 163, 74, 0.18);
}

body.theme-light .assignment-chip::before,
html[data-app-theme="light"] body .assignment-chip::before {
  color: #ffffff;
  background: #16a34a;
}

body.theme-light .calendar-chip.weekly-chip,
html[data-app-theme="light"] body .calendar-chip.weekly-chip {
  color: #92400e;
  background: rgba(217, 119, 6, 0.09);
  border-color: rgba(146, 64, 14, 0.18);
}

body.theme-light .calendar-chip.weekly-chip::before,
html[data-app-theme="light"] body .calendar-chip.weekly-chip::before {
  color: #ffffff;
  background: #d97706;
}

body.theme-light .time-low,
body.theme-light .status-completed,
html[data-app-theme="light"] body .time-low,
html[data-app-theme="light"] body .status-completed {
  color: #15803d;
  background: rgba(22, 163, 74, 0.09);
  border-color: rgba(22, 163, 74, 0.18);
}

body.theme-light .time-mid,
body.theme-light .status-almost_done,
html[data-app-theme="light"] body .time-mid,
html[data-app-theme="light"] body .status-almost_done {
  color: #b45309;
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.18);
}

body.theme-light .time-high,
html[data-app-theme="light"] body .time-high {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.16);
}

body.theme-light .danger-button,
body.theme-light .icon-button.danger,
html[data-app-theme="light"] body .danger-button,
html[data-app-theme="light"] body .icon-button.danger {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.055);
  border-color: rgba(220, 38, 38, 0.18);
}

body.theme-light .status-in_progress,
html[data-app-theme="light"] body .status-in_progress {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18);
}

body.theme-light .status-not_started,
body.theme-light .class-badge.no-class,
html[data-app-theme="light"] body .status-not_started,
html[data-app-theme="light"] body .class-badge.no-class {
  color: #64748b;
  background: rgba(100, 116, 139, 0.08);
  border-color: rgba(100, 116, 139, 0.16);
}

body.theme-light .status-select,
html[data-app-theme="light"] body .status-select {
  background-image:
    linear-gradient(45deg, transparent 50%, #0f172a 50%),
    linear-gradient(135deg, #0f172a 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 50%,
    calc(100% - 10px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

body.theme-light .class-badge,
body.theme-light .calendar-chip,
html[data-app-theme="light"] body .class-badge,
html[data-app-theme="light"] body .calendar-chip {
  color: color-mix(in srgb, var(--class-color, var(--primary)) 68%, #0f172a);
}

body.theme-light .assignment-chip,
html[data-app-theme="light"] body .assignment-chip {
  color: #15803d;
}

body.theme-light .project-chip,
html[data-app-theme="light"] body .project-chip {
  color: #7e22ce;
}

body.theme-light .project-task-chip,
html[data-app-theme="light"] body .project-task-chip {
  color: #0369a1;
}

body.theme-light .calendar-chip.weekly-chip,
html[data-app-theme="light"] body .calendar-chip.weekly-chip {
  color: #92400e;
}

body.theme-light .project-marker,
html[data-app-theme="light"] body .project-marker {
  color: #4338ca;
  background: rgba(99, 102, 241, 0.09);
  border-color: rgba(67, 56, 202, 0.18);
}

body.theme-light .project-chip,
html[data-app-theme="light"] body .project-chip {
  color: #4338ca;
  background: rgba(99, 102, 241, 0.09);
  border-color: rgba(67, 56, 202, 0.18);
}

body.theme-light .project-chip::before,
html[data-app-theme="light"] body .project-chip::before {
  background: #4f46e5;
}

body.theme-light .mini-assignment.due-soon,
html[data-app-theme="light"] body .mini-assignment.due-soon {
  border-left-color: #d97706;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 22px rgba(217, 119, 6, 0.08);
}

body.theme-light .due-overdue,
html[data-app-theme="light"] body .due-overdue {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(185, 28, 28, 0.24);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 18px rgba(220, 38, 38, 0.09);
}

body.theme-light .due-overdue::before,
html[data-app-theme="light"] body .due-overdue::before {
  color: #ffffff;
  background: #dc2626;
}

body.theme-light .mini-assignment.overdue,
body.theme-light .assignment-card.overdue-card,
html[data-app-theme="light"] body .mini-assignment.overdue,
html[data-app-theme="light"] body .assignment-card.overdue-card {
  border-color: rgba(185, 28, 28, 0.2);
  border-left-color: #dc2626;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 28px rgba(220, 38, 38, 0.09);
}

body.theme-light .mini-assignment.overdue,
html[data-app-theme="light"] body .mini-assignment.overdue {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.08), #ffffff 42%);
}

body.theme-light .assignment-card.overdue-card,
html[data-app-theme="light"] body .assignment-card.overdue-card {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.07), #ffffff 38%);
}

body.theme-light .calendar-chip.overdue-chip,
html[data-app-theme="light"] body .calendar-chip.overdue-chip {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.09);
  border-color: rgba(185, 28, 28, 0.22);
  box-shadow: inset 3px 0 0 #dc2626;
}

body.theme-light .calendar-more,
html[data-app-theme="light"] body .calendar-more {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.16);
}

body.theme-dark .auth-card,
html[data-app-theme="dark"] body .auth-card {
  background: rgba(8, 13, 24, 0.94);
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .top-nav {
    align-items: center;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }

  .nav-links a,
  .logout-button {
    min-height: 36px;
    padding: 0 12px;
  }

  .page {
    padding-top: 154px;
  }
}

@media (max-width: 720px) {
  .auth-card {
    padding: 26px;
  }

  .auth-card h1 {
    letter-spacing: -0.06em;
  }

  .top-nav {
    padding: 12px;
  }

  .nav-links {
    gap: 6px;
  }

  .nav-links a,
  .logout-button {
    flex: 0 0 auto;
    font-size: 0.78rem;
  }

  .page {
    width: min(100% - 28px, 1120px);
    padding-top: 176px;
  }

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

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

  .dashboard-page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-add-button {
    align-self: flex-start;
  }

  .dashboard-header-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .placeholder-card {
    min-height: 116px;
    padding: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .onboarding-shell {
    min-height: 100vh;
    padding: 16px;
  }

  .onboarding-card {
    min-height: auto;
    padding: 18px;
    border-radius: 22px;
  }

  .onboarding-progress {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .onboarding-progress span {
    min-height: 28px;
    font-size: 0;
  }

  .onboarding-progress span::before {
    content: "";
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 999px;
  }

  .onboarding-grid,
  .onboarding-feature {
    grid-template-columns: 1fr;
  }

  .onboarding-copy,
  .onboarding-panel,
  .onboarding-demo-card,
  .onboarding-finish {
    min-height: auto;
    padding: 20px;
  }

  .onboarding-title {
    font-size: 2.15rem;
  }

  .onboarding-class-form {
    grid-template-columns: 1fr;
  }

  .onboarding-actions {
    justify-content: stretch;
  }

  .onboarding-actions .secondary-button,
  .onboarding-actions .primary-button {
    flex: 1 1 0;
  }

  .spelling-row {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .spelling-row .spelling-definition {
    grid-column: 1 / -1;
  }

  .bible-pull {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    gap: 4px;
  }

  .calendar-cell {
    min-height: 70px;
    padding: 6px;
  }

  .calendar-page-panel {
    padding: 16px;
  }

  .calendar-page-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .calendar-page-grid .calendar-header,
  .calendar-page-grid .calendar-cell.outside-month {
    display: none;
  }

  .calendar-page-grid .calendar-cell {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: start;
    min-height: auto;
    padding: 10px;
  }

  .calendar-page-grid .calendar-date {
    width: 34px;
    min-width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
  }

  .calendar-page-grid .calendar-chip,
  .calendar-page-grid .calendar-more {
    grid-column: 2;
    min-height: 32px;
    margin-top: 0;
    margin-bottom: 6px;
    padding: 8px 10px;
    font-size: 0.76rem;
  }

  .calendar-page-grid .calendar-chip:last-child,
  .calendar-page-grid .calendar-more:last-child {
    margin-bottom: 0;
  }

  .calendar-module-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-module-cta,
  .calendar-page-controls {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
  }

  .inline-form {
    flex-direction: column;
  }
}

/* Compact onboarding overrides. Keep this block after all responsive rules. */
.onboarding-page {
  min-height: 100vh;
}

.onboarding-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.onboarding-card {
  width: min(100%, 860px);
  min-height: auto;
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 16px;
  padding: 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(2, 6, 23, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.onboarding-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
}

.onboarding-progress span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.onboarding-progress span.active,
.onboarding-progress span.done {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.11);
  border-color: rgba(56, 189, 248, 0.22);
}

.onboarding-stage {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s var(--motion), transform 0.22s var(--motion);
  overflow-y: auto;
  min-height: 0;
}

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

.onboarding-simple {
  display: grid;
  align-content: start;
  gap: 16px;
}

.onboarding-simple.centered {
  place-items: center;
  text-align: center;
}

.onboarding-welcome-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.onboarding-welcome-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(56, 189, 248, 0.28));
}

.welcome-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.onboarding-title {
  max-width: 640px;
  margin: 0;
  color: var(--text);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.05em;
}

.onboarding-subtitle {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.55;
}

.onboarding-mini-grid,
.onboarding-preview-grid,
.onboarding-theme-cards {
  display: grid;
  gap: 12px;
}

.onboarding-mini-grid,
.onboarding-theme-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.onboarding-mini-grid section,
.onboarding-section-card,
.onboarding-theme-card,
.onboarding-preview-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
}

.onboarding-mini-grid section {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.onboarding-mini-grid strong,
.onboarding-theme-card strong,
.onboarding-preview-top strong,
.onboarding-class-row strong {
  color: var(--text);
}

.onboarding-mini-grid span,
.onboarding-theme-card span,
.onboarding-preview-top span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
}

.onboarding-section-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.onboarding-divider {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 4px 0;
}

.onboarding-connect-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  align-items: center;
}

.onboarding-connect-icon {
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(15, 157, 88, 0.12);
  flex-shrink: 0;
}

.onboarding-connect-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.onboarding-connect-status {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.onboarding-connect-status.connected {
  color: #22c55e;
}

.onboarding-prefs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.onboarding-pref-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.onboarding-pref-toggle input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.onboarding-gc-links-section {
  border-top: 1px solid var(--glass-border);
  padding-top: 12px;
}

.onboarding-gc-links-list {
  display: grid;
  gap: 12px;
}

.onboarding-gc-link-row {
  display: grid;
  gap: 6px;
}

.onboarding-gc-link-name {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 700;
}

.onboarding-gc-select-wrap {
  position: relative;
}

.onboarding-gc-select-wrap::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.onboarding-gc-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  padding: 0 32px 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s;
}

.onboarding-gc-select:hover {
  border-color: var(--muted);
}

.onboarding-gc-select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.onboarding-preset-row,
.onboarding-manual-class {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.onboarding-manual-class input,
.onboarding-preset-row select {
  min-height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
}

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

.onboarding-class-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 14px;
}

.onboarding-theme-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.onboarding-theme-card.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border-color: color-mix(in srgb, var(--primary) 28%, transparent);
}

body.theme-dark .onboarding-theme-card.active,
html[data-app-theme="dark"] body .onboarding-theme-card.active {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--primary);
}

body.theme-light .onboarding-theme-card.active,
html[data-app-theme="light"] body .onboarding-theme-card.active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.2);
  color: #2563eb;
}

body.theme-light .onboarding-feature-card,
html[data-app-theme="light"] body .onboarding-feature-card {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(100, 116, 139, 0.15);
}

body.theme-dark .onboarding-feature-card,
html[data-app-theme="dark"] body .onboarding-feature-card {
  background: rgba(148, 163, 184, 0.03);
}

.onboarding-preview-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.onboarding-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.onboarding-preview-top span {
  padding: 4px 8px;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 999px;
}

.onboarding-preview-lines {
  display: grid;
  gap: 7px;
}

.onboarding-preview-lines p {
  margin: 0;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 750;
}

/* ----- onboarding feature cards (landing page style) ----- */

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

.onboarding-feature-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.onboarding-feature-card:hover {
  transform: translateY(-2px);
}

.ob-preview {
  height: 90px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.ob-feature-body {
  padding: 12px 14px 14px;
}

.ob-feature-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.ob-feature-desc {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

/* Dashboard preview */
.ob-dashboard {
  background: rgba(15, 23, 42, 0.2);
  padding: 0;
  gap: 0;
}

.ob-dm-topbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid var(--glass-border);
}

.ob-dm-nav-item {
  width: 28px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.ob-dm-nav-item.active {
  background: rgba(56, 189, 248, 0.2);
}

.ob-dm-nav-spacer {
  flex: 1;
}

.ob-dm-nav-ico {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.ob-dm-nav-ico.out {
  background: rgba(129, 140, 248, 0.15);
}

.ob-dm-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
}

.ob-dm-eyebrow {
  font-size: 6px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: block;
}

.ob-dm-heading {
  font-size: 10px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.ob-dm-add {
  margin-left: auto;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  color: var(--bg);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  flex-shrink: 0;
}

.ob-dm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 0 10px 8px;
}

.ob-dm-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  padding: 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ob-dm-card-title {
  font-size: 6px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ob-dm-assign {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ob-dm-badge {
  font-size: 5px;
  font-weight: 700;
  color: var(--c, var(--primary));
  background: color-mix(in srgb, var(--c, var(--primary)) 12%, transparent);
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}

.ob-dm-title {
  font-size: 6px;
  font-weight: 600;
  color: var(--text-2);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ob-dm-prog {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.ob-dm-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.ob-dm-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ob-dm-label {
  font-size: 6px;
  font-weight: 600;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Assignments preview */
.ob-assignments {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ob-assign-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  padding: 4px 7px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ob-badge {
  font-size: 6px;
  font-weight: 800;
  color: var(--c, var(--primary));
  background: color-mix(in srgb, var(--c, var(--primary)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--primary)) 26%, transparent);
  padding: 1px 5px;
  border-radius: 999px;
  flex-shrink: 0;
}

.ob-assign-title {
  font-size: 7px;
  font-weight: 600;
  color: var(--text-2);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ob-due {
  font-size: 6px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  flex-shrink: 0;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.ob-due.soon {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.ob-book-ref {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 6px;
  align-self: flex-start;
  margin: 0 2px;
}

.ob-book-ref span {
  font-size: 6px;
  font-weight: 600;
  color: var(--primary);
}

.ob-book-icon {
  font-size: 8px;
}

/* Projects preview */
.ob-projects {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ob-proj-marker {
  font-size: 5px;
  font-weight: 800;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.2);
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: flex-start;
}

.ob-proj-name {
  font-size: 8px;
  font-weight: 700;
  color: var(--text-2);
}

.ob-prog-bar {
  height: 5px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  overflow: hidden;
}

.ob-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
}

.ob-task-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--glass-border);
  padding-top: 3px;
  margin-top: 2px;
}

.ob-task-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px;
  align-items: center;
  font-size: 6px;
  color: var(--muted);
  cursor: default;
}

.ob-task-row input[type="checkbox"] {
  display: none;
}

.ob-check {
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--glass-strong);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ob-task-row input:checked + .ob-check {
  background: var(--primary);
  border-color: var(--primary);
}

.ob-task-row input:checked + .ob-check::after {
  content: '✓';
  font-size: 5px;
  color: var(--bg);
  font-weight: 800;
  line-height: 1;
}

.ob-task-row input:checked ~ span {
  text-decoration: line-through;
  opacity: 0.5;
}

/* Calendar preview */
.ob-calendar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ob-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.ob-cal-week span {
  font-size: 7px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.ob-cal-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ob-cal-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.ob-cal-row span {
  font-size: 7px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding: 2px 1px;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 16px;
}

.ob-today {
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary) !important;
  font-weight: 800 !important;
}

.ob-chip {
  font-size: 4px;
  font-weight: 800;
  padding: 1px 2px;
  border-radius: 2px;
  line-height: 1.2;
  background: rgba(56, 189, 248, 0.2);
  color: var(--primary);
  display: inline-block;
}

.ob-chip.p {
  background: rgba(129, 140, 248, 0.2);
  color: var(--secondary);
}

.ob-chip.w {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

/* Weekly preview */
.ob-weekly {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ob-quote {
  font-size: 8px;
  font-style: italic;
  color: var(--muted);
  padding: 6px 8px;
  border-left: 2px solid var(--primary);
  background: rgba(56, 189, 248, 0.04);
  border-radius: 0 6px 6px 0;
  line-height: 1.3;
}

.ob-spelling {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  overflow: hidden;
}

.ob-spell-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 6px;
  padding: 2px 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ob-spell-row:last-child {
  border-bottom: 0;
}

.ob-spell-word {
  font-weight: 600;
  color: var(--text-2);
}

.ob-spell-def {
  color: var(--muted);
}

/* ShareView preview */
.ob-shareview {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ob-share-header {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ob-share-eyebrow {
  font-size: 6px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ob-share-title {
  font-size: 9px;
  font-weight: 800;
  color: var(--text);
}

.ob-share-row {
  display: flex;
  gap: 4px;
}

.ob-share-mini {
  flex: 1;
  padding: 5px 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ob-share-mini-hdr {
  font-size: 6px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ob-share-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ob-share-item strong {
  font-size: 6px;
  font-weight: 700;
  color: var(--text-2);
}

.ob-share-item span {
  font-size: 5px;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 550px) {
  .onboarding-preview-grid {
    grid-template-columns: 1fr;
  }
}

/* light theme adjustments */
body.theme-light .ob-dashboard,
html[data-app-theme="light"] body .ob-dashboard {
  background: #f1f5f9;
}
body.theme-light .ob-dm-topbar,
html[data-app-theme="light"] body .ob-dm-topbar {
  background: #e2e8f0;
}
body.theme-light .ob-dm-nav-item,
html[data-app-theme="light"] body .ob-dm-nav-item {
  background: rgba(0, 0, 0, 0.06);
}
body.theme-light .ob-dm-nav-item.active,
html[data-app-theme="light"] body .ob-dm-nav-item.active {
  background: rgba(37, 99, 235, 0.15);
}
body.theme-light .ob-dm-card,
html[data-app-theme="light"] body .ob-dm-card {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(100, 116, 139, 0.15);
}

.onboarding-terms-step {
  min-height: min(62vh, 560px);
}

.onboarding-terms-panel {
  min-height: 0;
  max-height: min(48vh, 430px);
  overflow: auto;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  scrollbar-color: var(--primary) rgba(255, 255, 255, 0.06);
}

.terms-content {
  display: grid;
  gap: 12px;
}

.terms-content h1,
.terms-content h2,
.terms-content h3,
.terms-content p {
  margin: 0;
}

.terms-content h1 {
  color: var(--text);
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.terms-content h2 {
  padding-top: 8px;
  color: var(--text);
  font-size: 1rem;
}

.terms-content p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.6;
}

.terms-privacy-panel {
  width: min(720px, calc(100vw - 28px));
}

.terms-privacy-scroll {
  max-height: min(62vh, 620px);
  overflow: auto;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
}

body.theme-light .terms-privacy-scroll,
html[data-app-theme="light"] body .terms-privacy-scroll {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.16);
}

.terms-admin-form {
  display: grid;
  gap: 12px;
}

.terms-admin-form textarea {
  min-height: 320px;
  resize: vertical;
  font-family: "Space Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
}

body.theme-light .onboarding-mini-grid section,
body.theme-light .onboarding-section-card,
body.theme-light .onboarding-theme-card,
body.theme-light .onboarding-preview-card,
body.theme-light .onboarding-preview-lines p,
body.theme-light .onboarding-terms-panel,
html[data-app-theme="light"] body .onboarding-mini-grid section,
html[data-app-theme="light"] body .onboarding-section-card,
html[data-app-theme="light"] body .onboarding-theme-card,
html[data-app-theme="light"] body .onboarding-preview-card,
html[data-app-theme="light"] body .onboarding-preview-lines p,
html[data-app-theme="light"] body .onboarding-terms-panel {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.16);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}

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

@media (max-width: 720px) {
  .onboarding-shell {
    padding: 14px;
  }

  .onboarding-card {
    padding: 16px;
    border-radius: 20px;
  }

  .onboarding-progress span {
    min-height: 26px;
    font-size: 0;
  }

  .onboarding-progress span::before {
    content: "";
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 999px;
  }

  .onboarding-simple {
    min-height: auto;
  }

  .onboarding-mini-grid,
  .onboarding-theme-cards,
  .onboarding-preview-grid,
  .onboarding-preset-row,
  .onboarding-manual-class {
    grid-template-columns: 1fr;
  }

  .onboarding-actions {
    justify-content: stretch;
  }

  .onboarding-actions .secondary-button,
  .onboarding-actions .primary-button {
    flex: 1 1 0;
  }
}

/* ==============================
   Textbooks Page
   ============================== */

.textbooks-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.textbooks-header .select-wrap {
  position: relative;
  min-width: 200px;
}

.textbooks-header .select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 40px;
  padding: 0 36px 0 14px;
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  outline: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.textbooks-header .select-wrap select:hover {
  border-color: rgba(56,189,248,0.45);
  background: rgba(255,255,255,0.05);
}

.textbooks-header .select-wrap select:focus {
  border-color: rgba(56,189,248,0.55);
  box-shadow: 0 0 0 4px rgba(56,189,248,0.13);
}

.textbooks-header .select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.textbooks-header .select-wrap select option {
  background: var(--bg);
  color: var(--text);
}

.textbooks-panel {
  padding: 24px;
}

.textbooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.textbook-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  transition: transform 0.25s cubic-bezier(.2,.8,.3,1), border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  animation: textbookRise 0.5s cubic-bezier(.2,.8,.3,1) backwards;
}

.textbook-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,0.45);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.5), 0 0 0 1px rgba(56,189,248,0.12), 0 0 24px -4px rgba(56,189,248,0.35);
  background: rgba(255,255,255,0.08);
}

.textbook-thumb-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  background: radial-gradient(120% 100% at 50% 0%, rgba(56,189,248,0.08), transparent 60%), var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-bottom: 1px solid var(--glass-border);
}

.textbook-thumb-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,0.55);
}

.textbook-grade-tags {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.textbook-grade-tag {
  font-family: "Space Mono", monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a1305;
  background: #fbbf24;
  padding: 4px 8px;
  border-radius: 8px;
  box-shadow: 0 4px 10px -2px rgba(251,191,36,0.4);
}

body.theme-light .textbook-grade-tag {
  color: #1a1305;
}

.textbook-card-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.textbook-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  margin: 0;
  flex: 1;
}

.textbook-open-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(56,189,248,0.16);
  color: var(--primary);
  border: 1px solid rgba(56,189,248,0.3);
  font-weight: 600;
  font-size: 0.84rem;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.textbook-open-btn:hover {
  background: var(--primary);
  color: var(--bg);
  box-shadow: 0 0 22px -2px rgba(56,189,248,0.35);
}

.textbook-open-btn:active { transform: scale(0.97); }

.textbook-open-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.textbooks-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.textbooks-state h2 {
  color: var(--text);
  font-size: 1.2rem;
  margin: 14px 0 6px;
}

.textbooks-state p { font-size: 0.84rem; margin: 0; }

.textbooks-state-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

/* skeleton */
.skel-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.skel-thumb {
  aspect-ratio: 3/4;
  background: linear-gradient(100deg, rgba(255,255,255,0.03) 30%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

.skel-line {
  height: 12px;
  margin: 16px;
  border-radius: 6px;
  background: linear-gradient(100deg, rgba(255,255,255,0.03) 30%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

.skel-line.short { width: 50%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

/* ==============================
   Request a PDF
   ============================== */

.textbooks-header-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.textbooks-header-actions .button-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  flex-shrink: 0;
}

.textbook-request-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin: -6px 0 18px;
}

.textbook-request-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.textbook-request-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.textbook-request-form .field-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 7px;
}

.textbook-request-form .field textarea {
  min-height: 88px;
  resize: vertical;
}

.textbooks-optional {
  color: var(--muted);
  font-weight: 500;
  text-transform: lowercase;
  opacity: 0.7;
}

.textbook-request-status {
  min-height: 20px;
  margin: 0;
  font-size: 0.83rem;
}

.textbook-request-status[data-state="error"] {
  color: var(--danger, #ef4444);
}

.textbook-request-status[data-state="success"] {
  color: var(--primary);
}

@media (max-width: 560px) {
  .textbook-request-row {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   @mention Book Reference System
   ============================== */

.mention-wrapper {
  position: relative;
  width: 100%;
}

.mention-wrapper textarea {
  width: 100%;
  box-sizing: border-box;
}

.mention-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  min-width: 260px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  padding: 6px;
  display: none;
}

.mention-dropdown.active {
  display: block;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.84rem;
}

.mention-item:hover,
.mention-item.highlighted {
  background: rgba(56,189,248,0.12);
}

.mention-item img {
  width: 28px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg);
}

.mention-item-text {
  flex: 1;
  overflow: hidden;
}

.mention-item-title {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mention-item-grade {
  font-size: 0.72rem;
  color: var(--muted);
}

.mention-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.book-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.book-reference-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.2);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  transition: background 0.2s;
}

.book-reference-badge:hover {
  background: rgba(56,189,248,0.2);
}

.book-reference-badge img {
  width: 20px;
  height: 26px;
  object-fit: cover;
  border-radius: 3px;
}

.book-reference-badge .ref-title {
  font-weight: 600;
  color: var(--text);
}

.book-reference-badge .ref-remove {
  margin-left: 4px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

.book-reference-badge .ref-remove:hover {
  opacity: 1;
}

body.theme-light .textbook-card:hover {
  background: rgba(255,255,255,0.7);
}

body.theme-light .mention-dropdown {
  background: rgba(255,255,255,0.98);
  border-color: rgba(100,116,139,0.2);
}

body.theme-light .mention-item:hover,
body.theme-light .mention-item.highlighted {
  background: rgba(37,99,235,0.08);
}

body.theme-dark .textbook-card:hover {
  background: rgba(255,255,255,0.04);
}

@media (max-width: 720px) {
  .textbooks-header {
    flex-direction: column;
    align-items: stretch;
  }
  .textbooks-header .select-wrap {
    min-width: 0;
  }
  .textbooks-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }
  .textbooks-panel {
    padding: 16px;
  }
}

/* ── Teacher Dashboard ── */

.teacher-section {
  padding: 20px;
  margin-bottom: 18px;
}

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

.teacher-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.teacher-roster-table th:first-child,
.teacher-roster-table td:first-child {
  width: 60%;
}

/* Sent suggestion cards */
.teacher-sent-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.teacher-sent-card.teacher-sent-expired {
  opacity: 0.5;
}

.teacher-sent-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.teacher-sent-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: rgba(56,189,248,0.12);
  padding: 2px 8px;
  border-radius: 50px;
  flex-shrink: 0;
}

.teacher-sent-grade {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: auto;
}

.teacher-sent-row {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.teacher-sent-expired-label {
  color: var(--danger, #ef4444);
  font-weight: 600;
}

/* Theme toggle in nav */
.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s;
}
.theme-toggle-btn:hover {
  color: var(--text);
}

/* Teacher collapsible students */
.teacher-collapsible-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
  font: inherit;
  text-align: left;
}
.teacher-collapsible-trigger .teacher-row {
  flex: 1;
}
.teacher-collapsible-trigger .settings-panel-cue {
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ── Teacher Suggestions Section (student dashboard) ── */

.teacher-suggestions-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 18px;
  margin-bottom: 18px;
}

.teacher-suggestions-header h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.teacher-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  margin-bottom: 8px;
}

.teacher-suggestion-item:last-child {
  margin-bottom: 0;
}

.teacher-suggestion-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: rgba(56,189,248,0.12);
  padding: 2px 8px;
  border-radius: 50px;
  flex-shrink: 0;
}

.teacher-suggestion-info {
  flex: 1;
  min-width: 0;
}

.teacher-suggestion-info strong {
  display: block;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-suggestion-info span {
  font-size: 0.78rem;
  color: var(--muted);
}

.teacher-suggestion-item .compact-button {
  flex-shrink: 0;
}

/* ── Teacher Suggestions Section (student dashboard) ── */

.teacher-suggestions-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 18px;
  margin-bottom: 18px;
}

.teacher-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.teacher-suggestions-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.teacher-suggestions-header h2::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background: rgba(56,189,248,0.15);
  border-radius: 50%;
}

.teacher-suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  margin-bottom: 8px;
}

.teacher-suggestion-item:last-child {
  margin-bottom: 0;
}

.teacher-suggestion-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: rgba(56,189,248,0.12);
  padding: 2px 8px;
  border-radius: 50px;
  flex-shrink: 0;
}

.teacher-suggestion-info {
  flex: 1;
  min-width: 0;
}

.teacher-suggestion-info strong {
  display: block;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-suggestion-info span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Teacher suggestions toggle button (student dashboard) ── */

.dashboard-suggest-button {
  flex: 0 0 auto;
}

.teacher-suggestion-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

/* ==========================================================================
   Custom Dropdown Component
   ========================================================================== */

.custom-dropdown {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  min-width: 160px;
  width: 100%;
}

.custom-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  outline: none;
  line-height: 1;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s var(--motion), background 0.15s var(--motion), box-shadow 0.15s var(--motion);
}

.custom-dropdown-trigger:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.35);
}

.custom-dropdown-trigger:focus-visible {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.13);
}

.custom-dropdown-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.custom-dropdown-value {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dropdown-value.placeholder {
  color: var(--muted);
}

.custom-dropdown-arrow {
  flex: 0 0 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 0.15s var(--motion);
}

.custom-dropdown.open .custom-dropdown-arrow {
  transform: rotate(180deg);
}

.custom-dropdown-panel {
  margin-top: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.custom-dropdown-options {
  padding: 4px;
}

.custom-dropdown-option {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  color: var(--text);
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  transition: background 0.1s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-dropdown-option:hover,
.custom-dropdown-option:focus {
  background: rgba(56, 189, 248, 0.12);
  outline: none;
}

.custom-dropdown-option.selected {
  background: rgba(56, 189, 248, 0.18);
  font-weight: 500;
}

.custom-dropdown-option.disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.custom-dropdown-option.disabled:hover {
  background: transparent;
}

.custom-dropdown.disabled .custom-dropdown-trigger {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Theme-specific adjustments */
body.theme-light .custom-dropdown-trigger,
html[data-app-theme="light"] body .custom-dropdown-trigger {
  background: rgba(20, 32, 51, 0.04);
  border-color: rgba(30, 64, 105, 0.15);
}

body.theme-light .custom-dropdown-trigger:hover:not(:disabled),
html[data-app-theme="light"] body .custom-dropdown-trigger:hover:not(:disabled) {
  background: rgba(20, 32, 51, 0.06);
  border-color: rgba(47, 111, 237, 0.35);
}

body.theme-light .custom-dropdown-panel,
html[data-app-theme="light"] body .custom-dropdown-panel {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(30, 64, 105, 0.15);
  box-shadow: 0 16px 48px rgba(20, 32, 51, 0.15);
}

body.theme-light .custom-dropdown-option:hover,
body.theme-light .custom-dropdown-option:focus,
html[data-app-theme="light"] body .custom-dropdown-option:hover,
html[data-app-theme="light"] body .custom-dropdown-option:focus {
  background: rgba(47, 111, 237, 0.1);
}

body.theme-light .custom-dropdown-option.selected,
html[data-app-theme="light"] body .custom-dropdown-option.selected {
  background: rgba(47, 111, 237, 0.15);
  color: var(--primary-deep);
}

body.theme-dark .custom-dropdown-trigger,
html[data-app-theme="dark"] body .custom-dropdown-trigger {
  background: rgba(8, 13, 24, 0.6);
  border-color: rgba(148, 163, 184, 0.12);
}

body.theme-dark .custom-dropdown-trigger:hover:not(:disabled),
html[data-app-theme="dark"] body .custom-dropdown-trigger:hover:not(:disabled) {
  background: rgba(8, 13, 24, 0.8);
  border-color: rgba(147, 197, 253, 0.35);
}

body.theme-dark .custom-dropdown-panel,
html[data-app-theme="dark"] body .custom-dropdown-panel {
  background: rgba(8, 13, 24, 0.95);
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

body.theme-dark .custom-dropdown-option:hover,
body.theme-dark .custom-dropdown-option:focus,
html[data-app-theme="dark"] body .custom-dropdown-option:hover,
html[data-app-theme="dark"] body .custom-dropdown-option:focus {
  background: rgba(147, 197, 253, 0.12);
}

body.theme-dark .custom-dropdown-option.selected,
html[data-app-theme="dark"] body .custom-dropdown-option.selected {
  background: rgba(147, 197, 253, 0.18);
}

html[data-app-theme="wesley"] body .custom-dropdown-trigger,
body.theme-wesley .custom-dropdown-trigger {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-app-theme="wesley"] body .custom-dropdown-trigger:hover:not(:disabled),
body.theme-wesley .custom-dropdown-trigger:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(56, 189, 248, 0.35);
}

html[data-app-theme="wesley"] body .custom-dropdown-panel,
body.theme-wesley .custom-dropdown-panel {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 48px rgba(2, 6, 23, 0.5);
}

/* Assignment/Project detail popup: stack the title full-width and put the
   Convert + Edit buttons in the row underneath so no blank space is left */
@media (max-width: 520px) {
  .assignment-detail-panel .modal-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .assignment-detail-panel .modal-header h2 {
    width: 100%;
  }

  .assignment-detail-panel .modal-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .assignment-detail-panel .modal-header-actions .secondary-button.compact-button {
    flex: 1 1 0;
    min-height: 0;
    padding: 10px 10px;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
  }

  .assignment-detail-panel .modal-header-actions .icon-button {
    flex: 0 0 auto;
  }
}

/* Small phones: nav links wrap into 3 rows and get taller than 176px */
@media (max-width: 400px) {
  .page {
    padding-top: 200px;
  }
}

/* Print styles */
@media print {
  .custom-dropdown-panel {
    display: none !important;
  }
}
