:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #edf4f1;
  --surface-warm: #fff9f1;
  --ink: #172a26;
  --muted: #667b75;
  --faint: #8b9c97;
  --line: #dfe8e4;
  --brand: #176b5b;
  --brand-2: #26967f;
  --brand-soft: #dff2ec;
  /* The Classformed wordmark. Deliberately a different hue from --brand (teal) so the product
     name reads as a name, and dark enough to clear WCAG AA on --surface. */
  --brandname: #1d4ed8;
  --warning: #a7601c;
  --danger: #ba4252;
  --shadow: 0 18px 45px rgba(25, 58, 50, .08);
  --shadow-sm: 0 7px 24px rgba(25, 58, 50, .07);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar: 248px;
  --content: 1220px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1715;
  --surface: #17211e;
  --surface-soft: #1d2b27;
  --surface-warm: #29231c;
  --ink: #eff8f5;
  --muted: #a2b6b0;
  --faint: #7f948e;
  --line: #2a3a35;
  --brand: #61cbb2;
  --brand-2: #86dcc8;
  --brand-soft: #1d3e36;
  --brandname: #8ab4ff;
  --warning: #f2b264;
  --danger: #f08290;
  --shadow: 0 18px 45px rgba(0, 0, 0, .25);
  --shadow-sm: 0 7px 24px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  color: var(--brandname);
}
.brand-mark svg { width: 100%; height: 100%; }


.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 28px 18px 22px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 28px;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.6px;
}
.brand .brand-mark { width: 28px; height: 28px; }

.nav-label {
  margin: 8px 12px 7px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.nav-list { display: grid; gap: 3px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: .18s ease;
}
.nav-link:hover { color: var(--ink); background: var(--surface-soft); }
.nav-link.active { color: var(--brand); background: var(--brand-soft); }
.nav-link svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-badge { margin-left: auto; min-width: 21px; padding: 2px 6px; border-radius: 20px; background: var(--line); font-size: 10px; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 18px 10px 0; }
.review-pill { padding: 11px 12px; border-radius: 13px; background: var(--surface-warm); color: var(--warning); font-size: 11px; line-height: 1.45; }

.main-shell { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  height: 76px;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  gap: 18px;
  background: color-mix(in srgb, var(--bg) 89%, transparent);
  backdrop-filter: blur(16px);
  z-index: 20;
}
.mobile-logo { display: none; }
.search-wrap { position: relative; width: min(460px, 48vw); }
.search-wrap svg { position: absolute; left: 14px; top: 50%; width: 18px; color: var(--faint); transform: translateY(-50%); }
.search-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 42px;
  border: 1px solid transparent;
  border-radius: 14px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.search-wrap input:focus { border-color: var(--brand-2); }
.search-hint { position: absolute; right: 13px; top: 50%; color: var(--faint); font-size: 11px; transform: translateY(-50%); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
}
.icon-button:hover { border-color: var(--brand-2); }
.icon-button svg { width: 18px; }
.profile-chip { display: flex; align-items: center; gap: 10px; padding: 5px 9px 5px 5px; border: 0; border-radius: 14px; background: transparent; cursor: pointer; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 800; }
.profile-copy { text-align: left; line-height: 1.2; }
.profile-copy strong { display: block; font-size: 12px; }
.profile-copy span { color: var(--faint); font-size: 10px; }

.page { max-width: var(--content); margin: 0 auto; padding: 20px clamp(20px, 4vw, 48px) 70px; animation: pageIn .3s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(5px); } }
.page-heading { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif; letter-spacing: -.035em; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; }
h2 { margin-bottom: 7px; font-size: 22px; }
h3 { margin-bottom: 5px; font-size: 16px; }
.lead { max-width: 690px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.section-heading { margin: 36px 0 16px; display: flex; align-items: flex-end; justify-content: space-between; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.text-link { border: 0; background: none; color: var(--brand); font-size: 12px; font-weight: 700; cursor: pointer; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 18px; }
.welcome-card {
  position: relative;
  min-height: 265px;
  padding: clamp(25px, 4vw, 42px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #155f51 0%, #217d6a 60%, #31977f 100%);
  color: white;
  box-shadow: var(--shadow);
}
.welcome-card::before, .welcome-card::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.welcome-card::before { width: 310px; height: 310px; right: -90px; top: -150px; }
.welcome-card::after { width: 210px; height: 210px; right: 35px; bottom: -140px; }
.welcome-card .eyebrow { color: #bde8dd; }
.welcome-card h1 { max-width: 600px; margin-bottom: 14px; font-size: clamp(31px, 4vw, 48px); }
.welcome-card p { max-width: 540px; margin: 0 0 24px; color: #dcefeb; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  min-height: 43px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button.ghost-light { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.1); color: white; }
.button.small { min-height: 36px; padding: 0 13px; font-size: 12px; }
.button svg { width: 16px; height: 16px; }
.button[disabled] { cursor: not-allowed; filter: grayscale(.5); opacity: .58; transform: none; }

.daily-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-sm); }
.daily-top { display: flex; justify-content: space-between; align-items: flex-start; }
.daily-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: #fff0df; color: #d27628; }
[data-theme="dark"] .daily-icon { background: #3d2c1c; }
.daily-icon svg { width: 20px; }
.daily-card h2 { margin: 18px 0 4px; }
.daily-card > p { margin: 0; color: var(--muted); font-size: 12px; }
.goal-number { color: var(--brand); font-family: inherit; font-size: 13px; font-weight: 800; }
.progress-track { height: 8px; margin: 20px 0 9px; overflow: hidden; border-radius: 8px; background: var(--line); }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.goal-foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; }
.streak-row { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 6px; }
.day { text-align: center; color: var(--faint); font-size: 9px; }
.day span { width: 27px; height: 27px; margin-bottom: 6px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); font-size: 10px; }
.day.done span { background: var(--brand); color: white; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { padding: 19px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.stat-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-soft); color: var(--brand); }
.stat-icon svg { width: 16px; }
.stat-value { margin-top: 15px; font-family: inherit; font-size: 25px; font-weight: 800; letter-spacing: -.05em; }
.stat-caption { margin-top: 3px; color: var(--faint); font-size: 10px; }

.subject-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.subject-card {
  position: relative;
  min-height: 190px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}
.subject-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.subject-card::after { content: ""; position: absolute; width: 110px; height: 110px; right: -48px; bottom: -46px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.subject-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.subject-icon svg { width: 21px; }
.subject-card h3 { margin: 21px 0 5px; font-size: 15px; }
.subject-card p { margin: 0; color: var(--muted); font-size: 11px; }
.subject-progress { margin-top: 17px; display: flex; align-items: center; gap: 9px; color: var(--faint); font-size: 10px; }
.subject-progress .progress-track { flex: 1; height: 5px; margin: 0; }

.continue-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 15px; }
.continue-card, .note-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.continue-card { display: flex; align-items: center; gap: 18px; }
.continue-symbol { width: 56px; height: 56px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 18px; background: var(--brand-soft); color: var(--brand); }
.continue-symbol svg { width: 24px; }
.continue-copy { min-width: 0; flex: 1; }
.continue-copy p { margin: 3px 0 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-card { background: var(--surface-warm); }
.note-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.subject-hero { padding: 30px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); }
.subject-hero-top { display: flex; align-items: center; gap: 20px; }
.subject-hero .subject-icon { width: 64px; height: 64px; border-radius: 20px; }
.subject-hero .subject-icon svg { width: 30px; }
.subject-hero h1 { margin: 0 0 6px; font-size: 34px; }
.subject-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.hero-metrics { margin-top: 28px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.hero-metric { padding: 20px 20px 0 0; }
.hero-metric strong { display: block; font-family: inherit; font-size: 20px; }
.hero-metric span { color: var(--faint); font-size: 10px; }

.chapter-list { display: grid; gap: 12px; }
.chapter-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.chapter-toggle { width: 100%; padding: 19px 21px; display: flex; align-items: center; gap: 14px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.chapter-number { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: var(--surface-soft); color: var(--brand); font-size: 11px; font-weight: 800; }
.chapter-copy { flex: 1; }
.chapter-copy strong { display: block; font-family: inherit; font-size: 14px; }
.chapter-copy span { color: var(--faint); font-size: 10px; }
.chapter-toggle > svg { width: 17px; color: var(--faint); transition: transform .2s; }
.chapter-card.open .chapter-toggle > svg { transform: rotate(180deg); }
.topic-list { display: none; padding: 0 12px 12px; }
.chapter-card.open .topic-list { display: grid; }
.topic-row { padding: 12px 10px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 11px; border-top: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.topic-row:hover { background: var(--surface-soft); }
.topic-status { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--faint); }
.topic-status svg { width: 12px; }
.topic-status.complete { background: var(--brand); border-color: var(--brand); color: white; }
.topic-title { font-size: 12px; font-weight: 600; }
.topic-row > svg { width: 15px; color: var(--faint); }

.reader-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; align-items: start; }
.reader-head { margin-bottom: 20px; }
.breadcrumbs { margin-bottom: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--faint); font-size: 11px; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs svg { width: 12px; }
.reader-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.reader-title-row h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 42px); }
.reader-title-row p { margin: 0; color: var(--muted); font-size: 12px; }
.reader-actions { display: flex; gap: 8px; }
.reader-card { border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-sm); }
.study-section { padding: 28px clamp(22px, 4vw, 38px); border-top: 1px solid var(--line); scroll-margin-top: 95px; }
.study-section:first-child { border-top: 0; }
.section-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.section-kicker span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; }
.study-section h2 { margin: 0; font-size: 19px; }
.study-section p { margin: 0; color: color-mix(in srgb, var(--ink) 84%, var(--muted)); font-size: 15px; line-height: 1.8; }
.study-section.pearl { background: var(--surface-warm); }
.reader-end { padding: 27px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); }
.reader-end p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.reader-side { position: sticky; top: 96px; display: grid; gap: 13px; }
.toc, .review-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.toc h3, .review-card h3 { font-size: 13px; }
.toc a { padding: 7px 8px; display: block; border-left: 2px solid var(--line); color: var(--muted); font-size: 11px; }
.toc a:hover { border-color: var(--brand); color: var(--brand); }
.review-card p { margin: 8px 0 13px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.topic-nav { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.topic-nav a { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.topic-nav a:last-child { text-align: right; }
.topic-nav span { display: block; margin-bottom: 4px; color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.topic-nav strong { font-size: 11px; }

.empty-state { max-width: 680px; margin: 48px auto; padding: clamp(30px, 6vw, 58px); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); text-align: center; box-shadow: var(--shadow-sm); }
.empty-icon { width: 68px; height: 68px; margin: 0 auto 21px; display: grid; place-items: center; border-radius: 22px; background: var(--brand-soft); color: var(--brand); }
.empty-icon svg { width: 29px; }
.empty-state h1 { font-size: 29px; }
.empty-state p { max-width: 520px; margin: 8px auto 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.empty-state .hero-actions { margin-top: 24px; justify-content: center; }
.source-gate { margin: 24px auto 0; padding: 13px 15px; border-radius: 12px; background: var(--surface-soft); color: var(--muted); text-align: left; font-size: 11px; line-height: 1.5; }

.search-results { display: grid; gap: 10px; }
.search-result { padding: 18px 20px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; }
.search-result:hover { border-color: var(--brand-2); }
.search-result .subject-icon { width: 40px; height: 40px; border-radius: 12px; }
.search-result h3 { margin: 0 0 4px; font-size: 13px; }
.search-result p { margin: 0; color: var(--faint); font-size: 10px; }
.search-result > svg { width: 17px; color: var(--faint); }
.result-snippet { margin-top: 7px !important; color: var(--muted) !important; font-size: 11px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.filter-row { margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 100px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.filter-chip.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.saved-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.saved-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.saved-card h3 { margin: 14px 0 6px; font-size: 13px; }
.saved-card p { margin: 0 0 15px; color: var(--faint); font-size: 10px; }

.progress-layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; }
.panel { padding: 23px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.panel-head { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: start; }
.panel-head p { margin: 3px 0 0; color: var(--faint); font-size: 10px; }
.subject-bars { display: grid; gap: 18px; }
.bar-row-top { margin-bottom: 8px; display: flex; justify-content: space-between; font-size: 11px; }
.bar-row-top strong { font-size: 11px; }
.bar-row-top span { color: var(--faint); }
.activity-chart { height: 190px; display: flex; align-items: flex-end; gap: 9px; border-bottom: 1px solid var(--line); }
.chart-bar { flex: 1; min-height: 3px; position: relative; border-radius: 6px 6px 0 0; background: var(--brand-soft); }
.chart-bar.active { background: var(--brand); }
.chart-bar span { position: absolute; left: 50%; bottom: -23px; color: var(--faint); font-size: 9px; transform: translateX(-50%); }
.profile-panel { max-width: 760px; }
.profile-banner { padding: 28px; display: flex; align-items: center; gap: 20px; border-radius: var(--radius-xl); background: linear-gradient(135deg, var(--brand-soft), var(--surface)); border: 1px solid var(--line); }
.profile-banner .avatar { width: 62px; height: 62px; border-radius: 20px; font-size: 20px; }
.profile-banner h2 { margin: 0 0 4px; }
.profile-banner p { margin: 0; color: var(--muted); font-size: 12px; }
.settings-list { margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.setting-row { padding: 18px 20px; display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; }
.setting-row > svg { width: 18px; color: var(--brand); }
.setting-copy { flex: 1; }
.setting-copy strong { display: block; font-size: 12px; }
.setting-copy span { color: var(--faint); font-size: 10px; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 8px; }
.toast { max-width: 340px; padding: 12px 15px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-size: 12px; animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }
.bottom-nav { display: none; }

@media (max-width: 1080px) {
  :root { --sidebar: 214px; }
  .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .saved-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .sidebar { display: none; }
  .main-shell { margin-left: 0; }
  .topbar { height: 67px; padding: 0 16px; }
  .mobile-logo { display: flex; align-items: center; gap: 8px; font-family: inherit; font-weight: 800; }
  .mobile-logo .brand-mark { width: 24px; height: 24px; }
  .search-wrap { flex: 1; width: auto; }
  .search-wrap input { box-shadow: none; border-color: var(--line); }
  .search-hint, .profile-copy, .top-actions .icon-button:first-child { display: none; }
  .page { padding: 14px 16px 92px; }
  .hero-grid, .continue-row, .progress-layout { grid-template-columns: 1fr; }
  .reader-grid { grid-template-columns: 1fr; }
  .reader-side { display: none; }
  .bottom-nav {
    position: fixed;
    inset: auto 0 0;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 6px 10px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(15px);
    z-index: 40;
  }
  .bottom-link { display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--faint); font-size: 9px; font-weight: 700; }
  .bottom-link svg { width: 19px; }
  .bottom-link.active { color: var(--brand); }
}

@media (max-width: 570px) {
  .topbar { gap: 9px; }
  .mobile-logo span:last-child { display: none; }
  .search-wrap input { height: 40px; font-size: 12px; }
  .profile-chip { padding-right: 0; }
  .welcome-card { min-height: 300px; }
  .subject-grid, .stats-grid, .saved-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 16px; }
  .hero-metrics { grid-template-columns: repeat(2, 1fr); }
  .subject-hero { padding: 22px; }
  .subject-hero-top { align-items: flex-start; }
  .subject-hero .subject-icon { width: 50px; height: 50px; border-radius: 15px; }
  .subject-hero h1 { font-size: 26px; }
  .reader-title-row { display: block; }
  .reader-actions { margin-top: 15px; }
  .reader-end { align-items: flex-start; flex-direction: column; }
  .topic-nav { grid-template-columns: 1fr; }
  .topic-nav a:last-child { text-align: left; }
  .search-result { grid-template-columns: 38px 1fr; }
  .search-result > svg { display: none; }
  .page-heading { display: block; }
}

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

/* Public experience */
.public-page { min-height: 100vh; overflow: hidden; background: var(--surface-soft); color: #0f151d; --ink:#0f151d; --muted:#687a75; --line:var(--line); --surface:#fff; --brand:#1f5bd0; }
.public-nav { position: relative; z-index: 20; width: min(1240px,calc(100% - 40px)); height: 86px; margin: 0 auto; display:flex; align-items:center; gap:30px; }
.public-brand { padding:0; font-size:22px; }
.public-links { margin-left:auto; display:flex; gap:28px; color:#5b6e68; font-size:13px; font-weight:650; }
.public-links a { position:relative; }
.public-links a::after { content:""; position:absolute; left:0; right:100%; bottom:-7px; height:2px; background:#1f5bd0; transition:.25s ease; }
.public-links a:hover::after { right:0; }
.public-actions { display:flex; gap:9px; }
.landing { overflow:hidden; }
.landing-hero { position:relative; width:min(1370px,calc(100% - 26px)); min-height:730px; margin:0 auto; padding:90px clamp(28px,7vw,105px); display:grid; grid-template-columns:1.05fr .95fr; align-items:center; border-radius:38px; overflow:hidden; background:radial-gradient(circle at 72% 20%,rgba(86,205,174,.19),transparent 24%),linear-gradient(135deg,#0b211c 0%,#123b32 62%,#17604f 100%); color:#fff; }
.grain { position:absolute; inset:0; opacity:.15; pointer-events:none; background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E"); }
.aurora { position:absolute; border-radius:50%; filter:blur(3px); opacity:.65; animation:auroraFloat 10s ease-in-out infinite alternate; }
.aurora-one { width:430px; height:430px; left:-170px; top:-190px; background:radial-gradient(circle,#2bb29455,transparent 68%); }
.aurora-two { width:480px; height:480px; right:-160px; bottom:-280px; background:radial-gradient(circle,#66e3bd44,transparent 68%); animation-delay:-4s; }
@keyframes auroraFloat { to { transform:translate(55px,42px) scale(1.15); } }
.hero-copy { position:relative; z-index:3; max-width:720px; }
.landing-badge { width:max-content; margin-bottom:28px; padding:8px 13px; border:1px solid rgba(255,255,255,.16); border-radius:100px; background:rgba(255,255,255,.07); color:#c7e7de; font-size:11px; font-weight:700; letter-spacing:.04em; backdrop-filter:blur(10px); }
.landing-badge span { width:7px;height:7px;margin-right:7px;display:inline-block;border-radius:50%;background:#6de0bd;box-shadow:0 0 0 6px #6de0bd1e;animation:badgePulse 2s infinite; }
@keyframes badgePulse { 50%{box-shadow:0 0 0 11px transparent;} }
.hero-copy h1 { max-width:780px; margin:0 0 25px; font-size:clamp(48px,6.3vw,89px); line-height:.98; letter-spacing:-.07em; }
.hero-copy h1 em { color:#8fb6ff; font-style:normal; font-weight:500; }
.hero-copy>p { max-width:620px; color:#cee1dc; font-size:17px; line-height:1.72; }
.landing-primary { min-height:52px; padding:0 22px; background:#f2fff9; color:#113f34; box-shadow:0 12px 30px #06130f44; }
.landing-ghost { min-height:52px; padding:0 22px; border-color:#ffffff2b; background:#ffffff0c; color:#fff; }
.trust-row { margin-top:35px; display:flex; flex-wrap:wrap; gap:20px; color:#a9c8c0; font-size:10px; font-weight:650; }
.trust-row span { display:flex; align-items:center; gap:7px; }
.trust-row svg { width:14px; }
.hero-stage { position:relative; z-index:2; min-height:530px; perspective:1100px; }
.demo-card { position:absolute; left:10%; top:18%; width:min(430px,82%); min-height:330px; padding:27px; border:1px solid #ffffff22; border-radius:28px; background:linear-gradient(145deg,rgba(255,255,255,.96),rgba(224,242,236,.88)); color:#18342d; box-shadow:0 45px 100px #05130f66; transform:rotateY(-8deg) rotateX(4deg); animation:cardHover 5.5s ease-in-out infinite; backdrop-filter:blur(16px); }
@keyframes cardHover { 50%{transform:translateY(-14px) rotateY(-5deg) rotateX(2deg);} }
.demo-top { display:flex;align-items:center;gap:10px;font-size:12px;font-weight:700; }
.demo-top i { margin-left:auto;padding:5px 9px;border-radius:20px;background:#d8eee8;color:#1f5bd0;font-style:normal; }
.mini-logo { width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:#1f5bd0;color:#fff; }
.demo-card h3 { margin:35px 0 21px;font-size:26px; }
.demo-bars { display:grid;gap:12px; }
.demo-bars span { height:9px;border-radius:10px;background:linear-gradient(90deg,#1d856f var(--w),#d8e5e1 var(--w)); }
.demo-callout { margin-top:34px;padding:16px;display:flex;justify-content:space-between;border-radius:15px;background:#eff7f4;font-size:11px; }
.demo-callout span { color:#6c817a; }
.float-card { position:absolute; z-index:5; padding:13px 16px; display:flex; align-items:center; gap:11px; border:1px solid #ffffff35; border-radius:17px; background:#ffffffea; color:#17372f; box-shadow:0 18px 45px #0615104d; backdrop-filter:blur(12px); animation:floatCard 4s ease-in-out infinite; }
.float-card svg { width:20px;color:#268d76; }
.float-card b,.float-card span { display:block; }
.float-card b { font-size:11px; }.float-card span { margin-top:2px;color:#71857f;font-size:9px; }
.float-one { right:1%;top:12%;animation-delay:-1s; }.float-two { left:0;bottom:19%;animation-delay:-2.1s; }.float-three { right:3%;bottom:6%;animation-delay:-3s; }
@keyframes floatCard { 50%{transform:translateY(-10px) rotate(1deg);} }
.orbit { position:absolute;border:1px solid #a7e4d333;border-radius:50%;animation:orbitSpin 24s linear infinite; }
.orbit-a { width:510px;height:510px;left:-2%;top:1%; }.orbit-b{width:360px;height:360px;left:13%;top:15%;animation-direction:reverse;}
@keyframes orbitSpin { to{transform:rotate(360deg);} }
.pulse-dot { position:absolute;width:7px;height:7px;border-radius:50%;background:#8fb6ff;box-shadow:0 0 20px #8fb6ff;animation:dotFloat 3s ease-in-out infinite; }.dot-a{left:9%;top:13%}.dot-b{right:10%;top:50%;animation-delay:-1s}.dot-c{left:35%;bottom:6%;animation-delay:-2s}
@keyframes dotFloat { 50%{transform:scale(1.8);opacity:.35;} }
.marquee { margin:22px 0 0; overflow:hidden; background:var(--brand-soft); color:#276d5d; }
.marquee>div { width:max-content;padding:15px 0;display:flex;animation:marqueeMove 28s linear infinite; }
.marquee span { padding:0 32px;font-size:11px;font-weight:800;letter-spacing:.07em;text-transform:uppercase; }.marquee i{margin-left:45px;color:#6ab6a3;font-style:normal;}
@keyframes marqueeMove { to{transform:translateX(-50%);} }
.landing-section { width:min(1220px,calc(100% - 40px));margin:145px auto; }
.landing-section-head { max-width:690px;margin-bottom:46px; }
.landing-section-head h2,.story-sticky h2,.landing-safety h2,.landing-cta h2 { font-size:clamp(38px,5vw,64px);line-height:1.05;letter-spacing:-.06em; }
.landing-section-head>p:last-child,.story-sticky>p:last-of-type { color:#657972;line-height:1.7; }
.feature-bento { display:grid;grid-template-columns:1.15fr .85fr;grid-template-rows:repeat(2,330px);gap:17px; }
.bento { position:relative;padding:34px;overflow:hidden;border:1px solid #dce8e3;border-radius:29px;background:#fff;box-shadow:0 18px 60px #183a300a; }
.bento-icon { width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:#e5f3ef;color:#1f5bd0; }.bento-icon svg{width:21px;}
.bento>p,.bento>div>p { margin:20px 0 7px;color:#1f5bd0;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.11em; }
.bento h3 { max-width:520px;font-size:clamp(23px,2.7vw,37px);line-height:1.16; }.bento>span:last-child,.bento>div>span{color:var(--muted);font-size:12px;}
.bento-book { grid-row:span 2;padding:48px;background:linear-gradient(150deg,#fff,var(--brand-soft)); }.bento-book .bento-icon{margin-bottom:60px;}.bento-book h3{font-size:45px;}
.book-stack { position:absolute;right:-60px;bottom:-55px;width:330px;height:290px;transform:rotate(-9deg); }.book-stack i{position:absolute;inset:0;border:1px solid #b8d4cc;border-radius:24px;background:#fff;box-shadow:0 20px 50px #24473d1a;}.book-stack i:nth-child(2){transform:translate(-27px,-29px);background:#dff1eb}.book-stack i:nth-child(3){transform:translate(-54px,-58px);background:#1f5bd0}
.bento-progress { background:#161e29;color:#fff;border-color:#161e29; }.bento-progress .bento-icon{background:#ffffff12;color:#8fb6ff}.bento-progress p{color:#8fb6ff}.bento-progress h3{max-width:320px}.ring-visual{position:absolute;right:-28px;bottom:-35px;width:190px;height:190px;display:grid;place-items:center;border-radius:50%;background:conic-gradient(#78d8bd 0 74%,#ffffff12 74%);}.ring-visual::after{content:"";position:absolute;inset:18px;border-radius:50%;background:#161e29}.ring-visual span{position:relative;z-index:2;font-size:37px;font-weight:800}.ring-visual small{font-size:14px}
.bento-honest{background:#fff9ef}.bento-sync{background:#edf6ff}.sync-line{position:absolute;right:25px;bottom:25px;display:flex;gap:12px}.sync-line i{width:12px;height:12px;border-radius:50%;background:#1f5bd0;animation:syncPulse 1.8s infinite}.sync-line i:nth-child(2){animation-delay:.2s}.sync-line i:nth-child(3){animation-delay:.4s}@keyframes syncPulse{50%{transform:scale(1.7);opacity:.25}}
.story-section { width:min(1220px,calc(100% - 40px));margin:170px auto;display:grid;grid-template-columns:.78fr 1.22fr;gap:100px;align-items:start; }
.story-sticky { position:sticky;top:100px; }.story-steps{display:grid;gap:18px}.story-step{min-height:260px;padding:35px;display:grid;grid-template-columns:50px 1fr;align-content:center;border:1px solid var(--line);border-radius:28px;background:#fff;box-shadow:0 20px 50px #183a3009;transition:.3s ease;transition-delay:var(--delay)}.story-step:hover{transform:translateX(-8px);border-color:#81c3b2}.story-step>span{font-size:11px;color:#7f938d}.story-step>i{width:48px;height:48px;display:grid;place-items:center;border-radius:15px;background:var(--brand-soft);color:#1f5bd0}.story-step>i svg{width:22px}.story-step h3,.story-step p{grid-column:2;margin-left:0}.story-step h3{margin-top:22px;font-size:26px}.story-step p{max-width:430px;color:#6f817c;line-height:1.6}
.landing-safety { width:min(1220px,calc(100% - 40px));margin:120px auto;padding:70px;display:grid;grid-template-columns:1fr 1fr;gap:70px;border-radius:35px;background:#102a24;color:#fff; }.landing-safety .eyebrow{color:#83d9c1}.landing-safety h2{font-size:50px}.safety-copy>p{color:#bed5cf;line-height:1.8}.safety-flow{margin-top:35px;display:flex;align-items:center;flex-wrap:wrap;gap:9px}.safety-flow span{padding:9px 12px;border:1px solid #ffffff1f;border-radius:10px;background:#ffffff0c;font-size:10px}.safety-flow i{color:#7ed6be;font-style:normal}
.landing-cta { position:relative;width:min(1220px,calc(100% - 40px));margin:150px auto 90px;padding:100px 40px;overflow:hidden;border-radius:40px;background:linear-gradient(135deg,#dff4ed,#f6fbf9);text-align:center}.landing-cta h2{max-width:820px;margin:0 auto 18px}.landing-cta>p:not(.eyebrow){max-width:620px;margin:0 auto 30px;color:#647a73;line-height:1.7}.cta-orbit{position:absolute;width:620px;height:620px;left:50%;top:50%;border:1px solid #1f5bd016;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 0 70px #1f5bd008,0 0 0 140px #1f5bd005}
.landing-cta>*:not(.cta-orbit){position:relative}.landing-cta .landing-primary{background:#1f5bd0;color:#fff}
.public-footer { width:min(1220px,calc(100% - 40px));min-height:130px;margin:0 auto;padding:30px 0;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:28px;border-top:1px solid #dde8e4;color:#71827d;font-size:11px}.public-footer .brand{padding:0;color:#0f151d}.public-footer p{text-align:center}.public-footer nav{display:flex;gap:17px}.public-footer>span{grid-column:3}
.reveal { opacity:0;transform:translateY(24px);transition:opacity .8s ease,transform .8s cubic-bezier(.2,.7,.2,1)}.reveal.revealed{opacity:1;transform:none}.landing-hero .reveal{animation:heroReveal .9s .15s both}@keyframes heroReveal{from{opacity:0;transform:translateY(25px)}}

/* Authentication */
.auth-page { min-height:100vh;display:grid;grid-template-columns:1.05fr .95fr;background:var(--surface-soft);color:#0f151d; }
.auth-art { position:relative;min-height:100vh;padding:42px clamp(38px,6vw,90px);overflow:hidden;background:radial-gradient(circle at 70% 20%,#2c8e7855,transparent 28%),linear-gradient(145deg,#0c241e,#175c4c);color:#fff; }
.auth-brand{position:relative;z-index:2;padding:0;color:#fff}.auth-art-copy{position:relative;z-index:2;max-width:650px;margin-top:13vh}.auth-art-copy .eyebrow{color:#8ee2ca}.auth-art-copy h1{font-size:clamp(42px,5vw,72px);line-height:1.03}.auth-art-copy>p:last-child{max-width:560px;color:#c5ddd6;font-size:15px;line-height:1.75}
.auth-visual { position:relative;z-index:2;margin-top:70px;display:flex;flex-wrap:wrap;gap:12px}.auth-visual article{padding:13px 15px;display:flex;gap:10px;align-items:center;border:1px solid #ffffff22;border-radius:15px;background:#ffffff0c;backdrop-filter:blur(8px)}.auth-visual svg{width:19px;color:#85ddc4}.auth-visual b,.auth-visual span{display:block}.auth-visual b{font-size:10px}.auth-visual span{color:#a9c9c0;font-size:9px}
.auth-ring{position:absolute;width:650px;height:650px;left:-250px;bottom:-410px;border:1px solid #ffffff17;border-radius:50%;box-shadow:0 0 0 80px #ffffff06,0 0 0 160px #ffffff04}
.auth-panel{position:relative;min-height:100vh;display:grid;place-items:center;padding:50px}.auth-close{position:absolute;right:30px;top:25px;width:40px;height:40px;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;font-size:22px}.auth-form{width:min(470px,100%)}.auth-form h2{font-size:36px;margin-bottom:10px}.auth-form>p:not(.eyebrow):not(.auth-switch){color:var(--muted);margin-bottom:30px}.auth-form label,.contact-form label,.feedback-form label,.delete-account-box label,.inbox-detail label{display:grid;gap:8px;margin-bottom:17px;color:var(--muted);font-size:11px;font-weight:700}.auth-form input,.contact-form input,.contact-form textarea,.feedback-form input,.feedback-form textarea,.feedback-form select,.delete-account-box input,.inbox-detail textarea,.inbox-detail select,.admin-tr select{width:100%;padding:13px 14px;border:1px solid var(--line);border-radius:12px;background:#fff;color:#15202f;outline:none}.auth-form input{height:50px}.auth-form input:focus,.contact-form input:focus,.contact-form textarea:focus,.feedback-form textarea:focus{border-color:#2f6fed;box-shadow:0 0 0 4px #2f6fed12}.consent-box{margin:22px 0;padding:17px;border:1px solid var(--line);border-radius:14px;background:#f3f8f6}.check-row{display:flex!important;align-items:flex-start;gap:10px!important;margin:10px 0!important;line-height:1.5}.check-row input{width:17px;height:17px;flex:0 0 auto;margin-top:2px}.check-row a{color:#1f5bd0;text-decoration:underline}.form-error{min-height:20px;margin:7px 0;color:var(--danger);font-size:11px}.auth-submit{width:100%;min-height:52px}.auth-switch{text-align:center;color:var(--muted);font-size:12px}.auth-switch a{color:#1f5bd0;font-weight:800}

/* Legal and contact */
.legal-layout { width:min(1220px,calc(100% - 40px));margin:50px auto 100px;display:grid;grid-template-columns:245px minmax(0,1fr);gap:55px;align-items:start}.legal-aside{position:sticky;top:30px;padding:19px;display:grid;gap:5px;border:1px solid var(--line);border-radius:18px;background:#fff}.legal-aside>span{padding:8px;color:#859690;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.12em}.legal-aside a{padding:10px 11px;border-radius:9px;color:#5e716b;font-size:12px;font-weight:700}.legal-aside a.active{background:var(--brand-soft);color:#1f5bd0}.legal-aside small{margin:15px 7px 3px;padding-top:15px;border-top:1px solid #e2eae7;color:#a36022;line-height:1.5}.legal-document{padding:clamp(28px,5vw,65px);border:1px solid var(--line);border-radius:28px;background:#fff;box-shadow:0 20px 60px #17372d0b}.legal-hero{padding-bottom:35px;border-bottom:1px solid #dfe8e5}.legal-hero h1{font-size:clamp(43px,6vw,74px)}.legal-hero>p:last-child{color:#7a8b86}.legal-notice{margin:30px 0;padding:20px;border-left:4px solid #1f5bd0;border-radius:0 13px 13px 0;background:var(--brand-soft);color:#536b64;font-size:13px;line-height:1.7}.legal-section{padding:30px 0;border-top:1px solid #e6ecea}.legal-section:first-of-type{border-top:0}.legal-section h2{font-size:21px}.legal-section p,.legal-section li{color:#536862;font-size:13px;line-height:1.85}.legal-section ul{padding-left:21px}
.contact-page{width:min(1120px,calc(100% - 40px));margin:70px auto 120px;display:grid;grid-template-columns:1fr 1fr;gap:90px;align-items:start}.contact-intro h1{font-size:clamp(44px,6vw,72px);line-height:1.05}.contact-intro>p{color:#687b75;line-height:1.8}.contact-points{margin-top:35px;display:grid;gap:13px;color:#597069;font-size:12px}.contact-points span{display:flex;align-items:center;gap:10px}.contact-points svg{width:18px;color:#1f5bd0}.contact-form{padding:35px;border:1px solid var(--line);border-radius:27px;background:#fff;box-shadow:0 25px 70px #17372d10}.contact-form h2{font-size:27px}.contact-form textarea,.feedback-form textarea{resize:vertical}

/* Account feedback */
.feedback-form{max-width:820px}.feedback-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.form-help{color:var(--faint);font-size:10px}.danger-setting{color:var(--danger)}.delete-account-box{margin-top:17px;padding:20px;border:1px solid color-mix(in srgb,var(--danger) 35%,var(--line));border-radius:16px;background:var(--surface)}.delete-account-box p{color:var(--muted);font-size:11px}.delete-account-box input{max-width:400px}

/* Admin */
.admin-page{max-width:var(--content);margin:0 auto;padding:22px clamp(20px,4vw,48px) 80px}.admin-head{padding:30px 0;display:flex;justify-content:space-between;align-items:flex-end;gap:20px}.admin-head h1{margin-bottom:7px}.admin-head>div>p:last-child{margin:0;color:var(--muted)}.admin-tabs{position:sticky;top:75px;z-index:10;margin-bottom:24px;padding:8px;display:flex;gap:5px;overflow:auto;border:1px solid var(--line);border-radius:17px;background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(13px)}.admin-tabs a{padding:10px 13px;display:flex;align-items:center;gap:7px;white-space:nowrap;border-radius:11px;color:var(--muted);font-size:11px;font-weight:750}.admin-tabs a.active{background:var(--brand);color:#fff}.admin-tabs svg{width:15px}.admin-loading{padding:70px;display:grid;place-items:center;gap:15px;color:var(--muted)}.admin-loading span{width:30px;height:30px;border:3px solid var(--line);border-top-color:var(--brand);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
.admin-stat-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:18px}.admin-stat-grid article{padding:19px;border:1px solid var(--line);border-radius:18px;background:var(--surface)}.admin-stat-grid span{display:block;color:var(--muted);font-size:10px}.admin-stat-grid strong{display:block;margin-top:12px;font-size:24px;font-family:inherit}.admin-grid{display:grid;grid-template-columns:1.3fr .7fr;gap:17px}.admin-panel{padding:23px;border:1px solid var(--line);border-radius:20px;background:var(--surface);box-shadow:var(--shadow-sm)}.admin-panel-head{margin-bottom:20px;display:flex;justify-content:space-between;align-items:flex-start;gap:15px}.admin-panel-head h2{font-size:17px}.admin-panel-head p,.admin-panel-head span,.admin-panel-head small{margin:3px 0 0;color:var(--faint);font-size:10px}.admin-bars{height:250px;padding-top:30px;display:flex;align-items:flex-end;gap:8px;border-bottom:1px solid var(--line)}.admin-bars>div{position:relative;min-height:3px;flex:1;border-radius:6px 6px 0 0;background:linear-gradient(180deg,var(--brand-2),var(--brand))}.admin-bars>div span{position:absolute;left:50%;top:-19px;color:var(--faint);font-size:8px;transform:translateX(-50%)}.admin-bars>div i{position:absolute;left:50%;bottom:-21px;color:var(--faint);font-size:8px;font-style:normal;transform:translateX(-50%)}.event-ranking{display:grid}.event-ranking>div{padding:11px 0;display:grid;grid-template-columns:30px 1fr auto;align-items:center;border-top:1px solid var(--line);font-size:11px}.event-ranking>div:first-child{border:0}.event-ranking b{color:var(--faint);font-size:9px}.event-ranking span{text-transform:capitalize}.content-health{margin-top:17px;display:flex;align-items:center;justify-content:space-between;gap:20px}.content-health p{margin:5px 0;color:var(--muted);font-size:11px}
.admin-table{overflow:auto}.admin-tr{min-width:930px;padding:11px 6px;display:grid;grid-template-columns:1.5fr .75fr .75fr 1fr 1fr .55fr;gap:10px;align-items:center;border-top:1px solid var(--line);font-size:10px}.admin-th{border:0;color:var(--faint);font-weight:800;text-transform:uppercase;letter-spacing:.06em}.admin-tr strong,.admin-tr small{display:block}.admin-tr small{margin-top:3px;color:var(--faint)}.admin-tr select{padding:7px;font-size:10px;background:var(--surface);color:var(--ink)}
.activity-feed article{padding:13px 0;display:grid;grid-template-columns:13px 1fr auto;gap:11px;align-items:center;border-top:1px solid var(--line)}.activity-feed article:first-child{border:0}.activity-dot{width:8px;height:8px;border-radius:50%;background:var(--brand)}.activity-feed strong{font-size:11px;text-transform:capitalize}.activity-feed p,.activity-feed time{margin:3px 0 0;color:var(--faint);font-size:9px}
.inbox-layout{display:grid;grid-template-columns:.85fr 1.15fr;gap:17px;align-items:start}.inbox-list{padding:12px}.inbox-list .admin-panel-head{padding:12px}.inbox-item{width:100%;padding:15px;display:block;border:0;border-top:1px solid var(--line);background:transparent;color:var(--ink);text-align:left;cursor:pointer}.inbox-item.active{border-radius:13px;background:var(--surface-soft)}.inbox-item strong{display:block;margin:9px 0 4px;font-size:11px;text-transform:capitalize}.inbox-item p{margin:0;color:var(--muted);font-size:10px;line-height:1.5}.inbox-item small{display:block;margin-top:8px;color:var(--faint);font-size:8px}.status-badge{padding:4px 7px;border-radius:20px;background:var(--surface-soft);color:var(--brand);font-size:8px;font-weight:800;text-transform:uppercase}.status-new{background:#fff0df;color:var(--warning)}.status-resolved,.status-closed,.status-replied{background:var(--brand-soft);color:var(--brand)}.inbox-detail{position:sticky;top:145px}.inbox-meta{margin:18px 0;display:grid;grid-template-columns:1fr 1fr;gap:9px}.inbox-meta span{padding:10px;border-radius:10px;background:var(--surface-soft);font-size:10px}.inbox-meta b{display:block;margin-bottom:4px;color:var(--faint);font-size:8px;text-transform:uppercase}.message-body{margin:20px 0;padding:20px;border:1px solid var(--line);border-radius:14px;white-space:pre-wrap;color:var(--muted);font-size:12px;line-height:1.7}.inbox-detail textarea,.inbox-detail select{background:var(--surface);color:var(--ink)}
.control-list{display:grid}.control-list>div{padding:16px 0;display:grid;grid-template-columns:1fr 1.2fr;gap:7px;border-top:1px solid var(--line)}.control-list>div:first-child{border:0}.control-list span{color:var(--muted);font-size:11px}.control-list strong{font-size:11px}.control-list small{grid-column:2;color:var(--faint)}.setting-form textarea{width:100%;padding:15px;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--ink);font-family:ui-monospace,monospace;font-size:10px;resize:vertical}

@media(max-width:900px){
  .public-links{display:none}.landing-hero{min-height:auto;padding:75px 35px;grid-template-columns:1fr}.hero-stage{min-height:500px;margin-top:30px}.feature-bento{grid-template-columns:1fr;grid-template-rows:auto}.bento-book{grid-row:auto;min-height:540px}.bento{min-height:320px}.story-section{grid-template-columns:1fr;gap:40px}.story-sticky{position:static}.landing-safety{grid-template-columns:1fr}.auth-page{grid-template-columns:1fr}.auth-art{min-height:570px}.auth-panel{min-height:auto}.legal-layout{grid-template-columns:1fr}.legal-aside{position:static}.contact-page{grid-template-columns:1fr;gap:45px}.admin-stat-grid{grid-template-columns:repeat(2,1fr)}.admin-grid,.inbox-layout{grid-template-columns:1fr}.inbox-detail{position:static}.public-footer{grid-template-columns:1fr;text-align:center}.public-footer p{text-align:center}.public-footer nav{justify-content:center}.public-footer>span{grid-column:auto}}
@media(max-width:580px){
  .public-nav{width:calc(100% - 24px);height:72px}.public-actions .secondary{display:none}.public-brand{font-size:18px}.landing-hero{width:calc(100% - 12px);padding:55px 20px;border-radius:26px}.hero-copy h1{font-size:48px}.hero-copy>p{font-size:14px}.hero-stage{min-height:420px}.demo-card{left:2%;width:94%;min-height:300px}.float-card{transform:scale(.85)}.float-one{right:-9%}.float-two{left:-8%}.float-three{right:-8%}.trust-row{gap:10px}.landing-section,.story-section,.landing-safety,.landing-cta{width:calc(100% - 24px);margin:90px auto}.landing-section-head h2,.story-sticky h2,.landing-safety h2,.landing-cta h2{font-size:38px}.bento-book{padding:30px;min-height:500px}.bento-book h3{font-size:34px}.landing-safety{padding:38px 24px}.landing-cta{padding:70px 22px}.auth-art{min-height:520px;padding:30px 22px}.auth-art-copy{margin-top:80px}.auth-art-copy h1{font-size:43px}.auth-panel{padding:45px 20px}.auth-form h2{font-size:30px}.legal-layout{width:calc(100% - 20px);margin-top:20px}.legal-document{padding:24px}.legal-aside{display:none}.contact-page{width:calc(100% - 24px);margin-top:40px}.contact-intro h1{font-size:44px}.contact-form{padding:23px}.feedback-grid{grid-template-columns:1fr}.admin-head{display:block}.admin-head>a{margin-top:15px}.admin-stat-grid{grid-template-columns:1fr 1fr}.admin-tabs{top:66px}.content-health{align-items:flex-start;flex-direction:column}}

/* ---------------------------------------------------------------------------
   Additions: theme control, exam clock, announcements, recovery console.
   --------------------------------------------------------------------------- */

/* Focus is the only affordance a keyboard user has. One visible ring, everywhere. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--brand-2, #2f6fed);
  outline-offset: 2px;
  border-radius: 6px;
}

button#theme-toggle { background: none; border: inherit; cursor: pointer; color: inherit; font: inherit; }

.notify-chip { position: relative; }
.notify-dot {
  position: absolute; top: 6px; right: 6px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--danger, #f08290);
  box-shadow: 0 0 0 2px var(--surface, #fff);
}
.notify-dot[hidden] { display: none; }

.exam-clock-box { display: grid; grid-auto-flow: column; align-items: center; gap: 8px; }
.exam-clock-box svg { width: 18px; height: 18px; }
.exam-clock-box strong { font-variant-numeric: tabular-nums; font-size: 20px; }
.exam-clock-box span { font-size: 11px; color: var(--muted, var(--muted)); }
#exam-clock.urgent { color: var(--warning, #c07c22); }
#exam-clock.expired { color: var(--danger, var(--danger)); }

.notification-list { display: grid; gap: 14px; }
.notification-item.unread { border-left: 3px solid var(--brand, #2f6fed); }
.notification-item .badge {
  align-self: start; padding: 3px 9px; border-radius: 999px;
  background: var(--brand-soft, #e3f2ee); color: var(--brand, #1f5bd0);
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}

.reset-code {
  display: block; margin-top: 6px; padding: 6px 8px; border-radius: 8px;
  background: var(--surface-soft, #f1f6f4); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; word-break: break-all; user-select: all;
}
.reset-code[hidden] { display: none; }

/* The animated landing and the reveal-on-scroll sections must not move for anyone who has
   asked the platform to stop animating things. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* The mark inside the demo card sits on the blue chip, so it inverts rather than taking the
   brand colour it would be invisible against. */
.mini-logo .brand-mark { width: 20px; height: 20px; color: #fff; }
