/* Harmattan University demo platform */
:root {
  --navy: #0d1b3e;
  --navy-2: #16295a;
  --navy-3: #22397a;
  --gold: #c8103e;
  --gold-2: #ff6b86;
  --gold-soft: #fbe7ec;
  --ink: #111827;
  --muted: #5b6472;
  --bg: #f5f6fa;
  --line: #e3e6ee;
  --white: #ffffff;
  --green: #1f8a5b;
  --green-soft: #e3f4ec;
  --red: #c2410c;
  --red-soft: #fdeee6;

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(13, 27, 62, 0.06), 0 8px 24px -12px rgba(13, 27, 62, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 1rem; line-height: 1.6; color: var(--ink); background: var(--white); -webkit-font-smoothing: antialiased; }
body[data-view="learner"], body[data-view="admin"] { background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--navy-3); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; color: var(--navy); }
h1 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.wrap { width: min(1200px, 100% - 3rem); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.crest { flex: none; }

/* Demo bar */
.demo-bar { background: #070d1f; color: rgba(255,255,255,0.85); font-size: 0.86rem; position: sticky; top: 0; z-index: 60; }
.demo-bar-inner { display: flex; align-items: center; gap: 1.25rem; padding: 0.5rem 1.25rem; max-width: 1440px; margin-inline: auto; }
.demo-label { margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: #d9f449; box-shadow: 0 0 0 4px rgba(217,244,73,0.18); }
.view-switch { display: flex; gap: 0.25rem; margin-left: auto; background: rgba(255,255,255,0.07); border-radius: 999px; padding: 0.2rem; }
.view-switch a { color: rgba(255,255,255,0.78); text-decoration: none; padding: 0.3rem 0.85rem; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.view-switch a:hover { color: #fff; }
.view-switch a[aria-current] { background: #d9f449; color: #002b37; }
.demo-back { color: #d9f449; font-weight: 600; text-decoration: none; white-space: nowrap; }
.demo-back:hover { text-decoration: underline; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font: inherit; font-weight: 700; font-size: 0.95rem; padding: 0.75rem 1.3rem; border-radius: 10px; border: 1.5px solid transparent; text-decoration: none; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-3); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #a50d33; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.9rem; }
.btn-block { width: 100%; }
.link-arrow { font-weight: 700; color: var(--navy-3); }

.tag { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 999px; background: var(--navy); color: #fff; }
.tag-gold { background: var(--gold); color: #fff; }
.tag-light { background: var(--gold-soft); color: #9b0c30; }

/* Public header */
.pub-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 2.4rem; z-index: 50; }
.pub-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 0.85rem; }
.pub-brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--navy); }
.pub-brand strong { display: block; font-family: var(--serif); font-size: 1.2rem; line-height: 1.1; }
.pub-brand small { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.01em; }
.pub-brand-light, .pub-brand-light strong { color: #fff; }
.pub-brand-light small { color: rgba(255,255,255,0.65); }
.pub-nav { display: flex; align-items: center; gap: 1.6rem; }
.pub-nav > a:not(.btn) { text-decoration: none; color: var(--ink); font-weight: 600; }
.pub-nav > a:not(.btn):hover, .pub-nav > a[aria-current] { color: var(--navy-3); box-shadow: inset 0 -2px 0 var(--gold); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem; color: var(--navy); cursor: pointer; }
.menu-btn .ic { width: 1.4rem; height: 1.4rem; }

/* Hero */
.hero { position: relative; background: var(--navy) var(--hero) center / cover no-repeat; color: #fff; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(13,27,62,0.95) 0%, rgba(13,27,62,0.85) 45%, rgba(13,27,62,0.35) 100%); }
.hero-inner { position: relative; padding-block: clamp(4rem, 3rem + 6vw, 8rem); }
.eyebrow-line { color: var(--gold-2); font-weight: 700; margin-bottom: 1rem; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem); max-width: 16ch; }
.hero-sub { font-size: 1.15rem; color: rgba(255,255,255,0.85); max-width: 52ch; }
.hero-search { margin-top: 2rem; display: flex; align-items: center; gap: 0.5rem; background: #fff; border-radius: 14px; padding: 0.4rem 0.4rem 0.4rem 1rem; max-width: 620px; color: var(--muted); }
.hero-search input { flex: 1; border: 0; font: inherit; font-size: 1rem; padding: 0.6rem 0.25rem; min-width: 0; color: var(--ink); }
.hero-search input:focus { outline: none; }
.hero-search:focus-within { box-shadow: 0 0 0 3px var(--gold); }
.hero-pills { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; margin-top: 1.1rem; font-size: 0.9rem; color: rgba(255,255,255,0.7); align-items: center; }
.hero-pills a { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,0.3); border-radius: 999px; padding: 0.25rem 0.75rem; }
.hero-pills a:hover { border-color: var(--gold); }

.facts { background: var(--navy-2); color: #fff; }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding-block: 1.75rem; }
.facts-grid div { display: grid; grid-template-columns: auto 1fr; column-gap: 0.75rem; align-items: start; }
.facts-grid .ic { grid-row: span 2; width: 1.6rem; height: 1.6rem; color: var(--gold-2); margin-top: 0.15rem; }
.facts-grid strong { font-size: 1.02rem; }
.facts-grid span { font-size: 0.88rem; color: rgba(255,255,255,0.7); }

/* Sections */
.sec { padding-block: clamp(3.5rem, 2.5rem + 3vw, 5.5rem); }
.sec-tight { padding-block: 2.5rem 4.5rem; }
.sec-tint { background: var(--bg); }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; }
.sec-head h2 { font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.3rem); margin-bottom: 0.3rem; }
.sec-head p { color: var(--muted); margin: 0; }

/* Program cards */
.p-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.p-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.p-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.p-card-img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.p-card-img img { width: 100%; height: 100%; object-fit: cover; }
.p-card-img .tag { position: absolute; left: 0.85rem; top: 0.85rem; }
.p-card-img .tag-gold { left: auto; right: 0.85rem; }
.p-card-body { padding: 1.25rem 1.35rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.p-card-body h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; }
.p-card-body p { color: var(--muted); font-size: 0.94rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.p-meta { display: flex; gap: 1rem; font-size: 0.86rem; color: var(--muted); margin-bottom: 1rem; }
.p-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.p-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.p-foot strong { font-size: 1.1rem; color: var(--navy); }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.cat-tile { display: grid; grid-template-columns: 1fr auto; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem 1.4rem; font: inherit; cursor: pointer; color: var(--ink); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.cat-tile strong { font-size: 1.05rem; color: var(--navy); }
.cat-tile span { grid-column: 1; color: var(--muted); font-size: 0.9rem; }
.cat-tile .ic { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--gold); width: 1.4rem; height: 1.4rem; }
.cat-tile:hover { border-color: var(--navy); box-shadow: var(--shadow); }

.journey { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; counter-reset: j; }
.journey li { counter-increment: j; padding-top: 1.25rem; border-top: 3px solid var(--gold); }
.journey li::before { content: "Step " counter(j); display: block; font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-bottom: 0.4rem; }
.journey p { color: var(--muted); margin: 0; }

.org-band { background: var(--navy); color: #fff; }
.org-band-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; padding-block: clamp(3.5rem, 2.5rem + 3vw, 5rem); }
.org-band-img img { border-radius: var(--r-lg); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.org-band h2 { color: #fff; font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.4rem); }
.org-band p { color: rgba(255,255,255,0.82); font-size: 1.08rem; margin-bottom: 1.75rem; }

.fac-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.fac-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; text-align: center; display: grid; justify-items: center; gap: 0.25rem; }
.fac-card strong { color: var(--navy); margin-top: 0.6rem; }
.fac-card span { color: var(--muted); font-size: 0.9rem; }
.avatar { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--gold-soft); color: #9b0c30; font-weight: 800; font-size: 0.85rem; flex: none; }
.avatar-lg { width: 4.25rem; height: 4.25rem; font-size: 1.25rem; background: var(--navy); color: var(--gold-2); }
.avatar-photo { object-fit: cover; background: var(--bg); }
.avatar-lg.avatar-photo { width: 6rem; height: 6rem; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gold); }
.avatar-md { width: 3.5rem; height: 3.5rem; }
.btn-admin { box-shadow: 0 0 0 3px rgba(200,16,62,0.3); }

.cta { background: linear-gradient(120deg, var(--navy-2), var(--navy)); color: #fff; text-align: center; }
.cta-inner { padding-block: 4rem; }
.cta h2 { color: #fff; font-size: 2.2rem; }
.cta p { color: rgba(255,255,255,0.8); margin-bottom: 1.5rem; }

.pub-footer { background: #091430; color: rgba(255,255,255,0.75); }
.pub-footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; padding-block: 3.5rem 2rem; }
.pub-footer-grid p { margin-top: 1rem; max-width: 36ch; font-size: 0.94rem; }
.pub-footer h3 { color: #fff; font-family: var(--sans); font-size: 0.95rem; }
.pub-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.94rem; }
.pub-footer ul a { color: rgba(255,255,255,0.75); text-decoration: none; }
.pub-footer ul a:hover { color: var(--gold-2); }
.pub-footer-base { border-top: 1px solid rgba(255,255,255,0.1); padding-block: 1.25rem; font-size: 0.85rem; }
.pub-footer-base p { margin: 0; }

/* Page hero */
.page-hero { background: var(--navy); color: #fff; padding-block: 3rem 3.25rem; position: relative; }
.page-hero-img { background: var(--navy) var(--hero) center / cover no-repeat; }
.page-hero-img::before { content: ""; position: absolute; inset: 0; background: rgba(13,27,62,0.86); }
.page-hero .wrap { position: relative; }
.page-hero h1 { color: #fff; font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
.page-hero p { color: rgba(255,255,255,0.82); max-width: 62ch; font-size: 1.08rem; margin: 0; }
.crumbs { font-size: 0.88rem; color: var(--muted); margin-bottom: 1rem; }
.page-hero .crumbs, .prog-hero .crumbs, .crumbs-light { color: rgba(255,255,255,0.65); }
.page-hero .crumbs a, .prog-hero .crumbs a, .crumbs.crumbs-light a { color: rgba(255,255,255,0.85); }
.crumbs a { color: var(--navy-3); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* Catalog */
.toolbar { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.search-field { display: flex; align-items: center; gap: 0.6rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 0.9rem; color: var(--muted); flex: 1; max-width: 420px; }
.search-field input { border: 0; font: inherit; padding: 0.7rem 0; flex: 1; min-width: 0; color: var(--ink); background: transparent; }
.search-field input:focus { outline: none; }
.search-field:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(200,16,62,0.35); }
.sort { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.92rem; }
.sort select, .card-form select, .modal-form select { font: inherit; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.chip { font: inherit; font-size: 0.9rem; font-weight: 600; padding: 0.45rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--navy); }
.chip.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.result-count { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.25rem; }
.empty { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; }
.empty p { color: var(--muted); }

/* Program detail */
.prog-hero { background: var(--navy); color: #fff; }
.prog-hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; align-items: center; padding-block: 2.5rem 3.5rem; }
.prog-hero h1 { color: #fff; font-size: clamp(2rem, 1.5rem + 2vw, 3rem); margin-top: 0.75rem; }
.prog-lede { color: rgba(255,255,255,0.85); font-size: 1.12rem; max-width: 58ch; }
.prog-facts { display: grid; grid-template-columns: repeat(4, auto); gap: 1rem 2rem; margin-top: 1.75rem; justify-content: start; }
.prog-facts span { display: block; font-size: 0.82rem; color: rgba(255,255,255,0.6); }
.prog-facts strong { font-size: 1rem; }
.prog-hero-img img { border-radius: var(--r-lg); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6); }
.prog-layout { display: grid; grid-template-columns: 1fr 360px; gap: 3rem; align-items: start; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.75rem; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 700; background: none; border: 0; padding: 0.85rem 1.1rem; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--gold); }
.tab-panel h2 { font-size: 1.5rem; margin-top: 0.5rem; }
.tab-panel h2 + p, .tab-panel p { color: #374151; max-width: 70ch; }
.outcomes { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.outcomes li { display: flex; gap: 0.6rem; background: var(--bg); border-radius: 12px; padding: 0.9rem 1rem; }
.outcomes .ic { color: var(--green); margin-top: 0.2rem; }
.acc { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 0.75rem; background: #fff; }
.acc summary { list-style: none; cursor: pointer; padding: 1rem 1.25rem; display: flex; gap: 1rem; align-items: baseline; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; margin-left: auto; color: var(--navy); font-weight: 700; font-size: 1.2rem; }
.acc[open] summary::after { content: "\2212"; }
.acc-num { font-size: 0.82rem; font-weight: 700; color: #9b0c30; white-space: nowrap; }
.acc p { padding: 0 1.25rem 1.1rem; margin: 0; color: var(--muted); }
.fac-list { display: grid; gap: 1rem; }
.fac-row { display: flex; gap: 1rem; align-items: center; background: var(--bg); border-radius: 12px; padding: 1rem; }
.fac-row strong { display: block; color: var(--navy); }
.fac-row span { color: var(--muted); font-size: 0.92rem; }
.enroll-card { position: sticky; top: 8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.75rem; box-shadow: var(--shadow); display: grid; gap: 0.75rem; margin-top: -6rem; }
.enroll-label { color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.enroll-fee { font-family: var(--serif); font-size: 2.2rem; color: var(--navy); line-height: 1; }
.enroll-note { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.5rem; }
.enroll-list { list-style: none; padding: 1rem 0 0; margin: 0.25rem 0 0; border-top: 1px solid var(--line); display: grid; gap: 0.55rem; font-size: 0.92rem; color: #374151; }
.enroll-list li { display: flex; gap: 0.6rem; align-items: center; }
.enroll-list .ic { color: var(--gold); }
.enroll-team { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; font-weight: 600; text-decoration: none; background: var(--gold-soft); color: #8a0b2b; border-radius: 10px; padding: 0.75rem 0.9rem; }

/* Certificate */
.cert { --gold: #c8a24a; --gold-2: #e2c47a; background: #fff; padding: 14px; border-radius: 6px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.cert-inner { border: 2px solid var(--gold); outline: 1px solid var(--gold); outline-offset: -8px; padding: clamp(1.75rem, 1rem + 3vw, 3rem); text-align: center; background: radial-gradient(circle at 50% 0%, #fbf7ec, #fff 60%); }
.cert-top { display: flex; align-items: center; justify-content: center; gap: 0.85rem; text-align: left; margin-bottom: 1.5rem; }
.cert-top strong { display: block; font-family: var(--serif); font-size: 1.35rem; color: var(--navy); line-height: 1.1; }
.cert-top span { font-size: 0.85rem; color: var(--muted); }
.cert-kicker { font-family: var(--serif); font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.2rem); color: var(--navy); margin-bottom: 1.25rem; }
.cert-small { color: var(--muted); margin: 0.25rem 0; }
.cert-name { font-family: var(--serif); font-style: italic; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); color: var(--navy); margin: 0.25rem 0 0.75rem; border-bottom: 1px solid var(--gold); display: inline-block; padding: 0 1.5rem 0.25rem; }
.cert-prog { font-family: var(--serif); font-weight: 700; font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); color: var(--navy); margin-top: 0.5rem; }
.cert-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 1rem; margin-top: 2rem; }
.cert-foot > div { display: grid; gap: 0.15rem; }
.cert-foot small { color: var(--muted); font-size: 0.78rem; }
.sig { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.6rem; color: var(--navy); border-bottom: 1px solid var(--line); }
.cert-seal { justify-items: center; }
.cert-preview { max-width: 640px; }

/* Organizations and about */
.benefits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.benefits > div { background: var(--bg); border-radius: var(--r); padding: 1.5rem; }
.benefits .ic { width: 1.8rem; height: 1.8rem; color: var(--gold); margin-bottom: 0.75rem; }
.benefits p { color: var(--muted); margin: 0; }
.org-form-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 3rem; align-items: start; }
.org-form-grid > div > p { color: var(--muted); }
.check-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: 0.6rem; }
.check-list li { display: flex; gap: 0.6rem; align-items: center; font-weight: 600; }
.check-list .ic { color: var(--green); }
.card-form, .modal-form { display: grid; gap: 1rem; }
.card-form { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.75rem; box-shadow: var(--shadow); }
.card-form label, .modal-form label { display: grid; gap: 0.35rem; font-size: 0.9rem; font-weight: 700; color: var(--navy); }
.card-form input, .modal-form input, .modal-form textarea { font: inherit; font-weight: 400; padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.card-form input:focus, .modal-form input:focus, .modal-form textarea:focus, .card-form select:focus, .modal-form select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(200,16,62,0.35); }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card-form .btn { justify-self: start; }
.about-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 3rem; align-items: start; }
.about-grid p { color: #374151; font-size: 1.05rem; }
.stat-stack { display: grid; gap: 1rem; }
.stat-stack div { background: var(--navy); color: #fff; border-radius: var(--r); padding: 1.25rem 1.5rem; }
.stat-stack strong { display: block; font-family: var(--serif); font-size: 2rem; color: var(--gold-2); line-height: 1.1; }

/* App shell */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: calc(100vh - 2.4rem); }
.side { background: var(--navy); color: #fff; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 2.4rem; height: calc(100vh - 2.4rem); }
.shell-admin .side { background: #0a1430; }
.side-brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: #fff; padding: 0.25rem 0.5rem; }
.side-brand strong { display: block; font-family: var(--serif); font-size: 1rem; line-height: 1.15; }
.side-brand small { color: var(--gold-2); font-size: 0.78rem; font-weight: 600; }
.side-nav { display: grid; gap: 0.25rem; }
.side-nav a, .side-out { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.85rem; border-radius: 10px; color: rgba(255,255,255,0.75); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.side-nav a:hover, .side-out:hover { background: rgba(255,255,255,0.07); color: #fff; }
.side-nav a[aria-current] { background: rgba(200,16,62,0.16); color: var(--gold-2); }
.side-out { margin-top: auto; }
.shell-main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 0.85rem 2rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 2.4rem; z-index: 20; }
.top-search { display: flex; align-items: center; gap: 0.6rem; background: var(--bg); border-radius: 10px; padding: 0 0.9rem; color: var(--muted); flex: 1; max-width: 460px; }
.top-search input { border: 0; background: transparent; font: inherit; padding: 0.6rem 0; flex: 1; min-width: 0; }
.top-search input:focus { outline: none; }
.icon-btn { position: relative; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; margin-left: auto; }
.icon-btn:hover { border-color: var(--navy); }
.icon-btn .dot { position: absolute; top: 0.5rem; right: 0.55rem; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.tbl .icon-btn { margin-left: 0; width: 2.2rem; height: 2.2rem; }
.who { display: flex; align-items: center; gap: 0.6rem; }
.who strong { display: block; font-size: 0.92rem; color: var(--navy); line-height: 1.2; }
.who span { font-size: 0.8rem; color: var(--muted); }
.shell-content { padding: 2rem; max-width: 1320px; }
.page-top { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-top h1 { font-size: 1.9rem; margin-bottom: 0.2rem; }
.page-top p { color: var(--muted); margin: 0; }
.page-actions { display: flex; gap: 0.75rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.panel-head h2 { font-family: var(--sans); font-size: 1.05rem; font-weight: 800; margin: 0; }
.panel-head a { font-size: 0.9rem; font-weight: 700; text-decoration: none; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--navy-3), var(--navy)); }
.bar-light { background: rgba(255,255,255,0.2); }
.bar-light i { background: var(--gold); }

/* Learner dashboard */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.dash-grid-2 { grid-template-columns: 1.3fr 1fr; }
.resume { display: grid; grid-template-columns: 0.9fr 1.1fr; padding: 0; overflow: hidden; background: var(--navy); border: 0; color: #fff; }
.resume img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.resume-body { padding: 1.75rem; }
.resume h2 { color: #fff; font-size: 1.6rem; margin-top: 0.75rem; }
.resume p { color: rgba(255,255,255,0.78); margin-bottom: 0.4rem; }
.resume-next strong { color: #fff; }
.resume-row { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0 1.4rem; }
.resume-row .bar { flex: 1; }
.resume-row span { font-weight: 700; }
.stats-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mini-stat { background: var(--bg); border-radius: var(--r); padding: 1.2rem; display: grid; align-content: center; }
.mini-stat strong { font-family: var(--serif); font-size: 2rem; color: var(--navy); line-height: 1.1; }
.mini-stat span { color: var(--muted); font-size: 0.9rem; }
.my-progs { display: grid; gap: 0.75rem; }
.my-prog { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: center; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--r); padding: 0.6rem; transition: border-color 0.15s ease; }
.my-prog:hover { border-color: var(--navy); }
.my-prog img { width: 120px; height: 80px; object-fit: cover; border-radius: 10px; }
.my-prog-body { display: grid; gap: 0.35rem; }
.my-prog-body .tag { justify-self: start; }
.my-prog-body strong { color: var(--navy); }
.my-prog-body .muted { font-size: 0.85rem; }
.agenda { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: 0.75rem; }
.agenda li { display: flex; gap: 1rem; align-items: center; }
.agenda .date { display: grid; place-items: center; width: 3.2rem; height: 3.4rem; border-radius: 12px; background: var(--gold-soft); color: #9b0c30; font-size: 0.75rem; font-weight: 700; line-height: 1.1; flex: none; }
.agenda .date b { font-size: 1.2rem; color: var(--navy); }
.agenda strong { display: block; color: var(--navy); }
.agenda span { color: var(--muted); font-size: 0.88rem; }
.cert-mini { display: flex; align-items: center; gap: 0.85rem; background: var(--navy); color: #fff; border-radius: var(--r); padding: 1rem; }
.cert-mini > div:first-child { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 10px; background: rgba(200,16,62,0.2); color: var(--gold-2); }
.cert-mini strong { display: block; }
.cert-mini span { font-size: 0.85rem; color: rgba(255,255,255,0.7); }
.cert-mini .btn { margin-left: auto; }

/* Course */
.course-head { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: 2rem; border-radius: var(--r-lg); background: var(--navy) var(--hero) center / cover; color: #fff; overflow: hidden; margin-bottom: 1.5rem; }
.course-head::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,27,62,0.96), rgba(13,27,62,0.75)); }
.course-head > * { position: relative; }
.course-head h1 { color: #fff; font-size: 2rem; }
.course-head p { color: rgba(255,255,255,0.8); margin: 0; }
.course-ring { position: relative; display: grid; place-items: center; }
.course-ring span { position: absolute; text-align: center; font-weight: 800; font-size: 1.3rem; line-height: 1.1; }
.course-ring small { display: block; font-size: 0.7rem; font-weight: 600; color: rgba(255,255,255,0.7); }
.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: rgba(13,27,62,0.1); }
.course-head .ring-bg { stroke: rgba(255,255,255,0.18); }
.ring-fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.course-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; align-items: start; }
.lesson-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 0.75rem; border-radius: 12px; text-decoration: none; color: var(--ink); }
.lesson-row:hover { background: var(--bg); }
.lesson-row + .lesson-row { border-top: 1px solid var(--line); }
.lesson-row:hover + .lesson-row { border-top-color: transparent; }
.l-state { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--bg); color: var(--navy); flex: none; }
.l-state .ic { width: 0.95rem; height: 0.95rem; }
.lesson-row.is-done .l-state { background: var(--green-soft); color: var(--green); }
.lesson-row.is-current { background: var(--gold-soft); }
.l-title { flex: 1; font-weight: 600; }
.l-time { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.module-locked { display: flex; gap: 0.85rem; align-items: center; padding: 0.85rem 0.25rem; border-top: 1px solid var(--line); color: var(--muted); }
.module-locked:first-of-type { border-top: 0; }
.module-locked strong { display: block; color: var(--ink); font-size: 0.95rem; }
.module-locked span { font-size: 0.85rem; }

/* Lesson player */
.lesson-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; background: #050b1c; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.stage { position: absolute; inset: 0 0 52px; cursor: pointer; }
.slide { position: absolute; inset: 0; padding: clamp(1.25rem, 0.5rem + 3vw, 3rem); background: radial-gradient(circle at 85% 15%, rgba(200,16,62,0.22), transparent 45%), linear-gradient(135deg, var(--navy), #08122b); color: #fff; display: flex; flex-direction: column; justify-content: center; animation: slideIn 0.45s ease both; }
.slide h2 { color: #fff; font-size: clamp(1.3rem, 0.8rem + 2vw, 2.4rem); max-width: 22ch; }
.slide p { color: var(--gold-2); font-size: clamp(0.95rem, 0.8rem + 0.6vw, 1.25rem); max-width: 40ch; }
.slide ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.7rem; }
.slide li { position: relative; padding-left: 1.6rem; font-size: clamp(0.95rem, 0.8rem + 0.6vw, 1.25rem); color: rgba(255,255,255,0.9); }
.slide li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 0.6rem; height: 0.6rem; border-radius: 2px; background: var(--gold); }
.slide-title h2 { font-size: clamp(1.6rem, 1rem + 2.6vw, 3rem); }
.slide-brand { position: absolute; top: 1rem; left: 1.25rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: rgba(255,255,255,0.6); }
.slide-num { position: absolute; right: 1.25rem; bottom: 1rem; font-size: 0.8rem; color: rgba(255,255,255,0.5); }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.captions { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); width: min(86%, 760px); text-align: center; background: rgba(0,0,0,0.72); color: #fff; padding: 0.5rem 0.85rem; border-radius: 8px; font-size: 0.95rem; }
.big-play { position: absolute; left: 50%; top: calc(50% - 26px); transform: translate(-50%, -50%); width: 5rem; height: 5rem; border-radius: 50%; border: 0; background: var(--gold); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.4); transition: transform 0.2s ease; }
.big-play .ic { width: 2rem; height: 2rem; fill: currentColor; stroke: none; margin-left: 0.2rem; }
.big-play:hover { transform: translate(-50%, -50%) scale(1.06); }
.player.is-playing .big-play { display: none; }
.controls { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; display: flex; align-items: center; gap: 0.35rem; padding: 0 0.75rem; background: #0a1430; }
.ctl { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; }
.ctl:hover, .ctl.is-on { background: rgba(255,255,255,0.12); }
#ctl-play .ic { fill: currentColor; stroke: none; }
.scrub { flex: 1; height: 6px; border-radius: 99px; background: rgba(255,255,255,0.2); margin: 0 0.6rem; overflow: hidden; }
.scrub-fill { height: 100%; width: 0; background: var(--gold); border-radius: 99px; transition: width 0.25s linear; }
.time { color: rgba(255,255,255,0.75); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lesson-title-row { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: 1.5rem 0 1rem; }
.lesson-title-row h1 { font-size: 1.7rem; margin: 0.2rem 0 0; }
.lesson-title-row .ic { color: var(--green); }
.tab-panel textarea { width: 100%; font: inherit; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.res-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.res-list button { width: 100%; display: flex; gap: 0.6rem; align-items: center; font: inherit; font-weight: 600; text-align: left; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); cursor: pointer; }
.res-list button:hover { border-color: var(--navy); }
.lesson-nav { display: flex; justify-content: space-between; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.lesson-side { position: sticky; top: 7.5rem; padding: 1rem; }
.lesson-side .panel-head { padding: 0.5rem 0.5rem 0; }

/* Quiz */
.quiz-wrap { max-width: 760px; margin: 0 auto; padding: 2rem; }
.quiz-top { display: flex; justify-content: space-between; color: var(--muted); font-weight: 600; font-size: 0.9rem; margin-bottom: 0.75rem; }
.quiz-q { font-size: 1.5rem; margin: 1.75rem 0 1.25rem; }
.opts { display: grid; gap: 0.75rem; }
.opt { display: flex; align-items: center; gap: 0.85rem; text-align: left; font: inherit; font-weight: 600; padding: 1rem 1.1rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; transition: border-color 0.15s ease; }
.opt:hover:not(:disabled) { border-color: var(--navy); }
.opt:disabled { cursor: default; }
.opt-key { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: var(--bg); color: var(--navy); font-weight: 800; flex: none; }
.opt.is-right { border-color: var(--green); background: var(--green-soft); }
.opt.is-right .opt-key { background: var(--green); color: #fff; }
.opt.is-wrong { border-color: var(--red); background: var(--red-soft); }
.opt.is-wrong .opt-key { background: var(--red); color: #fff; }
.quiz-fb { min-height: 1.5rem; margin-top: 1rem; border-radius: 12px; }
.quiz-fb.is-right, .quiz-fb.is-wrong { padding: 0.9rem 1rem; }
.quiz-fb.is-right { background: var(--green-soft); color: #14532d; }
.quiz-fb.is-wrong { background: var(--red-soft); color: #7c2d12; }
.quiz-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }
.quiz-result { position: relative; text-align: center; display: grid; justify-items: center; }
.quiz-result .ring { margin-bottom: 1.25rem; }
.qr-pct { position: absolute; top: 46px; font-family: var(--serif); font-size: 2.2rem; font-weight: 700; color: var(--navy); }
.quiz-result p { color: var(--muted); }
.quiz-result .quiz-actions { justify-content: center; }

/* Certificates page */
.cert-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.cert-side { display: grid; gap: 0.75rem; }
.cert-side h2 { font-family: var(--sans); font-size: 1.15rem; font-weight: 800; margin: 0; }
.cert-side .muted { margin: 0 0 0.5rem; }
.verify { background: var(--bg); border-radius: 12px; padding: 0.85rem 1rem; display: grid; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
.verify code { color: var(--navy); font-weight: 700; word-break: break-all; }

/* Admin */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.35rem 1.5rem; display: grid; gap: 0.25rem; }
.kpi span { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.kpi strong { font-family: var(--serif); font-size: 2.1rem; color: var(--navy); line-height: 1.15; }
.kpi em { font-style: normal; font-size: 0.84rem; font-weight: 700; }
.kpi em.up { color: var(--green); }
.admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.admin-grid-2 { grid-template-columns: 1.6fr 1fr; }
.chart { width: 100%; height: auto; }
.chart .g { stroke: var(--line); stroke-width: 1; }
.chart .t { font-size: 11px; fill: var(--muted); font-family: var(--sans); }
.chart .line { fill: none; stroke: var(--navy-3); stroke-width: 2.5; stroke-linejoin: round; }
.chart .area { fill: rgba(34,57,122,0.08); }
.chart .pt { fill: #fff; stroke: var(--navy-3); stroke-width: 2.5; }
.chart .pt:hover { fill: var(--gold); }
.hbars { display: grid; gap: 1rem; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 0.75rem; align-items: center; }
.hbar-label { font-size: 0.9rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-val { font-weight: 800; color: var(--navy); font-size: 0.9rem; grid-row: 1; grid-column: 2; }
.hbar-track { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), #9e0c31); }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tbl th { text-align: left; font-size: 0.8rem; font-weight: 700; color: var(--muted); padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 0.8rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-person, .cell-prog { display: flex; align-items: center; gap: 0.7rem; min-width: 210px; }
.cell-person strong, .cell-prog strong { display: block; color: var(--navy); font-weight: 700; }
.cell-person span, .cell-prog span { font-size: 0.82rem; color: var(--muted); }
.cell-prog img { width: 56px; height: 40px; object-fit: cover; border-radius: 8px; }
.pill { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.pill-published, .pill-individual { background: var(--green-soft); color: var(--green); }
.pill-draft { background: var(--bg); color: var(--muted); }
.pill-scheduled, .pill-sponsored { background: var(--gold-soft); color: #9b0c30; }
.pill-government { background: #e7ecfa; color: var(--navy-3); }
.comp { display: flex; align-items: center; gap: 0.6rem; min-width: 140px; }
.comp .bar { flex: 1; }
.comp span { font-weight: 700; font-size: 0.85rem; width: 2.6rem; text-align: right; }
.sponsors { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.sponsors li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.seats { font-weight: 800; color: var(--navy); white-space: nowrap; }
.table-note { padding: 1rem 0.75rem 0; margin: 0; }

/* Modal and toast */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(7,13,31,0.6); }
.modal-card { position: relative; background: #fff; border-radius: var(--r-lg); padding: 2rem; width: min(520px, 100%); box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5); animation: pop 0.2s ease; }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.modal-card h2 { font-size: 1.45rem; }
.modal-card p { color: var(--muted); }
.modal-x { position: absolute; right: 1rem; top: 0.75rem; border: 0; background: none; font-size: 1.6rem; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 12px; background: var(--gold-soft); color: #9b0c30; margin-bottom: 1rem; }
.modal-icon .ic { width: 1.5rem; height: 1.5rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 110; background: var(--navy); color: #fff; padding: 0.85rem 1.25rem; border-radius: 12px; box-shadow: 0 20px 40px -15px rgba(0,0,0,0.5); font-weight: 600; max-width: calc(100% - 2rem); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Responsive */
@media (max-width: 1100px) {
  .p-grid { grid-template-columns: 1fr 1fr; }
  .prog-layout, .lesson-grid, .cert-layout { grid-template-columns: 1fr; }
  .enroll-card { position: static; margin-top: 0; }
  .lesson-side { position: static; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .admin-grid, .admin-grid-2, .dash-grid, .dash-grid-2, .course-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .demo-label { display: none; }
  .view-switch { margin-left: 0; overflow-x: auto; }
  .menu-btn { display: block; }
  .pub-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; flex-direction: column; align-items: stretch; padding: 1rem 1.5rem 1.5rem; border-bottom: 1px solid var(--line); gap: 1rem; }
  .pub-nav.is-open { display: flex; }
  .facts-grid, .journey, .benefits, .fac-grid { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .org-band-grid, .prog-hero-grid, .org-form-grid, .about-grid, .pub-footer-grid { grid-template-columns: 1fr; }
  .prog-facts { grid-template-columns: 1fr 1fr; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 0.5rem; padding: 0.6rem 0.75rem; overflow-x: auto; }
  .side-brand span, .side-out span { display: none; }
  .side-nav { display: flex; gap: 0.25rem; }
  .side-nav a { padding: 0.55rem 0.7rem; white-space: nowrap; }
  .side-out { margin-top: 0; margin-left: auto; }
  .topbar { top: 2.4rem; padding: 0.75rem 1rem; }
  .who div { display: none; }
  .shell-content { padding: 1.25rem; }
  .resume { grid-template-columns: 1fr; }
  .resume img { min-height: 180px; max-height: 200px; }
}
@media (max-width: 620px) {
  .p-grid, .cat-grid, .facts-grid, .journey, .benefits, .fac-grid, .outcomes, .kpis, .f2 { grid-template-columns: 1fr; }
  .sec-head { flex-direction: column; align-items: start; }
  .hero-search .btn { padding-inline: 0.9rem; }
  .course-head { flex-direction: column; align-items: start; }
  .lesson-title-row { flex-direction: column; align-items: start; }
  .cert-foot { grid-template-columns: 1fr; justify-items: center; }
  .my-prog { grid-template-columns: 80px 1fr; }
  .my-prog img { width: 80px; height: 64px; }
  .top-search { display: none; }
}

/* Overflow guards: grid and flex children may shrink below their content width */
.prog-layout > *, .shell-main, .shell-content > *, .dash-grid > *, .admin-grid > *, .course-grid > *, .lesson-grid > *, .cert-layout > *, .org-form-grid > *, .about-grid > * { min-width: 0; }
.panel { min-width: 0; }
/* Exit demo control */
.db-short { display: none; }
.demo-back { flex: none; }
.view-switch { min-width: 0; }
@media (max-width: 620px) {
  .demo-bar-inner { gap: 0.6rem; padding: 0.45rem 0.75rem; }
  .db-full { display: none; }
  .db-short { display: inline; }
  .demo-back { background: rgba(255,255,255,0.1); padding: 0.3rem 0.75rem; border-radius: 999px; }
  .view-switch a { padding: 0.3rem 0.6rem; }
  .prog-facts { grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
  .cert-inner { padding: 1.25rem 0.75rem; }
  .cert-top { flex-direction: column; text-align: center; }
}

@media (max-width: 420px) {
  .demo-bar-inner { gap: 0.35rem; padding: 0.4rem 0.5rem; }
  .view-switch a { padding: 0.3rem 0.45rem; font-size: 0.8rem; }
  .demo-back { padding: 0.3rem 0.55rem; font-size: 0.8rem; }
}
