/* ============================================================
   OYC AI Studio — Front-end v2
   Design system ported from the Figma redesign + preview at
   /core/preview/homepage.html. Source Figma:
   "2026 Gold Front Website Design", node 19588:34246.
   v1 lives at / and is unchanged. v2 lives at /v2.
   ============================================================ */

/* -- Fonts: real Neue Haas Grotesk (licensed) self-hosted from
   the goldfront-website repo. Display Std cuts only — works
   across sizes since the website itself uses Display for body. */
@font-face {
  font-family: 'Neue Haas Grotesk Display Std';
  src: url('/public/fonts/nhaasgroteskdsstd-55rg.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Neue Haas Grotesk Display Std';
  src: url('/public/fonts/nhaasgroteskdsstd-65md.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Neue Haas Grotesk';
  src: url('/public/fonts/NeueHaasDisplay-Light.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Neue Haas Grotesk';
  src: url('/public/fonts/NeueHaasDisplay-Mediu.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  /* Colors — extracted exactly from Figma (light mode default) */
  --c-ink: #1d1d1d;
  --c-ink-50: rgba(29, 29, 29, 0.5);
  --c-bg: #3681a5;
  --c-surface: #ffffff;
  --c-surface-muted: #f9f9f9;
  --c-surface-chip: #f1f1f1;
  --c-border: #e7e7e7;
  --c-maroon: #7f2e2e;
  --c-pink: #f15bb2;
  --c-pink-10: rgba(241, 91, 178, 0.1);
  --c-yellow-bg: rgba(254, 229, 127, 0.4);
  --c-yellow-ink: #8a710e;
  --c-mint-bg: rgba(127, 254, 210, 0.3);
  --c-mint-ink: #3cb087;
  --c-blue-bg: rgba(59, 130, 246, 0.16);
  --c-blue-ink: #1d4ed8;
  --c-chat-overlay: rgba(255, 255, 255, 0.92);
  --c-landscape-filter: none;

  --ft-display: 'Neue Haas Grotesk Display Std', 'Neue Haas Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --ft-text: 'Neue Haas Grotesk', 'Neue Haas Grotesk Display Std', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dark theme — inverts surfaces while keeping the brand accent palette
   (pink, maroon, mint, yellow). Activated via `data-theme="dark"` on the
   html element. Toggled from the sidebar; preference persists in
   localStorage. */
[data-theme="dark"] {
  --c-ink: #e8e6e1;
  --c-ink-50: rgba(232, 230, 225, 0.55);
  --c-bg: #182d3a;
  --c-surface: #1f1f24;
  --c-surface-muted: #25252b;
  --c-surface-chip: #2a2a31;
  --c-border: #353540;
  --c-pink-10: rgba(241, 91, 178, 0.16);
  --c-yellow-bg: rgba(254, 229, 127, 0.18);
  --c-yellow-ink: #d4b94a;
  --c-mint-bg: rgba(127, 254, 210, 0.18);
  --c-mint-ink: #5fcfa0;
  --c-blue-bg: rgba(96, 165, 250, 0.18);
  --c-blue-ink: #93c5fd;
  --c-chat-overlay: rgba(31, 31, 36, 0.94);
  --c-landscape-filter: brightness(0.55) saturate(0.85);
}
[data-theme="dark"] .chat-screen { background: var(--c-chat-overlay); }
[data-theme="dark"] .landscape  { filter: var(--c-landscape-filter); }
[data-theme="dark"] .auth-card,
[data-theme="dark"] .welcome-modal,
[data-theme="dark"] .pricing-card { background: var(--c-surface); }
[data-theme="dark"] .auth-brand,
[data-theme="dark"] .brand { color: var(--c-ink); }
[data-theme="dark"] .stat-card,
[data-theme="dark"] .lb-panel,
[data-theme="dark"] .milestone-tile,
[data-theme="dark"] .lesson-detail,
[data-theme="dark"] .settings-card,
[data-theme="dark"] .admin-card { background: var(--c-surface); }
[data-theme="dark"] .lb-name,
[data-theme="dark"] .plan-tier { color: var(--c-ink); }
[data-theme="dark"] .nav-icon { filter: invert(0.85) hue-rotate(180deg); }
[data-theme="dark"] .nav-icon--avatar { filter: none; }
[data-theme="dark"] .nav-icon--avatar img { filter: none; }
[data-theme="dark"] .toast--info { background: var(--c-surface); color: var(--c-ink); }
[data-theme="dark"] .auth-page,
[data-theme="dark"] .pricing-page { background: var(--c-bg); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--ft-text);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.3;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.page {
  display: flex;
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* -- Sidebar — fixed viewport height. Scrollable area on top contains
   brand + nav + pinned lists; the footer (plan card + user bar) is a
   non-scrolling sibling so it stays pinned to the bottom of the
   viewport regardless of how long the pinned lists or main content
   get. -- */
.sidebar {
  width: 283px;
  flex-shrink: 0;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  padding: 45px 14px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
}
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.brand {
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 50.185px;
  letter-spacing: -1.7565px;
  line-height: 0.8;
  color: #262626;
  text-transform: uppercase;
  padding: 0 12px;
  background: none;
  border: none;
  text-align: left;
}
.brand--clickable {
  cursor: pointer;
  border-radius: 6px;
  transition: opacity 0.15s ease;
}
.brand--clickable:hover { opacity: 0.7; }
.brand .reg {
  font-size: 33.457px;
  letter-spacing: -1.171px;
  vertical-align: top;
}

.nav {
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--c-ink);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.nav-item--inactive { opacity: 0.4; }
.nav-item--active { background: var(--c-surface-chip); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-icon--avatar {
  background: var(--c-maroon);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  display: inline-block;
}
.nav-icon--avatar > img {
  position: absolute;
  width: 42.6px; height: 28.4px;
  left: -8.4px; top: 50%;
  transform: translateY(-50%);
  object-fit: cover;
  max-width: none;
}

.sidebar-footer { flex-shrink: 0; margin-top: 16px; }

.plan-card {
  background: var(--c-pink-10);
  border: 1px solid var(--c-pink);
  border-radius: 10px;
  padding: 11px;
  height: 99px;
  position: relative;
  margin-bottom: 16px;
}
.plan-label { font-size: 12px; line-height: 1.3; color: var(--c-ink); }
.plan-tier {
  font-size: 24px; line-height: 1.3; color: #000;
  margin-top: 19px;
}
.plan-upgrade {
  position: absolute;
  bottom: 10px; left: 11px;
  font-size: 12px; line-height: 1.3;
  color: var(--c-pink);
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0;
}
.plan-upgrade .arrow { width: 10px; height: 8px; }

.user-bar {
  display: flex;
  align-items: center;
  gap: 11px;
}
.avatar-mono {
  width: 30px; height: 30px;
  border-radius: 100px;
  background: var(--c-pink);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar-mono img { width: 14px; height: 8px; }
.avatar-mono--initial {
  color: #fff;
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 13px;
}
.user-text { display: flex; flex-direction: column; }
.user-name { font-size: 12px; line-height: 1.3; }
.user-action {
  font-size: 12px; line-height: 1.3; opacity: 0.5;
  background: none; border: none; padding: 0; text-align: left;
}

/* -- Main -- */
.main {
  flex: 1;
  position: relative;
  padding: 29px 0 0 80px;
  min-width: 0;
  z-index: 1;
}

.hero { max-width: 800px; }
.hero-title {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.3;
  color: #ffffff;
}
.hero-sub {
  font-size: 16px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 16px;
}
.hero-cta {
  display: inline-block;
  margin-top: 28px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.hero-cta:hover { text-decoration: none; opacity: 0.85; }

.card-grid {
  margin-top: 60px;
  display: grid;
  grid-template-columns: repeat(3, 302px);
  gap: 24px;
  position: relative;
  z-index: 1;
}

/* -- Plugin Card -- */
.card {
  background: var(--c-surface-muted);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 16px;
  width: 302px;
  height: 354px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 90px;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.plugin-name {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 24px;
  line-height: 0.95;
  color: var(--c-ink);
}
.plugin-role { color: var(--c-pink); }
.plugin-desc {
  font-size: 12px;
  line-height: 1.3;
  color: var(--c-ink-50);
}
.card-footer {
  display: flex;
  gap: 9px;
  height: 41px;
}
.btn-primary {
  flex: 1;
  background: var(--c-ink);
  color: var(--c-surface-muted);
  font-size: 16px;
  line-height: 1.3;
  text-align: center;
  padding: 10px 24px;
  border-radius: 6px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  text-decoration: none;
}
.btn-icon {
  width: 38px;
  height: 41px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.btn-icon--outline { background: transparent; }
.btn-icon img { width: 14px; height: 14px; }

/* -- Avatar — composite of layered images.
   Sized via --scale (default 1 = 90px circle, the dashboard size).
   Smaller contexts (chat header, message bubble) override --scale on
   the .avatar element so all layer offsets scale proportionally. -- */
.avatar {
  --scale: 1;
  width: calc(90px * var(--scale));
  height: calc(90px * var(--scale));
  border-radius: 100px;
  background: var(--c-maroon);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.avatar--md { --scale: 0.55; }
.avatar--sm { --scale: 0.4; }
.avatar--xs { --scale: 0.26; }

.avatar-stack {
  position: absolute;
  inset: 0 auto auto 0;
  width: 90px;
  height: 90px;
  transform: scale(var(--scale));
  transform-origin: top left;
}

.avatar-layer {
  position: absolute;
  object-fit: cover;
  max-width: none;
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 100px;
  font-family: var(--ft-display);
  font-weight: 400;
  font-size: 14px;
  line-height: normal;
  white-space: nowrap;
}
.badge--strategy { background: var(--c-blue-bg); color: var(--c-blue-ink); }
.badge--messaging { background: var(--c-mint-bg); color: var(--c-mint-ink); }

/* -- Landscape backdrop -- */
.landscape {
  position: absolute;
  bottom: -44px;
  left: 0;
  width: 100%;
  height: 597px;
  object-fit: cover;
  object-position: left center;
  pointer-events: none;
  z-index: 0;
  display: block;
}

/* ============================================================
   Dashboard — type + spacing + cards copied from Figma node
   19588:32362 (2026 Gold Front Website Design).
   ============================================================ */

.dashboard-content {
  padding-bottom: 80px;
  max-width: 1118px;
}
.dashboard-greeting { margin-bottom: 32px; }

.dash-section { margin-top: 28px; }

/* Section label = grey rounded chip with 18px medium ink text. */
.section-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--c-surface-chip);
  border-radius: 8px;
  padding: 6px 16px;
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 18px;
  line-height: 23.4px;
  color: var(--c-ink);
  margin-bottom: 10px;
}

/* Stat row — 4 cards, 24px gap, fixed 200px tall. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.stat-card {
  background: var(--c-surface);
  border-radius: 8px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 200px;
}
.stat-card-icon {
  width: 24px;
  height: 24px;
  color: var(--c-ink);
  flex-shrink: 0;
}
.stat-card-text {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.stat-card-value {
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 80px;
  line-height: 64px;
  letter-spacing: -2.5px;
  color: var(--c-ink);
}
.stat-card-value--half {
  font-size: 40px;
  line-height: 32px;
  letter-spacing: -1.25px;
}
.stat-grid--compact .stat-card-value {
  font-size: 40px;
  line-height: 32px;
  letter-spacing: -1.25px;
}
.stat-card-label {
  font-family: var(--ft-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 20.8px;
  color: var(--c-ink);
}
.stat-card-progress {
  height: 4px;
  background: var(--c-surface-chip);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.stat-card-progress > div {
  height: 100%;
  background: var(--c-pink);
  border-radius: 2px;
  transition: width 0.5s;
}

/* Leaderboard — 2 panels, 24px gap, white cards 140px tall */
.lb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.lb-panel {
  background: var(--c-surface);
  border-radius: 8px;
  padding: 20px 24px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}
.lb-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.lb-panel-header-icon {
  width: 24px;
  height: 24px;
  color: var(--c-ink);
  flex-shrink: 0;
}
.lb-panel-header-label {
  font-family: var(--ft-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 20.8px;
  color: var(--c-ink);
}
.lb-panel-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-panel-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lb-rank-pill {
  background: var(--c-pink);
  color: #ffffff;
  border-radius: 100px;
  padding: 8px 24px;
  font-family: var(--ft-text);
  font-weight: 400;
  font-size: 24px;
  line-height: 29.4px;
  flex-shrink: 0;
}
.lb-rank-pill--silver { background: #888; }
.lb-rank-pill--bronze { background: #b15a1b; }
.lb-name {
  font-family: var(--ft-text);
  font-weight: 400;
  font-size: 24px;
  line-height: 31.2px;
  color: #000;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-empty {
  background: var(--c-surface);
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  color: var(--c-ink-50);
  font-size: 14px;
}

/* Milestones — 7 tiles, 16px gap, 140px tall */
.milestone-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 16px;
}
.milestone-tile {
  background: var(--c-surface);
  border-radius: 8px;
  padding: 16px;
  height: 140px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0.4;
  transition: all 0.3s ease;
}
.milestone-tile--earned {
  opacity: 1;
}
.milestone-emoji {
  font-family: var(--ft-text);
  font-weight: 400;
  font-size: 24px;
  line-height: 31.2px;
}
.milestone-name {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 16px;
  line-height: 20.8px;
  color: var(--c-ink);
}
.milestone-desc {
  font-family: var(--ft-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 18.4px;
  color: var(--c-ink);
}
.milestone-date {
  font-size: 11px;
  font-family: var(--ft-display);
  letter-spacing: 0.04em;
  color: var(--c-pink);
  margin-top: auto;
}

.upgrade-card {
  margin-top: 28px;
  background: var(--c-pink-10);
  border: 1px solid var(--c-pink);
  border-radius: 8px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.upgrade-eyebrow {
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-pink);
}
.upgrade-title {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 18px;
  color: var(--c-ink);
  margin-top: 6px;
}
.upgrade-detail {
  font-size: 14px;
  color: var(--c-ink-50);
  margin-top: 4px;
  max-width: 520px;
}
.upgrade-cta {
  background: var(--c-ink);
  color: var(--c-surface-muted);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}
.upgrade-cta:hover { opacity: 0.92; }

/* Responsive — collapse the grids gracefully on narrower viewports */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lb-grid   { grid-template-columns: 1fr; }
  .milestone-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .stat-grid, .milestone-grid { grid-template-columns: 1fr 1fr; }
  .stat-card-value { font-size: 56px; line-height: 48px; letter-spacing: -1.5px; }
  .stat-card-value--half { font-size: 28px; line-height: 24px; letter-spacing: -0.75px; }
  .stat-grid--compact .stat-card-value { font-size: 28px; line-height: 24px; letter-spacing: -0.75px; }
}

/* ============================================================
   Training — modules → lessons → HTML lesson content
   ============================================================ */

.training-content {
  padding-bottom: 80px;
  max-width: 960px;
}

.training-modules {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Module — plain text on the page background, no card chrome */
.module-block {
  display: flex;
  flex-direction: column;
}
.module-title {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  color: var(--c-ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.module-empty {
  padding: 12px 0;
  color: var(--c-ink-50);
  font-size: 14px;
  font-style: italic;
}

.module-lessons {
  display: flex;
  flex-direction: column;
}
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: opacity 0.15s ease;
}
.lesson-row:hover .lesson-row-title { color: var(--c-pink); }
.lesson-row:hover .lesson-row-arrow { color: var(--c-pink); transform: translateX(2px); }
.lesson-row:disabled { cursor: default; opacity: 0.6; }
.lesson-row--locked,
.lesson-row--locked:hover {
  cursor: default;
}
.lesson-row--locked:hover .lesson-row-title {
  color: var(--c-ink);
}

.lesson-row-title {
  flex: 1;
  font-family: var(--ft-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  color: var(--c-ink);
  transition: color 0.15s ease;
}
.lesson-row-arrow {
  font-size: 16px;
  color: var(--c-ink-50);
  flex-shrink: 0;
  transition: color 0.15s ease, transform 0.15s ease;
}
.lesson-row-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ft-text);
  font-size: 13px;
  line-height: 1.2;
  color: var(--c-ink-50);
  flex-shrink: 0;
}

.draft-badge {
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(254, 229, 127, 0.4);
  color: var(--c-yellow-ink);
  padding: 4px 10px;
  border-radius: 100px;
}

.training-empty {
  background: var(--c-surface);
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  color: var(--c-ink-50);
  font-size: 14px;
}

/* Lesson detail view */
.lesson-detail {
  background: var(--c-surface);
  border-radius: 8px;
  padding: 32px 36px;
  max-width: 800px;
}
.lesson-back {
  background: transparent;
  color: var(--c-ink);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 24px;
  transition: background 0.15s, border-color 0.15s;
}
.lesson-back:hover {
  background: var(--c-surface-chip);
  border-color: var(--c-ink);
}
.lesson-title {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--c-ink);
  margin-bottom: 24px;
}
.lesson-body {
  font-family: var(--ft-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-ink);
}
.lesson-body :first-child { margin-top: 0; }
.lesson-body p { margin: 0 0 16px; }
.lesson-body h1, .lesson-body h2, .lesson-body h3 {
  font-family: var(--ft-text);
  font-weight: 500;
  color: var(--c-ink);
  margin: 28px 0 12px;
  line-height: 1.2;
}
.lesson-body h1 { font-size: 24px; }
.lesson-body h2 { font-size: 20px; }
.lesson-body h3 { font-size: 17px; }
.lesson-body ul, .lesson-body ol { margin: 0 0 16px 24px; }
.lesson-body li { margin-bottom: 6px; }
.lesson-body a { color: var(--c-pink); text-decoration: underline; }
.lesson-body a:hover { text-decoration: none; }
.lesson-body img, .lesson-body iframe, .lesson-body video {
  max-width: 100%;
  border-radius: 6px;
  margin: 12px 0;
}
.lesson-body iframe { aspect-ratio: 16/9; height: auto; width: 100%; }
.lesson-body code {
  background: var(--c-surface-chip);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}
.lesson-body pre {
  background: var(--c-surface-chip);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 16px;
}
.lesson-body pre code { background: none; padding: 0; }

/* Locked tool card — dim, no hover, button reads "Unlocks ..." */
.card--locked {
  opacity: 0.55;
}
.card--locked .btn-primary,
.card--locked .btn-icon {
  cursor: not-allowed;
}
.card--locked .btn-primary:hover { background: var(--c-ink); }
.plugin-locked-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-ink-50);
  margin: 0;
}

/* ============================================================
   Settings — profile / password / subscription / support
   ============================================================ */

.settings-content {
  padding-bottom: 80px;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-card {
  background: var(--c-surface);
  border-radius: 8px;
  padding: 28px 32px;
}
.settings-card-title {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  color: var(--c-ink);
  margin-bottom: 20px;
}

.settings-field-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-label {
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-ink);
  opacity: 0.6;
}
.settings-input {
  height: 48px;
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-surface);
  font-family: inherit;
  font-size: 16px;
  color: var(--c-ink);
  outline: none;
  transition: border-color 0.15s;
}
.settings-input:focus { border-color: var(--c-ink); }
.settings-input--readonly {
  background: var(--c-surface-muted);
  color: var(--c-ink-50);
}
.settings-helper {
  font-size: 13px;
  line-height: 1.4;
  color: var(--c-ink-50);
}

.settings-email-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-email-row .settings-input { flex: 1; }
.settings-email-change-btn {
  background: transparent;
  color: var(--c-ink);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  height: 48px;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.settings-email-change-btn:hover {
  background: var(--c-surface-chip);
  border-color: var(--c-ink);
}

.settings-email-change-form {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-action-row {
  margin-top: 24px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.settings-action-btn {
  background: var(--c-ink);
  color: var(--c-surface-muted);
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  height: 44px;
  transition: background 0.15s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.settings-action-btn:hover:not(:disabled) { background: #2d2d2d; }
.settings-action-btn:disabled { opacity: 0.5; cursor: default; }
.settings-action-btn--ghost {
  background: transparent;
  color: var(--c-ink);
  border: 1px solid var(--c-border);
}
.settings-action-btn--ghost:hover:not(:disabled) {
  background: var(--c-surface-chip);
  border-color: var(--c-ink);
}

.settings-status {
  font-size: 13px;
  line-height: 1.4;
}
.settings-status--success { color: #137a4d; }
.settings-status--error   { color: var(--c-pink); }

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
}
.settings-row:last-of-type { border-bottom: none; }
.settings-row-key { color: var(--c-ink); }
.settings-row-value { color: var(--c-ink-50); }
.settings-row-value--capitalize { text-transform: capitalize; }

.settings-progress {
  height: 6px;
  background: var(--c-surface-chip);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 14px;
}
.settings-progress > div {
  height: 100%;
  background: var(--c-pink);
  transition: width 0.5s ease, background 0.5s ease;
  border-radius: 3px;
}
.settings-progress--warning > div { background: #d97706; }
.settings-progress--danger  > div { background: #dc2626; }

/* ============================================================
   Chat — conversation screen for a plugin (Jed, Kendrick, etc.).
   Lives inside .main, positioned absolutely to fill the entire
   content area regardless of .main's dashboard padding.
   ============================================================ */

.chat-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--c-chat-overlay);
  backdrop-filter: blur(12px);
  z-index: 1;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
  flex-shrink: 0;
}
.chat-header-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.chat-header-name {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  color: var(--c-ink);
}
.chat-header-role {
  font-size: 13px;
  line-height: 1.3;
  color: var(--c-pink);
}
.chat-header-back {
  width: 40px;
  height: 40px;
  border-radius: 100px;
  background: var(--c-surface-chip);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ft-display);
  font-size: 16px;
  color: var(--c-ink);
  text-decoration: none;
  flex-shrink: 0;
}
.chat-header-back:hover { background: var(--c-border); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  display: flex;
  gap: 12px;
  max-width: 760px;
}
.msg--assistant { align-self: flex-start; align-items: flex-start; }
.msg--user      { align-self: flex-end;   align-items: flex-end; flex-direction: row-reverse; }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg--assistant .msg-bubble {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-ink);
  border-top-left-radius: 4px;
}
.msg--user .msg-bubble {
  background: var(--c-ink);
  color: var(--c-surface-muted);
  border-top-right-radius: 4px;
}
.msg-bubble--thinking {
  display: flex; gap: 4px; align-items: center; padding: 14px 18px;
}
.thinking-dot {
  width: 6px; height: 6px; border-radius: 100%;
  background: var(--c-ink-50);
  animation: thinking-pulse 1.4s infinite ease-in-out;
}
.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinking-pulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.85); }
  30% { opacity: 1; transform: scale(1); }
}

.chat-composer {
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  padding: 16px 32px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--c-ink);
  background: var(--c-surface-muted);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 12px 16px;
  resize: none;
  outline: none;
  min-height: 48px;
  max-height: 200px;
  overflow-y: auto;
}
.chat-input:focus { border-color: var(--c-ink); }
.chat-input::placeholder { color: var(--c-ink-50); }

.chat-send {
  height: 48px;
  padding: 0 24px;
  background: var(--c-ink);
  color: var(--c-surface-muted);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  flex-shrink: 0;
}
.chat-send:hover:not(:disabled) { opacity: 0.92; }
.chat-send:disabled { opacity: 0.4; cursor: default; }

/* ============================================================
   Chat add-ons — pin button, history dropdown, attachments
   ============================================================ */

.chat-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.chat-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 100px;
  background: var(--c-surface-chip);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--c-ink);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chat-icon-btn:hover { background: var(--c-border); border-color: #cfcfcf; }
.chat-icon-btn--active {
  background: var(--c-pink);
  border-color: var(--c-pink);
  color: #fff;
}
.chat-icon-btn--active:hover { background: #c64695; border-color: #c64695; }
.chat-icon-btn svg { width: 18px; height: 18px; }

/* History drawer — slides out from the right edge of the sidebar,
   pushing main content via flex layout (no overlay). */
.history-drawer {
  width: 0;
  flex-shrink: 0;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
  z-index: 5;
}
.history-drawer--open { width: 320px; }
.history-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.history-drawer-title {
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-ink-50);
}
.history-drawer-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--c-ink-50);
  cursor: pointer;
}
.history-drawer-close:hover { background: var(--c-surface-muted); color: var(--c-ink); }
.history-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}
.history-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--c-ink-50);
}
.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s ease;
}
.history-item:hover { background: var(--c-surface-muted); }
.history-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.history-item-title {
  font-size: 14px;
  color: var(--c-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item-date {
  font-size: 11px;
  color: var(--c-ink-50);
}
.history-item-delete {
  background: none;
  border: none;
  color: var(--c-ink-50);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.history-item:hover .history-item-delete { opacity: 1; }
.history-item-delete:hover { color: var(--c-pink); }
.history-rename-input {
  flex: 1;
  background: var(--c-surface-muted);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--c-ink);
  outline: none;
  min-width: 0;
}
.history-rename-input:focus { border-color: var(--c-ink); }

/* Attachments — chips above composer */
.chat-composer { flex-direction: column; align-items: stretch; gap: 10px; }
.chat-composer-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.chat-attachments {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chat-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c-surface-muted);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--c-ink);
}
.chat-attachment img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
}
.chat-attachment-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-attachment-remove {
  background: none;
  border: none;
  color: var(--c-ink-50);
  cursor: pointer;
  padding: 0 2px;
  font-size: 16px;
  line-height: 1;
}
.chat-attachment-remove:hover { color: var(--c-pink); }

.chat-attach-btn {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--c-surface-muted);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--c-ink);
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.chat-attach-btn:hover { background: var(--c-border); border-color: var(--c-ink); }
.chat-attach-btn svg { width: 18px; height: 18px; }
.chat-attach-error {
  font-size: 12px;
  color: var(--c-pink);
  padding: 0 4px;
}

/* Markdown rendering inside assistant message bubbles */
.msg-md {
  /* .msg-bubble preserves plain-text user newlines. Marked emits newline
     text nodes between block tags, so markdown needs normal whitespace. */
  white-space: normal;
}
.msg-md > :first-child { margin-top: 0; }
.msg-md > :last-child  { margin-bottom: 0; }
.msg-md p { margin: 0 0 6px; line-height: 1.5; }
.msg-md h1, .msg-md h2, .msg-md h3, .msg-md h4 {
  font-family: var(--ft-text);
  font-weight: 650;
  color: inherit;
  margin: 12px 0 4px;
  line-height: 1.25;
}
.msg-md > h1:first-child,
.msg-md > h2:first-child,
.msg-md > h3:first-child,
.msg-md > h4:first-child { margin-top: 0; }
.msg-md h1 { font-size: 22px; letter-spacing: -0.01em; }
.msg-md h2 { font-size: 18px; letter-spacing: -0.005em; }
.msg-md h3 { font-size: 16px; }
.msg-md h4 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85; }
.msg-md ul, .msg-md ol { margin: 0 0 8px 22px; padding: 0; }
.msg-md p + ul,
.msg-md p + ol { margin-top: 1.5em; }
.msg-md li { margin: 0; line-height: 1.45; }
/* Loose-list — when the model emits blank lines between items, marked
   wraps each <li> in a <p>. Nuke all margins on every direct child of <li>
   so loose lists render as tight as compact ones. */
.msg-md li > * { margin: 0 !important; }
.msg-md li > p { line-height: inherit; }
.msg-md li + li { margin-top: 8px; }
.msg-md hr {
  border: 0;
  border-top: 1px solid var(--c-border);
  margin: 14px 0;
  opacity: 0.6;
}
.msg-md code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.msg--user .msg-md code { background: rgba(255, 255, 255, 0.18); }
.msg-md pre {
  background: rgba(0, 0, 0, 0.06);
  padding: 10px 12px;
  border-radius: 6px;
  margin: 0 0 8px;
  overflow-x: auto;
  font-size: 13px;
}
.msg-md pre code { background: none; padding: 0; }
.msg-md a { color: var(--c-pink); text-decoration: underline; }
.msg-md a:hover { text-decoration: none; }
.msg-md strong { font-weight: 500; }
.msg-md em { font-style: italic; }
.msg-md blockquote {
  margin: 0 0 8px;
  padding-left: 12px;
  border-left: 3px solid var(--c-border);
  color: var(--c-ink-50);
}

/* Message hover actions (edit / regenerate) */
.msg-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.msg:hover .msg-actions { opacity: 1; }
.msg-action {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-ink-50);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.msg-action:hover { background: var(--c-surface-chip); color: var(--c-ink); }
.msg--user .msg-action {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
}
.msg--user .msg-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Message attachments — small previews above message bubble text */
.msg-images { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.msg-images img {
  max-width: 200px;
  max-height: 160px;
  border-radius: 6px;
  object-fit: cover;
}
.msg-docs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; font-size: 12px; opacity: 0.85; }

/* ============================================================
   Sidebar pinned chats — under nav, before footer
   ============================================================ */

.sidebar-pinned {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--c-border);
}
.sidebar-pinned-label {
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-ink-50);
  padding: 0 12px;
  margin-bottom: 8px;
}
.sidebar-pinned-empty {
  font-size: 12px;
  color: var(--c-ink-50);
  padding: 0 12px;
  line-height: 1.4;
}
.sidebar-pinned-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pinned-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.pinned-chat:hover { background: var(--c-surface-chip); }
.pinned-chat-title {
  flex: 1;
  font-size: 13px;
  line-height: 1.3;
  color: var(--c-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pinned tool — small avatar + two-line label (firstName, role) */
.pinned-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.pinned-tool:hover { background: var(--c-surface-chip); }
.pinned-tool .avatar--xs { flex-shrink: 0; }
.pinned-tool-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}
.pinned-tool-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--c-ink);
}
.pinned-tool-role {
  font-size: 13px;
  line-height: 1.3;
  color: var(--c-pink);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Pinned conversation row — wraps the open button + a hover-revealed rename ✎ */
.pinned-chat-row {
  position: relative;
  display: flex;
  align-items: center;
}
.pinned-chat-row .pinned-chat { padding-right: 32px; }
.pinned-chat-rename {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: none;
  border: none;
  color: var(--c-ink-50);
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.pinned-chat-row:hover .pinned-chat-rename { opacity: 1; }
.pinned-chat-rename:hover {
  color: var(--c-pink);
  background: var(--c-surface-muted);
}

.pinned-chat--renaming { padding: 4px 6px; }
.pinned-chat-rename-input {
  flex: 1;
  background: var(--c-surface-muted);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--c-ink);
  width: 100%;
  outline: none;
}
.pinned-chat-rename-input:focus { border-color: var(--c-pink); }

/* ============================================================
   Admin panel — tabs + user table
   ============================================================ */

.admin-content {
  padding-bottom: 80px;
  max-width: 1080px;
}
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 0;
}
.admin-tab {
  background: none;
  border: none;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: rgba(255, 255, 255, 0.95); }
.admin-tab--active {
  color: #fff;
  border-color: #fff;
}

.admin-card {
  background: var(--c-surface);
  border-radius: 8px;
  padding: 24px 28px;
}
.admin-search {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-surface-muted);
  font-family: inherit;
  font-size: 14px;
  color: var(--c-ink);
  outline: none;
  margin-bottom: 16px;
}
.admin-search:focus { border-color: var(--c-ink); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table thead th {
  text-align: left;
  padding: 8px 10px;
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-ink-50);
  border-bottom: 1px solid var(--c-border);
}
.admin-table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-ink);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--c-surface-muted); }
.admin-table-muted { color: var(--c-ink-50); }
.admin-table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-table-action {
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.admin-table-action:hover { background: var(--c-surface-chip); border-color: var(--c-ink); }
.admin-table-action--danger { color: var(--c-pink); border-color: var(--c-pink); }
.admin-table-action--danger:hover { background: var(--c-pink-10); }

.admin-plan-select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--c-ink);
  cursor: pointer;
}

.admin-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--c-ink-50);
}
.admin-pager-buttons { display: flex; gap: 8px; }

.admin-empty {
  text-align: center;
  padding: 36px 12px;
  color: var(--c-ink-50);
  font-size: 14px;
}

.admin-temp-pwd {
  background: var(--c-pink-10);
  border: 1px solid var(--c-pink);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--c-ink);
}
.admin-temp-pwd code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 500;
  background: rgba(241, 91, 178, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

/* ============================================================
   Auth — sign-in screen (light surface, NHG, on teal page bg)
   Hits the same /api/auth/* backend as v1.
   ============================================================ */

.auth-page {
  min-height: 100vh;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
  overflow: hidden;
}
/* Subtle hero landscape behind the card — same image used elsewhere
   in v2, dialed way down so it reads as atmospheric texture. */
.auth-landscape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--c-surface);
  border-radius: 20px;
  padding: 48px 44px 40px;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.auth-brand {
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 40px;
  letter-spacing: -1.4px;
  line-height: 0.8;
  color: var(--c-ink);
  text-transform: uppercase;
  margin-bottom: 32px;
}
.auth-brand .reg {
  font-size: 26.7px;
  letter-spacing: -0.94px;
  vertical-align: top;
}

.auth-headline {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -1.2px;
  color: var(--c-ink);
  margin-bottom: 12px;
}
.auth-headline-accent { color: var(--c-pink); }
.auth-subhead {
  font-size: 14px;
  line-height: 1.4;
  color: var(--c-ink-50);
  margin-bottom: 32px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-label {
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-ink);
  opacity: 0.6;
}
.auth-input {
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-surface);
  font-family: inherit;
  font-size: 16px;
  color: var(--c-ink);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.auth-input:focus { border-color: var(--c-ink); }

.auth-password-wrap { position: relative; }
.auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  border-radius: 8px;
}
.auth-password-toggle:hover { opacity: 0.9; background: var(--c-surface-chip); }
.auth-password-toggle svg { width: 18px; height: 18px; }

.auth-forgot {
  align-self: flex-end;
  font-size: 13px;
  color: var(--c-pink);
  background: none;
  border: none;
  padding: 0;
  margin-top: -6px;
}
.auth-forgot:hover { text-decoration: underline; }

.auth-error {
  background: var(--c-pink-10);
  border: 1px solid var(--c-pink);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--c-pink);
}

.auth-submit {
  height: 48px;
  background: var(--c-ink);
  color: var(--c-surface-muted);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  margin-top: 4px;
}
.auth-submit:hover:not(:disabled) { opacity: 0.92; }
.auth-submit:disabled { opacity: 0.5; cursor: default; }

.auth-foot {
  font-size: 14px;
  color: var(--c-ink-50);
  text-align: center;
  margin-top: 18px;
}
.auth-foot a { color: var(--c-pink); font-weight: 500; }
.auth-foot a:hover { text-decoration: underline; }

.auth-pricing {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}
.auth-pricing:hover { color: rgba(255, 255, 255, 0.95); }

/* Auth: terms checkbox + reset/forgot success state */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--c-ink-50);
}
.auth-terms input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--c-pink);
  flex-shrink: 0;
  cursor: pointer;
}
.auth-terms label { cursor: pointer; }
.auth-terms a { color: var(--c-pink); font-weight: 500; }
.auth-terms a:hover { text-decoration: underline; }

.auth-success {
  text-align: center;
  padding: 12px 0 4px;
}
.auth-success-emoji {
  font-size: 40px;
  margin-bottom: 12px;
}
.auth-success-title {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 18px;
  color: var(--c-ink);
}
.auth-success-detail {
  font-size: 13px;
  color: var(--c-ink-50);
  margin-top: 8px;
}
.auth-success-detail strong { color: var(--c-ink); font-weight: 500; }

.auth-back-link {
  text-align: center;
  margin-top: 4px;
}
.auth-back-link button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-pink);
  cursor: pointer;
  padding: 0;
}
.auth-back-link button:hover { text-decoration: underline; }

/* ============================================================
   Email-verification banner (shows above .main when user.email_verified false)
   ============================================================ */

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.verification-banner {
  background: var(--c-yellow-bg);
  color: var(--c-yellow-ink);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  font-weight: 500;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(138, 113, 14, 0.2);
  flex-shrink: 0;
}
.verification-banner-cta {
  background: transparent;
  border: 1px solid var(--c-yellow-ink);
  color: var(--c-yellow-ink);
  border-radius: 100px;
  padding: 4px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.verification-banner-cta:hover:not(:disabled) {
  background: rgba(138, 113, 14, 0.12);
}
.verification-banner-cta:disabled { opacity: 0.5; cursor: default; }
.verification-banner-status { font-style: italic; }

/* ============================================================
   Toast — short-lived top-right notifications
   ============================================================ */

.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--c-ink);
  color: var(--c-surface-muted);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.25s ease;
  max-width: 360px;
  pointer-events: auto;
}
.toast--success { background: #137a4d; color: #fff; }
.toast--error   { background: var(--c-pink);   color: #fff; }
.toast--info    { background: var(--c-ink);    color: var(--c-surface-muted); }
@keyframes toast-in {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* -- Loading state -- */
.loading {
  min-height: 100vh;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* ============================================================
   Pricing screen — pre-signup browse
   ============================================================ */

.pricing-page {
  min-height: 100vh;
  background: var(--c-bg);
  padding: 56px 24px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.pricing-header {
  text-align: center;
  margin-bottom: 40px;
  max-width: 720px;
  position: relative;
  z-index: 2;
}
.pricing-headline {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: #fff;
}
.pricing-headline-accent { color: var(--c-pink); }
.pricing-subhead {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 14px;
}

.pricing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  padding: 8px 16px;
  backdrop-filter: blur(8px);
}
.pricing-toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color 0.15s;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}
.pricing-toggle-label--active { color: #fff; }
.pricing-toggle-savings { color: var(--c-pink); margin-left: 4px; }
.pricing-toggle-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  border: none;
  padding: 0;
}
.pricing-toggle-switch--on { background: var(--c-pink); }
.pricing-toggle-switch::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: left 0.2s;
}
.pricing-toggle-switch--on::after { left: 21px; }

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  max-width: 1280px;
  width: 100%;
  position: relative;
  z-index: 2;
}
@media (max-width: 1100px) {
  .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; }
}
@media (max-width: 560px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 360px; }
}

/* Embedded variant — when rendered inside the signed-in studio shell.
   Sit inside .main (which has 80px left padding, no right padding), and
   center the grid horizontally within the available width. */
.pricing-page--embedded {
  background: transparent;
  min-height: auto;
  padding: 0 80px 60px 0;
  align-items: center;
}
.pricing-page--embedded .hero {
  align-self: stretch;
  margin-bottom: 32px;
}
.pricing-page--embedded .pricing-grid {
  margin: 0 auto;
}
.pricing-page--embedded .pricing-foot { display: none; }

/* Card — matches .card on the tools page (surface-muted, border, radius) */
.pricing-card {
  background: var(--c-surface-muted);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 380px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.pricing-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.pricing-card--current {
  border-color: var(--c-pink);
  border-width: 2px;
  padding: 23px 19px;
}

.pricing-card-top { display: flex; flex-direction: column; gap: 16px; }
.pricing-card-name {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 22px;
  line-height: 1;
  color: var(--c-ink);
}
.pricing-card-badge {
  display: inline-block;
  align-self: flex-start;
  background: var(--c-pink);
  color: #fff;
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
  margin-top: -8px;
}
.pricing-card-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pricing-card-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--c-ink);
}
.pricing-card-check {
  color: var(--c-pink);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.pricing-card-bottom { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.pricing-card-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.pricing-card-price-amount {
  font-family: var(--ft-display);
  font-weight: 500;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -1.5px;
  color: var(--c-ink);
}
.pricing-card-price-period {
  font-size: 13px;
  color: var(--c-ink-50);
}
.pricing-card-pricenote {
  font-size: 11px;
  color: var(--c-ink-50);
  line-height: 1.3;
  margin: -6px 0 0;
}
.pricing-card-cta {
  background: var(--c-ink);
  color: var(--c-surface-muted);
  border: none;
  border-radius: 8px;
  height: 44px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 4px;
}
.pricing-card-cta:hover:not(:disabled) { background: #2d2d2d; }
.pricing-card-cta:disabled {
  background: var(--c-border);
  color: var(--c-ink-50);
  cursor: default;
}

.pricing-foot {
  text-align: center;
  margin-top: 36px;
  position: relative;
  z-index: 2;
}
.pricing-foot p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
}
.pricing-foot button {
  background: none;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.pricing-foot button:hover { text-decoration: none; opacity: 0.85; }

/* ============================================================
   Welcome modal — first-session 👋
   ============================================================ */

.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
  animation: welcome-fade-in 0.2s ease;
}
@keyframes welcome-fade-in { from { opacity: 0; } to { opacity: 1; } }

.welcome-modal {
  background: var(--c-surface);
  border-radius: 16px;
  padding: 44px 40px 36px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  animation: welcome-pop 0.25s ease;
}
@keyframes welcome-pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.welcome-emoji { font-size: 44px; margin-bottom: 18px; line-height: 1; }
.welcome-title {
  font-family: var(--ft-text);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--c-ink);
  margin-bottom: 12px;
}
.welcome-message {
  font-size: 15px;
  line-height: 1.5;
  color: var(--c-ink-50);
  margin-bottom: 24px;
}
.welcome-cta {
  background: var(--c-ink);
  color: var(--c-surface-muted);
  border: none;
  border-radius: 10px;
  width: 100%;
  height: 48px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.welcome-cta:hover { background: #2d2d2d; }

/* ============================================================
   Interactive states — subtle rollovers for everything clickable
   ============================================================ */

/* Universal: smooth out hover transitions on interactive elements */
.nav-item, .plan-upgrade, .user-action, .card, .btn-primary, .btn-icon,
.upgrade-cta, .auth-submit, .chat-send, .chat-header-back,
.auth-password-toggle, .auth-forgot {
  transition: background-color 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, opacity 0.15s ease, transform 0.15s ease,
              box-shadow 0.15s ease;
}

/* Sidebar nav — active stays put, inactive items lift toward full opacity */
.nav-item { cursor: pointer; }
.nav-item--inactive:hover {
  opacity: 0.7;
  background: var(--c-surface-chip);
}
.nav-item--active { cursor: default; }

/* Sidebar plan upgrade button */
.plan-upgrade { cursor: pointer; }
.plan-upgrade:hover { color: #c64695; }
.plan-upgrade:hover .arrow { transform: translateX(2px); }
.plan-upgrade .arrow { transition: transform 0.15s ease; }

/* Sidebar Sign Out — comes alive on hover */
.user-action { cursor: pointer; }
.user-action:hover { opacity: 1; color: var(--c-pink); }

/* Theme toggle button in user bar */
.theme-toggle {
  width: 32px;
  height: 32px;
  background: var(--c-surface-chip);
  border: 1px solid var(--c-border);
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--c-ink);
  flex-shrink: 0;
  margin-left: auto;
  transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover { background: var(--c-border); border-color: var(--c-ink); }
.theme-toggle svg { width: 16px; height: 16px; }

/* Plugin cards (Tools page) — no card-level hover affordance.
   The "Work with X" button telegraphs hover instead (see below). */
.card {
  cursor: default;
}

/* "Work with X" primary button — has a label + an arrow anchored to
   the label's right edge (so the arrow tracks text length). On card
   hover, the textwrap bumps 10px left, the label turns pink, and the
   arrow fades up roughly 2 character-widths past the end of the text. */
.btn-primary {
  cursor: pointer;
}
.btn-primary-textwrap {
  position: relative;
  display: inline-block;
  transition: transform 0.22s ease;
}
.btn-primary-label {
  transition: color 0.18s ease;
}
.btn-primary-arrow {
  position: absolute;
  left: calc(100% + 1.2ch);
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-pink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

/* Hover on the card lifts the button's affordance, not the card itself. */
.card:hover .btn-primary-textwrap {
  transform: translateX(-5px);
}
.card:hover .btn-primary-label {
  color: var(--c-pink);
}
.card:hover .btn-primary-arrow {
  opacity: 1;
}
/* In dark mode, push the button background a hair whiter on hover so
   the pink label has a brighter canvas. Light mode bg stays dark. */
[data-theme="dark"] .card:hover .btn-primary {
  background: #ffffff;
}

.btn-primary:active:not(:disabled) {
  filter: brightness(0.92);
  transform: translateY(1px);
}

/* Favorite (star) icon button */
.btn-icon { cursor: pointer; }
.btn-icon:hover {
  background: #d8d8d8;
  border-color: #cfcfcf;
}
.btn-icon--outline:hover {
  background: var(--c-surface-chip);
}

/* Chat back button gets a slightly stronger hover than the default */
.chat-header-back { cursor: pointer; }

/* Auth toggle buttons (sign-up / pricing / forgot) — keep underlines subtle */
.auth-foot a, .auth-pricing { transition: opacity 0.15s ease, color 0.15s ease; }

/* Stat card icons — micro-color shift on whole card hover (no card click,
   but subtle indication that the section is alive) */
.stat-card { transition: box-shadow 0.15s ease, transform 0.15s ease; }
/* (intentionally no .stat-card:hover — they're not clickable) */

/* Leaderboard panels — same: not clickable, but rows could be later */
.lb-panel-row { transition: opacity 0.15s ease; }

/* Focus-visible ring for keyboard navigation */
.nav-item:focus-visible,
.btn-primary:focus-visible,
.btn-icon:focus-visible,
.plan-upgrade:focus-visible,
.user-action:focus-visible,
.upgrade-cta:focus-visible,
.auth-submit:focus-visible,
.chat-send:focus-visible,
.chat-header-back:focus-visible,
.auth-forgot:focus-visible {
  outline: 2px solid var(--c-pink);
  outline-offset: 2px;
}
