/* =========================================================
   Luna Trading Flow — design system
   ========================================================= */
:root {
  --bg: #0a0a0b;
  --bg-2: #0f0f11;
  --surface: #131315;
  --surface-2: #19191c;
  --surface-3: #202024;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f4f4f2;
  --text-2: #c9c9c6;
  --muted: #8d8d93;
  --dim: #5d5d63;
  --gold: #5b9ee0;
  --gold-2: #8cc4f8;
  --gold-ink: #06121f;
  --gold-soft: rgba(91, 158, 224, 0.1);
  --gold-line: rgba(91, 158, 224, 0.32);
  --ok: #5fb98b;
  --ok-soft: rgba(95, 185, 139, 0.12);
  --bad: #e06a6a;
  --bad-soft: rgba(224, 106, 106, 0.12);
  --warn: #d9a548;
  --warn-soft: rgba(217, 165, 72, 0.12);
  --info: #a493e0;
  --info-soft: rgba(164, 147, 224, 0.12);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.6);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font); font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: var(--text); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.02rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.num, .stat-value, td.n, .mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: .86rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.right { text-align: right; }
.gold { color: var(--gold-2); }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.nowrap { white-space: nowrap; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stack > * + * { margin-top: 20px; }
.row-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.content > *, .public main > section { animation: rise .45s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .08s; }
.content > *:nth-child(4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--gold);
  background: var(--gold); color: var(--gold-ink); font: 600 .92rem/1 var(--font); letter-spacing: -.005em;
  cursor: pointer; transition: background .2s var(--ease), border-color .2s, color .2s, transform .1s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--gold-2); border-color: var(--gold-2); color: var(--gold-ink); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--gold-line); color: var(--gold-2); background: var(--gold-soft); }
.btn.subtle { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.subtle:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(224, 106, 106, .35); }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn.sm { height: 34px; padding: 0 12px; font-size: .85rem; border-radius: 8px; }
.btn.lg { height: 50px; padding: 0 26px; font-size: 1rem; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-2); font: inherit; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.link-btn.danger { color: var(--bad); }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; position: relative; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
form.inline { display: inline; }

/* ---------- badges, bars ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .01em; border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.badge.gold { color: var(--gold-2); background: var(--gold-soft); border-color: var(--gold-line); }
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(95, 185, 139, .28); }
.badge.bad { color: var(--bad); background: var(--bad-soft); border-color: rgba(224, 106, 106, .28); }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(217, 165, 72, .28); }
.badge.info { color: var(--info); background: var(--info-soft); border-color: rgba(127, 166, 217, .28); }
.badge.dim { color: var(--dim); }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--gold); transition: width .6s var(--ease); }
.bar.ok i { background: var(--ok); } .bar.bad i { background: var(--bad); } .bar.info i { background: var(--info); }
.bar.thin { height: 4px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h3 { margin: 0; font-size: .95rem; }
.card-body { padding: 18px 22px 22px; }
.card-body.flush { padding: 10px 0 0; }
.card.gold-edge { border-color: var(--gold-line); background: linear-gradient(180deg, rgba(91, 158, 224, .05), transparent 50%), var(--surface); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; gap: 12px; } .stat { padding: 14px 16px; } .stat-value { font-size: 1.35rem; } }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .8rem; font-weight: 500; }
.stat-value { font-family: var(--display); font-size: 1.65rem; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; line-height: 1.2; }
.stat-sub { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.stat .bar { margin-top: 12px; }

.empty { text-align: center; padding: 36px 18px; color: var(--muted); }
.empty .ic { color: var(--gold); margin-bottom: 8px; }
.empty h4 { color: var(--text); font-size: 1rem; margin: 4px 0 6px; }
.empty p { max-width: 420px; margin: 0 auto 14px; font-size: .9rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; font-weight: 500; font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255, 255, 255, .015); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { display: block; color: var(--muted); font-size: .8rem; }
.row-link { color: var(--text); font-weight: 500; }
.row-link:hover { color: var(--gold-2); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid.g3f { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid, .form-grid.g3f { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label { font-size: .8rem; font-weight: 500; color: var(--text-2); }
.hint { font-size: .77rem; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  border-radius: 10px; padding: 0 13px; height: 42px; font: .92rem var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea { padding: 11px 13px; height: auto; min-height: 96px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d8d93' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-soft); }
input::placeholder, textarea::placeholder { color: var(--dim); }
input[type=file] { color: var(--muted); font-size: .85rem; }
input[type=file]::file-selector-button { background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 12px; margin-right: 10px; cursor: pointer; font: 500 .82rem var(--font); }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); width: 16px; height: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--text-2); cursor: pointer; }
.check input { margin-top: 3px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: .82rem; color: var(--text-2); cursor: pointer; transition: all .15s; user-select: none; }
.chip input:checked + span { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-2); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--gold-soft); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 7px 14px; border-radius: 7px; font-size: .86rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--surface-3); color: var(--text); }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.form-section { font-family: var(--display); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin: 26px 0 14px; font-weight: 600; }
.form-section:first-child { margin-top: 0; }
details.disclose summary { cursor: pointer; color: var(--muted); font-size: .88rem; list-style: none; }
details.disclose summary::-webkit-details-marker { display: none; }
details.disclose summary::before { content: '+ '; color: var(--gold); }
details.disclose[open] summary::before { content: '− '; }

.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 22px; border-radius: 12px; background: var(--ok-soft); border: 1px solid rgba(95, 185, 139, .28); color: #bfe6cf; font-size: .9rem; }
.flash .ic { color: var(--ok); }
.flash.error { background: var(--bad-soft); border-color: rgba(224, 106, 106, .3); color: #f3c3c3; }
.flash.error .ic { color: var(--bad); }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: .88rem; }
.notice.gold { background: var(--gold-soft); border-color: var(--gold-line); color: #cfe3f7; }

/* =========================================================
   App shell
   ========================================================= */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--line); padding: 22px 14px 16px; overflow-y: auto; z-index: 40; }
.side-brand { display: block; padding: 2px 10px 22px; }
.side-brand img { height: 32px; width: auto; display: block; }
.side-nav { flex: 1; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); padding: 18px 12px 8px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--muted); font-size: .9rem; font-weight: 500; transition: background .15s, color .15s; width: 100%; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.nav-item.active { color: var(--text); background: var(--surface-2); box-shadow: inset 2px 0 0 var(--gold); }
.nav-item.active .ic { color: var(--gold); }
.nav-item.locked { color: var(--dim); }
.nav-lock, .nav-count { margin-left: auto; }
.nav-count { font-size: .7rem; font-weight: 700; background: var(--gold); color: var(--gold-ink); border-radius: 99px; padding: 1px 7px; }
.nav-item.as-btn { background: none; border: 0; font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer; text-align: left; }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.side-card .tiny { color: var(--muted); }
.side-card strong { display: block; font-size: .86rem; margin: 2px 0 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 32px; background: rgba(10, 10, 11, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-title { font-weight: 500; color: var(--muted); font-size: .9rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.menu-btn { display: none; }
.bell .dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--gold); color: var(--gold-ink); font-size: .66rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
.me { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: .88rem; font-weight: 500; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #2a2a2f, #1a1a1d); border: 1px solid var(--line-2); color: var(--gold-2); font-weight: 600; object-fit: cover; flex: none; }
.content { padding: 34px 32px 48px; max-width: 1280px; width: 100%; }
.app-foot { margin-top: auto; padding: 18px 32px 26px; color: var(--dim); font-size: .76rem; border-top: 1px solid var(--line); }
.app-foot a { color: var(--muted); }
.scrim { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .25s var(--ease); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 35; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 24px 16px 40px; }
  .app-foot { padding: 16px; }
  .hide-sm { display: none !important; }
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .lede { margin: 8px 0 0; color: var(--muted); max-width: 640px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 600; margin-bottom: 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .86rem; margin-bottom: 16px; }
.back:hover { color: var(--text); }

/* ---------- dashboard ---------- */
.hero-panel { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; }
.hero-panel .hp-main { padding: 28px 30px; }
.hero-panel .hp-side { padding: 28px 30px; border-left: 1px solid var(--line); background: rgba(255, 255, 255, .012); display: grid; gap: 18px; align-content: start; }
.hero-panel h1 { font-size: clamp(1.6rem, 2.6vw, 2.05rem); margin-bottom: 6px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.kv .k { color: var(--muted); font-size: .82rem; }
.kv .v { font-weight: 600; text-align: right; }
.big-num { font-family: var(--display); font-size: 2.6rem; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
@media (max-width: 860px) { .hero-panel { grid-template-columns: 1fr; } .hero-panel .hp-side { border-left: 0; border-top: 1px solid var(--line); } }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 14px; align-items: flex-start; padding: 13px 22px; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .li-main { flex: 1; min-width: 0; }
.list .li-title { font-weight: 500; font-size: .9rem; }
.list .li-sub { color: var(--muted); font-size: .8rem; }
.list .li-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); flex: none; border: 1px solid var(--line); }
.list li.unread .li-title::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-left: 8px; vertical-align: middle; }

/* roadmap */
.roadmap { list-style: none; margin: 0; padding: 0; position: relative; }
.roadmap li { position: relative; display: flex; align-items: center; gap: 16px; padding: 12px 0 12px 0; }
.roadmap li + li::before { content: ''; position: absolute; left: 15px; top: -12px; height: 24px; width: 1px; background: var(--line-2); }
.rm-dot { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); font-size: .76rem; font-weight: 600; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.roadmap .completed .rm-dot { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.roadmap .in_progress .rm-dot { border-color: var(--gold); color: var(--gold-2); box-shadow: 0 0 0 4px var(--gold-soft); }
.roadmap .locked .rm-dot { color: var(--dim); background: transparent; }
.rm-title { flex: 1; font-weight: 500; font-size: .92rem; }
.roadmap .locked .rm-title { color: var(--dim); }
.roadmap .completed .rm-title { color: var(--text-2); }
.rm-cols { columns: 2; column-gap: 40px; }
.rm-cols li { break-inside: avoid; }
@media (max-width: 760px) { .rm-cols { columns: 1; } }

.locked-panel { position: relative; text-align: center; padding: 56px 24px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: radial-gradient(600px 200px at 50% 0, var(--gold-soft), transparent 70%); }
.locked-panel .lock-ic { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold-2); }
.locked-panel h2 { margin-bottom: 8px; }
.locked-panel p { color: var(--muted); max-width: 520px; margin: 0 auto 22px; }

.spark { width: 100%; height: 140px; display: block; }
.spark .line { fill: none; stroke: var(--gold); stroke-width: 2; }
.spark .area { fill: url(#none); fill: rgba(91, 158, 224, .08); }
.spark .zero { stroke: var(--line-2); stroke-dasharray: 3 4; }

.milestone { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.milestone .m-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--dim); border: 1px solid var(--line); }
.milestone.reached .m-ic { background: var(--gold-soft); color: var(--gold-2); border-color: var(--gold-line); }
.milestone .bar { margin-top: 6px; }

.acct { padding: 20px 22px; }
.acct-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.acct h3 { margin: 0 0 2px; }
.acct-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0 14px; }
.acct-metrics div span { display: block; color: var(--muted); font-size: .75rem; }
.acct-metrics div strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.acct-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.acct-bars .tiny { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 6px; }
@media (max-width: 760px) { .acct-metrics { grid-template-columns: repeat(2, 1fr); } .acct-bars { grid-template-columns: 1fr; } }

.lesson-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .2s, transform .2s var(--ease); color: var(--text); height: 100%; }
.lesson-card:hover { border-color: var(--gold-line); color: var(--text); transform: translateY(-2px); }
.lesson-card .lc-kind { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
.lesson-card h4 { margin: 0; font-size: .98rem; }
.lesson-card.is-locked { opacity: .55; }
.cat-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.cat-nav a { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); font-size: .84rem; }
.cat-nav a.on, .cat-nav a:hover { color: var(--gold-2); border-color: var(--gold-line); background: var(--gold-soft); }
.video { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose p { color: var(--text-2); line-height: 1.75; }
.shot { border-radius: 12px; border: 1px solid var(--line); display: block; }

.feedback { border-left: 2px solid var(--gold); padding: 4px 0 4px 16px; }
.comment { padding: 14px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: .84rem; }
.comment-head .who { font-weight: 600; }
.trade-dir { font-weight: 600; font-size: .8rem; }
.trade-dir.long { color: var(--ok); } .trade-dir.short { color: var(--bad); }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.detail-grid > div { background: var(--surface); padding: 14px 16px; }
.detail-grid > div > span { display: block; font-size: .74rem; color: var(--muted); margin-bottom: 3px; }
.detail-grid strong { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: repeat(2, 1fr); } }

.creds { display: grid; gap: 14px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px; text-align: left; margin: 22px 0; }
.creds small { display: block; color: var(--muted); font-size: .76rem; }
.creds code { font: 600 1.05rem ui-monospace, 'SFMono-Regular', Menlo, monospace; color: var(--gold-2); word-break: break-all; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-size: .88rem; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--text); border-bottom-color: var(--gold); }
.tabs a:hover { color: var(--text); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters input, .filters select { height: 38px; width: auto; min-width: 160px; }

/* =========================================================
   Public site
   ========================================================= */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(10, 10, 11, .8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-head .row { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand img { height: 34px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.nav-link { color: var(--muted); font-size: .9rem; font-weight: 500; }
.nav-link:hover { color: var(--text); }
@media (max-width: 640px) { .hide-sm { display: none !important; } .site-nav { gap: 14px; } .brand img { height: 28px; } .container { padding: 0 16px; } }

.hero { padding: 110px 0 90px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -40% -10% auto; height: 520px; background: radial-gradient(closest-side, rgba(91, 158, 224, .09), transparent 70%); pointer-events: none; }
.hero .container { position: relative; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -.035em; line-height: 1.03; max-width: 900px; margin-bottom: 26px; }
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero .lede { font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: var(--text-2); max-width: 660px; line-height: 1.7; margin-bottom: 36px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 22px; color: var(--dim); font-size: .82rem; }
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); letter-spacing: -.03em; }
.section-head p { color: var(--muted); font-size: 1.04rem; }
.phase-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.phase-card { padding: 34px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.phase-card.p2 { border-color: var(--gold-line); background: linear-gradient(180deg, rgba(91, 158, 224, .06), transparent 40%), var(--surface); }
.phase-card .tag { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.phase-card h3 { font-size: 1.5rem; margin: 10px 0 12px; letter-spacing: -.02em; }
.phase-card p { color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: .92rem; }
.ticks li .ic { color: var(--gold); margin-top: 3px; }
.ticks.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .phase-compare { grid-template-columns: 1fr; } .ticks.two { grid-template-columns: 1fr; } }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.steps > div { background: var(--bg); padding: 30px 26px; }
.steps .n { font-family: var(--display); color: var(--gold); font-weight: 600; font-size: .86rem; margin-bottom: 18px; display: block; }
.steps h4 { font-size: 1.04rem; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: .9rem; margin: 0; }
@media (max-width: 960px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 26px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.feature .f-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-2); border: 1px solid var(--gold-line); margin-bottom: 18px; }
.feature h4 { margin-bottom: 6px; font-size: 1rem; }
.feature p { color: var(--muted); font-size: .9rem; margin: 0; }
@media (max-width: 960px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.milestone-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.milestone-strip div { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--surface); }
.milestone-strip span { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 6px; }
.milestone-strip strong { font-family: var(--display); font-size: 1.05rem; }
@media (max-width: 860px) { .milestone-strip { grid-template-columns: 1fr 1fr; } }
.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 500; font-size: 1.02rem; list-style: none; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--gold); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--muted); margin: 12px 0 0; }
.cta-band { text-align: center; padding: 90px 24px; }
.cta-band h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -.03em; }
.cta-band p { color: var(--muted); max-width: 560px; margin: 0 auto 30px; }

.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 980px; margin: 0 auto; }
.price-card { display: flex; flex-direction: column; padding: 36px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); }
.price-card.p2 { border-color: var(--gold-line); background: linear-gradient(180deg, rgba(91, 158, 224, .07), transparent 45%), var(--surface); }
.price-card .tag { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.price-card h2 { font-size: 1.55rem; margin: 10px 0 6px; }
.price-card .desc { color: var(--muted); font-size: .92rem; min-height: 4.6em; }
.price { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 6px; }
.price .from { color: var(--muted); font-size: .86rem; }
.price strong { font-family: var(--display); font-size: 3rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.price .unit { color: var(--muted); font-size: .9rem; }
.price-card .ticks { margin: 24px 0 30px; flex: 1; }
.price-card .btn { margin-top: auto; }
@media (max-width: 860px) { .price-grid { grid-template-columns: 1fr; } .price-card .desc { min-height: 0; } }
.private-price { display: inline-flex; align-items: center; gap: 8px; }

.auth-wrap { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 440px; padding: 36px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .lede { color: var(--muted); margin-bottom: 26px; }
.auth-card .field { margin-bottom: 16px; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; max-width: 1000px; margin: 0 auto; padding: 56px 0 90px; align-items: start; }
.summary-line { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.summary-line.total { border-bottom: 0; font-weight: 600; font-size: 1.05rem; padding-top: 16px; }
@media (max-width: 860px) { .checkout-grid { grid-template-columns: 1fr; padding-top: 32px; } }
.legal { max-width: 780px; margin: 0 auto; padding: 64px 0 90px; }
.legal h1 { font-size: 2.2rem; }
.legal h2 { font-size: 1.15rem; margin-top: 34px; }
.legal p, .legal li { color: var(--text-2); line-height: 1.75; }
.legal .updated { color: var(--muted); font-size: .86rem; }
.site-foot { border-top: 1px solid var(--line); padding: 54px 0 40px; margin-top: 0; }
.foot-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; margin-bottom: 30px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 22px; align-content: flex-start; }
.foot-links a { color: var(--muted); font-size: .86rem; }
.foot-links a:hover { color: var(--text); }
.fine { color: var(--dim); font-size: .78rem; line-height: 1.7; max-width: 900px; }

/* vertical rhythm between top-level blocks in the app */
.content > * + * { margin-top: 20px; }
.content > .page-head + *, .content > .flash + * { margin-top: 0; }
.content > .back + .page-head { margin-top: 0; }

/* =========================================================
   Hero candle background
   ========================================================= */
.candle-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; opacity: .72;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 78%, transparent 100%); }
.hero h1, .hero .lede { text-shadow: 0 2px 24px rgba(10, 10, 11, .9); }
@media (max-width: 760px) { .candle-fx { opacity: .5; } }

/* =========================================================
   Mobile polish
   ========================================================= */
.grid > *, .stack > * { min-width: 0; }
.tabbar { display: none; }
@media (max-width: 960px) {
  .has-tabbar .main { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 34;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(12, 12, 14, .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border-radius: 12px;
    color: var(--muted); font: 500 .68rem/1 var(--font); letter-spacing: .01em; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tab .ic { width: 21px; height: 21px; }
  .tab.on { color: var(--gold-2); }
  .tab.on::before { content: ''; position: absolute; top: -6px; width: 26px; height: 2px; border-radius: 2px; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
  .tab:active { background: rgba(255, 255, 255, .04); }
  .tab-dot { position: absolute; top: 8px; left: calc(50% + 8px); width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
  .sidebar { padding-top: calc(22px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  /* 16px inputs stop iOS from zooming in on focus */
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px; height: 46px; }
  textarea { height: auto; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 38px; }
  .page-head { margin-bottom: 20px; }
  .page-actions, .page-actions .btn { width: 100%; }
  .page-actions .btn { justify-content: center; flex: 1; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .filters input, .filters select { width: 100%; min-width: 0; }
  .hero { padding: 64px 0 56px; }
  .hero .cta .btn { flex: 1 1 auto; justify-content: center; }
  .card-head { flex-wrap: wrap; gap: 8px; }

  /* tables become stacked cards */
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-wrap tbody tr:last-child { border-bottom: 0; }
  .table-wrap td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 5px 0; border: 0; text-align: right; }
  .table-wrap td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; text-align: left; flex: none; }
  .table-wrap td[data-label=""]::before { content: none; }
  .table-wrap td:first-child { display: block; text-align: left; font-size: .95rem; padding-bottom: 8px; }
  .table-wrap td:first-child::before { content: none; }
  .table-wrap td[data-label=""] { justify-content: flex-end; }
  .table-wrap td .sub { text-align: inherit; }
  .table-wrap td.nowrap, .table-wrap .right { white-space: normal; }
  .table-wrap td > span[id^="link-"] { word-break: break-all; text-align: right; }
}
