:root {
  --bg: #f3f6f8;
  --panel: #ffffff;
  --ink: #14212b;
  --muted: #5d6d7c;
  --line: #dbe3ea;
  --accent: #0b6b5f;
  --accent-soft: #e5f4f1;
  --blue: #255d9a;
  --blue-soft: #e8f1fb;
  --amber-soft: #fff4df;
  --shadow: 0 18px 45px rgba(20, 33, 43, .09);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(37, 93, 154, .28);
  outline-offset: 2px;
}
.site-header {
  padding: 24px clamp(18px, 5vw, 64px);
  background: linear-gradient(135deg, #fff, #f7fbfc 58%, #e8f5f2);
  border-bottom: 1px solid var(--line);
}
.site-header.compact { padding-bottom: 22px; }
.lesson-header {
  padding: 20px clamp(18px, 4vw, 56px) 24px;
}
.lesson-header-inner {
  width: min(100%, 1840px);
  margin: 0 auto;
}
.lesson-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.lesson-topbar .brand-strip {
  margin-bottom: 0;
}
.home-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 28px;
  align-items: end;
}
.hero-copy {
  min-width: 0;
}
.brand-strip {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  max-width: 100%;
  margin-bottom: 14px;
  color: var(--ink);
}
.brand-logo-full,
.brand-logo-mark {
  display: block;
  height: auto;
  object-fit: contain;
  object-position: left center;
}
.brand-logo-full {
  width: min(430px, 72vw);
  max-height: 72px;
}
.brand-logo-mark {
  width: 78px;
  max-height: 58px;
}
.brand-strip-full {
  display: flex;
  width: min(460px, 100%);
}
.brand-strip-full .brand-logo-mark,
.brand-strip-full .brand-text {
  display: none;
}
.brand-strip-compact .brand-logo-full {
  display: none;
}
.brand-text {
  min-width: 0;
}
.brand-strip strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.15;
}
.brand-strip span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .9rem;
}
.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .04em;
}
h1 {
  margin: 0;
  max-width: 1060px;
  font-size: clamp(1.85rem, 3.5vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
h2 {
  margin: 0 0 12px;
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  line-height: 1.2;
}
.subtitle {
  max-width: 980px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 1rem;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 22px;
  max-width: 980px;
}
.home-header .metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: center;
  margin-top: 0;
  max-width: none;
}
.metrics div, .toolbar, .lesson-card, .lesson-content, .lesson-aside .aside-card, .note, .overview-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.metrics div { padding: 14px; }
.home-header .metrics div { padding: 12px; }
.metrics strong { display: block; font-size: 1.55rem; }
.metrics span, .lesson-card span, .aside-card span, .source-list span { color: var(--muted); }
.index-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 20px;
  padding: 22px clamp(18px, 5vw, 64px) 40px;
}
.toolbar {
  align-self: start;
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
  padding: 16px;
}
label { font-weight: 800; font-size: .9rem; }
input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font: inherit;
}
.count {
  margin: 0;
  display: inline-flex;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
}
.filter-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
}
.overview, .lesson-list-section {
  grid-column: 2;
}
.overview {
  display: grid;
  gap: 14px;
}
.overview-block {
  padding: 18px;
}
.overview-block p {
  margin: 0;
  color: var(--muted);
}
.overview-block p + p {
  margin-top: 10px;
}
.goal-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.goal-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.goal-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}
.goal-item h3 {
  margin: 0 0 4px;
  font-size: .98rem;
  line-height: 1.2;
}
.goal-item p {
  font-size: .9rem;
  line-height: 1.4;
}
.month-list {
  display: grid;
  gap: 20px;
}
.month-section {
  display: grid;
  gap: 12px;
}
.month-section.is-hidden,
.lesson-card.is-hidden {
  display: none !important;
}
.month-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.month-heading h2 { margin: 0; }
.month-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
}
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 13px;
}
.lesson-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 9px;
  padding: 15px;
  color: var(--ink);
  text-decoration: none;
}
.lesson-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.card-top {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.lesson-id {
  flex: 0 0 auto;
  min-width: 38px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff !important;
  font-weight: 900;
  text-align: center;
}
.lesson-meta {
  min-width: 0;
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-card strong {
  font-size: 1.08rem;
  line-height: 1.25;
}
.full-topic {
  display: -webkit-box;
  font-size: .9rem;
  line-height: 1.38;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.lesson-result {
  font-size: .92rem;
  line-height: 1.4;
}
.lesson-result b { color: var(--ink); }
.open-label {
  width: fit-content;
  margin-top: 4px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--accent) !important;
  font-weight: 850;
}
.lesson-card:hover .open-label {
  background: var(--accent);
  color: #fff !important;
}
.note {
  grid-column: 2;
  margin-top: 20px;
  padding: 18px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  margin-bottom: 16px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.lesson-topbar .back-link {
  flex: 0 0 auto;
  margin-bottom: 0;
}
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 22px;
  width: min(100%, 1840px);
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 40px) 42px;
  align-items: start;
}
.lesson-aside {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 16px;
}
.aside-card { padding: 14px; }
.aside-card strong { display: block; margin-bottom: 8px; }
.video-card { background: var(--amber-soft); }
.video-card span, .resource-card span {
  display: block;
  margin-bottom: 10px;
  font-size: .92rem;
}
.resource-card {
  background: #fbfdff;
}
.resource-link {
  display: inline-flex;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 850;
  text-decoration: none;
}
.compact-source-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding-left: 18px;
}
.compact-source-list a {
  display: inline-block;
  font-weight: 850;
  line-height: 1.25;
}
.lesson-content {
  padding: 22px;
  min-width: 0;
}
.lesson-content section + section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.must {
  background: var(--accent-soft);
  border: 1px solid #b9ddd6;
  border-radius: 10px;
  padding: 18px !important;
}
li + li { margin-top: 6px; }
.source-list {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}
.schedule {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.schedule th, .schedule td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.schedule th {
  background: var(--blue-soft);
  color: var(--blue);
  font-size: .88rem;
}
.schedule td:first-child {
  width: 92px;
  font-weight: 850;
  white-space: nowrap;
}
.source-list a { font-weight: 800; }
.lesson-content a { overflow-wrap: anywhere; }
.source-list span { display: block; font-size: .92rem; }
.lesson-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 800;
}
.nav-link.primary { background: var(--accent); color: #fff; }
@media (max-width: 1080px) {
  .home-header {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .home-header .metrics {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    margin-top: 0;
  }
}
@media (max-width: 840px) {
  .metrics, .index-layout, .lesson-layout { grid-template-columns: 1fr; }
  .home-header .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar, .lesson-aside { position: static; }
  .lesson-content { order: 1; }
  .lesson-aside { order: 2; }
  .note, .overview, .lesson-list-section { grid-column: auto; }
  .month-heading { align-items: start; flex-direction: column; }
  .schedule { display: block; overflow-x: auto; }
}
@media (max-width: 640px) {
  .lesson-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}
@media (max-width: 520px) {
  .brand-strip {
    gap: 12px;
    margin-bottom: 16px;
  }
  .brand-strip-full {
    width: 100%;
  }
  .brand-strip-full .brand-logo-full {
    display: none;
  }
  .brand-strip-full .brand-logo-mark,
  .brand-strip-full .brand-text {
    display: block;
  }
  .brand-logo-mark {
    width: 60px;
    max-height: 46px;
  }
  .brand-strip strong { font-size: .98rem; }
  .brand-strip span { font-size: .82rem; }
}
