:root {
  --ink: #18312b;
  --muted: #6c7c77;
  --forest: #173f36;
  --forest-2: #245c4e;
  --mint: #dcefe7;
  --mint-2: #edf7f2;
  --cream: #faf8f2;
  --paper: #fffefb;
  --coral: #ec765f;
  --yellow: #f5c85b;
  --blue: #6aa9c8;
  --line: #e5e9e4;
  --shadow: 0 18px 55px rgba(28, 60, 50, 0.09);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", system-ui, sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px 1fr; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 254px;
  padding: 30px 22px 22px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--line);
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.4px; }
.brand-mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 11px; background: var(--forest); color: #fff;
  font-family: "Playfair Display", serif; font-size: 24px; line-height: 1;
}

.nav-list { margin-top: 56px; display: grid; gap: 8px; }
.nav-item {
  min-height: 48px; padding: 0 14px; display: flex; align-items: center; gap: 13px;
  border-radius: 13px; color: var(--muted); font-weight: 600; transition: .2s ease;
}
.nav-item:hover { background: var(--mint-2); color: var(--forest); transform: translateX(2px); }
.nav-item.active { background: var(--mint); color: var(--forest); }
.nav-icon { width: 22px; text-align: center; font-size: 20px; }

.daily-goal { margin-top: auto; padding: 18px; border-radius: 18px; background: var(--mint-2); }
.goal-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.goal-top strong { color: var(--forest-2); }
.goal-track { height: 7px; margin: 12px 0 8px; overflow: hidden; border-radius: 99px; background: #d5e5de; }
.goal-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--coral); transition: width .6s ease; }
.daily-goal small { color: var(--muted); }

.sidebar-profile {
  width: 100%; margin-top: 14px; padding: 10px 8px; display: flex; gap: 10px; align-items: center;
  border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer;
}
.sidebar-profile:hover { background: #f4f5f2; }
.profile-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #f3d7c7; font-size: 12px; font-weight: 700; }
.sidebar-profile > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.sidebar-profile small { color: var(--muted); }
.chevron { font-size: 24px; color: var(--muted); }

.main-content { grid-column: 2; min-width: 0; }
.mobile-header { display: none; }
.page { width: min(1180px, calc(100% - 72px)); margin: 0 auto; padding: 52px 0 70px; animation: appear .35s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.eyebrow { margin: 0 0 8px; color: var(--coral); font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, .french-display { font-family: "Playfair Display", Georgia, serif; }
h1 { margin-bottom: 12px; font-size: clamp(38px, 5vw, 66px); line-height: 1.02; letter-spacing: -2.5px; }
h2 { margin-bottom: 8px; font-size: 31px; letter-spacing: -1px; }
h3 { margin-bottom: 8px; }
.lead { max-width: 620px; color: var(--muted); font-size: 17px; line-height: 1.65; }

.hero {
  position: relative; min-height: 350px; padding: 54px; overflow: hidden;
  border-radius: 30px; color: white; background: var(--forest); box-shadow: var(--shadow);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 360px; height: 360px; right: -80px; top: -120px; border: 76px solid rgba(255,255,255,.055); }
.hero::after { width: 170px; height: 170px; right: 185px; bottom: -105px; background: var(--coral); opacity: .9; }
.hero-content { position: relative; z-index: 2; max-width: 650px; }
.hero .eyebrow { color: #9ed1bd; }
.hero h1 em { color: #f5cf72; font-style: normal; }
.hero p { max-width: 540px; color: #cfe0da; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 29px; }

.button {
  min-height: 48px; padding: 0 21px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid transparent; border-radius: 14px; background: var(--forest); color: #fff; font-weight: 700; cursor: pointer; transition: .2s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(23,63,54,.15); }
.button.primary { background: var(--coral); }
.button.light { background: #fff; color: var(--forest); }
.button.ghost { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); }
.button.outline { border-color: var(--line); background: transparent; color: var(--forest); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.stats-row { margin: 24px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card { padding: 20px 22px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--mint); font-size: 20px; }
.stat-card strong { display: block; font-size: 22px; }
.stat-card small { color: var(--muted); }

.section-head { margin: 40px 0 18px; display: flex; justify-content: space-between; align-items: end; gap: 18px; }
.section-head p { margin: 0; color: var(--muted); }
.text-link { border: 0; background: none; color: var(--forest-2); font-weight: 700; cursor: pointer; }

.lesson-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lesson-card {
  min-height: 250px; padding: 25px; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); transition: .25s ease;
}
.lesson-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.lesson-number { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: var(--forest); background: var(--mint); font-weight: 700; }
.lesson-card:nth-child(2) .lesson-number { background: #f9e3c3; }
.lesson-card:nth-child(3) .lesson-number { background: #dbeaf2; }
.lesson-card h3 { margin-top: 26px; font-size: 20px; }
.lesson-card p { color: var(--muted); line-height: 1.55; }
.lesson-meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.lesson-status { color: var(--forest-2); font-weight: 700; }

.quote-card { margin-top: 22px; padding: 24px 28px; display: flex; align-items: center; gap: 18px; border-radius: 20px; background: #f6ead9; }
.quote-mark { font-family: Georgia, serif; font-size: 52px; line-height: .5; color: var(--coral); }
.quote-card p { margin: 0; font-family: "Playfair Display", serif; font-size: 18px; }
.quote-card small { margin-left: auto; color: var(--muted); white-space: nowrap; }

.page-header { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.page-header h1 { font-size: clamp(36px, 4vw, 50px); }

.path-list { display: grid; gap: 16px; }
.path-card {
  display: grid; grid-template-columns: 70px 1fr auto; gap: 22px; align-items: center;
  padding: 23px 25px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper);
}
.path-badge { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; background: var(--mint); font-size: 22px; font-weight: 700; }
.path-card p { margin: 0; color: var(--muted); }
.progress-mini { width: 120px; height: 6px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: var(--line); }
.progress-mini span { display: block; height: 100%; background: var(--coral); }

.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; }
.lesson-sheet { padding: 36px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); }
.lesson-sheet h2 { font-size: 39px; }
.lesson-sheet .translation { color: var(--muted); font-size: 18px; }
.phrase-box { margin: 28px 0; padding: 25px; border-left: 5px solid var(--coral); border-radius: 0 18px 18px 0; background: var(--mint-2); }
.phrase-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.french-display { font-size: 30px; }
.speak-button { width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--forest); color: white; cursor: pointer; font-size: 18px; }
.note { padding: 18px; border-radius: 15px; background: #fff4df; line-height: 1.6; }
.lesson-nav { margin-top: 30px; display: flex; justify-content: space-between; }
.lesson-index { padding: 22px; align-self: start; border-radius: 20px; background: var(--forest); color: white; }
.lesson-index h3 { margin-bottom: 18px; }
.lesson-index button { width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: #bcd1ca; text-align: left; cursor: pointer; }
.lesson-index button.active { background: rgba(255,255,255,.12); color: white; }

.practice-tabs { display: flex; gap: 8px; margin-bottom: 25px; padding: 5px; width: fit-content; border-radius: 14px; background: #e8ebe6; }
.practice-tabs button { padding: 9px 17px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.practice-tabs button.active { background: var(--paper); color: var(--forest); box-shadow: 0 3px 12px rgba(0,0,0,.06); }

.flash-wrap { max-width: 700px; margin: 0 auto; text-align: center; }
.flashcard { height: 365px; perspective: 1000px; cursor: pointer; }
.flash-inner { position: relative; width: 100%; height: 100%; transition: transform .55s; transform-style: preserve-3d; }
.flashcard.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; padding: 34px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  border-radius: 28px; backface-visibility: hidden; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.flash-face.back { transform: rotateY(180deg); background: var(--forest); color: white; }
.flash-label { position: absolute; top: 25px; left: 27px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.back .flash-label { color: #9bbab0; }
.flash-face .french-display { font-size: clamp(38px, 6vw, 62px); }
.flash-face p { color: var(--muted); }
.back p { color: #c4d8d1; }
.flash-actions { margin-top: 22px; display: flex; justify-content: center; align-items: center; gap: 14px; }
.round-button { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); cursor: pointer; font-size: 20px; }
.card-count { min-width: 80px; color: var(--muted); }

.quiz-card { max-width: 760px; margin: 0 auto; padding: 36px; border: 1px solid var(--line); border-radius: 25px; background: var(--paper); box-shadow: var(--shadow); }
.quiz-progress { height: 8px; overflow: hidden; border-radius: 99px; background: var(--line); }
.quiz-progress span { display: block; height: 100%; background: var(--coral); transition: width .3s; }
.quiz-card h2 { margin: 32px 0 25px; }
.answer-list { display: grid; gap: 11px; }
.answer-button { padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: white; text-align: left; cursor: pointer; }
.answer-button:hover { border-color: var(--forest-2); background: var(--mint-2); }
.answer-button.correct { border-color: #4d9c78; background: #e0f3e9; }
.answer-button.wrong { border-color: #d86b5c; background: #fde8e5; }
.quiz-feedback { min-height: 28px; margin: 16px 0 0; font-weight: 700; }

.progress-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.panel { padding: 27px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); }
.big-score { margin: 24px 0 4px; font-family: "Playfair Display", serif; font-size: 70px; line-height: 1; color: var(--forest); }
.bar-chart { height: 190px; padding-top: 24px; display: flex; align-items: end; gap: 13px; }
.bar-item { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.bar { width: min(34px, 80%); min-height: 8px; border-radius: 7px 7px 3px 3px; background: var(--mint); }
.bar.today { background: var(--coral); }
.achievement-list { display: grid; gap: 13px; margin-top: 18px; }
.achievement { padding: 14px; display: flex; gap: 12px; align-items: center; border-radius: 14px; background: var(--mint-2); }
.achievement-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); }

.toast { position: fixed; right: 26px; bottom: 26px; padding: 13px 18px; border-radius: 12px; color: #fff; background: var(--ink); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; z-index: 50; }
.toast.show { opacity: 1; transform: none; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }

@media (max-width: 950px) {
  .app-shell { display: block; }
  .main-content { min-width: 0; }
  .sidebar { transform: translateX(-105%); transition: transform .25s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .mobile-header { height: 72px; padding: 0 22px; display: flex; justify-content: space-between; align-items: center; background: var(--paper); border-bottom: 1px solid var(--line); }
  .menu-button { width: 42px; height: 42px; border: 0; border-radius: 11px; background: var(--mint); font-size: 20px; }
  .page { width: min(100% - 38px, 760px); padding-top: 28px; }
  .lesson-grid { grid-template-columns: 1fr; }
  .lesson-card { min-height: 220px; }
  .lesson-layout, .progress-grid { grid-template-columns: 1fr; }
  .lesson-index { order: -1; display: flex; gap: 4px; overflow-x: auto; }
  .lesson-index h3 { display: none; }
  .lesson-index button { width: auto; min-width: max-content; }
}

@media (max-width: 620px) {
  .hero { min-height: 440px; padding: 36px 27px; }
  .hero::after { right: 45px; }
  .stats-row { grid-template-columns: 1fr; }
  .section-head, .page-header { align-items: start; flex-direction: column; }
  .quote-card { align-items: flex-start; }
  .quote-card small { display: none; }
  .path-card { grid-template-columns: 54px 1fr; gap: 14px; }
  .path-card .button { grid-column: 1 / -1; }
  .path-badge { width: 50px; height: 50px; }
  .lesson-sheet { padding: 25px; }
  .flashcard { height: 390px; }
  .quiz-card { padding: 25px; }
}

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

/* Source-led edition */
.archive-hero::after { width: 220px; height: 220px; right: 120px; bottom: -155px; }
.source-strip { margin: 18px 0 24px; padding: 18px 24px; display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.source-strip div { display: grid; gap: 2px; }
.source-strip strong { font-family: "Playfair Display",serif; font-size: 17px; }
.source-strip small { color: var(--muted); }
.authority-note { margin: 22px 0; padding: 19px 22px; display: flex; align-items: flex-start; gap: 14px; border-radius: 16px; background: #f4ead7; }
.authority-note > span { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--coral); color: white; font-family: Georgia,serif; font-weight: 700; }
.authority-note p { margin: 2px 0 0; line-height: 1.55; }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-topline.compact { justify-content: flex-start; margin-bottom: 8px; }
.level-pill { padding: 5px 9px; border-radius: 99px; background: #edf0ec; color: var(--forest-2); font-size: 11px; font-weight: 700; }
.source-author { margin: 25px 0 4px !important; color: var(--coral) !important; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.compact .source-author { margin: 0 !important; }
.source-card h3 { margin-top: 4px; }
.media-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.media-grid .media-card:nth-child(1):nth-last-child(2), .media-grid .media-card:nth-child(2):last-child { grid-column: span 1; }
.media-card { min-height: 235px; padding: 25px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.media-card h3 { margin-top: 28px; font-size: 20px; }
.media-card p { color: var(--muted); line-height: 1.55; }
.source-type { color: var(--coral); font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.external-link { margin-top: auto; color: var(--forest-2); font-weight: 700; }
.external-link:hover { text-decoration: underline; }
.method-ribbon { margin-bottom: 22px; padding: 16px 20px; display: flex; gap: 24px; flex-wrap: wrap; border-radius: 15px; color: white; background: var(--forest); font-size: 13px; }
.method-ribbon span { color: #bad2ca; }
.reading-sheet { padding-top: 28px; }
.source-citation { margin-bottom: 24px; padding-bottom: 20px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); font-size: 13px; }
.source-citation > span { color: var(--coral); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.source-citation a { color: var(--forest-2); font-weight: 700; }
.excerpt-card { margin: 0 0 18px; padding: 30px; border-radius: 20px; color: white; background: var(--forest); }
.excerpt-card .eyebrow { color: #9ed1bd; }
.excerpt-card blockquote { margin: 22px 0 0; font-family: "Playfair Display",serif; font-size: clamp(24px,3.2vw,37px); line-height: 1.45; }
.excerpt-card .speak-button { background: var(--coral); }
.translation-panel { margin-bottom: 28px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 18px; background: #faf7ef; }
.translation-panel p:not(.eyebrow) { font-size: 17px; line-height: 1.65; }
.translation-panel small { color: var(--muted); }
.reading-note { color: var(--muted); line-height: 1.7; }
.vocab-grid { margin: 18px 0 10px; display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.vocab-item { padding: 13px 15px; display: flex; justify-content: space-between; gap: 12px; border-radius: 12px; background: var(--mint-2); }
.vocab-item span { color: var(--muted); text-align: right; }
.cefr-sequence { display: grid; gap: 10px; }
.cefr-stage { padding: 16px; display: flex; gap: 15px; border: 1px solid var(--line); border-radius: 14px; }
.cefr-stage > span { color: var(--coral); font-weight: 700; }
.cefr-stage p { margin: 4px 0 0; color: var(--muted); line-height: 1.5; }
.source-list { display: grid; gap: 12px; }
.source-entry { padding: 18px 20px; display: grid; grid-template-columns: 58px 1fr auto; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.source-entry h3 { margin: 2px 0 4px; }
.source-entry p { margin: 0; color: var(--muted); }
.source-manifesto { line-height: 1.7; }
.source-manifesto .external-link { display: inline-block; margin-top: 8px; }

@media (max-width: 950px) {
  .source-strip { grid-template-columns: repeat(2,1fr); }
  .media-grid { grid-template-columns: 1fr; }
  .source-citation { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .source-strip { grid-template-columns: 1fr 1fr; padding: 16px; }
  .source-strip strong { font-size: 14px; }
  .method-ribbon { gap: 10px 18px; }
  .method-ribbon strong { width: 100%; }
  .vocab-grid { grid-template-columns: 1fr; }
  .source-entry { grid-template-columns: 50px 1fr; }
  .source-entry .button { grid-column: 1/-1; }
  .excerpt-card { padding: 23px; }
  .lesson-nav { gap: 10px; flex-direction: column; }
}

/* Complete 24-week course */
.course-progress { margin: 26px 0; padding: 27px 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-radius: 22px; color: white; background: var(--forest); }
.course-progress h2 { margin-bottom: 4px; }
.course-progress p:last-child { margin: 0; color: #bcd1ca; }
.progress-ring { --value: 0; width: 92px; height: 92px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--coral) calc(var(--value) * 1%), rgba(255,255,255,.12) 0); position: relative; }
.progress-ring::after { content:""; position:absolute; width:68px; height:68px; border-radius:50%; background:var(--forest); }
.progress-ring span { position:relative; z-index:1; font-weight:700; }
.level-route { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin:24px 0; }
.level-card { position:relative; min-height:270px; padding:25px; overflow:hidden; border:1px solid var(--line); border-radius:22px; background:var(--paper); cursor:pointer; transition:.25s ease; }
.level-card:hover { transform:translateY(-4px); box-shadow:var(--shadow); }
.level-index { width:50px; height:50px; display:grid; place-items:center; margin-bottom:28px; border-radius:15px; background:var(--mint); font-family:"Playfair Display",serif; font-size:20px; font-weight:700; }
.level-card:nth-child(2) .level-index { background:#f8e3bf; }
.level-card:nth-child(3) .level-index { background:#daeaf2; }
.level-card h3 { font-size:23px; }
.level-card p:not(.eyebrow) { color:var(--muted); line-height:1.55; }
.level-card small { display:block; padding-right:20px; color:var(--forest-2); }
.level-arrow { position:absolute; right:24px; bottom:22px; font-size:22px; }
.week-feature { padding:27px; display:grid; grid-template-columns:72px 1.1fr 1fr; gap:22px; align-items:center; border:1px solid var(--line); border-radius:22px; background:var(--paper); }
.feature-number { font-family:"Playfair Display",serif; font-size:54px; color:var(--coral); }
.week-feature h3 { margin:12px 0 7px; font-size:22px; }
.week-feature p { color:var(--muted); line-height:1.5; }
.feature-units { display:grid; gap:8px; }
.mini-unit { width:100%; padding:11px 13px; display:grid; grid-template-columns:30px 1fr auto; gap:10px; align-items:center; border:1px solid var(--line); border-radius:11px; background:#fff; text-align:left; cursor:pointer; }
.mini-unit:hover { border-color:var(--forest-2); }
.mini-unit > span { width:26px; height:26px; display:grid; place-items:center; border-radius:50%; background:var(--mint); font-size:12px; font-weight:700; }
.mini-unit.done > span { color:white; background:var(--forest-2); }
.mini-unit small { color:var(--muted); }
.filter-tabs { width:fit-content; margin:0 0 25px; padding:5px; display:flex; gap:5px; border-radius:14px; background:#e8ebe6; }
.filter-tabs button { padding:9px 16px; border:0; border-radius:10px; background:transparent; color:var(--muted); font-weight:700; cursor:pointer; }
.filter-tabs button.active { color:var(--forest); background:var(--paper); box-shadow:0 3px 10px rgba(0,0,0,.06); }
.week-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:17px; }
.week-card { min-height:245px; padding:23px; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:20px; background:var(--paper); cursor:pointer; transition:.22s ease; }
.week-card:hover { transform:translateY(-4px); box-shadow:var(--shadow); }
.week-card-top { display:flex; justify-content:space-between; align-items:center; }
.week-no { font-family:"Playfair Display",serif; font-size:17px; font-weight:700; }
.week-card .source-author { margin-top:28px !important; }
.week-card h3 { font-size:20px; }
.week-card > p:not(.source-author) { color:var(--muted); line-height:1.5; }
.unit-dots { margin-top:auto; display:flex; align-items:center; gap:6px; }
.unit-dots span { width:24px; height:6px; border-radius:99px; background:var(--line); }
.unit-dots span.done { background:var(--coral); }
.unit-dots small { margin-left:auto; color:var(--muted); }
.week-overview-head { margin-bottom:25px; }
.week-kicker { margin:28px 0 13px; display:flex; align-items:center; gap:10px; color:var(--coral); font-weight:700; }
.week-overview-head h1 { font-size:clamp(42px,5vw,62px); }
.week-source-banner { padding:30px; display:grid; grid-template-columns:.7fr 1.3fr; gap:30px; align-items:center; border-radius:24px; color:white; background:var(--forest); }
.week-source-banner p:last-child { margin:0; color:#bcd1ca; }
.week-source-banner blockquote { margin:0; padding-left:25px; border-left:3px solid var(--coral); font-family:"Playfair Display",serif; font-size:23px; line-height:1.5; }
.unit-list { display:grid; gap:12px; }
.unit-row { padding:19px 20px; display:grid; grid-template-columns:48px 1fr auto; gap:18px; align-items:center; border:1px solid var(--line); border-radius:17px; background:var(--paper); cursor:pointer; transition:.2s; }
.unit-row:hover { border-color:#b9cbc4; transform:translateX(3px); }
.unit-row.completed { background:#f5faf7; }
.unit-kind-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:14px; color:var(--forest); background:var(--mint); font-size:18px; font-weight:700; }
.unit-row h3 { margin:3px 0 5px; }
.unit-row p:last-child { margin:0; color:var(--muted); }
.week-nav { margin-top:25px; display:flex; justify-content:space-between; }
.unit-header { margin-bottom:24px; }
.unit-header > div { margin:25px 0 12px; display:flex; gap:10px; align-items:center; }
.unit-header h1 { max-width:920px; font-size:clamp(38px,4.5vw,58px); }
.unit-duration { color:var(--muted); font-size:13px; }
.unit-sheet { padding:31px; border:1px solid var(--line); border-radius:24px; background:var(--paper); }
.unit-columns { margin:30px 0 10px; display:grid; grid-template-columns:1fr 1fr; gap:30px; }
.unit-columns h2 { font-size:26px; }
.unit-footer { margin-top:18px; display:grid; grid-template-columns:1fr auto 1fr; gap:12px; }
.unit-footer button:last-child { justify-self:end; }
.official-source-mark { margin-bottom:22px; display:flex; gap:17px; align-items:center; }
.official-source-mark > span { width:64px; height:64px; display:grid; place-items:center; border-radius:18px; color:white; background:var(--forest); font-weight:700; }
.official-source-mark h2 { margin-bottom:3px; }
.official-source-mark p:last-child { margin:0; color:var(--muted); }
.media-launch { min-height:290px; padding:34px; display:grid; grid-template-columns:1fr 180px; gap:25px; align-items:center; border-radius:23px; color:white; background:var(--forest); }
.media-launch h2 { margin:18px 0 10px; font-size:35px; }
.media-launch p { max-width:630px; color:#c4d8d1; line-height:1.6; }
.media-launch .button { margin-top:10px; }
.media-symbol { width:150px; height:150px; display:grid; place-items:center; border:35px solid rgba(255,255,255,.07); border-radius:50%; color:var(--yellow); background:rgba(255,255,255,.05); font-size:38px; }
.task-list { display:grid; gap:10px; }
.task-check { padding:16px; display:flex; align-items:center; gap:14px; border:1px solid var(--line); border-radius:13px; cursor:pointer; }
.task-check:has(input:checked) { background:var(--mint-2); }
.task-check input { width:18px; height:18px; accent-color:var(--forest-2); }
.task-check span { display:flex; gap:14px; align-items:center; }
.task-check strong { color:var(--coral); }
.lab-brief { padding:29px; display:grid; grid-template-columns:1fr 1fr; gap:30px; align-items:center; border-radius:20px; background:#f5ebd9; }
.lab-brief blockquote { margin:0; padding-left:22px; border-left:3px solid var(--coral); font-family:"Playfair Display",serif; font-size:20px; line-height:1.55; }
.focus-chip { display:inline-block; padding:7px 10px; border-radius:99px; background:#fff8; color:var(--forest-2); font-size:12px; font-weight:700; }
.response-prompt { margin-top:25px; padding:25px; border:1px solid var(--line); border-radius:18px; }
.response-prompt h3 { line-height:1.5; }
.response-prompt textarea { width:100%; min-height:150px; margin:12px 0; padding:16px; resize:vertical; border:1px solid var(--line); border-radius:13px; color:var(--ink); background:#fff; line-height:1.55; }
.response-prompt textarea:focus { outline:2px solid var(--mint); border-color:var(--forest-2); }
.self-check { margin-top:14px; padding:17px; border-radius:13px; background:var(--mint-2); }
.self-check p { margin:7px 0; }
.self-check a { color:var(--forest-2); font-weight:700; }
.review-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:22px; align-items:start; }
.review-stats { position:sticky; top:25px; }
.review-stat { padding:16px 0; display:flex; justify-content:space-between; align-items:end; border-bottom:1px solid var(--line); }
.review-stat strong { font-family:"Playfair Display",serif; font-size:34px; }
.review-stat span { color:var(--muted); }
.review-stats .button { width:100%; margin-top:20px; }

@media (max-width:1100px) {
  .week-grid { grid-template-columns:repeat(2,1fr); }
  .week-feature { grid-template-columns:70px 1fr; }
  .feature-units { grid-column:1/-1; }
}
@media (max-width:950px) {
  .level-route { grid-template-columns:1fr; }
  .level-card { min-height:220px; }
  .week-source-banner, .unit-columns, .lab-brief { grid-template-columns:1fr; }
  .review-layout { grid-template-columns:1fr; }
  .review-stats { position:static; }
}
@media (max-width:620px) {
  .course-progress { align-items:flex-start; }
  .progress-ring { width:76px; height:76px; }
  .progress-ring::after { width:56px; height:56px; }
  .week-feature { grid-template-columns:1fr; }
  .feature-number { font-size:40px; }
  .week-grid { grid-template-columns:1fr; }
  .filter-tabs { width:100%; overflow-x:auto; }
  .filter-tabs button { white-space:nowrap; }
  .week-source-banner { padding:24px; }
  .week-source-banner blockquote { font-size:19px; }
  .unit-row { grid-template-columns:44px 1fr; }
  .unit-row .button { grid-column:1/-1; }
  .unit-sheet { padding:20px; }
  .media-launch { grid-template-columns:1fr; padding:25px; }
  .media-symbol { display:none; }
  .unit-footer { grid-template-columns:1fr 1fr; }
  .unit-footer [data-complete-unit] { grid-column:1/-1; grid-row:1; }
  .unit-footer button:last-child { justify-self:stretch; }
  .source-citation { gap:7px; }
}

/* Account and cross-device sync */
body.modal-open { overflow:hidden; }
.sidebar-profile.is-signed-in .profile-avatar { color:white; background:var(--forest-2); }
.account-modal[hidden] { display:none; }
.account-modal { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:22px; }
.modal-scrim { position:absolute; inset:0; width:100%; height:100%; border:0; background:rgba(16,35,30,.58); backdrop-filter:blur(5px); cursor:default; }
.account-dialog { position:relative; width:min(520px,100%); max-height:calc(100vh - 44px); overflow:auto; padding:30px; border:1px solid rgba(255,255,255,.45); border-radius:25px; background:var(--paper); box-shadow:0 28px 80px rgba(16,35,30,.28); }
.account-dialog-head { margin-bottom:24px; display:flex; justify-content:space-between; gap:20px; align-items:flex-start; }
.account-dialog-head h2 { margin:4px 0 0; font-size:30px; }
.modal-close { width:38px; height:38px; flex:0 0 auto; border:1px solid var(--line); border-radius:50%; color:var(--ink); background:white; font-size:24px; line-height:1; cursor:pointer; }
.auth-tabs { margin-bottom:22px; padding:5px; display:grid; grid-template-columns:1fr 1fr; gap:5px; border-radius:13px; background:#e8ebe6; }
.auth-tabs button { padding:10px 12px; border:0; border-radius:9px; color:var(--muted); background:transparent; font-weight:700; cursor:pointer; }
.auth-tabs button.active { color:var(--forest); background:white; box-shadow:0 3px 10px rgba(0,0,0,.07); }
.auth-form { display:grid; gap:16px; }
.auth-form label { display:grid; gap:7px; color:var(--forest); font-size:13px; font-weight:700; }
.auth-form input { width:100%; padding:13px 14px; border:1px solid var(--line); border-radius:11px; color:var(--ink); background:white; font:inherit; }
.auth-form input:focus { outline:2px solid var(--mint); border-color:var(--forest-2); }
.auth-form .button { width:100%; margin-top:3px; }
.auth-form .button:disabled { opacity:.65; cursor:wait; }
.form-message { min-height:20px; margin:0; color:var(--coral); font-size:13px; line-height:1.45; }
.account-note { margin-top:19px; padding:14px 16px; display:grid; gap:3px; border-radius:13px; background:var(--mint-2); }
.account-note strong { color:var(--forest); font-size:13px; }
.account-note span { color:var(--muted); font-size:12px; line-height:1.45; }
.cloud-setup-card { padding:8px 2px 2px; text-align:center; }
.cloud-icon { width:62px; height:62px; margin:0 auto 16px; display:grid; place-items:center; border-radius:18px; color:white; background:var(--forest); font-size:25px; }
.cloud-setup-card h3 { margin:0 0 9px; font-size:23px; }
.cloud-setup-card > p { margin:0; color:var(--muted); line-height:1.6; }
.cloud-setup-card .account-note { text-align:left; }
.account-identity { padding:18px; display:flex; gap:14px; align-items:center; border:1px solid var(--line); border-radius:16px; }
.account-identity > span { width:52px; height:52px; display:grid; place-items:center; border-radius:15px; color:white; background:var(--forest-2); font-weight:700; }
.account-identity h3 { margin:3px 0 0; font-size:17px; overflow-wrap:anywhere; }
.sync-summary { margin:16px 0; padding:17px 18px; display:flex; gap:12px; align-items:flex-start; border-radius:15px; background:var(--mint-2); }
.sync-dot { width:9px; height:9px; margin-top:5px; flex:0 0 auto; border-radius:50%; background:#45a478; box-shadow:0 0 0 4px rgba(69,164,120,.14); }
.sync-summary div { display:grid; gap:4px; }
.sync-summary small { color:var(--muted); line-height:1.45; }
.account-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.danger-link { width:100%; margin-top:18px; padding:8px; border:0; color:#a3483d; background:transparent; font-weight:700; cursor:pointer; }

@media (max-width:620px) {
  .account-modal { padding:0; align-items:end; }
  .account-dialog { width:100%; max-height:92vh; padding:24px 20px; border-radius:25px 25px 0 0; }
  .account-dialog-head h2 { font-size:25px; }
  .account-actions { grid-template-columns:1fr; }
}
