/* ==========================================================================
   Mediikx Edu — design system v3
   Poppins everywhere. Every colour comes from a CSS custom property set by
   includes/settings.php (theme_css_vars), so Admin -> Settings -> Theme
   re-skins the whole site. Neutrals/gradients below are derived from those.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
:root {
  --font-heading: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.18);
  --shadow-md: 0 10px 30px -14px rgba(0,0,0,.5);
  --shadow-lg: 0 30px 60px -24px rgba(0,0,0,.6);
  --ease: cubic-bezier(.22,.8,.3,1);
  --header-h: 68px;
}
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
  background: var(--c-bg); color: var(--c-text);
  font-family: 'Poppins', var(--font-body); font-size: 15.5px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; position: relative;
}
/* Everything is Poppins — including form controls, code and tables. */
button, input, select, textarea, optgroup, table, code, pre, kbd, samp, .mono { font-family: 'Poppins', var(--font-body); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* Ambient background glow */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -8%, color-mix(in srgb, var(--c-primary) 13%, transparent), transparent 70%),
    radial-gradient(800px 480px at 100% 0%, color-mix(in srgb, var(--c-secondary) 12%, transparent), transparent 70%),
    radial-gradient(700px 500px at 50% 110%, color-mix(in srgb, var(--c-primary) 6%, transparent), transparent 70%);
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
::selection { background: var(--c-primary); color: var(--c-primary-ink); }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 999; background: var(--c-primary); color: var(--c-primary-ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.18; letter-spacing: -.02em; margin: 0 0 .5em; color: var(--c-text); overflow-wrap: break-word; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 1.25rem + 1.2vw, 2.25rem); }
h3 { font-size: 1.28rem; font-weight: 600; }
h4 { font-size: 1.04rem; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 1em; max-width: 70ch; }
.text-muted { color: var(--c-text-muted); }
.text-sm { font-size: .875rem; } .text-xs { font-size: .76rem; }
.text-gradient { background: linear-gradient(95deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 40%, var(--c-secondary)) 55%, var(--c-secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--c-primary); }
.lead { font-size: 1.1rem; color: var(--c-text-muted); line-height: 1.7; }
.center { text-align: center; } .center p { margin-inline: auto; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 24px; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
section { padding: 72px 0; } .section-tight { padding: 36px 0 24px; }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; } .section-head p { margin-inline: auto; color: var(--c-text-muted); }
@media (max-width: 680px) { section { padding: 52px 0; } .container, .container-narrow { padding: 0 18px; } }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 600; font-size: .93rem; line-height: 1.1; white-space: nowrap; letter-spacing: .005em;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, color .2s, opacity .2s;
}
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 78%, #fff));
  color: var(--c-primary-ink);
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--c-primary) 75%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--c-primary) 85%, transparent), inset 0 1px 0 rgba(255,255,255,.4); }
.btn-secondary { background: var(--c-surface-raised); color: var(--c-text); border-color: var(--c-border-strong); }
.btn-secondary:hover { border-color: var(--c-primary); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--c-text); border-color: var(--c-border-strong); }
.btn-ghost:hover { background: color-mix(in srgb, var(--c-surface-raised) 80%, transparent); border-color: color-mix(in srgb, var(--c-primary) 50%, var(--c-border-strong)); }
.btn-danger { background: var(--c-accent); color: #fff; box-shadow: 0 8px 20px -10px var(--c-accent); }
.btn-sm { padding: 8px 14px; font-size: .82rem; border-radius: 10px; } .btn-lg { padding: 16px 30px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; } .btn-icon { padding: 10px; border-radius: 11px; }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: not-allowed; pointer-events: none; }
.btn.is-loading::after { content: ''; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-surface-raised) 45%, var(--c-surface)), var(--c-surface));
  border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 24px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.03);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.card-raised { background: var(--c-surface-raised); } .card-pad-lg { padding: 34px; }
.card-hoverable:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c-primary) 45%, var(--c-border)); box-shadow: var(--shadow-md); }
.surface-hero { position: relative; overflow: hidden; background: linear-gradient(150deg, color-mix(in srgb, var(--c-primary) 14%, var(--c-surface-raised)), var(--c-surface) 65%); border: 1px solid var(--c-border-strong); border-radius: var(--r-xl); box-shadow: var(--shadow-md); }
.divider { height: 1px; background: var(--c-border); border: none; margin: 26px 0; }
.glass { background: color-mix(in srgb, var(--c-surface) 65%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--c-border-strong); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--c-surface-raised); border: 1px solid var(--c-border); color: var(--c-text-muted); }
.badge-primary { background: color-mix(in srgb, var(--c-primary) 16%, transparent); color: var(--c-primary); border-color: color-mix(in srgb, var(--c-primary) 34%, transparent); }
.badge-secondary { background: color-mix(in srgb, var(--c-secondary) 16%, transparent); color: var(--c-secondary); border-color: color-mix(in srgb, var(--c-secondary) 34%, transparent); }
.badge-accent { background: color-mix(in srgb, var(--c-accent) 16%, transparent); color: var(--c-accent); border-color: color-mix(in srgb, var(--c-accent) 34%, transparent); }

/* ---------- Forms ---------- */
label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 7px; color: var(--c-text-muted); letter-spacing: .01em; }
.field { margin-bottom: 18px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=tel],
input[type=file], input[type=search], select, textarea {
  width: 100%; background: color-mix(in srgb, var(--c-bg) 70%, var(--c-surface)); border: 1.5px solid var(--c-border-strong); color: var(--c-text);
  border-radius: 12px; padding: 13px 15px; font-size: .94rem; transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--c-text-muted) 70%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--c-primary) 35%, var(--c-border-strong)); }
input:focus, select:focus, textarea:focus { border-color: var(--c-primary); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-primary) 18%, transparent); background: var(--c-bg); }
input[type=file] { padding: 10px; cursor: pointer; font-size: .85rem; }
input[type=file]::file-selector-button { margin-right: 12px; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--c-surface-raised); color: var(--c-text); font-family: inherit; font-weight: 600; cursor: pointer; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2387A0AC' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
input[type=checkbox], input[type=radio] { accent-color: var(--c-primary); width: 17px; height: 17px; vertical-align: -3px; }
.help-text { font-size: .79rem; color: var(--c-text-muted); margin-top: 6px; }
.color-input-row { display: flex; align-items: center; gap: 10px; }
input[type=color] { width: 46px; height: 42px; padding: 3px; border-radius: 10px; border: 1.5px solid var(--c-border-strong); background: var(--c-bg); cursor: pointer; }
.input-icon { position: relative; } .input-icon > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-text-muted); pointer-events: none; }
.input-icon > input { padding-left: 44px; }
.pw-wrap { position: relative; } .pw-wrap input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--c-text-muted); padding: 8px; border-radius: 8px; display: grid; place-items: center; }
.pw-toggle:hover { color: var(--c-text); background: var(--c-surface-raised); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--c-border-strong); background: var(--c-surface-raised); font-size: .88rem; margin-bottom: 18px; }
.alert-error { border-color: color-mix(in srgb, var(--c-accent) 55%, transparent); background: color-mix(in srgb, var(--c-accent) 11%, var(--c-surface)); }
.alert-success { border-color: color-mix(in srgb, var(--c-secondary) 55%, transparent); background: color-mix(in srgb, var(--c-secondary) 11%, var(--c-surface)); }

/* ---------- Announcement bar ---------- */
.announce { background: linear-gradient(90deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 45%, var(--c-secondary))); color: var(--c-primary-ink); font-size: .84rem; font-weight: 500; text-align: center; padding: 9px 16px; }
.announce a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin-left: 8px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--c-bg) 78%, transparent); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--c-border); transition: box-shadow .25s, background .25s; }
.site-header.is-scrolled { box-shadow: 0 10px 30px -18px rgba(0,0,0,.6); background: color-mix(in srgb, var(--c-bg) 90%, transparent); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-heading); font-size: 1.14rem; font-weight: 700; letter-spacing: -.02em; flex-shrink: 0; }
.brand img, .brand .brand-logo { height: 34px; width: auto; max-width: 150px; object-fit: contain; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0; background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 55%, var(--c-secondary))); color: var(--c-primary-ink); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; box-shadow: 0 8px 18px -8px var(--c-primary); }
html[data-theme="light"] .logo-for-dark, html:not([data-theme="light"]) .logo-for-light { display: none; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.main-nav { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--c-surface-raised) 65%, transparent); border: 1px solid var(--c-border); }
.main-nav a { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 500; color: var(--c-text-muted); padding: 8px 16px; border-radius: 999px; transition: color .2s, background .2s; }
.main-nav a svg { width: 16px; height: 16px; opacity: .85; }
.main-nav a:hover { color: var(--c-text); background: color-mix(in srgb, var(--c-text) 6%, transparent); }
.main-nav a.active { color: var(--c-primary-ink); background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 75%, #fff)); font-weight: 600; box-shadow: 0 6px 16px -8px var(--c-primary); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.credit-chip { display: inline-flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--c-surface-raised) 80%, transparent); border: 1px solid var(--c-border-strong); padding: 7px 14px 7px 10px; border-radius: 999px; font-size: .84rem; font-weight: 600; transition: border-color .2s, transform .2s; }
.credit-chip:hover { border-color: var(--c-primary); transform: translateY(-1px); }
.credit-chip .dot { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff8, transparent 50%), linear-gradient(135deg, var(--c-primary), var(--c-secondary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 20%, transparent); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--c-border-strong); background: color-mix(in srgb, var(--c-surface-raised) 80%, transparent); color: var(--c-text-muted); transition: all .2s; }
.theme-toggle:hover { color: var(--c-primary); border-color: var(--c-primary); transform: rotate(12deg); }
.theme-toggle svg { width: 18px; height: 18px; }
html[data-theme="light"] .theme-toggle .icon-moon, html:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--c-secondary), var(--c-primary)); color: var(--c-primary-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .88rem; border: 2px solid var(--c-bg); box-shadow: 0 0 0 1.5px var(--c-border-strong); }
.user-menu { position: relative; }
.user-menu > button { background: none; border: 0; padding: 0; border-radius: 50%; display: block; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 12px); width: 244px; padding: 8px; border-radius: 18px; background: var(--c-surface); border: 1px solid var(--c-border-strong); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right; transition: all .2s var(--ease); z-index: 80; }
.user-menu.open .user-menu-panel { opacity: 1; visibility: visible; transform: none; }
.user-menu-head { padding: 12px 12px 10px; border-bottom: 1px solid var(--c-border); margin-bottom: 6px; }
.user-menu-head strong { display: block; font-size: .92rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-head span { font-size: .76rem; color: var(--c-text-muted); }
.user-menu-panel a, .user-menu-panel button.mi { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border-radius: 11px; font-size: .87rem; font-weight: 500; color: var(--c-text); background: none; border: 0; text-align: left; }
.user-menu-panel a:hover, .user-menu-panel button.mi:hover { background: var(--c-surface-raised); }
.user-menu-panel svg { color: var(--c-text-muted); } .user-menu-panel .danger { color: var(--c-accent); } .user-menu-panel .danger svg { color: var(--c-accent); }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav { display: none; position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 70; background: color-mix(in srgb, var(--c-surface) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--c-border-strong); border-radius: 22px; padding: 7px 6px; box-shadow: var(--shadow-lg); }
.bottom-nav ul { list-style: none; display: flex; justify-content: space-around; margin: 0; padding: 0; }
.bottom-nav li { flex: 1; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .62rem; font-weight: 500; color: var(--c-text-muted); padding: 7px 2px; border-radius: 15px; white-space: nowrap; transition: all .2s; }
.bottom-nav svg { width: 21px; height: 21px; }
.bottom-nav a.active { color: var(--c-primary-ink); background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 75%, #fff)); font-weight: 600; }
@media (max-width: 860px) { .bottom-nav { display: block; } .main-nav { display: none; } body { padding-bottom: 92px; } .brand-name { max-width: 150px; } }
@media (max-width: 520px) { .hide-xs { display: none !important; } }
.hide-mobile { display: initial; } @media (max-width: 860px) { .hide-mobile { display: none !important; } }
.show-mobile { display: none; } @media (max-width: 860px) { .show-mobile { display: initial; } }

/* ---------- Page header / breadcrumbs ---------- */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .8rem; color: var(--c-text-muted); margin-bottom: 14px; }
.crumbs a:hover { color: var(--c-primary); } .crumbs svg { opacity: .5; }
.page-head { margin-bottom: 30px; }
.page-head h1 { margin-bottom: 8px; } .page-head p { color: var(--c-text-muted); margin: 0; }

/* ---------- Hero (marketing) ---------- */
.hero { position: relative; padding: 76px 0 56px; overflow: hidden; isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(color-mix(in srgb, var(--c-text) 12%, transparent) 1px, transparent 1.2px); background-size: 26px 26px; mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%); opacity: .55; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 1.3rem + 3.4vw, 4rem); line-height: 1.08; margin: 18px 0 20px; }
.hero .lead { max-width: 54ch; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 30px; font-size: .84rem; color: var(--c-text-muted); }
.hero-trust span { display: inline-flex; align-items: center; gap: 8px; } .hero-trust svg { color: var(--c-secondary); }
.hero-art { position: relative; }
.hero-art > svg, .hero-art > img { width: 100%; height: auto; border-radius: var(--r-xl); }
.hero-art > img { box-shadow: var(--shadow-lg); border: 1px solid var(--c-border-strong); aspect-ratio: 5/4; object-fit: cover; }
.float-chip { position: absolute; display: flex; align-items: center; gap: 11px; padding: 11px 15px; border-radius: 16px; background: color-mix(in srgb, var(--c-surface) 82%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--c-border-strong); box-shadow: var(--shadow-md); font-size: .8rem; line-height: 1.3; animation: floaty 6s ease-in-out infinite; }
.float-chip b { display: block; font-size: .9rem; }
.float-chip i { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-style: normal; background: color-mix(in srgb, var(--c-primary) 18%, transparent); color: var(--c-primary); }
.float-chip.c2 i { background: color-mix(in srgb, var(--c-secondary) 18%, transparent); color: var(--c-secondary); }
.float-chip.c1 { left: -18px; top: 14%; } .float-chip.c2 { right: -14px; bottom: 22%; animation-delay: -2.2s; } .float-chip.c3 { left: 8%; bottom: -16px; animation-delay: -4s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } .hero { padding-top: 44px; } .float-chip.c1 { left: 4px; } .float-chip.c2 { right: 4px; } }
@media (max-width: 520px) { .float-chip.c3 { display: none; } .hero-trust { gap: 12px 18px; } }

.hero-glow { position: relative; isolation: isolate; }
[data-reveal] { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(18px); }

/* ---------- Feature / step cards ---------- */
.feature { padding: 26px; } .feature h4 { margin: 16px 0 8px; font-size: 1.05rem; } .feature p { font-size: .88rem; color: var(--c-text-muted); margin: 0; }
.ico-box { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: color-mix(in srgb, var(--c-primary) 15%, transparent); color: var(--c-primary); border: 1px solid color-mix(in srgb, var(--c-primary) 28%, transparent); }
.ico-box.alt { background: color-mix(in srgb, var(--c-secondary) 15%, transparent); color: var(--c-secondary); border-color: color-mix(in srgb, var(--c-secondary) 28%, transparent); }
.ico-box.warn { background: color-mix(in srgb, var(--c-accent) 15%, transparent); color: var(--c-accent); border-color: color-mix(in srgb, var(--c-accent) 28%, transparent); }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; position: relative; }
.step { position: relative; padding: 28px 26px; counter-increment: step; }
.step::before { content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; margin-bottom: 16px; font-weight: 700; background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 60%, var(--c-secondary))); color: var(--c-primary-ink); box-shadow: 0 10px 20px -10px var(--c-primary); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 30px 12px; border-radius: var(--r-xl); }
.stat-band > div { text-align: center; padding: 6px 10px; border-right: 1px solid var(--c-border); } .stat-band > div:last-child { border: 0; }
.stat-band .num { font-family: var(--font-heading); font-size: 2.3rem; font-weight: 800; line-height: 1.1; }
@media (max-width: 760px) { .stat-band { grid-template-columns: repeat(2, 1fr); row-gap: 22px; } .stat-band > div:nth-child(2) { border: 0; } }
.cta-banner { position: relative; overflow: hidden; text-align: center; padding: 64px 28px; border-radius: 32px; background: linear-gradient(135deg, color-mix(in srgb, var(--c-primary) 28%, var(--c-surface-raised)), color-mix(in srgb, var(--c-secondary) 22%, var(--c-surface))); border: 1px solid var(--c-border-strong); }
.cta-banner::before { content: ''; position: absolute; width: 420px; height: 420px; right: -120px; top: -160px; border-radius: 50%; background: color-mix(in srgb, var(--c-primary) 22%, transparent); filter: blur(30px); }
.cta-banner > * { position: relative; } .cta-banner p { margin-inline: auto; color: var(--c-text-muted); }
.faq details { padding: 0; } .faq summary { padding: 19px 22px; font-weight: 600; list-style: none; }
.faq details p { padding: 0 22px 20px; margin: 0; color: var(--c-text-muted); font-size: .9rem; }
details > summary { cursor: pointer; } details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: '+'; float: right; font-size: 1.3rem; line-height: 1; color: var(--c-primary); transition: transform .2s; } details[open] > summary::after { content: '−'; }

/* AI mock chat on the marketing page */
.chat-mock { padding: 22px; display: grid; gap: 12px; }
.bubble { max-width: 86%; padding: 12px 16px; border-radius: 18px; font-size: .88rem; line-height: 1.55; }
.bubble.me { justify-self: end; background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 75%, #fff)); color: var(--c-primary-ink); border-bottom-right-radius: 6px; font-weight: 500; }
.bubble.ai { background: var(--c-surface-raised); border: 1px solid var(--c-border); border-bottom-left-radius: 6px; }
.chat-row { display: flex; gap: 10px; align-items: flex-end; } .chat-row .mx { width: 40px; height: 44px; flex-shrink: 0; }

/* ---------- Course cards ---------- */
.course-card { position: relative; display: flex; flex-direction: column; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.course-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--c-primary) 50%, var(--c-border)); box-shadow: var(--shadow-md); }
.cc-cover { position: relative; aspect-ratio: 2 / 1; overflow: hidden; } .cc-cover .cover-art { width: 100%; height: 100%; transition: transform .6s var(--ease); } .course-card:hover .cover-art { transform: scale(1.06); }
.cc-letter { position: absolute; left: 16px; bottom: 14px; padding: 5px 12px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: #fff; background: rgba(8,14,20,.45); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.22); }
.cc-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.cc-body h4 { margin: 0 0 4px; font-size: 1.08rem; } .cc-meta { font-size: .8rem; color: var(--c-text-muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.cc-desc { font-size: .84rem; color: var(--c-text-muted); margin: 10px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-progress { margin-top: auto; padding-top: 16px; }
.cc-progress .progress-track { height: 6px; } .cc-progress small { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: .74rem; color: var(--c-text-muted); font-weight: 500; }
.lock-pill { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .74rem; font-weight: 700; color: #fff; background: rgba(8,14,20,.55); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.25); z-index: 2; }
.course-letter { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-weight: 700; background: color-mix(in srgb, var(--c-primary) 16%, transparent); color: var(--c-primary); margin-bottom: 14px; }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 28px; }
.chip { padding: 8px 18px; border-radius: 999px; font-size: .84rem; font-weight: 600; border: 1px solid var(--c-border-strong); background: transparent; color: var(--c-text-muted); transition: all .2s; }
.chip:hover { color: var(--c-text); border-color: var(--c-primary); } .chip.active { background: var(--c-primary); color: var(--c-primary-ink); border-color: var(--c-primary); }

.course-hero { position: relative; border-radius: var(--r-xl); overflow: hidden; margin-bottom: 28px; min-height: 220px; display: flex; align-items: flex-end; border: 1px solid var(--c-border-strong); }
.course-hero .cover-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.course-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(6,12,18,.72)); }
.course-hero-inner { position: relative; z-index: 2; padding: 28px 30px; color: #fff; width: 100%; } .course-hero-inner h1 { color: #fff; margin: 8px 0 4px; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); } .course-hero-inner p { color: rgba(255,255,255,.82); margin: 0; }
.course-hero .badge { background: rgba(8,14,20,.45); color: #fff; border-color: rgba(255,255,255,.25); backdrop-filter: blur(8px); }

/* ---------- Topic / lesson rows ---------- */
.topic-row, .lesson-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); margin-bottom: 12px; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.topic-row:hover, .lesson-row:hover { border-color: color-mix(in srgb, var(--c-primary) 55%, var(--c-border)); transform: translateX(5px); box-shadow: var(--shadow-md); }
.topic-row > svg, .lesson-row > svg { color: var(--c-text-muted); transition: transform .25s, color .25s; } .topic-row:hover > svg, .lesson-row:hover > svg { color: var(--c-primary); transform: translateX(3px); }
.row-num { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: .88rem; color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 13%, transparent); }
.row-num.done { background: var(--c-secondary); color: var(--c-primary-ink); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.status-dot.published { background: var(--c-secondary); } .status-dot.draft { background: var(--c-text-muted); } .status-dot.review { background: var(--c-primary); }

/* ---------- Tabs ---------- */
.tab-bar { display: flex; gap: 6px; overflow-x: auto; padding: 5px; margin-bottom: 26px; border-radius: 16px; background: color-mix(in srgb, var(--c-surface-raised) 70%, transparent); border: 1px solid var(--c-border); scrollbar-width: none; position: sticky; top: calc(var(--header-h) + 8px); z-index: 20; backdrop-filter: blur(12px); }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-bar button, .tab-bar a { border: 0; background: none; color: var(--c-text-muted); padding: 10px 18px; font-size: .86rem; font-weight: 600; border-radius: 12px; white-space: nowrap; transition: all .2s; flex-shrink: 0; }
.tab-bar button:hover, .tab-bar a:hover { color: var(--c-text); background: color-mix(in srgb, var(--c-text) 6%, transparent); }
.tab-bar button.active, .tab-bar a.active { color: var(--c-primary-ink); background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 75%, #fff)); box-shadow: 0 6px 16px -8px var(--c-primary); }
.tab-panel { display: none; } .tab-panel.active { display: block; animation: fadein .35s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
[data-panel="learn"] p { font-size: 1.02rem; line-height: 1.85; max-width: 72ch; }

/* ---------- Key facts ---------- */
.key-fact { position: relative; padding: 18px 20px 18px 24px; margin: 22px 0; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--c-primary) 11%, var(--c-surface)), var(--c-surface)); border: 1px solid color-mix(in srgb, var(--c-primary) 26%, var(--c-border)); }
.key-fact::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--c-primary), var(--c-secondary)); }
.key-fact strong { display: block; margin-bottom: 5px; color: var(--c-primary); font-size: .92rem; }
.source-tag { display: inline-flex; align-items: center; gap: 7px; font-size: .77rem; font-weight: 500; color: var(--c-text-muted); border: 1px solid var(--c-border-strong); border-radius: 999px; padding: 5px 13px; background: var(--c-surface); }

/* ---------- Quiz ---------- */
[data-question] { counter-reset: opt; }
.quiz-option { counter-increment: opt; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; margin-bottom: 10px; border: 1.5px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text); font-size: .93rem; font-weight: 500; transition: all .2s var(--ease); }
.quiz-option::before { content: counter(opt, upper-alpha); flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--c-surface-raised); color: var(--c-text-muted); transition: all .2s; }
.quiz-option:hover { border-color: var(--c-primary); transform: translateX(4px); } .quiz-option:hover::before { background: var(--c-primary); color: var(--c-primary-ink); }
.quiz-option.correct { border-color: var(--c-secondary); background: color-mix(in srgb, var(--c-secondary) 14%, var(--c-surface)); animation: pop .35s var(--ease); } .quiz-option.correct::before { content: '✓'; background: var(--c-secondary); color: var(--c-primary-ink); }
.quiz-option.incorrect { border-color: var(--c-accent); background: color-mix(in srgb, var(--c-accent) 12%, var(--c-surface)); animation: shake .35s; } .quiz-option.incorrect::before { content: '✕'; background: var(--c-accent); color: #fff; }
@keyframes pop { 50% { transform: scale(1.015); } } @keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.quiz-explain { margin-top: 14px; padding: 15px 18px; background: color-mix(in srgb, var(--c-primary) 8%, var(--c-surface-raised)); border-radius: 14px; font-size: .88rem; border: 1px solid var(--c-border); animation: fadein .3s; }

/* ---------- Flashcards ---------- */
.flashcard { perspective: 1400px; height: 230px; cursor: pointer; }
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform .6s var(--ease); transform-style: preserve-3d; }
.flashcard:hover .flashcard-inner { transform: translateY(-4px); } .flashcard.flipped .flashcard-inner { transform: rotateY(180deg); } .flashcard.flipped:hover .flashcard-inner { transform: rotateY(180deg) translateY(-4px); }
.flashcard-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; align-items: center; justify-content: center; text-align: center; padding: 28px; border-radius: var(--r-lg); border: 1px solid var(--c-border-strong); background: linear-gradient(150deg, var(--c-surface-raised), var(--c-surface)); font-size: 1.05rem; font-weight: 500; box-shadow: var(--shadow-sm); }
.flashcard-face.front::after { content: 'Tap to flip'; position: absolute; bottom: 14px; font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--c-text-muted); opacity: .8; }
.flashcard-face.back { transform: rotateY(180deg); background: linear-gradient(150deg, color-mix(in srgb, var(--c-primary) 20%, var(--c-surface-raised)), var(--c-surface)); border-color: color-mix(in srgb, var(--c-primary) 40%, var(--c-border)); }

/* ---------- Wallet / paywall / checkout ---------- */
.paywall-modal-backdrop { position: fixed; inset: 0; background: rgba(3,6,12,.7); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.paywall-modal { max-width: 440px; width: 100%; }
.choice-tile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border: 1.5px solid var(--c-border-strong); border-radius: var(--r-md); margin-bottom: 12px; background: var(--c-surface-raised); transition: border-color .2s, transform .2s; }
.choice-tile:hover { border-color: var(--c-primary); transform: translateY(-2px); }
.balance-card { position: relative; overflow: hidden; padding: 32px; border-radius: var(--r-xl); color: var(--c-primary-ink); background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 40%, var(--c-secondary))); box-shadow: 0 24px 50px -24px var(--c-primary); }
.balance-card::before { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.18); } .balance-card::after { content: ''; position: absolute; right: 60px; bottom: -110px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.1); }
.balance-card > * { position: relative; z-index: 1; } .balance-card .amt { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
th { color: var(--c-text-muted); font-weight: 600; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; background: color-mix(in srgb, var(--c-surface-raised) 60%, var(--c-surface)); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; } tbody tr { transition: background .15s; } tbody tr:hover td { background: color-mix(in srgb, var(--c-primary) 5%, transparent); }

/* ---------- Toasts ---------- */
.flash-stack { position: fixed; top: 82px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; width: min(92vw, 380px); }
.flash-toast { position: relative; padding: 14px 18px 14px 20px; border-radius: 14px; border: 1px solid var(--c-border-strong); background: var(--c-surface-raised); font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-lg); animation: slidein .4s var(--ease); word-break: break-word; max-height: 260px; overflow-y: auto; }
.flash-toast::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c-text-muted); }
.flash-toast.success::before { background: var(--c-secondary); } .flash-toast.error::before { background: var(--c-accent); }
.flash-stack:has(.flash-toast.error) { width: min(92vw, 520px); }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 70px; padding: 64px 0 34px; border-top: 1px solid var(--c-border); background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--c-surface) 70%, transparent)); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-grid h5 { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c-text-muted); margin: 0 0 16px; font-weight: 600; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } .footer-grid li a { font-size: .88rem; color: var(--c-text); opacity: .86; display: inline-flex; align-items: center; gap: 9px; } .footer-grid li a:hover { color: var(--c-primary); opacity: 1; }
.footer-grid li svg { color: var(--c-primary); flex-shrink: 0; }
.footer-brand p { font-size: .88rem; color: var(--c-text-muted); margin: 16px 0 18px; max-width: 34ch; }
.socials { display: flex; gap: 8px; flex-wrap: wrap; } .socials a { padding: 7px 14px; border-radius: 999px; font-size: .76rem; font-weight: 600; border: 1px solid var(--c-border-strong); color: var(--c-text-muted); transition: all .2s; } .socials a:hover { color: var(--c-primary-ink); background: var(--c-primary); border-color: var(--c-primary); transform: translateY(-2px); }
.footer-bottom { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--c-border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .8rem; color: var(--c-text-muted); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Auth pages ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-aside { position: relative; overflow: hidden; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(155deg, color-mix(in srgb, var(--c-primary) 26%, var(--c-surface-raised)), var(--c-surface) 60%, color-mix(in srgb, var(--c-secondary) 20%, var(--c-bg))); border-right: 1px solid var(--c-border); }
.auth-aside::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--c-text) 14%, transparent) 1px, transparent 1.2px); background-size: 24px 24px; opacity: .5; mask-image: linear-gradient(180deg, #000, transparent 85%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); }
.auth-aside > * { position: relative; } .auth-aside h2 { font-size: clamp(1.7rem, 1.2rem + 1.5vw, 2.5rem); margin-top: 28px; max-width: 14ch; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; } .auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--c-text-muted); } .auth-points svg { color: var(--c-secondary); flex-shrink: 0; margin-top: 2px; }
.auth-mascot { display: flex; align-items: flex-end; gap: 16px; } .auth-mascot .mx { width: 112px; height: auto; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 40px 28px; }
.auth-card { width: 100%; max-width: 430px; margin: 0 auto; } .auth-card h1 { font-size: 2rem; margin-bottom: 6px; } .auth-card .sub { color: var(--c-text-muted); margin-bottom: 28px; }
.auth-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-aside { display: none; } .auth-main { padding: 28px 20px 60px; } }

/* ---------- Dashboard ---------- */
.dash-hero { position: relative; overflow: hidden; padding: 30px 32px; border-radius: var(--r-xl); margin-bottom: 26px; background: linear-gradient(120deg, color-mix(in srgb, var(--c-primary) 20%, var(--c-surface-raised)), var(--c-surface) 70%); border: 1px solid var(--c-border-strong); }
.dash-hero::after { content: ''; position: absolute; right: -80px; top: -100px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c-secondary) 30%, transparent), transparent 70%); }
.dash-hero > * { position: relative; z-index: 1; }
.tile { display: flex; align-items: center; gap: 16px; padding: 20px; } .tile .val { font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-family: var(--font-heading); } .tile .lbl { font-size: .78rem; color: var(--c-text-muted); }
.ring { --p: 0; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: conic-gradient(var(--c-primary) calc(var(--p) * 1%), var(--c-surface-3) 0); position: relative; }
.ring::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--c-surface); } .ring span { position: relative; z-index: 1; font-size: .72rem; font-weight: 700; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 34px; }
.qa { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--c-surface); border: 1px solid var(--c-border); transition: all .25s var(--ease); font-weight: 600; font-size: .9rem; }
.qa:hover { transform: translateY(-4px); border-color: var(--c-primary); box-shadow: var(--shadow-md); } .qa small { font-weight: 400; color: var(--c-text-muted); font-size: .76rem; margin-top: -8px; }
@media (max-width: 860px) { .quick-actions { grid-template-columns: repeat(2, 1fr); } }
.continue-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 24px 28px; margin-bottom: 30px; transition: transform .25s var(--ease), box-shadow .25s; } .continue-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 64px 20px; color: var(--c-text-muted); }
.empty-art { width: 120px; margin: 0 auto 18px; opacity: .9; }
.skeleton { background: linear-gradient(90deg, var(--c-surface) 25%, var(--c-surface-raised) 50%, var(--c-surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.progress-track { height: 7px; border-radius: 999px; background: var(--c-surface-3); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--c-primary), var(--c-secondary)); border-radius: 999px; transition: width .6s var(--ease); }
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100; background: linear-gradient(90deg, var(--c-primary), var(--c-secondary)); transition: width .1s linear; }
.to-top { position: fixed; right: 20px; bottom: 96px; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--c-surface-raised); border: 1px solid var(--c-border-strong); color: var(--c-text); box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s; z-index: 50; } .to-top.show { opacity: 1; visibility: visible; transform: none; }
[data-pulse]::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c-secondary); margin-right: 7px; animation: pulse-dot 1.4s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

/* ---------- Light mode ---------- */
html[data-theme="light"] { --c-bg: #F4F6F8; --c-surface: #FFFFFF; --c-surface-raised: #EEF2F5; --c-surface-3: #E1E8ED; --c-border: rgba(10,22,32,.08); --c-border-strong: rgba(10,22,32,.15); --c-text: #0F1A22; --c-text-muted: #5A6B76; --c-primary-ink: #161A1C; --shadow-sm: 0 1px 2px rgba(15,30,45,.08); --shadow-md: 0 14px 34px -16px rgba(15,30,45,.28); --shadow-lg: 0 30px 60px -26px rgba(15,30,45,.35); }
html[data-theme="light"] .site-header, html[data-theme="light"] .admin-topbar { background: color-mix(in srgb, var(--c-bg) 82%, transparent); }
html[data-theme="light"] .card { box-shadow: var(--shadow-sm); } html[data-theme="light"] ::selection { color: #fff; }

/* ---------- Tutor ---------- */
.tutor-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: flex-start; }
.tutor-sidebar { padding: 18px; position: sticky; top: calc(var(--header-h) + 16px); }
.tutor-thread-list { max-height: 300px; overflow-y: auto; }
.tutor-chat { min-height: 62vh; max-height: 78vh; display: flex; flex-direction: column; }
.tutor-messages { flex: 1; overflow-y: auto; margin-bottom: 16px; min-height: 0; padding-right: 4px; }
@media (max-width: 860px) { .tutor-layout { grid-template-columns: 1fr; gap: 16px; } .tutor-sidebar { order: 2; position: static; } .tutor-thread-list { max-height: 170px; } .tutor-chat { order: 1; min-height: 70vh; max-height: none; } }

/* ---------- Lightbox ---------- */
.lightbox-overlay { position: fixed; inset: 0; z-index: 999; background: rgba(6,8,14,.94); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; backdrop-filter: blur(6px); }
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-stage { position: relative; width: min(94vw, 1100px); height: min(88vh, 900px); display: flex; align-items: center; justify-content: center; overflow: auto; cursor: grab; touch-action: pinch-zoom; }
.lightbox-stage img { max-width: none; transition: transform .18s ease; transform-origin: center; border-radius: 10px; }
.lightbox-caption { position: absolute; left: 0; right: 0; bottom: -40px; text-align: center; color: #9fb2bd; font-size: .82rem; }
.lightbox-bar { position: absolute; top: -52px; right: 0; display: flex; gap: 8px; }
.lightbox-bar button, .lightbox-nav { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s; }
.lightbox-bar button:hover, .lightbox-nav:hover { background: rgba(255,255,255,.2); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; } .lightbox-nav.prev { left: -58px; } .lightbox-nav.next { right: -58px; }
@media (max-width: 900px) { .lightbox-nav.prev { left: 4px; } .lightbox-nav.next { right: 4px; } .lightbox-bar { top: 10px; right: 10px; } }
[data-lightbox-trigger] { cursor: zoom-in; }

/* ---------- Install sheet ---------- */
.install-sheet { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 160%); z-index: 900; width: min(92vw, 430px); background: var(--c-surface); border: 1px solid var(--c-border-strong); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow-lg); transition: transform .45s var(--ease); }
.install-sheet.show { transform: translate(-50%, 0); } .install-sheet .row-between { align-items: flex-start; }
.install-card { padding: 20px; border: 1px solid var(--c-border); border-radius: var(--r-lg); display: flex; align-items: center; gap: 14px; }
.install-card .install-icon { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, var(--c-primary), var(--c-secondary)); color: var(--c-primary-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ======================================================================
   Mediikx guide (the avatar that walks people through the app)
   ====================================================================== */
.mx { overflow: visible; }
.mx-body, .mx-head { transform-box: fill-box; }
.mx-head { transform-origin: 50% 90%; animation: mx-bob 4.2s ease-in-out infinite; }
.mx-body { animation: mx-breathe 4.2s ease-in-out infinite; transform-origin: 50% 100%; }
.mx-eye { transform-box: fill-box; transform-origin: 50% 50%; animation: mx-blink 5.2s infinite; }
.mx-pupil { transition: transform .12s linear; transform: translate(var(--px, 0px), var(--py, 0px)); }
.mx-wave { transform-box: fill-box; transform-origin: 90% 90%; }
.mx.is-waving .mx-wave, .gd-launcher.is-greeting .mx-wave { animation: mx-wave 1.1s ease-in-out infinite; }
.mx.is-talking .mx-mouth { animation: mx-talk .26s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 0; }
.mx-bulb { animation: mx-bulb 2.4s ease-in-out infinite; }
@keyframes mx-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2.5px) rotate(-1.2deg); } }
@keyframes mx-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.015); } }
@keyframes mx-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes mx-wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-22deg); } 75% { transform: rotate(14deg); } }
@keyframes mx-talk { from { transform: scaleY(.7); } to { transform: scaleY(1.9); } }
@keyframes mx-bulb { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.gd-root { --gd-edge: 22px; }
.gd-launcher { position: fixed; bottom: var(--gd-edge); z-index: 120; display: flex; align-items: flex-end; gap: 10px; border: 0; background: none; padding: 0; }
.gd-root.pos-right .gd-launcher { right: var(--gd-edge); flex-direction: row-reverse; } .gd-root.pos-left .gd-launcher { left: var(--gd-edge); }
.gd-fab { position: relative; width: 74px; height: 80px; border-radius: 26px; display: grid; place-items: center; background: linear-gradient(160deg, color-mix(in srgb, var(--c-primary) 24%, var(--c-surface-raised)), var(--c-surface)); border: 1px solid var(--c-border-strong); box-shadow: var(--shadow-lg), 0 0 0 0 color-mix(in srgb, var(--c-primary) 40%, transparent); transition: transform .3s var(--ease); animation: gd-ring 3.4s ease-out infinite; overflow: visible; }
.gd-fab:hover { transform: translateY(-4px) scale(1.04); } .gd-fab .mx { width: 58px; height: 64px; margin-top: 4px; } .gd-fab img.gd-photo { width: 100%; height: 100%; border-radius: 24px; object-fit: cover; }
@keyframes gd-ring { 0% { box-shadow: var(--shadow-lg), 0 0 0 0 color-mix(in srgb, var(--c-primary) 38%, transparent); } 70%, 100% { box-shadow: var(--shadow-lg), 0 0 0 16px transparent; } }
.gd-badge { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--c-accent); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--c-bg); animation: pop .5s var(--ease); }
.gd-hint { max-width: 230px; padding: 12px 15px; border-radius: 18px; background: var(--c-surface); border: 1px solid var(--c-border-strong); box-shadow: var(--shadow-md); font-size: .83rem; line-height: 1.45; text-align: left; color: var(--c-text); animation: gd-in .5s var(--ease) both; position: relative; margin-bottom: 14px; }
.gd-hint b { color: var(--c-primary); } .gd-hint button { background: none; border: 0; color: var(--c-text-muted); position: absolute; top: 4px; right: 6px; font-size: .9rem; padding: 4px; }
@keyframes gd-in { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }

.gd-menu { position: fixed; bottom: calc(var(--gd-edge) + 94px); z-index: 121; width: min(92vw, 330px); padding: 18px; border-radius: 24px; background: var(--c-surface); border: 1px solid var(--c-border-strong); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(14px) scale(.96); transition: all .28s var(--ease); }
.gd-root.pos-right .gd-menu { right: var(--gd-edge); transform-origin: bottom right; } .gd-root.pos-left .gd-menu { left: var(--gd-edge); transform-origin: bottom left; }
.gd-menu.open { opacity: 1; visibility: visible; transform: none; }
.gd-menu-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; } .gd-menu-head .mx { width: 50px; height: 54px; flex-shrink: 0; } .gd-menu-head img.gd-photo { width: 50px; height: 54px; border-radius: 16px; object-fit: cover; }
.gd-menu-head strong { display: block; font-size: .98rem; line-height: 1.2; } .gd-menu-head span { font-size: .76rem; color: var(--c-text-muted); }
.gd-menu-say { font-size: .86rem; color: var(--c-text-muted); margin: 0 0 14px; }
.gd-menu-list { display: grid; gap: 8px; }
.gd-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--c-border); background: var(--c-surface-raised); color: var(--c-text); font-size: .86rem; font-weight: 600; transition: all .2s; }
.gd-opt:hover { border-color: var(--c-primary); transform: translateX(3px); } .gd-opt svg { color: var(--c-primary); flex-shrink: 0; } .gd-opt.primary { background: linear-gradient(135deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 78%, #fff)); color: var(--c-primary-ink); border-color: transparent; } .gd-opt.primary svg { color: var(--c-primary-ink); }
.gd-tips { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 9px; } .gd-tips li { display: flex; gap: 9px; font-size: .84rem; color: var(--c-text); } .gd-tips svg { color: var(--c-secondary); flex-shrink: 0; margin-top: 2px; }
.gd-muted-link { display: block; margin-top: 12px; text-align: center; font-size: .75rem; color: var(--c-text-muted); background: none; border: 0; width: 100%; } .gd-muted-link:hover { color: var(--c-text); }

/* Tour */
.gd-overlay { position: fixed; inset: 0; z-index: 130; pointer-events: auto; background: transparent; }
.gd-spot { position: fixed; z-index: 131; border-radius: 18px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(4,9,14,.72), 0 0 0 3px var(--c-primary), 0 0 36px 4px color-mix(in srgb, var(--c-primary) 55%, transparent); transition: top .45s var(--ease), left .45s var(--ease), width .45s var(--ease), height .45s var(--ease), opacity .3s; }
.gd-spot.center { box-shadow: 0 0 0 9999px rgba(4,9,14,.72); border-radius: 0; width: 0 !important; height: 0 !important; }
.gd-card { position: fixed; z-index: 132; width: min(92vw, 380px); padding: 20px 20px 16px; border-radius: 24px; background: var(--c-surface); border: 1px solid var(--c-border-strong); box-shadow: var(--shadow-lg); transition: top .45s var(--ease), left .45s var(--ease), opacity .25s, transform .3s var(--ease); animation: gd-in .45s var(--ease) both; }
.gd-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; } .gd-card-head .mx { width: 50px; height: 56px; flex-shrink: 0; margin-top: -26px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); } .gd-card-head img.gd-photo { width: 50px; height: 56px; border-radius: 16px; object-fit: cover; margin-top: -26px; flex-shrink: 0; box-shadow: var(--shadow-md); }
.gd-card-head small { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c-text-muted); font-weight: 600; margin-left: auto; }
.gd-card h4 { font-size: 1.12rem; margin: 0 0 6px; } .gd-card p { margin: 0 0 16px; font-size: .9rem; color: var(--c-text-muted); line-height: 1.6; min-height: 3.2em; }
.gd-dots { display: flex; gap: 5px; margin-bottom: 14px; } .gd-dots i { height: 5px; flex: 1; max-width: 26px; border-radius: 999px; background: var(--c-surface-3); transition: background .3s; } .gd-dots i.on { background: var(--c-primary); }
.gd-actions { display: flex; align-items: center; gap: 8px; } .gd-actions .spacer { flex: 1; } .gd-skip { background: none; border: 0; color: var(--c-text-muted); font-size: .8rem; font-weight: 500; padding: 8px 4px; } .gd-skip:hover { color: var(--c-text); }
@media (max-width: 560px) { .gd-card { left: 12px !important; right: 12px; width: auto; top: auto !important; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); } .gd-root { --gd-edge: 14px; } .gd-hint { max-width: 190px; } }
@media (max-width: 860px) { .gd-launcher { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); } .gd-menu { bottom: calc(190px + env(safe-area-inset-bottom, 0px)); } .to-top { bottom: 176px; right: 16px; } .install-sheet { bottom: 100px; } }
@media (max-width: 860px) { .gd-fab { width: 64px; height: 70px; border-radius: 22px; } .gd-fab .mx { width: 50px; height: 56px; } }

/* ---------- Safety nets ---------- */
/* If JS fails after the head script marked <html class="js">, never leave content invisible. */
.js [data-reveal]:not(.is-in) { animation: reveal-failsafe 0s 2.2s forwards; }
@keyframes reveal-failsafe { to { opacity: 1; transform: none; } }
.to-top .rot { transform: rotate(180deg); }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }

/* Hero art extras */
.ecg { stroke-dasharray: 300; stroke-dashoffset: 300; animation: ecg 3s linear infinite; }
@keyframes ecg { 0% { stroke-dashoffset: 300; } 60%, 100% { stroke-dashoffset: -300; } }
.hero-card { animation: card-sway 6s ease-in-out infinite; transform-origin: 440px 360px; }
@keyframes card-sway { 0%, 100% { transform: rotate(7deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-6px); } }
.hero-mascot { position: absolute; left: -26px; bottom: -34px; display: flex; align-items: flex-end; gap: 6px; z-index: 3; }
.hero-mascot .mx { width: 104px; height: auto; filter: drop-shadow(0 14px 18px rgba(0,0,0,.35)); }
.hero-mascot .say { position: relative; margin-bottom: 64px; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--c-surface); border: 1px solid var(--c-border-strong); box-shadow: var(--shadow-md); font-size: .78rem; font-weight: 600; white-space: nowrap; }
@media (max-width: 980px) { .hero-mascot { left: 6px; bottom: -40px; } .hero-mascot .mx { width: 86px; } }
@media (max-width: 520px) { .hero-mascot .say { display: none; } }
