:root {
  color-scheme: light;
  --ink: #1e293b;
  --muted: #64748b;
  --subtle: #e2e8f0;
  --line: #cbd5e1;
  --paper: #ffffff;
  --mist: #f8fafc;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --brand-soft: #ccfbf1;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --rose: #e11d48;
  --rose-soft: #ffe4e6;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  --radius: 8px;
  --content: min(1180px, calc(100vw - 36px));
  font-family:
    "Inter",
    "Segoe UI",
    "Microsoft YaHei",
    "PingFang SC",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 360px),
    var(--mist);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 14px max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(203, 213, 225, 0.8);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #14b8a6);
  color: white;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}

.nav a:hover,
.nav a.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 168px;
}

.main {
  flex: 1;
  width: 100%;
}

.section {
  width: var(--content);
  margin: 0 auto;
  padding: 34px 0;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(122deg, #102a2b 0%, #0f766e 54%, #3b82f6 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 72px);
  color: white;
  min-height: 540px;
  display: grid;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 24, 38, 0.38), transparent 42%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 36px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: var(--content);
  margin: 0 auto;
  padding: 72px 0 82px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 0.78fr);
  gap: 58px;
  align-items: center;
}

.hero h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-size: clamp(42px, 5.6vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p {
  max-width: 650px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  line-height: 1.8;
}

.hero-copy {
  display: grid;
  gap: 14px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 800;
}

.hero-link {
  color: white;
  border-color: rgba(255, 255, 255, 0.22);
}

.hero-link:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hero-board {
  position: relative;
  min-height: 430px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1)),
    rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.curve {
  position: absolute;
  inset: 26px 22px auto 22px;
  height: 160px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
}

.curve::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -1px;
  height: 150px;
  background: radial-gradient(ellipse at center bottom, rgba(255, 255, 255, 0.75) 0 8%, rgba(255, 255, 255, 0.36) 9% 28%, transparent 64%);
  clip-path: polygon(0 100%, 7% 84%, 13% 67%, 20% 46%, 29% 28%, 39% 14%, 50% 8%, 61% 14%, 71% 28%, 80% 46%, 87% 67%, 93% 84%, 100% 100%);
}

.board-card {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric {
  min-height: 94px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.metric strong {
  display: block;
  font-size: 28px;
  margin-bottom: 6px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.learning-dashboard {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
}

.dashboard-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.88);
}

.dashboard-top strong {
  margin-left: 8px;
  font-size: 13px;
  letter-spacing: 0;
}

.window-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
}

.window-dot:nth-child(2) {
  background: #fcd34d;
}

.window-dot:nth-child(3) {
  background: #93c5fd;
}

.dashboard-visual {
  position: relative;
  min-height: 185px;
  margin: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.02)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 42px);
  overflow: hidden;
}

.learning-dashboard .curve {
  inset: auto 28px 42px 28px;
  height: 118px;
  border-bottom-color: rgba(255, 255, 255, 0.72);
}

.learning-dashboard .curve::before {
  left: 4%;
  right: 4%;
  height: 126px;
  background: radial-gradient(ellipse at center bottom, rgba(255, 255, 255, 0.86) 0 9%, rgba(191, 219, 254, 0.46) 10% 30%, transparent 68%);
}

.z-marker {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border-radius: 50%;
  background: white;
  color: var(--brand-strong);
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
}

.bar-set {
  position: absolute;
  right: 20px;
  bottom: 24px;
  display: flex;
  align-items: end;
  gap: 7px;
  height: 98px;
}

.bar-set span {
  width: 12px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, #fbbf24, #f97316);
}

.learning-dashboard .board-card {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  margin: 0 18px 14px;
}

.learning-dashboard .metric {
  min-height: 88px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.1);
}

.next-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  margin: 0 18px 18px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.48);
  color: white;
}

.next-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.next-card strong {
  min-width: 0;
  line-height: 1.45;
}

.next-card .primary-button {
  grid-row: 1 / span 2;
  grid-column: 2;
  box-shadow: none;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.eyebrow {
  margin: 0;
  color: var(--brand-strong);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 12px;
}

.hero .eyebrow {
  color: var(--accent-soft);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.primary-button {
  background: var(--brand);
  color: white;
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.22);
}

.primary-button:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
}

.secondary-button {
  background: white;
  color: var(--brand-strong);
  border: 1px solid var(--line);
}

.secondary-button:hover {
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.ghost-button {
  background: transparent;
  color: var(--brand-strong);
  border: 1px solid transparent;
}

.ghost-button:hover {
  background: var(--brand-soft);
}

.danger-button {
  background: var(--rose-soft);
  color: #be123c;
}

.danger-button:hover {
  background: #fecdd3;
}

.icon-button {
  width: 42px;
  padding: 0;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 22px;
}

.full-width {
  width: 100%;
}

.button-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 18px;
}

.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.44fr);
  align-items: start;
}

.three-col {
  grid-template-columns: repeat(3, 1fr);
}

.panel {
  background: var(--paper);
  border: 1px solid var(--subtle);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.panel-pad {
  padding: 22px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2,
.panel h2,
.panel h3 {
  margin: 0;
  line-height: 1.2;
}

.section-head p,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

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

.lesson-card {
  position: relative;
  overflow: hidden;
  min-height: 248px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--subtle);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98)),
    white;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.lesson-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--blue), var(--accent));
}

.lesson-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
}

.lesson-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.lesson-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.lesson-card-top,
.lesson-card-foot,
.lesson-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lesson-index {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--blue);
  font-weight: 900;
}

.lesson-unit {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.lesson-meta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--subtle);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.lesson-card-foot {
  margin-top: 4px;
}

.mini-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--mist);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mini-status.is-done {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--mist);
  color: var(--muted);
  border: 1px solid var(--subtle);
  font-size: 12px;
  font-weight: 750;
}

.tag.good {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: #99f6e4;
}

.tag.warn {
  color: #92400e;
  background: var(--accent-soft);
  border-color: #fde68a;
}

.tag.bad {
  color: #be123c;
  background: var(--rose-soft);
  border-color: #fecdd3;
}

.progress-line {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
}

.progress-line span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 0.2s ease;
}

.home-strip {
  background: white;
  border-bottom: 1px solid var(--subtle);
}

.home-strip-inner {
  width: var(--content);
  min-height: 70px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  align-items: center;
}

.home-strip-inner span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--mist);
  color: #475569;
  border: 1px solid var(--subtle);
  font-size: 13px;
  font-weight: 850;
}

.syllabus-section {
  padding-top: 42px;
}

.home-section-head h2 {
  font-size: clamp(28px, 4vw, 42px);
}

.home-progress-panel {
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--subtle);
  border-radius: 8px;
  background: white;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

.home-progress-panel strong {
  display: block;
  font-size: 18px;
}

.home-progress-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.progress-ring {
  --value: 0;
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--value) * 1%), #e5e7eb 0);
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: white;
}

.progress-ring span {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-weight: 900;
  font-size: 14px;
}

.feature-row {
  padding-top: 6px;
}

.feature-card {
  position: relative;
  overflow: hidden;
  min-height: 176px;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--blue), var(--accent));
}

.feature-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #0f172a;
  color: white;
  font-weight: 900;
  font-size: 13px;
}

.learning-layout {
  width: var(--content);
  margin: 0 auto;
  padding: 24px 0 38px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.resource-layout {
  width: var(--content);
  margin: 0 auto;
  padding: 28px 0 44px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.lesson-sidebar {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.sidebar-head {
  padding: 18px;
  border-bottom: 1px solid var(--subtle);
}

.lesson-list {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.lesson-tab {
  width: 100%;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  text-align: left;
}

.lesson-tab:hover,
.lesson-tab.active {
  background: var(--brand-soft);
  border-color: #99f6e4;
}

.lesson-tab small {
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.status-dot.done {
  background: var(--brand);
}

.lesson-content {
  padding: 26px;
}

.lesson-hero {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--subtle);
}

.lesson-hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: 0;
}

.resource-hero {
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--subtle);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(204, 251, 241, 0.88), rgba(219, 234, 254, 0.84)),
    white;
}

.objective-list,
.formula-list,
.tip-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.objective-list li,
.formula-list li,
.tip-list li {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--mist);
  border: 1px solid var(--subtle);
  line-height: 1.65;
}

.formula-list li {
  font-weight: 750;
  color: var(--brand-strong);
  background: #f0fdfa;
}

.content-block {
  padding: 22px 0;
  border-bottom: 1px solid var(--subtle);
}

.content-block h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.content-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.quiz {
  display: grid;
  gap: 16px;
}

.resource-form {
  gap: 18px;
}

.question {
  border: 1px solid var(--subtle);
  border-radius: 8px;
  padding: 16px;
  background: white;
}

.practice-question,
.paper-question {
  position: relative;
  padding: 18px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
}

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

.question-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0f172a;
  color: white;
  font-weight: 900;
}

.question h3 {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.55;
}

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

.option {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
}

.option input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.answer-field {
  margin-top: 12px;
}

.answer-field input,
.structured-part input {
  background: white;
}

.structured-parts {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.structured-part {
  padding: 14px;
  border: 1px solid var(--subtle);
  border-radius: 8px;
  background: var(--mist);
}

.structured-part span {
  line-height: 1.6;
}

.structured-part strong {
  color: var(--brand-strong);
}

.feedback {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  line-height: 1.65;
}

.feedback.correct {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.feedback.wrong {
  background: var(--rose-soft);
  color: #be123c;
}

.result-summary {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid #99f6e4;
  background:
    linear-gradient(135deg, rgba(240, 253, 250, 0.98), rgba(239, 246, 255, 0.98)),
    white;
}

.result-summary h2 {
  margin: 8px 0;
  font-size: 32px;
}

.result-summary p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.paper-layout {
  width: var(--content);
  margin: 0 auto;
  padding: 28px 0 44px;
  display: grid;
  gap: 18px;
}

.paper-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(37, 99, 235, 0.08)),
    white;
}

.paper-hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(34px, 5vw, 58px);
}

.paper-stats {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  gap: 10px;
}

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

.paper-card {
  min-height: 142px;
  display: grid;
  gap: 8px;
  align-content: start;
  text-align: left;
  border: 1px solid var(--subtle);
  border-radius: 8px;
  padding: 16px;
  background: white;
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
}

.paper-card:hover,
.paper-card.active {
  border-color: var(--brand);
  background: #f0fdfa;
}

.paper-card strong {
  font-size: 22px;
}

.paper-card small {
  color: var(--muted);
  font-weight: 700;
}

.paper-year {
  width: fit-content;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #0f172a;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.timer-card {
  min-width: 138px;
  padding: 14px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--subtle);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.timer-card span,
.timer-card strong {
  display: block;
}

.timer-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timer-card strong {
  margin-top: 6px;
  color: var(--brand-strong);
  font-size: 28px;
}

.status-page {
  width: min(760px, calc(100vw - 36px));
  margin: 58px auto;
  text-align: center;
}

.status-page h1 {
  margin: 8px 0 12px;
  font-size: clamp(30px, 5vw, 54px);
}

.profile-layout {
  width: var(--content);
  margin: 0 auto;
  padding: 28px 0 42px;
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(320px, 0.3fr);
  gap: 18px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--ink);
  font-weight: 750;
  font-size: 13px;
}

.field input,
.field select,
.field textarea,
.search-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 90px;
  padding-top: 10px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

.form-error {
  min-height: 20px;
  color: #be123c;
  font-size: 13px;
  line-height: 1.5;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--subtle);
  border-radius: 8px;
  background: white;
}

.stat strong {
  display: block;
  font-size: 28px;
  margin-bottom: 4px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.admin-layout {
  width: var(--content);
  margin: 0 auto;
  padding: 28px 0 42px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin: 18px 0;
}

.table-wrap {
  overflow: auto;
}

.user-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--subtle);
  text-align: left;
  vertical-align: top;
}

.user-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: var(--mist);
}

.user-table td {
  line-height: 1.5;
}

.user-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.empty-state {
  padding: 38px;
  text-align: center;
  color: var(--muted);
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(5px);
}

.modal-panel {
  position: relative;
  width: min(480px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.modal-head {
  padding-right: 42px;
}

.modal-head h2 {
  margin: 8px 0;
  font-size: 28px;
}

.modal-head p:last-child {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--mist);
  border: 1px solid var(--subtle);
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: white;
  color: var(--brand-strong);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.toast-region {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 13px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  line-height: 1.5;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 22px 18px;
  color: var(--muted);
  border-top: 1px solid var(--subtle);
  background: white;
  font-size: 13px;
}

.hidden,
.register-only.hidden {
  display: none !important;
}

@media (max-width: 1040px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-inner,
  .two-col,
  .profile-layout,
  .learning-layout,
  .resource-layout {
    grid-template-columns: 1fr;
  }

  .home-hero-inner {
    gap: 30px;
  }

  .home-strip-inner {
    grid-template-columns: repeat(3, 1fr);
    padding: 12px 0;
  }

  .lesson-sidebar {
    position: static;
    max-height: none;
  }

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

  .stat-grid,
  .three-col,
  .paper-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .paper-hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  :root {
    --content: min(100vw - 24px, 1180px);
  }

  .topbar {
    padding: 12px;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .top-actions {
    min-width: 0;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    padding: 38px 0 44px;
  }

  .hero h1 {
    font-size: clamp(36px, 12vw, 48px);
  }

  .hero p {
    font-size: 16px;
  }

  .hero-board {
    min-height: auto;
  }

  .dashboard-visual {
    min-height: 150px;
    margin: 12px;
  }

  .board-card,
  .learning-dashboard .board-card {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 70px;
  }

  .next-card {
    grid-template-columns: 1fr;
    margin: 0 12px 12px;
  }

  .next-card .primary-button {
    grid-row: auto;
    grid-column: auto;
  }

  .home-strip-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .home-progress-panel {
    min-width: 0;
    width: 100%;
  }

  .lesson-card-foot {
    align-items: stretch;
    display: grid;
  }

  .lesson-grid,
  .stat-grid,
  .three-col,
  .paper-grid,
  .paper-stats {
    grid-template-columns: 1fr;
  }

  .lesson-hero {
    display: grid;
  }

  .resource-hero {
    padding: 16px;
  }

  .question-head {
    align-items: start;
  }

  .timer-card {
    width: 100%;
  }

  .section-head,
  .admin-toolbar {
    display: grid;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }
}
