/* Wuxian Capital Mentorship — sales page styles
   Change the brand color in one place: --accent below. */

:root {
  --accent: #4C8DFF;          /* blue. Text on accent fills uses --bg (dark) for contrast */
  --accent-lt: #7FB0FF;       /* lighter blue for highlighted words */
  --accent-dim: #1A3B78;      /* blue borders */
  --accent-soft: rgba(76, 141, 255, 0.10);
  --accent-rgb: 76, 141, 255;
  --bg: #05070D;
  --surface: #0B111E;
  --surface-2: #111A2C;
  --line: #1A2438;
  --line-strong: #2A3954;
  --text: #EEF2F8;
  --text-soft: #D3DBE8;
  --text-body: #A9B4C6;
  --muted: #8A96AB;
  --dash: #3E4A60;
  --font: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  --head: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-lg: 16px;
  --radius-md: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--text); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1 {
  font-weight: 600;
  font-size: clamp(40px, 6.4vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}
h2 {
  font-weight: 600;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.035em;
}
h3 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }

.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.strong { color: var(--text-soft); }

/* ---------- Layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.section { padding-top: 96px; padding-bottom: 96px; display: flex; flex-direction: column; gap: 44px; }
.section-tight { padding-bottom: 96px; display: flex; flex-direction: column; gap: 40px; }
.band { border-top: 1px solid var(--line); }
.heading { display: flex; flex-direction: column; gap: 14px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bento { display: flex; flex-direction: row; flex-wrap: wrap; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-accent { background: var(--accent); color: var(--bg); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); font-weight: 500; }
.btn-dark { background: var(--bg); color: var(--text); font-size: 18px; }
.btn-sm { min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn-lg { min-height: 56px; padding: 0 30px; }
.btn-block { display: flex; min-height: 54px; }

/* ---------- Nav ---------- */
.nav-wrap { position: sticky; top: 0; z-index: 10; padding: 14px 16px 0; }
.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 10px 10px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  background: rgba(19, 21, 25, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; text-decoration: none; }
.brand-sub { color: var(--muted); font-weight: 400; }
.dot { width: 10px; height: 10px; border-radius: 999px; background: var(--accent); flex: none; }
.dot-sm { width: 8px; height: 8px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 15px; }
.nav-links a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: #C6CAD2; text-decoration: none; }
.nav-links a:not(.btn):hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 26px 26px;
}
.hero-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 44px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  text-align: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #C6CAD2;
}
.lead { font-size: clamp(18px, 1.8vw, 21px); color: var(--text-body); max-width: 32em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
/* Member page Results: the big highlighted total between the totals and "Every payout" */
.results-highlight {
  max-width: 22em; margin: 56px auto 16px; text-align: center; text-wrap: balance;
  font: 800 clamp(30px, 4.6vw, 52px)/1.12 var(--head); color: var(--text); letter-spacing: -0.01em;
}
.hero-inner .lead + .lead { margin-top: -14px; } /* two intro paragraphs read as one block */

/* ---------- Offer + focus ---------- */
.bento.container { padding-bottom: 96px; }
.offer { flex: 1 1 380px; min-width: 0; border-radius: var(--radius-lg); padding: 36px; display: flex; flex-direction: column; gap: 22px; }
.price { font-weight: 600; font-size: clamp(40px, 4.6vw, 56px); line-height: 1; letter-spacing: -0.03em; margin-bottom: 6px; }
.focus { flex: 999 1 480px; min-width: 0; border-radius: var(--radius-lg); padding: 36px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.focus-title { margin-top: 10px; font-weight: 600; font-size: clamp(26px, 3vw, 36px); line-height: 1.12; letter-spacing: -0.03em; max-width: 16em; }
.chart { width: 100%; height: auto; color: var(--accent); }
.intro { flex: 999 1 480px; min-width: 0; border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px; align-self: flex-start; }
.intro-head { display: flex; justify-content: space-between; gap: 12px; padding: 0 4px; font-size: 12px; }
.intro-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 16px; object-fit: contain; }
.intro .chips { padding: 0 4px 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.12); font-size: 14px; color: #C6CAD2; }

/* ---------- Lists ---------- */
.checks, .crosses { display: flex; flex-direction: column; gap: 12px; }
.checks li, .crosses li { position: relative; padding-left: 32px; }
.checks li::before, .crosses li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  background-color: var(--accent);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.checks li::before { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.5l4 4 8-9'/%3E%3C/svg%3E"); }
.crosses li::before { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 5l10 10M15 5L5 15'/%3E%3C/svg%3E"); background-color: var(--muted); }

/* ---------- Pain points ---------- */
.pain { padding: 28px; display: flex; flex-direction: column; gap: 40px; }
.pain p { color: var(--text-soft); }
.pain-text { display: flex; flex-direction: column; gap: 10px; }
.pain-text h3 { font: 700 18px/1.35 var(--head); color: var(--text); margin: 0; }
.num { font-family: var(--mono); font-size: 14px; color: var(--accent); }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.step { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; border-top: 2px solid var(--accent); }
.step p { color: var(--text-body); }
.step-label { font-family: var(--mono); font-size: 14px; color: var(--muted); }

/* ---------- Placeholders (remove once you add real images) ---------- */
.placeholder {
  border: 1px dashed var(--dash);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
}

/* ---------- Mentor ---------- */
.mentor-photo { flex: 1 1 320px; min-width: 0; min-height: 420px; border-radius: var(--radius-lg); object-fit: cover; }
img.mentor-photo { width: 100%; height: 420px; }
.mentor { flex: 999 1 460px; min-width: 0; border-radius: var(--radius-lg); padding: 44px; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.mentor p { color: var(--text-body); }
.mentor p.strong { color: var(--text-soft); }

/* ---------- Results ---------- */
.proof { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.proof .placeholder { height: 220px; }
.proof img { width: 100%; height: 220px; object-fit: cover; border-radius: 14px; display: block; }
.proof figcaption { padding: 0 8px 8px; font-size: 15px; color: #C6CAD2; }
.note { max-width: 44em; }

/* ---------- Fit ---------- */
.fit { padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.fit h3 { font-size: 20px; letter-spacing: -0.01em; }
.fit .checks { color: var(--text-soft); gap: 14px; }
.fit-no { background: transparent; }
.fit-no .crosses { color: var(--text-body); gap: 14px; }

/* ---------- FAQ ---------- */
.faq { flex-direction: row; flex-wrap: wrap; gap: 48px; }
.faq h2 { flex: 1 1 300px; min-width: 0; }
.faq-list { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 0 24px; }
summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
.pm { flex: none; font-size: 24px; line-height: 1; color: var(--accent); transition: transform 0.2s ease; }
details[open] .pm { transform: rotate(45deg); }
details p { padding-bottom: 24px; color: var(--text-body); }
.faq-answer p { padding-bottom: 12px; } /* an answer with several paragraphs */
.faq-answer p:last-child { padding-bottom: 24px; }

/* ---------- Final CTA ---------- */
.final {
  background: var(--accent);
  color: var(--bg);
  border-radius: 32px;
  padding: clamp(40px, 6vw, 80px) clamp(24px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
  text-align: center;
}
.final h2 { font-size: clamp(32px, 5vw, 64px); line-height: 1.02; letter-spacing: -0.04em; max-width: 14em; }
.final p { max-width: 30em; font-size: 19px; color: #1C1D20; }
.final .small { color: #1C1D20; }
.final-price { font-family: var(--mono); font-weight: 500; font-size: 22px; }

/* ---------- Admin ---------- */
.admin { min-height: calc(100vh - 220px); display: flex; align-items: flex-start; justify-content: center; padding: clamp(24px, 6vh, 72px) 16px; }
.admin-card { width: 100%; max-width: 460px; padding: 32px; display: flex; flex-direction: column; gap: 28px; }
.admin-card.is-wide { max-width: 860px; }
.admin-tools { display: flex; gap: 16px; }
.admin-card section { display: flex; flex-direction: column; gap: 22px; }
.admin-title { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.admin-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin label { font-size: 14px; color: var(--muted); }
.admin input, .waitlist input {
  width: 100%; min-height: 48px; padding: 0 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 12px;
  font: 400 16px var(--font);
}
.waitlist input::placeholder { color: var(--dash); }
.waitlist input[aria-invalid="true"] { border-color: #FF8A7A; }
.admin input:focus-visible, .admin button:focus-visible, .waitlist input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.admin button { font-family: var(--font); cursor: pointer; }
.admin button.btn { border: 0; font-size: 16px; }
.admin button:disabled { opacity: 0.5; cursor: wait; }
/* Review list */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }
.tabs button {
  flex: 1 1 auto; min-height: 44px; padding: 0 14px; border: 0; border-radius: 11px; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 15px; font-weight: 600;
}
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tabs .count { font-family: var(--mono); font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--text-soft); }
.tabs button[data-filter="pending"] .count { background: var(--accent); color: var(--bg); }
.app-list { display: flex; flex-direction: column; gap: 14px; }
.app-empty { padding: 28px; border: 1px dashed var(--dash); border-radius: 16px; color: var(--muted); text-align: center; }
.app-item { display: flex; flex-direction: column; gap: 18px; padding: 22px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; min-width: 0; }
.app-item[data-status="pending"] { border-color: var(--line-strong); }
.app-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.app-who { min-width: 0; }
.app-name { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; overflow-wrap: anywhere; }
.app-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 14px; color: var(--muted); }
.app-meta .selectable { color: var(--text-soft); user-select: all; overflow-wrap: anywhere; }
.status-pill { flex: none; padding: 4px 12px; border-radius: 999px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--text-soft); }
.status-pending { border-color: var(--accent); color: var(--accent); }
.status-accepted { background: #1F3A2B; border-color: #3E7A57; color: #9FE0B6; }
.status-member { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.status-declined { background: transparent; border-color: var(--dash); color: var(--muted); }
.app-facts { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.app-facts div { padding: 10px 12px; background: var(--surface); border-radius: 12px; min-width: 0; }
.app-facts dt { font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.app-facts dd { margin: 2px 0 0; font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.app-long h3 { font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-bottom: 4px; }
.app-long p { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-soft); font-size: 16px; }
.app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.app-actions .btn { min-height: 44px; padding: 0 22px; font-size: 15px; }
.admin .app-actions button.btn-ghost, .admin .app-actions a.btn-ghost { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.app-decided { font-size: 13px; color: var(--muted); }
.app-item .form-msg:empty { display: none; }
@media (max-width: 700px) {
  .app-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-card { padding: 22px; }
  .app-item { padding: 18px; }
}
.form-msg { font-size: 14px; color: var(--muted); min-height: 1.6em; }
.form-msg.is-error { color: #FF8A7A; }
.waitlist-actions .form-msg { flex: 1 1 220px; min-width: 0; }
/* ---------- Landing page (waitlist) ---------- */
.nav-note { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 0 12px; }
.landing {
  padding: 56px 16px 96px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 26px 26px;
}
.landing-card { max-width: 720px; margin: 0 auto; }
.waitlist-title { font-size: clamp(34px, 5.4vw, 52px); line-height: 1.04; letter-spacing: -0.035em; }
.waitlist .waitlist-done h2 { font-size: 28px; letter-spacing: -0.02em; padding-right: 0; }

.consent { font-size: 14px; color: var(--muted); }
.consent a, .offer .small a, details p a { color: var(--accent); }

/* ---------- Legal pages ---------- */
.legal { padding: 40px 16px 96px; }
.legal-back { display: block; max-width: 760px; margin: 0 auto 24px; font-size: 14px; color: var(--muted); text-decoration: none; }
.legal-back:hover { color: var(--text); }
.legal-head { max-width: 760px; margin: 0 auto 28px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.legal-head h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.05; letter-spacing: -0.035em; }
.legal-date { font-size: 14px; color: var(--muted); }
.legal-card { max-width: 760px; margin: 0 auto; padding: clamp(24px, 5vw, 44px); display: flex; flex-direction: column; }
.legal-intro { color: var(--text-soft); padding-bottom: 22px; }
.legal-card section { display: flex; flex-direction: column; gap: 10px; padding: 22px 0; border-top: 1px solid var(--line); }
.legal-card section:last-child { padding-bottom: 0; }
.legal-card h2 { font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; }
.legal-card p { color: var(--text-body); font-size: 16px; }
.legal-card strong { color: var(--text); font-weight: 600; }
.legal-card a { color: var(--accent); }

/* ---------- Community (post feed) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.cm-page { --role-admin: var(--accent); --role-mod: #6FD3B5; --role-member: var(--text-soft); --chat-bg: #0F1114; --side-bg: #0C0D10; }
.cm-page input, .cm-page select, .cm-page textarea {
  width: 100%; min-height: 46px; padding: 0 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 12px;
  font: 400 16px var(--font);
}
.cm-page input.sr-only { width: 1px; min-height: 0; height: 1px; padding: 0; border: 0; }
.cm-page textarea { padding: 12px 14px; line-height: 1.5; resize: none; }
.cm-page input:focus-visible, .cm-page select:focus-visible, .cm-page textarea:focus-visible,
.cm-page button:focus-visible, .cm-page a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cm-page button { font-family: var(--font); cursor: pointer; }
.cm-page button.btn { border: 0; }
.cm-page button.btn-ghost { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.cm-page button:disabled { opacity: 0.5; cursor: wait; }
.cm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.cm-link { min-height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 14px; }
.cm-link:hover { color: var(--text); }

.cm-top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 16px; min-height: 56px;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  background: rgba(10, 11, 13, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.cm-top-link { margin-left: auto; font-size: 14px; font-weight: 500; color: var(--text-soft); text-decoration: none; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line-strong); }
.cm-top-link:hover { color: var(--text); border-color: var(--text-body); }
.cm-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--line-strong); color: var(--text); font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
}
.cm-avatar.is-small { width: 32px; height: 32px; font-size: 12px; }
.cm-loading { padding: 80px 16px; text-align: center; color: var(--muted); }

/* Sign in */
.cm-auth { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.cm-auth-card { width: 100%; max-width: 460px; padding: clamp(24px, 5vw, 36px); display: flex; flex-direction: column; gap: 18px; }
.cm-auth-card h1 { font-size: clamp(28px, 4vw, 34px); line-height: 1.15; letter-spacing: -0.025em; }
.cm-auth-card > p { color: var(--text-body); }
.cm-auth-card form { display: flex; flex-direction: column; gap: 14px; }
.cm-auth-card label { font-size: 14px; color: var(--muted); }
.cm-auth-note { font-size: 15px; color: var(--text-soft); }
.cm-auth-card .link-btn { align-self: flex-start; }
.cm-demo { display: flex; flex-direction: column; gap: 12px; }
.cm-demo-list { display: flex; flex-direction: column; gap: 8px; }
.cm-demo-person {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; text-align: left;
  background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; font-size: 16px;
}
.cm-demo-person:hover { border-color: var(--accent); }
.cm-demo-text { display: flex; flex-direction: column; line-height: 1.3; }

/* Role colors */
.role-admin { color: var(--role-admin); }
.role-mod { color: var(--role-mod); }
.role-member { color: var(--role-member); }

/* Inside the community the app has its own sidebar: no separate top bar */
.cm-page.is-app > .cm-top { display: none; }

/* App layout: sidebar | tabs + feed */
.cf-app {
  --cf-line: rgba(255, 255, 255, 0.06);
  --cf-hover: rgba(255, 255, 255, 0.05);
  display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh;
}
.cf-icon-btn {
  flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.cf-icon-btn:hover { background: var(--cf-hover); color: var(--text); }

/* Sidebar */
.cf-side {
  position: sticky; top: 0; height: 100vh; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--side-bg); border-right: 1px solid var(--cf-line);
}
.cf-brand { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--cf-line); }
.cf-logo {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--bg); font: 800 18px var(--head); letter-spacing: -0.02em;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.35);
}
.cf-brand-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.cf-brand-name { font: 700 15px var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-brand-sub { font-size: 12px; color: var(--muted); }
.cf-close-side { display: none; }
.cf-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 18px; display: flex; flex-direction: column; gap: 2px; }
.cf-all {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 14px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-soft);
  font-size: 15px; font-weight: 600; text-align: left; transition: background 0.15s ease, color 0.15s ease;
}
.cf-all:hover { background: var(--cf-hover); color: var(--text); }
/* Community spaces: the whole community, or one batch's own space */
.cf-spaces { display: flex; flex-direction: column; gap: 4px; padding: 6px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.02); }
.cf-space {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-body);
  font-size: 14px; font-weight: 600; text-align: left; transition: background 0.15s ease, color 0.15s ease;
}
.cf-space:hover { background: var(--cf-hover); color: var(--text); }
.cf-space[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-dim); color: var(--text); }
.cf-space svg { flex: 0 0 auto; opacity: 0.8; }
.cf-space-you { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-lt); font-size: 11px; font-weight: 600; white-space: nowrap; }
.cf-all[aria-current="true"] { background: var(--accent); color: var(--bg); box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.28); }
.cf-nav-label {
  display: flex; align-items: center; justify-content: space-between; min-height: 30px; margin: 16px 0 2px; padding: 0 2px 0 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.cf-nav-label .cf-icon-btn { width: 28px; height: 28px; border-radius: 8px; }
.cf-channels { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.cf-cat { display: flex; flex-direction: column; gap: 1px; }
.cf-cat-head { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 2px 0 14px; color: var(--muted); }
.cf-cat-name { min-width: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-cat-lock { flex: none; display: inline-flex; }
.cf-cat-tools { margin-left: auto; display: flex; gap: 2px; }
.cf-tool { width: 26px; height: 26px; border-radius: 7px; opacity: 0; }
.cf-cat-head:hover .cf-tool, .cf-chan-row:hover .cf-tool, .cf-tool:focus-visible { opacity: 1; }
@media (hover: none) { .cf-tool { opacity: 1; } }
.cf-chan-row { display: flex; align-items: center; gap: 2px; }
.cf-chan {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px 0 14px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-body);
  font-size: 14.5px; font-weight: 500; text-align: left; transition: background 0.15s ease, color 0.15s ease;
}
.cf-chan:hover { background: var(--cf-hover); color: var(--text); }
.cf-chan[aria-current="true"] { background: var(--accent); color: var(--bg); font-weight: 600; }
.cf-chan-icon { flex: none; display: inline-flex; color: var(--muted); }
.cf-chan[aria-current="true"] .cf-chan-icon { color: var(--bg); }
.cf-chan-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-cat-empty { padding: 2px 14px; font-size: 13px; color: var(--muted); }
.cf-side-foot { padding: 10px; border-top: 1px solid var(--cf-line); display: flex; flex-direction: column; gap: 6px; }
.cf-back {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--text-body); font-size: 14px; font-weight: 500; text-decoration: none;
}
.cf-back:hover { background: var(--cf-hover); color: var(--accent-lt); }
.cf-me { display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 10px; background: var(--surface); border: 1px solid var(--cf-line); border-radius: 14px; }
.cf-me-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cf-me-info strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-me-info span { font-size: 12px; }

/* Main column: tab bar */
.cf-main { min-width: 0; display: flex; flex-direction: column; }
.cf-tabbar {
  position: sticky; top: 0; z-index: 6; display: flex; align-items: stretch; gap: 6px; min-height: 60px; padding: 0 24px;
  background: rgba(6, 9, 18, 0.88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--cf-line);
}
.cf-tabbar > .cf-icon-btn { align-self: center; }
.cf-tabs { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cf-tabs::-webkit-scrollbar { display: none; }
.cf-tab {
  position: relative; flex: none; display: inline-flex; align-items: center; min-height: 60px; padding: 0 14px;
  border: 0; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: color 0.15s ease;
}
.cf-tab:hover { color: var(--text); }
.cf-tab[aria-selected="true"] { color: var(--accent-lt); }
.cf-tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6);
}
.cm-page .cf-tab:focus-visible { outline-offset: -4px; }
.cf-mobile-only { display: none; }

.cf-feed { width: 100%; max-width: 760px; margin: 0 auto; padding: 24px 24px 72px; display: flex; flex-direction: column; gap: 16px; }
.cf-loading { padding: 32px 0; text-align: center; color: var(--muted); font-size: 15px; }
.cf-feed > .form-msg:empty, .cf-compose .form-msg:empty { display: none; }

/* Feed header: channel name + sort */
.cf-feed-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; }
.cf-feed-title { min-width: 0; flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.cf-feed-title h1 { display: flex; align-items: center; gap: 8px; min-width: 0; font: 700 21px/1.3 var(--head); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.cf-feed-icon { display: inline-flex; color: var(--accent); }
.cf-feed-title p { font-size: 14px; color: var(--muted); }
.cf-feed-title p:empty { display: none; }
.cf-edit-channel { width: 30px; height: 30px; border-radius: 8px; }
.cf-sort { flex: none; display: inline-flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.cf-sort button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.cf-sort button:hover { color: var(--text); }
.cf-sort button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Composer */
.cf-composer { padding: 14px 16px; }
.cf-prompt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 15px; text-align: left; }
.cf-prompt-text {
  flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; padding: 0 18px;
  border-radius: 999px; background: var(--bg); border: 1px solid var(--line); transition: border-color 0.15s ease, color 0.15s ease;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-prompt:hover .cf-prompt-text { border-color: var(--accent-dim); color: var(--text-body); }
.cf-compose { display: flex; flex-direction: column; gap: 12px; border-radius: 12px; }
.cf-compose.is-drop { outline: 2px dashed var(--accent); outline-offset: 6px; }
.cm-page .cf-compose-title { min-height: 50px; font: 700 18px var(--head); }
.cm-page .cf-compose-body { min-height: 130px; resize: vertical; font-size: 15px; }
.cf-compose-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.cf-attach-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--text-body); font-size: 14px; font-weight: 500;
}
.cf-attach-btn:hover { border-color: var(--accent-dim); color: var(--accent-lt); }
.cf-compose-actions { margin-left: auto; }
.cf-compose-actions { margin-left: auto; display: flex; gap: 8px; }
.cm-page .cf-compose-actions .btn { min-height: 40px; padding: 0 18px; font-size: 15px; }
.cf-file-chip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-width: 0; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px; }
.cf-readonly { padding: 12px 16px; border-radius: 12px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 14px; text-align: center; }

/* Post card */
.cf-posts { display: flex; flex-direction: column; gap: 16px; }
.cf-post { padding: 18px 20px 0; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 80px; transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.cf-post.is-pinned { border-color: var(--accent-dim); }
.cf-post.is-highlight { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.16); }
.cf-post-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cf-av { position: relative; flex: none; display: inline-flex; }
.cf-badge {
  position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font: 800 9px/1 var(--head); color: var(--bg); background: var(--role-admin); box-shadow: 0 0 0 2px var(--surface);
}
.cf-badge.is-mod { background: var(--role-mod); }
.cf-post-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.cf-post-author { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
.cf-post-author strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.cf-role-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); }
.cf-role-tag.role-admin { background: rgba(var(--accent-rgb), 0.15); }
.cf-role-tag.role-mod { background: rgba(111, 211, 181, 0.14); }
.cf-post-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-chan-link { padding: 0; border: 0; background: transparent; color: var(--text-body); font: inherit; font-weight: 600; }
.cf-chan-link:hover { color: var(--accent-lt); text-decoration: underline; }
.cf-pinned {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 7px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--accent-lt); background: var(--accent-soft); border: 1px solid var(--accent-dim);
}
.cf-menu-wrap { position: relative; flex: none; margin-right: -8px; }
.cf-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 8; width: max-content; min-width: 200px; max-width: min(280px, calc(100vw - 32px));
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.cf-menu-item {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); font-size: 14px; text-align: left;
}
.cf-menu-item:hover, .cf-menu-item:focus-visible { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.cf-menu-icon { display: inline-flex; }
.cf-menu-item.is-danger { color: #FF8A7A; }
.cf-menu-q { padding: 8px 10px 4px; font-size: 14px; line-height: 1.45; color: var(--text-soft); }
.cf-menu-confirm { display: flex; gap: 6px; padding: 6px; }
.cf-btn-danger { min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: #E5484D; color: #fff; font-size: 14px; font-weight: 600; }
.cf-btn-plain { min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; color: var(--text-soft); font-size: 14px; }
.cf-post-title { font: 700 20px/1.3 var(--head); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.cf-post-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-soft); font-size: 15px; line-height: 1.6; }
.cf-post-body.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; overflow: hidden; }
.cf-post-body a, .cf-comment-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cf-post-body a:hover, .cf-comment-text a:hover { color: var(--accent-lt); }
.cf-mention { padding: 1px 7px; border-radius: 999px; background: rgba(var(--accent-rgb), 0.16); color: var(--accent-lt); font-weight: 600; font-size: 0.93em; }
.cf-more { align-self: flex-start; margin-top: -6px; padding: 0; border: 0; background: transparent; color: var(--accent-lt); font-size: 14px; font-weight: 600; }
.cf-more:hover { text-decoration: underline; }

/* Attachments */
.cf-image { align-self: flex-start; display: block; max-width: 100%; padding: 0; border: 1px solid var(--cf-line); border-radius: 12px; overflow: hidden; background: var(--bg); cursor: zoom-in; }
.cf-image img { display: block; max-width: 100%; max-height: 420px; width: auto; height: auto; object-fit: contain; }
.cf-file { display: flex; align-items: center; gap: 12px; max-width: 440px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.cf-file-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
}
.cf-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cf-file-info strong { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-file-info span { font-size: 12px; color: var(--muted); }
.cf-file-open { flex: none; font-size: 13px; font-weight: 600; color: var(--accent-lt); }
.cf-file-missing { flex: none; font-size: 12px; color: var(--muted); }

/* Likes, comments count, actions */
.cf-stats { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.cf-stats-likes { display: inline-flex; align-items: center; gap: 6px; }
.cf-like-dot { width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--bg); }
.cf-like-dot svg path { fill: currentColor; }
.cf-stats-comments { margin-left: auto; }
.cf-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px 0; border-top: 1px solid var(--cf-line); }
.cf-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 8px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.cf-action:hover { background: var(--cf-hover); color: var(--text); }
.cf-action.is-liked { color: var(--accent); }
.cf-action.is-liked svg path { fill: currentColor; fill-opacity: 0.9; }

/* Comments */
.cf-comments { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 16px; border-top: 1px solid var(--cf-line); }
.cf-comments-more { align-self: flex-start; padding: 0; border: 0; background: transparent; color: var(--text-body); font-size: 13px; font-weight: 600; }
.cf-comments-more:hover { color: var(--accent-lt); text-decoration: underline; }
.cf-comment { display: flex; align-items: flex-start; gap: 10px; }
.cf-comment .cf-badge { width: 15px; height: 15px; font-size: 8px; }
.cf-comment-bubble { min-width: 0; max-width: 100%; padding: 8px 12px 9px; border-radius: 14px; background: var(--surface-2); }
.cf-comment-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.cf-comment-head strong { font-size: 13.5px; font-weight: 600; }
.cf-comment-head time { font-size: 12px; color: var(--muted); }
.cf-comment-text { font-size: 14.5px; line-height: 1.5; color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.cf-comment-del { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.cf-comment-del:hover, .cf-comment-del.is-armed { color: #FF8A7A; }
@media (hover: hover) {
  .cf-comment-del { opacity: 0; transition: opacity 0.15s ease; }
  .cf-comment:hover .cf-comment-del, .cf-comment-del:focus-visible, .cf-comment-del.is-armed { opacity: 1; }
}
.cf-comment-form { display: flex; align-items: center; gap: 10px; }
.cf-comment-field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 0 4px 0 16px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 999px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cf-comment-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12); }
.cm-page .cf-comment-input, .cm-page .cf-comment-input:focus { min-height: 40px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 14.5px; }
.cm-page .cf-comment-input:focus-visible { outline: none; }
.cf-send { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: var(--accent); color: var(--bg); }
.cf-send:hover { background: var(--accent-lt); }

/* Empty feed */
.cf-empty { padding: 44px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.cf-empty-icon { width: 56px; height: 56px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-dim); margin-bottom: 4px; }
.cf-empty h2 { font: 700 18px/1.3 var(--head); letter-spacing: 0; }
.cf-empty p { max-width: 34em; color: var(--muted); font-size: 15px; }
.cf-empty .btn { margin-top: 6px; min-height: 42px; }

/* Learning, Members, About */
.cf-section-head { display: flex; flex-direction: column; gap: 4px; }
.cf-section-head h1 { font: 700 21px/1.3 var(--head); letter-spacing: -0.01em; }
.cf-section-head p { font-size: 14px; color: var(--muted); }
.cf-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cf-span { grid-column: 1 / -1; }
.cf-course { display: flex; flex-direction: column; overflow: hidden; color: var(--text); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.cf-course:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.cf-course-cover { position: relative; aspect-ratio: 16 / 9; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 14px; background: var(--surface-2); overflow: hidden; }
.cf-course-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cf-course-cover.is-generated { background: radial-gradient(120% 120% at 0% 0%, rgba(var(--accent-rgb), 0.45), transparent 60%), var(--surface-2); }
.cf-course-brand { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-lt); }
.cf-course-cover-title { font: 800 17px/1.2 var(--head); overflow-wrap: anywhere; }
.cf-course-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.cf-course-body h2 { font: 700 16px/1.3 var(--head); letter-spacing: 0; }
.cf-course-body p { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.cf-course-meta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-lt); }
.cf-members { display: flex; flex-direction: column; gap: 22px; }
.cf-group h2 { margin-bottom: 10px; font: 500 11px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.cf-member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cf-member { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-width: 0; }
.cf-member-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cf-member-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-member-sub { font-size: 13px; }
.cf-mini { align-self: flex-start; margin-top: 2px; padding: 0; border: 0; background: transparent; color: var(--accent-lt); font-size: 13px; font-weight: 600; }
.cf-mini:hover { text-decoration: underline; }
.cf-about { padding: clamp(22px, 4vw, 32px); display: flex; flex-direction: column; gap: 14px; }
.cf-about h1 { font: 800 clamp(24px, 3.4vw, 30px)/1.2 var(--head); letter-spacing: -0.02em; }
.cf-about p { color: var(--text-body); }
.cf-about-list { display: flex; flex-direction: column; gap: 8px; }
.cf-about-list li { position: relative; padding-left: 20px; color: var(--text-body); }
.cf-about-list li::before { content: ""; position: absolute; left: 2px; top: 0.7em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.cf-about-list strong { color: var(--text); font-weight: 600; }

/* Overlays */
.cf-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.55); }
.cf-lightbox { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(2, 4, 9, 0.9); cursor: zoom-out; }
.cf-lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }
.cf-toast {
  position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 60; width: max-content; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); color: var(--text); font-size: 14px; overflow-wrap: anywhere;
}

/* Admin dialog (also used by the dashboard) */
.dc-dialog { width: min(480px, calc(100% - 32px)); }
.dc-form { padding: 26px; display: flex; flex-direction: column; gap: 16px; border-radius: 20px; }
.dc-form h2 { font-size: 22px; letter-spacing: -0.02em; }
.dc-form-fields { display: flex; flex-direction: column; gap: 14px; }
.dc-form label { font-size: 14px; color: var(--muted); }
.dc-form-actions { justify-content: flex-start; }
.dc-form-danger { margin-left: auto; }
.dc-danger { color: #FF8A7A; }
.dc-danger.is-armed { color: #FF8A7A; text-decoration: underline; }
.dc-form .form-msg:empty { display: none; }

@media (max-width: 800px) {
  .cf-app { grid-template-columns: minmax(0, 1fr); }
  .cf-side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 40; height: auto; width: min(300px, 86%);
    transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0.2s;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
  }
  .cf-side.is-open { transform: none; visibility: visible; }
  .cf-close-side, .cf-mobile-only { display: inline-flex; }
  .cf-tabbar { padding: 0 8px; gap: 2px; }
  .cf-tab { padding: 0 12px; }
  .cf-feed { padding: 16px 16px 64px; }
  .cf-post { padding: 16px 16px 0; }
  .cf-compose-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
}
@media (max-width: 480px) {
  .cf-action span { font-size: 13px; }
  .cf-action { gap: 6px; }
  .cf-pinned span { display: none; }
  .cf-pinned { padding: 4px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-side, .cf-chan, .cf-all, .cf-course, .cf-post, .cf-action { transition: none; }
}

/* ---------- Member dashboard & courses ---------- */
.pt-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.pt-auth-tabs button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 600 15px var(--font); cursor: pointer; }
.pt-auth-tabs button[aria-selected="true"] { background: var(--accent); color: var(--bg); }
.cm-page input[readonly] { background: var(--surface); color: var(--text-soft); border-style: dashed; cursor: not-allowed; }
.cm-page input[readonly]:focus-visible { outline-color: var(--line-strong); }
.pt-step { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: -6px; }
.pt-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pt-user-name { font-size: 15px; font-weight: 500; color: var(--text-soft); }
.pt-app {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 0; align-items: start;
  min-height: calc(100vh - 57px);
}
.pt-side {
  position: sticky; top: 57px; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; min-height: calc(100vh - 57px); border-right: 1px solid var(--line); background: var(--side-bg);
}
.pt-side-label { padding: 18px 12px 6px; font-size: 12px; color: var(--muted); }
/* (shown as pills: see "Sidebar section labels" further down) */
.pt-nav {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 14px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-soft);
  font: 500 15px var(--font); text-decoration: none; text-align: left;
}
.pt-nav:hover { background: var(--surface); color: var(--text); }
.pt-nav[aria-current="true"] { background: var(--accent); color: var(--bg); font-weight: 600; }
/* Batch spaces under "Community" (indented, with a guide line) */
.ad-batch-links { display: flex; flex-direction: column; gap: 2px; }
.ad-batch-links:empty { display: none; }
.pt-nav.pt-nav-sub, .ad-root .ad-nav.pt-nav-sub { white-space: nowrap; min-height: 36px; gap: 10px; margin-left: 22px; width: calc(100% - 22px); padding-left: 16px; font-size: 14px; color: var(--text-body); border-left: 1px solid var(--line-strong); border-radius: 0 10px 10px 0; }
.pt-nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; margin-right: -2px; }
.pt-nav-you { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-lt); font-size: 11px; font-weight: 600; white-space: nowrap; }
.pt-main {
  min-width: 0; display: flex; flex-direction: column; gap: 20px;
  padding: 28px max(16px, env(safe-area-inset-right, 0px)) 72px max(24px, env(safe-area-inset-left, 0px));
  max-width: 1280px; width: 100%;
}
.pt-main > .form-msg:empty { display: none; }
.pt-section { display: flex; flex-direction: column; gap: 22px; }
.pt-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pt-section-head h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.025em; }
.pt-section-head h2 { font-size: 20px; letter-spacing: -0.015em; }
.pt-small-btn { min-height: 42px; padding: 0 18px; font-size: 15px; }

/* Home */
.pt-welcome h1 { font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.02em; line-height: 1.2; }
.pt-welcome p { color: var(--muted); margin-top: 4px; }
.pt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; max-width: 900px; }
.pt-stat {
  display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: 18px;
  color: var(--text); text-decoration: none; text-align: left; font: inherit;
}
.pt-stat:hover { border-color: var(--line-strong); }
.pt-stat-icon { flex: none; width: 44px; height: 44px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg); color: var(--accent); }
.pt-stat-text { display: flex; flex-direction: column; gap: 2px; }
.pt-stat-label { color: var(--muted); font-size: 15px; }
.pt-stat-value { font-size: 17px; color: var(--text-soft); }
.pt-stat-value strong { font-size: 26px; color: var(--text); font-weight: 700; }
.pt-continue { padding: 22px; border-radius: 18px; display: flex; flex-direction: column; gap: 16px; }
.pt-continue-head { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.pt-continue-row { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px; align-items: center; }
.pt-continue-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pt-continue-info h3 { font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.02em; line-height: 1.15; text-transform: uppercase; }
.pt-continue-desc { color: var(--text-body); }
.pt-continue-btn { align-self: flex-start; gap: 10px; min-height: 46px; }
.pt-play { display: inline-flex; width: 22px; height: 22px; border-radius: 999px; align-items: center; justify-content: center; background: var(--text); color: var(--bg); font-size: 10px; padding-left: 2px; }
.pt-meta { font-size: 14px; color: var(--muted); }
.pt-meta.is-warn { color: var(--accent); }
.pt-bar { height: 8px; border-radius: 999px; background: var(--line-strong); overflow: hidden; }
.pt-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }

/* Course cards and covers */
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.pt-course-card { padding: 0; overflow: hidden; border-radius: 18px; text-align: left; color: var(--text); font: inherit; display: flex; flex-direction: column; }
.pt-course-card:hover { border-color: var(--accent); }
.pt-course-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.pt-course-card-body h3 { font-size: 17px; line-height: 1.3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pt-cover { aspect-ratio: 16 / 9; width: 100%; max-width: 100%; background: var(--bg); overflow: hidden; position: relative; }
.pt-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-cover.is-generated {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 18px;
  background:
    radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(135deg, #0E1D3D 0%, #05070D 65%);
}
.pt-cover-brand { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.pt-cover-title { font-size: 22px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; text-transform: uppercase; color: var(--text); overflow-wrap: anywhere; }
.pt-cover-lg { border-radius: 12px; }
.pt-cover-lg .pt-cover-title { font-size: clamp(24px, 3vw, 34px); }
.pt-cover-sm { width: 120px; flex: none; border-radius: 8px; }
.pt-cover-sm.is-generated { padding: 8px; }
.pt-cover-sm .pt-cover-title { font-size: 11px; }
.pt-cover-sm .pt-cover-brand { display: none; }
.pt-draft, .pt-pub { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.pt-pub { border-color: #3E7A57; color: #9FE0B6; }

/* Lesson page */
.pt-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--text-soft); }
.pt-crumb-link { border: 0; background: none; padding: 0; color: var(--text); font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.pt-crumb-sep { color: var(--muted); }
.pt-crumb-current { color: var(--accent); }
.pt-course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.pt-course-main, .pt-course-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pt-player-card { padding: 14px; border-radius: 18px; }
.pt-player { aspect-ratio: 16 / 9; width: 100%; max-width: 100%; background: #000; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pt-player video, .pt-player iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.pt-player-empty { color: var(--muted); padding: 24px; text-align: center; }
.pt-about { padding: 22px; border-radius: 18px; display: flex; flex-direction: column; gap: 10px; }
.pt-about h1 { font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -0.02em; line-height: 1.2; }
.pt-about-label { font-size: 16px; color: var(--accent); font-weight: 600; margin-top: 6px; }
.pt-about p { color: var(--text-body); white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-about .cm-row { margin-top: 8px; }
.pt-complete { min-width: 200px; }
.pt-complete.is-done { background: #1F3A2B; color: #9FE0B6; }
.pt-contents { padding: 0; border-radius: 18px; overflow: hidden; }
.pt-contents-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.pt-contents-head h2 { font-size: 18px; letter-spacing: -0.01em; }
.pt-contents-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pt-contents-count { flex: none; font-size: 13px; color: var(--text-soft); padding-top: 3px; }
.pt-lesson-list { list-style: none; margin: 0; padding: 0; }
.pt-lesson {
  display: grid; grid-template-columns: 22px 96px minmax(0, 1fr) 26px; align-items: center; gap: 12px;
  width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  color: var(--text); text-align: left; font: 500 15px var(--font);
}
.pt-lesson:hover { background: rgba(255, 255, 255, 0.03); }
.pt-lesson[aria-current="true"] { background: var(--accent); color: var(--bg); }
.pt-lesson-num { font-family: var(--mono); font-size: 13px; text-align: center; }
.pt-thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.pt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-thumb.is-generated { color: var(--accent); font-size: 14px; background: linear-gradient(135deg, #0E1D3D, #0A0B0D); }
.pt-lesson-title { line-height: 1.35; overflow-wrap: anywhere; }
.pt-check { width: 26px; height: 26px; border-radius: 999px; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.pt-check.is-done { border-color: #2FB36E; background: #2FB36E; color: #fff; }
.pt-lesson[aria-current="true"] .pt-check:not(.is-done) { border-color: rgba(10, 11, 13, 0.35); }
.pt-lesson[aria-current="true"] .pt-check.is-done { border-color: #fff; }
.pt-lesson-empty { padding: 16px 20px; color: var(--muted); font-size: 14px; }
.pt-contents-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px; }
.pt-contents-foot .btn { min-height: 42px; padding: 0 12px; font-size: 14px; }
.pt-page button.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pt-instructor { padding: 20px; border-radius: 18px; display: flex; flex-direction: column; gap: 12px; }
.pt-instructor h2 { font-size: 18px; }
.pt-instructor-who { display: flex; align-items: center; gap: 12px; }
.pt-instructor-who div { display: flex; flex-direction: column; line-height: 1.3; }
.pt-instructor-who span { font-size: 14px; color: var(--muted); }
.pt-instructor p { font-size: 14px; color: var(--text-body); white-space: pre-wrap; }
.pt-instructor p strong { color: var(--text); font-weight: 600; }

/* Manage */
.pt-manage-help { color: var(--text-body); max-width: 60em; }
.pt-manage-list { display: flex; flex-direction: column; gap: 18px; }
.pt-mcourse { padding: 20px; border-radius: 18px; display: flex; flex-direction: column; gap: 14px; }
.pt-mcourse-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pt-mcourse-title { flex: 1; min-width: 200px; }
.pt-mcourse-title h2 { font-size: 19px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pt-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-mini {
  min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text-soft); font: 500 13px var(--font);
}
.pt-mini:hover { color: var(--text); border-color: var(--text-body); }
.pt-page .pt-mini:disabled { opacity: 0.35; cursor: default; }
.pt-mini.is-danger:hover, .pt-mini.is-armed { color: #FF8A7A; border-color: #FF8A7A; }
.pt-mini.is-add { align-self: flex-start; border-style: dashed; color: var(--accent); border-color: var(--accent); }
.pt-mmodule { padding: 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.pt-mmodule-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pt-mmodule-head h3 { font-size: 16px; }
.pt-mlessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pt-mlesson { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pt-mlesson-info { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; }
.pt-mlesson-info strong { font-size: 15px; overflow-wrap: anywhere; }
.pt-mlesson-empty { padding: 8px 0; color: var(--muted); font-size: 14px; }

/* Admin dialog extras */
.pt-dialog { width: min(560px, calc(100% - 32px)); }
.pt-hint { font-size: 13px; color: var(--muted); }
.pt-checkbox, .pt-radio { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-soft); cursor: pointer; }
.cm-page .pt-checkbox input, .cm-page .pt-radio input { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }
.pt-source { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pt-source legend { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.cm-page input[type="file"] { padding: 10px; min-height: 0; font-size: 14px; }

@media (max-width: 1100px) {
  .pt-course-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .pt-app { grid-template-columns: minmax(0, 1fr); }
  .pt-side { position: static; min-height: 0; flex-direction: row; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pt-side-label { display: none; }
  .pt-nav { width: auto; white-space: nowrap; }
  .pt-continue-row { grid-template-columns: minmax(0, 1fr); }
  .pt-user-name { display: none; }
  .pt-lesson { grid-template-columns: 20px 72px minmax(0, 1fr) 24px; }
  .pt-thumb { width: 72px; }
}

/* ---------- Members-only gate ---------- */
.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 26px 26px;
}
.gate-card { width: 100%; max-width: 520px; padding: clamp(26px, 5vw, 40px); display: flex; flex-direction: column; gap: 24px; }
.gate-locked { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.gate-title { font-size: clamp(28px, 4vw, 36px); line-height: 1.15; letter-spacing: -0.025em; }
.gate-locked p { color: var(--text-body); }
.gate-locked .btn { margin-top: 6px; }

/* ---------- Payment pop-up ---------- */
.pay-card { gap: 24px; }
.pay-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; }
.pay-tabs button {
  min-height: 44px; border: 0; border-radius: 11px; background: transparent; cursor: pointer;
  color: var(--muted); font: 600 15px var(--font);
}
.pay-tabs button[aria-selected="true"] { background: var(--accent); color: var(--bg); }
.pay-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.qr-frame { width: 220px; max-width: 100%; aspect-ratio: 1; padding: 12px; background: #fff; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr-frame.is-missing { padding: 0; background: transparent; }
.qr-frame.is-missing .placeholder { width: 100%; height: 100%; }
.pay-details { margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pay-details div { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pay-details div:last-child { border-bottom: 0; padding-bottom: 0; }
.pay-details dt { font-size: 13px; color: var(--muted); }
.pay-details dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text); overflow-wrap: anywhere; }
.pay-details .mono { font-family: var(--mono); font-size: 18px; letter-spacing: 0.02em; }
.copy {
  min-height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 500 13px var(--font);
}
.copy:hover { border-color: var(--accent); color: var(--accent); }
.copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; color: var(--text-body); }
.pay-steps li { display: flex; gap: 14px; align-items: baseline; }
.pay-steps strong { color: var(--text); }
.pay-main { display: flex; flex-direction: column; gap: 24px; }
.pay-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pay-card .pay-actions button.pay-done-btn {
  margin-left: auto; border: 2px solid var(--accent); background: rgba(76, 141, 255, 0.1); color: var(--accent);
  font: 600 17px var(--font); cursor: pointer; opacity: 1;
}
.pay-card .pay-actions button.pay-done-btn:hover:not(:disabled) { background: var(--accent); color: var(--bg); }
.pay-card .pay-actions button.pay-done-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pay-card .pay-actions button.pay-done-btn:disabled {
  border: 2px dashed var(--dash); background: transparent; color: var(--muted); cursor: not-allowed; transform: none;
}
.pay-done-btn .ico-check, .pay-done-btn:disabled .ico-lock { display: inline-block; }
.pay-done-btn .ico-lock, .pay-done-btn:disabled .ico-check { display: none; }
.pay-done-hint { margin-top: -12px; text-align: right; font-size: 14px; color: var(--muted); }
.pay-verify { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 24px 0 8px; }
.pay-verify[hidden], .pay-main[hidden] { display: none; }
.pay-verify-icon {
  width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: rgba(76, 141, 255, 0.12); border: 1px solid var(--accent);
  animation: pay-pulse 1.8s ease-in-out infinite;
}
.pay-verify h2 { font-size: clamp(26px, 4vw, 32px); line-height: 1.15; letter-spacing: -0.02em; }
.pay-verify p { color: var(--text-body); max-width: 440px; }
.pay-verify .btn { margin-top: 8px; }
@keyframes pay-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(76, 141, 255, 0.35); } 50% { box-shadow: 0 0 0 12px rgba(76, 141, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .pay-verify-icon { animation: none; } }
.final-link { color: #1C1D20; font-size: 15px; font-weight: 500; }
@media (max-width: 560px) {
  .pay-panel { grid-template-columns: 1fr; justify-items: center; }
  .pay-details { width: 100%; }
  .pay-actions { flex-direction: column; }
  .pay-actions .btn { width: 100%; }
  .pay-card .pay-actions button.pay-done-btn { margin-left: 0; }
  .pay-done-hint { text-align: center; }
}

/* ---------- Waitlist pop-up ---------- */
.waitlist-dialog {
  width: min(680px, calc(100% - 32px)); max-width: none; max-height: calc(100% - 32px);
  margin: auto; padding: 0; border: 0; background: transparent; color: var(--text); overflow: auto;
}
.waitlist-dialog::backdrop { background: rgba(5, 6, 8, 0.78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.waitlist-dialog[open] { animation: pop-in 0.18s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
body:has(.waitlist-dialog[open]) { overflow: hidden; }
.dialog-close {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text-soft); cursor: pointer;
}
.dialog-close:hover { color: var(--text); border-color: var(--text-body); }
.dialog-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.waitlist { position: relative; border-radius: var(--radius-lg); padding: clamp(26px, 5vw, 44px); display: flex; flex-direction: column; gap: 28px; }
.waitlist h2 { font-size: clamp(28px, 4vw, 40px); padding-right: 44px; }
.waitlist-done .btn { align-self: flex-start; margin-top: 6px; }
.waitlist-done .btn-ghost { background: transparent; font: 500 16px var(--font); cursor: pointer; }
.waitlist-head { display: flex; flex-direction: column; gap: 14px; }
.waitlist-head p { color: var(--text-body); max-width: 40em; }
.waitlist form { display: flex; flex-direction: column; gap: 22px; max-width: 640px; }
.waitlist fieldset { border: 0; margin: 0; padding: 0; }
.waitlist legend, .waitlist label:not(.hint) { padding: 0; font-size: 16px; font-weight: 500; color: var(--text-soft); }
.waitlist legend { margin-bottom: 10px; }
.waitlist .hint { font-size: 14px; color: var(--muted); }
.waitlist .field-row .field { gap: 6px; }
.waitlist #wl-email, .waitlist #wl-phone { max-width: none; } /* now side by side in a .field-row */
.waitlist .wl-contact-row { align-items: start; }
.req { color: var(--accent); }
.wl-step { display: flex; flex-direction: column; gap: 26px; }
.waitlist legend { line-height: 1.4; }
.choices { display: grid; gap: 8px; }
.waitlist label.choice {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 10px 14px; margin: 0;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px;
  font-size: 16px; font-weight: 400; color: var(--text-soft); cursor: pointer;
}
.waitlist .choice:hover { border-color: var(--text-body); }
.waitlist .choice input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--accent); }
.waitlist .choice:has(input:checked) { border-color: var(--accent); color: var(--text); }
.waitlist .choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.waitlist .scale .choice { justify-content: center; font-family: var(--mono); font-size: 18px; }
.waitlist .scale .choice input { position: absolute; opacity: 0; pointer-events: none; }
.waitlist .scale .choice:has(input:checked) { background: var(--accent); color: var(--bg); }
.scale-ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.waitlist fieldset[aria-invalid="true"] .choice { border-color: #FF8A7A; }
.waitlist textarea {
  width: 100%; min-height: 120px; padding: 12px 14px; resize: vertical;
  background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px;
  font: 400 16px/1.5 var(--font);
}
.waitlist textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.waitlist textarea[aria-invalid="true"] { border-color: #FF8A7A; }
.paste-note { font-size: 14px; color: var(--accent); min-height: 0; }
.paste-note:empty { display: none; }
.waitlist .waitlist-actions button.btn-ghost { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.waitlist-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.waitlist button.btn { border: 0; font: 600 17px var(--font); cursor: pointer; }
.waitlist button.btn:disabled { opacity: 0.5; cursor: wait; }
.waitlist-done { display: flex; flex-direction: column; gap: 10px; padding: 24px; border: 1px solid var(--accent); border-radius: 16px; max-width: 640px; }
.waitlist-done p { color: var(--text-body); }
.waitlist-done .accepted-line { margin-top: -4px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--accent); }
.waitlist-done .accepted-line #wl-accepted-name { font-weight: 800; }

.demo-note { padding: 12px 14px; border: 1px dashed var(--accent); border-radius: 12px; font-size: 14px; color: var(--text-soft); }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 14px; text-decoration: underline; padding: 8px 0; min-height: 44px; }

/* ---------- Footer ---------- */
.footer { padding-top: 40px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 18px; font-size: 14px; color: var(--muted); }
.footer p { max-width: 60em; }
.footer strong { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .steps { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .section { padding-top: 72px; padding-bottom: 72px; }
  .section-tight, .bento.container { padding-bottom: 72px; }
  .hero-inner { padding-top: 32px; padding-bottom: 56px; }
}

@media (max-width: 640px) {
  .nav { border-radius: 24px; padding: 12px 14px; justify-content: center; }
  .nav-links a:not(.btn) { display: none; }
  .nav-note { display: none; }
  .landing { padding-top: 28px; }
  .offer, .focus, .mentor { padding: 26px; }
  .intro { padding: 14px; }
  .cta-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .pm { transition: none; }
  .waitlist-dialog[open] { animation: none; }
}

@media (max-width: 420px) {
  .field-row { grid-template-columns: 1fr; }
  .waitlist #wl-email, .waitlist #wl-phone { max-width: none; }
  .waitlist-actions .btn { width: 100%; }
}

/* ==========================================================
   Blue theme layer
   Glow atmosphere, Montserrat headings, mono labels, beam CTAs,
   accent-bar cards. Colors all come from the tokens in :root.
   ========================================================== */
@property --beam-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

::selection { background: rgba(var(--accent-rgb), 0.35); color: var(--text); }
body { font-size: 16px; line-height: 1.65; }

/* Soft pools of blue light behind the page, like it's lit from somewhere */
body::before {
  content: ""; position: fixed; inset: -20% -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle 420px at 50% 2%, rgba(var(--accent-rgb), 0.30), transparent 70%),
    radial-gradient(circle 260px at 86% 24%, rgba(127, 176, 255, 0.16), transparent 70%),
    radial-gradient(circle 320px at 10% 42%, rgba(var(--accent-rgb), 0.15), transparent 70%),
    radial-gradient(circle 240px at 78% 66%, rgba(127, 176, 255, 0.11), transparent 70%),
    radial-gradient(circle 360px at 18% 90%, rgba(var(--accent-rgb), 0.13), transparent 70%);
  filter: blur(8px);
}
.hero, .landing, .gate { background-image: none; }

/* ---------- Type ---------- */
h1, h2, h3, .price, .focus-title, .admin-title, .brand, .app-name { font-family: var(--head); }
h1, h2 { font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.1; }
h2 { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.15; }
h3 { font-weight: 700; letter-spacing: -0.01em; }
.accent { color: var(--accent-lt); }
.eyebrow.accent, .num, .step-label { color: var(--accent); }
.lead { font-weight: 300; }
.eyebrow { font-size: 11px; letter-spacing: 0.2em; }
.badge {
  font-size: 11px; letter-spacing: 0.18em; padding: 7px 16px;
  color: var(--accent-lt); background: var(--accent-soft); border-color: var(--accent-dim);
}
.num, .step-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.dot { box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.8); }

/* ---------- Buttons ---------- */
.btn { font-family: var(--head); font-weight: 800; letter-spacing: 0.01em; border-radius: 10px; }
.waitlist button.btn, .admin button.btn, .cm-page button.btn { font-family: var(--head); font-weight: 800; font-size: 16px; }
.btn-accent { background: var(--accent); color: var(--bg); box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.28); }
.btn-ghost { border-color: var(--line-strong); background: rgba(11, 17, 30, 0.5); }
.btn-ghost:hover { border-color: var(--accent-dim); color: var(--accent-lt); }

/* Main calls to action: dark button with a light beam travelling around the border */
.btn-accent.btn-lg, .btn-accent.btn-block, .btn-dark {
  position: relative; isolation: isolate;
  background: #070B16; color: #fff;
  box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.22);
}
.btn-accent.btn-lg::before, .btn-accent.btn-block::before, .btn-dark::before,
.btn-accent.btn-lg::after, .btn-accent.btn-block::after, .btn-dark::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.btn-accent.btn-lg::before, .btn-accent.btn-block::before, .btn-dark::before { background: rgba(var(--accent-rgb), 0.35); }
.btn-accent.btn-lg::after, .btn-accent.btn-block::after, .btn-dark::after {
  background: conic-gradient(from var(--beam-angle), transparent 0deg, transparent 290deg, #2F6BFF 335deg, #7FB0FF 352deg, #E3EEFF 360deg);
  filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), 0.9));
  animation: beam-travel 3s linear infinite;
}
@keyframes beam-travel { to { --beam-angle: 360deg; } }

/* ---------- Nav ---------- */
.nav {
  min-height: 60px; padding: 8px 8px 8px 20px; border-radius: 16px;
  background: rgba(7, 11, 22, 0.78); border-color: var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}
.brand { font-weight: 800; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; }
.brand-sub { font-weight: 600; }
.nav-links a:not(.btn), .nav-note { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.nav-links a:not(.btn):hover { color: var(--accent-lt); }

/* ---------- Cards ---------- */
.card { background: rgba(11, 17, 30, 0.72); }
dialog .card { background: var(--surface); }
.chips span { background: var(--surface-2); border-color: var(--line); font-size: 13px; }
.offer { border-color: var(--accent-dim); box-shadow: 0 24px 70px rgba(var(--accent-rgb), 0.12); }
.price { font-weight: 900; }
.landing-card { border-color: var(--line-strong); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }

/* Pain points: blue bar down the left edge */
.pain { position: relative; overflow: hidden; }
.pain::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }

/* Steps: cards with a big faded number in the corner */
.steps { counter-reset: step; gap: 18px; }
.step {
  counter-increment: step; position: relative; overflow: hidden;
  padding: 26px 22px 28px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: rgba(11, 17, 30, 0.72);
}
.step::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.step::after {
  content: "0" counter(step); position: absolute; right: 8px; bottom: -24px; pointer-events: none;
  font-family: var(--head); font-weight: 900; font-size: 110px; line-height: 1; letter-spacing: -0.04em;
  color: var(--accent); opacity: 0.08;
}
.step > * { position: relative; z-index: 1; }
.step h3 { font-size: 19px; }

.fit:not(.fit-no) { border-color: var(--accent-dim); }

/* ---------- FAQ ---------- */
details { border-radius: var(--radius-md); background: rgba(11, 17, 30, 0.72); transition: border-color 0.2s ease; }
details[open] { border-color: var(--accent-dim); }
summary { font-family: var(--head); font-weight: 700; font-size: 16px; }

/* ---------- Final CTA: dark panel lit from above ---------- */
.final {
  color: var(--text); border: 1px solid var(--accent-dim); border-radius: 20px;
  background: radial-gradient(120% 140% at 50% 0%, rgba(var(--accent-rgb), 0.24), transparent 60%), var(--surface);
  box-shadow: 0 30px 80px rgba(var(--accent-rgb), 0.12);
}
.final h2 { font-size: clamp(30px, 4.6vw, 54px); line-height: 1.08; letter-spacing: -0.025em; }
.final p, .final .small { color: var(--text-body); }
.final-price { color: var(--accent-lt); font-size: 18px; letter-spacing: 0.06em; }
.final-link { color: var(--muted); }
.final-link:hover { color: var(--accent-lt); }

/* ---------- Forms ---------- */
.admin input:focus, .waitlist input:focus, .waitlist textarea:focus, .cm-page input:focus, .cm-page textarea:focus, .cm-page select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}
.waitlist .choice:has(input:checked) { background: var(--accent-soft); }

/* ---------- App pages: blue-tinted backgrounds ---------- */
.cm-page { --chat-bg: #080C16; --side-bg: #060912; }

@media (max-width: 640px) {
  .nav { border-radius: 16px; padding: 10px 12px; }
  .brand { font-size: 12px; letter-spacing: 0.1em; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-accent.btn-lg::after, .btn-accent.btn-block::after, .btn-dark::after { animation: none; }
}
/* ---------- Community: "Create a post" pop-up ---------- */
.cf-compose-dialog { width: min(600px, calc(100% - 32px)); }
.cf-compose-dialog .cf-compose { position: relative; padding: 20px 22px 22px; gap: 18px; background: var(--surface); border-radius: var(--radius-lg); }
.cf-compose-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: -4px; }
.cf-compose-top h2 { font: 600 15px var(--font); letter-spacing: 0; color: var(--text-soft); }
.cf-compose-who { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px; }
.cf-compose-who .cm-avatar { width: 52px; height: 52px; font-size: 17px; }
.cf-compose-id { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cf-compose-id strong { font: 700 17px var(--head); overflow-wrap: anywhere; }
.cf-compose-id span { font-size: 13px; color: var(--muted); }
.cf-compose-id b { color: var(--text-soft); font-weight: 600; }
.cf-compose-in { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-soft); }
.cf-compose-chan {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 8px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cf-compose-chan::before { content: "#"; color: var(--accent); font-family: var(--mono); }
.cf-compose .field { gap: 8px; }
.cf-compose .field > label { font-size: 15px; font-weight: 600; color: var(--text-soft); }
.cf-count { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cf-count-wrap { position: relative; }
.cm-page .cf-count-wrap input { padding-right: 92px; min-height: 50px; font: 500 16px var(--font); }
.cf-count-wrap .cf-count { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.cf-body-box { position: relative; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); }
.cf-body-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12); }
.cm-page .cf-body-box textarea { display: block; min-height: 150px; border: 0; background: transparent; resize: vertical; }
.cm-page .cf-body-box textarea:focus, .cm-page .cf-body-box textarea:focus-visible { box-shadow: none; outline: none; }
.cf-body-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px 8px 6px; }
.cf-emoji-pop {
  position: absolute; left: 6px; bottom: 46px; z-index: 3;
  display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; padding: 8px; max-width: calc(100% - 12px);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.cf-emoji-pop button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 19px; line-height: 1; cursor: pointer; }
.cf-emoji-pop button:hover, .cf-emoji-pop button:focus-visible { background: var(--accent-soft); }
.cf-link-row { display: flex; gap: 8px; }
.cm-page .cf-link-row input { flex: 1; min-width: 0; }
.cm-page .cf-link-row .btn { min-height: 46px; padding: 0 16px; font-size: 14px; }
.cf-check { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; font-size: 15px; color: var(--text-soft); cursor: pointer; }
.cm-page .cf-check input { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; accent-color: var(--accent); }
.cf-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-ptool {
  width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text-soft); cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cf-ptool:hover, .cf-ptool[aria-expanded="true"] { border-color: var(--accent-dim); color: var(--accent-lt); }
.cm-page button.cf-compose-post { width: 100%; min-height: 50px; font-size: 16px; }
.cf-actions.is-single { grid-template-columns: minmax(0, 1fr); }
.cf-comments-off { padding: 8px 2px 2px; font-size: 13px; color: var(--muted); }
@media (max-width: 520px) {
  .cf-compose-dialog .cf-compose { padding: 18px 16px; }
  .cf-compose-in { width: 100%; }
  .cf-emoji-pop { grid-template-columns: repeat(6, 36px); }
}
@media (prefers-reduced-motion: reduce) { .cf-ptool { transition: none; } }

/* ---------- Community: reactions ---------- */
.cf-react-badge {
  --rc: var(--accent);
  flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  color: var(--rc); background: color-mix(in srgb, var(--rc) 18%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 45%, transparent);
}
.cf-react-badge.is-sm { width: 20px; height: 20px; }
.cf-react-badge.is-lg { width: 42px; height: 42px; }
.cf-react-stack { display: inline-flex; }
.cf-react-stack .cf-react-badge { box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1px color-mix(in srgb, var(--rc) 45%, transparent); }
.cf-react-stack .cf-react-badge + .cf-react-badge { margin-left: -5px; }
.cf-like-wrap { position: relative; display: flex; min-width: 0; }
.cf-like-wrap > .cf-action { flex: 1; }
.cf-action.is-liked { color: var(--rc, var(--accent)); }
.cf-action.is-liked .cf-react-badge { width: 22px; height: 22px; }
.cf-react-picker {
  position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 6;
  display: flex; gap: 6px; padding: 6px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  animation: cf-react-in 0.16s ease-out;
}
@keyframes cf-react-in { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
.cf-react-opt { padding: 0; border: 0; background: none; border-radius: 999px; cursor: pointer; transition: transform 0.12s ease; }
.cf-react-opt:hover, .cf-react-opt:focus-visible { transform: translateY(-4px) scale(1.12); }
.cf-react-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cf-react-opt.is-on .cf-react-badge { box-shadow: 0 0 0 2px var(--rc); }
@media (max-width: 520px) {
  .cf-react-picker { gap: 4px; padding: 5px 6px; }
  .cf-react-badge.is-lg { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-react-picker { animation: none; }
  .cf-react-opt { transition: none; }
}
/* ---------- Community: who reacted ---------- */
button.cf-stats-likes { padding: 2px 4px; margin: -2px -4px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; cursor: pointer; }
button.cf-stats-likes:hover span:last-child { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cf-rx-dialog { width: min(460px, calc(100% - 32px)); }
.cf-rx { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 22px; background: var(--surface); border-radius: var(--radius-lg); }
.cf-rx-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.cf-rx-tabs::-webkit-scrollbar { display: none; }
.cf-rx-tab {
  --rc: var(--accent);
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 10px;
  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none;
  color: var(--muted); font: 600 14px var(--font); cursor: pointer;
}
.cf-rx-tab:hover { color: var(--text); }
.cf-rx-tab[aria-selected="true"] { color: var(--rc); border-bottom-color: var(--rc); }
.cf-rx-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.cf-rx-all { font-family: var(--head); font-weight: 700; }
.cf-rx-n { font-variant-numeric: tabular-nums; }
.cf-rx-list { display: flex; flex-direction: column; gap: 4px; min-height: 160px; max-height: min(420px, 60vh); overflow-y: auto; }
.cf-rx-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-radius: 10px; }
.cf-rx-row:hover { background: rgba(255, 255, 255, 0.03); }
.cf-rx-face { position: relative; flex: none; display: inline-flex; }
.cf-rx-face .cf-react-badge { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; box-shadow: 0 0 0 2px var(--surface); }
.cf-rx-face .cf-react-badge svg { width: 11px; height: 11px; }
.cf-rx-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-rx-you { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.cf-rx-empty { padding: 28px 8px; text-align: center; color: var(--muted); font-size: 14px; }
/* ---------- Community: reaction look + animation ---------- */
/* Pastel circle with a colored line icon */
.cf-react-badge { background: var(--rb, #E6EDFF); color: var(--rc); box-shadow: none; }
.cf-react-stack .cf-react-badge { box-shadow: 0 0 0 2px var(--surface); }
.cf-react-opt.is-on .cf-react-badge { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--rc); }
.cf-react-badge.is-lg { width: 44px; height: 44px; }
.cf-react-badge.is-lg svg { width: 24px; height: 24px; }

/* The bar springs up, then each reaction pops in one after another */
.cf-react-picker { animation: cf-react-bar 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.3); transform-origin: 20% 100%; }
@keyframes cf-react-bar { from { opacity: 0; transform: translateY(10px) scale(0.85); } to { opacity: 1; transform: none; } }
.cf-react-opt { opacity: 0; animation: cf-react-in-opt 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.5) forwards; animation-delay: calc(var(--i, 0) * 35ms + 40ms); }
@keyframes cf-react-in-opt { from { opacity: 0; translate: 0 14px; scale: 0.4; } to { opacity: 1; translate: 0 0; scale: 1; } }

/* Hover: lift and grow, and each icon does its own little move */
.cf-react-opt { transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.6); }
.cf-react-opt:hover, .cf-react-opt:focus-visible { transform: translateY(-8px) scale(1.25); }
.cf-react-opt::after {
  content: attr(aria-label); position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%) translateY(4px);
  padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.85); color: #fff;
  font: 600 11px var(--font); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.12s, transform 0.12s;
}
.cf-react-opt { position: relative; }
.cf-react-opt:hover::after, .cf-react-opt:focus-visible::after { opacity: 1; transform: translateX(-50%); }
.cf-react-opt:hover [data-r="like"] svg { animation: cf-rx-like 0.6s ease-in-out infinite; transform-origin: 30% 80%; }
.cf-react-opt:hover [data-r="love"] svg { animation: cf-rx-love 0.8s ease-in-out infinite; }
.cf-react-opt:hover [data-r="haha"] svg { animation: cf-rx-haha 0.5s ease-in-out infinite; }
.cf-react-opt:hover [data-r="celebrate"] svg { animation: cf-rx-clap 0.45s ease-in-out infinite; }
.cf-react-opt:hover [data-r="insightful"] { animation: cf-rx-glow 1s ease-in-out infinite; }
.cf-react-opt:hover [data-r="support"] svg { animation: cf-rx-float 0.9s ease-in-out infinite; }
@keyframes cf-rx-like { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-18deg) translateY(-1px); } 60% { transform: rotate(6deg); } }
@keyframes cf-rx-love { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(0.95); } 45% { transform: scale(1.15); } }
@keyframes cf-rx-haha { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg) translateY(-1px); } 75% { transform: rotate(10deg) translateY(-1px); } }
@keyframes cf-rx-clap { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(-12deg) scale(0.9); } }
@keyframes cf-rx-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 135, 10, 0); } 50% { box-shadow: 0 0 16px 4px rgba(245, 165, 36, 0.55); } }
@keyframes cf-rx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* After picking: the reaction bursts onto the Like button */
.cf-action.is-pop .cf-react-badge { animation: cf-rx-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.6); }
.cf-action.is-pop span:last-child { animation: cf-rx-label 0.4s ease-out; }
@keyframes cf-rx-pop { 0% { transform: scale(0.2) rotate(-25deg); } 55% { transform: scale(1.45) rotate(8deg); } 100% { transform: none; } }
@keyframes cf-rx-label { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.cf-action.is-pop .cf-react-badge::after {
  content: ""; position: absolute; inset: -6px; border-radius: 999px; border: 2px solid var(--rc);
  animation: cf-rx-ring 0.55s ease-out forwards; pointer-events: none;
}
.cf-action .cf-react-badge { position: relative; }
@keyframes cf-rx-ring { from { opacity: 0.9; transform: scale(0.5); } to { opacity: 0; transform: scale(1.6); } }

@media (prefers-reduced-motion: reduce) {
  .cf-react-picker, .cf-react-opt, .cf-react-opt svg, .cf-react-opt [data-r], .cf-action.is-pop .cf-react-badge,
  .cf-action.is-pop span:last-child, .cf-action.is-pop .cf-react-badge::after { animation: none !important; }
  .cf-react-opt { opacity: 1; transition: none; }
}
/* ---------- Community: real emoji reactions ---------- */
.cf-emoji {
  display: inline-block; line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
  font-style: normal; font-weight: 400;
}
.cf-react-badge { background: transparent; box-shadow: none; }
.cf-react-badge.is-sm { width: 20px; height: 20px; }
.cf-react-badge.is-sm .cf-emoji { font-size: 14px; }
.cf-react-badge.is-lg { width: 44px; height: 44px; background: transparent; }
.cf-react-badge.is-lg .cf-emoji { font-size: 32px; }
/* Small emoji in the count and list sit on a dark coin so they overlap cleanly */
.cf-react-stack .cf-react-badge, .cf-rx-face .cf-react-badge, .cf-rx-tab .cf-react-badge { background: var(--surface-2); box-shadow: 0 0 0 2px var(--surface); }
.cf-action .cf-react-badge { width: 22px; height: 22px; background: transparent; }
.cf-action .cf-react-badge .cf-emoji { font-size: 17px; }
.cf-rx-face .cf-react-badge .cf-emoji { font-size: 11px; }
.cf-react-opt.is-on .cf-react-badge { box-shadow: none; background: rgba(var(--accent-rgb), 0.16); }
.cf-react-opt.is-on .cf-react-badge::before {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 4px; height: 4px; margin-left: -2px; border-radius: 999px; background: var(--accent);
}
.cf-react-opt .cf-react-badge { position: relative; }

/* Hover moves now act on the emoji itself */
.cf-react-opt:hover [data-r="like"] .cf-emoji { animation: cf-rx-like 0.6s ease-in-out infinite; transform-origin: 30% 80%; }
.cf-react-opt:hover [data-r="love"] .cf-emoji { animation: cf-rx-love 0.8s ease-in-out infinite; }
.cf-react-opt:hover [data-r="haha"] .cf-emoji { animation: cf-rx-haha 0.5s ease-in-out infinite; }
.cf-react-opt:hover [data-r="celebrate"] .cf-emoji { animation: cf-rx-clap 0.5s ease-in-out infinite; }
.cf-react-opt:hover [data-r="insightful"] { animation: cf-rx-glow 1s ease-in-out infinite; border-radius: 999px; }
.cf-react-opt:hover [data-r="support"] .cf-emoji { animation: cf-rx-float 0.9s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .cf-react-opt .cf-emoji, .cf-react-opt [data-r] { animation: none !important; }
}
/* ---------- Community: comment threads ---------- */
button.cf-stats-comments { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
button.cf-stats-comments:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cf-comments { gap: 16px; }
.cf-thread { display: flex; flex-direction: column; gap: 12px; }
.cf-comment { gap: 12px; }
.cf-comment-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cf-comment-head { align-items: center; flex-wrap: nowrap; gap: 8px; min-height: 22px; }
.cf-comment-head strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cf-comment-right { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; flex: none; }
.cf-comment-right time { font-size: 12px; color: var(--muted); }
.cf-comment-text { font-size: 15px; color: var(--text); }
.cf-comment-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.cf-clink { padding: 2px 0; border: 0; background: none; color: var(--text-body); font: 600 13px var(--font); cursor: pointer; }
.cf-clink:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cf-clink.is-liked { color: var(--accent-lt); }
.cf-clink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.cf-clike-n { display: inline-flex; align-items: center; gap: 5px; color: var(--text-body); font-variant-numeric: tabular-nums; }
.cf-clike-n .cf-react-badge { width: 18px; height: 18px; background: var(--surface-2); }
.cf-clike-n .cf-react-badge .cf-emoji { font-size: 11px; }
.cf-sep { color: var(--line-strong); }
.cf-dot { color: var(--muted); }
/* Replies hang off the parent with a thread line */
.cf-replies {
  display: flex; flex-direction: column; gap: 12px;
  margin-left: 15px; padding-left: 26px; border-left: 2px solid var(--line-strong); border-bottom-left-radius: 12px;
}
.cf-comment.is-reply .cm-avatar { width: 28px; height: 28px; font-size: 11px; }
/* ⋮ menu on each comment */
.cf-cmenu-wrap { position: relative; display: inline-flex; }
.cf-cmenu-btn { width: 28px; height: 28px; color: var(--muted); }
.cf-cmenu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 6; min-width: 170px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}
.cf-cmenu .cf-comment-del { display: block; width: 100%; padding: 9px 10px; border-radius: 7px; text-align: left; font-size: 14px; color: #FF8A7A; opacity: 1; }
.cf-cmenu .cf-comment-del:hover { background: rgba(255, 138, 122, 0.1); }
/* Comment box: grows with the text, emoji + send underneath */
.cf-comment-form { align-items: flex-start; }
.cf-comment-field {
  position: relative; flex-direction: column; align-items: stretch; gap: 4px; padding: 10px 12px 8px 14px;
  border-radius: 14px; background: var(--bg);
}
.cm-page .cf-comment-input, .cm-page .cf-comment-input:focus {
  min-height: 24px; max-height: 220px; padding: 2px 0; resize: none; overflow-y: auto; line-height: 1.5; font-size: 15px;
}
.cf-comment-foot { display: flex; align-items: center; justify-content: space-between; }
.cf-comment-foot .cf-icon-btn { width: 32px; height: 32px; color: var(--muted); }
.cf-comment-foot .cf-icon-btn:hover { color: var(--accent-lt); }
.cf-emoji-pop.is-comment { left: 6px; bottom: 46px; }
.cf-reply-to { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cf-reply-cancel { margin-left: auto; padding: 0; border: 0; background: none; color: var(--muted); font: 600 12px var(--font); cursor: pointer; }
.cf-reply-cancel:hover { color: var(--text); text-decoration: underline; }
.cf-comment-form.is-reply .cm-avatar { width: 28px; height: 28px; font-size: 11px; }
@media (max-width: 520px) {
  .cf-replies { margin-left: 8px; padding-left: 14px; }
}
/* ---------- Community: post pop-up ---------- */
.cf-post-dialog { width: min(720px, calc(100% - 32px)); overflow: hidden; }
.cf-pd {
  display: flex; flex-direction: column; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  padding: 0; overflow: hidden; background: var(--surface); border-radius: var(--radius-lg);
}
.cf-pd-head {
  position: relative; flex: none; display: flex; align-items: center; justify-content: center;
  min-height: 60px; padding: 0 56px; border-bottom: 1px solid var(--line);
}
.cf-pd-head h2 { font: 700 18px var(--head); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-pd-close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 999px; background: var(--surface-2); }
.cf-pd-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cf-pd-body .cf-post { border: 0; border-radius: 0; background: none; box-shadow: none; }
.cf-pd-body .cf-comments { border-top: 1px solid var(--line); }
.cf-pd-foot { flex: none; padding: 12px 18px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.cf-pd-foot[hidden] { display: none; }
.cf-pd-foot .cf-comment-form { margin: 0; }
/* "View 3 replies" under a comment */
.cf-creplies {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 0 44px; padding: 2px 0;
  border: 0; background: none; color: var(--text-body); font: 600 13px var(--font); cursor: pointer;
}
.cf-creplies:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.cf-creplies-icon { display: inline-flex; transition: transform 0.15s ease; }
.cf-creplies.is-open .cf-creplies-icon { transform: rotate(180deg); }
.cf-creplies:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 520px) {
  .cf-post-dialog { width: 100%; max-width: 100%; max-height: 100%; margin: 0; }
  .cf-pd { max-height: 100vh; max-height: 100dvh; border-radius: 0; }
  .cf-pd-foot { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .cf-creplies-icon { transition: none; } }
/* ---------- Community: comment attachments ---------- */
.cf-comment-tools { display: inline-flex; align-items: center; gap: 2px; }
.cf-comment-field.is-drop { border-color: var(--accent); border-style: dashed; }
.cf-cfile {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px;
}
.cf-cfile[hidden] { display: none; }
.cf-cfile-thumb { width: 52px; height: 52px; flex: none; object-fit: cover; border-radius: 8px; background: var(--bg); }
.cf-cfile .cf-file-info { flex: 1; min-width: 0; }
.cf-cfile .cf-file-info strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-cfile .cf-file-info span { font-size: 12px; color: var(--muted); }
.cf-comment-att { margin-top: 4px; }
.cf-comment-att.cf-image { max-width: min(320px, 100%); }
.cf-comment-att.cf-image img { max-height: 260px; }
.cf-comment-att.cf-file { max-width: 360px; }
/* ---------- Community: keep pop-ups smooth ---------- */
/* A blurred backdrop has to be redrawn whenever anything behind it changes; a plain dark one doesn't. */
.cf-post-dialog::backdrop, .cf-compose-dialog::backdrop, .cf-rx-dialog::backdrop, .dc-dialog::backdrop {
  background: rgba(3, 5, 10, 0.82); -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* Nothing behind an open pop-up needs to keep animating. */
body:has(dialog[open]) .btn-accent.btn-lg::after,
body:has(dialog[open]) .btn-accent.btn-block::after,
body:has(dialog[open]) .btn-dark::after { animation-play-state: paused; }
/* The pop-up scrolls on its own layer. */
.cf-pd-body { will-change: scroll-position; contain: content; }
/* ---------- Member page: mentor photo, payout certificates, payment QR ---------- */
img.mentor-photo { object-position: 50% 30%; background: var(--surface); }

.results-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.results-sub { font-size: 18px; letter-spacing: -0.01em; margin-top: 4px; }
.results-sub .muted { font: 400 14px var(--font); }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.result { margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 10px; background: rgba(11, 17, 30, 0.72); border: 1px solid var(--line); border-radius: var(--radius-md); }
.result.is-total { border-color: var(--accent-dim); box-shadow: 0 18px 50px rgba(var(--accent-rgb), 0.10); }
.result-img {
  display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 10px; overflow: hidden;
  background: #05070D; cursor: zoom-in; transition: transform 0.18s ease;
}
.result-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.result-img:hover { transform: translateY(-2px); }
.result-img:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.result figcaption { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 2px; }
.result figcaption strong { font: 800 18px var(--head); color: var(--text); font-variant-numeric: tabular-nums; }
.result.is-total figcaption strong { font-size: 24px; color: var(--accent-lt); }
.result figcaption span { font-size: 13px; color: var(--muted); }

.zoom-dialog {
  width: min(1100px, calc(100% - 32px)); max-width: none; max-height: calc(100% - 32px); margin: auto; padding: 48px 16px 16px;
  border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
}
.zoom-dialog::backdrop { background: rgba(3, 5, 10, 0.88); }
.zoom-dialog img { display: block; max-width: 100%; max-height: calc(100vh - 160px); margin: 0 auto; border-radius: 10px; }
.zoom-cap { margin-top: 12px; text-align: center; font-size: 15px; color: var(--text-soft); }

.pay-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pay-tabs button { padding: 0 6px; }
.qr-frame { width: 240px; aspect-ratio: auto; padding: 8px; }
.qr-frame img { width: 100%; height: auto; max-height: 340px; object-fit: contain; border-radius: 10px; }

@media (max-width: 900px) {
  .results-totals { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .result { padding: 8px; }
  .result figcaption strong { font-size: 16px; }
  .pay-tabs button { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .result-img { transition: none; } }
/* ---------- Member page: payout certificates sliding left ---------- */
.results-marquee {
  position: relative; overflow: hidden; margin: 0 -24px; padding: 8px 0 14px;
  /* soft fade at both edges */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.results-track {
  display: flex; width: max-content;
  animation: results-slide var(--loop-time, 68s) linear infinite;
}
/* margin (not gap) so the copied half is exactly half the track and the loop doesn't jump */
.results-track > .result { flex: none; width: 300px; margin-right: 16px; }
.results-track > .result.is-total { width: 340px; }
@keyframes results-slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* Hover, touch or keyboard focus pauses it so people can look at a certificate */
.results-marquee:hover .results-track,
.results-marquee:focus-within .results-track,
.results-marquee:active .results-track { animation-play-state: paused; }
.results-track .result-img:hover { transform: translateY(-4px) scale(1.02); }
@media (max-width: 520px) {
  .results-marquee { margin: 0 -16px; }
  .results-track > .result { width: 230px; margin-right: 12px; }
  .results-track > .result.is-total { width: 260px; }
}
/* Reduced motion: no sliding; the row scrolls sideways by hand instead */
@media (prefers-reduced-motion: reduce) {
  .results-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; scroll-snap-type: x mandatory; }
  .results-track { animation: none; }
  .results-track > .result { scroll-snap-align: start; }
  .results-track > .result[aria-hidden="true"] { display: none; }
}
/* ---------- Top bar links: plain, readable text ---------- */
.nav-links a:not(.btn) {
  font-family: var(--font); font-size: 15px; font-weight: 500; letter-spacing: 0; text-transform: none;
  color: var(--text-soft);
}
.nav-links a:not(.btn):hover { color: #fff; }
.nav-links a:not(.btn):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Member page: price options ---------- */
.plan-list { display: flex; flex-direction: column; gap: 6px; margin-top: -6px; }
.plan-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  font-size: 15px; color: var(--text-soft);
}
.plan-row strong { font: 800 16px var(--head); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-row small { font: 500 13px var(--font); color: var(--muted); }
.plan-row.is-best { border-color: var(--accent-dim); background: var(--accent-soft); }
/* Each option: name + how it's paid on the left; price (per month) + the total on the right */
.plan-row { align-items: center; }
.plan-name, .plan-price { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-price { align-items: flex-end; text-align: right; }
.plan-name small, .plan-price > small { font-size: 12px; }
.plan-price strong small { font-size: 12px; font-weight: 500; margin-left: 1px; }
.plan-price > small { color: var(--text-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }

.pay-plans { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pay-plans legend { margin-bottom: 10px; padding: 0; font-size: 15px; font-weight: 600; color: var(--text-soft); }
.pay-plan {
  position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pay-plan input { position: absolute; opacity: 0; pointer-events: none; }
.pay-plan-name { font-size: 13px; color: var(--muted); }
.pay-plan-price { font: 800 19px var(--head); color: var(--text); font-variant-numeric: tabular-nums; }
.pay-plan-price small { font: 500 12px var(--font); color: var(--muted); }
.pay-plan-note { font-size: 12px; color: var(--muted); }
.pay-plan:hover { border-color: var(--text-body); }
.pay-plan:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.pay-plan:has(input:checked) .pay-plan-name { color: var(--accent-lt); }
.pay-plan:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) {
  .pay-plans { grid-template-columns: minmax(0, 1fr); }
  .pay-plan { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
  .pay-plan-name { flex: 1 0 100%; }
}
@media (prefers-reduced-motion: reduce) { .pay-plan { transition: none; } }
/* The waitlist form's label rule removes padding; put it back on the payment options. */
.waitlist label.pay-plan { padding: 12px 14px; font-weight: 400; }

/* ---------- Solid blue buttons: white text on hover ---------- */
/* The blue deepens a little at the same time so the white text stays easy to read. */
.btn-accent { transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease; }
.btn-accent:hover { color: #fff; background-color: #2F6FE6; opacity: 1; }
/* ---------- Dark "beam" buttons: blue background on hover ---------- */
.btn-accent.btn-lg, .btn-accent.btn-block, .btn-dark { transition: transform 0.15s ease, background-color 0.18s ease, box-shadow 0.18s ease; }
.btn-accent.btn-lg:hover, .btn-accent.btn-block:hover, .btn-dark:hover {
  background-color: #2F6FE6; color: #fff; opacity: 1;
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.45);
}
/* ---------- "Done, I've sent it": white text ---------- */
.pay-card .pay-actions button.pay-done-btn:not(:disabled) { color: #fff; }
.pay-card .pay-actions button.pay-done-btn:hover:not(:disabled) { background: #2F6FE6; border-color: #2F6FE6; color: #fff; }
/* ---------- Keep the member-page pop-ups smooth ---------- */
/* A blurred backdrop has to be redrawn every time anything behind it moves (the results slider
   never stops), which made the payment pop-up lag. A plain dark backdrop costs nothing. */
.waitlist-dialog::backdrop, .zoom-dialog::backdrop {
  background: rgba(3, 5, 10, 0.84); -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* Nothing behind an open pop-up needs to move. */
body:has(dialog[open]) .results-track { animation-play-state: paused; }
/* The slider also rests while it's scrolled out of view (set by main.js). */
.results-marquee.is-offscreen .results-track { animation-play-state: paused; }
/* The payment pop-up scrolls on its own layer. */
#pay-dialog { will-change: transform; }
#pay-dialog .qr-frame img { content-visibility: auto; }
/* Buttons inside the open pop-up keep their moving edge light; only the page behind it rests. */
body:has(dialog[open]) dialog .btn-accent.btn-lg::after,
body:has(dialog[open]) dialog .btn-accent.btn-block::after,
body:has(dialog[open]) dialog .btn-dark::after { animation-play-state: running; }
@media (prefers-reduced-motion: reduce) {
  body:has(dialog[open]) dialog .btn-accent.btn-lg::after,
  body:has(dialog[open]) dialog .btn-accent.btn-block::after,
  body:has(dialog[open]) dialog .btn-dark::after { animation: none; }
}
/* ---------- Admin: the page stays still, the applications list scrolls inside the panel ---------- */
@media (min-width: 701px) {
  body:has(.admin-card.is-wide) { overflow: hidden; }
  main.admin:has(.admin-card.is-wide) { height: 100vh; height: 100dvh; min-height: 0; padding-top: 24px; padding-bottom: 24px; }
  .admin-card.is-wide { max-height: 100%; min-height: 0; overflow: hidden; }
  .admin-card.is-wide > * { flex-shrink: 0; }
  .admin-card.is-wide > #panel-view:not([hidden]) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .admin-card.is-wide #panel-view > * { flex-shrink: 0; }
  .admin-card.is-wide #app-list {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    margin-right: -10px; padding-right: 10px;
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  }
}
/* ---------- Admin: compact application cards so a whole one fits in the panel ---------- */
.admin-card.is-wide { gap: 18px; padding: 24px 26px; }
.admin-card.is-wide #panel-view { gap: 14px; }
.admin-card.is-wide #list-msg:empty { display: none; }
.admin-card.is-wide .admin-title { font-size: 26px; }
.app-list { gap: 12px; }
.app-item { gap: 12px; padding: 16px 18px; }
.app-name { font-size: 18px; }
.app-meta { margin-top: 2px; font-size: 13px; }
.app-facts { gap: 8px; }
.app-facts div { padding: 8px 12px; }
.app-facts dt { font-size: 11px; }
.app-facts dd { font-size: 14px; }
/* "Biggest why" and "Biggest struggles" side by side */
.app-longs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.app-long h3 { font-size: 13px; margin-bottom: 2px; }
.app-long p { font-size: 15px; line-height: 1.45; }
.app-actions { gap: 8px 12px; }
.app-actions .btn { min-height: 38px; padding: 0 16px; font-size: 14px; }
.app-actions .link-btn { min-height: 38px; padding: 0; font-size: 13px; }
.app-decided { font-size: 12px; }
@media (max-width: 700px) {
  .app-longs { grid-template-columns: minmax(0, 1fr); }
}
/* Same size for every action button; text links line up with them */
.admin .app-actions .btn, .admin .app-actions button.btn { font-size: 14px; min-height: 38px; padding: 0 16px; }
.admin .app-actions .link-btn { display: inline-flex; align-items: center; }

/* ---------- Admin: payment option the member chose ---------- */
.app-pay {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 14px;
  border: 1px dashed var(--line-strong); border-radius: 12px; font-size: 14px; color: var(--muted);
}
.app-pay.is-set { border-style: solid; border-color: var(--accent-dim); background: var(--accent-soft); color: var(--text-body); }
.app-pay-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.app-pay.is-set .app-pay-label { color: var(--accent-lt); }
.app-pay strong { font-size: 15px; color: var(--text); font-weight: 600; }
.app-pay-meta { font-size: 13px; }
/* ---------- Member page: intro video player ---------- */
/* Dark browser controls instead of the white bar, and the video fills its frame. */
.intro-video { color-scheme: dark; height: auto; max-width: 100%; border: 1px solid var(--line); background: #000; }
.intro-video:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* "Tap for sound" button over the autoplaying (muted) intro video */
.intro-player { position: relative; }
.intro-sound {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; cursor: pointer;
  background: rgba(5, 7, 13, 0.72); color: #fff; font: 700 15px var(--head);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: intro-sound-pulse 2s ease-in-out infinite;
}
.intro-sound svg { color: var(--accent-lt); }
.intro-sound:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.intro-sound:hover svg { color: var(--bg); }
.intro-sound:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@keyframes intro-sound-pulse { 0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 0 rgba(var(--accent-rgb), .45); } 50% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 10px rgba(var(--accent-rgb), 0); } }
@media (prefers-reduced-motion: reduce) { .intro-sound { animation: none; } }
/* ---------- Member page: payment locked until the intro video is finished ---------- */
[data-pay].is-locked { opacity: 0.6; cursor: not-allowed; filter: saturate(0.6); }
[data-pay].is-locked:hover { transform: none; opacity: 0.75; }
[data-pay] .pay-lock-icon { flex: none; margin-right: 2px; }
.intro-gate { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.intro-gate-bar { display: block; height: 6px; border-radius: 999px; background: var(--line-strong); overflow: hidden; }
.intro-gate-bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 0.4s linear; }
.intro-gate-text { font-size: 13px; color: var(--text-body); font-variant-numeric: tabular-nums; }
.intro-gate.is-done .intro-gate-bar > span { background: #2FB36E; }
.intro-gate.is-done .intro-gate-text { color: #9FE0B6; font-weight: 600; }
.intro-gate.is-nudge { animation: intro-gate-nudge 0.5s ease; }
.intro-gate.is-nudge .intro-gate-text { color: var(--accent-lt); font-weight: 600; }
@keyframes intro-gate-nudge { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .intro-gate.is-nudge { animation: none; } .intro-gate-bar > span { transition: none; } }
/* "Watch first · Sound on · 5:14" above the intro video: plain, readable text */
.intro-head.eyebrow {
  font-family: var(--font); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--text-soft); align-items: center;
}
.intro-head.eyebrow > span:last-child { color: var(--text-body); font-weight: 500; font-variant-numeric: tabular-nums; }
/* ---------- Small labels site-wide: readable text instead of tiny spaced-out capitals ---------- */
.eyebrow {
  font-family: var(--font); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.eyebrow.muted { color: var(--text-body); }
.eyebrow.accent { color: var(--accent-lt); }
.badge {
  font-family: var(--font); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none;
  padding: 8px 18px; color: var(--accent-lt);
}
/* ---------- Payment pop-up: two columns on computers so it fits without scrolling ---------- */
@media (min-width: 900px) {
  #pay-dialog { width: min(980px, calc(100% - 32px)); }
  #pay-dialog .pay-card { padding: 30px 34px 26px; }
  #pay-dialog .pay-main {
    display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 34px; row-gap: 16px; align-items: start;
  }
  #pay-dialog .pay-main > * { grid-column: 1; min-width: 0; }
  /* QR + account details on the right, next to everything else */
  #pay-dialog .pay-main > .pay-panel {
    grid-column: 2; grid-row: 1 / span 8; display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  }
  #pay-dialog .pay-panel .qr-frame { width: 100%; max-width: 300px; padding: 8px; }
  #pay-dialog .pay-panel .qr-frame img { max-height: 330px; }
  #pay-dialog .pay-details { gap: 8px; }
  #pay-dialog .pay-details div { padding-bottom: 8px; }
  #pay-dialog .pay-details .mono { font-size: 16px; }
  #pay-dialog .waitlist-head { gap: 8px; padding-right: 40px; }
  #pay-dialog .waitlist-head h2 { font-size: 34px; }
  #pay-dialog .waitlist-head p { font-size: 15px; line-height: 1.55; }
  #pay-dialog .pay-plans legend { margin-bottom: 8px; }
  #pay-dialog .pay-steps { gap: 6px; font-size: 15px; }
  #pay-dialog .pay-actions .btn-lg { min-height: 50px; }
  #pay-dialog .pay-done-hint { margin-top: -8px; text-align: left; }
}@media (min-width: 900px) {
  #pay-dialog { max-height: calc(100% - 16px); }
  #pay-dialog .pay-card { padding: 24px 30px 20px; }
  #pay-dialog .pay-main { row-gap: 12px; }
  #pay-dialog .pay-main > .pay-panel { margin-top: 46px; }          /* clear of the close button */
  #pay-dialog .pay-panel .qr-frame img { max-height: 270px; }
  #pay-dialog .waitlist-head h2 { font-size: 30px; }
  #pay-dialog .pay-plan { padding-top: 10px; padding-bottom: 10px; }
  #pay-dialog .pay-tabs button { min-height: 40px; }
  #pay-dialog .pay-actions .btn-lg { min-height: 46px; }
}
/* ---------- Payment progress: chosen option locked, payments counted ---------- */
.pay-status {
  margin: 0; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  color: var(--accent-lt); background: var(--accent-soft); border: 1px solid var(--accent-dim);
}
.pay-status[hidden] { display: none; }
.waitlist label.pay-plan.is-off, .pay-plan.is-off { opacity: 0.35; cursor: not-allowed; }
.pay-plan.is-off:hover { border-color: var(--line-strong); }
.app-pay-count { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--accent-lt); border: 1px solid var(--accent-dim); }
.app-pay-count.is-complete { color: #9FE0B6; border-color: #3E7A57; background: #1F3A2B; }
.admin .app-pay .app-pay-reset { margin-left: auto; min-height: 0; padding: 0; font-size: 12px; }
/* Reset payment: red text, no underline */
.admin .app-pay .app-pay-reset { color: #FF8A7A; text-decoration: none; font-weight: 600; }
.admin .app-pay .app-pay-reset:hover { color: #FFB3A8; text-decoration: none; }

/* "You're fully paid" version of the payment message */
.pay-verify.is-paid .pay-verify-icon { color: #2FB36E; background: rgba(47, 179, 110, 0.12); border-color: #2FB36E; animation: none; }
.pay-verify.is-paid .eyebrow { color: #9FE0B6; }
/* ---------- Admin: monthly renewals (access date, confirm payment, reminder) ---------- */
.app-pay-access { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text-soft); border: 1px solid var(--line-strong); }
.app-pay-access.is-ok { color: #9FE0B6; border-color: #3E7A57; background: #1F3A2B; }
.app-pay-access.is-soon { color: #F6CF8E; border-color: #7A5A1E; background: rgba(245, 185, 92, 0.10); }
.app-pay-access.is-late { color: #FFB3A8; border-color: #8A3328; background: rgba(255, 107, 87, 0.12); }
.app-pay-access.is-wait { color: var(--muted); border-style: dashed; }
.app-pay-tools { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-left: auto; }
.admin .app-pay .app-pay-tools .app-pay-reset { margin-left: 0; }
.admin .app-pay .app-pay-tools .btn { min-height: 30px; padding: 0 12px; font-size: 13px; border-radius: 999px; }
.admin .app-pay .app-pay-tools .btn-ghost { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.status-paused { background: rgba(255, 107, 87, 0.14); border-color: #8A3328; color: #FFB3A8; }
/* ---------- Brand logo (wc mark) ---------- */
.brand-logo { display: block; flex: none; height: 22px; width: auto; }
.brand { gap: 12px; }
.cf-logo img { display: block; width: 78%; height: auto; }
@media (max-width: 640px) { .brand-logo { height: 18px; } }
/* ---------- Minimal page-switch animation ---------- */
/* Between pages: the browser crossfades old → new (Chrome, Edge, Safari; others just switch). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; animation-timing-function: ease-out; }
/* The top bar stays put while the content fades. */
.nav-wrap, .cm-top { view-transition-name: topbar; }
::view-transition-group(topbar) { animation-duration: 0s; }

/* Inside the dashboard and community: new content fades in and rises a few pixels. */
@keyframes wx-page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pt-main > .pt-section, .pt-main > .cx, .cf-panel:not([hidden]) { animation: wx-page-in 0.22s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .pt-main > .pt-section, .pt-main > .cx, .cf-panel:not([hidden]) { animation: none; }
}
/* ---------- Loading screen: logo + sliding light ---------- */
.wx-loader{position:fixed;inset:0;z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;background:#05070D}
.wx-loader img{height:46px;width:auto;animation:wxl-pulse 1.6s ease-in-out infinite}
.wx-loader-bar{position:relative;width:148px;height:3px;border-radius:3px;background:rgba(255,255,255,.08);overflow:hidden}
.wx-loader-bar::after{content:"";position:absolute;top:0;bottom:0;left:0;width:45%;border-radius:inherit;background:linear-gradient(90deg,transparent,#4C8DFF,#7FB0FF,transparent);animation:wxl-slide 1.1s cubic-bezier(.4,0,.2,1) infinite}
@keyframes wxl-pulse{0%,100%{opacity:.6;transform:scale(.97)}
50%{opacity:1;transform:scale(1)}
}
@keyframes wxl-slide{from{transform:translateX(-100%)}
to{transform:translateX(230%)}
}
@media (prefers-reduced-motion:reduce){.wx-loader img,.wx-loader-bar::after{animation:none}
.wx-loader-bar::after{left:27%}
}


/* ==========================================================================
   Admin panel (admin.html): full-screen app — top bar, sidebar, lists, detail drawer
   ========================================================================== */
.ad-root { --ad-side: #060912; --ad-panel: #0A0F1B; --ad-raise: #0F1626;
  --t-blue: #9CC2FF; --t-blue-bg: rgba(76, 141, 255, 0.12); --t-blue-line: #24467F;
  --t-green: #9FE0B6; --t-green-bg: rgba(72, 190, 120, 0.12); --t-green-line: #2F6B48;
  --t-amber: #F6CF8E; --t-amber-bg: rgba(245, 185, 92, 0.12); --t-amber-line: #7A5A1E;
  --t-red: #FFB3A8; --t-red-bg: rgba(255, 107, 87, 0.12); --t-red-line: #8A3328;
  font-family: var(--font); color: var(--text); }
.ad-root h1, .ad-root h2, .ad-root h3, .ad-root h4, .ad-root p, .ad-root ul, .ad-root dl, .ad-root dd { margin: 0; }
.ad-root ul { padding: 0; list-style: none; }
.ad-root button { font-family: var(--font); }
.ad-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ad-show-sm, .ad-lbl-short { display: none; }
.ad-root svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ad-root svg circle { fill: currentColor; stroke: none; }
.ad-selectable { user-select: all; overflow-wrap: anywhere; }

/* Buttons */
.ad-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px;
  font: 600 14.5px/1.2 var(--font); letter-spacing: 0; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ad-btn:focus-visible, .ad-icon-btn:focus-visible, .ad-nav:focus-visible, .ad-chip:focus-visible, .ad-stat:focus-visible,
.ad-menu-item:focus-visible, .ad-brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ad-btn:disabled { opacity: 0.5; cursor: wait; }
.ad-btn-primary { background: var(--accent); color: var(--bg); }
.ad-btn-primary:hover { background: #6AA0FF; color: var(--bg); }
.ad-btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.ad-btn-ghost:hover { background: var(--surface-2); border-color: var(--accent-dim); color: var(--text); }
.ad-btn-amber { background: var(--t-amber-bg); border-color: var(--t-amber-line); color: var(--t-amber); }
.ad-btn-amber:hover { background: rgba(245, 185, 92, 0.2); color: #FFE1AE; }
.ad-btn-danger { background: #C9442F; color: #fff; }
.ad-btn-danger:hover { background: #DD553F; color: #fff; }
.ad-btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; gap: 6px; }
.ad-btn-sm svg { width: 16px; height: 16px; }
.ad-btn-block { width: 100%; min-height: 50px; font-size: 16px; }
.ad-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); cursor: pointer;
}
.ad-icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.ad-icon-btn:disabled { opacity: 0.35; cursor: default; }
.ad-icon-btn svg { width: 20px; height: 20px; }
.ad-icon-btn-sm { width: 32px; height: 32px; }
.ad-icon-btn-sm svg { width: 16px; height: 16px; }

/* Brand + demo pill */
.ad-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; border-radius: 10px; }
.ad-logo {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.3);
}
.ad-logo img { display: block; width: 78%; height: auto; }
.ad-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ad-brand-name { font: 700 15.5px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-brand-admin { color: var(--accent-lt); }
.ad-brand-sub { font-size: 13px; color: var(--muted); }
.ad-demo-pill {
  padding: 10px 14px; border: 1px dashed var(--accent-dim); border-radius: 12px;
  background: var(--accent-soft); color: var(--text-soft); font-size: 14px; line-height: 1.45;
}
.ad-demo-pill-sm { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--accent-lt); cursor: help; }

/* Sign in */
.ad-login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.ad-login-card {
  width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 22px; padding: 32px;
  background: rgba(11, 17, 30, 0.85); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 60px rgba(var(--accent-rgb), 0.06);
}
.ad-login-title { font: 700 26px/1.2 var(--head); letter-spacing: -0.02em; }
.ad-login-sub { margin-top: 6px; font-size: 15px; color: var(--text-body); }
.ad-form { display: flex; flex-direction: column; gap: 16px; }
.ad-field { display: flex; flex-direction: column; gap: 6px; }
.ad-field label { font-size: 14px; color: var(--text-soft); }
.ad-field input, .ad-search input {
  width: 100%; min-height: 48px; padding: 0 14px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 12px; font: 400 16px var(--font);
}
.ad-field input:focus, .ad-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14); }
.ad-msg { min-height: 1.5em; font-size: 14px; color: var(--muted); }
.ad-msg:empty { display: none; }
.ad-msg.is-error { color: #FF8A7A; }

/* App shell: the page itself doesn't scroll; lists and the drawer scroll inside */
.ad-app {
  position: fixed; inset: 0; display: grid; overflow: hidden;
  grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top" "side main";
  background: var(--bg); font-size: 15px; line-height: 1.5;
}
.ad-app[hidden] { display: none; }
.ad-top {
  grid-area: top; display: flex; align-items: center; gap: 14px; min-width: 0;
  padding: 0 16px 0 18px; background: var(--ad-side); border-bottom: 1px solid var(--line);
}
.ad-top-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
/* Members-area header (React, same as the dashboard) across the top of the admin panel */
.ad-members-slot { grid-area: top; min-width: 0; min-height: 57px; background: rgba(10, 11, 13, 0.92); border-bottom: 1px solid var(--line); }
.ad-members-slot:not(:empty) { border-bottom: 0; background: none; }
.ad-members-slot .cm-top { position: relative; }
.ad-head .ad-top-tools { align-self: flex-start; }
.ad-top-tools .ad-btn { min-height: 36px; }
#refresh.is-busy svg { animation: ad-spin 0.8s linear infinite; }
@keyframes ad-spin { to { transform: rotate(360deg); } }

.ad-side {
  grid-area: side; display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto;
  padding: 16px 12px; background: var(--ad-side); border-right: 1px solid var(--line);
}
.ad-nav {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; padding: 0 12px 0 14px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-soft);
  font: 500 15px var(--font); text-align: left; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease;
}
.ad-nav svg { width: 19px; height: 19px; }
.ad-nav:hover { background: var(--surface); color: var(--text); }
.ad-nav[aria-current="page"] { background: var(--accent); color: var(--bg); font-weight: 600; box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.25); }
.ad-nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--bg); font: 600 12.5px/1 var(--font);
}
.ad-badge-quiet { background: var(--line-strong); color: var(--text-soft); }
/* Members-area menu kept on the admin panel (same look as the dashboard sidebar) */
.ad-side .ad-side-brand { flex: none; margin: -16px -12px 10px; padding: 0 16px; min-height: 68px; border-bottom: 1px solid var(--line); }
.ad-side .cf-logo img { width: 78%; height: auto; }
a.ad-nav { text-decoration: none; }
/* Manage courses: drag handles to reorder courses, modules and lessons */
.pt-mmodules { display: flex; flex-direction: column; gap: 14px; }
.pt-manage-list > *, .pt-mmodules > *, .pt-mlessons > * { transition: transform 0.18s ease; }
.pt-grip {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 36px; margin: 0 -4px 0 -6px;
  padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  cursor: grab; touch-action: none; transition: color 0.15s ease, background-color 0.15s ease;
}
.pt-grip:hover { color: var(--text); background: var(--surface-2); }
.pt-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; color: var(--text); }
.pt-mlesson .pt-grip { align-self: center; }
.pt-mmodule-head { justify-content: flex-start; }
.pt-mmodule-head h3 { flex: 1; min-width: 0; }
[data-dragging="true"] { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(var(--accent-rgb), 0.55); border-radius: 12px; background: var(--surface); }
.pt-mlesson[data-dragging="true"] { padding-left: 8px; padding-right: 8px; border-top-color: transparent; }
body.is-sorting, body.is-sorting * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

/* Required first step: "Set up your profile" (photo + display name) */
.ps-setup { min-height: calc(100dvh - 57px); }
/* Creating an account / signing in / setting up the profile: no members header, just the card */
.cm-page:has(.pt-account) > .cm-top, .cm-page:has(.ps-setup) > .cm-top { display: none; }
.pt-account, .ps-setup { min-height: 100vh; min-height: 100dvh; }
.ps-card { max-width: 520px; }
.ps-card .eyebrow { margin-bottom: -8px; }
.ps-lead { color: var(--text-body); font-size: 15.5px; line-height: 1.55; }
.ps-photo { display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.ps-avatar {
  position: relative; flex: none; width: 96px; height: 96px; padding: 0; border-radius: 999px; cursor: pointer;
  border: 2px dashed rgba(var(--accent-rgb), 0.6); background: var(--surface); overflow: visible;
}
.ps-avatar.has-photo { border-style: solid; border-color: var(--accent); }
.ps-avatar img, .ps-initials { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 999px; object-fit: cover; }
.ps-initials { font: 700 30px var(--head); color: #fff; opacity: 0.85; }
.ps-cam {
  position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--bg); border: 3px solid var(--surface);
}
.ps-avatar:hover .ps-cam { background: var(--accent-lt); }
.ps-photo-text { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.ps-photo-text strong { font-size: 15.5px; }
.ps-req { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-lt); font: 500 11.5px/1.6 var(--font); vertical-align: 2px; }
.ps-card .field label { color: var(--text-soft); }
.ps-submit { width: 100%; }
.ps-out { margin: -4px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
@media (max-width: 480px) { .ps-photo { flex-direction: column; text-align: center; } .ps-photo-text { align-items: center; } }

/* Lesson mini player: the started video keeps playing in the corner while the member browses
   other dashboard pages. The lesson view stays loaded (so the video never restarts) but hidden;
   only its video card is shown. */
.cx.is-away {
  position: fixed; inset: 0; z-index: 60; visibility: hidden; pointer-events: none;
  animation: none !important; transform: none !important; min-height: 0; overflow: visible;
}
.cx.is-away .cx-main, .cx.is-away .cx-body { container-type: normal; contain: none; transform: none; animation: none; }
.cx.is-away .cx-stage {
  visibility: visible; pointer-events: auto;
  position: fixed; right: 20px; bottom: 20px; z-index: 61; width: min(400px, calc(100vw - 32px)); gap: 0;
  --mini-top: 76px; --mini-gap: 20px;
  border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(var(--accent-rgb), 0.12);
  animation: cx-mini-in 0.24s ease-out backwards; /* not "both": it would override the drag movement */
}
.cx.is-away .cx-actions { display: none; }
/* The four corners (drag the top bar to move it) */
.cx.is-away .cx-stage[data-corner="br"] { top: auto; left: auto; right: var(--mini-gap); bottom: var(--mini-gap); }
.cx.is-away .cx-stage[data-corner="bl"] { top: auto; right: auto; left: var(--mini-gap); bottom: var(--mini-gap); }
.cx.is-away .cx-stage[data-corner="tr"] { bottom: auto; left: auto; right: var(--mini-gap); top: var(--mini-top); }
.cx.is-away .cx-stage[data-corner="tl"] { bottom: auto; right: auto; left: var(--mini-gap); top: var(--mini-top); }
.cx.is-away .cx-mini-bar { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.cx.is-away .cx-stage.is-dragging { cursor: grabbing; box-shadow: 0 26px 70px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(var(--accent-rgb), 0.6); }
.cx.is-away .cx-stage.is-dragging * { cursor: grabbing; }
.cx.is-away .cx-stage.is-dragging .cx-player { pointer-events: none; }
.cx.is-away .cx-player, .cx.is-away .cx-body .cx-player { width: 100%; max-height: none; margin: 0; border: 0; border-radius: 0; }
.cx-mini-bar { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); }
.cx-mini-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 4px 0; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.cx-mini-title { max-width: 100%; font: 600 14px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-mini-sub { max-width: 100%; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-mini-open:hover .cx-mini-title { color: var(--accent-lt); }
.cx-mini-btn {
  flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-soft); cursor: pointer;
}
.cx-mini-btn:hover { background: var(--surface-2); color: var(--text); }
.cx-mini-btn:focus-visible, .cx-mini-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@keyframes cx-mini-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  /* Phones: full width, so it moves between the top and the bottom */
  .cx.is-away .cx-stage { width: auto; --mini-gap: 12px; --mini-top: 68px; }
  .cx.is-away .cx-stage[data-corner] { left: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) { .cx.is-away .cx-stage { animation: none; } }

/* Sidebar section labels ("Learning", "Admin Tools") as pills: dashboard + admin sidebars */
.pt-side-label, .ad-side-label {
  width: fit-content; margin: 18px 12px 8px; padding: 5px 14px; border: 1px solid var(--accent-dim); border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-lt); font: 500 14.5px/1.4 var(--font); letter-spacing: 0; text-transform: none;
}
.ad-root .ad-side .ad-side-label { flex: none; margin: 18px 12px 8px; }
/* "Dashboard" stands out from the other menu items (members sidebar + admin sidebar) */
.pt-nav.pt-nav-home, .ad-root .ad-nav.pt-nav-home { min-height: 50px; font-size: 17.5px; font-weight: 600; }
.pt-nav.pt-nav-home svg, .ad-root .ad-nav.pt-nav-home svg { width: 21px; height: 21px; }
@media (max-width: 760px) { .ad-root .ad-nav.pt-nav-home { min-height: 54px; font-size: 12.5px; } .ad-root .ad-nav.pt-nav-home svg { width: 19px; height: 19px; } }
.ad-nav svg { stroke-width: 1.7; }
.ad-root .ad-nav svg.ad-fill { fill: currentColor; stroke: none; }
.ad-nav svg[viewBox="0 0 18 18"] { width: 18px; height: 18px; }
.ad-nav[aria-current="page"] .ad-badge { background: var(--bg); color: var(--accent-lt); }

.ad-main { grid-area: main; position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ad-main:focus { outline: none; }
.ad-loader.wx-loader { position: absolute; z-index: 5; }
.ad-error {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 16px 28px 0; padding: 10px 14px; border: 1px solid var(--t-red-line); border-radius: 12px;
  background: var(--t-red-bg); color: var(--t-red); font-size: 14.5px;
}
.ad-section {
  flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0;
  display: flex; flex-direction: column; gap: 16px; padding: 24px 28px 0;
  animation: wx-page-in 0.2s ease-out both;
}
.ad-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ad-root .ad-head h1 { font: 700 26px/1.2 var(--head); letter-spacing: -0.02em; }
.ad-root .ad-head h1:focus { outline: none; }
.ad-sub { margin-top: 4px; font-size: 14.5px; color: var(--text-body); }
.ad-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -8px; padding: 0 8px 28px; display: flex; flex-direction: column; gap: 20px; }

/* Toolbar: search + chips */
.ad-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ad-search { position: relative; flex: 1 1 260px; max-width: 360px; }
.ad-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ad-search input { min-height: 42px; padding-left: 40px; font-size: 15px; }
.ad-search input::placeholder { color: var(--muted); }
.ad-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text-soft);
  font: 500 14px var(--font); cursor: pointer;
}
.ad-chip:hover { border-color: var(--accent-dim); color: var(--text); }
.ad-chip[aria-pressed="true"] { background: var(--t-blue-bg); border-color: var(--accent); color: var(--text); }
.ad-chip-n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--line); color: var(--text-soft); font-size: 12.5px; font-weight: 600; text-align: center; }
.ad-chip[aria-pressed="true"] .ad-chip-n { background: var(--accent); color: var(--bg); }

/* Lists */
.ad-cols {
  position: sticky; top: 0; z-index: 2; display: grid; align-items: end; gap: 16px;
  padding: 0 17px 8px; background: var(--bg); font-size: 13px; color: var(--muted);
}
.ad-cols span:first-child { padding-left: 48px; }
.ad-cols + .ad-list { margin-top: -20px; }
.ad-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.ad-row { position: relative; display: grid; align-items: center; gap: 16px; min-height: 62px; padding: 10px 16px; border-top: 1px solid var(--line); }
.ad-row:first-child { border-top: 0; border-radius: 14px 14px 0 0; }
.ad-row:last-child { border-radius: 0 0 14px 14px; }
.ad-row:only-child { border-radius: 14px; }
.ad-row:hover { background: var(--surface-2); }
.ad-row-open { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.ad-row-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ad-row > :not(.ad-row-open) { position: relative; pointer-events: none; min-width: 0; }
.ad-row > .ad-row-actions { pointer-events: auto; z-index: 1; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.ad-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ad-avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--t-blue-bg); border: 1px solid var(--t-blue-line); color: var(--accent-lt); font: 700 13px var(--head);
}
.ad-avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.ad-who-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ad-name { font-weight: 600; font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-email { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-who-extra { display: none; font-size: 13px; color: var(--text-body); }
.ad-cell { font-size: 14.5px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-cell-k { display: none; }
.ad-role { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 6px; background: var(--line); color: var(--accent-lt); font-size: 12px; font-weight: 600; vertical-align: 1px; }
.ad-cols-apps, .ad-row-app { grid-template-columns: minmax(0, 2.4fr) 100px 112px minmax(0, 1.3fr) 104px; }
.ad-cols-pay, .ad-row-pay { grid-template-columns: minmax(0, 2fr) 104px 122px 110px 104px 196px; }
.ad-cols-mem, .ad-row-mem { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.5fr) 190px 210px; }
.ad-row-att { grid-template-columns: minmax(0, 1fr) auto 196px; }
.ad-row-att .ad-email { white-space: normal; }
.ad-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 20px; text-align: center; color: var(--text-body); font-size: 15px; }
.ad-empty p { max-width: 460px; }
.ad-empty-ok svg { width: 28px; height: 28px; color: var(--t-green); }
.ad-more-note { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* Pills: green done, amber due, red overdue/declined, blue pending/active */
.ad-pill {
  display: inline-flex; align-items: center; max-width: 100%; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-strong);
  font: 600 12.5px/1.6 var(--font); color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ad-pill.is-blue { background: var(--t-blue-bg); border-color: var(--t-blue-line); color: var(--t-blue); }
.ad-pill.is-green { background: var(--t-green-bg); border-color: var(--t-green-line); color: var(--t-green); }
.ad-pill.is-amber { background: var(--t-amber-bg); border-color: var(--t-amber-line); color: var(--t-amber); }
.ad-pill.is-red { background: var(--t-red-bg); border-color: var(--t-red-line); color: var(--t-red); }
.ad-pill.is-muted { color: var(--muted); border-style: dashed; }
.ad-pill.is-solid { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Overview */
.ad-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ad-stat {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 18px 18px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-align: left; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.ad-stat:hover { border-color: var(--accent-dim); background: var(--surface-2); }
.ad-stat > svg { position: absolute; top: 18px; right: 16px; color: var(--muted); }
.ad-stat-n { font: 700 32px/1.15 var(--head); letter-spacing: -0.02em; color: var(--accent-lt); }
.ad-stat.is-amber .ad-stat-n { color: var(--t-amber); }
.ad-stat.is-green .ad-stat-n { color: var(--t-green); }
.ad-stat.is-zero .ad-stat-n { color: var(--muted); }
.ad-stat-label { font-size: 15px; font-weight: 600; }
.ad-stat-hint { font-size: 13.5px; color: var(--muted); }
.ad-panel { display: flex; flex-direction: column; gap: 10px; }
.ad-root .ad-panel-title { font: 600 17px var(--font); letter-spacing: 0; }

/* Detail drawer */
.ad-drawer-wrap { position: absolute; inset: 0; z-index: 20; }
.ad-backdrop { position: absolute; inset: 0; background: rgba(2, 4, 10, 0.6); opacity: 0; transition: opacity 0.18s ease; }
.ad-drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  display: flex; flex-direction: column; background: var(--ad-panel); border-left: 1px solid var(--line-strong);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5); outline: none;
  transform: translateX(28px); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease;
}
.ad-drawer-wrap.is-open .ad-backdrop { opacity: 1; }
.ad-drawer-wrap.is-open .ad-drawer { transform: none; opacity: 1; }
.ad-d-head { flex: none; display: flex; flex-direction: column; gap: 12px; padding: 10px 16px 18px 20px; border-bottom: 1px solid var(--line); }
.ad-d-bar { display: flex; align-items: center; gap: 6px; margin-left: -8px; }
.ad-d-close svg:nth-of-type(2), .ad-d-back-label { display: none; }
.ad-d-step { display: flex; align-items: center; gap: 2px; }
.ad-d-pos { font-size: 13.5px; color: var(--muted); padding: 0 4px; white-space: nowrap; }
.ad-more { position: relative; margin-left: auto; }
.ad-more-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--accent-dim); }
.ad-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 230px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--ad-raise); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.ad-menu.is-confirm { width: 320px; gap: 12px; padding: 14px; }
.ad-menu-item {
  display: flex; align-items: center; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: 500 14.5px var(--font); text-align: left; cursor: pointer;
}
.ad-menu-item:hover { background: var(--surface-2); }
.ad-menu-item.is-danger { color: var(--t-red); }
.ad-menu-ask { font-size: 14.5px; color: var(--text-soft); line-height: 1.5; }
.ad-menu-btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.ad-d-id { display: flex; align-items: flex-start; gap: 14px; }
.ad-d-id-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ad-root .ad-d-name { font: 700 21px/1.25 var(--head); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.ad-d-contact { display: flex; align-items: center; gap: 4px; font-size: 14.5px; color: var(--text-soft); min-width: 0; }
.ad-d-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ad-d-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 20px 20px 32px; }
.ad-next { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.ad-next.is-blue { background: rgba(76, 141, 255, 0.08); border-color: var(--t-blue-line); }
.ad-next.is-green { background: rgba(72, 190, 120, 0.07); border-color: var(--t-green-line); }
.ad-next.is-amber { background: rgba(245, 185, 92, 0.07); border-color: var(--t-amber-line); }
.ad-next.is-red { background: rgba(255, 107, 87, 0.07); border-color: var(--t-red-line); }
.ad-next-head { display: flex; align-items: center; gap: 8px; }
.ad-next-head svg { color: var(--t-green); width: 20px; height: 20px; }
.ad-root .ad-next-title { font: 600 16.5px var(--font); letter-spacing: 0; }
.ad-next.is-blue .ad-next-title { color: var(--t-blue); }
.ad-next.is-green .ad-next-title { color: var(--t-green); }
.ad-next.is-amber .ad-next-title { color: var(--t-amber); }
.ad-next.is-red .ad-next-title { color: var(--t-red); }
.ad-next-text { font-size: 14.5px; color: var(--text-body); line-height: 1.55; }
.ad-next-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ad-d-error { font-size: 14px; color: #FF8A7A; }
.ad-d-note { padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 14px; color: var(--text-soft); overflow-wrap: anywhere; user-select: all; }
.ad-d-sec { display: flex; flex-direction: column; gap: 12px; }
.ad-root .ad-d-sec-title { font: 600 15.5px var(--font); letter-spacing: 0; color: var(--text); }
.ad-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ad-fact { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.ad-fact dt { font-size: 13px; color: var(--muted); }
.ad-fact dd { font-size: 14.5px; color: var(--text); overflow-wrap: anywhere; }
.ad-long h4 { font-size: 13.5px; font-weight: 500; color: var(--muted); margin-bottom: 2px; }
.ad-long p { font-size: 14.5px; line-height: 1.55; color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.ad-d-meta { font-size: 13.5px; color: var(--muted); }
.ad-progress { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ad-progress-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--text-body); }
.ad-progress-label strong { font-size: 15px; font-weight: 600; color: var(--text); }
.ad-progress-track { display: flex; gap: 4px; }
.ad-progress-seg { flex: 1; height: 8px; border-radius: 4px; background: var(--line-strong); }
.ad-progress-seg.is-sent { background: repeating-linear-gradient(135deg, #24467F 0 6px, #1A3462 6px 12px); }
.ad-progress-seg.is-done { background: #4FBF7F; }
.ad-dl { display: flex; flex-direction: column; }
.ad-dl-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.ad-dl-row:first-child { border-top: 0; }
.ad-dl-row dt { color: var(--muted); }
.ad-dl-row dd { color: var(--text); min-width: 0; }
.ad-d-tools, .ad-d-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* Toasts */
.ad-toasts { position: absolute; right: 20px; bottom: 20px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.ad-toast {
  display: flex; align-items: center; gap: 10px; max-width: 380px; padding: 11px 16px; border-radius: 12px;
  background: var(--ad-raise); border: 1px solid var(--line-strong); color: var(--text); font-size: 14.5px; font-weight: 500;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); animation: ad-toast-in 0.2s ease-out both; transition: opacity 0.3s ease, transform 0.3s ease;
}
.ad-toast svg { color: var(--t-green); }
.ad-toast.is-error { border-color: var(--t-red-line); color: var(--t-red); }
.ad-toast.is-leaving { opacity: 0; transform: translateY(6px); }
@keyframes ad-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Narrower desktops */
@media (max-width: 1180px) {
  .ad-cols-apps, .ad-row-app { grid-template-columns: minmax(0, 2fr) 96px 108px minmax(0, 1.2fr); }
  .ad-cols-apps span:nth-child(5), .ad-row-app .ad-c-commit { display: none; }
  .ad-cols-pay, .ad-row-pay { grid-template-columns: minmax(0, 2fr) 96px 118px 100px 196px; }
  .ad-cols-pay span:nth-child(4), .ad-row-pay .ad-c-method { display: none; }
  .ad-cols-mem, .ad-row-mem { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) 180px 200px; }
  .ad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .ad-app { grid-template-columns: 220px minmax(0, 1fr); }
  .ad-lbl-long { display: none; }
  .ad-lbl-short { display: inline; }
  .ad-cols-apps, .ad-row-app { grid-template-columns: minmax(0, 1fr) 92px 108px; }
  .ad-cols-apps span:nth-child(4), .ad-row-app .ad-c-savings { display: none; }
  .ad-cols-pay, .ad-row-pay { grid-template-columns: minmax(0, 1fr) 118px 196px; }
  .ad-cols-pay span:nth-child(2), .ad-cols-pay span:nth-child(5), .ad-row-pay .ad-c-plan, .ad-row-pay .ad-c-sent { display: none; }
  .ad-cols-mem, .ad-row-mem { grid-template-columns: minmax(0, 1fr) 180px 200px; }
  .ad-cols-mem span:nth-child(2), .ad-row-mem .ad-c-plan { display: none; }
  .ad-row-mem .ad-who-extra { display: block; }
}

/* Phones and small tablets: bottom tab bar, drawer as a full-screen sheet */
@media (max-width: 760px) {
  .ad-show-sm { display: inline; }
  .ad-hide-sm { display: none; }
  .ad-app {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "top" "main" "side";
  }
  .ad-top { gap: 10px; padding: 0 8px 0 max(14px, env(safe-area-inset-left, 0px)); }
  .ad-top .ad-brand-name { font-size: 15px; }
  .ad-top .ad-brand-name { max-width: 46vw; }
  .ad-top-tools { gap: 2px; }
  .ad-top-tools .ad-btn { width: 44px; min-height: 44px; padding: 0; border-color: transparent; }
  .ad-top .ad-logo { width: 32px; height: 32px; }
  .ad-side {
    flex-direction: row; gap: 2px; overflow: visible; padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    border-right: 0; border-top: 1px solid var(--line);
  }
  .ad-nav { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 2px; min-height: 54px; padding: 4px 2px; font-size: 12.5px; text-align: center; }
  .ad-nav[aria-current="page"] { box-shadow: none; background: var(--t-blue-bg); color: var(--accent-lt); }
  .ad-nav-label { max-width: 100%; }
  /* bottom tab bar: Dashboard + the four admin sections */
  .ad-side .ad-side-brand, .ad-side-label, .ad-side .ad-side-extra { display: none; }
  .ad-badge { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; min-width: 20px; height: 20px; font-size: 11.5px; padding: 0 6px; }
  .ad-nav[aria-current="page"] .ad-badge { background: var(--accent); color: var(--bg); }
  .ad-error { margin: 12px 16px 0; }
  .ad-section { padding: 16px 16px 0; gap: 12px; }
  .ad-root .ad-head h1 { font-size: 22px; }
  .ad-sub { font-size: 14px; }
  .ad-search { max-width: none; flex-basis: 100%; }
  .ad-search input { min-height: 44px; }
  .ad-chip { min-height: 40px; }
  .ad-chips { gap: 6px; }
  .ad-cols { display: none; }
  .ad-cols + .ad-list { margin-top: 0; }
  .ad-scroll { gap: 16px; padding-bottom: 20px; }
  .ad-row, .ad-row-app, .ad-row-pay, .ad-row-mem, .ad-row-att { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 10px 12px; min-height: 64px; }
  .ad-row .ad-c-date, .ad-row .ad-c-savings, .ad-row .ad-c-commit, .ad-row .ad-c-plan, .ad-row .ad-c-payment,
  .ad-row .ad-c-method, .ad-row .ad-c-sent { display: none; }
  .ad-who-extra { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ad-row-mem .ad-email, .ad-row-pay .ad-email { display: none; }
  .ad-row > .ad-row-actions { grid-column: 1 / -1; justify-content: flex-start; padding-left: 48px; }
  .ad-row > .ad-row-actions:empty { display: none; }
  .ad-row-att .ad-c-status { display: none; }
  .ad-btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
  .ad-icon-btn { width: 44px; height: 44px; }
  .ad-icon-btn-sm { width: 40px; height: 40px; }
  .ad-stats { gap: 10px; }
  .ad-stat { padding: 14px; }
  .ad-stat > svg { top: 14px; right: 12px; }
  .ad-stat-n { font-size: 26px; }
  .ad-stat-label { font-size: 14px; }
  .ad-stat-hint { font-size: 12.5px; }
  .ad-toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .ad-app:has(.ad-side) .ad-toasts { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .ad-toast { max-width: none; }
  .ad-drawer { width: 100%; border-left: 0; box-shadow: none; transform: translateY(16px); }
  .ad-d-head { padding: 6px 12px 14px 16px; gap: 10px; }
  .ad-d-bar { margin-left: -6px; }
  .ad-d-close { width: auto; padding: 0 10px 0 4px; font-size: 15px; font-weight: 500; color: var(--accent-lt); }
  .ad-d-close svg:first-of-type { display: none; }
  .ad-d-close svg:nth-of-type(2), .ad-d-back-label { display: inline; }
  .ad-d-pos { display: none; }
  .ad-d-body { padding: 16px 16px 28px; gap: 20px; }
  .ad-root .ad-d-name { font-size: 19px; }
  .ad-avatar-lg { width: 44px; height: 44px; font-size: 15px; }
  .ad-next-actions .ad-btn { min-height: 44px; }
  .ad-dl-row { grid-template-columns: 120px minmax(0, 1fr); }
  .ad-login-card { padding: 24px 20px; }
}
@media (max-width: 420px) {
  .ad-top .ad-brand-name .ad-brand-admin { display: inline; }
  .ad-demo-pill-sm { padding: 2px 8px; font-size: 12px; }
  .ad-brand-wx { display: none; }
  .ad-menu.is-confirm { width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .ad-section, .ad-toast { animation: none; }
  .ad-drawer, .ad-backdrop, .ad-toast { transition: none; }
  #refresh.is-busy svg { animation: none; }
}
/* Admin: batches (chip after the name in lists, Batch select in the drawer) */
.ad-batch {
  display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--t-blue-line);
  background: var(--t-blue-bg); color: var(--t-blue); font-size: 12px; font-weight: 600; line-height: 1.6; vertical-align: 1px; white-space: nowrap;
}
.ad-batch-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ad-select {
  min-width: 200px; min-height: 44px; padding: 0 38px 0 14px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--bg) 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='%239AA3B2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--text); font: 500 15px var(--font); appearance: none; -webkit-appearance: none; cursor: pointer;
}
.ad-select:hover { border-color: var(--accent-dim); }
.ad-select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14); }
.ad-select:disabled { opacity: 0.6; cursor: wait; }
.ad-select option { background: var(--surface, #12151B); color: var(--text); }
.ad-d-batch .ad-d-meta { margin-top: 8px; }
@media (max-width: 640px) { .ad-select { width: 100%; } }

/* Admin > Members: batch bar (members per batch, how full each batch is, which one is open) */
.ad-batch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--ad-panel, var(--surface)); }
.ad-batch-size { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-soft); font-weight: 500; }
.ad-batch-size input { width: 76px; min-height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: 600 15px var(--font); }
.ad-batch-size input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ad-batch-fill { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-batch-fill:empty { display: none; }
.ad-batch-count { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 13px; color: var(--text-soft); }
.ad-batch-count strong { color: var(--text); font-weight: 600; }
.ad-batch-count.is-full { color: var(--muted); border-color: var(--line); }
.ad-batch-count.is-full strong { color: var(--text-soft); }
.ad-batch-count.is-open { border-color: var(--accent-dim); background: var(--accent-soft); }
.ad-batch-open { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--accent-lt); }
.ad-batch-msg { flex-basis: 100%; margin: 0; font-size: 13.5px; color: #FF8A7A; }
@media (max-width: 760px) { .ad-batch-open { margin-left: 0; flex-basis: 100%; } }/* Batch bar: one item per batch (name, size box, how full) */
.ad-batch-bar { flex-direction: column; align-items: stretch; gap: 10px; }
.ad-batch-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 14px; }
.ad-batch-title { font-size: 14px; font-weight: 600; color: var(--text); }
.ad-batch-head .ad-batch-open { margin-left: 0; }
.ad-batch-fill { gap: 8px; }
.ad-batch-item { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); font-size: 13.5px; }
.ad-batch-name { font-weight: 600; color: var(--text); white-space: nowrap; }
.ad-batch-input { width: 64px; min-height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2, var(--surface)); color: var(--text); font: 600 14px var(--font); }
.ad-batch-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ad-batch-state { color: var(--text-soft); white-space: nowrap; padding-right: 6px; }
.ad-batch-item.is-full { opacity: 0.75; }
.ad-batch-item.is-full .ad-batch-state { color: #FF8A7A; }
.ad-batch-item.is-open { border-color: var(--accent-dim); background: var(--accent-soft); }
.ad-batch-item.is-next { border-style: dashed; }
/* ---------- Member page: Student wins (testimonials) ---------- */
.tm { display: flex; flex-direction: column; gap: 28px; }
.tm-head { display: flex; flex-direction: column; gap: 10px; }

.tm-head p { color: var(--text-body); max-width: 34em; }
.tm-proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tm-shot { margin: 0; overflow: hidden; border-radius: var(--radius-lg); display: flex; flex-direction: column; }
.tm-zoom { display: block; width: 100%; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; aspect-ratio: 16 / 11; background: #07090F; cursor: zoom-in; overflow: hidden; }
.tm-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform 0.25s ease; }
.tm-zoom:hover img { transform: scale(1.03); }
.tm-zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tm-shot figcaption { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 3px; }
.tm-shot figcaption strong { color: var(--text); font-size: 15.5px; }
.tm-shot figcaption span { color: var(--muted); font-size: 13.5px; }
.tm-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #3A78F0, #16306B); color: #fff; font: 800 14px/1 'Montserrat', var(--font); }


@media (max-width: 900px) { .tm-proof { grid-template-columns: 1fr 1fr; } .tm-proof .tm-shot:first-child { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .tm { gap: 22px; }
  .tm-proof { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .tm-shot img { transition: none; } .tm-zoom:hover img { transform: none; } }
/* Mentee messages (Discord screenshots): same cards as the results above, showing the start of
   each message; click (or tap) opens it full size to read. */
.tm-sub { margin-top: 12px; }
.tm-msg .tm-zoom { background: #1E1F22; }
.tm-msg img { object-position: left top; }
.tm-msg.is-small img { object-fit: contain; object-position: center; }
.tm-msg figcaption { flex-direction: row; align-items: center; gap: 12px; cursor: zoom-in; }
.tm-msg figcaption > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.tm-msg figcaption strong { color: var(--text); font-size: 15.5px; }
.tm-msg figcaption small { color: var(--muted); font-size: 13.5px; }
/* The newest win is a tall screenshot: it spans two rows, and the messages use four columns
   around it (2 rows x 4 = no empty cell). Tablets: two columns, phones: one. */
.tm-msgs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tm-msg.is-tall { grid-row: span 2; }
.tm-msg.is-tall .tm-zoom { position: relative; aspect-ratio: auto; flex: 1 1 auto; min-height: 0; }
.tm-msg.is-tall img { position: absolute; inset: 0; object-position: center top; } /* the other cards set the row height */
@media (max-width: 1100px) and (min-width: 641px) {
  .tm-msgs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-msgs .tm-shot:first-child { grid-column: auto; }
}
@media (max-width: 640px) {
  .tm-msgs { grid-template-columns: 1fr; }
  .tm-msg.is-tall { grid-row: auto; }
  .tm-msg.is-tall .tm-zoom { aspect-ratio: 3 / 4; }
}
.tm-read { margin-left: auto; color: var(--accent-lt, #7FB0FF); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tm-read::after { content: " \2192"; }
/* ---------- Community: Schedule (calendar per batch) ---------- */
#cf-tab-schedule { padding: 22px clamp(14px, 2.4vw, 28px) 40px; }
.sc { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 20px; align-items: start; max-width: 1400px; margin: 0 auto; }
.sc-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sc-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-body); cursor: pointer; }
.sc-icon:hover { background: var(--cf-hover, var(--surface-2)); color: var(--text); }
.sc-icon.is-big { width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 10px; }
/* mini month */
.sc-mini { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 10px 10px 12px; }
.sc-mini-head { display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 2px; margin-bottom: 6px; }
.sc-mini-head strong { text-align: center; font: 700 15px var(--head); color: var(--text); }
.sc-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.sc-mini-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sc-mini-day { position: relative; height: 32px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-soft); font: 600 13px var(--font); cursor: pointer; }
.sc-mini-day:hover { background: var(--surface-2); color: var(--text); }
.sc-mini-day.is-other { color: var(--muted); opacity: 0.55; }
.sc-mini-day.has-events::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.sc-mini-day.is-today { border-color: var(--accent); color: var(--accent-lt); }
.sc-mini-day.is-selected { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.sc-mini-day.is-selected::after { background: var(--bg); }
/* upcoming / past */
.sc-seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sc-seg button { min-height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--text-body); font: 600 13.5px var(--font); cursor: pointer; }
.sc-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-lt); box-shadow: inset 0 0 0 1px var(--accent-dim); }
.sc-list { display: flex; flex-direction: column; gap: 16px; }
.sc-group h3 { margin: 0 0 8px; font: 700 14px var(--head); color: var(--accent-lt); }
.sc-group h3.is-today { color: var(--text); }
.sc-item { display: flex; flex-direction: column; gap: 2px; width: 100%; margin-bottom: 8px; padding: 6px 10px 6px 12px; border: 0; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: transparent; text-align: left; cursor: pointer; }
.sc-item:hover { background: var(--surface-2); }
.sc-item strong { color: var(--text); font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-item span { color: var(--muted); font-size: 12.5px; }
.sc-item.is-all { border-left-color: #F2BE4A; }
.sc-empty { color: var(--muted); font-size: 14px; }
/* main calendar */
.sc-main { padding: 18px 18px 14px; border-radius: 16px; min-width: 0; }
.sc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 14px; }
.sc-title h2 { margin: 0; font-size: clamp(19px, 2vw, 23px); letter-spacing: -0.01em; }
.sc-title span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.sc-nav { display: flex; align-items: center; gap: 8px; }
.sc-today { min-height: 36px; }
.sc-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sc-view { min-height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background-color: var(--bg); color: var(--text); font: 600 14px var(--font); }
.sc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); gap: 1px; }
.sc-wd { padding: 10px 6px; text-align: center; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; }
.sc-cell { position: relative; min-height: 112px; padding: 6px 5px 6px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; min-width: 0; cursor: default; }
.sc-grid.is-week .sc-cell { min-height: 360px; }
.sc-cell.is-other { background: var(--bg); background-image: linear-gradient(rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0.018)); }
.sc-cell.is-other .sc-date { opacity: 0.4; }
.sc-cell.is-selected { box-shadow: inset 0 0 0 1px var(--accent-dim); }
.sc-date { align-self: flex-start; min-width: 24px; height: 24px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-body); }
.sc-cell.is-today .sc-date { background: var(--accent); color: var(--bg); }
.sc-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sc-chip { display: flex; gap: 4px; align-items: baseline; width: 100%; min-width: 0; padding: 3px 5px; border: 1px solid var(--accent-dim); border-radius: 6px; background: var(--accent-soft); color: var(--accent-lt); font-size: 11.5px; line-height: 1.3; text-align: left; cursor: pointer; }
.sc-chip:hover { background: rgba(var(--accent-rgb), 0.2); color: var(--text); }
.sc-chip-time { flex: 0 0 auto; font-weight: 700; }
.sc-chip-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sc-grid.is-week .sc-chip { flex-direction: column; gap: 1px; }
.sc-grid.is-week .sc-chip-title { white-space: normal; }
.sc-chip.is-all { border-color: #5C4718; background: rgba(242, 190, 74, 0.1); color: #F5C451; }
.sc-chip.is-past { opacity: 0.55; }
.sc-more { align-self: flex-start; padding: 1px 4px; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.sc-more:hover { color: var(--text); }
.sc-dots { display: none; }
.sc-legend { display: flex; gap: 16px; margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); }
.sc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sc-key { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.sc-key.is-all { background: #F2BE4A; }
/* event pop-up */
.sc-dialog { width: min(520px, calc(100% - 32px)); }
.sc-ev { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 26px; }
.sc-ev .dialog-close { position: absolute; top: 14px; right: 14px; }
.sc-ev h2 { margin: 0; padding-right: 40px; font-size: 22px; line-height: 1.25; }
.sc-tag { align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-dim); color: var(--accent-lt); font-size: 12px; font-weight: 600; }
.sc-tag.is-all { background: rgba(242, 190, 74, 0.1); border-color: #5C4718; color: #F5C451; }
.sc-ev-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--text-soft); font-size: 15px; }
.sc-ev-facts li { display: flex; gap: 10px; align-items: flex-start; }
.sc-ev-facts svg { flex: 0 0 auto; margin-top: 1px; color: var(--accent-lt); }
.sc-ev-facts small { display: block; color: var(--muted); font-size: 12.5px; }
.sc-ev-details { white-space: pre-wrap; color: var(--text-body); font-size: 15px; line-height: 1.6; padding-top: 12px; border-top: 1px solid var(--line); }
.sc-ev-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 4px; }
.sc-danger.is-armed { border-color: #7A2E2E; color: #FF8A7A; }
/* add / edit form */
.sc-form-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
.sc-tz-hint { margin-top: -6px; }
.sc-repeat legend { margin-bottom: 8px; }
.sc-days { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-day-pick { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text-body); font-size: 13.5px; font-weight: 600; cursor: pointer; user-select: none; }
.sc-day-pick input { position: absolute; opacity: 0; pointer-events: none; }
.sc-day-pick.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.sc-day-pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 1100px) {
  .sc { grid-template-columns: 1fr; }
  .sc-side { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 14px; }
  .sc-mini { grid-row: 1 / span 2; }
}
@media (max-width: 700px) {
  #cf-tab-schedule { padding: 14px 12px 32px; }
  .sc-side { display: flex; }
  .sc-main { padding: 14px 10px 12px; }
  .sc-tools { margin-left: 0; width: 100%; justify-content: space-between; }
  .sc-cell { min-height: 58px; padding: 4px 2px; align-items: center; }
  .sc-grid.is-week .sc-cell { min-height: 120px; align-items: stretch; }
  .sc-grid.is-month .sc-chips { display: none; }
  .sc-grid.is-month .sc-dots { display: flex; gap: 3px; margin-top: auto; }
  .sc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
  .sc-dots i.is-all { background: #F2BE4A; }
  .sc-grid.is-month .sc-cell { cursor: pointer; }
  .sc-wd { padding: 8px 2px; font-size: 12px; }
  .sc-form-row { grid-template-columns: 1fr 1fr; }
  .sc-form-row .field:first-child { grid-column: 1 / -1; }
}
.sc-dayview { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.sc-dayview h3 { margin: 0 0 10px; font: 700 15px var(--head); color: var(--text); }
/* Schedule fits the screen: the Upcoming / Past list scrolls inside its own box, and the
   calendar's rows grow or shrink with the window height (wide screens only). */
.sc-list { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sc-list::-webkit-scrollbar { width: 6px; }
.sc-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.sc-list::-webkit-scrollbar-track, .sc-list::-webkit-scrollbar-button { background: transparent; display: none; }
@media (min-width: 1101px) {
  #cf-tab-schedule { padding-bottom: 18px; }
  .sc { height: max(560px, calc(100dvh - 104px)); grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .sc-side { height: 100%; min-height: 0; }
  .sc-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 6px; }
  .sc-main { height: 100%; display: flex; flex-direction: column; }
  .sc-grid { flex: 1 1 auto; min-height: 0; grid-auto-rows: minmax(0, 1fr); grid-template-rows: auto; }
  .sc-grid.is-month { grid-template-rows: auto repeat(6, minmax(0, 1fr)); }
  .sc-grid.is-week { grid-template-rows: auto minmax(0, 1fr); }
  .sc-cell, .sc-grid.is-week .sc-cell { min-height: 0; overflow: hidden; }
  .sc-grid.is-week .sc-chips { overflow-y: auto; }
  .sc-dayview { display: none; }
}
@media (max-width: 1100px) {
  .sc-list { max-height: 300px; overflow-y: auto; padding-right: 6px; }
}
.sc-more { line-height: 1.2; padding: 0 4px; }

/* ---------- Dashboard: Announcements and Rules pages ---------- */
.nt { max-width: 980px; gap: 20px; }
/* header card */
.nt-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px;
  padding: 26px 28px; border-radius: 20px; border-color: var(--line-strong);
  background: radial-gradient(120% 160% at 100% 0%, rgba(var(--accent-rgb), 0.18) 0%, rgba(var(--accent-rgb), 0.04) 45%, transparent 70%), var(--surface);
}
.nt-hero::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.7; }
.nt-hero-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; color: var(--accent-lt); background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.28), rgba(var(--accent-rgb), 0.08)); border: 1px solid var(--accent-dim); box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.18); }
.nt-eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-lt); }
.nt-hero-text h1 { margin: 4px 0 4px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.02em; line-height: 1.1; }
.nt-hero-text p { margin: 0; color: var(--text-body); font-size: 15px; }
.nt-hero-side { display: flex; align-items: center; gap: 18px; }
.nt-stats { display: flex; gap: 6px; }
.nt-stat { display: flex; flex-direction: column; align-items: center; min-width: 92px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.nt-stat strong { font: 800 19px var(--head); color: var(--text); line-height: 1.2; white-space: nowrap; }
.nt-stat span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.nt-add { gap: 8px; white-space: nowrap; }
/* toolbar */
.nt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.nt-search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--muted); }
.nt-search:focus-within { border-color: var(--accent); }
.nt-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: 500 15px var(--font); outline: none; }
.nt-seg { display: inline-flex; padding: 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.nt-seg button { min-height: 34px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--text-body); font: 600 14px var(--font); cursor: pointer; }
.nt-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-lt); box-shadow: inset 0 0 0 1px var(--accent-dim); }
/* cards */
.nt-feed { display: flex; flex-direction: column; gap: 14px; }
.nt-card { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 22px 24px; border-radius: 18px; transition: border-color 0.15s ease; }
.nt-card:hover { border-color: var(--line-strong); }
.nt-card.is-skeleton { gap: 12px; }
.nt-card.is-featured {
  padding: 24px 26px; border-color: var(--accent-dim);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.09), rgba(var(--accent-rgb), 0.02) 60%), var(--surface);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.nt-flag { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--bg); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.nt-card-top { display: flex; align-items: flex-start; gap: 12px; }
.nt-title { margin: 0; flex: 1; min-width: 0; font-size: clamp(18px, 1.9vw, 21px); line-height: 1.3; letter-spacing: -0.01em; }
.nt-card.is-featured .nt-title { font-size: clamp(20px, 2.2vw, 24px); }
.nt-new { flex: 0 0 auto; margin-top: 3px; padding: 3px 9px; border-radius: 999px; background: rgba(61, 220, 132, 0.12); border: 1px solid rgba(61, 220, 132, 0.35); color: #6EE7A8; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.nt-num { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-dim); color: var(--accent-lt); font: 800 14px var(--head); }
.nt-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.nt-meta strong { color: var(--text-soft); font-weight: 600; }
.nt-text { color: var(--text-soft); font-size: 15.5px; line-height: 1.75; overflow-wrap: anywhere; white-space: pre-wrap; }
.nt-text.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.nt-more { align-self: flex-start; margin-top: -4px; padding: 0; border: 0; background: transparent; color: var(--accent-lt); font: 600 14px var(--font); cursor: pointer; }
.nt-more:hover { text-decoration: underline; }
.nt-att { max-width: 560px; }
.nt-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.nt-act { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: transparent; color: var(--text-body); font: 600 13px var(--font); cursor: pointer; }
.nt-act:hover { color: var(--text); border-color: var(--text-body); }
.nt-act.is-danger:hover, .nt-act.is-danger.is-armed { color: #FF8A7A; border-color: #7A2E2E; }
/* timeline */
.nt-group { display: flex; flex-direction: column; gap: 12px; }
.nt-group-label { margin: 6px 0 0; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.nt-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; position: relative; }
.nt-timeline::before { content: ""; position: absolute; left: 31px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--line-strong), transparent); }
.nt-tl-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: start; }
.nt-date { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0 7px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg); }
.nt-date span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-lt); }
.nt-date b { font: 800 22px/1.1 var(--head); color: var(--text); }
.nt-date small { font-size: 11px; color: var(--muted); }
/* empty + form */
.nt-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; text-align: center; border-style: dashed; border-radius: 18px; }
.nt-empty h2 { margin: 6px 0 0; font-size: 20px; }
.nt-empty p { margin: 0 0 8px; color: var(--text-body); }
.nt-empty-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--accent-dim); color: var(--accent-lt); }
.nt-check { display: inline-flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: 14.5px; cursor: pointer; }
.nt-check input { width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 900px) {
  .nt-hero { grid-template-columns: auto minmax(0, 1fr); }
  .nt-hero-side { grid-column: 1 / -1; justify-content: space-between; flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .nt-hero { padding: 20px 18px; gap: 14px; }
  .nt-hero-icon { width: 48px; height: 48px; border-radius: 14px; }
  .nt-stat { min-width: 0; flex: 1; }
  .nt-stats { flex: 1; }
  .nt-add { width: 100%; }
  .nt-card, .nt-card.is-featured { padding: 18px 16px; }
  .nt-tl-item { grid-template-columns: 1fr; gap: 8px; }
  .nt-timeline::before { display: none; }
  .nt-date { flex-direction: row; gap: 6px; justify-self: start; padding: 4px 12px; border-radius: 999px; }
  .nt-date b { font-size: 14px; }
}
/* ---------- Community side menu (reworked) ---------- */
.cf-nav { padding: 16px 12px 18px; gap: 3px; }
/* the batch this space belongs to */
.cf-spacecard {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 12px;
  border: 1px solid var(--accent-dim); border-radius: 14px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.04) 70%);
}
.cf-spacecard-badge {
  flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(145deg, #5B9BFF, #2F64D8); color: #fff; font: 800 14px var(--head); letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.35);
}
.cf-spacecard-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cf-spacecard-text strong { font: 700 15px var(--head); color: var(--text); }
.cf-spacecard-text span { font-size: 12.5px; color: var(--text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-spacecard-lock { flex: 0 0 auto; display: inline-flex; color: var(--accent-lt); opacity: 0.85; }
/* batch switch (moderators and admins) */
.cf-spaces { flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 10px; border: 0; background: none; }
.cf-space { transition: none; width: auto; min-height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; color: var(--text-body); }
.cf-space[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
/* section labels */
.cf-sec, .cf-nav-label { margin: 14px 0 4px; padding: 0 12px; min-height: 0; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.cf-sec { margin-top: 6px; }
.cf-nav-label { display: flex; align-items: center; justify-content: space-between; padding-right: 2px; }
/* rows: All posts, Schedule, channels */
.cf-all, .cf-chan {
  position: relative; min-height: 40px; padding: 0 12px; gap: 11px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-body); font-size: 14.5px; font-weight: 500; box-shadow: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.cf-all svg, .cf-chan-icon { color: var(--muted); }
.cf-all:hover, .cf-chan:hover { background: var(--cf-hover); color: var(--text); }
.cf-all[aria-current="true"], .cf-chan[aria-current="true"] {
  background: var(--accent-soft); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-dim);
}
.cf-all[aria-current="true"]::before, .cf-chan[aria-current="true"]::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.cf-all[aria-current="true"] svg, .cf-chan[aria-current="true"] .cf-chan-icon { color: var(--accent-lt); }
.cf-channels { gap: 10px; margin-top: 2px; }
.cf-cat-head { min-height: 26px; padding: 0 2px 0 12px; }
.cf-cat-name { font-size: 12px; font-weight: 600; color: var(--text-body); }
/* footer */
.cf-back { border-radius: 10px; }

/* ---------- Community: chat rooms (batch #chat) ---------- */
.ch { position: relative; display: flex; flex-direction: column; width: 100%; max-width: none; margin: 0; height: calc(100dvh - 61px); min-height: 420px; }
.ch-head { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--cf-line, var(--line)); }
.ch-head-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-dim); color: var(--accent-lt); flex: 0 0 auto; }
.ch-head-text { min-width: 0; }
.ch-head-text h1 { margin: 0; font-size: 18px; line-height: 1.2; }
.ch-head-text p { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 24px 12px; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.ch-scroll::-webkit-scrollbar { width: 8px; }
.ch-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.ch-intro { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 22px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.ch-intro-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; margin-bottom: 6px; color: var(--accent-lt); background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.28), rgba(var(--accent-rgb), 0.08)); border: 1px solid var(--accent-dim); }
.ch-intro h2 { margin: 0; font-size: 22px; }
.ch-intro p { margin: 0; color: var(--text-body); font-size: 14.5px; }
.ch-note { color: var(--muted); font-size: 14px; padding: 12px 0; }
.ch-note.is-error { color: #FF8A7A; }
.ch-day { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.ch-day::before, .ch-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ch-day span { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
/* message groups */
.ch-group { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
.ch-group.is-mine { justify-content: flex-end; }
.ch-avatar { flex: 0 0 auto; margin-top: 20px; }
.ch-group-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: min(72%, 620px); }
.ch-group.is-mine .ch-group-body { align-items: flex-end; }
.ch-group-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 4px 2px; font-size: 13px; }
.ch-group-head strong { color: var(--text); font-weight: 600; }
.ch-you { color: var(--text-body); font-weight: 600; }
.ch-group-head time { color: var(--muted); font-size: 12px; }
.ch-role { padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.ch-role.is-admin { background: rgba(242, 190, 74, 0.12); border: 1px solid #5C4718; color: #F5C451; }
.ch-role.is-mod { background: var(--accent-soft); border: 1px solid var(--accent-dim); color: var(--accent-lt); }
.ch-batch { padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-body); font-size: 10.5px; font-weight: 600; }
.ch-bubble-row { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.ch-bubble-row.is-mine { flex-direction: row-reverse; }
.ch-bubble {
  min-width: 0; padding: 9px 14px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface-2, var(--surface)); color: var(--text-soft); font-size: 15px; line-height: 1.5;
}
.ch-group:not(.is-mine) .ch-group-head + .ch-bubble-row .ch-bubble { border-top-left-radius: 6px; }
.ch-group.is-mine .ch-group-head + .ch-bubble-row .ch-bubble { border-top-right-radius: 6px; }
.ch-bubble-row.is-mine .ch-bubble { background: #2F64D8; border-color: #2F64D8; color: #fff; }
.ch-bubble-row.is-mine .ch-bubble a { color: #fff; text-decoration: underline; }
.ch-bubble.is-pending { opacity: 0.6; }
.ch-bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-bubble-att { margin: 2px 0 4px; max-width: 300px; }
.ch-bubble-att img { max-width: 100%; height: auto; border-radius: 12px; }
.ch-bubble-att:only-child { margin: 0; }
.ch-del { flex: 0 0 auto; display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 600 12px var(--font); cursor: pointer; opacity: 0; transition: opacity 0.12s ease; }
.ch-bubble-row:hover .ch-del, .ch-del:focus-visible, .ch-del.is-armed { opacity: 1; }
.ch-del:hover { background: var(--cf-hover); color: #FF8A7A; }
.ch-del.is-armed { color: #FF8A7A; }
@media (hover: none) { .ch-del { opacity: 0.6; } }
/* new messages pill */
.ch-jump { position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%); z-index: 2; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--accent); color: var(--bg); font: 700 13px var(--font); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); cursor: pointer; }
/* message box */
.ch-composer { padding: 12px 24px 16px; border-top: 1px solid var(--cf-line, var(--line)); background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.25)); }
.ch-box { display: flex; align-items: flex-end; gap: 6px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.ch-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15); }
.ch-box textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 160px; padding: 9px 6px; border: 0; outline: none; resize: none; background: transparent; color: var(--text); font: 400 15px/1.45 var(--font); }
.ch-box textarea::placeholder { color: var(--muted); }
.ch-tool, .ch-send { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; cursor: pointer; }
.ch-tool { background: transparent; color: var(--text-body); }
.ch-tool:hover { background: var(--cf-hover); color: var(--text); }
.ch-send { background: var(--accent); color: var(--bg); }
.ch-send:hover:not(:disabled) { filter: brightness(1.1); }
.ch-send:disabled { background: var(--surface-2, var(--line)); color: var(--muted); cursor: default; }
.ch-hint { margin: 6px 4px 0; font-size: 12px; color: var(--muted); }
.ch-hint.is-error { color: #FF8A7A; }
.ch-att { display: flex; align-items: center; gap: 10px; max-width: 420px; margin-bottom: 8px; padding: 6px 6px 6px 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.ch-att img, .ch-att-file { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.ch-att-file { display: grid; place-items: center; background: var(--surface-2, var(--line)); color: var(--text-body); }
.ch-att-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-att-name small { color: var(--muted); font-size: 12px; }
.ch-att-x { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.ch-att-x:hover { background: var(--cf-hover); color: var(--text); }
.ch-readonly { margin: 0; padding: 16px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; text-align: center; }
@media (max-width: 760px) {
  .ch-head { padding: 12px 14px; }
  .ch-scroll { padding: 16px 12px 10px; }
  .ch-group-body { max-width: 86%; }
  .ch-avatar { margin-top: 20px; }
  .ch-composer { padding: 10px 10px 12px; }
  .ch-hint { display: none; }
  .ch-hint.is-error { display: block; }
  .ch-jump { bottom: 92px; }
}
.ch-bubble:has(> .ch-bubble-att:only-child) { padding: 4px; }
.ch-bubble-att:only-child img { display: block; }
/* Chat room fills whatever height is left under the tab bar (and the payment banner, if shown). */
.cf-main:has(> .cf-panel.is-chat:not([hidden])) { height: 100dvh; }
.cf-panel.is-chat:not([hidden]) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cf-panel.is-chat .ch { flex: 1 1 auto; height: auto; min-height: 0; }
.ch-box textarea, .ch-box textarea:focus, .ch-box textarea:focus-visible { border: 0; outline: none; box-shadow: none; background: transparent; border-radius: 0; }

/* ---------- @mentions ---------- */
.cf-mention { display: inline-block; padding: 0 5px; border-radius: 6px; background: rgba(var(--accent-rgb), 0.16); color: var(--accent-lt); font-weight: 600; }
.cf-mention.is-me, .cf-mention.is-all { background: rgba(242, 190, 74, 0.16); color: #F5C451; }
.ch-bubble-row.is-mine .cf-mention { background: rgba(255, 255, 255, 0.18); color: #fff; }
.ch-bubble.is-for-me { border-color: #5C4718; background: linear-gradient(90deg, rgba(242, 190, 74, 0.12), rgba(242, 190, 74, 0.04)), var(--surface-2, var(--surface)); box-shadow: inset 3px 0 0 #F2BE4A; }
/* the "@" picker */
.ch-composer, .cf-comment-field, .cf-body-box { position: relative; }
.mn-pop {
  position: absolute; left: 0; right: 0; z-index: 30; max-width: 380px; max-height: 300px; overflow-y: auto; padding: 6px;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.mn-pop.is-above { bottom: calc(100% + 6px); }
.ch-composer > .mn-pop.is-above { left: 24px; bottom: calc(100% - 4px); }
.mn-pop.is-below { top: calc(100% + 6px); }
.mn-pop-head { padding: 6px 10px 4px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.mn-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text-soft); font: 500 14.5px var(--font); text-align: left; cursor: pointer; }
.mn-opt.is-active { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-dim); }
.mn-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mn-meta { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.mn-all { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(242, 190, 74, 0.16); color: #F5C451; font-weight: 800; }
@media (max-width: 760px) { .ch-composer > .mn-pop.is-above { left: 10px; right: 10px; max-width: none; } }

/* ---------- Chat: message toolbar, reactions, replies, editing ---------- */
.ch-bubble-row { position: relative; align-items: flex-start; }
.ch-bubble-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; }
.ch-bubble-row.is-mine .ch-bubble-col { align-items: flex-end; }
.ch-bubble-row.is-flash .ch-bubble { animation: ch-flash 1.6s ease; }
@keyframes ch-flash { 0%, 40% { box-shadow: 0 0 0 3px rgba(242, 190, 74, 0.7); } 100% { box-shadow: 0 0 0 0 rgba(242, 190, 74, 0); } }
/* hover toolbar */
.ch-tools {
  position: relative; flex: 0 0 auto; align-self: center; display: flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.12s ease;
}
.ch-bubble-row:hover .ch-tools, .ch-bubble-row:focus-within .ch-tools, .ch-bubble-row.is-picking .ch-tools { opacity: 1; pointer-events: auto; }
@media (hover: none) { .ch-tools { opacity: 0.85; pointer-events: auto; box-shadow: none; } }
.ch-tool-btn { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text-body); font: 600 12px var(--font); cursor: pointer; }
.ch-tool-btn:hover { background: var(--cf-hover); color: var(--text); }
.ch-tool-btn.is-danger:hover, .ch-tool-btn.is-armed { color: #FF8A7A; }
.ch-del { display: none; }
/* quick reactions */
.ch-rx-pop { position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 5; display: flex; gap: 2px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); }
.ch-bubble-row:not(.is-mine) .ch-rx-pop { right: auto; left: 0; }
.ch-rx-opt { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 19px; cursor: pointer; transition: transform 0.1s ease, background 0.1s ease; }
.ch-rx-opt:hover { transform: scale(1.2); background: var(--cf-hover); }
.ch-rx-opt.is-on { background: var(--accent-soft); }
.ch-rx { display: flex; flex-wrap: wrap; gap: 4px; }
.ch-rx-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text-body); font: 600 12.5px var(--font); cursor: pointer; }
.ch-rx-chip:hover { border-color: var(--text-body); color: var(--text); }
.ch-rx-chip.is-mine { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-lt); }
/* quoted reply inside a bubble */
.ch-quote { display: flex; flex-direction: column; gap: 1px; width: 100%; min-width: 160px; margin: 2px 0 6px; padding: 6px 10px; border: 0; border-left: 3px solid var(--accent); border-radius: 8px; background: rgba(0, 0, 0, 0.25); color: inherit; text-align: left; cursor: pointer; }
.ch-quote strong { font-size: 12.5px; color: var(--accent-lt); }
.ch-quote span { font-size: 13px; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.ch-bubble-row.is-mine .ch-quote { border-left-color: #fff; background: rgba(255, 255, 255, 0.14); }
.ch-bubble-row.is-mine .ch-quote strong { color: #fff; }
.ch-edited { display: inline-block; margin-left: 6px; font-size: 11.5px; opacity: 0.7; }
/* reply bar above the message box */
.ch-replybar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--surface); color: var(--accent-lt); }
.ch-replybar-text { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: baseline; color: var(--text-body); font-size: 13.5px; }
.ch-replybar-text strong { color: var(--text); }
.ch-replybar-text em { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; color: var(--muted); }
/* editing in place */
.ch-edit { position: relative; width: min(560px, 100%); padding: 8px; border: 1px solid var(--accent); border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15); }
.ch-edit-input { display: block; width: 100%; min-height: 40px; max-height: 200px; padding: 6px 8px; border: 0; outline: none; resize: none; background: transparent; color: var(--text); font: 400 15px/1.5 var(--font); }
.ch-edit-input:focus, .ch-edit-input:focus-visible { outline: none; box-shadow: none; border: 0; }
.ch-edit-foot { display: flex; align-items: center; gap: 8px; padding: 6px 4px 0; }
.ch-edit-foot span { flex: 1; font-size: 12px; color: var(--muted); }
.ch-edit-btn { min-height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: transparent; color: var(--text-body); font: 600 13px var(--font); cursor: pointer; }
.ch-edit-btn.is-save { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.ch-edit > .mn-pop { bottom: calc(100% + 6px); }

/* ---------- Chat: message toolbar (reworked) — floats over the message's top corner ---------- */
.ch-bubble-row { position: relative; }
.ch-tools {
  position: absolute; top: -18px; right: -6px; z-index: 4; align-self: auto;
  display: flex; align-items: center; gap: 1px; padding: 3px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: #0E1422; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.3);
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.ch-bubble-row.is-mine .ch-tools { right: auto; left: -6px; }
.ch-bubble-row:hover .ch-tools, .ch-bubble-row:focus-within .ch-tools, .ch-bubble-row.is-picking .ch-tools { opacity: 1; transform: none; pointer-events: auto; }
.ch-bubble-row:hover .ch-bubble { filter: brightness(1.06); }
.ch-tool-btn {
  position: relative; display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px;
  border: 0; border-radius: 7px; background: transparent; color: #A9B4C6; font: 600 12px var(--font); cursor: pointer;
}
.ch-tool-btn:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.ch-tool-btn.is-emoji { font-size: 16px; line-height: 1; padding: 0 5px; filter: saturate(0.9); }
.ch-tool-btn.is-emoji:hover { transform: scale(1.12); filter: none; }
.ch-tool-btn.is-emoji.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-dim); }
.ch-tool-btn.is-danger:hover { background: rgba(255, 90, 90, 0.12); color: #FF8A7A; }
.ch-tool-btn.is-armed { background: #C2413A; color: #fff; padding: 0 10px; }
.ch-tool-btn.is-armed:hover { background: #D64A42; color: #fff; }
.ch-tool-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line-strong); }
/* small labels on hover */
.ch-tool-btn[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(2px);
  padding: 4px 8px; border-radius: 6px; background: #F1F4F9; color: #0A0F1B; font: 600 11.5px var(--font); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.1s ease 0.25s, transform 0.1s ease 0.25s;
}
.ch-tool-btn[data-tip]:hover::after, .ch-tool-btn[data-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%); }
/* full reaction picker under the toolbar */
.ch-rx-pop { bottom: auto; top: calc(100% + 6px); }
/* room above the first message of a group for the floating toolbar */
.ch-group-body { gap: 4px; }
@media (hover: none) {
  .ch-tools { position: static; opacity: 1; transform: none; pointer-events: auto; box-shadow: none; background: transparent; border-color: transparent; }
  .ch-tool-btn[data-tip]::after { display: none; }
}
/* toolbar beside the message (outside it), so it never covers text */
.ch-tools { top: 50%; right: auto; left: calc(100% + 8px); transform: translate(0, calc(-50% + 4px)); }
.ch-bubble-row.is-mine .ch-tools { left: auto; right: calc(100% + 8px); }
.ch-bubble-row:hover .ch-tools, .ch-bubble-row:focus-within .ch-tools, .ch-bubble-row.is-picking .ch-tools { transform: translate(0, -50%); }
@media (hover: none) { .ch-tools { transform: none; } }
/* invisible bridge over the gap, so moving the mouse to the toolbar keeps it open */
.ch-tools::before { content: ""; position: absolute; top: -8px; bottom: -8px; right: 100%; width: 14px; }
.ch-bubble-row.is-mine .ch-tools::before { right: auto; left: 100%; }

/* ================= Chat: message rows (reworked, list style) ================= */
.ch-scroll { padding: 18px 0 10px; }
.ch-intro { margin: 0 24px 6px; }
.ch-note { padding: 12px 24px; }
/* day dividers */
.ch-day { margin: 20px 24px 8px; gap: 14px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ch-day span { padding: 0; border: 0; background: none; letter-spacing: 0.02em; }
.ch-day::before, .ch-day::after { background: var(--line); }
/* groups and rows: everyone on the left, no bubbles */
.ch-group, .ch-group.is-mine { display: block; margin-top: 14px; }
.ch-group-body { max-width: none; }
.ch-bubble-row, .ch-bubble-row.is-mine {
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: start; column-gap: 12px;
  padding: 2px 72px 2px 20px; flex-direction: initial; transition: background 0.08s ease;
}
.ch-bubble-row.is-first { padding-top: 6px; }
.ch-bubble-row:hover, .ch-bubble-row.is-picking, .ch-bubble-row:focus-within { background: rgba(255, 255, 255, 0.028); }
.ch-bubble-row:hover .ch-bubble { filter: none; }
.ch-gutter { display: flex; justify-content: center; padding-top: 2px; min-height: 22px; }
.ch-bubble-row.is-first .ch-gutter { padding-top: 2px; }
.ch-bubble-row.has-quote .ch-gutter { padding-top: 26px; }
.ch-hover-time { visibility: hidden; padding-top: 3px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.ch-bubble-row:hover .ch-hover-time { visibility: visible; }
.ch-bubble-col, .ch-bubble-row.is-mine .ch-bubble-col { align-items: stretch; gap: 2px; min-width: 0; }
/* name line */
.ch-group-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; padding: 0; font-size: 13px; line-height: 1.4; }
.ch-name { color: var(--text); font: 700 15px var(--head); letter-spacing: 0.01em; }
.ch-name.is-admin { color: #F5C451; }
.ch-name.is-mod { color: var(--accent-lt); }
.ch-group-head .ch-role, .ch-group-head .ch-batch { align-self: center; }
.ch-you { padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--text-body); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; align-self: center; }
.ch-group-head time { color: var(--muted); font-size: 12px; }
/* message text: plain, no bubble */
.ch-bubble, .ch-bubble-row.is-mine .ch-bubble,
.ch-group:not(.is-mine) .ch-group-head + .ch-bubble-row .ch-bubble, .ch-group.is-mine .ch-group-head + .ch-bubble-row .ch-bubble {
  padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text-soft);
  font-size: 15px; line-height: 1.55;
}
.ch-bubble-row.is-mine .ch-bubble a { color: var(--accent-lt); }
.ch-bubble-row.is-mine .cf-mention { background: rgba(var(--accent-rgb), 0.16); color: var(--accent-lt); }
.ch-bubble.is-pending { opacity: 0.55; }
.ch-bubble-att { margin: 4px 0 2px; max-width: 360px; }
.ch-bubble:has(> .ch-bubble-att:only-child) { padding: 0; }
.ch-edited { margin-left: 4px; font-size: 11px; color: var(--muted); opacity: 1; }
/* a message that mentions you: tinted row with a gold bar */
.ch-bubble-row.is-for-me, .ch-bubble-row.is-for-me:hover { background: rgba(242, 190, 74, 0.075); box-shadow: inset 2px 0 0 #F2BE4A; }
.ch-bubble-row.is-for-me:hover { background: rgba(242, 190, 74, 0.11); }
.ch-bubble.is-for-me { background: none; box-shadow: none; border: 0; }
/* reply line above a message */
.ch-quote, .ch-bubble-row.is-mine .ch-quote {
  display: flex; flex-direction: row; align-items: center; gap: 6px; width: auto; min-width: 0; max-width: 100%; margin: 0 0 2px; padding: 0;
  border: 0; border-radius: 0; background: none; color: var(--muted); font-size: 13px; text-align: left; cursor: pointer;
}
.ch-quote:hover span, .ch-quote:hover strong { color: var(--text); }
.ch-quote-icon { display: inline-flex; color: var(--muted); }
.ch-quote strong, .ch-bubble-row.is-mine .ch-quote strong { flex: 0 0 auto; font-size: 13px; color: var(--accent-lt); }
.ch-quote span { min-width: 0; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 1; color: var(--text-body); }
/* reactions under the text */
.ch-rx { margin-top: 4px; }
/* flash when jumped to */
.ch-bubble-row.is-flash { animation: ch-row-flash 1.6s ease; }
.ch-bubble-row.is-flash .ch-bubble { animation: none; }
@keyframes ch-row-flash { 0%, 35% { background: rgba(var(--accent-rgb), 0.18); } 100% { background: transparent; } }
/* toolbar: top right of the row */
.ch-tools, .ch-bubble-row.is-mine .ch-tools { top: -16px; right: 20px; left: auto; transform: translateY(4px); }
.ch-bubble-row:hover .ch-tools, .ch-bubble-row:focus-within .ch-tools, .ch-bubble-row.is-picking .ch-tools { transform: none; }
.ch-tools::before, .ch-bubble-row.is-mine .ch-tools::before { display: none; }
.ch-rx-pop, .ch-bubble-row:not(.is-mine) .ch-rx-pop { left: auto; right: 0; }
/* editing */
.ch-edit { width: 100%; max-width: 760px; margin: 2px 0; }
/* message box */
.ch-composer { background: none; padding: 10px 20px 14px; }
.ch-box { position: relative; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 12px; background: var(--surface-2, #111A2C); border-color: transparent; }
.ch-box:focus-within { border-color: var(--line-strong); box-shadow: none; }
.ch-plus { width: 32px; height: 32px; margin: 0 4px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: var(--text-soft); }
.ch-plus:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.ch-box textarea { padding: 10px 6px; }
.ch-send { width: 36px; height: 36px; border-radius: 10px; }
.ch-emoji-pop { position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 20; display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
.ch-emoji-opt { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 20px; cursor: pointer; }
.ch-emoji-opt:hover { background: var(--cf-hover); transform: scale(1.1); }
.ch-replybar { margin: 0 0 8px; }
@media (max-width: 760px) {
  .ch-bubble-row, .ch-bubble-row.is-mine { grid-template-columns: 40px minmax(0, 1fr); column-gap: 10px; padding: 2px 12px; }
  .ch-gutter .cm-avatar { width: 36px !important; height: 36px !important; }
  .ch-hover-time { display: none; }
  .ch-tools, .ch-bubble-row.is-mine .ch-tools { position: static; grid-column: 2; justify-self: start; margin-top: 2px; }
  .ch-day { margin: 16px 12px 6px; }
  .ch-intro { margin: 0 12px 6px; }
  .ch-composer { padding: 8px 10px 10px; }
  .ch-emoji-pop { grid-template-columns: repeat(6, 36px); }
}
/* phones: the toolbar shows for the message you tap (tap sets :hover / focus) */
@media (hover: none), (max-width: 760px) {
  .ch-tools, .ch-bubble-row.is-mine .ch-tools {
    position: absolute; top: -14px; right: 10px; grid-column: auto; margin: 0;
    opacity: 0; pointer-events: none; background: #0E1422; border-color: var(--line-strong); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  }
  .ch-bubble-row:hover .ch-tools, .ch-bubble-row:focus-within .ch-tools, .ch-bubble-row.is-picking .ch-tools { opacity: 1; pointer-events: auto; }
}
.ch-bubble-text { display: inline; }
.ch-bubble-att + .ch-bubble-text { display: block; }
.ch-edited { vertical-align: baseline; }
/* Messages sit at the bottom, next to the message box (like any chat); older ones fill in above. */
.ch-scroll > .ch-intro { margin-top: auto; }

/* ---------- Chat: formatted text (markdown subset) ---------- */
.ch-bubble-text, .ch-bubble-att + .ch-bubble-text { display: block; }
.md { white-space: normal; }
.md-p { white-space: pre-wrap; overflow-wrap: anywhere; }
.md-p.is-empty { line-height: 0.8; }
.md-h1, .md-h2, .md-h3 { color: var(--text); font-family: var(--head); line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.md-h1 { font-size: 26px; font-weight: 800; margin: 6px 0 4px; }
.md-h2 { font-size: 21px; font-weight: 800; margin: 5px 0 3px; }
.md-h3 { font-size: 17px; font-weight: 700; margin: 4px 0 2px; }
.md-h1:first-child, .md-h2:first-child, .md-h3:first-child { margin-top: 2px; }
.md strong { color: var(--text); font-weight: 700; }
.md s { opacity: 0.75; }
.md-code { padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); font: 500 0.88em var(--mono); color: #E8ECF3; }
.md-pre { margin: 4px 0; padding: 10px 12px; max-width: 760px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #070B14; }
.md-pre code { font: 500 13px/1.55 var(--mono); color: #D7DEE9; white-space: pre; }
.md-quote { margin: 2px 0; padding: 0 0 0 12px; border-left: 4px solid var(--line-strong); color: var(--text-body); }
.md-ul { margin: 2px 0; padding-left: 22px; }
.md-ul li { margin: 1px 0; overflow-wrap: anywhere; }
.md-ul li::marker { color: var(--muted); }
.md-ul { list-style: disc outside; }
.md-ul li { display: list-item; }
/* The logo area and the tab bar share one bottom line. */
.cf-brand { min-height: 0; height: 60px; box-sizing: border-box; }
.cf-tabbar { min-height: 0; height: 60px; box-sizing: border-box; }

/* ---------- Schedule: Add / Edit event form ---------- */
.sc-form-dialog { width: min(620px, calc(100% - 32px)); }
.sc-form-dialog .dc-form { overflow-x: hidden; }
.sc-form-row > .field, .sc-form-dialog .field { min-width: 0; }
.sc-form-dialog input, .sc-form-dialog select, .sc-form-dialog textarea { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.sc-form-dialog input[type="date"], .sc-form-dialog input[type="time"] { padding-right: 10px; }
/* "Repeat every week on": a clean group, no browser frame */
.sc-repeat { min-width: 0; margin: 0; padding: 0; border: 0; }
.sc-repeat legend { padding: 0; margin-bottom: 10px; font-size: 14px; color: var(--text-soft); }
.sc-repeat legend .muted { font-size: 13px; }
.sc-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sc-day-pick { position: relative; min-width: 0; padding: 0; }
@media (max-width: 520px) {
  .sc-form-row { grid-template-columns: 1fr 1fr; }
  .sc-form-row .field:first-child { grid-column: 1 / -1; }
  .sc-days { gap: 4px; }
  .sc-day-pick { font-size: 12.5px; min-height: 34px; }
}
.sc-tools .btn { white-space: nowrap; }
/* In a chat room the page is a fixed-height column: the tab bar (and banner) must not be squeezed. */
.cf-main > .cf-tabbar, .cf-main > .rn-banner { flex-shrink: 0; }

/* ---------- Scrollbars: slim and dark everywhere (pop-ups, lists, pages) ---------- */
/* Firefox (no ::-webkit-scrollbar): the simple thin, dark scrollbar. */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: #2A3954 transparent; } }
/* Chrome, Edge, Safari use the custom one below, so undo the simple settings set on some areas. */
@supports selector(::-webkit-scrollbar) {
  .sc-list, .ch-scroll, .mb-list, .cf-nav, dialog, .dc-form, .admin-card.is-wide #app-list { scrollbar-width: auto; scrollbar-color: auto; }
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background-color: #2A3954; border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: #3B4E72; }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
*::-webkit-scrollbar-corner { background: transparent; }
/* pop-ups: the scrollbar stays inside the rounded corners */
dialog { scrollbar-gutter: auto; }
dialog::-webkit-scrollbar-track { margin: 14px 0; }
.dc-form::-webkit-scrollbar-track, .card::-webkit-scrollbar-track { margin: 14px 0; }

/* ---------- Community: Members tab (reworked) ---------- */
.mm, .ab { width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px clamp(14px, 2.4vw, 28px) 64px; display: flex; flex-direction: column; gap: 20px; }
.mm-hero, .ab-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 20px; padding: 26px 28px; border-radius: 20px; border-color: var(--line-strong);
  background: radial-gradient(120% 160% at 100% 0%, rgba(var(--accent-rgb), 0.18) 0%, rgba(var(--accent-rgb), 0.04) 45%, transparent 70%), var(--surface);
}
.mm-hero::after, .ab-hero::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.7; }
.mm-hero-text { flex: 1; min-width: 0; }
.mm-eyebrow, .ab-eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-lt); }
.mm-hero h1, .ab-hero h1 { margin: 4px 0 4px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.02em; line-height: 1.1; }
.mm-hero p, .ab-hero p { margin: 0; color: var(--text-body); font-size: 15px; line-height: 1.6; }
.mm-stats { display: flex; gap: 8px; }
.mm-stat { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.mm-stat strong { font: 800 22px var(--head); color: var(--text); line-height: 1.2; }
.mm-stat span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mm-search { flex: 1 1 240px; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--muted); }
.mm-search:focus-within { border-color: var(--accent); }
.mm-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: 500 15px var(--font); }
.mm-search input:focus { box-shadow: none; outline: none; }
.mm-seg { display: inline-flex; flex-wrap: wrap; padding: 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.mm-seg button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text-body); font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.mm-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-lt); box-shadow: inset 0 0 0 1px var(--accent-dim); }
.mm-section { display: flex; flex-direction: column; gap: 12px; }
.mm-section-title { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.mm-section-title span { padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--text-body); font-size: 11px; letter-spacing: 0; }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mm-grid.is-team { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.mm-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: 16px; min-width: 0; transition: border-color 0.15s ease, transform 0.15s ease; }
.mm-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.mm-card.is-featured { padding: 18px 20px; background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.07), transparent 70%), var(--surface); border-color: var(--accent-dim); }
.mm-card.is-featured.is-admin { background: linear-gradient(180deg, rgba(242, 190, 74, 0.07), transparent 70%), var(--surface); border-color: #4A3A14; }
.mm-card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mm-card-top .cm-avatar { width: 44px; height: 44px; }
.mm-card.is-featured .mm-card-top .cm-avatar { width: 52px; height: 52px; }
.mm-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.mm-name { color: var(--text); font: 700 15.5px var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-role, .mm-batch { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.mm-role { background: rgba(255, 255, 255, 0.06); color: var(--text-body); }
.mm-role.is-owner, .mm-role.is-admin { background: rgba(242, 190, 74, 0.12); color: #F5C451; }
.mm-role.is-mod { background: var(--accent-soft); color: var(--accent-lt); }
.mm-batch { border: 1px solid var(--accent-dim); color: var(--accent-lt); }
.mm-note { margin: 0; color: var(--text-body); font-size: 13.5px; line-height: 1.55; }
.mm-card-foot { display: flex; padding-top: 12px; border-top: 1px solid var(--line); margin-top: auto; }
.mm-change { min-height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: transparent; color: var(--text-soft); font: 600 13px var(--font); cursor: pointer; }
.mm-change:hover { border-color: var(--accent); color: var(--accent-lt); }
.mm-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; text-align: center; border-style: dashed; border-radius: 18px; }
.mm-empty h2 { margin: 0; font-size: 19px; }
.mm-empty p { margin: 0 0 6px; color: var(--text-body); }

/* ---------- Community: About tab (reworked) ---------- */
.ab-hero { align-items: flex-start; }
.ab-logo { flex: 0 0 auto; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(145deg, #5B9BFF, #2F64D8); box-shadow: 0 12px 30px rgba(var(--accent-rgb), 0.35); }
.ab-logo img { width: 40px; height: auto; }
.ab-hero-text { flex: 1; min-width: 0; }
.ab-hero p { max-width: 62ch; }
.ab-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ab-fact { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(0, 0, 0, 0.25); color: var(--text-body); font-size: 13px; }
.ab-fact b { color: var(--text); font-weight: 700; margin-right: 4px; }
.ab-section { display: flex; flex-direction: column; gap: 12px; }
.ab-title { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.ab-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ab-feature { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 16px; }
.ab-feature h3 { margin: 4px 0 0; font-size: 16px; }
.ab-feature p { margin: 0; color: var(--text-body); font-size: 14px; line-height: 1.6; }
.ab-feature-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-dim); color: var(--accent-lt); }
.ab-columns { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.ab-rules { padding: 22px 24px; border-radius: 18px; }
.ab-rules ol { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.ab-rules li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.ab-rules li:first-child { border-top: 0; padding-top: 4px; }
.ab-rule-num { flex: 0 0 auto; font: 800 14px var(--head); color: var(--accent); min-width: 22px; padding-top: 1px; }
.ab-rules li > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.ab-rules strong { color: var(--text); font-size: 15px; }
.ab-rules li > span:last-child > span { color: var(--text-body); font-size: 14px; line-height: 1.55; }
.ab-help { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 18px; }
.ab-help p { margin: 0; color: var(--text-body); font-size: 14.5px; line-height: 1.6; }
.ab-help strong { color: var(--text); }
.ab-help a { color: var(--accent-lt); font-weight: 600; }
.ab-small { padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px !important; color: var(--muted) !important; }
@media (max-width: 860px) {
  .mm-hero { flex-direction: column; align-items: flex-start; }
  .mm-stats { width: 100%; }
  .mm-stat { flex: 1; min-width: 0; }
  .ab-columns { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .mm, .ab { padding: 16px 12px 48px; gap: 16px; }
  .mm-hero, .ab-hero { padding: 20px 18px; }
  .ab-hero { flex-direction: column; }
  .ab-logo { width: 52px; height: 52px; border-radius: 14px; }
  .mm-grid, .mm-grid.is-team { grid-template-columns: 1fr; }
}

/* ---------- Community: Learning tab (reworked) ---------- */
.lr { width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px clamp(14px, 2.4vw, 28px) 64px; display: flex; flex-direction: column; gap: 20px; }
.lr-hero-icon { flex: 0 0 auto; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; color: var(--accent-lt); background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.28), rgba(var(--accent-rgb), 0.08)); border: 1px solid var(--accent-dim); box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.18); }
/* covers */
.lr-cover { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #0B1428; }
.lr-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.lr-cover.is-generated {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 18px 20px;
  background: radial-gradient(120% 120% at 0% 0%, rgba(var(--accent-rgb), 0.45), transparent 55%),
              radial-gradient(90% 90% at 100% 100%, rgba(47, 100, 216, 0.35), transparent 60%), #0B1428;
}
.lr-cover.is-generated::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px); background-size: 18px 18px; }
.lr-cover-brand { position: relative; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-lt); }
.lr-cover-title { position: relative; color: #fff; font: 800 clamp(20px, 2.2vw, 26px) / 1.15 var(--head); letter-spacing: -0.01em; text-transform: uppercase; }
.lr-cover.is-featured .lr-cover-title { font-size: clamp(24px, 3vw, 34px); }
.lr-cover-play {
  position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.95); color: #0A0F1B; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: scale(0.9); transition: opacity 0.18s ease, transform 0.18s ease;
}
.lr-cover-play svg { margin-left: 2px; }
.lr-featured:hover .lr-cover-play, .lr-card:hover .lr-cover-play, .lr-featured:focus-visible .lr-cover-play, .lr-card:focus-visible .lr-cover-play { opacity: 1; transform: none; }
.lr-featured:hover .lr-cover img, .lr-card:hover .lr-cover img { transform: scale(1.03); }
/* featured course */
.lr-featured {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); overflow: hidden; border-radius: 20px; color: inherit; text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lr-featured:hover { border-color: var(--accent-dim); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }
.lr-featured .lr-cover { aspect-ratio: auto; min-height: 280px; height: 100%; }
.lr-featured-body { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 28px 30px; min-width: 0; }
.lr-kicker { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-lt); }
.lr-featured-body h2 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -0.01em; color: var(--text); }
.lr-featured-body p { margin: 0; color: var(--text-body); font-size: 15px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.lr-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.lr-pill { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text-body); font-size: 12.5px; font-weight: 600; }
.lr-open { gap: 8px; pointer-events: none; }
/* more courses */
.lr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lr-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; color: inherit; text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.lr-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.lr-card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.lr-card-body h3 { margin: 0; font-size: 16.5px; line-height: 1.3; color: var(--text); }
.lr-card-body p { margin: 0; color: var(--text-body); font-size: 14px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lr-card-body .lr-meta { margin-top: auto; padding-top: 10px; }
.lr-link { color: var(--accent-lt); font-weight: 700; font-size: 14px; }
.lr-featured:focus-visible, .lr-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 860px) {
  .lr-featured { grid-template-columns: 1fr; }
  .lr-featured .lr-cover { min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 600px) {
  .lr { padding: 16px 12px 48px; gap: 16px; }
  .lr-featured-body { padding: 20px 18px; }
  .lr-hero { flex-wrap: wrap; }
  .lr-hero-icon { width: 48px; height: 48px; border-radius: 14px; }
  .lr-open { width: 100%; }
}

/* ---------- Mentorship agreement (src/shared/Contract.jsx) ---------- */
.cm-page:has(.ct-setup) > .cm-top { display: none; }
.ct-setup { min-height: 100vh; min-height: 100dvh; }
.cm-auth-card.ct-card { max-width: 640px; }
.ct-card .eyebrow { margin-bottom: -8px; }
.ct-lead { color: var(--text-body); font-size: 15.5px; line-height: 1.55; }
.ct-form { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ct-form .field label, .ct-label { color: var(--text-soft); font-size: 14px; font-weight: 500; }
.ct-form .form-msg:empty { display: none; }

/* the three steps (a real sequence) */
.ct-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; counter-reset: ct; }
.ct-steps li { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); min-width: 0; }
.ct-steps li::before {
  counter-increment: ct; content: counter(ct); display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 4px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-lt, var(--accent)); font: 700 12px/1 var(--head);
}
.ct-steps strong { font: 600 14px/1.3 var(--head); color: var(--text); }
.ct-steps span { font-size: 13px; line-height: 1.5; color: var(--muted); }

/* the agreement document */
.ct-doc2 { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); overflow: hidden; }
.ct-doc2-main { display: flex; align-items: center; gap: 14px; padding: 16px; flex-wrap: wrap; }
.ct-doc2-icon { display: grid; place-items: center; width: 46px; height: 54px; flex-shrink: 0; border-radius: 8px; background: var(--accent-soft); color: var(--accent-lt, var(--accent)); }
.ct-doc2-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 180px; min-width: 0; }
.ct-doc2-text strong { font: 700 15.5px/1.3 var(--head); color: var(--text); }
.ct-doc2-text span { font-size: 13px; color: var(--muted); font-family: var(--mono); letter-spacing: 0.02em; }
.ct-doc2-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ct-dl { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 14px; }
.ct-doc2-wait { font-size: 13px; color: var(--muted); }
.ct-doc2-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.ct-doc2-missing { padding: 0 16px 14px; font-size: 13px; color: var(--muted); }
.ct-doc-text { max-height: min(48vh, 380px); overflow: auto; padding: 18px 20px; border-top: 1px solid var(--line); }
.ct-doc-text:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ct-legal { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.65; color: var(--text-body); }
.ct-legal-org { font: 700 12px/1 var(--head); letter-spacing: 0.14em; color: var(--muted); }
.ct-legal h2 { font: 800 18px/1.25 var(--head); color: var(--text); margin: 0 0 2px; }
.ct-legal h3 { font: 700 14px/1.35 var(--head); color: var(--text); margin: 6px 0 0; letter-spacing: 0.02em; }
.ct-legal h4 { font: 600 14px/1.4 var(--font); color: var(--text); margin: 2px 0 0; }
.ct-legal strong { color: var(--text); font-weight: 600; }
.ct-sec { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.ct-legal ul, .ct-legal ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.ct-legal ul { list-style: disc outside; }
.ct-legal ol { list-style: decimal outside; }
.ct-legal-sign { font-size: 13px; color: var(--muted); font-style: italic; }

/* upload */
.ct-drop {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px;
  border: 1.5px dashed var(--line-strong, #2a3954); border-radius: 14px; background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}
.ct-drop.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.field.is-invalid .ct-drop { border-color: var(--danger, #f87171); }
.ct-drop-icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent-lt, var(--accent)); }
.ct-drop-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 200px; min-width: 0; }
.ct-drop-text strong { font: 600 14.5px/1.35 var(--head); color: var(--text); }
.ct-drop-text span { font-size: 12.5px; color: var(--muted); }
.ct-choose { padding: 9px 16px; font-size: 14px; flex-shrink: 0; }
.ct-files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ct-files li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.ct-file-type { font: 700 10px/1 var(--mono); letter-spacing: 0.06em; padding: 5px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-lt, var(--accent)); }
.ct-file-name { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-file-size { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-file-x { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.ct-file-x:hover { background: var(--accent-soft); color: var(--text); }
.ct-file-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.ct-agree { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.55; color: var(--text-body); cursor: pointer; }
.ct-agree input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
.ct-agree.is-invalid span { color: var(--text); }
.ct-agree.is-invalid input { outline: 2px solid var(--danger, #f87171); outline-offset: 2px; }
.ct-fine { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: -8px; }

/* rejected: the owner's reason */
.ct-alert { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.ct-alert strong { font: 600 14.5px/1.35 var(--head); color: var(--text); }
.ct-alert p { font-size: 14px; color: var(--text); white-space: pre-wrap; }
.ct-alert span { font-size: 13px; color: var(--muted); }

/* ready to send (Create account, step 2) */
.ct-done { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.25); color: var(--text-soft); font-size: 14px; line-height: 1.5; }
.ct-done::before { content: "✓"; color: #4ade80; font-weight: 700; }

/* under review */
.ct-review { display: flex; flex-direction: column; gap: 16px; }
.ct-review-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-lt, var(--accent)); }
.ct-review h1 { margin: -6px 0 0; }
.ct-track { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.ct-track li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 0 0 18px 30px; }
.ct-track li:last-child { padding-bottom: 0; }
.ct-track li::before { content: ""; position: absolute; left: 4px; top: 4px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong, #2a3954); background: var(--bg); }
.ct-track li::after { content: ""; position: absolute; left: 10px; top: 20px; bottom: 2px; width: 2px; background: var(--line); }
.ct-track li:last-child::after { display: none; }
.ct-track li.is-done::before { border-color: #4ade80; background: #4ade80; }
.ct-track li.is-now::before { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); }
.ct-track strong { font: 600 14.5px/1.3 var(--head); color: var(--text); }
.ct-track li:not(.is-done):not(.is-now) strong { color: var(--muted); }
.ct-track span { font-size: 13px; color: var(--muted); }
.ct-summary { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
.ct-summary div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding: 9px 0; font-size: 14px; }
.ct-summary div + div { border-top: 1px solid var(--line); }
.ct-summary dt { color: var(--muted); }
.ct-summary dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

@media (max-width: 560px) {
  /* phones: one compact list instead of three boxes */
  .ct-steps { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
  .ct-steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; border: 0; border-radius: 0; background: none; padding: 12px 14px; }
  .ct-steps li + li { border-top: 1px solid var(--line); }
  .ct-steps li::before { grid-row: 1 / span 2; margin-bottom: 0; }
  .ct-doc2-actions, .ct-dl { width: 100%; justify-content: center; }
  .ct-choose { width: 100%; }
}

/* Admin drawer: the member's signed agreement */
.ad-ct-files { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.ad-ct-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--text); }
.ad-ct-file span:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-ct-file small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.ad-ct-review { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.ad-ct-review textarea { width: 100%; min-height: 76px; resize: vertical; }
.ad-ct-note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.3); font-size: 14px; color: var(--text); white-space: pre-wrap; }.ad-ct-review textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; line-height: 1.5; }
.ad-ct-review textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ad-ct-review .ad-btn-danger { align-self: flex-start; }/* Legal pages: sub-headings and bullet lists */
.legal-card h3 { font: 600 16px/1.35 var(--head); color: var(--text); margin-top: 6px; }
.legal-card ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; list-style: disc outside; color: var(--text-body); font-size: 16px; }
.legal-card li::marker { color: var(--accent); }
.legal-contact { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); line-height: 1.7; }.ct-doc2-note { font-size: 13px; color: var(--muted); }
.ct-doc2-loading { padding: 22px 16px; font-size: 14px; color: var(--muted); }