/* ============================================================
   GEMS XL ACADEMY — gems.vip theme v2 (drop-in stylesheet)
   Link AFTER the page's inline <style> so overrides win.
   Fonts (add to <head>):
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
   ============================================================ */

/* ---------- 1. Brand tokens (repaints inline var() usage too) ---------- */
:root {
  --green: #30f1b6;          /* mint */
  --mint-dark: #329879;      /* mint dark — text-safe accent */
  --teal: #02171d;           /* ink */
  --gray: #eef4f6;           /* app bg */
  --panel: #ffffff;
  --border: #d8e6e4;
  --muted: #4d6a6b;
  --amber: #e88f35;
  --coral: #fc4f52;
  --shadow: 0 1px 2px rgba(2, 23, 29, .05), 0 10px 30px -12px rgba(2, 23, 29, .12);
  --shadow-lift: 0 2px 6px rgba(2, 23, 29, .07), 0 18px 44px -16px rgba(2, 23, 29, .18);
  --shadow-deep: 0 1px 2px rgba(2,23,29,.06), 0 12px 32px -10px rgba(2,23,29,.14), 0 32px 80px -24px rgba(2,23,29,.16);
  --radius: 18px;
  --radius-input: 14px;
  --font-head: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23329879' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* ---------- 2. Base + gems.vip backdrop ---------- */
body {
  font-family: var(--font-body);
  color: var(--teal);
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(48, 241, 182, .18), transparent 60%),
    radial-gradient(1100px 640px at 100% 0%, rgba(50, 152, 121, .13), transparent 55%),
    radial-gradient(800px 600px at 50% 115%, rgba(48, 241, 182, .09), transparent 60%),
    var(--gray);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(48, 241, 182, .4); color: var(--teal); }
::placeholder { color: #93aeae; opacity: 1; }

h1, h2, h3, .brand, .done-banner .big, .f-stage .pct, .tier .rate {
  font-family: var(--font-head);
  letter-spacing: -0.02em;
}
h1 { font-size: 2.1rem; font-weight: 700; line-height: 1.12; }
h2 { font-size: 1.15rem; font-weight: 700; border-top-color: var(--border); }
.lede { font-size: 1.02rem; color: var(--muted); line-height: 1.6; max-width: 62ch; }

/* Mint-dash uppercase kickers */
.page-tag, .mini .k, .stepbox .n, .brand-sub, .f-stage .lbl {
  font-family: var(--font-head);
  color: var(--mint-dark);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.page-tag { font-size: .68rem; }
.page-tag::before, .brand-sub::before {
  content: "";
  display: inline-block;
  width: 22px; height: 2px;
  background: var(--green);
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 2px;
}

/* ---------- 3. FRAME: centered content column, gems.vip-style ---------- */
/* Main app: content column floats on the gradient with real gutters. */
main {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 56px clamp(24px, 5vw, 72px) 96px;
  box-sizing: border-box;
}
/* Admin: everything sits in a centered 1100px column. */
#dash {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px clamp(8px, 3vw, 32px) 64px;
}
#dash > h1 { font-size: 1.6rem; margin-top: 6px; }
#dash .sub {
  font-family: var(--font-head);
  color: var(--mint-dark);
  font-weight: 700;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  margin-bottom: 24px;
}
#dash .sub::before {
  content: "";
  display: inline-block;
  width: 22px; height: 2px;
  background: var(--green);
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 2px;
}

/* ---------- 4. Sidebar ---------- */
aside {
  background:
    radial-gradient(420px 320px at 85% -10%, rgba(48, 241, 182, .22), transparent 60%),
    radial-gradient(380px 420px at -10% 100%, rgba(50, 152, 121, .25), transparent 55%),
    var(--teal);
  color: #c8dedd;
  border-right: 1px solid rgba(48, 241, 182, .15);
  padding: 28px 18px;
}
aside .brand { font-size: 1.15rem; letter-spacing: -0.01em; }
aside .brand-sub { color: var(--green); }
aside .brand-sub::before { background: var(--green); }
.nav-item { border-radius: 12px; transition: background .18s ease, transform .18s ease; }
.nav-item:hover { background: rgba(48, 241, 182, .1); transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(48, 241, 182, .22), rgba(48, 241, 182, .08));
  box-shadow: inset 2px 0 0 var(--green);
  color: #fff;
}
.nav-item .num { border-color: var(--green); color: var(--green); }
.nav-item.done .num { background: var(--green); color: var(--teal); border-color: var(--green); }
.nav-item .t small { color: #7fa3a1; }
.side-progress { border-top-color: rgba(48, 241, 182, .2); color: #7fa3a1; }
.side-bar { background: rgba(255, 255, 255, .1); border-radius: 4px; }
.side-bar > span { background: linear-gradient(90deg, var(--mint-dark), var(--green)); }
.user-chip { border-top-color: rgba(48, 241, 182, .2); color: #a9c6c4; }
.user-chip a, .auth-skip a { color: var(--green); }

/* ---------- 5. Cards / minis / quotes — glass on gradient ---------- */
.card, .mini, .tier, .stepbox, .f-stage, .auth-card {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .9);
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.82));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.card { padding: 24px 26px; }
.mini { padding: 18px; }
.mini, .stepbox, .f-stage, .tier { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.mini:hover, .stepbox:hover, .f-stage:hover, .tier:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(48, 241, 182, .55);
}
.quote {
  border-left: 3px solid var(--green);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.06rem;
  color: var(--teal);
  background: rgba(255, 255, 255, .72);
  border-radius: 0 var(--radius-input) var(--radius-input) 0;
}
.disclaimer {
  background: rgba(232, 143, 53, .1);
  border-color: rgba(232, 143, 53, .35);
  color: #8a5417;
  border-radius: var(--radius-input);
}
.f-stage .pct { color: var(--mint-dark); font-weight: 700; }
.tier .rate { color: var(--teal); }
.tier .eq { color: var(--mint-dark); }

/* ---------- 6. Buttons ---------- */
.btn, #login button, .tools button, #gGo {
  font-family: var(--font-head);
  font-weight: 700;
  border-radius: 999px;
  padding: 12px 26px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn {
  background: var(--green);
  border-color: var(--green);
  color: var(--teal);
  box-shadow: 0 6px 18px -6px rgba(48, 241, 182, .55);
}
.btn:hover { filter: none; transform: translateY(-2px); box-shadow: 0 12px 26px -6px rgba(48, 241, 182, .7); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: rgba(255, 255, 255, .88);
  color: var(--teal);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.btn.ghost:hover { border-color: var(--green); }
.btn:focus-visible, .opt:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--mint-dark);
  outline-offset: 2px;
}

/* ---------- 7. Forms: kill every browser default ---------- */
#authGate {
  background:
    radial-gradient(700px 480px at 20% 0%, rgba(48, 241, 182, .2), transparent 60%),
    radial-gradient(700px 480px at 90% 100%, rgba(50, 152, 121, .16), transparent 60%),
    var(--gray);
}
.auth-card { padding: 36px 34px; box-shadow: var(--shadow-deep); }
.auth-card h1 { font-size: 1.5rem; }
.auth-card label, label {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .66rem;
  color: var(--mint-dark);
  font-weight: 700;
}
input[type="text"], input[type="password"], input[type="email"], select, textarea,
.auth-card input, #login input, .tools input {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: #fff;
  color: var(--teal);
  font-family: var(--font-body);
  font-size: .9rem;
  min-height: 46px;
  padding: 11px 16px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(2, 23, 29, .04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
select {
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 600;
}
select option { font-family: var(--font-body); color: var(--teal); background: #fff; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(48, 241, 182, .22), inset 0 1px 2px rgba(2, 23, 29, .04);
}
select:hover { border-color: rgba(48, 241, 182, .6); }
.auth-err, .notice.err { border-radius: var(--radius-input); background: rgba(252, 79, 82, .09); border: 1px solid rgba(252, 79, 82, .35); color: #b71f22; }

/* ---------- 8. Quiz UI ---------- */
#qOpts .opt {
  background: rgba(255, 255, 255, .88) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-input) !important;
  padding: 14px 18px !important;
  font-family: var(--font-body);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
#qOpts .opt:hover {
  border-color: var(--green) !important;
  transform: translateX(3px);
  box-shadow: 0 6px 16px -8px rgba(2, 23, 29, .25);
}
.done-banner {
  background:
    radial-gradient(400px 260px at 90% -20%, rgba(48, 241, 182, .3), transparent 60%),
    var(--teal);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep);
}
.done-banner p { color: #a9c6c4; }

/* ---------- 9. Tables ---------- */
table { border-radius: var(--radius-input); box-shadow: var(--shadow); overflow: hidden; border: 1px solid rgba(255,255,255,.9); }
th {
  background: var(--teal);
  font-family: var(--font-head);
  letter-spacing: .12em;
  padding: 12px 12px;
}
td { padding: 11px 12px; }
tbody tr:hover td { background: rgba(48, 241, 182, .07); }

/* ---------- 10. Admin panel (hardcoded hex → explicit overrides) ---------- */
#dash .cards { gap: 14px; }
#dash .cards .card { padding: 18px 24px; min-width: 140px; }
#dash .cards .card .v { color: var(--mint-dark); font-family: var(--font-head); font-size: 1.6rem; letter-spacing: -0.02em; }
#dash .cards .card .k { font-family: var(--font-head); letter-spacing: .14em; font-weight: 700; color: var(--muted); }
.tools { gap: 12px; margin: 10px 0 18px; }
.tools button {
  background: var(--teal);
  color: #fff;
  padding: 10px 20px;
  font-size: .8rem;
}
.tools button:hover { box-shadow: 0 8px 20px -8px rgba(2, 23, 29, .5); transform: translateY(-1px); }
.logout { font-family: var(--font-head); color: var(--mint-dark); font-weight: 600; }
#login {
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow-deep);
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.85));
  backdrop-filter: blur(12px);
  padding: 32px 30px;
  margin: 14vh auto;
}
#login h1 { font-size: 1.35rem; }
#login .sub { font-size: .84rem; color: var(--muted); margin-bottom: 14px; }
#login button { background: var(--green); color: var(--teal); width: 100%; box-shadow: 0 6px 18px -6px rgba(48, 241, 182, .55); }
#login button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(48, 241, 182, .65); }
#detail { background: rgba(2, 23, 29, .55); backdrop-filter: blur(6px); }
#detail .panel { border-radius: var(--radius); box-shadow: var(--shadow-deep); padding: 28px; }
#detail .kv div b { color: var(--mint-dark); }
#detail .item { background: var(--gray); border-radius: var(--radius-input); }
#dash tbody tr:hover td { background: rgba(48, 241, 182, .08); }

/* ---------- 11. Content Creator — editor feel ---------- */
#gGoal, #gPlatform {
  width: 100%;
  margin: 6px 0 14px;
  border-radius: 999px;            /* pill selects, chip-like */
  padding-left: 20px;
  background-color: #fff;
}
#gTopic {
  width: 100%;
  margin: 6px 0 16px;
}
#gGo {
  background: var(--green);
  border-color: var(--green);
  color: var(--teal);
  font-size: .95rem;
  padding: 13px 30px;
  margin-top: 2px;
  box-shadow: 0 8px 22px -6px rgba(48, 241, 182, .6);
}
#gGo:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(48, 241, 182, .75); }
#gDraft, [id^="tpl-"] {
  background: rgba(238, 244, 246, .85) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-input) !important;
  padding: 18px 20px !important;
  font-size: .9rem !important;
  line-height: 1.65;
}
#gOut > span { font-family: var(--font-head); font-weight: 600; }
/* copy buttons feel like toolbar chips */
[data-t].btn.ghost { border-radius: 999px; padding: 8px 18px; font-size: .78rem; }

/* ---------- 12. Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .mini:hover, .stepbox:hover, .f-stage:hover, .tier:hover, .btn:hover, .nav-item:hover, #qOpts .opt:hover {
    transform: none;
  }
}
/* ============================================================
   GEMS XL ACADEMY — creator top panel v2 + library/sources
   Append to academy-theme.css. Classes: .cc-* (creator panel),
   .lib-* (library). Uses existing brand tokens; local fallbacks
   below in case appended standalone.
   ============================================================ */
:root {
  --mint: #30f1b6; --mint-dark: #329879; --ink: #02171d;
  --coral: #fc4f52;
  --border: #d8e6e4; --muted: #4d6a6b;
  --r: 18px;
  --head: 'Space Grotesk', sans-serif; --body: 'Inter', sans-serif;
  --shadow: 0 1px 2px rgba(2,23,29,.05), 0 10px 30px -12px rgba(2,23,29,.12);
  --shadow-deep: 0 1px 2px rgba(2,23,29,.06), 0 12px 32px -10px rgba(2,23,29,.14), 0 32px 80px -24px rgba(2,23,29,.16);
}
.icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ============================================================
     .cc-*  — CREATOR TOP PANEL (framed)
     ============================================================ */
  .cc-panel {
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.82));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.9); border-radius: var(--r);
    box-shadow: var(--shadow-deep); overflow: hidden; margin-bottom: 28px;
  }
  .cc-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 24px; border-bottom: 1px solid var(--border);
    background: rgba(238,244,246,.55);
  }
  .cc-head-icon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, rgba(48,241,182,.25), rgba(50,152,121,.18));
    border: 1px solid rgba(48,241,182,.45); color: var(--mint-dark);
    display: grid; place-items: center;
  }
  .cc-head-icon svg { width: 17px; height: 17px; }
  .cc-head h2 { font-family: var(--head); font-size: 1rem; letter-spacing: -0.01em; margin: 0; }
  .cc-head .cc-sub { font-size: .76rem; color: var(--muted); margin-top: 1px; }
  .cc-head .cc-step { margin-left: auto; font-family: var(--head); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mint-dark); background: rgba(48,241,182,.14); border: 1px solid rgba(48,241,182,.4); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }

  .cc-controls {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    border-bottom: 1px solid var(--border);
  }
  .cc-group { padding: 18px 24px 20px; }
  .cc-group + .cc-group { border-left: 1px solid var(--border); }
  .cc-group-label {
    display: flex; align-items: center; gap: 7px; margin: 0 0 12px;
    font-family: var(--head); font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em; color: var(--mint-dark);
  }
  .cc-group-label .icon { width: 14px; height: 14px; }
  .cc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .cc-chip {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--head); font-size: .8rem; font-weight: 600;
    border: 1px solid var(--border); background: #fff; color: var(--ink);
    border-radius: 999px; padding: 8px 15px; cursor: pointer; transition: .15s;
    box-shadow: 0 1px 2px rgba(2,23,29,.04);
  }
  .cc-chip .icon { width: 14px; height: 14px; color: var(--mint-dark); }
  .cc-chip:hover { border-color: var(--mint); transform: translateY(-1px); box-shadow: var(--shadow); }
  .cc-chip[aria-pressed="true"] { background: var(--ink); color: var(--mint); border-color: var(--ink); box-shadow: 0 6px 16px -6px rgba(2,23,29,.45); }
  .cc-chip[aria-pressed="true"] .icon { color: var(--mint); }

  .cc-row { display: flex; gap: 14px; align-items: flex-end; padding: 20px 24px 24px; flex-wrap: wrap; }
  .cc-field { flex: 1; min-width: 240px; }
  .cc-field label { display: flex; align-items: center; gap: 7px; font-family: var(--head); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--mint-dark); margin: 0 0 8px; }
  .cc-field label .icon { width: 14px; height: 14px; }
  .cc-field input {
    width: 100%; border: 1px solid var(--border); border-radius: 999px; padding: 12px 20px; min-height: 48px;
    font: .92rem var(--body); color: var(--ink); background: #fff; transition: .15s;
    box-shadow: inset 0 1px 2px rgba(2,23,29,.04);
  }
  .cc-field input::placeholder { color: #93aeae; }
  .cc-field input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px rgba(48,241,182,.25); }
  .cc-generate {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--head); font-weight: 700; font-size: .92rem; cursor: pointer;
    background: var(--mint); color: var(--ink); border: 1px solid var(--mint);
    border-radius: 999px; padding: 0 26px; min-height: 48px; transition: .15s;
    box-shadow: 0 6px 18px -6px rgba(48,241,182,.55); white-space: nowrap;
  }
  .cc-generate:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -6px rgba(48,241,182,.7); }
  .cc-generate .icon { width: 16px; height: 16px; }
  .cc-hint { width: 100%; font-size: .76rem; color: var(--muted); margin: -6px 0 0; }

  /* draft preview (unchanged style, kept for context) */
  .cc-result { padding: 0 24px 26px; }
  .badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--head); font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 5px 13px; }
  .badge.ok { background: rgba(48,241,182,.18); color: var(--mint-dark); }
  .badge .icon { width: 12px; height: 12px; }
  .draft { margin-top: 12px; border: 1px solid var(--border); border-radius: 14px; background: rgba(238,244,246,.8); padding: 18px 20px; font-size: .92rem; line-height: 1.65; white-space: pre-wrap; }
  .queue-note { display: flex; align-items: center; gap: 7px; font-size: .76rem; color: var(--muted); margin-top: 10px; }
  .queue-note .icon { width: 13px; height: 13px; }

  /* ============================================================
     .lib-*  — LIBRARY / SOURCES PANEL
     ============================================================ */
  .lib-panel {
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.82));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.9); border-radius: var(--r);
    box-shadow: var(--shadow-deep); overflow: hidden; margin-bottom: 28px;
  }
  .lib-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 24px; border-bottom: 1px solid var(--border);
    background: rgba(238,244,246,.55);
  }
  .lib-head-icon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, rgba(48,241,182,.25), rgba(50,152,121,.18));
    border: 1px solid rgba(48,241,182,.45); color: var(--mint-dark);
    display: grid; place-items: center;
  }
  .lib-head-icon svg { width: 17px; height: 17px; }
  .lib-head h2 { font-family: var(--head); font-size: 1rem; letter-spacing: -0.01em; margin: 0; }
  .lib-head .lib-sub { font-size: .76rem; color: var(--muted); margin-top: 1px; }
  .lib-count { margin-left: auto; font-family: var(--head); font-size: .72rem; font-weight: 700; color: var(--mint-dark); background: rgba(48,241,182,.14); border: 1px solid rgba(48,241,182,.4); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }

  .lib-list { list-style: none; margin: 0; padding: 8px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .lib-item {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    padding: 11px 12px 11px 11px; transition: .15s; min-width: 0;
  }
  .lib-item:hover { border-color: rgba(48,241,182,.6); box-shadow: var(--shadow); transform: translateY(-1px); }
  .lib-favicon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center; color: var(--mint-dark);
    background: rgba(48,241,182,.12); border: 1px solid rgba(48,241,182,.35);
  }
  .lib-favicon svg { width: 17px; height: 17px; }
  .lib-meta { min-width: 0; flex: 1; }
  .lib-title { display: block; font-family: var(--head); font-weight: 600; font-size: .84rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lib-url { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lib-remove {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
    display: grid; place-items: center; border: 1px solid transparent;
    background: transparent; color: var(--muted); transition: .15s;
  }
  .lib-remove svg { width: 13px; height: 13px; }
  .lib-remove:hover { color: var(--coral); background: rgba(252,79,82,.08); border-color: rgba(252,79,82,.3); }

  .lib-add { display: flex; gap: 10px; padding: 12px 20px 20px; flex-wrap: wrap; border-top: 1px dashed var(--border); margin-top: 4px; }
  .lib-add input {
    border: 1px solid var(--border); border-radius: 999px; padding: 10px 18px; min-height: 44px;
    font: .88rem var(--body); color: var(--ink); background: #fff; transition: .15s;
    box-shadow: inset 0 1px 2px rgba(2,23,29,.04);
  }
  .lib-add input::placeholder { color: #93aeae; }
  .lib-add input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px rgba(48,241,182,.25); }
  #libTitle { flex: 1; min-width: 150px; }
  #libUrl { flex: 2; min-width: 200px; }
  .lib-add-btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    font-family: var(--head); font-weight: 700; font-size: .84rem;
    background: #fff; color: var(--ink); border: 1px solid var(--border);
    border-radius: 999px; padding: 0 20px; min-height: 44px; transition: .15s;
  }
  .lib-add-btn .icon { width: 15px; height: 15px; color: var(--mint-dark); }
  .lib-add-btn:hover { border-color: var(--mint); transform: translateY(-1px); box-shadow: var(--shadow); }
  .lib-note { padding: 0 24px 18px; font-size: .74rem; color: var(--muted); }

/* ---------- responsive (≤900px) ---------- */
@media (max-width: 900px) {
  .lib-list { grid-template-columns: 1fr; }
  .cc-controls { grid-template-columns: 1fr; }
  .cc-group + .cc-group { border-left: 0; border-top: 1px solid var(--border); }
  .cc-row { padding: 18px 18px 20px; }
  .cc-group { padding: 16px 18px 18px; }
  .cc-head, .lib-head { padding: 14px 18px; }
  .cc-result { padding: 0 18px 22px; }
  .cc-generate { width: 100%; justify-content: center; }
  .cc-head .cc-step { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-chip, .cc-generate, .lib-item, .lib-remove, .lib-add-btn { transition: none !important; }
}

/* ============================================================
   Gems XL Academy — Content Creator v3 (.c3- classes)
   Append-ready: paste into academy-theme.css (or a <style> tag).
   BULLETPROOF RULES baked in:
   - Every inline <svg> in the v3 markup carries explicit
     width/height ATTRIBUTES (12–18) AND is capped again in CSS
     (max-width/max-height 20px inside .c3-panel) — double enforcement.
     Even if a class is stripped, icons can never render giant.
   - Icon tiles are flex: 0 0 32px + min-width — they never shrink.
   - Layout uses a handful of flex wrappers only; segments wrap.
   Fonts expected: Space Grotesk / Inter / Instrument Serif.
   ============================================================ */

  /* ============================================================
     .c3-*  — CREATOR v3 (bulletproof: every svg has width/height
     attributes AND CSS caps; icon tiles never shrink; layout uses
     a handful of robust flex wrappers)
     ============================================================ */

  /* --- defensive base: even unstyled/unclassed svg can never explode --- */
  .c3-panel svg, .c3-refbar svg { max-width: 20px; max-height: 20px; flex: 0 0 auto; display: block; }
  .c3-panel img { max-width: 100%; }

  /* --- panels (glass cards) --- */
  .c3-panel {
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.84));
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.9); border-radius: 18px;
    box-shadow: 0 1px 2px rgba(2,23,29,.06), 0 12px 32px -10px rgba(2,23,29,.14), 0 32px 80px -24px rgba(2,23,29,.16);
    overflow: hidden; margin-bottom: 26px;
  }
  .c3-panel-head {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 22px; border-bottom: 1px solid #d8e6e4;
    background: rgba(238,244,246,.6);
  }
  .c3-tile {
    width: 32px; height: 32px; min-width: 32px; border-radius: 9px; flex: 0 0 32px;
    background: linear-gradient(135deg, rgba(48,241,182,.22), rgba(50,152,121,.16));
    border: 1px solid rgba(48,241,182,.45); color: #329879;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .c3-tile svg { width: 16px; height: 16px; }
  .c3-panel-head h2 { font-family: var(--head); font-size: .98rem; letter-spacing: -0.01em; margin: 0; }
  .c3-panel-sub { font-size: .75rem; color: #4d6a6b; margin-top: 1px; }
  .c3-badge {
    margin-left: auto; flex: 0 0 auto; white-space: nowrap;
    font-family: var(--head); font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: #329879; background: rgba(48,241,182,.14); border: 1px solid rgba(48,241,182,.4);
    border-radius: 999px; padding: 5px 12px;
  }

  /* --- labeled control rows (framed) --- */
  .c3-fieldrow {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 14px 22px; border-bottom: 1px solid #e4eeec;
  }
  .c3-fieldrow:last-child { border-bottom: 0; }
  .c3-label {
    flex: 0 0 88px; font-family: var(--head); font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em; color: #329879;
  }

  /* --- segmented control --- */
  .c3-seg {
    display: inline-flex; flex-wrap: wrap; gap: 4px;
    background: rgba(2,23,29,.045); border: 1px solid #d8e6e4;
    border-radius: 999px; padding: 4px;
  }
  .c3-seg-btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    font-family: var(--head); font-weight: 600; font-size: .8rem; line-height: 1;
    color: #35545a; background: transparent; border: 1px solid transparent;
    border-radius: 999px; padding: 8px 14px; transition: .15s; white-space: nowrap;
  }
  .c3-seg-btn svg { width: 16px; height: 16px; color: #329879; }
  .c3-seg-btn:hover { background: rgba(255,255,255,.9); border-color: #d8e6e4; }
  .c3-seg-btn[aria-pressed="true"] {
    background: var(--mint); color: var(--ink); border-color: rgba(2,23,29,.12);
    box-shadow: 0 2px 8px -2px rgba(48,241,182,.6), inset 0 1px 0 rgba(255,255,255,.4);
    font-weight: 700;
  }
  .c3-seg-btn[aria-pressed="true"] svg { color: var(--ink); }

  /* --- topic + generate row --- */
  .c3-actionrow { display: flex; gap: 12px; align-items: center; padding: 16px 22px 20px; flex-wrap: wrap; background: rgba(238,244,246,.35); }
  .c3-input {
    flex: 1 1 260px; min-width: 200px; border: 1px solid #d8e6e4; border-radius: 999px;
    padding: 0 20px; height: 46px; font: 500 .9rem var(--body); color: var(--ink);
    background: #fff; transition: .15s; box-shadow: inset 0 1px 2px rgba(2,23,29,.04);
  }
  .c3-input::placeholder { color: #93aeae; }
  .c3-input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px rgba(48,241,182,.25); }
  .c3-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--head); font-weight: 700; font-size: .88rem; cursor: pointer;
    border-radius: 999px; height: 46px; padding: 0 24px; transition: .15s; white-space: nowrap;
    flex: 0 0 auto;
  }
  .c3-btn svg { width: 16px; height: 16px; }
  .c3-btn-primary {
    background: var(--mint); color: var(--ink); border: 1px solid rgba(2,23,29,.12);
    box-shadow: 0 6px 18px -6px rgba(48,241,182,.55);
  }
  .c3-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(48,241,182,.7); }
  .c3-btn-ghost { background: #fff; color: var(--ink); border: 1px solid #d8e6e4; }
  .c3-btn-ghost svg { color: #329879; }
  .c3-btn-ghost:hover { border-color: var(--mint); box-shadow: 0 1px 2px rgba(2,23,29,.05), 0 10px 30px -12px rgba(2,23,29,.12); }
  .c3-hint { flex: 1 1 100%; font-size: .74rem; color: #4d6a6b; margin: 0; }

  /* --- draft result --- */
  .c3-result { padding: 0 22px 22px; background: rgba(238,244,246,.35); }
  .c3-pill-ok { display: inline-flex; align-items: center; gap: 6px; font-family: var(--head); font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 5px 12px; background: rgba(48,241,182,.18); color: #1f7a5f; border: 1px solid rgba(48,241,182,.4); }
  .c3-pill-ok svg { width: 12px; height: 12px; }
  .c3-draft { margin-top: 10px; border: 1px solid #d8e6e4; border-radius: 14px; background: #fff; padding: 16px 18px; font-size: .9rem; line-height: 1.65; white-space: pre-wrap; }
  .c3-note { display: flex; align-items: center; gap: 7px; font-size: .74rem; color: #4d6a6b; margin-top: 10px; }
  .c3-note svg { width: 13px; height: 13px; }

  /* --- library rows --- */
  .c3-lib-list { list-style: none; margin: 0; padding: 10px 14px 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .c3-lib-item {
    display: flex; align-items: center; gap: 11px; min-width: 0;
    background: #fff; border: 1px solid #d8e6e4; border-radius: 13px;
    padding: 9px 10px; transition: .15s;
  }
  .c3-lib-item:hover { border-color: rgba(48,241,182,.6); box-shadow: 0 1px 2px rgba(2,23,29,.05), 0 10px 30px -12px rgba(2,23,29,.12); }
  .c3-lib-meta { min-width: 0; flex: 1 1 auto; }
  .c3-lib-title { display: block; font-family: var(--head); font-weight: 600; font-size: .82rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .c3-lib-url { display: block; font-size: .72rem; color: #4d6a6b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .c3-lib-remove {
    width: 26px; height: 26px; min-width: 26px; border-radius: 50%; flex: 0 0 26px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; background: transparent; color: #7a9596; transition: .15s;
  }
  .c3-lib-remove svg { width: 12px; height: 12px; }
  .c3-lib-remove:hover { color: var(--coral); background: rgba(252,79,82,.08); border-color: rgba(252,79,82,.3); }
  .c3-lib-add { display: flex; gap: 10px; padding: 12px 22px 8px; flex-wrap: wrap; border-top: 1px dashed #d8e6e4; margin-top: 10px; }
  .c3-lib-add .c3-input { height: 42px; font-size: .84rem; }
  .c3-lib-add .c3-input.t { flex: 1 1 150px; }
  .c3-lib-add .c3-input.u { flex: 2 1 200px; }
  .c3-lib-add .c3-btn { height: 42px; font-size: .82rem; padding: 0 18px; }
  .c3-lib-note { padding: 4px 22px 16px; font-size: .72rem; color: #4d6a6b; margin: 0; }

  /* --- templates + published --- */
  .c3-sec { font-family: var(--head); font-size: 1.12rem; letter-spacing: -0.01em; margin: 34px 0 14px; }
  .c3-sec em { font-family: var(--serif); font-style: italic; font-weight: 400; color: #329879; margin-left: 6px; letter-spacing: 0; }
  .c3-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .c3-tpl {
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.84));
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.9); border-radius: 18px;
    box-shadow: 0 1px 2px rgba(2,23,29,.05), 0 10px 30px -12px rgba(2,23,29,.12);
    padding: 18px; transition: .18s; display: flex; flex-direction: column; gap: 10px;
  }
  .c3-tpl svg { max-width: 20px; max-height: 20px; flex: 0 0 auto; }
  .c3-tpl:hover { transform: translateY(-2px); box-shadow: 0 2px 6px rgba(2,23,29,.07), 0 18px 44px -16px rgba(2,23,29,.18); border-color: rgba(48,241,182,.55); }
  .c3-tpl h3 { font-family: var(--head); font-size: .93rem; margin: 0; display: flex; align-items: center; gap: 8px; }
  .c3-tpl .c3-body { font-size: .8rem; color: #35545a; background: rgba(238,244,246,.8); border: 1px solid #e4eeec; border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; flex: 1; line-height: 1.6; }
  .c3-tpl .c3-btn { align-self: flex-start; height: 38px; font-size: .78rem; padding: 0 16px; }
  .c3-tpl .c3-btn svg { width: 13px; height: 13px; }

  /* --- referral bar --- */
  .c3-refbar {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    background: radial-gradient(400px 260px at 90% -20%, rgba(48,241,182,.3), transparent 60%), var(--ink);
    color: #c8dedd; border-radius: 18px; padding: 20px 24px; margin-top: 30px;
    box-shadow: 0 1px 2px rgba(2,23,29,.06), 0 12px 32px -10px rgba(2,23,29,.14); flex-wrap: wrap;
  }
  .c3-refbar code { font-size: .84rem; color: var(--mint); word-break: break-all; }
  .c3-refbar .kicker { color: var(--mint); }
  .c3-refbar .c3-btn-primary { border-color: var(--mint); }

  @media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; } aside { position: static; height: auto; }
    main { padding: 24px 18px 72px; }
    .c3-grid, .c3-lib-list { grid-template-columns: 1fr; }
    .c3-fieldrow { padding: 12px 16px; align-items: flex-start; flex-direction: column; gap: 8px; }
    .c3-label { flex: 0 0 auto; }
    .c3-seg { width: 100%; }
    .c3-seg-btn { flex: 1 1 auto; justify-content: center; }
    .c3-actionrow { padding: 14px 16px 18px; }
    .c3-actionrow .c3-btn-primary { flex: 1 1 100%; width: 100%; }
    .c3-panel-head { padding: 13px 16px; }
    #ccPanel .c3-badge { display: none; } /* step badge only; #libCount stays visible */
    .c3-refbar .c3-btn { flex: 1 1 100%; width: 100%; }
    .c3-result { padding: 0 16px 18px; }
    .c3-lib-add { padding: 12px 16px 8px; }
    .c3-lib-note { padding: 4px 16px 14px; }
  }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

  /* --- destination row (v3.1) --- */
  .c3-dest-url {
    flex: 1 1 220px; min-width: 180px; border: 1px solid #d8e6e4; border-radius: 999px;
    padding: 0 18px; height: 40px; font: 500 .84rem var(--body); color: var(--ink);
    background: #fff; transition: .15s; box-shadow: inset 0 1px 2px rgba(2,23,29,.04);
  }
  .c3-dest-url::placeholder { color: #93aeae; }
  .c3-dest-url:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px rgba(48,241,182,.25); }
  .c3-dest-url[hidden] { display: none; }
  .c3-dest-caption { display: flex; align-items: center; gap: 7px; font-size: .72rem; color: #7a9596; margin-top: 6px; word-break: break-all; }
  .c3-dest-caption svg { width: 12px; height: 12px; flex: 0 0 auto; }

/* Append after creator-v3.css — Library & sources v4 (.lib4-) */
/* ============================================================
   .lib4-*  — Library & sources v4: actionable rows
   (Open / Share+QR / My tracked link). Append-ready.
   ============================================================ */
.lib4-item { position: relative; }
.lib4-meta { min-width: 0; flex: 1 1 auto; }
.lib4-open-title { text-decoration: none; color: inherit; border-radius: 6px; }
.lib4-open-title:hover .c3-lib-title { color: #1f7a5f; }
.lib4-open-title:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

.c3-lib-item.lib4-item { flex-wrap: wrap; }
.lib4-actions { display: inline-flex; gap: 4px; flex: 0 0 auto; margin-left: auto; }
.lib4-iconbtn {
  position: relative; width: 30px; height: 30px; min-width: 30px; flex: 0 0 30px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: #7a9596; transition: .15s; padding: 0;
}
.lib4-iconbtn svg { width: 15px; height: 15px; max-width: 15px; max-height: 15px; }
.lib4-iconbtn:hover { color: #1f7a5f; background: rgba(48,241,182,.12); border-color: rgba(48,241,182,.45); }
.lib4-iconbtn:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; color: #1f7a5f; }
.lib4-iconbtn.danger:hover { color: var(--coral); background: rgba(252,79,82,.08); border-color: rgba(252,79,82,.3); }
/* tooltip */
.lib4-iconbtn::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%) translateY(2px); white-space: nowrap; pointer-events: none;
  font: 600 .64rem var(--head); letter-spacing: .04em; color: #eafff8;
  background: var(--ink); border-radius: 7px; padding: 5px 9px; opacity: 0; transition: .15s;
  box-shadow: 0 6px 18px -6px rgba(2,23,29,.5); z-index: 5;
}
.lib4-iconbtn:hover::after, .lib4-iconbtn:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- popover / modal --- */
.lib4-overlay { position: fixed; inset: 0; background: rgba(2,23,29,.28); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); z-index: 40; }
.lib4-overlay[hidden] { display: none; }
.lib4-pop {
  position: fixed; z-index: 41; width: min(340px, calc(100vw - 32px));
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(255,255,255,.92));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.95); border-radius: 18px;
  box-shadow: 0 2px 6px rgba(2,23,29,.08), 0 24px 60px -18px rgba(2,23,29,.35);
  padding: 16px 16px 14px;
}
.lib4-pop[hidden] { display: none; }
.lib4-pop svg { max-width: none; max-height: none; } /* QR svg may exceed the 20px panel cap — pop lives outside .c3-panel */
.lib4-pop-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.lib4-pop-head .c3-tile { width: 28px; height: 28px; min-width: 28px; flex: 0 0 28px; border-radius: 8px; }
.lib4-pop-head .c3-tile svg { width: 14px; height: 14px; max-width: 14px; max-height: 14px; }
.lib4-pop-title { font-family: var(--head); font-weight: 700; font-size: .84rem; letter-spacing: -0.01em; min-width: 0; }
.lib4-pop-sub { font-size: .68rem; color: #4d6a6b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib4-pop-close {
  margin-left: auto; width: 28px; height: 28px; min-width: 28px; flex: 0 0 28px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: #7a9596; transition: .15s; padding: 0;
}
.lib4-pop-close svg { width: 12px; height: 12px; max-width: 12px; max-height: 12px; }
.lib4-pop-close:hover { color: var(--coral); background: rgba(252,79,82,.08); border-color: rgba(252,79,82,.3); }
.lib4-pop-close:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }

.lib4-qrwrap {
  display: grid; place-items: center; background: #fff; border: 1px solid #d8e6e4;
  border-radius: 13px; padding: 12px; margin-bottom: 10px;
}
.lib4-qrwrap svg { width: 168px; height: 168px; display: block; }
.lib4-qr-note { font-size: .66rem; color: #7a9596; text-align: center; margin: -4px 0 10px; }

.lib4-urlrow {
  display: flex; align-items: center; gap: 8px;
  background: rgba(238,244,246,.8); border: 1px solid #e4eeec; border-radius: 11px;
  padding: 8px 10px; margin-bottom: 10px;
}
.lib4-urlrow code {
  font-size: .7rem; color: #35545a; min-width: 0; flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}
.lib4-urlrow.tracked code { color: #1f7a5f; }
.lib4-pop-btns { display: flex; gap: 8px; }
.lib4-pop-btns .c3-btn { height: 38px; font-size: .78rem; padding: 0 16px; flex: 1 1 auto; }
.lib4-tracked-hint { display: flex; gap: 7px; align-items: flex-start; font-size: .68rem; color: #4d6a6b; line-height: 1.45; margin: 0 0 10px; }
.lib4-tracked-hint[hidden] { display: none; }
.lib4-tracked-hint svg { width: 12px; height: 12px; max-width: 12px; max-height: 12px; flex: 0 0 auto; margin-top: 1px; color: #329879; }

@media (max-width: 640px) {
  .lib4-pop { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
  .lib4-iconbtn { width: 40px; height: 40px; min-width: 40px; flex: 0 0 40px; }
  .lib4-iconbtn::after { display: none; }
  .lib4-actions { gap: 2px; }
}


/* ============================================================
   Gems XL Academy — Admin “Users” v1 (.adm- classes)
   Append-ready: paste into academy-theme.css (or a <style> tag).
   Same bulletproof rules as .c3-/.l4-:
   - every inline svg carries width/height ATTRIBUTES (12–18)
   - CSS caps svg again inside .adm- containers (max 20px)
   - icon tiles never shrink; 40px min touch targets
   - table → stacked cards under 768px
   ============================================================ */

/* defensive: no svg inside admin UI can ever explode */
.adm-stats svg, .adm-panel svg, .adm-modal svg, .adm-confirm svg, .adm-toolbar svg {
  max-width: 20px; max-height: 20px; flex: 0 0 auto; display: block;
}

/* --- stats row (framed cards, landing-page pattern) --- */
.adm-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 26px; }
.adm-stat {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.84));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.9); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(2,23,29,.05), 0 10px 30px -12px rgba(2,23,29,.12);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.adm-stat-top { display: flex; align-items: center; gap: 8px; }
.adm-stat-top svg { width: 15px; height: 15px; color: #329879; }
.adm-stat-k {
  font-family: var(--head); font-size: .64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: #4d6a6b; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.adm-stat-v { font-family: var(--head); font-weight: 700; font-size: 1.55rem; letter-spacing: -0.02em; line-height: 1; }
.adm-stat-sub { font-size: .7rem; color: #4d6a6b; }
.adm-stat-sub em { font-family: var(--serif); font-style: italic; color: #329879; }
.adm-stat.coral .adm-stat-top svg { color: var(--coral); }
.adm-stat.coral .adm-stat-v { color: var(--coral); }
.adm-stat.amber .adm-stat-top svg { color: var(--amber); }

/* --- toolbar: search + filter chips + add --- */
.adm-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.adm-search { position: relative; flex: 1 1 240px; min-width: 200px; }
.adm-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: #7a9596; pointer-events: none; }
.adm-search input {
  width: 100%; border: 1px solid #d8e6e4; border-radius: 999px; height: 44px;
  padding: 0 18px 0 40px; font: 500 .88rem var(--body); color: var(--ink);
  background: #fff; transition: .15s; box-shadow: inset 0 1px 2px rgba(2,23,29,.04);
}
.adm-search input::placeholder { color: #93aeae; }
.adm-search input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px rgba(48,241,182,.25); }
.adm-chips {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  background: rgba(2,23,29,.045); border: 1px solid #d8e6e4; border-radius: 999px; padding: 4px;
}
.adm-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 36px;
  font-family: var(--head); font-weight: 600; font-size: .78rem; line-height: 1;
  color: #35545a; background: transparent; border: 1px solid transparent;
  border-radius: 999px; padding: 8px 14px; transition: .15s; white-space: nowrap;
}
.adm-chip .n { font-size: .68rem; font-weight: 700; color: #329879; background: rgba(48,241,182,.16); border-radius: 999px; padding: 2px 7px; }
.adm-chip:hover { background: rgba(255,255,255,.9); border-color: #d8e6e4; }
.adm-chip:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.adm-chip[aria-pressed="true"] {
  background: var(--mint); color: var(--ink); border-color: rgba(2,23,29,.12); font-weight: 700;
  box-shadow: 0 2px 8px -2px rgba(48,241,182,.6), inset 0 1px 0 rgba(255,255,255,.4);
}
.adm-chip[aria-pressed="true"] .n { background: rgba(2,23,29,.12); color: var(--ink); }
.adm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--head); font-weight: 700; font-size: .84rem; cursor: pointer;
  border-radius: 999px; height: 44px; padding: 0 20px; transition: .15s; white-space: nowrap; flex: 0 0 auto;
}
.adm-btn svg { width: 15px; height: 15px; }
.adm-btn:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.adm-btn-primary { background: var(--mint); color: var(--ink); border: 1px solid rgba(2,23,29,.12); box-shadow: 0 6px 18px -6px rgba(48,241,182,.55); }
.adm-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(48,241,182,.7); }
.adm-btn-ghost { background: #fff; color: var(--ink); border: 1px solid #d8e6e4; }
.adm-btn-ghost svg { color: #329879; }
.adm-btn-ghost:hover { border-color: var(--mint); box-shadow: 0 1px 2px rgba(2,23,29,.05), 0 10px 30px -12px rgba(2,23,29,.12); }
.adm-btn-danger { background: var(--coral); color: #fff; border: 1px solid rgba(2,23,29,.12); box-shadow: 0 6px 18px -6px rgba(252,79,82,.5); }
.adm-btn-danger:hover { transform: translateY(-1px); }

/* --- users panel --- */
.adm-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.84));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.9); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(2,23,29,.06), 0 12px 32px -10px rgba(2,23,29,.14), 0 32px 80px -24px rgba(2,23,29,.16);
  overflow: hidden; margin-bottom: 26px;
}
.adm-panel-head { display: flex; align-items: center; gap: 12px; padding: 15px 22px; border-bottom: 1px solid #d8e6e4; background: rgba(238,244,246,.6); }
.adm-tile {
  width: 32px; height: 32px; min-width: 32px; border-radius: 9px; flex: 0 0 32px;
  background: linear-gradient(135deg, rgba(48,241,182,.22), rgba(50,152,121,.16));
  border: 1px solid rgba(48,241,182,.45); color: #329879;
  display: inline-flex; align-items: center; justify-content: center;
}
.adm-tile svg { width: 16px; height: 16px; }
.adm-panel-head h2 { font-family: var(--head); font-size: .98rem; letter-spacing: -0.01em; margin: 0; }
.adm-panel-sub { font-size: .75rem; color: #4d6a6b; margin-top: 1px; }
.adm-count {
  margin-left: auto; flex: 0 0 auto; white-space: nowrap;
  font-family: var(--head); font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #329879; background: rgba(48,241,182,.14); border: 1px solid rgba(48,241,182,.4);
  border-radius: 999px; padding: 5px 12px;
}

/* column header (desktop only) */
.adm-cols {
  display: grid; grid-template-columns: minmax(180px,1.4fr) minmax(150px,1.1fr) 120px 110px 96px 190px;
  gap: 12px; align-items: center; padding: 9px 22px; border-bottom: 1px solid #e4eeec;
  font-family: var(--head); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #7a9596;
}

/* user row (framed) */
.adm-rows { list-style: none; margin: 0; padding: 0; }
.adm-row {
  display: grid; grid-template-columns: minmax(180px,1.4fr) minmax(150px,1.1fr) 120px 110px 96px 190px;
  gap: 12px; align-items: center; padding: 12px 22px;
  border-bottom: 1px solid #e4eeec; transition: .15s; min-width: 0;
}
.adm-row:last-child { border-bottom: 0; }
.adm-row:hover { background: rgba(48,241,182,.05); }
.adm-row:focus-within { background: rgba(48,241,182,.07); }
.adm-row.is-blocked { background: rgba(2,23,29,.03); }
.adm-row.is-blocked .adm-name, .adm-row.is-blocked .adm-soc, .adm-row.is-blocked .adm-wallet { opacity: .55; }
.adm-row.is-blocked .adm-avatar { filter: grayscale(1); opacity: .6; }

.adm-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.adm-avatar {
  width: 36px; height: 36px; min-width: 36px; border-radius: 10px; flex: 0 0 36px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 700; font-size: .82rem; color: var(--ink);
  background: linear-gradient(135deg, rgba(48,241,182,.55), rgba(50,152,121,.35));
  border: 1px solid rgba(48,241,182,.5);
}
.adm-name { font-family: var(--head); font-weight: 600; font-size: .88rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-joined { display: block; font-size: .68rem; color: #7a9596; }

.adm-socs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.adm-soc { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: #35545a; min-width: 0; }
.adm-soc svg { width: 13px; height: 13px; color: #329879; }
.adm-soc span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.adm-wallet { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; color: #35545a; white-space: nowrap; }

/* role + status badges */
.adm-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-family: var(--head); font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 10px; border: 1px solid transparent;
}
.adm-badge svg { width: 11px; height: 11px; }
.adm-role-participant { color: #35545a; background: rgba(2,23,29,.05); border-color: #d8e6e4; }
.adm-role-leader { color: #329879; background: rgba(48,241,182,.14); border-color: rgba(48,241,182,.4); }
.adm-role-mega { color: var(--ink); background: var(--mint); border-color: rgba(2,23,29,.12); box-shadow: 0 2px 8px -2px rgba(48,241,182,.5); }
.adm-st-active { color: #1f7a5f; background: rgba(48,241,182,.12); border-color: rgba(48,241,182,.35); }
.adm-st-graduated { color: #9a5f16; background: rgba(232,143,53,.12); border-color: rgba(232,143,53,.35); }
.adm-st-blocked { color: var(--coral); background: rgba(252,79,82,.1); border-color: rgba(252,79,82,.35); }

/* action cluster */
.adm-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.adm-act {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  min-height: 40px; min-width: 40px; padding: 0 12px;
  font-family: var(--head); font-weight: 600; font-size: .72rem; line-height: 1;
  color: #35545a; background: #fff; border: 1px solid #d8e6e4; border-radius: 999px; transition: .15s; white-space: nowrap;
}
.adm-act svg { width: 14px; height: 14px; color: #329879; }
.adm-act:hover { border-color: var(--mint); box-shadow: 0 1px 2px rgba(2,23,29,.05), 0 8px 22px -10px rgba(2,23,29,.16); }
.adm-act:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.adm-act-block { color: var(--coral); }
.adm-act-block svg { color: var(--coral); }
.adm-act-block:hover { border-color: rgba(252,79,82,.5); background: rgba(252,79,82,.05); box-shadow: none; }
.adm-act-unblock { color: #7a9596; background: transparent; border-style: dashed; }
.adm-act-unblock svg { color: #7a9596; }
.adm-act-unblock:hover { color: #329879; border-color: rgba(48,241,182,.5); background: rgba(48,241,182,.06); }
.adm-act-unblock:hover svg { color: #329879; }

/* inline role select (framed, chevron) */
.adm-roleselect {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: var(--head); font-weight: 600; font-size: .72rem; color: var(--ink);
  min-height: 40px; padding: 0 26px 0 12px; border: 1px solid #d8e6e4; border-radius: 999px; background: #fff;
  background-image: var(--chevron, url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23329879' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>"));
  background-repeat: no-repeat; background-position: right 10px center; transition: .15s;
}
.adm-roleselect:hover { border-color: var(--mint); }
.adm-roleselect:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* access toggles placeholder strip */
.adm-access {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 22px; background: rgba(238,244,246,.5); border-top: 1px dashed #d8e6e4;
  font-size: .72rem; color: #4d6a6b;
}
.adm-access .adm-badge { text-transform: none; letter-spacing: .02em; }

/* --- modal + confirm dialog --- */
.adm-overlay {
  position: fixed; inset: 0; z-index: 40; display: none;
  align-items: flex-start; justify-content: center; overflow-y: auto; padding: 6vh 16px 40px;
  background: rgba(2,23,29,.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.adm-overlay.open { display: flex; }
.adm-modal {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.92));
  border: 1px solid rgba(255,255,255,.9); border-radius: 18px; width: 100%; max-width: 520px;
  box-shadow: 0 1px 2px rgba(2,23,29,.06), 0 12px 32px -10px rgba(2,23,29,.2), 0 32px 80px -24px rgba(2,23,29,.3);
  overflow: hidden;
}
.adm-modal-head { display: flex; align-items: center; gap: 12px; padding: 15px 22px; border-bottom: 1px solid #d8e6e4; background: rgba(238,244,246,.6); }
.adm-modal-head h2 { font-family: var(--head); font-size: .98rem; margin: 0; }
.adm-modal-x {
  margin-left: auto; width: 40px; height: 40px; min-width: 40px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; color: #7a9596; transition: .15s;
}
.adm-modal-x svg { width: 14px; height: 14px; }
.adm-modal-x:hover { color: var(--coral); background: rgba(252,79,82,.08); border-color: rgba(252,79,82,.3); }
.adm-modal-x:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.adm-form { padding: 18px 22px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.adm-field.full { grid-column: 1 / -1; }
.adm-field label { font-family: var(--head); font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #329879; }
.adm-field input, .adm-field select {
  border: 1px solid #d8e6e4; border-radius: 12px; height: 44px; padding: 0 14px;
  font: 500 .86rem var(--body); color: var(--ink); background: #fff; transition: .15s;
  box-shadow: inset 0 1px 2px rgba(2,23,29,.04); width: 100%;
}
.adm-field input::placeholder { color: #93aeae; }
.adm-field input:focus, .adm-field select:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px rgba(48,241,182,.25); }
.adm-field .hint { font-size: .68rem; color: #7a9596; }
.adm-form-foot { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.adm-form-note { margin-right: auto; font-size: .7rem; color: #7a9596; }

/* confirm dialog */
.adm-confirm { max-width: 420px; }
.adm-confirm-body { padding: 20px 22px 22px; }
.adm-confirm-body p { margin: 0 0 6px; font-size: .9rem; line-height: 1.55; }
.adm-confirm-body .who { font-family: var(--head); font-weight: 700; }
.adm-confirm-body .sub { font-size: .76rem; color: #4d6a6b; margin-bottom: 16px; }
.adm-confirm-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.adm-tile-coral { background: linear-gradient(135deg, rgba(252,79,82,.18), rgba(252,79,82,.08)); border-color: rgba(252,79,82,.4); color: var(--coral); }

/* toast */
.adm-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px); z-index: 60;
  background: var(--ink); color: #c8dedd; border: 1px solid rgba(48,241,182,.35);
  border-radius: 999px; padding: 10px 20px; font: 600 .8rem var(--head);
  box-shadow: 0 12px 32px -10px rgba(2,23,29,.4); opacity: 0; pointer-events: none; transition: .25s;
}
.adm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.adm-toast b { color: var(--mint); }

/* empty state */
.adm-empty { padding: 34px 22px; text-align: center; font-size: .84rem; color: #7a9596; }
.adm-empty em { font-family: var(--serif); font-style: italic; color: #329879; }

/* --- responsive --- */
@media (max-width: 1100px) {
  .adm-stats { grid-template-columns: repeat(3, 1fr); }
  .adm-cols { display: none; }
  .adm-row { grid-template-columns: 1fr 1fr; }
  .adm-row > .adm-who { grid-column: 1 / -1; }
  .adm-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 768px) {
  .adm-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .adm-stat { padding: 13px 14px; }
  .adm-stat-v { font-size: 1.35rem; }
  .adm-toolbar .adm-btn-primary { flex: 1 1 100%; width: 100%; }
  .adm-chips { width: 100%; }
  .adm-chip { flex: 1 1 auto; justify-content: center; }
  .adm-row { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
  .adm-panel-head, .adm-cols { padding-left: 16px; padding-right: 16px; }
  .adm-access { padding: 12px 16px; }
  .adm-badges-line { display: flex; gap: 6px; flex-wrap: wrap; }
  .adm-actions { justify-content: flex-start; }
  .adm-form { grid-template-columns: 1fr; }
}
@media (min-width: 769px) { .adm-badges-line { display: contents; } }
@media (prefers-reduced-motion: reduce) { .adm-stats *, .adm-panel *, .adm-modal *, .adm-toast { transition: none !important; } }

/* ============================================================
   .tab5-* / .pub5-*  — Creator area v5: TAB SPLIT + published
   final-draft cards with share row. Append-ready; depends on
   the .c3-* base (panels, buttons, inputs) already shipped.
   ============================================================ */

/* --- tab panels: only the active one renders --- */
.tab5-panel[hidden] { display: none; }
.tab5-panel { animation: tab5-in .22s ease; }
@keyframes tab5-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* sidebar nav items acting as tabs keep .nav-item styling;
   add focus ring + button reset when rendered as <button> */
.tab5-nav {
  display: flex; width: 100%; text-align: left; border: 0; background: transparent;
  color: inherit; font: inherit; min-height: 40px;
}
.tab5-nav:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* ============ published final-draft cards ============ */
.pub5-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pub5-card {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.86));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.9); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(2,23,29,.05), 0 10px 30px -12px rgba(2,23,29,.12);
  padding: 0; overflow: hidden; transition: .18s;
}
.pub5-card:hover { box-shadow: 0 2px 6px rgba(2,23,29,.07), 0 18px 44px -16px rgba(2,23,29,.18); border-color: rgba(48,241,182,.5); }
.pub5-card svg { max-width: 20px; max-height: 20px; flex: 0 0 auto; display: block; }

.pub5-head {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 18px 12px; border-bottom: 1px solid #e4eeec;
  background: rgba(238,244,246,.5);
}
.pub5-head .c3-tile { width: 30px; height: 30px; min-width: 30px; flex: 0 0 30px; border-radius: 8px; }
.pub5-head .c3-tile svg { width: 15px; height: 15px; }
.pub5-title { font-family: var(--head); font-weight: 700; font-size: .86rem; letter-spacing: -0.01em; min-width: 0; }
.pub5-approved {
  margin-left: auto; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--head); font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #1f7a5f; background: rgba(48,241,182,.16); border: 1px solid rgba(48,241,182,.4);
  border-radius: 999px; padding: 5px 11px; white-space: nowrap;
}
.pub5-approved svg { width: 11px; height: 11px; }

.pub5-body {
  padding: 15px 18px 13px; font-size: .88rem; line-height: 1.65; color: var(--ink);
  white-space: pre-wrap;
}
.pub5-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 0 18px 12px; font-size: .7rem; color: #7a9596;
}
.pub5-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pub5-meta svg { width: 12px; height: 12px; }

/* --- share action row --- */
.pub5-share {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid #e4eeec; background: rgba(238,244,246,.45);
}
.pub5-share-label {
  font-family: var(--head); font-size: .62rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #329879; margin: 0 6px 0 4px;
}
.pub5-sbtn {
  position: relative; width: 34px; height: 34px; min-width: 34px; flex: 0 0 34px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 10px; border: 1px solid #d8e6e4; background: #fff;
  color: #35545a; transition: .15s; padding: 0; text-decoration: none;
}
.pub5-sbtn svg { width: 16px; height: 16px; }
.pub5-sbtn:hover { color: #1f7a5f; border-color: rgba(48,241,182,.6); background: rgba(48,241,182,.1); transform: translateY(-1px); }
.pub5-sbtn:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
.pub5-sbtn.copy { width: auto; padding: 0 12px; gap: 6px; font: 700 .72rem var(--head); flex-basis: auto; }
.pub5-sbtn.copy svg { width: 13px; height: 13px; }
@media (max-width: 640px) {
  .pub5-sbtn { width: 40px; height: 40px; min-width: 40px; flex-basis: 40px; }
  .pub5-sbtn.copy { flex-basis: auto; height: 40px; }
}

/* --- toast --- */
.tab5-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #eafff8; font: 600 .78rem var(--head);
  border-radius: 999px; padding: 10px 18px; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 10px 30px -8px rgba(2,23,29,.5); opacity: 0; pointer-events: none;
  transition: .22s; z-index: 60;
}
.tab5-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tab5-toast svg { width: 13px; height: 13px; max-width: 13px; max-height: 13px; color: var(--mint); }

/* ============================================================
   .vid-*  — Academy reusable framed video block. Append-ready.
   16:9 rounded glass frame; kicker + title above, caption below.
   Variant A: live iframe (youtube-nocookie). Variant B: poster
   with play overlay (swap to iframe on click).
   ============================================================ */
.vid-block { margin: 30px 0; max-width: 760px; }
.vid-kicker {
  font-family: var(--head); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .14em; font-weight: 700; color: var(--mint-dark);
}
.vid-kicker::before {
  content: ""; display: inline-block; width: 22px; height: 2px; background: var(--mint);
  vertical-align: middle; margin-right: 8px; border-radius: 2px;
}
.vid-title { font-family: var(--head); font-size: 1.18rem; letter-spacing: -0.01em; margin: 8px 0 14px; }
.vid-title em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--mint-dark); }

.vid-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  background: linear-gradient(135deg, rgba(2,23,29,.92), rgba(2,23,29,.98));
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 1px 2px rgba(2,23,29,.06), 0 12px 32px -10px rgba(2,23,29,.14), 0 32px 80px -24px rgba(2,23,29,.16);
}
.vid-frame::after { /* subtle glass rim */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(48,241,182,.18), inset 0 1px 0 rgba(255,255,255,.14);
}
.vid-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* --- poster variant --- */
.vid-poster {
  position: absolute; inset: 0; width: 100%; padding: 0; cursor: pointer; border: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(560px 320px at 20% 0%, rgba(48,241,182,.22), transparent 60%),
    radial-gradient(520px 360px at 100% 100%, rgba(50,152,121,.28), transparent 55%),
    var(--ink);
  color: #c8dedd;
}
.vid-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vid-play {
  position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; background: var(--mint); color: var(--ink);
  box-shadow: 0 8px 28px -6px rgba(48,241,182,.7), 0 0 0 8px rgba(48,241,182,.18);
  transition: .18s;
}
.vid-play svg { width: 22px; height: 22px; margin-left: 3px; }
.vid-poster:hover .vid-play, .vid-poster:focus-visible .vid-play { transform: scale(1.07); box-shadow: 0 10px 34px -6px rgba(48,241,182,.85), 0 0 0 10px rgba(48,241,182,.24); }
.vid-poster:focus-visible { outline: 2px solid var(--mint); outline-offset: -4px; border-radius: 18px; }
.vid-poster-label {
  position: absolute; left: 18px; bottom: 14px; z-index: 1;
  font: 700 .72rem var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--mint);
}
.vid-duration {
  position: absolute; right: 14px; bottom: 12px; z-index: 1;
  font: 600 .7rem var(--head); color: #eafff8; background: rgba(2,23,29,.72);
  border: 1px solid rgba(48,241,182,.3); border-radius: 999px; padding: 4px 10px;
}

.vid-caption { display: flex; gap: 8px; align-items: flex-start; font-size: .78rem; color: var(--muted); line-height: 1.55; margin: 12px 2px 0; }
.vid-caption svg { width: 14px; height: 14px; max-width: 14px; max-height: 14px; flex: 0 0 auto; margin-top: 1px; color: #329879; }

@media (max-width: 640px) {
  .vid-block { margin: 22px 0; }
  .vid-frame { border-radius: 14px; }
  .vid-play { width: 56px; height: 56px; }
}

/* ============================================================
   .pt-*  — GEMS XL ACADEMY payout tables (append-ready)
   Table 1: campaign reward program → Commissions & Tiers page
   Table 2: exact payout distribution → Verification & Reward Pools page
   ============================================================ */

.pt-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.84));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.9); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(2,23,29,.06), 0 12px 32px -10px rgba(2,23,29,.14), 0 32px 80px -24px rgba(2,23,29,.16);
  overflow: hidden; margin: 30px 0 34px;
}
.pt-head { padding: 26px 28px 6px; }
.pt-kicker {
  font-family: 'Space Grotesk', sans-serif; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .16em; color: #329879; margin: 0 0 10px;
}
.pt-kicker::before {
  content: ""; display: inline-block; width: 22px; height: 2px;
  background: #30f1b6; vertical-align: middle; margin-right: 8px; border-radius: 2px;
}
.pt-head h2 {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.45rem; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 6px; color: #02171d;
}
.pt-head h2 em {
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; color: #329879;
}
.pt-intro { font-size: .92rem; line-height: 1.6; color: #4d6a6b; margin: 0 0 10px; max-width: 62ch; }

/* --- framed table --- */
.pt-tablewrap { padding: 10px 28px 28px; }
.pt-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid #d8e6e4; border-radius: 14px; overflow: hidden;
  background: rgba(255,255,255,.7);
  font-size: .9rem;
}
.pt-table th {
  font-family: 'Space Grotesk', sans-serif; font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .13em; text-align: left;
  color: #7fd7bd; background: #02171d; padding: 13px 18px; white-space: nowrap;
}
.pt-table td {
  padding: 15px 18px; border-top: 1px solid #e4eeec; vertical-align: middle;
  color: #02171d; line-height: 1.5;
}
.pt-table tbody tr:hover td { background: rgba(48,241,182,.07); }
.pt-num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.pt-table .pt-c { text-align: left; }

/* pool name cell with icon tile */
.pt-pool { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pt-pool-tile {
  width: 30px; height: 30px; min-width: 30px; flex: 0 0 30px; border-radius: 9px;
  background: linear-gradient(135deg, rgba(48,241,182,.22), rgba(50,152,121,.16));
  border: 1px solid rgba(48,241,182,.45); color: #329879;
  display: inline-flex; align-items: center; justify-content: center;
}
.pt-pool-tile svg { width: 16px; height: 16px; display: block; }
.pt-pool-tile.pt-amber {
  background: linear-gradient(135deg, rgba(232,143,53,.18), rgba(232,143,53,.1));
  border-color: rgba(232,143,53,.4); color: #b06a24;
}
.pt-pool-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: #02171d; }
.pt-pool-name b { color: #329879; font-weight: 700; }

/* winners chip */
.pt-chip {
  display: inline-block; font-family: 'Space Grotesk', sans-serif; font-size: .68rem;
  font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  color: #329879; background: rgba(48,241,182,.14); border: 1px solid rgba(48,241,182,.4);
  border-radius: 999px; padding: 5px 12px;
}

/* column sizing (desktop) */
.pt-table--dist th:first-child { width: 28%; }
.pt-table--dist th:not(:first-child) { width: 24%; }

/* rank cell (table 2) */
.pt-rank { font-family: 'Space Grotesk', sans-serif; font-weight: 700; white-space: nowrap; }
.pt-rank small { display: block; font-family: 'Inter', sans-serif; font-weight: 500; font-size: .72rem; color: #4d6a6b; letter-spacing: 0; }
.pt-table tbody tr.pt-top1 td { background: rgba(48,241,182,.1); }
.pt-table tbody tr.pt-top1:hover td { background: rgba(48,241,182,.14); }
.pt-top1 .pt-rank { color: #329879; }

/* footer / totals row */
.pt-table tfoot td {
  background: rgba(238,244,246,.9); border-top: 2px solid #30f1b6;
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: #02171d;
}
.pt-table tfoot .pt-num { color: #329879; font-size: .98rem; }

/* footnote strip */
.pt-note {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 14px 2px 0; font-size: .78rem; line-height: 1.55; color: #4d6a6b;
}
.pt-note svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; color: #e88f35; }

/* ---------- responsive: 768 tighten, 390 stacked cards ---------- */
@media (max-width: 860px) {
  .pt-head { padding: 22px 20px 4px; }
  .pt-tablewrap { padding: 8px 20px 22px; }
  .pt-table th, .pt-table td { padding: 12px 14px; }
}

@media (max-width: 640px) {
  .pt-table, .pt-table thead, .pt-table tbody, .pt-table tfoot,
  .pt-table tr, .pt-table th, .pt-table td { display: block; }
  .pt-table thead { position: absolute; clip: rect(0 0 0 0); height: 1px; width: 1px; overflow: hidden; }
  .pt-table { border: 0; background: transparent; overflow: visible; }
  .pt-table tr {
    border: 1px solid #d8e6e4; border-radius: 14px; overflow: hidden;
    background: rgba(255,255,255,.85); margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(2,23,29,.05), 0 10px 30px -12px rgba(2,23,29,.12);
  }
  .pt-table td { border-top: 0; border-bottom: 1px solid #eef4f6; padding: 11px 16px; }
  .pt-table td:last-child { border-bottom: 0; }
  .pt-table td[data-l]::before {
    content: attr(data-l); display: block;
    font-family: 'Space Grotesk', sans-serif; font-size: .62rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .13em; color: #329879; margin-bottom: 3px;
  }
  .pt-table tbody tr:hover td { background: transparent; }
  .pt-table tfoot tr { border-color: rgba(48,241,182,.55); }
  .pt-table tfoot td { border-top: 0; background: transparent; }
  .pt-table tfoot td:first-child { background: rgba(48,241,182,.12); }
  .pt-rank small { display: inline; margin-left: 6px; }

  /* Leaderboard table — same stacked-card mechanism as .pt-table (data-l labels via
   * ::before), fixes horizontal overflow that was dragging the whole mobile page sideways. */
  .lb-table, .lb-table thead, .lb-table tbody, .lb-table tr, .lb-table th, .lb-table td { display: block; }
  .lb-table thead { position: absolute; clip: rect(0 0 0 0); height: 1px; width: 1px; overflow: hidden; }
  .lb-table { border: 0; background: transparent; overflow: visible; width: 100%; }
  .lb-table tr {
    border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
    background: var(--panel); margin-bottom: 10px; box-shadow: var(--shadow);
  }
  .lb-table td { border-top: 0; border-bottom: 1px solid #eef4f6; padding: 10px 14px; }
  .lb-table td:last-child { border-bottom: 0; }
  .lb-table td[data-l]::before {
    content: attr(data-l); display: block;
    font-family: 'Space Grotesk', sans-serif; font-size: .6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .1em; color: #329879; margin-bottom: 3px;
  }
  .lb-table td.lb-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: rgba(48,241,182,.08); }
  .lb-table td.lb-head::before { display: none; }
  .lb-table .lb-rank { font-weight: 800; font-size: 1rem; min-width: 22px; }
  .lb-table .lb-name { font-weight: 700; flex: 1; }
}

/* ============================================================
   .mnav-*  — GEMS XL ACADEMY mobile navigation v1 (append-ready)
   Sticky top app bar + step tab strip + fixed bottom nav.

   ⚠️ DESKTOP UNAFFECTED — everything below lives inside
   @media (max-width: 768px), except this comment block.
   Above 768px the three .mnav- containers are display:none
   via the base rules right here (also safe: they render
   nothing on desktop, sidebar layout stays exactly as-is).
   No shared token overrides — all colors are the existing
   brand tokens (mint #30f1b6, dark mint #329879, ink #02171d,
   bg #eef4f6, coral #fc4f52, amber #e88f35).
   ============================================================ */

/* Hidden on desktop by default — the mobile media query turns them on. */
.mnav-appbar, .mnav-tabs, .mnav-bottom { display: none; }

@media (max-width: 768px) {

  /* On mobile the desktop sidebar goes away; content owns the column. */
  body.mnav-on aside { display: none; }
  body.mnav-on main {
    padding: 18px 18px 96px;             /* room for fixed bottom nav */
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    max-width: none;
  }

  /* ---------- 1. Sticky top app bar ---------- */
  .mnav-appbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background:
      radial-gradient(420px 200px at 90% -40%, rgba(48,241,182,.25), transparent 60%),
      #02171d;
    color: #fff;
    border-bottom: 1px solid rgba(48,241,182,.2);
  }
  .mnav-logo {
    width: 30px; height: 30px; min-width: 30px; border-radius: 9px;
    background: linear-gradient(135deg, #30f1b6, #329879);
    color: #02171d; display: inline-flex; align-items: center; justify-content: center;
    font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: .8rem;
  }
  .mnav-title {
    flex: 1; min-width: 0;
    font-family: 'Space Grotesk', sans-serif; font-weight: 700;
    font-size: .92rem; letter-spacing: -0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mnav-title small {
    display: block; font-family: 'Space Grotesk', sans-serif;
    font-size: .58rem; font-weight: 700; letter-spacing: .16em;
    text-transform: uppercase; color: #30f1b6;
  }
  .mnav-progress {
    font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: .72rem;
    color: #30f1b6; background: rgba(48,241,182,.12);
    border: 1px solid rgba(48,241,182,.4); border-radius: 999px;
    padding: 5px 11px; white-space: nowrap;
  }

  /* ---------- 2. Step tab strip (sticky under app bar) ---------- */
  .mnav-tabs {
    position: sticky; z-index: 39;
    top: var(--mnav-appbar-h, calc(50px + env(safe-area-inset-top, 0px))); /* set by JS to actual app-bar height */
    display: flex; gap: 8px; align-items: stretch;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 14px;
    background: rgba(238,244,246,.92);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid #d8e6e4;
  }
  .mnav-tabs::-webkit-scrollbar { display: none; }
  .mnav-tab {
    appearance: none; -webkit-appearance: none;
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 40px; padding: 8px 14px; flex: 0 0 auto;
    border-radius: 999px; cursor: pointer;
    border: 1px solid #d8e6e4; background: #fff; color: #02171d;
    font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: .78rem;
    white-space: nowrap;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
  }
  .mnav-tab .mnav-num {
    width: 20px; height: 20px; min-width: 20px; border-radius: 50%;
    border: 1.5px solid #329879; color: #329879;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .62rem; font-weight: 700;
  }
  .mnav-tab[aria-selected="true"] {
    background: #02171d; color: #fff; border-color: #02171d;
    box-shadow: 0 6px 16px -6px rgba(2,23,29,.45);
  }
  .mnav-tab[aria-selected="true"] .mnav-num { border-color: #30f1b6; color: #30f1b6; }
  .mnav-tab.done .mnav-num {
    background: #30f1b6; border-color: #30f1b6; color: #02171d;
  }
  .mnav-tab.done .mnav-num svg { width: 11px; height: 11px; display: block; }
  .mnav-tab.locked { color: #93aeae; }
  .mnav-tab.locked .mnav-num { border-color: #b9cdcc; color: #93aeae; }
  .mnav-tab:focus-visible { outline: 2px solid #329879; outline-offset: 2px; }

  /* ---------- 3. Content: single visible section + soft transition ---------- */
  .mnav-page { display: none; }
  .mnav-page.active {
    display: block;
    animation: mnavIn .15s ease both;
  }
  @keyframes mnavIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }

  /* ---------- 4. Fixed bottom navigation ---------- */
  .mnav-bottom {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(var(--mnav-bitem-count, 5), 1fr); /* set from item count in markup — was hardcoded to 5, wrapped to 2 rows once the 6th "Code" item was added */
    background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid #d8e6e4;
    padding: 6px 4px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 28px -14px rgba(2,23,29,.25);
  }
  .mnav-bitem {
    appearance: none; -webkit-appearance: none;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    min-height: 48px; padding: 6px 2px;
    background: none; border: 0; border-radius: 12px; cursor: pointer;
    font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: .6rem;
    letter-spacing: .02em; color: #4d6a6b;
    transition: color .15s ease, background .15s ease;
  }
  .mnav-bitem svg { width: 18px; height: 18px; display: block; }
  .mnav-bitem .mnav-blabel { display: block; white-space: nowrap; }
  .mnav-bitem[aria-current="page"] {
    color: #329879; background: rgba(48,241,182,.14);
  }
  .mnav-bitem[aria-current="page"] svg { color: #329879; }
  .mnav-bitem:focus-visible { outline: 2px solid #329879; outline-offset: -2px; }

  /* payout tables get horizontal scroll room inside narrow column */
  .pt-tablewrap { padding: 10px 14px 20px; overflow-x: auto; }
  .pt-head { padding: 20px 16px 4px; }
}

/* ---------- Motion safety (harmless at any width) ---------- */
@media (prefers-reduced-motion: reduce) {
  .mnav-page.active { animation: none; }
  .mnav-tab, .mnav-bitem { transition: none; }
}

/* ============================================================
   .vid-*  — Guides page: reusable framed video block (native <video>)
   16:9 rounded glass frame; kicker + title above, caption below.
   Poster overlay swaps in a real <video controls> on click.
   ============================================================ */
.vid-block { margin: 30px 0; max-width: 760px; }
.vid-kicker {
  font-family: var(--head); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .14em; font-weight: 700; color: var(--mint-dark);
}
.vid-kicker::before {
  content: ""; display: inline-block; width: 22px; height: 2px; background: var(--mint);
  vertical-align: middle; margin-right: 8px; border-radius: 2px;
}
.vid-title { font-family: var(--head); font-size: 1.18rem; letter-spacing: -0.01em; margin: 8px 0 14px; }
.vid-title em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--mint-dark); }

.vid-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  background: linear-gradient(135deg, rgba(2,23,29,.92), rgba(2,23,29,.98));
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 1px 2px rgba(2,23,29,.06), 0 12px 32px -10px rgba(2,23,29,.14), 0 32px 80px -24px rgba(2,23,29,.16);
}
.vid-frame::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(48,241,182,.18), inset 0 1px 0 rgba(255,255,255,.14);
}
.vid-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: contain; background: #000; }
.vid-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

.vid-poster {
  position: absolute; inset: 0; width: 100%; padding: 0; cursor: pointer; border: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(560px 320px at 20% 0%, rgba(48,241,182,.22), transparent 60%),
    radial-gradient(520px 360px at 100% 100%, rgba(50,152,121,.28), transparent 55%),
    var(--ink);
  color: #c8dedd;
}
.vid-play {
  position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; background: var(--mint); color: var(--ink);
  box-shadow: 0 8px 28px -6px rgba(48,241,182,.7), 0 0 0 8px rgba(48,241,182,.18);
  transition: .18s;
}
.vid-play svg { width: 22px; height: 22px; margin-left: 3px; }
.vid-poster:hover .vid-play, .vid-poster:focus-visible .vid-play { transform: scale(1.07); box-shadow: 0 10px 34px -6px rgba(48,241,182,.85), 0 0 0 10px rgba(48,241,182,.24); }
.vid-poster:focus-visible { outline: 2px solid var(--mint); outline-offset: -4px; border-radius: 18px; }
.vid-poster-label {
  position: absolute; left: 18px; bottom: 14px; z-index: 1;
  font: 700 .72rem var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--mint);
}
.vid-duration {
  position: absolute; right: 14px; bottom: 12px; z-index: 1;
  font: 600 .7rem var(--head); color: #eafff8; background: rgba(2,23,29,.72);
  border: 1px solid rgba(48,241,182,.3); border-radius: 999px; padding: 4px 10px;
}
.vid-caption { display: flex; gap: 8px; align-items: flex-start; font-size: .78rem; color: var(--muted); line-height: 1.55; margin: 12px 2px 0; }
.vid-caption svg { width: 14px; height: 14px; max-width: 14px; max-height: 14px; flex: 0 0 auto; margin-top: 1px; color: #329879; }
.vid-steps { margin: 8px 0 0; padding-left: 0; list-style: none; font-size: .84rem; color: #35545a; line-height: 1.6; }
.vid-steps li { margin-bottom: 4px; }

@media (max-width: 640px) {
  .vid-block { margin: 22px 0; }
  .vid-frame { border-radius: 14px; }
  .vid-play { width: 56px; height: 56px; }
}
