/* AGRO-AI Academy design system.
   Brand: the official AGRO-AI Academy lockup (src/brand.js, scripts/brand/).
   Palette sampled from the logo — deep forest through wordmark green to lime —
   on clean paper-white surfaces. Glacial Indifference, AGRO-AI's typeface,
   sets headings, navigation and controls; long-form reading stays in a fast
   system sans that covers every script. Logical properties keep every layout
   correct in RTL. */

:root {
  --bg: #fbfbf7;
  --surface: #ffffff;
  --surface-2: #f2f4ec;
  --surface-3: #e7ecdf;
  --ink: #0f2410;
  --ink-2: #34482f;
  --muted: #55664f;
  --line: #e1e6d8;
  --line-strong: #c9d2bd;
  --brand: #1c4c07;
  --brand-2: #27570b;
  --brand-ink: #ffffff;
  --forest: #0c3e03;
  --forest-deep: #082503;
  --accent: #6fac1e;
  --accent-soft: #eef6dc;
  --accent-text: #2f5f0a;
  --lime-1: #d6fc5b;
  --lime-2: #b1e646;
  --on-dark: #eef4e8;
  --on-dark-2: #c3d2bc;
  --on-dark-muted: #bccdb5;
  --grad-brand: linear-gradient(135deg, #0c3e03 0%, #1c4c07 45%, #2f6a0d 100%);
  --grad-brand-hover: linear-gradient(135deg, #12500a 0%, #245f0b 45%, #3b7c12 100%);
  /* Brightest glow stop kept dark enough for AA text anywhere on it (≥ 5.6:1). */
  --grad-forest: radial-gradient(120% 140% at 88% -10%, #245010 0%, #144509 34%, #0a2e05 62%, #071f04 100%);
  --grad-lime: linear-gradient(90deg, #6fac1e 0%, #b1e646 60%, #d6fc5b 100%);
  --info: #1d5fa8;
  --success: #1f7a3d;
  --success-soft: #e6f3ea;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --focus: #3f7d10;
  --shadow-sm: 0 1px 2px rgb(15 36 16 / 6%);
  --shadow: 0 1px 2px rgb(15 36 16 / 5%), 0 10px 30px rgb(15 36 16 / 8%);
  --shadow-lg: 0 28px 70px rgb(8 37 3 / 18%);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --font-brand: "Glacial Indifference", "Avenir Next", Avenir, "Century Gothic", "Segoe UI", system-ui, sans-serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #07160a;
  --surface: #0d2010;
  --surface-2: #122914;
  --surface-3: #1a341b;
  --ink: #eef4e8;
  --ink-2: #c8d6c2;
  --muted: #9cb096;
  --line: #1f3a20;
  --line-strong: #2d4d2c;
  --brand: #b1e646;
  --brand-2: #d6fc5b;
  --brand-ink: #082503;
  --accent: #b1e646;
  --accent-soft: #1b3311;
  --accent-text: #c9ef5a;
  --grad-brand: linear-gradient(135deg, #b1e646 0%, #d6fc5b 100%);
  --grad-brand-hover: linear-gradient(135deg, #c3f05a 0%, #e2ff7c 100%);
  --info: #7fb2ec;
  --success: #6fcf8f;
  --success-soft: #15291c;
  --warn: #f0c46a;
  --warn-soft: #2b2312;
  --danger: #ff8a7f;
  --danger-soft: #2f1714;
  --focus: #d6fc5b;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 28px rgb(0 0 0 / 28%);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / 45%);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #07160a;
    --surface: #0d2010;
    --surface-2: #122914;
    --surface-3: #1a341b;
    --ink: #eef4e8;
    --ink-2: #c8d6c2;
    --muted: #9cb096;
    --line: #1f3a20;
    --line-strong: #2d4d2c;
    --brand: #b1e646;
    --brand-2: #d6fc5b;
    --brand-ink: #082503;
    --accent: #b1e646;
    --accent-soft: #1b3311;
    --accent-text: #c9ef5a;
    --grad-brand: linear-gradient(135deg, #b1e646 0%, #d6fc5b 100%);
    --grad-brand-hover: linear-gradient(135deg, #c3f05a 0%, #e2ff7c 100%);
    --info: #7fb2ec;
    --success: #6fcf8f;
    --success-soft: #15291c;
    --warn: #f0c46a;
    --warn-soft: #2b2312;
    --danger: #ff8a7f;
    --danger-soft: #2f1714;
    --focus: #d6fc5b;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 28px rgb(0 0 0 / 28%);
    --shadow-lg: 0 24px 64px rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; outline: none; }
img, svg, video { max-width: 100%; }
img { height: auto; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:root[data-theme="dark"] a { color: var(--accent-text); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.01em; color: var(--ink); font-family: var(--font-brand); font-weight: 700; }
h4 { font-family: var(--font-sans); font-weight: 650; }
h1, h2 { text-wrap: balance; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
pre { background: var(--surface-2); border: 1px solid var(--line); padding: 1rem; border-radius: var(--radius-sm); overflow: auto; }
pre code { background: none; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }
.medium { max-width: 960px; }
.stack > * + * { margin-top: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ic { flex-shrink: 0; vertical-align: -0.2em; }
[dir="rtl"] .ic-flip, [dir="rtl"] .btn .ic[data-dir] { transform: scaleX(-1); }

.eyebrow { font: 700 .8rem/1.3 var(--font-brand); letter-spacing: .16em; text-transform: uppercase; color: var(--accent-text); margin-bottom: .85rem; display: flex; align-items: flex-start; gap: .65em; }
.eyebrow::before { content: ""; width: 22px; height: 3px; margin-top: .5em; border-radius: 2px; background: var(--grad-lime); flex-shrink: 0; }
.display { font-size: clamp(2.5rem, 5.4vw, 4.2rem); line-height: 1.04; letter-spacing: -0.025em; }
.display-sm { font-size: clamp(2rem, 4.2vw, 3.15rem); line-height: 1.06; letter-spacing: -0.02em; }
.h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.28rem); color: var(--ink-2); line-height: 1.55; max-width: 62ch; }
.gradient-text, .hero h1 em { color: var(--brand-2); }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .gradient-text, .hero h1 em { background: linear-gradient(100deg, #1c4c07 0%, #427b11 55%, #6fac1e 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
  :root[data-theme="dark"] .gradient-text, :root[data-theme="dark"] .hero h1 em { background-image: var(--grad-lime); }
  @media (prefers-color-scheme: dark) { :root[data-theme="system"] .gradient-text, :root[data-theme="system"] .hero h1 em { background-image: var(--grad-lime); } }
}
.section { padding-block: clamp(56px, 8vw, 104px); }
.section-tight { padding-block: clamp(32px, 5vw, 56px); }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.section-head p { margin: 0; max-width: 60ch; color: var(--muted); }

/* ───────── Buttons & controls ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .65rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  font: 700 .97rem/1.2 var(--font-brand); letter-spacing: .01em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); background-image: var(--grad-brand); color: var(--brand-ink) !important; box-shadow: 0 1px 0 rgb(255 255 255 / 12%) inset, 0 6px 18px rgb(12 62 3 / 22%); }
.btn-primary:hover { background-image: var(--grad-brand-hover); box-shadow: 0 1px 0 rgb(255 255 255 / 14%) inset, 0 10px 26px rgb(12 62 3 / 28%); }
.btn-lime { background: var(--lime-1); color: var(--forest-deep) !important; }
.btn-lime:hover { background: #e4ff86; box-shadow: 0 10px 26px rgb(214 252 91 / 25%); }
.btn-secondary { background: var(--surface); color: var(--ink) !important; border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand) !important; }
.btn-quiet { background: transparent; color: var(--ink) !important; }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff !important; }
.btn-sm { min-height: 36px; padding: .4rem .85rem; font-size: .875rem; }
.btn-lg { min-height: 52px; padding: .85rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  background: transparent; border: 1px solid transparent; color: var(--ink); cursor: pointer; list-style: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn::-webkit-details-marker, summary::-webkit-details-marker { display: none; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.inline { display: inline; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: .35rem; }
.field { margin-bottom: 1.1rem; }
.field-hint { font-size: .82rem; color: var(--muted); margin-top: .3rem; font-weight: 400; }
.field-error { font-size: .85rem; color: var(--danger); margin-top: .3rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="url"],
input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: 46px; padding: .6rem .8rem; font: 1rem/1.4 var(--font-sans);
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; }
textarea.code { font-family: var(--font-mono); font-size: .88rem; min-height: 320px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid="true"] { border-color: var(--danger); }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: var(--brand); }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 40px); box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.25rem; }
legend { font-weight: 650; padding: 0 .35rem; }

.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 1.25rem; font-size: .95rem; }
.alert p:last-child { margin: 0; }
.alert-info { background: var(--surface-2); border-color: var(--line-strong); }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--ink); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge-green { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-lime { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ───────── Header ───────── */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 72px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; border-radius: 10px; }
.brand .logo { display: block; height: 46px; width: auto; }
.logo-on-dark { display: none !important; }
:root[data-theme="dark"] .logo-on-light { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .logo-on-light { display: none !important; }
  :root[data-theme="system"] .logo-on-dark { display: block !important; }
}
.primary-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.primary-nav a { position: relative; white-space: nowrap; display: block; padding: .55rem .8rem; border-radius: 999px; text-decoration: none; color: var(--ink-2); font: 700 .98rem/1.2 var(--font-brand); letter-spacing: .01em; }
.primary-nav a:hover { background: var(--surface-2); color: var(--ink); }
.primary-nav a[aria-current="page"] { color: var(--brand); }
.primary-nav a[aria-current="page"]::after { content: ""; position: absolute; inset-inline: .8rem; bottom: .2rem; height: 2px; border-radius: 2px; background: var(--grad-lime); }
.header-tools { margin-inline-start: auto; display: flex; align-items: center; gap: .4rem; }
.lang { display: flex; align-items: center; gap: .3rem; }
.lang-label { display: flex; align-items: center; gap: .3rem; margin: 0; color: var(--muted); position: relative; }
.lang select { min-height: 36px; width: auto; max-width: 140px; padding: .3rem 1.6rem .3rem .5rem; padding-inline: .5rem 1.6rem; font-size: .88rem; border-radius: 999px; background: var(--surface); appearance: auto; }
.theme-form { margin: 0; }
:root[data-theme="dark"] .when-dark, :root[data-theme="light"] .when-light, :root[data-theme="system"] .when-light { display: inline; }
:root[data-theme="dark"] .when-light, :root[data-theme="light"] .when-dark, :root[data-theme="system"] .when-dark { display: none; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .when-dark { display: inline; } :root[data-theme="system"] .when-light { display: none; } }
.account-menu, .mobile-nav { position: relative; }
.account-menu summary, .mobile-nav summary { list-style: none; cursor: pointer; }
.avatar-btn { display: block; border-radius: 999px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; background: var(--brand); background-image: var(--grad-brand); color: var(--brand-ink); font: 700 1rem var(--font-brand); }
.menu-panel, .mobile-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 240px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .5rem;
}
.menu-panel a, .menu-panel button, .mobile-panel a {
  display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .75rem; border-radius: 10px; text-decoration: none;
  color: var(--ink) !important; background: none; border: 0; font: inherit; font-size: .95rem; cursor: pointer; text-align: start;
}
.menu-panel a:hover, .menu-panel button:hover, .mobile-panel a:hover { background: var(--surface-2); }
.menu-name { padding: .5rem .75rem .65rem; margin: 0 0 .35rem; border-bottom: 1px solid var(--line); font-weight: 650; }
.menu-name span { display: block; font-weight: 400; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.mobile-nav { display: none; }
.notice-bar { background: var(--warn-soft); border-top: 1px solid var(--line); font-size: .9rem; padding: .45rem 0; }
.notice-bar .wrap { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 980px) {
  .primary-nav { display: none; }
  .mobile-nav { display: block; }
}
.site-header.nav-compact .primary-nav { display: none; }
.site-header.nav-compact .mobile-nav { display: block; }
.site-header.tools-compact .btn-start { display: none; }
.site-header.tools-compact .lang-label > .ic { display: none; }
.site-header.tools-compact .lang select { max-width: 112px; }
@media (max-width: 560px) {
  .hide-sm { display: none !important; }
  .brand .logo { height: 36px; }
  .lang-label > .ic { display: none; }
  .lang select { max-width: 122px; }
  .header-row { gap: .5rem; }
  .header-tools { gap: .15rem; }
  .header-tools .btn-start { display: none; }
}
@media (max-width: 400px) { .brand .logo { height: 32px; } }

/* ───────── Footer ───────── */
.site-footer { position: relative; background: var(--forest-deep); background-image: var(--grad-forest); color: var(--on-dark-2); margin-top: auto; }
.site-footer::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--grad-lime); }
.site-footer a { color: var(--on-dark); text-decoration: none; display: flex; align-items: center; gap: .3rem; padding: .25rem 0; font-size: .93rem; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .brand .logo { height: 48px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 2rem; padding-block: 64px 36px; }
.footer-grid h2 { font: 700 .8rem/1 var(--font-brand); letter-spacing: .14em; text-transform: uppercase; color: var(--lime-2); margin-bottom: 1rem; }
.footer-brand p { margin-top: 1.1rem; max-width: 34ch; font-size: .95rem; }
.free-badge { display: inline-flex; gap: .4rem; align-items: center; color: var(--lime-1); font: 700 .95rem var(--font-brand); }
.footer-base { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid rgb(214 252 91 / 14%); padding-block: 20px 28px; font-size: .82rem; color: var(--on-dark-muted); }
.footer-base p { margin: 0; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ───────── Hero ───────── */
.hero { position: relative; overflow: hidden; padding-block: clamp(48px, 8vw, 104px) clamp(48px, 7vw, 88px);
  background: radial-gradient(60% 70% at 100% 0%, rgb(177 230 70 / 16%), transparent 70%), radial-gradient(50% 60% at 0% 100%, rgb(28 76 7 / 6%), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: 1.25rem; }
.hero h1 em { font-style: normal; }
.hero-points { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 1.75rem; padding: 0; list-style: none; color: var(--ink-2); font-size: .95rem; }
.hero-points li { display: inline-flex; gap: .45rem; align-items: center; }
.hero-points .ic { color: var(--success); }
.hero-visual { position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 5 / 5.4; box-shadow: var(--shadow-lg); background: var(--forest-deep); background-image: var(--grad-forest); }
.hero-visual > svg { display: block; width: 100%; height: 100%; }
.hero-brand { display: grid; place-items: center; }
.hero-brand::before { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 50% 42%, transparent 0 46px, rgb(214 252 91 / 7%) 46px 47px); }
.hero-brand .hero-lockup { position: relative; width: min(64%, 300px); height: auto; margin-bottom: 18%; filter: drop-shadow(0 18px 40px rgb(0 0 0 / 35%)); }
.hero-card {
  position: absolute; inset-inline: 18px; bottom: 18px; background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink);
}
.hero-card .row-between { flex-wrap: nowrap; }
.hero-card strong { display: block; font-size: 1rem; }
.hero-card .tiny { color: var(--muted); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-visual { aspect-ratio: 16 / 11; } }

/* ───────── Cards & grids ───────── */
.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .cards-3, .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .cards-3, .cards-4 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.card h3 { font-size: 1.12rem; }
.card-link { text-decoration: none; color: inherit !important; display: block; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.course-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; height: 100%; }
.course-card .thumb { aspect-ratio: 16 / 9; background: var(--surface-3); position: relative; overflow: hidden; }
.course-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.course-card:hover .thumb img { transform: scale(1.03); }
.course-card .thumb .badge { position: absolute; top: 12px; inset-inline-start: 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); }
.course-card .body { padding: 1.15rem 1.25rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.course-card h3 { margin: 0; font-size: 1.1rem; line-height: 1.3; }
.course-card p { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; color: var(--muted); font-size: .84rem; align-items: center; margin-top: auto; padding-top: .5rem; }
.meta span { display: inline-flex; gap: .3rem; align-items: center; }
.program-label { font: 700 .76rem/1.3 var(--font-brand); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.feature { display: flex; flex-direction: column; gap: .6rem; }
.feature-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); }
.feature p { color: var(--muted); margin: 0; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.steps li::before { content: counter(step, decimal-leading-zero); font: 600 .85rem var(--font-mono); color: var(--accent-text); display: block; margin-bottom: .75rem; }
.steps h3 { font-size: 1.05rem; }
.steps p { color: var(--muted); font-size: .93rem; margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.topic-chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chip { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink) !important; font-weight: 550; font-size: .93rem; }
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed="true"], .chip.active { background: var(--brand); color: var(--brand-ink) !important; border-color: var(--brand); }
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 760px) { .stat-band { grid-template-columns: 1fr 1fr; } }
.stat { padding: 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stat .value { font: 700 2.1rem/1.1 var(--font-brand); letter-spacing: -0.01em; display: block; color: var(--brand); }
.stat .label { color: var(--muted); font-size: .88rem; }

.cert-showcase { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 900px) { .cert-showcase { grid-template-columns: 1fr; } }
.check-list { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .7rem; }
.check-list li { display: flex; gap: .6rem; align-items: flex-start; }
.check-list .ic { color: var(--success); margin-top: 3px; }

.faq details { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
.faq summary { cursor: pointer; font: 700 1.08rem/1.35 var(--font-brand); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: .75rem 0 0; color: var(--ink-2); max-width: 70ch; }

.instructor { display: flex; gap: 1rem; align-items: flex-start; }
.instructor-avatar { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); display: grid; place-items: center; flex-shrink: 0; color: var(--accent-text); font: 700 1.4rem var(--font-brand); overflow: hidden; }
.instructor-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Always the forest surface with light text, in every theme. */
.cta-band { background: var(--forest-deep); background-image: var(--grad-forest); color: #fff; border: 1px solid rgb(214 252 91 / 12%); border-radius: 28px; padding: clamp(32px, 6vw, 64px); display: flex; justify-content: space-between; gap: 2rem; align-items: center; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta-band h2 { color: inherit; margin: 0 0 .5rem; }
.cta-band p { margin: 0; color: var(--on-dark-2); max-width: 52ch; }
.cta-band .btn-primary { background: var(--lime-1); background-image: none; color: var(--forest-deep) !important; box-shadow: none; }
.cta-band .btn-primary:hover { background: #e4ff86; }

/* ───────── Page header ───────── */
.page-head { padding-block: clamp(40px, 6vw, 76px) clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--line); background: radial-gradient(55% 120% at 100% 0%, rgb(177 230 70 / 14%), transparent 70%), var(--surface-2); }
.page-head h1 { margin: 0 0 .6rem; }
.page-head .lead { margin: 0; }
.breadcrumbs { display: flex; gap: .35rem; flex-wrap: wrap; font-size: .86rem; color: var(--muted); margin-bottom: 1rem; list-style: none; padding: 0; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-inline-end: .35rem; color: var(--line-strong); }

/* ───────── Catalog ───────── */
.catalog { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2rem; padding-block: 2rem 4rem; }
.filters { position: sticky; top: 88px; align-self: start; }
.filters fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
.filters legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .5rem; padding: 0; }
.filters .check { font-size: .93rem; padding: .2rem 0; }
.search-bar { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.search-bar input { border-radius: 999px; padding-inline-start: 1rem; }
.results-meta { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
@media (max-width: 900px) { .catalog { grid-template-columns: 1fr; } .filters { position: static; } .filters-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; } }
.empty { text-align: center; padding: 3rem 1.5rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); color: var(--muted); background: var(--surface); }
.empty .ic { color: var(--accent-text); margin-bottom: .5rem; }
.empty h2, .empty h3 { color: var(--ink); font-size: 1.25rem; }

/* ───────── Course landing ───────── */
.course-hero { background: var(--forest-deep); background-image: var(--grad-forest); color: var(--on-dark); padding-block: clamp(40px, 6vw, 76px); }
.course-hero h1 { color: #fff; }
.course-hero .lead { color: var(--on-dark-2); }
.course-hero a { color: var(--lime-1); }
.course-hero .breadcrumbs, .course-hero .breadcrumbs a { color: var(--on-dark-muted); }
.course-hero .translation-note { color: var(--on-dark-2); }
.course-hero .badge { background: rgb(255 255 255 / 8%); color: var(--on-dark); border-color: rgb(255 255 255 / 14%); }
.course-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 3rem; align-items: start; }
.course-hero .meta { color: var(--on-dark-2); font-size: .92rem; }
.enroll-card { background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.enroll-card .thumb { aspect-ratio: 16/9; }
.enroll-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.enroll-card .body { padding: 1.4rem; }
.enroll-card a:not(.btn) { color: var(--brand); }
.course-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 3rem; padding-block: 3rem 4rem; }
@media (max-width: 980px) { .course-hero-grid, .course-body { grid-template-columns: 1fr; } }
.objectives { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.5rem; list-style: none; padding: 1.5rem; margin: 0 0 2rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.objectives li { display: flex; gap: .6rem; font-size: .95rem; }
.objectives .ic { color: var(--success); margin-top: 3px; }
@media (max-width: 640px) { .objectives { grid-template-columns: 1fr; } }
.syllabus { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.syllabus details { border-bottom: 1px solid var(--line); }
.syllabus details:last-child { border-bottom: 0; }
.syllabus summary { padding: 1rem 1.25rem; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; font-weight: 650; background: var(--surface-2); list-style: none; }
.syllabus summary .muted { font-weight: 400; font-size: .86rem; }
.syllabus ol { list-style: none; margin: 0; padding: .35rem 0; }
.syllabus li { display: flex; gap: .75rem; align-items: center; padding: .6rem 1.25rem; font-size: .95rem; }
.syllabus li .grow { display: flex; gap: .5rem; align-items: center; }
.syllabus li .ic { color: var(--muted); }
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; width: calc(var(--p, 0) * 1%); height: 100%; background: linear-gradient(90deg, var(--lime-2), var(--accent)); border-radius: inherit; transition: width .4s ease; }
.progress-lg { height: 12px; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring > div { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring strong { font: 700 1.6rem/1 var(--font-brand); }

/* ───────── Classroom ───────── */
.classroom { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.class-sidebar { border-inline-end: 1px solid var(--line); background: var(--surface); position: sticky; top: 68px; height: calc(100vh - 68px); overflow-y: auto; }
.class-sidebar header { padding: 1.25rem; border-bottom: 1px solid var(--line); }
.class-sidebar h2 { font: 700 1.02rem/1.3 var(--font-brand); margin: 0 0 .75rem; }
.class-sidebar h3 { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 1rem 1.25rem .4rem; margin: 0; font-weight: 700; }
.class-sidebar ol { list-style: none; margin: 0; padding: 0 .5rem .5rem; }
.class-sidebar li a { display: flex; gap: .65rem; align-items: flex-start; padding: .6rem .75rem; border-radius: 10px; text-decoration: none; color: var(--ink-2) !important; font-size: .92rem; line-height: 1.35; }
.class-sidebar li a:hover { background: var(--surface-2); }
.class-sidebar li a[aria-current="page"] { background: var(--accent-soft); color: var(--ink) !important; font-weight: 600; }
.class-sidebar .done .ic { color: var(--success); }
.class-sidebar .lesson-meta { display: block; font-size: .78rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.class-main { min-width: 0; }
.class-top { display: flex; align-items: center; gap: .75rem; padding: .75rem var(--gutter); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 68px; z-index: 5; }
.class-top .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-content { max-width: 920px; margin: 0 auto; padding: 1.75rem var(--gutter) 4rem; }
.sidebar-toggle { display: none; }
@media (max-width: 1024px) {
  .classroom { grid-template-columns: 1fr; }
  .class-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(88vw, 360px); height: 100vh; z-index: 60; transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  [dir="rtl"] .class-sidebar { transform: translateX(105%); }
  .class-sidebar.open { transform: none !important; }
  .sidebar-toggle { display: inline-grid; }
  .class-top { top: 68px; }
}
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 40%); z-index: 55; }

.player { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.player video, .player iframe { width: 100%; height: 100%; display: block; background: #000; border: 0; }
/* Licence mark: makes a recording attributable to its account; never blocks the player. */
.player-mark { position: absolute; z-index: 2; inset-inline-end: .75rem; inset-block-start: .75rem; pointer-events: none; user-select: none; color: rgb(255 255 255 / .5); font: 600 .72rem/1.2 var(--font-brand); letter-spacing: .02em; text-shadow: 0 1px 2px rgb(0 0 0 / .7); animation: player-mark-drift 90s ease-in-out infinite alternate; }
@keyframes player-mark-drift { 0% { transform: translate(0, 0); } 50% { transform: translate(-40%, 650%); } 100% { transform: translate(-120%, 1200%); } }
.ai-disclosure { display: flex; gap: .35rem; align-items: center; color: var(--muted); }
.license-note { display: flex; gap: .35rem; align-items: center; margin-top: 1.5rem; padding-top: .75rem; border-top: 1px solid var(--line); max-width: 72ch; }
.player-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.player-bar select { width: auto; min-height: 36px; padding: .25rem .5rem; font-size: .88rem; }
.video-pending { aspect-ratio: 16/9; border-radius: var(--radius); background: var(--forest-deep); background-image: var(--grad-forest); color: var(--on-dark); display: grid; place-items: center; text-align: center; padding: 2rem; }
.video-pending h2 { color: #fff; font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
.video-pending p { color: var(--on-dark-2); max-width: 52ch; margin-inline: auto; }
.video-pending .ic { color: var(--lime-1); }
.lesson-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 2rem 0 1.25rem; overflow-x: auto; }
.lesson-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: .7rem 1rem; font: 700 .95rem var(--font-brand); color: var(--muted); cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; white-space: nowrap; }
.lesson-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.prose { font-size: 1.06rem; line-height: 1.75; color: var(--ink); max-width: 72ch; }
.prose h2 { font-size: 1.65rem; margin-top: 2.2rem; }
.prose h3 { font-size: 1.22rem; margin-top: 1.8rem; }
.prose h4 { font-size: 1.05rem; margin-top: 1.4rem; }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose li { margin: .35rem 0; }
.prose blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-inline-start: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
[dir="rtl"] .prose blockquote { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.prose blockquote p:last-child { margin: 0; }
.prose .callout-important { border-inline-start-color: var(--warn); background: var(--warn-soft); }
.prose .callout-field-check { border-inline-start-color: var(--success); background: var(--success-soft); }
.prose img { border-radius: var(--radius); }
.table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: .65rem .85rem; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.25rem; }
.note-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; margin-top: .75rem; background: var(--surface); }
.note-item time { font-size: .8rem; color: var(--muted); }
.transcript { max-height: 420px; overflow-y: auto; padding-inline-end: .5rem; }
.transcript p { cursor: default; }
.complete-box { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-radius: var(--radius); background: var(--accent-soft); margin-top: 2rem; flex-wrap: wrap; }
.translation-note { font-size: .86rem; display: inline-flex; gap: .4rem; align-items: center; color: var(--muted); }

/* ───────── Assessments ───────── */
.exam-shell { max-width: 860px; margin: 0 auto; padding: 1.5rem var(--gutter) 5rem; }
.exam-status { position: sticky; top: 68px; z-index: 10; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: .75rem 0; margin-bottom: 1.5rem; }
.exam-status .row-between { flex-wrap: nowrap; }
.timer { font: 600 1.1rem var(--font-mono); display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .8rem; border-radius: 999px; background: var(--surface-2); }
.timer.low { background: var(--danger-soft); color: var(--danger); }
.question { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: clamp(18px, 3vw, 28px); margin-bottom: 1.25rem; }
.question legend, .question .q-head { font-weight: 650; font-size: 1.06rem; line-height: 1.45; padding: 0; margin-bottom: 1rem; float: left; width: 100%; }
[dir="rtl"] .question legend { float: right; }
.question legend + * { clear: both; }
.question fieldset { border: 0; padding: 0; margin: 0; }
.q-num { display: block; font: 600 .78rem var(--font-mono); color: var(--accent-text); margin-bottom: .35rem; letter-spacing: .05em; }
.q-case { background: var(--surface-2); border-radius: var(--radius-sm); padding: 1rem 1.15rem; margin-bottom: 1rem; font-size: .96rem; }
.option { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .55rem; cursor: pointer; font-weight: 450; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--line-strong); }
.option:has(input:checked) { border-color: var(--brand); background: var(--accent-soft); }
.option input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.match-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; align-items: center; margin-bottom: .6rem; }
@media (max-width: 560px) { .match-row { grid-template-columns: 1fr; gap: .3rem; } }
.order-list { list-style: none; padding: 0; margin: 0; }
.order-list li { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .5rem; background: var(--surface); }
.order-list li .grow { font-weight: 450; }
.order-list select { width: auto; min-height: 36px; }
.result-hero { text-align: center; padding: 2.5rem 1rem 2rem; }
.result-hero .ring { margin: 0 auto 1.25rem; width: 150px; height: 150px; }
.result-hero .ring > div { width: 116px; height: 116px; }
.feedback-item { border-inline-start: 4px solid var(--line-strong); padding: .9rem 1.1rem; margin-bottom: 1rem; background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); }
.feedback-item.correct { border-inline-start-color: var(--success); }
.feedback-item.incorrect { border-inline-start-color: var(--danger); }
.feedback-item.pending { border-inline-start-color: var(--warn); }
.save-state { font-size: .82rem; color: var(--muted); }

/* ───────── Dashboard ───────── */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2rem; padding-block: 2rem 4rem; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.dash-tabs a { padding: .75rem 1rem; text-decoration: none; color: var(--muted) !important; font: 700 .97rem var(--font-brand); border-bottom: 2px solid transparent; white-space: nowrap; }
.dash-tabs a[aria-current="page"] { color: var(--ink) !important; border-bottom-color: var(--brand); }
.continue-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.25rem; align-items: center; padding: 1rem; }
.continue-card .thumb { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; }
.continue-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 620px) { .continue-card { grid-template-columns: 1fr; } }
.list-row { display: flex; gap: 1rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .thumb-sm { width: 72px; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--surface-3); }
.list-row .thumb-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.achievement { display: flex; gap: .75rem; align-items: center; padding: .6rem 0; }
.achievement .medal { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex-shrink: 0; }
.achievement.locked .medal { background: var(--surface-2); color: var(--muted); }
/* Locked achievements are distinguished by their muted medal and label, not by opacity (keeps text contrast). */
.achievement.locked strong { color: var(--ink-2); font-weight: 600; }

/* ───────── Certificates ───────── */
.certificate {
  position: relative; aspect-ratio: 1.414 / 1; background: #fffdf8; color: #0f2410; border-radius: 6px;
  box-shadow: var(--shadow-lg); padding: 5.5% 6.5%; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid #e3e0d4; container-type: inline-size;
}
.certificate::before { content: ""; position: absolute; inset: 2.2%; border: 1.5px solid #1c4c07; border-radius: 3px; pointer-events: none; }
.certificate::after { content: ""; position: absolute; inset: 3.1%; border: .5px solid #6fac1e; border-radius: 2px; pointer-events: none; }
.certificate .c-top, .certificate .c-center, .certificate .c-foot { font-size: clamp(6px, 2.25cqw, 16px); }
.certificate .c-top { display: flex; justify-content: space-between; align-items: center; }
.certificate .c-brand { display: flex; align-items: center; }
.certificate .c-brand .logo { height: 3.4em; width: auto; display: block; }
.certificate .c-id { font: 600 .85em var(--font-mono); color: #5d6c62; }
.certificate .c-center { text-align: center; margin-block: auto; }
.certificate .c-label { letter-spacing: .3em; text-transform: uppercase; font: 700 .9em var(--font-brand); color: #27570b; }
.certificate .c-name { font: 700 3.3em/1.1 Georgia, "Times New Roman", serif; margin: .45em 0 .3em; color: #0f2410; letter-spacing: -0.01em; }
.certificate .c-text { color: #34482f; font-size: 1.05em; max-width: 46em; margin: 0 auto; }
.certificate .c-course { font: 700 1.85em/1.2 var(--font-brand); margin: .4em 0; color: #1c4c07; }
.certificate .c-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 1em; font-size: .9em; color: #34482f; }
.certificate .c-foot strong { display: block; color: #0f2410; }
.certificate .c-qr { width: 6.5em; height: 6.5em; background: #fff; padding: .3em; }
.certificate .c-qr svg { width: 100%; height: 100%; display: block; }
.certificate.revoked { filter: grayscale(1); opacity: .7; }
.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.share-grid .btn { justify-content: flex-start; }
@media (max-width: 480px) { .share-grid { grid-template-columns: 1fr; } }
.verify-result { border-radius: var(--radius-lg); padding: 1.75rem; border: 1px solid var(--line); background: var(--surface); }
.verify-result.valid { border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.verify-result.invalid { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.verify-status { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; }
.verify-status.valid { color: var(--success); }
.verify-status.invalid { color: var(--danger); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.5rem; margin: 1.25rem 0 0; }
dl.kv dt { color: var(--muted); font-size: .9rem; }
dl.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
@media (max-width: 520px) { dl.kv { grid-template-columns: 1fr; gap: .1rem; } dl.kv dd { margin-bottom: .6rem; } }

/* ───────── Auth ───────── */
.auth-page { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 68px); }
.auth-aside { background: var(--forest-deep); background-image: var(--grad-forest); color: var(--on-dark); padding: clamp(32px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-aside h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); position: relative; }
.auth-aside p, .auth-aside li { color: var(--on-dark-2); position: relative; }
.auth-aside .check-list .ic { color: var(--lime-1); }
.auth-aside .auth-lockup { position: relative; width: 168px; height: auto; margin-bottom: 2rem; }
.auth-aside svg.bg-art { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: clamp(24px, 5vw, 64px) var(--gutter); }
.auth-main .form-wrap { width: 100%; max-width: 440px; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .85rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.google-btn img, .google-btn svg { width: 18px; height: 18px; }
@media (max-width: 900px) { .auth-page { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ───────── Admin ───────── */
.admin { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.admin-nav { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 1.25rem .75rem; }
.admin-nav h2 { font: 700 .76rem var(--font-brand); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: .9rem .75rem .35rem; margin: 0; }
.admin-nav a { display: flex; gap: .6rem; align-items: center; padding: .55rem .75rem; border-radius: 10px; text-decoration: none; color: var(--ink-2) !important; font-size: .93rem; font-weight: 550; }
.admin-nav a:hover { background: var(--surface-2); }
.admin-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink) !important; }
.admin-main { padding: 1.75rem clamp(16px, 3vw, 40px) 4rem; min-width: 0; }
.admin-main h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.admin-main h2 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); }
.admin-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.admin-table:focus-visible { outline: 3px solid var(--focus, var(--brand)); outline-offset: 2px; }
.toc-list a { display: inline-block; min-height: 24px; padding-block: .15rem; }
.toc-list li + li { margin-top: .15rem; }
.admin-table table td, .admin-table table th { white-space: nowrap; }
.admin-table td.wrap-cell { white-space: normal; min-width: 240px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.kpi .value { font: 700 1.9rem/1.1 var(--font-brand); display: block; color: var(--brand); }
.kpi .label { color: var(--muted); font-size: .85rem; }
.bar-list { display: grid; gap: .55rem; }
.bar-list .bar-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 56px; gap: .75rem; align-items: center; font-size: .9rem; }
.bar-list .bar { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar-list .bar span { display: block; width: calc(var(--p, 0) * 1%); height: 100%; background: var(--brand); border-radius: inherit; }
.status-pill { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 900px) { .admin { grid-template-columns: 1fr; } .admin-nav { display: flex; flex-wrap: wrap; gap: .25rem; padding: .75rem; } .admin-nav h2 { display: none; } }
.tabs-inline { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .75rem 1.25rem; border-radius: 999px; box-shadow: var(--shadow-lg); z-index: 100; font-weight: 600; font-size: .93rem; max-width: calc(100vw - 32px); }
[dir="rtl"] .toast { transform: translateX(50%); }
.lang-notice { background: var(--accent-soft); color: var(--ink); border-bottom: 1px solid var(--line); font-size: .88rem; padding: .5rem 0; }
.lang-notice .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.lang-notice a { font-weight: 600; }
.offline-pill { position: fixed; bottom: 16px; inset-inline-end: 16px; z-index: 90; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--line); padding: .45rem .85rem; border-radius: 999px; font-size: .85rem; font-weight: 600; display: inline-flex; gap: .4rem; align-items: center; }

.error-page { padding-block: clamp(64px, 12vw, 140px); }

@media (prefers-reduced-motion: reduce) {
  .player-mark { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  body { background: #fff; }
  .certificate { box-shadow: none; font-size: 13px; }
}

/* Percentage utilities (CSP forbids inline style attributes). */
.pct-0{--p:0}.pct-1{--p:1}.pct-2{--p:2}.pct-3{--p:3}.pct-4{--p:4}.pct-5{--p:5}.pct-6{--p:6}.pct-7{--p:7}.pct-8{--p:8}.pct-9{--p:9}.pct-10{--p:10}.pct-11{--p:11}.pct-12{--p:12}.pct-13{--p:13}.pct-14{--p:14}.pct-15{--p:15}.pct-16{--p:16}.pct-17{--p:17}.pct-18{--p:18}.pct-19{--p:19}.pct-20{--p:20}.pct-21{--p:21}.pct-22{--p:22}.pct-23{--p:23}.pct-24{--p:24}.pct-25{--p:25}.pct-26{--p:26}.pct-27{--p:27}.pct-28{--p:28}.pct-29{--p:29}.pct-30{--p:30}.pct-31{--p:31}.pct-32{--p:32}.pct-33{--p:33}.pct-34{--p:34}.pct-35{--p:35}.pct-36{--p:36}.pct-37{--p:37}.pct-38{--p:38}.pct-39{--p:39}.pct-40{--p:40}.pct-41{--p:41}.pct-42{--p:42}.pct-43{--p:43}.pct-44{--p:44}.pct-45{--p:45}.pct-46{--p:46}.pct-47{--p:47}.pct-48{--p:48}.pct-49{--p:49}.pct-50{--p:50}.pct-51{--p:51}.pct-52{--p:52}.pct-53{--p:53}.pct-54{--p:54}.pct-55{--p:55}.pct-56{--p:56}.pct-57{--p:57}.pct-58{--p:58}.pct-59{--p:59}.pct-60{--p:60}.pct-61{--p:61}.pct-62{--p:62}.pct-63{--p:63}.pct-64{--p:64}.pct-65{--p:65}.pct-66{--p:66}.pct-67{--p:67}.pct-68{--p:68}.pct-69{--p:69}.pct-70{--p:70}.pct-71{--p:71}.pct-72{--p:72}.pct-73{--p:73}.pct-74{--p:74}.pct-75{--p:75}.pct-76{--p:76}.pct-77{--p:77}.pct-78{--p:78}.pct-79{--p:79}.pct-80{--p:80}.pct-81{--p:81}.pct-82{--p:82}.pct-83{--p:83}.pct-84{--p:84}.pct-85{--p:85}.pct-86{--p:86}.pct-87{--p:87}.pct-88{--p:88}.pct-89{--p:89}.pct-90{--p:90}.pct-91{--p:91}.pct-92{--p:92}.pct-93{--p:93}.pct-94{--p:94}.pct-95{--p:95}.pct-96{--p:96}.pct-97{--p:97}.pct-98{--p:98}.pct-99{--p:99}.pct-100{--p:100}

.syllabus .mod-summary { padding: .75rem 1.25rem 0; margin: 0; }
.w-small { width: 90px !important; flex: 0 0 auto; }
.exam-title { font: 700 1.02rem/1.3 var(--font-brand); margin: 0; letter-spacing: 0; }
.course-hero .eyebrow, .auth-aside .eyebrow, .site-footer .eyebrow, .cta-band .eyebrow { color: var(--lime-1); }
.dash-grid aside .h2, .dash-grid aside h2 { font: 700 1.15rem/1.3 var(--font-brand); letter-spacing: 0; margin-bottom: .75rem; }
.prose h2:first-child { margin-top: 0; }
.upcoming-box { display: flex; gap: .6rem; align-items: center; padding: .9rem 1rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-text); font-size: 1.02rem; }
.upcoming-box strong { color: var(--ink); }
.planned-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .4rem 1.5rem; font-size: .93rem; }
.planned-list li { display: flex; gap: .4rem; align-items: center; color: var(--ink-2); }

/* English curriculum text inside a right-to-left page keeps its own direction;
   headings and leads still align with the page edge. */
[dir="rtl"] :is(h1, h2, h3, .lead, .course-card .body)[dir="ltr"] { text-align: right; }
