:root {
  --ink: #1c1c1c;
  --muted: #6b625e;
  --line: #eadfd8;
  --bg: #f4cbb8;
  --card: #ffffff;
  --brand: #d0121a;
  --brand-dark: #9f0e14;
  --brand-soft: #fff1ee;
  --accent: #ffe08a;
  --navy: #08315f;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(16, 39, 37, 0.08);
  --radius: 18px;
  --sans: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.03em; }
button, input, select, textarea { font: inherit; color: inherit; }

.container { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(760px, 100%); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 246, 244, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(20, 34, 38, 0.06);
}
.bar { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; overflow: hidden;
  background: transparent; color: white; font-size: 14px; flex: none;
}
.logo-mark img { width: 40px; height: 40px; display: block; object-fit: contain; border-radius: 50%; background: #fff; }
.logo small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a, .side-link {
  padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px;
}
.nav a.active, .nav a:hover, .side-link:hover, .side-link.active { color: var(--ink); background: white; }
.bar-actions { display: flex; gap: 8px; }
.mobile-nav { display: none; }

.hero {
  padding: 56px 0 24px;
}
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px; align-items: center; }
.eyebrow {
  display: inline-flex; gap: 8px; align-items: center;
  color: var(--brand-dark); background: var(--brand-soft);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700;
}
h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); margin: 14px 0; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 58ch; }
.hero-card {
  background: var(--navy); color: white; border-radius: 28px; padding: 28px;
  box-shadow: var(--shadow); min-height: 320px;
  background-image: radial-gradient(circle at 90% 10%, rgba(208, 18, 26, 0.45), transparent 32%),
    linear-gradient(160deg, var(--navy), #0b5cab 55%);
}
.hero-card strong { display: block; font-size: 1.4rem; margin: 8px 0; }
.hero-card p { color: rgba(255,255,255,.78); }
.section { padding: 28px 0 10px; }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 18px; }
.section-head p, .muted { color: var(--muted); }
.grid-3, .grid-4, .grid-2 { display: grid; gap: 16px; min-width: 0; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 1px 0 rgba(16,39,37,.02);
}
.card h3 { margin-bottom: 8px; }
.course-card { display: flex; flex-direction: column; min-height: 230px; }
.course-card .price { margin-top: auto; font-weight: 750; color: var(--brand-dark); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.stat { background: white; border-radius: 16px; padding: 16px 18px; border: 1px solid var(--line); }
.stat b { display: block; font-size: 1.6rem; }
.stat span, .small { color: var(--muted); font-size: 14px; }
.steps { counter-reset: step; display: grid; gap: 12px; }
.steps li { list-style: none; background: white; border-radius: 16px; padding: 16px 16px 16px 64px; position: relative; border: 1px solid var(--line); }
.steps { padding: 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; background: var(--brand); color: white; font-weight: 700;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 1px solid transparent; padding: 10px 16px;
  font-weight: 700; cursor: pointer; background: white;
}
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #2b2110; }
.btn-ghost { background: white; border-color: var(--line); }
.btn-danger { background: #fff1f0; color: var(--danger); border-color: #ffd2ce; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.site-footer { margin-top: 48px; background: var(--navy); color: white; padding: 36px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.site-footer a, .site-footer p { color: rgba(255,255,255,.78); }
.site-footer h3 { font-size: 1rem; }
.copy { border-top: 1px solid rgba(255,255,255,.1); margin-top: 22px; padding-top: 14px; color: rgba(255,255,255,.6); font-size: 14px; }

.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; min-width: 0; }
.page-head > * { min-width: 0; }
.page-head form select { width: 180px; }
.page-head h1 { font-size: 1.8rem; margin: 0 0 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 180px; }
.table-wrap { overflow: auto; max-width: 100%; background: white; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 700; background: #fbf7f5; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; }
.badge-green { background: #e5f6ee; color: #067647; }
.badge-amber { background: #fff4df; color: #9a6700; }
.badge-rose { background: #ffe8e6; color: #b42318; }
.badge-sky { background: #e7f2ff; color: #175cd3; }
.badge-slate { background: #eef2f3; color: #3d4a4e; }
.alert { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.alert-success { background: #e8f7ef; color: #08663a; }
.alert-error { background: #fff0ee; color: #9f1c13; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field .error { color: var(--danger); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input:not([type]),
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="url"], input[type="search"],
select {
  width: 100%; height: 48px; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 0 12px;
}
input[type="file"], textarea {
  width: 100%; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 10px 12px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(208, 18, 26, .28); border-color: var(--brand); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.check input { width: auto; }
.empty { padding: 28px; text-align: center; color: var(--muted); background: white; border-radius: 16px; border: 1px dashed var(--line); }
.help { color: var(--muted); font-size: 13px; }
.stack { display: grid; gap: 14px; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.progress { height: 8px; background: #f3e4df; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #e85d4c); }
.split { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 76px); }
.split-copy { background: var(--navy); color: white; padding: 64px 48px; }
.split-copy p { color: rgba(255,255,255,.78); }
.auth-panel { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(440px, 100%); }
.demo { background: #fff8eb; border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.demo code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.portal { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--navy); color: white; padding: 22px 16px; display: flex; flex-direction: column; gap: 18px; height: 100vh; position: sticky; top: 0; overflow: hidden; }
.sidebar-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sidebar-panel { display: contents; }
.nav-check { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.menu-toggle { display: none; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: white; color: var(--navy); font-weight: 800; cursor: pointer; }
.menu-toggle .when-open { display: none; }
.user-box form, .user-box .btn { width: 100%; }
.sidebar .logo, .sidebar .logo small { color: white; }
.sidebar .logo small { color: rgba(255,255,255,.65); }
.sidebar .logo-mark { background: transparent; color: var(--brand); }
.side-nav { display: grid; gap: 0; align-content: start; min-height: 0; overflow: auto; }
.nav-group { display: grid; gap: 2px; }
.nav-group + .nav-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.nav-label { margin: 0 0 4px; padding: 0 12px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.48); }
.side-link { color: rgba(255,255,255,.78); }
.side-link:hover { background: rgba(255,255,255,.1); color: white; }
.side-link.active { background: var(--brand); color: white; }
.user-box { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar .btn-ghost { color: var(--navy); background: white; }
.user-box p { margin: 0 0 8px; }
.portal-main { padding: 28px; }
.callout { background: var(--brand-soft); border-radius: 16px; padding: 16px; }
.lesson + .lesson { margin-top: 10px; }
.bar-chart { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 88px 1fr 32px; gap: 8px; align-items: center; font-size: 14px; }
.bar-track { background: #f3e4df; border-radius: 99px; height: 10px; }
.bar-track span { display: block; height: 10px; border-radius: 99px; background: var(--brand); }
.pagination { display: flex; gap: 6px; list-style: none; padding: 16px 0 0; }
.pagination li a, .pagination li span { display: inline-flex; min-width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 10px; background: white; border: 1px solid var(--line); }
.pagination li.active span { background: var(--brand); color: white; border-color: var(--brand); }
.prose { white-space: pre-wrap; }
.rich-text { line-height: 1.75; }
.rich-text img, .rich-text video { max-width: 100%; height: auto; }
.rich-text iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.rich-text table { width: 100%; border-collapse: collapse; }
.rich-text td, .rich-text th { border: 1px solid var(--line); padding: 6px 8px; }
.rich-text ul, .rich-text ol { padding-left: 1.2em; }
.library-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.library-folder { display: flex; gap: 8px; align-items: center; flex: 1 1 320px; max-width: 520px; min-width: min(100%, 280px); }
.library-folder input { width: auto; flex: 1; min-width: 0; }
.library-upload { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.library-upload input[type="file"] { flex: 1 1 240px; width: auto; max-width: 480px; min-width: 0; }
.library-upload .btn { flex: none; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.media-card { display: grid; gap: 8px; align-content: start; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.media-card strong, .media-card .small { overflow-wrap: anywhere; }
.media-card img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; background: #f6f1ee; }
.media-card .actions { margin-top: 4px; }
.media-card .actions form { margin: 0; }
.picker { background: var(--bg); }
.picker-main { padding: 16px; }
.choice { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.choice input[type="radio"], .choice input[type="checkbox"] { width: auto; }
audio { width: 100%; margin-top: 10px; }
iframe.media { width: 100%; height: 360px; border: 0; border-radius: 16px; margin-top: 12px; }
fieldset { border: 0; padding: 0; margin: 0; }
[hidden] { display: none !important; }

.classroom { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.classroom-main { min-width: 0; display: grid; gap: 16px; }
.syllabus { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.syllabus-back { display: block; padding: 10px 10px 12px; font-weight: 800; color: var(--navy); }
.syllabus ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.syllabus-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px; border-radius: 12px; }
.syllabus-item strong { display: block; font-size: 14px; line-height: 1.35; }
.syllabus-item small { color: var(--muted); }
.syllabus-item.active { background: var(--brand-soft); }
.syllabus-item.active strong { color: var(--brand-dark); }
.syllabus-no { font-size: 12px; font-weight: 800; color: var(--brand); padding-top: 2px; }
.curriculum { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.curriculum a, .course-entry { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.curriculum h2, .course-entry h2 { font-size: 1.15rem; margin: 0 0 4px; }
.step-no { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--navy); color: white; font-weight: 800; font-size: 1.15rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.part-tabs { display: flex; gap: 8px; overflow: auto; padding-bottom: 2px; }
.part-tab { display: grid; gap: 2px; min-width: 148px; text-align: left; border: 1px solid var(--line); background: white; border-radius: 14px; padding: 10px 12px; cursor: pointer; }
.part-tab span { font-size: 12px; font-weight: 800; color: var(--brand); }
.part-tab[aria-selected="true"] { border-color: var(--brand); background: var(--brand-soft); }
.media-frame { position: relative; margin-top: 12px; padding-top: 56.25%; border-radius: 16px; overflow: hidden; background: #111; }
.media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.doc-card { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; background: #fffdfb; }
.part-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.part-list li { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.kind-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.kind-pick { position: relative; }
.kind-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kind-pick span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: white; font-weight: 700; cursor: pointer; }
.kind-pick input:checked + span { background: var(--brand); color: white; border-color: var(--brand); }
.kind-pick input:focus-visible + span { outline: 2px solid rgba(208, 18, 26, .28); }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; }

body.site { background: var(--bg); color: var(--ink); }
body.site h1 { font-size: 1.7rem; margin: 0 0 12px; }
body.site .section-head h2,
body.site .home-schedule h2 { color: var(--brand); }
.site-top { display: none; background: var(--brand); color: white; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; position: relative; }
.top-actions { display: none; }
.wordmark { color: white; font-weight: 800; display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.wordmark img { width: 42px; height: 42px; border-radius: 50%; flex: none; display: block; object-fit: contain; background: #fff; }
.wordmark-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.wordmark-text small { font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.wordmark-text strong { font-size: 1.05rem; font-weight: 800; color: #ffe08a; }
.site-banner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .9fr); min-height: 124px; background: #fff; }
.banner-id { display: flex; align-items: center; gap: 16px; padding: 14px 28px 14px max(16px, calc((100vw - 1120px) / 2)); }
.banner-seal {
  width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: transparent; padding: 0; overflow: hidden;
}
.banner-seal img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: contain; background: #fff; }
.banner-name { display: grid; gap: 4px; min-width: 0; color: #d0121a; }
.banner-name p, .banner-name strong, .banner-slogan strong, .banner-slogan span { margin: 0; }
.banner-name p { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.banner-name strong { font-size: clamp(1.15rem, 1.7vw, 1.55rem); font-weight: 800; letter-spacing: .01em; text-transform: uppercase; line-height: 1.2; }
.banner-slogan {
  display: flex; flex-direction: column; justify-content: center; gap: 6px; color: white;
  padding: 16px max(18px, calc((100vw - 1120px) / 2)) 16px 32px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.22) 0 1px, transparent 1.6px) 0 0 / 28px 28px,
    radial-gradient(circle at 70% 80%, rgba(255,224,138,.35) 0 1px, transparent 1.6px) 0 0 / 36px 36px,
    linear-gradient(115deg, transparent 0 18%, rgba(255,255,255,.08) 18.4% 18.8%, transparent 19.2% 100%),
    linear-gradient(100deg, #0b5cab 0%, #08315f 72%);
}
.banner-slogan strong { font-size: clamp(1.15rem, 1.8vw, 1.7rem); font-weight: 800; color: #ffe08a; letter-spacing: .02em; text-transform: uppercase; line-height: 1.25; }
.banner-slogan span { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: rgba(255,255,255,.92); }
.site-tools { background: #f7f7f7; border-bottom: 1px solid #e6e6e6; }
.tools-row { display: flex; gap: 16px; align-items: center; min-height: 52px; }
.tools-row time { color: #333; font-weight: 600; white-space: nowrap; }
.site-search { margin-left: auto; flex: 1; max-width: 360px; display: flex; gap: 8px; align-items: center; }
.site-search input { height: 38px; border-radius: 999px; background: white; width: auto; flex: 1; min-width: 0; }
.site-search .btn { height: 38px; padding: 0 14px; flex: none; }
.tool-link { font-weight: 700; color: var(--brand); white-space: nowrap; }
.site-menu { background: white; border-bottom: 3px solid var(--brand); position: sticky; top: 0; z-index: 20; }
.menu-row { display: flex; flex-wrap: wrap; gap: 2px; }
.menu-row > a, .menu-item > a {
  display: block; padding: 12px 14px; font-weight: 700; color: #222;
}
.menu-row > a.active, .menu-row > a:hover, .menu-item > a:hover { color: var(--brand); }
.menu-item { position: relative; }
.submenu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 240px; z-index: 30;
  background: white; border: 1px solid #ead4cb; box-shadow: 0 10px 24px rgba(0,0,0,.08); padding: 6px 0;
}
.menu-item:hover .submenu, .menu-item:focus-within .submenu { display: grid; }
.submenu a { padding: 8px 14px; color: #333; }
.submenu a:hover { background: var(--brand-soft); color: var(--brand); }
.site-main { padding: 18px 0 36px; }
.site-sheet { background: white; border-radius: 8px; padding: 18px; }
body.site .site-sheet .container { width: 100%; max-width: none; margin: 0; }
body.site .split { min-height: 0; }
.news-home { display: grid; grid-template-columns: 1.7fr .9fr; gap: 18px; }
.lead-card {
  display: flex; flex-direction: column; justify-content: flex-end; min-height: 280px; padding: 22px;
  border-radius: 6px; color: white; background:
    linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.72)),
    linear-gradient(120deg, var(--navy), var(--brand-dark));
}
.lead-card strong { font-size: 1.45rem; margin: 6px 0; }
.lead-card p, .lead-kicker { color: rgba(255,255,255,.9); margin: 0; }
.lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.mini-card { display: grid; gap: 8px; color: #222; }
.swatch { display: block; height: 120px; border-radius: 4px; background: linear-gradient(135deg, var(--navy), var(--brand)); }
.swatch-2 { background: linear-gradient(135deg, #0b5cab, var(--brand-dark)); }
.latest-box { border: 1px solid #f0d5cc; border-radius: 10px; padding: 8px 14px 12px; }
.latest-box h2 {
  margin: 8px 0 4px; color: var(--brand); font-size: 1.15rem; letter-spacing: .04em; text-transform: uppercase;
  border-left: 4px solid var(--brand); padding-left: 10px;
}
.latest-box a, .line-item { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid #f1e4de; color: #222; }
.latest-box time, .line-item time, .line-item span { color: #6b625e; font-size: 14px; }
.home-blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; margin-top: 26px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--brand); margin-bottom: 4px; }
.block-head h2 { margin: 0; font-size: 1.15rem; text-transform: uppercase; color: var(--brand); }
.block-head a { color: var(--navy); font-weight: 700; }
.home-schedule { margin-top: 22px; }
.portal-page { display: grid; grid-template-columns: 220px 1fr; gap: 22px; }
.portal-side { display: grid; align-content: start; gap: 4px; }
.portal-side h2 { font-size: 1rem; color: var(--brand); text-transform: uppercase; }
.portal-side a { padding: 8px 10px; border-radius: 8px; }
.portal-side a.active, .portal-side a:hover { background: var(--brand-soft); color: var(--brand); }
.post-view .lead { color: #444; }
.crumb, .crumb a { color: #6b625e; font-size: 14px; }
body.site .mobile-nav { display: none; }

@media (max-width: 900px) {
  h1 { font-size: 1.65rem; }
  body.site h1 { font-size: 1.45rem; }
  .container { width: min(1120px, calc(100% - 24px)); }
  .site-top { display: block; position: sticky; top: 0; z-index: 40; }
  .site-menu, .tool-link, .split-copy { display: none; }
  .top-actions { display: flex; align-items: center; gap: 8px; }
  .top-login, body.site .mobile-nav { display: block; }
  .top-login {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; padding: 0 14px; border-radius: 999px;
    background: var(--accent); color: var(--navy); font-weight: 800; white-space: nowrap;
  }
  .mobile-nav { position: relative; }
  .mobile-nav summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; padding: 0 14px; border-radius: 999px; background: white; color: var(--brand); font-weight: 800;
  }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-panel {
    position: absolute; top: calc(100% + 12px); right: 0; width: min(320px, calc(100vw - 24px));
    background: white; color: var(--ink); border-radius: 16px; padding: 8px;
    box-shadow: 0 18px 40px rgba(8, 49, 95, .22); max-height: calc(100vh - 88px); overflow: auto; z-index: 50;
  }
  .mobile-panel a { display: block; padding: 12px 14px; border-radius: 12px; font-weight: 700; color: var(--ink); }
  .mobile-panel a.sub { padding-left: 28px; font-weight: 600; color: var(--muted); }
  .mobile-panel a.active, .mobile-panel a:hover { background: var(--brand-soft); color: var(--brand-dark); }
  .wordmark { gap: 8px; }
  .wordmark img { width: 34px; height: 34px; }
  .wordmark-text small { font-size: .58rem; }
  .wordmark-text strong { font-size: .82rem; }
  .site-banner { grid-template-columns: 1fr; min-height: 0; }
  .banner-id { padding: 14px 16px; }
  .banner-seal { width: 64px; height: 64px; }
  .banner-name strong { font-size: 1.02rem; }
  .banner-slogan { padding: 14px 16px 16px; }
  .banner-slogan strong { font-size: 1.05rem; }
  .banner-slogan span { font-size: .7rem; }
  .tools-row { flex-wrap: wrap; gap: 8px; padding: 10px 0; }
  .tools-row time { width: 100%; white-space: normal; font-size: 13px; }
  .site-search { max-width: none; margin-left: 0; width: 100%; }
  .site-search input, .site-search .btn { height: 44px; }
  .news-home, .lead-grid, .home-blocks, .portal-page,
  .hero-grid, .grid-3, .grid-4, .grid-2, .stats, .footer-grid, .split, .form-grid, .portal { grid-template-columns: 1fr; }
  .lead-card { min-height: 200px; }
  .site-sheet { padding: 14px; }
  .site-main { padding-top: 12px; }
  .footer-grid { gap: 18px; }
  .page-head, .section-head, .block-head { flex-direction: column; align-items: stretch; }
  .page-head > .btn, .section-head > .btn, .card.stack > .btn, .card.stack > a.btn, .card.stack > form .btn { width: 100%; min-height: 48px; }
  .filters { display: grid; }
  .filters input, .filters select, .filters .btn, .page-head form, .page-head form select { width: 100%; min-width: 0; }
  .page-head .actions, .card .actions:not(td), .doc-card .actions { display: grid; }
  .page-head .actions .btn, .card .actions .btn { width: 100%; }
  .library-bar, .library-folder, .library-upload { display: grid; }
  .library-folder input, .library-upload input[type="file"], .library-folder .btn, .library-upload .btn { width: 100%; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  table { min-width: 0; }
  .portal-main .table-wrap table { min-width: 640px; }
  th, td { overflow-wrap: anywhere; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .doc-card, .lesson-nav { flex-direction: column; align-items: stretch; }
  .doc-card .btn, .lesson-nav .btn { width: 100%; }
  .part-tabs { max-width: 100%; }
  .part-tab { min-width: 0; flex: 1 0 140px; }
  iframe.media { height: auto; aspect-ratio: 16 / 9; }
  .pagination { flex-wrap: wrap; }
  .bar-row { grid-template-columns: 72px minmax(0, 1fr) 28px; }
  .portal { display: block; }
  .sidebar { height: auto; position: sticky; top: 0; z-index: 30; padding: 10px 14px; overflow: visible; gap: 0; }
  .sidebar-panel { display: none; }
  .menu-toggle { display: inline-flex; }
  .nav-check:checked ~ .sidebar-bar .menu-toggle { background: var(--brand); color: white; }
  .nav-check:checked ~ .sidebar-bar .when-closed { display: none; }
  .nav-check:checked ~ .sidebar-bar .when-open { display: inline; }
  .nav-check:checked ~ .sidebar-panel {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--navy); padding: 8px 12px 16px; max-height: calc(100vh - 68px); overflow: auto;
    box-shadow: 0 18px 36px rgba(0, 0, 0, .28);
  }
  .side-nav { display: grid; overflow: visible; gap: 0; }
  .nav-group { display: grid; gap: 2px; }
  .nav-group + .nav-group { margin-top: 12px; padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,.12); border-left: 0; }
  .nav-label { margin: 0 0 4px; white-space: normal; }
  .side-link { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; font-size: 16px; border-radius: 12px; white-space: normal; }
  .user-box { margin-top: 14px; }
  .portal-main { padding: 16px 14px 32px; min-width: 0; }
  .classroom, .part-list li, .curriculum a, .course-entry { grid-template-columns: 1fr; }
  .curriculum a, .course-entry { justify-items: start; }
  .syllabus { position: static; max-height: none; }
  .syllabus ol { display: grid; overflow: visible; }
  .syllabus-item { min-width: 0; }
  .step-no { width: 48px; height: 48px; }
  .auth-card { width: 100%; }
}

@media (max-width: 420px) {
  .brand-row { align-items: stretch; flex-wrap: wrap; padding: 8px 0; }
  .top-actions { width: 100%; }
  .top-login { flex: 1; }
  .mobile-nav { flex: 1; }
  .mobile-nav summary { width: 100%; }
}
