/* Public site (landing, later auth pages and Course Home).
   Colors and fonts follow theme/tokens.yml — keep them in sync with the book.
   Mobile first; logical properties so the page works RTL (Arabic) and LTR. */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "Inter"; src: url("../fonts/Inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/PlexArabic-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/PlexArabic-500.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/PlexArabic-600.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/PlexArabic-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/PlexMono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/PlexMono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  /* tokens.yml */
  --ink: #0f172a;
  --muted: #475569;
  --neutral: #94a3b8;
  --line: #e2e8f0;
  --mist: #f1f5f9;
  --primary: #4f46e5;
  --primary-light: #c7d2fe;
  --secondary: #0f766e;
  --secondary-light: #99f6e4;
  --warn: #b45309;
  --danger: #be123c;

  /* roles */
  --bg: #ffffff;
  --bg-tint: #f8fafc;
  --surface: #ffffff;
  --fg: var(--ink);
  --fg-muted: var(--muted);
  --accent: var(--primary);
  --accent-ink: #ffffff;
  --accent-soft: #eef2ff;
  --ok: var(--secondary);
  --risk: var(--danger);
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -8px rgba(15, 23, 42, .14);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, .06), 0 30px 60px -20px rgba(15, 23, 42, .28);

  --font: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 14px;
  --radius-sm: 10px;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);

  color-scheme: light;
}

/* Dark: the device setting, unless the visitor chose light; or an explicit
   dark choice (assets/js/theme.js sets data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e14;
    --bg-tint: #10141c;
    --surface: #151a23;
    --fg: #e6e8ee;
    --fg-muted: #a3acbb;
    --line: #262d3a;
    --mist: #1b212c;
    --accent: #818cf8;
    --accent-ink: #0b0e14;
    --accent-soft: rgba(129, 140, 248, .12);
    --ok: #5eead4;
    --risk: #fda4af;
    --code-bg: #0a0d13;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 60px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-tint: #10141c;
  --surface: #151a23;
  --fg: #e6e8ee;
  --fg-muted: #a3acbb;
  --line: #262d3a;
  --mist: #1b212c;
  --accent: #818cf8;
  --accent-ink: #0b0e14;
  --accent-soft: rgba(129, 140, 248, .12);
  --ok: #5eead4;
  --risk: #fda4af;
  --code-bg: #0a0d13;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 60px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
pre { margin: 0; font-family: var(--mono); }
/* `hidden` must win over component display rules (pills, nav links, notices). */
[hidden] { display: none !important; }
.en { unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
[dir="ltr"] { text-align: left; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 820px; }

.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn--sm { min-height: 44px; padding: 8px 16px; font-size: .92rem; }
.btn--lg { min-height: 52px; padding: 14px 28px; font-size: 1.06rem; }
.btn--block { display: flex; width: 100%; }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--light { background: #fff; color: #1e1b4b; }
.btn--light:hover { transform: translateY(-1px); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: .98rem; letter-spacing: -0.01em; }
.brand img { flex: none; border-radius: 7px; }
.brand__for { display: none; }
.topbar__nav { display: flex; align-items: center; gap: 4px; }
.topbar__link { display: none; color: var(--fg-muted); text-decoration: none; font-size: .95rem; padding: 8px 12px; border-radius: 8px; }
.topbar__link:hover { color: var(--fg); background: var(--mist); }
.brand__name { white-space: nowrap; }
.topbar__link--login { display: inline-block; font-weight: 600; color: var(--fg); min-height: 44px; display: inline-flex; align-items: center; }
.topbar__cta { display: none; }
@media (min-width: 560px) { .brand__for { display: inline; } .topbar__cta { display: inline-flex; } .topbar__link--login { font-weight: 400; color: var(--fg-muted); } }
@media (min-width: 900px) { .topbar__link { display: inline-block; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(28px, 5vw, 64px) clamp(40px, 5vw, 64px);
  background:
    radial-gradient(60% 60% at 85% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 70%),
    radial-gradient(50% 50% at 0% 30%, color-mix(in srgb, var(--secondary) 10%, transparent), transparent 70%),
    var(--bg);
}
.hero::before { /* faint grid, like graph paper in a notebook */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 60% at 50% 20%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 20%, #000 10%, transparent 75%);
  opacity: .55;
}
.hero__grid { position: relative; display: grid; gap: 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hero__title { font-size: clamp(1.95rem, 5.4vw, 3.05rem); font-weight: 700; line-height: 1.3; letter-spacing: 0; text-wrap: balance; }
.hero__title .en { white-space: nowrap; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); }
.hero__lead { margin-top: 18px; font-size: clamp(1.08rem, 2.4vw, 1.3rem); color: var(--fg-muted); max-width: 36em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__actions .btn { flex: 1 1 220px; }
.hero__sub { margin-top: 12px; color: var(--fg-muted); max-width: 36em; }
.hero__note { margin-top: 12px; font-size: .9rem; color: var(--fg-muted); }

.hero__visual { position: relative; margin-inline: auto; width: 100%; max-width: 640px; padding-bottom: 8%; direction: ltr; }
.device { overflow: hidden; background: var(--surface); box-shadow: var(--shadow-lg); }
.device--desktop { border-radius: 12px; border: 1px solid var(--line); width: 92%; }
.device__bar { display: flex; gap: 6px; padding: 9px 12px; background: var(--mist); border-bottom: 1px solid var(--line); }
.device__bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--neutral); opacity: .5; }
.device--phone {
  position: absolute; right: 0; bottom: 0; width: 34%;
  border-radius: 26px; border: 6px solid #0f172a; background: #0f172a;
}
.device--phone img { border-radius: 19px; }
.device--phone-solo { position: relative; width: min(300px, 78%); margin-inline: auto; }

@media (min-width: 980px) {
  .hero__grid { grid-template-columns: 1.02fr 1fr; align-items: center; gap: 56px; }
  .hero__actions .btn { flex: 0 0 auto; }
  .hero__visual { max-width: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(48px, 7vw, 88px); }
.section--tint { background: var(--bg-tint); border-block: 1px solid var(--line); }
.section__head { max-width: 720px; margin-bottom: clamp(28px, 5vw, 48px); }
.kicker { font-family: var(--mono); font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; display: inline-block; }
.section h2 { font-size: clamp(1.6rem, 4.4vw, 2.4rem); font-weight: 700; text-wrap: balance; }
.section__lead { margin-top: 14px; font-size: clamp(1.02rem, 2vw, 1.15rem); color: var(--fg-muted); }
.section__head[dir="ltr"], .section__head [dir="ltr"] { text-align: left; }

/* Why */
.why-card {
  margin: 0; padding: clamp(20px, 4vw, 32px);
  border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  background: color-mix(in srgb, #fef3c7 45%, var(--surface));
  font-size: 1.02rem;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .why-card { background: color-mix(in srgb, #fbbf24 7%, var(--surface)); border-color: color-mix(in srgb, #fbbf24 30%, transparent); } }
:root[data-theme="dark"] .why-card { background: color-mix(in srgb, #fbbf24 7%, var(--surface)); border-color: color-mix(in srgb, #fbbf24 30%, transparent); }
.why-card__label { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--warn); margin-bottom: 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .why-card__label { color: #fbbf24; } }
:root[data-theme="dark"] .why-card__label { color: #fbbf24; }
.why-card__label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.why-card ul { margin: 12px 0; padding-left: 1.2em; }
.why-card li { margin: 6px 0; }
.why-card__punch { font-weight: 600; }

/* Before → After */
.ba { display: grid; gap: 16px; }
.ba__col { padding: clamp(20px, 3.5vw, 28px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ba__col--after { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.ba__label { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 14px; }
.ba__arrow { display: grid; place-items: center; color: var(--accent); transform: rotate(90deg); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--risk { background: var(--risk); }
.dot--ok { background: var(--ok); }
@media (min-width: 860px) {
  .ba { grid-template-columns: 1fr auto 1fr; align-items: stretch; }
  .ba__arrow { transform: none; }
  [dir="rtl"] .ba__arrow svg { transform: scaleX(-1); }
}

/* Fit */
.fit { display: grid; gap: 16px; }
@media (min-width: 860px) { .fit { grid-template-columns: 1fr 1fr; } }
.fit__card { padding: clamp(20px, 3.5vw, 28px); border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.fit__card h3 { font-size: 1.15rem; margin-bottom: 14px; }
.fit__card--yes { border-top: 3px solid var(--ok); }
.fit__card--no { border-top: 3px solid var(--risk); }
.checks, .crosses { list-style: none; display: grid; gap: 10px; }
.checks li, .crosses li { position: relative; padding-inline-start: 30px; }
.checks li::before, .crosses li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .3em; width: 20px; height: 20px; border-radius: 50%;
  background-repeat: no-repeat; background-position: center; background-size: 12px;
}
.checks li::before { background-color: color-mix(in srgb, var(--ok) 16%, transparent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 6.2 2.3 2.3 4.7-5' fill='none' stroke='%230f766e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.crosses li::before { background-color: color-mix(in srgb, var(--risk) 14%, transparent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3.5 3.5 5 5m0-5-5 5' fill='none' stroke='%23be123c' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }
.crosses li { color: var(--fg-muted); }

/* Modules */
.modules { list-style: none; display: grid; gap: 12px; grid-template-columns: 1fr; counter-reset: none; }
@media (min-width: 640px) { .modules { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .modules { grid-template-columns: repeat(3, 1fr); } }
.module {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.module:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.module__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.module__num {
  font-family: var(--mono); font-weight: 600; font-size: .85rem; color: var(--accent);
  background: var(--accent-soft); border-radius: 8px; padding: 2px 9px;
}
.module__badge { font-size: .75rem; font-weight: 700; letter-spacing: .02em; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); padding: 3px 10px; border-radius: 999px; }
.module__badge--lock { color: var(--fg-muted); background: var(--mist); display: inline-flex; align-items: center; gap: 5px; }
.module__title { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }
.module__outcome { color: var(--fg-muted); font-size: .95rem; line-height: 1.55; }
.module__meta { margin-top: auto; padding-top: 6px; font-size: .8rem; color: var(--fg-muted); font-family: var(--mono); }
.module--free { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); box-shadow: inset 0 3px 0 var(--ok); }

/* Evolving project */
.evolve { display: grid; gap: 16px; }
.evolve__state { display: grid; gap: 12px; align-content: start; }
.evolve__tag { font-family: var(--mono); font-size: .8rem; font-weight: 600; color: var(--fg-muted); }
.evolve__state--after .evolve__tag { color: var(--ok); }
.tree, .term { border-radius: var(--radius-sm); overflow: auto; }
.tree { background: var(--surface); border: 1px solid var(--line); padding: 16px 18px; }
.tree pre { font-size: .86rem; line-height: 1.7; color: var(--fg); }
.tree b { color: var(--accent); font-weight: 600; }
.tree i { color: var(--fg-muted); font-style: normal; }
.tree .t-nb { color: var(--warn); }
@media (max-width: 479px) { .tree__note { display: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tree .t-nb { color: #fbbf24; } }
:root[data-theme="dark"] .tree .t-nb { color: #fbbf24; }
.term { background: var(--code-bg); color: var(--code-fg); border: 1px solid #1e293b; }
.term__label { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; padding: 8px 16px; border-bottom: 1px solid #1e293b; }
.term pre { padding: 14px 16px; font-size: .84rem; line-height: 1.7; white-space: pre; }
.t-prompt { color: #818cf8; }
.t-ok { color: #5eead4; }

/* What you get */
.included { display: grid; gap: 28px; }
.included__shot { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.features { list-style: none; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) {
  .included { grid-template-columns: 1.15fr 1fr; align-items: center; }
  .features { grid-template-columns: 1fr; }
}
.feature { display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; row-gap: 2px; padding: 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.feature__icon {
  grid-row: span 2; width: 40px; height: 40px; padding: 9px; border-radius: 10px;
  background: var(--accent-soft); stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.feature h3 { font-size: 1rem; }
.feature p { font-size: .93rem; color: var(--fg-muted); line-height: 1.55; }

/* Free Module 1 */
.free { display: grid; gap: 40px; align-items: center; }
.free__copy .checks { margin: 22px 0 28px; }
.free__copy .btn { width: 100%; }
@media (min-width: 560px) { .free__copy .btn { width: auto; } }
@media (min-width: 900px) { .free { grid-template-columns: 1.2fr 1fr; } }

/* Instructor */
.instructor { display: grid; gap: 16px; }
@media (min-width: 900px) { .instructor { grid-template-columns: 1.5fr 1fr; } }
.instructor__card { display: flex; gap: 16px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.avatar {
  flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 1.2rem; color: #fff; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.instructor__name { font-size: 1.2rem; }
.instructor__bio { margin-top: 6px; color: var(--fg-muted); font-size: .95rem; }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.links a { display: inline-block; font-size: .85rem; font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg); }
.links a:hover { border-color: var(--accent); color: var(--accent); }
.prev-work {
  display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--fg);
  transition: border-color .15s ease, transform .15s ease;
}
.prev-work:hover { border-color: var(--accent); transform: translateY(-2px); }
.prev-work__kicker { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 600; }
.prev-work__title { font-weight: 700; font-size: 1.05rem; }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 52px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 1.3rem; color: var(--accent); flex: none; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 20px 18px; color: var(--fg-muted); }
.faq details p:not(:last-child) { padding-bottom: 8px; }
.up__faq { margin-top: clamp(28px, 5vw, 44px); max-width: 760px; }
.up__faq h2 { font-size: 1.3rem; margin-bottom: 14px; }
.up__term { font-weight: 700; color: var(--fg); margin-top: 14px; }

/* Final CTA */
.final {
  padding-block: clamp(64px, 10vw, 120px);
  background: radial-gradient(80% 120% at 100% 0%, #6366f1 0%, transparent 60%), radial-gradient(70% 120% at 0% 100%, #0f766e 0%, transparent 60%), #1e1b4b;
  color: #fff; text-align: center;
}
.final__inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.final h2 { font-size: clamp(1.7rem, 5vw, 2.6rem); max-width: 22ch; text-wrap: balance; }
.final__lead { color: rgba(255, 255, 255, .78); font-size: 1.1rem; max-width: 40em; margin-bottom: 12px; }

/* Footer */
.footer { padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); color: var(--fg-muted); font-size: .88rem; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer a { color: var(--fg-muted); }

/* Mobile CTA dock: appears after the hero, hides at the final CTA */
.dock {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform .25s ease;
}
.dock.is-visible { transform: none; }
@media (min-width: 900px) { .dock { display: none; } }
body.has-dock .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) { body.has-dock .footer { padding-bottom: 28px; } }

/* Why: questions + lesson excerpt */
.why { display: grid; gap: 20px; align-items: start; }
@media (min-width: 980px) { .why { grid-template-columns: 1fr 1fr; gap: 28px; } }
.questions { list-style: none; display: grid; gap: 10px; }
.questions li {
  position: relative; padding: 14px 18px; padding-inline-start: 48px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); font-weight: 500;
}
.questions li::before {
  content: "?"; position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font: 700 .85rem/1 var(--font); color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .questions li::before { color: #fbbf24; background: rgba(251, 191, 36, .14); } }
:root[data-theme="dark"] .questions li::before { color: #fbbf24; background: rgba(251, 191, 36, .14); }
.core-line {
  margin-top: clamp(28px, 5vw, 44px); padding: clamp(18px, 3vw, 26px) clamp(20px, 3vw, 28px);
  border-radius: var(--radius); border-inline-start: 4px solid var(--accent);
  background: var(--accent-soft); font-size: clamp(1.1rem, 2.6vw, 1.35rem); font-weight: 700; line-height: 1.6;
}
.core-line .en { color: var(--accent); }

/* Before: a notebook mock */
.nb { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.nb__file { font: 600 .8rem/1 var(--mono); color: var(--fg-muted); padding: 10px 14px; background: var(--mist); border-bottom: 1px solid var(--line); }
.nb__cells { list-style: none; padding: 12px; display: grid; gap: 8px; }
.nb__cells li { display: flex; gap: 10px; align-items: center; font: 400 .88rem/1.4 var(--mono); padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.nb__in { color: var(--neutral); font-size: .78rem; }
.nb__risks { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 14px; }
.nb__risks li { font-size: .8rem; font-weight: 600; color: var(--risk); background: color-mix(in srgb, var(--risk) 10%, transparent); border: 1px dashed color-mix(in srgb, var(--risk) 45%, transparent); padding: 3px 10px; border-radius: 999px; }

/* After: the chain of properties */
.chain { list-style: none; display: grid; gap: 6px; }
.chain li {
  position: relative; padding: 8px 12px 8px 36px; border-radius: 8px; font-weight: 600; font-size: .95rem;
  background: color-mix(in srgb, var(--ok) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 25%, var(--line));
}
.chain li::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%);
  background: no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2 6.3 2.6 2.6L10 3.3' fill='none' stroke='%230f766e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.chain li:not(:last-child)::after { content: ""; position: absolute; left: 18px; bottom: -7px; width: 2px; height: 7px; background: color-mix(in srgb, var(--ok) 40%, transparent); }
.chain__end { background: var(--ok) !important; color: #fff; border-color: transparent !important; }
.chain__end::before { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chain__end { color: #04231f; } :root:not([data-theme="light"]) .chain__end::before { filter: none; } }
:root[data-theme="dark"] .chain__end { color: #04231f; } :root[data-theme="dark"] .chain__end::before { filter: none; }
.ba__key { margin-top: 20px; text-align: center; font-weight: 600; color: var(--fg); }

/* Fit extras */
.fit__card .kicker { margin-bottom: 4px; }
.fit__card--no .kicker { color: var(--risk); }
.fit__card--yes .kicker { color: var(--ok); }
.fit__not { margin-top: 18px; font-weight: 600; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags li { font-size: .82rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--mist); color: var(--fg-muted); border: 1px solid var(--line); }
.fit__position { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--fg-muted); }

/* Evolving project: progression strip + arrow */
.progress { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 4px; margin-bottom: 28px; counter-reset: step; }
.progress li {
  counter-increment: step; display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 600; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--accent-soft); color: var(--fg); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.progress li::before {
  content: counter(step); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font: 700 .72rem/1 var(--mono); background: var(--accent); color: var(--accent-ink);
}
.progress li:last-child { background: var(--ok); color: #fff; border-color: transparent; }
.progress li:last-child::before { background: #fff; color: var(--secondary); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .progress li:last-child { color: #04231f; } :root:not([data-theme="light"]) .progress li:last-child::before { background: #04231f; color: var(--ok); } }
:root[data-theme="dark"] .progress li:last-child { color: #04231f; } :root[data-theme="dark"] .progress li:last-child::before { background: #04231f; color: var(--ok); }
.evolve__arrow { display: grid; place-items: center; color: var(--accent); transform: rotate(90deg); }
@media (min-width: 980px) {
  .evolve { grid-template-columns: 1fr 48px 1.25fr; align-items: center; }
  .evolve__arrow { transform: none; }
}

/* Free / final extras */
.free__locked { margin: -12px 0 24px; font-size: .92rem; color: var(--fg-muted); }
.final__note { color: rgba(255, 255, 255, .72); font-size: .92rem; }
.prev-work .links { margin-top: 8px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Copy-slot overlay (?slots) — authoring aid only ---------- */
html.show-slots [data-slot] { outline: 2px dashed #f59e0b; outline-offset: 3px; position: relative; }
html.show-slots [data-review] { outline: 2px dashed #0ea5e9; outline-offset: 3px; }
html.show-slots [data-slot]::after {
  content: attr(data-slot); position: absolute; inset-inline-end: 0; top: -1.6em;
  font: 600 11px/1.6 var(--mono); color: #78350f; background: #fde68a; padding: 0 6px; border-radius: 4px; direction: ltr; z-index: 5;
}

/* 404 */
.notfound { min-height: 80vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; text-align: center; }
.notfound h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); }
.notfound__action { margin-top: 20px; }
.notfound > div { min-width: 0; max-width: 40rem; }

/* ---------- Auth pages (signup, login, verify, forgot, reset) ---------- */
body.auth {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background:
    radial-gradient(60% 50% at 90% 0%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, color-mix(in srgb, var(--secondary) 9%, transparent), transparent 70%),
    var(--bg);
}
.auth__top {
  display: flex; align-items: center; gap: 12px; min-height: 64px;
  padding: env(safe-area-inset-top, 0px) var(--gutter) 0;
  max-width: var(--wrap); width: 100%; margin-inline: auto;
}
.auth__top--split { justify-content: space-between; }
.auth__main { flex: 1; display: grid; place-items: start center; padding: clamp(12px, 4vh, 48px) var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px)); }
.auth__card {
  width: 100%; max-width: 440px; padding: clamp(22px, 5vw, 36px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
}
.auth__card--wide { max-width: 640px; }
.auth__card h1 { font-size: clamp(1.45rem, 4.6vw, 1.8rem); font-weight: 700; margin-bottom: 8px; }
.auth__lead { color: var(--fg-muted); margin-bottom: 20px; }
.auth__alt { margin-top: 20px; text-align: center; color: var(--fg-muted); font-size: .95rem; }
.auth__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); margin-bottom: 16px; }
.auth__tips { margin: 4px 0 20px; padding-inline-start: 1.2em; color: var(--fg-muted); font-size: .93rem; display: grid; gap: 4px; }
.auth__resend { padding-top: 18px; border-top: 1px dashed var(--line); }
.auth form { display: grid; gap: 16px; }

.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.field__opt { font-weight: 400; color: var(--fg-muted); font-size: .88em; }
.field input {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; font-size: 1rem; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder { color: var(--neutral); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field input[dir="ltr"] { text-align: left; }
.field__pw { position: relative; }
.field__pw input { padding-inline-end: 84px; }
[dir="rtl"] .field__pw input[dir="ltr"] { padding-inline-end: 14px; padding-right: 84px; }
.field__toggle {
  position: absolute; top: 50%; transform: translateY(-50%); right: 6px;
  min-height: 36px; min-width: 64px; padding: 0 10px; border: 0; border-radius: 8px;
  background: var(--mist); color: var(--fg); font: inherit; font-size: .85rem; cursor: pointer;
}
.field__hint { font-size: .85rem; color: var(--fg-muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; color: var(--fg); cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; margin-top: .25em; accent-color: var(--accent); flex: none; }
.btn[disabled] { opacity: .65; cursor: progress; transform: none; }

.notice { padding: 12px 14px; border-radius: 12px; font-size: .95rem; margin-bottom: 16px; line-height: 1.6; }
.notice--error { background: color-mix(in srgb, var(--risk) 10%, transparent); color: var(--risk); border: 1px solid color-mix(in srgb, var(--risk) 30%, transparent); }
.notice--ok { background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
form .notice { margin-bottom: 0; }

.me { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin-top: 8px; padding: 14px 16px; border-radius: 12px; background: var(--mist); font-size: .95rem; }
.me dt { color: var(--fg-muted); }
.me dd { margin: 0; font-weight: 600; word-break: break-all; }

/* ---------- Course Home ---------- */
body.home { background: var(--bg-tint); }
.home__main { padding-block: clamp(20px, 4vw, 40px) calc(48px + env(safe-area-inset-bottom, 0px)); }
.home__hero { margin-bottom: clamp(20px, 4vw, 32px); }
.home__hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); font-weight: 700; }
.home__access { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.home__upgrade { font-size: .92rem; font-weight: 600; text-decoration: none; }
.home__upgrade:hover { text-decoration: underline; }
.pill { display: inline-flex; align-items: center; font-size: .82rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.pill--free { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pill--full { color: var(--accent); background: var(--accent-soft); }

.cmods { list-style: none; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cmods { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cmods { grid-template-columns: repeat(3, 1fr); } }
.cmod > a {
  height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 20px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  color: var(--fg); text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.cmod > a:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.cmod__top { display: flex; justify-content: space-between; align-items: center; }
.cmod__title { font-size: 1.08rem; font-weight: 700; }
.cmod__outcome { color: var(--fg-muted); font-size: .95rem; line-height: 1.55; }
.cmod .module__meta { margin-top: auto; }
.cmod__state { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.cmod--free > a { box-shadow: inset 0 3px 0 var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.cmod--locked .cmod__state {
  color: var(--fg-muted); background: var(--mist); display: inline-flex; align-items: center; gap: 5px;
}
.cmod--locked .cmod__state::before {
  content: ""; width: 10px; height: 10px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 11V8a5 5 0 0 1 10 0v3M5 11h14v10H5z' fill='none' stroke='black' stroke-width='2.6' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 11V8a5 5 0 0 1 10 0v3M5 11h14v10H5z' fill='none' stroke='black' stroke-width='2.6' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cmod--locked .cmod__title { color: var(--fg-muted); }

/* Locked-module dialog */
.lock {
  width: min(440px, calc(100vw - 32px)); padding: 28px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg);
}
.lock::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.lock h2 { font-size: 1.35rem; margin: 4px 0 8px; }
.lock__outcome { color: var(--fg-muted); }
.lock__unlock { margin: 16px 0 20px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-weight: 600; }
.lock__actions { display: grid; gap: 8px; }
.lock__close { position: absolute; top: 10px; right: 10px; }
.lock__x { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--fg-muted); font-size: 1.5rem; cursor: pointer; }
.lock__x:hover { background: var(--mist); }

/* ---------- Staff page ---------- */
.admin__main { max-width: 860px; padding-block: 28px 64px; }
.admin__title { font-size: 1.5rem; margin-bottom: 14px; }
.admin__search { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.admin__search input { flex: 1 1 260px; }
.admin input, .admin select {
  min-height: 46px; padding: 8px 12px; font: inherit; color: var(--fg); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; width: 100%;
}
.admin input:focus, .admin select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.admin__user { display: grid; gap: 16px; }
.admin__state { font-size: 1.15rem; font-weight: 800; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line); }
.admin__state--full { color: var(--accent); background: var(--accent-soft); }
.admin__state--free { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.admin__state--warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.admin__panel { display: grid; gap: 14px; padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.admin__panel h2 { font-size: 1.1rem; }
.admin__panel--danger { border-color: color-mix(in srgb, var(--risk) 35%, var(--line)); }
.admin__grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .admin__grid { grid-template-columns: 1fr 1fr; } }
.admin__confirm { padding: 14px; border-radius: 12px; background: var(--mist); display: grid; gap: 10px; font-weight: 600; }
.admin__confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin__history { list-style: none; display: grid; gap: 10px; }
.admin__history li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--mist); font-size: .9rem; }
.btn--danger { background: var(--risk); color: #fff; }

/* Course Home: continue / install cards */
.home__cards { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 20px; }
@media (min-width: 760px) { .home__cards { grid-template-columns: 2fr 1fr; } }
.home__continue {
  position: relative; display: grid; gap: 2px; padding: 18px 56px 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--fg); text-decoration: none; box-shadow: var(--shadow);
}
.home__continue:hover { border-color: var(--accent); }
.home__continue .kicker { margin: 0; }
.home__continue-title { font-weight: 700; font-size: 1.05rem; }
.home__continue-go { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--accent); }
.home__install { display: grid; gap: 6px; align-content: start; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--line); font-size: .93rem; color: var(--fg-muted); }
.home__install .kicker { margin: 0; }
.home__install .btn { justify-self: start; }
.home__until { color: var(--fg-muted); font-size: .88rem; }
.home__until:empty { display: none; }
.discord { margin-bottom: 24px; padding: clamp(16px, 3vw, 24px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 14px; }
.discord h2 { font-size: 1.15rem; }
.discord__lead, .discord__steps p, .discord__note { color: var(--fg-muted); font-size: .93rem; }
.discord__steps { list-style: none; counter-reset: dstep; display: grid; gap: 14px; }
@media (min-width: 760px) { .discord__steps { grid-template-columns: repeat(3, 1fr); } }
.discord__steps > li { counter-increment: dstep; display: grid; gap: 6px; align-content: start; }
.discord__steps h3 { font-size: .98rem; }
.discord__steps h3::before { content: counter(dstep) ". "; color: var(--accent); }
.discord__form { display: flex; gap: 8px; flex-wrap: wrap; }
.discord__form input { flex: 1 1 160px; min-width: 0; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; }
.discord__form .btn, .discord__join { min-height: 44px; justify-self: start; }
.discord__msg:empty { display: none; }
.discord__msg.is-error { color: var(--danger); }
.discord__note { border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- Upgrade Page ---------- */
.up__main { padding-block: clamp(20px, 4vw, 40px) calc(48px + env(safe-area-inset-bottom, 0px)); }
.up__loading { color: var(--fg-muted); }
.up__hero { margin-bottom: 20px; }
.up__hero h1, .up__done h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 800; }
.up__lead { color: var(--fg-muted); margin-top: 8px; font-size: 1.05rem; }
.up__done { max-width: 620px; display: grid; gap: 14px; justify-items: start; padding: clamp(20px, 4vw, 32px); border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.up__grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 920px) { .up__grid { grid-template-columns: 1fr 1.05fr; } .up__pay { position: sticky; top: 84px; } }
.up__card { padding: clamp(18px, 3.5vw, 28px); border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.up__card h2 { font-size: 1.2rem; margin-bottom: 14px; }
.up__included .checks { gap: 14px; }
.up__price { padding: 18px 20px; border-radius: 14px; background: var(--accent-soft); margin-bottom: 18px; }
.up__price-label { font-weight: 700; color: var(--accent); font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.up__amount { font-size: clamp(1.45rem, 5vw, 1.9rem); font-weight: 800; line-height: 1.3; margin: 2px 0 4px; }
.up__currency { font-size: 1.1rem; font-weight: 700; color: var(--fg-muted); }
.up__price-note { color: var(--fg-muted); font-size: .95rem; }
.up__closed { padding: 14px 16px; border-radius: 12px; background: var(--mist); }
.up__closed h2 { font-size: 1.05rem; margin-bottom: 6px; }
.up__closed p { color: var(--fg-muted); }
.up__email { margin-top: 4px; font-family: var(--mono); font-weight: 700; color: var(--fg) !important; text-align: start; }
.up__steps { list-style: none; counter-reset: step; display: grid; gap: 18px; }
.up__steps > li { counter-increment: step; position: relative; padding-inline-start: 40px; }
.up__steps > li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 700 .85rem/1 var(--mono); background: var(--accent); color: var(--accent-ink);
}
.up__steps h3 { font-size: 1.02rem; margin-bottom: 6px; }
.up__steps p { color: var(--fg-muted); font-size: .95rem; }
.up__methods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.up__method { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 600; }
.up__method:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.up__method input { accent-color: var(--accent); width: 18px; height: 18px; }
.up__details { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--mist); }
.up__details p { color: var(--fg); }
.up__value { font-family: var(--mono); font-size: 1.02rem; word-break: break-all; }
.up__hint { font-size: .86rem !important; color: var(--fg-muted) !important; margin-top: 6px; }
.up__wa { margin-top: 10px; background: #25d366; color: #052e16; box-shadow: none; }
.up__wa.is-disabled { background: var(--mist); color: var(--fg-muted); cursor: not-allowed; pointer-events: auto; }
.up__steps p, .up__details p, .up__lead { overflow-wrap: anywhere; }
.up__card { min-width: 0; }
@media (max-width: 560px) { body.upgrade .topbar__link--login { display: none; } }

/* Staff reports (Milestone 9) */
.report.admin__main { max-width: 1180px; display: grid; gap: 16px; }
.report__range { align-items: end; }
.report__range label { display: grid; gap: 4px; font-size: .85rem; color: var(--fg-muted); }
.report__note { color: var(--fg-muted); font-size: .88rem; }
.report__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.report__table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.report__table th, .report__table td { text-align: start; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.report__table th { font-weight: 700; color: var(--fg-muted); font-size: .8rem; }
.report__table--dense th, .report__table--dense td { padding: 5px 8px; }
.report__add { align-self: end; }
[data-report] { display: grid; gap: 16px; }
[data-report][hidden] { display: none; }

/* Theme toggle (website pages) */
.theme-toggle {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg-muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--fg); background: var(--mist); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.auth__top .theme-toggle { margin-inline-start: auto; }

.up__paylink { margin-top: 6px; min-height: 44px; }
