/* ======================================================================
   Site layer: landing, dashboard, curriculum, leaderboard.
   The Blender-style editor ("Studio") keeps its own dark theme in style.css.
   ====================================================================== */
:root {
  --s-bg: #f5f7fb;
  --s-card: #ffffff;
  --s-sunken: #eef2f8;
  --s-text: #172033;
  --s-muted: #5a6478;
  --s-faint: #8a93a6;
  --s-line: #e2e7f0;
  --s-brand: #3d6fd8;
  --s-brand-ink: #2c56b3;
  --s-brand-soft: #e7eefc;
  --s-chart: #3d6fd8;
  --s-good: #1d8a4e;
  --s-good-soft: #e3f4ea;
  --s-gold: #c98a00;
  --s-gold-soft: #fdf3d9;
  --s-shadow: 0 1px 2px rgba(23, 32, 51, .06), 0 4px 16px rgba(23, 32, 51, .06);
  --s-radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --s-bg: #12151c;
    --s-card: #1b1f29;
    --s-sunken: #232836;
    --s-text: #e8ebf2;
    --s-muted: #a3abbc;
    --s-faint: #7a8396;
    --s-line: #2c3242;
    --s-brand: #6b95e6;
    --s-brand-ink: #8fb0ee;
    --s-brand-soft: #1f2a44;
    --s-chart: #5f8ae0;
    --s-good: #5cc489;
    --s-good-soft: #17301f;
    --s-gold: #f0b93a;
    --s-gold-soft: #33290f;
    --s-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

/* ---------- mode switching ---------- */
.site-nav, .studio-back { display: none; }
body.site-mode { grid-template-rows: 60px 1fr; background: var(--s-bg); color: var(--s-text); user-select: text; overflow: hidden; }
body.site-mode #app, body.site-mode #statusbar { display: none; }
body.site-mode #site { display: block; }
body.site-mode .menubar, body.site-mode .ws-tabs { display: none; }
body.studio-mode .studio-back { display: inline-flex; }

/* ---------- header ---------- */
body.site-mode #topbar { background: var(--s-card); border-bottom: 1px solid var(--s-line); padding: 0 24px; gap: 28px; color: var(--s-text); }
body.site-mode .logo { font-size: 18px; color: var(--s-text); }
body.site-mode .logo svg { width: 26px; height: 26px; }
.logo { color: inherit; text-decoration: none; }
body.site-mode .site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--s-muted); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover { color: var(--s-text); background: var(--s-sunken); }
.site-nav a.active { color: var(--s-brand-ink); background: var(--s-brand-soft); }
.site-nav .nav-studio { color: var(--s-brand-ink); }
body.site-mode #progress-badge { margin-left: auto; color: var(--s-muted); font-size: 13px; cursor: pointer; }
body.site-mode .pb-bar { background: var(--s-sunken); }
body.site-mode .hud-lv { background: var(--s-brand); }
body.site-mode .acc-local { color: var(--s-muted); background: var(--s-sunken); padding: 4px 10px; font-size: 12.5px; }
body.site-mode .acc-user { color: var(--s-text); background: var(--s-sunken); }
.studio-back { align-items: center; color: #cfd8ea; text-decoration: none; font-size: 12px; padding: 3px 9px; border-radius: var(--radius); background: #3a3f4b; white-space: nowrap; }
.studio-back:hover { background: #4a5163; color: #fff; }

/* ---------- page frame ---------- */
#site { overflow-y: auto; min-height: 0; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
#site *:focus-visible { outline: 2px solid var(--s-brand); outline-offset: 2px; }
.s-wrap { max-width: 1160px; margin: 0 auto; padding: 32px 24px 56px; }
.s-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.s-page-head h1 { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -.01em; }
.s-page-head p { margin: 4px 0 0; color: var(--s-muted); }
.s-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--s-brand-ink); }
.s-muted { color: var(--s-muted); }
.s-small { font-size: 13px; }
.s-card { background: var(--s-card); border: 1px solid var(--s-line); border-radius: var(--s-radius); box-shadow: var(--s-shadow); padding: 20px; }
.s-card h2 { margin: 0 0 14px; font-size: 17px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.s-card h2 a, .s-link { font-size: 13px; font-weight: 600; color: var(--s-brand-ink); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; }
.s-card h2 a:hover, .s-link:hover { text-decoration: underline; }
.s-grid { display: grid; gap: 20px; }
.s-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 15px; line-height: 1; font-family: inherit; padding: 12px 20px; border-radius: 10px; border: 1px solid var(--s-line); background: var(--s-card); color: var(--s-text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.s-btn:hover { background: var(--s-sunken); }
.s-btn.primary { background: var(--s-brand); border-color: var(--s-brand); color: #fff; }
.s-btn.primary:hover { filter: brightness(1.07); }
.s-btn.small { padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.s-btn[disabled] { opacity: .5; cursor: not-allowed; }
.s-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--s-sunken); color: var(--s-muted); white-space: nowrap; }
.s-chip.good { background: var(--s-good-soft); color: var(--s-good); }
.s-chip.brand { background: var(--s-brand-soft); color: var(--s-brand-ink); }
.s-chip.gold { background: var(--s-gold-soft); color: var(--s-gold); }
.s-bar { height: 8px; background: var(--s-sunken); border-radius: 999px; overflow: hidden; }
.s-bar > span { display: block; height: 100%; background: var(--s-brand); border-radius: 999px; transition: width .5s; }
.s-bar.good > span { background: var(--s-good); }
.s-stars { color: var(--s-gold); letter-spacing: 1px; white-space: nowrap; }
.s-stars .off { color: var(--s-line); }
.s-footer { border-top: 1px solid var(--s-line); margin-top: 48px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; color: var(--s-faint); font-size: 13px; }
.s-footer nav { display: flex; gap: 16px; }
.s-footer a { color: var(--s-muted); }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 40px 0 24px; }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.05; letter-spacing: -.025em; margin: 12px 0 16px; }
.hero h1 em { font-style: normal; color: var(--s-brand); }
.hero .lead { font-size: 18px; color: var(--s-muted); max-width: 34em; margin: 0 0 24px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .fine { margin-top: 14px; font-size: 13px; color: var(--s-faint); }
.hero-art { position: relative; aspect-ratio: 1 / .85; border-radius: 24px; background: radial-gradient(120% 90% at 30% 20%, var(--s-brand-soft), transparent 70%), var(--s-card); border: 1px solid var(--s-line); box-shadow: var(--s-shadow); overflow: hidden; }
.hero-art svg { position: absolute; inset: 8% 8% 18%; width: 84%; height: 74%; }
.hero-art .float { position: absolute; background: var(--s-card); border: 1px solid var(--s-line); border-radius: 12px; box-shadow: var(--s-shadow); padding: 10px 14px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.hero-art .f1 { left: 6%; bottom: 8%; }
.hero-art .f2 { right: 6%; top: 8%; }
.hero-art .f3 { right: 8%; bottom: 22%; }
.hero-art .f1 b { color: var(--s-good); }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 32px 0 56px; }
.stat-strip div { text-align: center; padding: 18px; border-radius: var(--s-radius); background: var(--s-card); border: 1px solid var(--s-line); }
.stat-strip b { display: block; font-size: 30px; letter-spacing: -.02em; }
.stat-strip span { color: var(--s-muted); font-size: 14px; }
.l-section { margin: 0 0 64px; }
.l-section > h2 { font-size: 28px; letter-spacing: -.015em; margin: 6px 0 8px; }
.l-section > p.s-muted { margin: 0 0 24px; max-width: 42em; }
.how { grid-template-columns: repeat(3, 1fr); }
.how .s-card .num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--s-brand-soft); color: var(--s-brand-ink); font-weight: 800; margin-bottom: 12px; }
.how h3, .feat h3 { margin: 0 0 6px; font-size: 17px; }
.how p, .feat p { margin: 0; color: var(--s-muted); font-size: 14px; }
.phase-preview { grid-template-columns: repeat(5, 1fr); }
.phase-preview .s-card { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.phase-preview .pn { font-size: 12px; font-weight: 700; color: var(--s-brand-ink); }
.phase-preview h3 { margin: 0; font-size: 15px; }
.phase-preview p { margin: 0; font-size: 13px; color: var(--s-muted); flex: 1; }
.feat { grid-template-columns: repeat(4, 1fr); }
.feat .ic { font-size: 26px; margin-bottom: 8px; }
.cta-band { text-align: center; padding: 40px 24px; border-radius: 24px; background: var(--s-brand); color: #fff; }
.cta-band h2 { margin: 0 0 8px; font-size: 28px; }
.cta-band p { margin: 0 0 20px; opacity: .9; }
.cta-band .s-btn { background: #fff; color: #1f3f86; border-color: #fff; }

/* ---------- dashboard ---------- */
.dash-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.dash-main, .dash-side { display: grid; gap: 20px; min-width: 0; }
.continue { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; background: linear-gradient(135deg, var(--s-brand) 0%, #2c4f9e 100%); color: #fff; border: 0; }
.continue .s-eyebrow { color: rgba(255, 255, 255, .8); }
.continue h2 { color: #fff; font-size: 22px; margin: 6px 0 6px; display: block; }
.continue p { margin: 0 0 12px; opacity: .9; }
.continue .meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; opacity: .9; }
.continue .s-btn { background: #fff; color: #1f3f86; border-color: #fff; }
.continue .s-bar { background: rgba(255, 255, 255, .25); margin-top: 14px; max-width: 360px; }
.continue .s-bar > span { background: #fff; }
.tiles { grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile { padding: 16px; }
.tile .k { font-size: 13px; color: var(--s-muted); display: flex; align-items: center; gap: 6px; }
.tile .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12.5px; color: var(--s-faint); }
.tile .s-bar { margin-top: 8px; height: 6px; }
.week-dots { display: flex; gap: 4px; margin-top: 8px; }
.week-dots i { width: 14px; height: 14px; border-radius: 4px; background: var(--s-sunken); }
.week-dots i.on { background: var(--s-good); }
/* activity chart (single series → no legend; title names it) */
.chart { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 160px; padding: 8px 0 0; border-bottom: 1px solid var(--s-line); background-image: linear-gradient(var(--s-line) 1px, transparent 1px); background-size: 100% 50%; background-position: 0 8px; }
.chart .col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; }
.chart .col:hover { background: color-mix(in srgb, var(--s-brand) 6%, transparent); border-radius: 6px 6px 0 0; }
.chart .barv { width: min(28px, 70%); background: var(--s-chart); border-radius: 4px 4px 0 0; min-height: 0; }
.chart .barv.zero { height: 2px !important; background: var(--s-line); border-radius: 0; }
.chart .val { font-size: 12px; font-weight: 700; color: var(--s-text); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.chart .tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--s-text); color: var(--s-card); font-size: 12px; padding: 5px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 2; }
.chart .col:hover .tip { opacity: 1; }
.chart .col:first-child .tip { left: 0; transform: none; }
.chart .col:last-child .tip { left: auto; right: 0; transform: none; }
.chart-x { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; text-align: center; font-size: 12px; color: var(--s-muted); margin-top: 6px; }
.chart-x .today { color: var(--s-text); font-weight: 700; }
.chart-sum { display: flex; gap: 24px; margin-bottom: 14px; }
.chart-sum b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.chart-sum span { font-size: 12.5px; color: var(--s-muted); }
.phase-rows { display: grid; gap: 4px; }
.phase-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 140px auto; gap: 14px; align-items: center; padding: 10px 4px; border-radius: 10px; }
.phase-row:hover { background: var(--s-sunken); }
.phase-row .pnum { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--s-brand-soft); color: var(--s-brand-ink); }
.phase-row.complete .pnum { background: var(--s-good-soft); color: var(--s-good); }
.phase-row .pt { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phase-row .ps { font-size: 12.5px; color: var(--s-muted); }
.phase-row .s-bar { height: 6px; }
.mini-rank { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-rank td { padding: 7px 4px; border-bottom: 1px solid var(--s-line); }
.mini-rank tr:last-child td { border-bottom: 0; }
.mini-rank .r { width: 30px; color: var(--s-muted); font-weight: 700; }
.mini-rank .x { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.mini-rank tr.me td { background: var(--s-brand-soft); }
.mini-rank tr.me td:first-child { border-radius: 8px 0 0 8px; }
.mini-rank tr.me td:last-child { border-radius: 0 8px 8px 0; }
.badge-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.badge-grid .b { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--s-sunken); filter: grayscale(1); opacity: .35; }
.badge-grid .b.on { filter: none; opacity: 1; background: var(--s-gold-soft); }
.cert-list { display: grid; gap: 8px; }
.cert-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--s-line); border-radius: 10px; }
.cert-item .ic { font-size: 22px; }
.cert-item .grow { flex: 1; min-width: 0; }
.cert-item.locked { opacity: .6; }
.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-card .av { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; background: var(--s-brand); flex: none; }
.profile-card input { font-weight: 700; font-size: 18px; font-family: inherit; color: var(--s-text); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -6px; width: 100%; }
.profile-card input:hover, .profile-card input:focus { border-color: var(--s-line); background: var(--s-sunken); outline: none; }
.signin-card { border-color: var(--s-brand); background: var(--s-brand-soft); }
.signin-card p { margin: 0 0 12px; color: var(--s-muted); font-size: 14px; }

/* ---------- curriculum ---------- */
.overall { display: flex; align-items: center; gap: 16px; min-width: 280px; }
.overall .s-bar { flex: 1; }
.cur-phase { margin-bottom: 36px; }
.cur-phase-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; margin-bottom: 14px; }
.cur-phase-head .pnum { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: var(--s-brand-soft); color: var(--s-brand-ink); }
.cur-phase-head h2 { margin: 0; font-size: 20px; }
.cur-phase-head p { margin: 2px 0 0; color: var(--s-muted); font-size: 14px; }
.cur-phase-head .right { text-align: right; font-size: 13px; color: var(--s-muted); min-width: 160px; }
.cur-phase-head .right .s-bar { margin-top: 6px; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.l-card { text-align: left; font: inherit; color: inherit; background: var(--s-card); border: 1px solid var(--s-line); border-radius: 12px; padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--s-shadow); transition: transform .12s, border-color .12s; }
.l-card:hover { transform: translateY(-2px); border-color: var(--s-brand); }
.l-card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.l-card .no { font-size: 12px; font-weight: 700; color: var(--s-faint); }
.l-card h3 { margin: 0; font-size: 15.5px; line-height: 1.3; }
.l-card p { margin: 0; font-size: 13px; color: var(--s-muted); flex: 1; }
.l-card .meta { display: flex; gap: 12px; font-size: 12px; color: var(--s-faint); flex-wrap: wrap; }
.l-card.done { border-color: color-mix(in srgb, var(--s-good) 45%, var(--s-line)); }
.l-card.test { background: var(--s-sunken); box-shadow: none; border-style: dashed; }
.l-card.test[disabled] { cursor: not-allowed; transform: none; border-color: var(--s-line); }
.exam-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; border: 2px solid var(--s-gold); }
.exam-card h2 { display: block; font-size: 20px; }
.reqs-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: 14px; }
.reqs-list li::before { content: '○'; margin-right: 8px; color: var(--s-faint); }
.reqs-list li.ok::before { content: '✓'; color: var(--s-good); font-weight: 800; }
.exam-actions { display: grid; gap: 8px; min-width: 220px; }

/* ---------- leaderboard ---------- */
.seg-tabs { display: inline-flex; padding: 4px; background: var(--s-sunken); border-radius: 10px; gap: 2px; }
.seg-tabs button { font-weight: 600; font-size: 14px; font-family: inherit; border: 0; background: none; color: var(--s-muted); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.seg-tabs button.active { background: var(--s-card); color: var(--s-text); box-shadow: var(--s-shadow); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; margin-bottom: 20px; }
.podium .p { text-align: center; padding: 20px 12px; }
.podium .p.first { padding-top: 32px; border: 2px solid var(--s-gold); }
.podium .medal { font-size: 34px; }
.podium .name { font-weight: 800; font-size: 17px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .xp { font-size: 22px; font-weight: 800; color: var(--s-brand-ink); font-variant-numeric: tabular-nums; }
.podium .podium-empty { color: var(--s-faint); font-size: 14px; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.lb-table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--s-faint); padding: 10px 12px; border-bottom: 1px solid var(--s-line); }
.lb-table td { padding: 12px; border-bottom: 1px solid var(--s-line); }
.lb-table tr:last-child td { border-bottom: 0; }
.lb-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.lb-table .rank { width: 56px; font-weight: 800; color: var(--s-muted); font-size: 18px; }
.lb-table tr.me td { background: var(--s-brand-soft); }
.lb-table .who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.lb-table .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: var(--s-brand); flex: none; }
.lb-scroll { overflow-x: auto; }
.lb-note { margin-top: 12px; font-size: 13px; color: var(--s-muted); }
.lb-empty { text-align: center; padding: 32px 16px; color: var(--s-muted); }
.lb-empty .big { font-size: 36px; }
.your-rank { display: flex; align-items: center; gap: 16px; }
.your-rank .big { font-size: 34px; font-weight: 800; color: var(--s-brand-ink); font-variant-numeric: tabular-nums; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .dash-grid { grid-template-columns: 1fr; }
  .phase-preview { grid-template-columns: repeat(2, 1fr); }
  .feat, .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body.site-mode #topbar { padding: 0 16px; gap: 12px; height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  body.site-mode { grid-template-rows: auto 1fr; }
  body.site-mode .site-nav { order: 3; width: 100%; overflow-x: auto; }
  body.site-mode .site-nav .nav-studio { display: none; }
  body.site-mode #progress-badge .pb-bar, body.site-mode #progress-badge .hud-title, body.site-mode #progress-badge > span:nth-last-child(-n+2) { display: none; }
  .s-wrap { padding: 20px 16px 40px; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 12px; }
  .stat-strip, .how, .phase-preview, .feat { grid-template-columns: 1fr 1fr; }
  .how { grid-template-columns: 1fr; }
  .continue, .exam-card { grid-template-columns: 1fr; }
  .phase-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .phase-row .s-bar { display: none; }
  .cur-phase-head { grid-template-columns: auto 1fr; }
  .cur-phase-head .right { grid-column: 1 / -1; text-align: left; }
  .podium { grid-template-columns: 1fr; }
  .lb-table .hide-sm { display: none; }
}
body.site-mode #progress-badge:hover { background: var(--s-sunken); }
body.site-mode .hud-title { color: var(--s-gold); }
.env-ribbon { position: fixed; left: 50%; transform: translateX(-50%); bottom: 4px; z-index: 50; background: #d9480f; color: #fff; font: 800 10px/1 system-ui, sans-serif; letter-spacing: .12em; padding: 3px 8px; border-radius: 5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); pointer-events: auto; cursor: help; }

/* ---------- community ---------- */
.c-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.c-main, .c-side { display: grid; gap: 16px; min-width: 0; }
.c-filters { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.c-list { display: grid; gap: 16px; }
.c-post { display: grid; gap: 10px; }
.c-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.c-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.c-author .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--s-brand); flex: none; }
.c-author .name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; font-size: 14.5px; }
.c-author .name a { color: var(--s-text); text-decoration: none; }
.c-author .name a:hover { text-decoration: underline; }
.c-author .name.legend a { color: var(--s-gold); }
.c-author .meta { font-size: 12.5px; color: var(--s-faint); }
.c-tier { font-size: 11.5px; font-weight: 600; color: var(--s-muted); background: var(--s-sunken); padding: 1px 7px; border-radius: 999px; }
.c-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.c-chips a.s-chip { text-decoration: none; }
.c-title { margin: 0; font-size: 18px; line-height: 1.3; }
.c-title a { color: var(--s-text); text-decoration: none; }
.c-title a:hover { color: var(--s-brand-ink); }
h2.c-title { font-size: 24px; display: block; }
.c-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--s-text); }
.c-body.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.c-thumb { padding: 0; border: 0; background: #303030; border-radius: 10px; overflow: hidden; cursor: pointer; display: block; width: 100%; aspect-ratio: 16 / 9; }
.c-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.c-thumb:hover img { transform: scale(1.02); }
.c-remixof { font-size: 13px; color: var(--s-muted); }
.c-remixof a { color: var(--s-brand-ink); }
.c-actions { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--s-line); padding-top: 8px; margin-top: 2px; }
.c-actions .grow { flex: 1; }
.c-act { font-weight: 600; font-size: 13.5px; line-height: 1; font-family: inherit; background: none; border: 0; color: var(--s-muted); padding: 8px 10px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.c-act:hover { background: var(--s-sunken); color: var(--s-text); }
.c-act.on { color: #d6336c; }
.c-act.remix { color: var(--s-brand-ink); }
.c-act[disabled] { opacity: .6; }
.c-menu { position: fixed; z-index: 90; background: var(--s-card); border: 1px solid var(--s-line); border-radius: 10px; box-shadow: var(--s-shadow); padding: 4px; display: grid; min-width: 160px; }
.c-menu button { font: inherit; text-align: left; border: 0; background: none; color: var(--s-text); padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.c-menu button:hover { background: var(--s-sunken); }
.c-compose { display: grid; gap: 10px; }
.c-input { font: inherit; font-size: 15px; color: var(--s-text); background: var(--s-bg); border: 1px solid var(--s-line); border-radius: 10px; padding: 10px 12px; resize: vertical; width: 100%; box-sizing: border-box; }
.c-input:focus { outline: 2px solid var(--s-brand); outline-offset: 0; border-color: transparent; }
.c-compose-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.c-select { font: inherit; font-size: 13px; color: var(--s-text); background: var(--s-sunken); border: 1px solid var(--s-line); border-radius: 8px; padding: 6px 8px; max-width: 100%; }
.c-more { justify-self: center; }
.c-remix-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-color: var(--s-brand); background: var(--s-brand-soft); }
.c-remix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.c-remix-grid.small { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.c-remix { display: grid; gap: 4px; color: var(--s-text); text-decoration: none; font-size: 13.5px; min-width: 0; }
.c-remix img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #303030; }
.c-remix b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-comments { display: grid; gap: 14px; margin-bottom: 14px; }
.c-comment { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--s-line); }
.c-comment p { margin: 0 0 0 46px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.c-comment-actions { margin-left: 46px; display: flex; gap: 12px; }
.c-me { display: flex; align-items: center; gap: 12px; }
.c-me-tier { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--s-gold-soft); }
.c-perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 13px; color: var(--s-faint); }
.c-perks li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; }
.c-perks li.on { color: var(--s-text); }
.c-perks li.on span:first-child { color: var(--s-good); font-weight: 800; }
.c-rules td { font-size: 13.5px; }
@media (max-width: 1000px) { .c-grid { grid-template-columns: 1fr; } .c-side { order: -1; } }
@media (max-width: 760px) { .c-comment p, .c-comment-actions { margin-left: 0; } }

/* ---------- share window (used on site pages and in the Studio) ---------- */
.share-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(10, 14, 22, .55); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.share-card { width: min(460px, 100%); background: var(--s-card); color: var(--s-text); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); padding: 20px; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; user-select: text; }
.share-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.share-head h2 { margin: 0; font-size: 19px; }
.share-x { border: 0; background: var(--s-sunken); color: var(--s-muted); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.share-preview { border-radius: 12px; overflow: hidden; background: var(--s-sunken); margin-bottom: 12px; max-height: 260px; display: grid; place-items: center; }
.share-preview img { width: 100%; max-height: 260px; object-fit: contain; display: block; }
.share-loading { padding: 40px; color: var(--s-muted); font-size: 13px; }
.share-text { margin: 0 0 14px; color: var(--s-muted); font-size: 14px; }
.share-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.share-btn { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border: 1px solid var(--s-line); border-radius: 12px; background: var(--s-card); color: var(--s-text); cursor: pointer; font-weight: 600; font-size: 12px; line-height: 1.2; font-family: inherit; }
.share-btn:hover { background: var(--s-sunken); }
.share-btn .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.share-btn .ic svg { width: 20px; height: 20px; }
.share-btn.facebook .ic { background: #1877f2; }
.share-btn.x .ic { background: #000; }
.share-btn.instagram .ic { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.share-btn.threads .ic { background: #000; }
.share-btn.linkedin .ic { background: #0a66c2; }
.share-url { display: flex; gap: 8px; margin-bottom: 10px; }
.share-url input { flex: 1; min-width: 0; font: 13px ui-monospace, monospace; color: var(--s-text); background: var(--s-sunken); border: 1px solid var(--s-line); border-radius: 8px; padding: 8px 10px; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-actions:empty { display: none; }
.share-note { margin: 12px 0 0; font-size: 12px; color: var(--s-faint); }
@media (max-width: 420px) { .share-grid { grid-template-columns: repeat(3, 1fr); } }
#toasts { z-index: 400; }
.c-compose-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--s-muted); }
.c-challenge { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border: 2px solid var(--s-gold); background: linear-gradient(135deg, var(--s-gold-soft), var(--s-card) 70%); }
.c-challenge h2 { margin: 4px 0 2px; font-size: 22px; display: block; }
.c-ch-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 280px; }
.c-ch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.free-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border: 2px solid var(--s-gold); }
.free-card h2 { display: block; margin: 4px 0 4px; font-size: 20px; }
.free-text { flex: 1 1 300px; min-width: 0; }
.free-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.c-next { display: grid; gap: 8px; }
.c-next-item { display: flex; gap: 10px; align-items: flex-start; }
.c-next-item .ic { font-size: 22px; }
.c-next-item .grow { flex: 1; min-width: 0; }
.badges-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.bg-group h3 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--s-muted); }
.bg-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; opacity: .6; }
.bg-item.on { opacity: 1; background: var(--s-gold-soft); }
.bg-item .ic { font-size: 24px; width: 32px; text-align: center; filter: grayscale(1); }
.bg-item.on .ic { filter: none; }
.bg-item .grow { flex: 1; min-width: 0; }
.bg-done { color: var(--s-good); font-weight: 700; }
.l-free { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 8px 0 0; }
@media (max-width: 1000px) { .l-free { grid-template-columns: 1fr; } }

/* ---------- admin ---------- */
.adm { display: grid; gap: 20px; }
.adm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
a.adm-tile { color: inherit; text-decoration: none; }
a.adm-tile:hover { border-color: var(--s-brand); }
.adm-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.adm-side { display: grid; gap: 20px; }
.chart.c30, .chart-x.c30 { grid-template-columns: repeat(30, 1fr); gap: 3px; }
.chart.c30 .barv { width: 100%; }
.chart-x.c30 span { font-size: 11px; white-space: nowrap; overflow: visible; }
.chart .tip.l { left: 0; transform: none; }
.chart .tip.r { left: auto; right: 0; transform: none; }
.adm-funnel { display: grid; gap: 10px; }
.adm-frow { display: grid; grid-template-columns: 140px minmax(0, 1fr) 110px; gap: 12px; align-items: center; font-size: 14px; }
.adm-frow .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--s-muted); }
.adm-mod { display: grid; gap: 10px; }
.adm-item { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--s-line); border-radius: 10px; }
.adm-item.hidden-item { background: var(--s-gold-soft); }
.adm-item img { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; }
.adm-item .grow { flex: 1; min-width: 0; }
.adm-body { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.adm-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.adm-danger { color: #c92a2a; }
.adm-search { margin-bottom: 12px; }
.adm-users td { font-size: 13.5px; }
@media (max-width: 1000px) { .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .adm-two { grid-template-columns: 1fr; } }

/* ---------- Pricing / Visxco Pro ---------- */
.s-chip.pro { background: var(--s-gold-soft); color: var(--s-gold); }
.site-nav .nav-pricing { color: var(--s-gold); }
.s-grid.plans { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 10px; }
.plan.best { border: 2px solid var(--s-brand); }
.plan-flag { position: absolute; top: -11px; right: 16px; background: var(--s-brand); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan-name { font-weight: 700; font-size: 15px; }
.plan-price b { font-size: 32px; letter-spacing: -0.02em; }
.plan-price span { color: var(--s-muted); margin-left: 4px; }
.plan-list { list-style: none; margin: 4px 0 8px; padding: 0; flex: 1; font-size: 14px; }
.plan-list li { padding: 4px 0 4px 22px; position: relative; }
.plan-list li::before { content: '✓'; position: absolute; left: 0; color: var(--s-good); font-weight: 700; }
.plan .s-btn { align-self: flex-start; }
.plan-terms { margin-top: 20px; }
.plan-terms ul { margin: 6px 0 0; padding-left: 20px; color: var(--s-muted); font-size: 14px; line-height: 1.6; }
.plan-card.active h2 { color: var(--s-gold); }
.adm-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 3px 0; border-bottom: 1px solid var(--s-line, rgba(127,127,127,.15)); }

/* ---------- intro page: real outcomes ---------- */
.hero .fine + .fine { margin-top: 4px; }
.hero-shot { margin: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--s-line); box-shadow: var(--s-shadow); background: var(--s-card); }
.hero-shot img { display: block; width: 100%; height: auto; }
.hero-shot figcaption { padding: 8px 14px; font-size: 13px; color: var(--s-muted); }
.s-faint { color: var(--s-faint); }
.s-grid.examples { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.example { margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.example img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.example figcaption { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.example figcaption p { margin: 4px 0; font-size: 14px; }
.example .ex-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.step-demo { margin: 0; padding: 12px; }
.step-demo img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--s-line); }
.step-demo figcaption { margin: 10px 2px 6px; font-weight: 600; }
.demo-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.demo-dot { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--s-line); background: var(--s-card); color: var(--s-muted); font-weight: 700; cursor: pointer; }
.demo-dot.on { background: var(--s-brand); border-color: var(--s-brand); color: #fff; }
.s-grid.how { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step-demo { max-width: 920px; margin-left: auto; margin-right: auto; }
.studio-error { max-width: 760px; margin: 40px auto; } .studio-error ul { line-height: 1.7; }
/* early access (Founder) pricing */
.plan-was { color: var(--s-faint); font-size: 16px; margin-right: 8px; }
.plan-founder { background: var(--s-gold-soft); color: var(--s-ink, inherit); border-radius: 8px; padding: 6px 8px; }
.early-banner { margin-bottom: 16px; border-color: var(--s-gold); }

/* feedback: footer link, admin card */
.s-footer .link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }
.adm-fb-tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.adm-fb-item { border-top: 1px solid var(--s-line); padding: 10px 0; }
.adm-fb-item.done { opacity: .6; }
.adm-fb-top { display: flex; justify-content: space-between; gap: 8px; }
.adm-fb-msg { margin: 6px 0; white-space: pre-wrap; word-break: break-word; }
.adm-fb-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

body.site-mode .ea-badge { color: var(--s-gold); background: var(--s-gold-soft); border-color: var(--s-gold); }
.hero .fine .link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--s-brand-ink); text-decoration: underline; cursor: pointer; }
