/* Hide scrollbars globally (keep scroll functional) */
html, body, *:not(.admin-keep-scrollbar):not(.admin-keep-scrollbar *) {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*:not(.admin-keep-scrollbar):not(.admin-keep-scrollbar *)::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

:root {
  --maint-banner-h: 0px;
  --accent-rgb: 74, 222, 128;      /* bright green — Writer's Desk structure uses this */
  --ink-rgb: 255, 255, 255;        /* light lines/tracks on dark surfaces */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-card-hover: #1e1e1e;
  --bg-elevated: #191919;
  --bg-glass: rgba(22, 22, 22, 0.82);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.58);
  --text-muted: rgba(255, 255, 255, 0.32);
  --accent: #4ade80;
  --accent-soft: rgba(74, 222, 128, 0.10);
  --accent-glow: rgba(74, 222, 128, 0.28);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --warning: #f59e0b;
  --xp-color: #4ade80;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.04);
  --border-hover: rgba(255, 255, 255, 0.16);
  --hover-bg: rgba(255, 255, 255, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-lg: 0 30px 80px rgba(0, 10, 0, 0.7), 0 10px 30px rgba(0, 10, 0, 0.4);
  --shadow-glow: 0 0 50px rgba(74, 222, 128, 0.14);
  --shadow-3d: 0 8px 32px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow-inset-glow: inset -8px -8px 24px rgba(74, 222, 128, 0.06), inset 8px 8px 24px rgba(0, 0, 0, 0.2);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Instrument Sans', system-ui, sans-serif;
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;
  --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  --gradient-accent: linear-gradient(135deg, #4ade80 0%, #86efac 100%);
  --gradient-hero: radial-gradient(ellipse at 50% 0%, rgba(74,222,128,0.08) 0%, transparent 60%);
}

/* ===== LIGHT THEME — Writer's Desk parchment palette ===== */
.light {
  --accent-rgb: 94, 125, 69;       /* forest / olive green */
  --ink-rgb: 74, 58, 30;           /* warm ink for borders / shadows */
  --bg-primary: #ebe4d4;
  --bg-secondary: #f3eee1;
  --bg-card: #faf6ec;
  --bg-card-hover: #f4eede;
  --bg-elevated: #fcf9f1;
  --bg-glass: rgba(250, 246, 236, 0.92);
  --text-primary: #3b352a;
  --text-secondary: rgba(59, 53, 42, 0.64);
  --text-muted: rgba(59, 53, 42, 0.42);
  --accent: #5e7d45;
  --accent-soft: rgba(var(--accent-rgb), 0.12);
  --accent-glow: rgba(var(--accent-rgb), 0.22);
  --danger: #c0573f;
  --danger-soft: rgba(192, 87, 63, 0.12);
  --success: #5e7d45;
  --success-soft: rgba(var(--accent-rgb), 0.12);
  --warning: #c08a3a;
  --xp-color: #5e7d45;
  --border: rgba(var(--ink-rgb), 0.12);
  --border-light: rgba(var(--ink-rgb), 0.06);
  --border-hover: rgba(var(--ink-rgb), 0.20);
  --hover-bg: rgba(var(--ink-rgb), 0.05);
  --shadow: 0 1px 3px rgba(var(--ink-rgb), 0.10), 0 0 0 1px rgba(var(--ink-rgb), 0.05);
  --shadow-lg: 0 16px 44px rgba(var(--ink-rgb), 0.13), 0 0 0 1px rgba(var(--ink-rgb), 0.05);
  --shadow-3d: 0 2px 10px rgba(var(--ink-rgb), 0.09), 0 1px 2px rgba(var(--ink-rgb), 0.05);
  --shadow-glow: 0 0 30px rgba(var(--accent-rgb), 0.10);
  --shadow-inset-glow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --gradient-card: linear-gradient(135deg, rgba(250,246,236,0.7) 0%, rgba(235,228,212,0.35) 100%);
  --gradient-accent: linear-gradient(135deg, #6e8d4f 0%, #54712f 100%);
  --gradient-hero: radial-gradient(ellipse at 50% 0%, rgba(var(--accent-rgb),0.07) 0%, transparent 60%);
}

/* ── Light: base overrides ── */
.light body, .light {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Grid pattern — subtle dark lines instead of white */
.light body::before {
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}

/* Vignette — very subtle on light */
.light body::after {
  background: radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0,0,0,0.06) 100%);
}

/* ── Light: nav ── */
.light .nav {
  background: rgba(245, 245, 240, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.light .logo {
  text-shadow: none;
}
.light .logo-img {
  filter: none;
}

/* ── Light: sidebar ── */
.light .sidebar {
  background: var(--bg-secondary);
  border-right-color: var(--border);
  box-shadow: 1px 0 8px rgba(0,0,0,0.04);
}
.light .sidebar-nav-item.active {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.24);
  box-shadow: none;
}
.light .user-avatar {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ── Light: buttons ── */
.light .btn-small,
.light .btn-primary {
  background: #22c55e;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}
.light .btn-small:hover,
.light .btn-primary:hover {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.30);
}
.light .btn-ghost {
  border-color: var(--border);
}
.light .btn-ghost:hover {
  border-color: rgba(0, 0, 0, 0.24);
}

/* ── Light: hero section (landing) ── */
.light .hero-title em {
  text-shadow: none;
}
.light .stat-num {
  text-shadow: none;
}

/* ── Light: mock editor ── */
.light .mock-editor {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.10), 0 0 0 1px rgba(0,0,0,0.06);
}
.light .mock-editor:hover {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0,0,0,0.06);
}
.light .mock-toolbar {
  background: rgba(0, 0, 0, 0.02);
}
.light .mock-dots span {
  background: rgba(0, 0, 0, 0.08);
}
.light .mock-cursor {
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

/* ── Light: feature cards ── */
.light .feature-card {
  box-shadow: var(--shadow);
}
.light .feature-card::before {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.04), transparent);
}
.light .feature-card:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.10), 0 0 0 1px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}
.light .feature-card:hover .feature-icon {
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);
}
.light .feature-card:hover .feature-icon svg {
  filter: none;
}

/* ── Light: how-it-works section ── */
.light .how-it-works::before {
  background: radial-gradient(ellipse, rgba(0,0,0,0.02) 0%, transparent 70%);
}

/* ── Light: CTA section ── */
.light .cta::before {
  background: radial-gradient(ellipse, rgba(0,0,0,0.03) 0%, transparent 70%);
}

/* ── Light: dashboard cards ── */
.light .stat-card,
.light .dash-stat-card {
  box-shadow: var(--shadow);
}
.light .stat-card::before,
.light .dash-stat-card::before {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.03), transparent);
}
.light .dash-stat-card:hover {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.10);
}
.light .dashboard-hero {
  box-shadow: var(--shadow);
}
.light .dashboard-hero::before {
  background: radial-gradient(circle, rgba(0,0,0,0.02) 0%, transparent 70%);
}

/* ── Light: heatmap ── */
.light .heatmap-section {
  box-shadow: var(--shadow);
}
.light .heatmap-section::before {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.03), transparent);
}
.light .heatmap-cell[data-level="0"] { background: rgba(34, 197, 94, 0.08); }
.light .heatmap-cell[data-level="1"] { background: rgba(34, 197, 94, 0.25); }
.light .heatmap-cell[data-level="2"] { background: rgba(34, 197, 94, 0.50); }
.light .heatmap-cell[data-level="3"] { background: rgba(34, 197, 94, 0.75); }
.light .heatmap-cell:hover {
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.25);
}
.light .heatmap-legend-cell[data-level="0"] { background: rgba(34,197,94,0.08); }
.light .heatmap-legend-cell[data-level="1"] { background: rgba(34,197,94,0.25); }
.light .heatmap-legend-cell[data-level="2"] { background: rgba(34,197,94,0.50); }

/* ── Light: accent-consistent overrides ── */
/* Buttons */
.light .btn-small:hover { box-shadow: 0 4px 16px rgba(34, 197, 94, 0.30); }
.light .btn-primary:hover { box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35); }
.light .btn-ghost:hover { border-color: rgba(34, 197, 94, 0.30); }

/* Stories: filter buttons */
.light .stories-filter-btn:hover,
.light .stories-filter-btn.active {
  border-color: rgba(34, 197, 94, 0.30);
}

/* Stories: hero card — no background override, inherits page bg */
.light .story-hero-card {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Stories: feature card */
.light .story-feature-card:hover {
  border-color: rgba(0, 0, 0, 0.14);
}

/* Stories: feed card */
.light .story-feed-card:hover {
  border-color: rgba(0, 0, 0, 0.14);
}

/* Stories: doc card */
.light .story-doc-card:hover {
  border-color: rgba(0, 0, 0, 0.14);
}

/* Stories: comment textarea focus */
.light .story-comment-form textarea:focus {
  border-color: rgba(34, 197, 94, 0.40);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

/* Stories: float link input focus */
.light .story-float-link-input input:focus {
  border-color: rgba(34, 197, 94, 0.40);
}

/* Landing: feature cards */
.light .feature-card:hover {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.10);
}
.light .feature-card:hover .feature-icon {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}

/* Landing: mock editor */
.light .mock-editor {
  box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.10), 0 30px 60px -30px rgba(0, 0, 0, 0.06);
}
.light .mock-editor:hover {
  box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.14), 0 30px 60px -30px rgba(0, 0, 0, 0.08);
}

/* Plan card active glow → neutral */
.light .plan-card.active {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 8px 40px rgba(0, 0, 0, 0.10);
}
.light .plan-card:hover {
  border-color: rgba(0, 0, 0, 0.16);
}

/* Analytics milestone */
.light .analytics-milestone.unlocked {
  background: rgba(34, 197, 94, 0.08);
}

/* Session panel */
.light .session-panel {
  box-shadow: var(--shadow);
}

/* General focus rings → green for light mode */
.light input:focus,
.light textarea:focus,
.light select:focus {
  border-color: rgba(34, 197, 94, 0.40);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

/* Stories: action buttons liked state → red heart */
.light .story-action-btn.liked {
  color: #dc2626;
}

/* Stories: compose format bar */
.light .story-composer-formatbar button.active {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

/* Elements with accent bg that need white text in light */
.light .analytics-range-btn.active {
  color: #ffffff;
}
.light .audio-track.active .audio-play-btn {
  color: #ffffff;
}
.light ::selection {
  background: #22c55e;
  color: #ffffff;
}

/* Stories submit button (Post Comment, etc.) */
.light .stories-submit-btn {
  background: #22c55e;
  color: #ffffff;
}
.light .stories-submit-btn:hover {
  background: #16a34a;
}

/* ===== STORIES ===== */
.stories-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.stories-view {
  min-height: calc(100vh - 160px);
}

.stories-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stories-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.stories-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stories-filter-btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.stories-filter-btn:hover,
.stories-filter-btn.active {
  border-color: rgba(74, 222, 128, 0.24);
  color: var(--text-primary);
  background: var(--accent-soft);
}

.stories-toolbar-note {
  font-size: 12px;
  color: var(--text-muted);
}

.stories-layout {
  margin-top: 8px;
}

.stories-feed-panel,
.stories-detail-panel {
  min-height: 560px;
}

.stories-feed-panel {
  display: block;
}

.stories-detail-panel {
  display: block;
}

.stories-mode-feed .stories-feed-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
  align-items: start;
}

.stories-mode-feed .stories-detail-panel {
  display: none;
}

.stories-mode-read .stories-feed-panel,
.stories-mode-compose .stories-feed-panel {
  display: none;
}

.stories-mode-read .stories-detail-panel,
.stories-mode-compose .stories-detail-panel {
  display: block;
}

.stories-feed-shell {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.stories-feed-lead {
  display: grid;
  gap: 22px;
}

.stories-feed-copy {
  padding: 26px 28px;
  background:
    radial-gradient(circle at top left, rgba(74, 222, 128, 0.14), transparent 42%),
    linear-gradient(135deg, rgba(74, 222, 128, 0.06), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.stories-kicker,
.story-feature-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.stories-feed-copy h2,
.stories-feed-section-head h3,
.story-detail-title,
.story-composer-head h2,
.story-feed-card h3,
.story-feature-card h3 {
  font-family: var(--font-display);
}

.stories-feed-copy h2 {
  margin: 12px 0 10px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 0.95;
}

.stories-feed-copy p,
.stories-feed-section-head p,
.story-detail-dek,
.story-feature-excerpt {
  color: var(--text-secondary);
}

.stories-feed-copy p {
  margin: 0;
  max-width: 760px;
  font-size: 15px;
  line-height: 1.7;
}

.story-feature-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 20px;
  padding: 26px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
}

.story-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: rgba(74, 222, 128, 0.22);
}

.story-feature-main,
.story-feature-author-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.story-feature-card h3 {
  font-size: clamp(30px, 3vw, 42px);
  line-height: 0.98;
  margin: 12px 0;
}

.story-feature-excerpt {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.8;
}

.story-feature-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.story-feature-metrics,
.story-reader-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.story-feature-metrics span,
.story-reader-meta-pills span {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  background: var(--hover-bg);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.stories-feed-stream {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stories-feed-section-head,
.story-feed-card-top,
.story-feed-meta,
.story-reader-topbar,
.story-reader-meta-bar,
.story-comment-card-head,
.story-composer-footer,
.story-composer-head,
.story-comments-head,
.story-comment-form-actions,
.story-composer-topbar,
.story-composer-fields {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.story-detail-badges,
.story-detail-actions,
.story-composer-actions,
.story-composer-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stories-feed-section-head {
  align-items: flex-end;
}

.stories-feed-section-head h3 {
  font-size: 24px;
  margin: 0;
}

.stories-feed-section-head p {
  margin: 6px 0 0;
  font-size: 13px;
}

.stories-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.story-feed-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 24px;
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.story-feed-card:hover {
  border-color: rgba(74, 222, 128, 0.24);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.story-feed-card-top {
  align-items: flex-start;
}

.story-feed-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.story-feed-card h3 {
  font-size: 26px;
  line-height: 1.05;
  margin: 18px 0 10px;
}

.story-feed-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 18px;
}

.story-feed-meta,
.story-feed-date,
.story-comment-card-head span,
.story-composer-note,
.story-comment-form-actions span {
  color: var(--text-muted);
  font-size: 12px;
}

.story-feed-meta {
  align-items: center;
}

.story-feed-label {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--hover-bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.story-feed-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.story-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.story-status-badge.success {
  background: var(--success-soft);
  color: var(--success);
}

.story-status-badge.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.story-status-badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.story-status-badge.muted {
  background: var(--hover-bg);
  color: var(--text-secondary);
}

.story-reader-shell,
.story-composer-shell {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.story-detail-title {
  font-size: clamp(44px, 6vw, 68px);
  line-height: 0.98;
  margin: 0;
}

.story-detail-dek {
  margin: 0;
  font-size: 18px;
  line-height: 1.8;
  max-width: 760px;
}

.story-reader-article,
.story-composer-card,
.story-comments-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.story-reader-article {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 34px 34px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.story-reader-topbar,
.story-composer-topbar {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.story-reader-meta-bar {
  align-items: flex-start;
}

.story-detail-content {
  font-size: 16px;
  line-height: 1.95;
  color: var(--text-primary);
  padding-bottom: 8px;
}

.story-detail-content h1,
.story-detail-content h2,
.story-detail-content h3 {
  font-family: var(--font-display);
}

.story-detail-content blockquote {
  margin: 20px 0;
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  background: var(--hover-bg);
  border-radius: 0 16px 16px 0;
}

.story-moderation-note,
.story-comment-locked {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.story-comment-form textarea,
.story-title-input,
.story-editor,
.story-excerpt-input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-radius: var(--radius);
  font: inherit;
}

.story-title-input {
  padding: 16px 18px;
  font-size: 30px;
  font-family: var(--font-display);
  font-weight: 800;
}

.story-excerpt-input {
  min-height: 96px;
  padding: 16px 18px;
  resize: vertical;
  line-height: 1.7;
}

.story-comments-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.story-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-secondary);
}

.story-toolbar button {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.story-toolbar button:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.story-editor {
  min-height: 480px;
  padding: 28px;
  font-size: 17px;
  line-height: 2;
  outline: none;
}

.story-editor:empty::before {
  content: "Start writing your story...";
  color: var(--text-muted);
}

.story-composer-card {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.story-composer-head {
  align-items: flex-start;
}

.story-composer-head h2 {
  margin: 8px 0;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.02;
}

.story-composer-head p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.story-composer-fields {
  align-items: stretch;
}

.story-composer-fields > * {
  flex: 1 1 100%;
}

.story-comment-form textarea {
  min-height: 96px;
  padding: 14px 16px;
  resize: vertical;
}

.story-comments-panel {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.story-comments-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
}

.story-comments-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.story-comment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-comment-card {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.story-comment-card p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.story-comment-pending-pill {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.story-empty-state {
  min-height: 420px;
}

.story-author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.story-author-compact {
  min-width: 0;
}

.story-author-featured {
  gap: 12px;
}

.story-author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.story-author-featured .story-author-avatar {
  width: 44px;
  height: 44px;
}

.story-author-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-author-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.story-author-copy strong {
  color: var(--text-primary);
  font-size: 13px;
}

.story-author-copy span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.story-author-plan {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 1080px) {
  .story-feature-card {
    grid-template-columns: 1fr;
  }

  .story-feature-side {
    padding: 16px;
  }
}

@media (max-width: 720px) {
  .stories-header {
    flex-direction: column;
  }

  .stories-header-actions {
    width: 100%;
  }

  .stories-header-actions .btn {
    flex: 1;
  }

  .stories-feed-copy,
  .story-feature-card,
  .story-reader-article,
  .story-comments-panel,
  .story-composer-card {
    padding: 20px;
    border-radius: 22px;
  }

  .story-detail-title {
    font-size: 36px;
  }

  .stories-card-list {
    grid-template-columns: 1fr;
  }

  .story-reader-topbar,
  .story-composer-topbar,
  .story-reader-article,
  .story-comments-panel,
  .story-composer-card {
    max-width: none;
  }

  .story-toolbar {
    padding: 14px;
  }

  .story-editor {
    min-height: 360px;
    padding: 20px;
  }
}
.light .heatmap-legend-cell[data-level="3"] { background: rgba(34,197,94,0.62); }

/* ── Light: tree ── */
.light .tree-container {
  box-shadow: var(--shadow);
}
.light .tree-container::before {
  background: linear-gradient(90deg, transparent, rgba(34,197,94,0.10), transparent);
}

/* ── Light: XP bar ── */
.light .xp-bar-fill {
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.15);
}

/* ── Light: document cards ── */
.light .doc-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  border-color: rgba(34, 197, 94, 0.16);
}
.light .doc-action-btn {
  background: rgba(0, 0, 0, 0.02);
}

/* ── Light: editor ── */
.light .editor-back-btn {
  background: rgba(0, 0, 0, 0.02);
}
.light .danger-progress {
  background: rgba(0, 0, 0, 0.04);
}

/* ── Light: modals ── */
.light .modal-overlay {
  background: rgba(0, 0, 0, 0.40);
}
.light .tab-warning {
  background: rgba(255, 255, 255, 0.97);
}
.light .duel-countdown-overlay {
  background: rgba(255, 255, 255, 0.95);
}
.light .streak-popup-overlay {
  background: rgba(0, 0, 0, 0.30);
}
.light .session-complete::before {
  background: radial-gradient(circle, rgba(34,197,94,0.08) 0%, transparent 60%);
}
.light .session-failed::before {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.06) 0%, transparent 60%);
}

/* ── Light: toast ── */
.light .toast.success {
  border-color: rgba(34, 197, 94, 0.25);
  box-shadow: var(--shadow-lg);
}

/* ── Light: spinner ── */
.light .spinner {
  border-color: rgba(0, 0, 0, 0.08);
  border-top-color: var(--accent);
}

/* ── Light: admin table ── */
.light .admin-table tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}
.light .leaderboard-table th {
  background: rgba(0, 0, 0, 0.02);
}
.light .leaderboard-table tr:hover td {
  background: rgba(34, 197, 94, 0.04);
}

/* ── Light: leaderboard / podium ── */
.light .podium-slot:nth-child(1) .podium-pedestal {
  background: linear-gradient(180deg, rgba(192,192,192,0.30), rgba(192,192,192,0.10));
  border: 1px solid rgba(192,192,192,0.40);
}
.light .podium-slot:nth-child(2) .podium-pedestal {
  background: linear-gradient(180deg, rgba(255,200,0,0.25), rgba(255,215,0,0.08));
  border: 1px solid rgba(255,200,0,0.40);
  box-shadow: 0 0 20px rgba(255,200,0,0.08);
}
.light .podium-slot:nth-child(3) .podium-pedestal {
  background: linear-gradient(180deg, rgba(205,127,50,0.25), rgba(205,127,50,0.08));
  border: 1px solid rgba(205,127,50,0.35);
}
.light .podium-avatar {
  box-shadow: 0 3px 12px rgba(34, 197, 94, 0.25);
}
.light .podium-name {
  color: var(--text-primary);
}
.light .leaderboard-me td {
  background: rgba(34, 197, 94, 0.06) !important;
}
.light .leaderboard-table-wrap {
  box-shadow: var(--shadow);
}

/* ── Light: profile section ── */
.light .profile-section {
  box-shadow: var(--shadow);
}
.light .achievement-card.earned:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(34, 197, 94, 0.25);
}

/* ── Light: duel cards ── */
.light .duel-sent-card {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.04), var(--bg-card));
}
.light .duel-bar {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
}

/* ── Light: selection popup ── */
.light .selection-popup {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.06);
}

/* ── Light: XP float ── */
.light .editor-xp-float {
  text-shadow: none;
}

/* ── Light: mobile overlay ── */
.light .mobile-sidebar-overlay {
  background: rgba(0, 0, 0, 0.25);
}

/* ── Light: landing animations ── */
.light .landing .stat-num {
  animation: none;
}
.light .motivate-toast {
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.12);
}

/* ── Light: duel button — solid green, no gradient ── */
.light .duel-big-btn {
  background: var(--accent) !important;
  animation: duel-pulse-light 2.5s ease-in-out infinite;
}
.light .duel-big-btn:hover {
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.3), var(--shadow-lg) !important;
}
@keyframes duel-pulse-light {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3), var(--shadow); }
  50% { box-shadow: 0 0 16px 4px rgba(34, 197, 94, 0.15), var(--shadow-lg); }
}

/* ── Light: streak popup ── */
.light .streak-popup {
  box-shadow: var(--shadow-lg);
}

/* ── Light: toast ── */
.light .toast {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}

/* ── Light: upgrade cards ── */
.light .upgrade-card {
  box-shadow: var(--shadow);
}
.light .upgrade-card:hover {
  box-shadow: var(--shadow-lg);
}
.light .upgrade-card-featured {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.20), var(--shadow);
}

/* ── Light: share dropdown ── */
.light .share-dropdown {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}
.light .share-dropdown-item:hover {
  background: var(--hover-bg);
}

/* ── Light: referral dots ── */
.light .referral-dot {
  background: rgba(0, 0, 0, 0.08);
}

/* ── Light: friend cards ── */
.light .friend-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

/* ── Light: duel history cards ── */
.light .duel-history-card {
  box-shadow: var(--shadow);
}

/* ── Light: analytics gate text ── */
.light .analytics-pro-gate-overlay .upgrade-label {
  color: var(--text-primary);
}

/* ── Light: profile plan badge ── */
.light .profile-plan-badge.free {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  border-color: var(--border);
}

/* ── Light: danger countdown ── */
.light .danger-countdown {
  background: rgba(255, 255, 255, 0.97);
  color: var(--text-primary);
}

/* ===== SEPIA THEME ===== */
/* ══════════════════════════════════════════════════════════════
   SEPIA THEME — Deep Parchment / Paper Palette
   Accent: #C37E3F (copper/leather)
   Background: #E8DCC8 (aged parchment)
   ALL hardcoded greens → copper rgba(195, 126, 63, ...)
   ══════════════════════════════════════════════════════════════ */
.sepia {
  --accent-rgb: 195, 126, 63;      /* copper — Writer's Desk structure uses this */
  --ink-rgb: 44, 31, 14;           /* sepia ink for lines/tracks/shadows */
  --bg-primary: #E8DCC8;
  --bg-secondary: #DED2BE;
  --bg-card: #F0E6D4;
  --bg-card-hover: #E8DECE;
  --bg-elevated: #EDE3D1;
  --bg-glass: rgba(232, 220, 200, 0.92);
  --text-primary: #2c1f0e;
  --text-secondary: rgba(44, 31, 14, 0.68);
  --text-muted: rgba(44, 31, 14, 0.44);
  --accent: #C37E3F;
  --accent-soft: rgba(195, 126, 63, 0.12);
  --accent-glow: rgba(195, 126, 63, 0.22);
  --success: #C37E3F;
  --success-soft: rgba(195, 126, 63, 0.12);
  --border: rgba(44, 31, 14, 0.12);
  --border-light: rgba(44, 31, 14, 0.06);
  --border-hover: rgba(44, 31, 14, 0.22);
  --hover-bg: rgba(44, 31, 14, 0.05);
  --shadow: 0 1px 3px rgba(44, 31, 14, 0.10), 0 0 0 1px rgba(44, 31, 14, 0.06);
  --shadow-lg: 0 12px 40px rgba(44, 31, 14, 0.14), 0 0 0 1px rgba(44, 31, 14, 0.06);
  --shadow-3d: 0 2px 8px rgba(44, 31, 14, 0.10), 0 1px 2px rgba(44, 31, 14, 0.06);
  --shadow-glow: 0 0 30px rgba(195, 126, 63, 0.10);
  --shadow-inset-glow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  --gradient-card: linear-gradient(135deg, rgba(240,230,212,0.6) 0%, rgba(232,220,200,0.3) 100%);
  --gradient-hero: radial-gradient(ellipse at 50% 0%, rgba(195,126,63,0.06) 0%, transparent 60%);
  --gradient-accent: linear-gradient(135deg, #C37E3F 0%, #D4954F 100%);
  --xp-color: #C37E3F;
}

/* ── Sepia: base overrides ── */
.sepia body, .sepia {
  background: var(--bg-primary);
  color: var(--text-primary);
}
/* Paper texture — visible fiber grain + noise */
.sepia body::before {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent, transparent 2px,
      rgba(100, 65, 20, 0.06) 2px,
      rgba(100, 65, 20, 0.06) 3px,
      transparent 3px, transparent 5px
    ),
    repeating-linear-gradient(
      90deg,
      transparent, transparent 3px,
      rgba(100, 65, 20, 0.04) 3px,
      rgba(100, 65, 20, 0.04) 4px,
      transparent 4px, transparent 7px
    ),
    repeating-linear-gradient(
      45deg,
      transparent, transparent 4px,
      rgba(100, 65, 20, 0.035) 4px,
      rgba(100, 65, 20, 0.035) 5px,
      transparent 5px, transparent 9px
    );
  background-size: auto;
  opacity: 1;
}
/* Vignette — aged paper edge darkening */
.sepia body::after {
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(100, 70, 25, 0.12) 100%);
}

/* ── Sepia: nav ── */
.sepia .nav {
  background: rgba(222, 210, 190, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.sepia .logo { text-shadow: none; color: #5C3A1E; }

/* ── Sepia: sidebar ── */
.sepia .sidebar {
  background: var(--bg-secondary);
  border-right-color: var(--border);
  box-shadow: 1px 0 8px rgba(44,31,14,0.06);
}
.sepia .sidebar-nav-item.active {
  background: rgba(195, 126, 63, 0.12);
  border: 1px solid rgba(195, 126, 63, 0.24);
  box-shadow: inset 0 0 16px rgba(195, 126, 63, 0.06);
}
.sepia .sidebar-nav-item:hover {
  background: rgba(195, 126, 63, 0.06);
}
.sepia .user-avatar {
  box-shadow: 0 4px 12px rgba(195, 126, 63, 0.25);
}

/* ── Sepia: buttons ── */
.sepia .btn-small,
.sepia .btn-primary {
  background: #C37E3F;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(195, 126, 63, 0.25);
}
.sepia .btn-small:hover,
.sepia .btn-primary:hover {
  background: #B06E32;
  box-shadow: 0 4px 16px rgba(195, 126, 63, 0.30);
}
.sepia .btn-ghost { border-color: rgba(195, 126, 63, 0.25); color: #C37E3F; }
.sepia .btn-ghost:hover { border-color: rgba(195, 126, 63, 0.4); background: rgba(195, 126, 63, 0.06); }

/* ── Sepia: stat cards + dashboard ── */
.sepia .stat-card,
.sepia .dash-stat-card {
  background: var(--bg-card);
  box-shadow: var(--shadow);
}
.sepia .stat-card::before { background: linear-gradient(90deg, transparent, rgba(195,126,63,0.18), transparent); }
.sepia .dash-stat-card::before { background: linear-gradient(90deg, transparent, rgba(195,126,63,0.18), transparent); }
.sepia .dash-stat-card:hover {
  box-shadow: 0 12px 36px rgba(44, 31, 14, 0.12);
  border-color: rgba(195, 126, 63, 0.18);
}
.sepia .dashboard-hero { box-shadow: var(--shadow); background: var(--bg-card); }
.sepia .dashboard-hero::before {
  background: radial-gradient(circle, rgba(195,126,63,0.08) 0%, transparent 70%);
}

/* ── Sepia: heatmap — copper tones ── */
.sepia .heatmap-cell[data-level="0"] { background: rgba(44, 31, 14, 0.06); }
.sepia .heatmap-cell[data-level="1"] { background: rgba(195, 126, 63, 0.25); }
.sepia .heatmap-cell[data-level="2"] { background: rgba(195, 126, 63, 0.50); }
.sepia .heatmap-cell[data-level="3"] { background: rgba(195, 126, 63, 0.75); }
.sepia .heatmap-cell[data-level="4"] { background: #C37E3F; }
.sepia .heatmap-cell:hover { box-shadow: 0 0 8px rgba(195, 126, 63, 0.3); }
.sepia .heatmap-legend-cell[data-level="0"] { background: rgba(44,31,14,0.06); }
.sepia .heatmap-legend-cell[data-level="1"] { background: rgba(195,126,63,0.25); }
.sepia .heatmap-legend-cell[data-level="2"] { background: rgba(195,126,63,0.50); }
.sepia .heatmap-legend-cell[data-level="3"] { background: rgba(195,126,63,0.75); }
.sepia .heatmap-legend-cell[data-level="4"] { background: #C37E3F; }
.sepia .heatmap-section::before { background: linear-gradient(90deg, transparent, rgba(195,126,63,0.15), transparent); }

/* ── Sepia: XP bar ── */
.sepia .xp-bar-fill { background: #C37E3F; box-shadow: 0 0 8px rgba(195, 126, 63, 0.22); }
.sepia .xp-bar { background: rgba(44, 31, 14, 0.08); }

/* ── Sepia: document cards ── */
.sepia .doc-card { background: var(--bg-card); }
.sepia .doc-card:hover {
  box-shadow: 0 16px 40px rgba(44, 31, 14, 0.12), 0 0 30px rgba(195, 126, 63, 0.06);
  border-color: rgba(195, 126, 63, 0.20);
}
.sepia .doc-action-btn { background: rgba(44, 31, 14, 0.04); }
.sepia .doc-icon.doc-icon-completed { background: rgba(195, 126, 63, 0.15); color: var(--accent); }

/* ── Sepia: tree container ── */
.sepia .tree-container::before { background: linear-gradient(90deg, transparent, rgba(195,126,63,0.18), transparent); }

/* ── Sepia: editor — writing on paper ── */
.sepia .editor-back-btn { background: rgba(44, 31, 14, 0.04); }
.sepia .danger-progress { background: rgba(44, 31, 14, 0.06); }
.sepia .danger-progress-fill { background: #C37E3F; }
.sepia .editor-area,
.sepia .ql-editor,
.sepia #editor-container { background: var(--bg-card); }

/* ── Sepia: modals ── */
.sepia .modal-overlay { background: rgba(44, 31, 14, 0.55); }
.sepia .modal { background: var(--bg-card); }

/* ── Sepia: toast ── */
.sepia .toast { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.sepia .toast.success { border-color: rgba(195, 126, 63, 0.3); box-shadow: var(--shadow-lg), 0 0 20px rgba(195, 126, 63, 0.1); }

/* ── Sepia: selection popup ── */
.sepia .selection-popup {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}

/* ── Sepia: inputs & forms ── */
.sepia input, .sepia textarea, .sepia select {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}
.sepia input:focus, .sepia textarea:focus, .sepia select:focus {
  border-color: rgba(195, 126, 63, 0.4);
  box-shadow: 0 0 0 3px rgba(195, 126, 63, 0.1);
}
/* Transparent-bg inputs must stay transparent in sepia */
.sepia .editor-title-input,
.sepia .editor-topic-input,
.sepia .story-title-input-plain { background: transparent !important; }

/* ── Sepia: duel cards — copper tones ── */
.sepia .duel-history-card.won { border-left-color: #C37E3F; }
.sepia .dhc-badge.won { background: rgba(195, 126, 63, 0.12); color: #C37E3F; }
.sepia .duel-big-btn:hover { box-shadow: 0 8px 30px rgba(195, 126, 63, 0.3), var(--shadow-lg) !important; }
.sepia .duel-sent-card { background: linear-gradient(135deg, rgba(195, 126, 63, 0.05), var(--bg-card)); }
.sepia .duel-bar { background: linear-gradient(135deg, rgba(195, 126, 63, 0.15), rgba(195, 126, 63, 0.05)); }
.sepia .duel-extra-time-accept { background: rgba(195, 126, 63, 0.15); color: #C37E3F; }
.sepia .duel-extra-time-accept:hover { background: rgba(195, 126, 63, 0.25); }

/* ── Sepia: friend cards ── */
.sepia .friend-card { background: var(--bg-card); }
.sepia .friend-card:hover { box-shadow: 0 8px 28px rgba(44, 31, 14, 0.10); }

/* ── Sepia: analytics ── */
.sepia .analytics-bar { background: #C37E3F !important; }
.sepia .analytics-milestone.unlocked { background: rgba(195, 126, 63, 0.08); }

/* ── Sepia: session modal + presets ── */
.sepia .time-preset.active { box-shadow: 0 4px 16px rgba(195, 126, 63, 0.3); }
.sepia .mode-option.active { box-shadow: 0 4px 20px rgba(195, 126, 63, 0.3); }
.sepia .motivate-toast { box-shadow: 0 4px 20px rgba(195, 126, 63, 0.2); }
.sepia .session-complete::before { background: radial-gradient(circle, rgba(195,126,63,0.12) 0%, transparent 60%); }

/* ── Sepia: achievements ── */
.sepia .achievement-card.earned { border-color: rgba(195, 126, 63, 0.2); }
.sepia .achievement-card.earned:hover { border-color: rgba(195, 126, 63, 0.4); }

/* ── Sepia: leaderboard ── */
.sepia .podium-avatar { box-shadow: 0 4px 16px rgba(195,126,63,0.3); }
.sepia .leaderboard-table tr:hover td { background: rgba(195,126,63,0.04); }
.sepia .leaderboard-me td { background: rgba(195,126,63,0.08) !important; }

/* ── Sepia: support tickets ── */
.sepia .ticket-type--suggestion { background: rgba(195,126,63,0.12); color: var(--accent); }
.sepia .ticket-type--feedback { background: rgba(195,126,63,0.12); color: #C37E3F; }
.sepia .ticket-status--open { background: rgba(195,126,63,0.12); color: #C37E3F; }
.sepia .ticket-status--replied { background: rgba(195,126,63,0.12); color: var(--accent); }

/* ── Sepia: pricing & upgrade cards ── */
.sepia .upgrade-card-featured { box-shadow: 0 0 0 1px rgba(195, 126, 63, 0.15), 0 4px 32px rgba(195, 126, 63, 0.08); }
.sepia .pricing-card.pro { box-shadow: 0 0 0 1px rgba(195, 126, 63, 0.15), 0 4px 32px rgba(195, 126, 63, 0.08); }
.sepia .plan-card-active { box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(195, 126, 63, 0.08); }

/* ── Sepia: landing page ── */
.sepia .mock-editor { box-shadow: 0 30px 80px rgba(44, 31, 14, 0.3), 0 0 60px rgba(195, 126, 63, 0.08); }
.sepia .mock-editor:hover { box-shadow: 0 30px 80px rgba(44, 31, 14, 0.3), 0 0 100px rgba(195, 126, 63, 0.12); }
.sepia .mock-dots span:nth-child(3) { background: #C37E3F; box-shadow: 0 0 8px rgba(195, 126, 63, 0.3); }
.sepia .feature-card::before { background: linear-gradient(90deg, transparent, rgba(195,126,63,0.18), transparent); }
.sepia .feature-card:hover { box-shadow: 0 20px 50px rgba(44, 31, 14, 0.15), 0 0 40px rgba(195, 126, 63, 0.08); border-color: rgba(195, 126, 63, 0.25); }
.sepia .feature-card:hover .feature-icon { box-shadow: 0 0 20px rgba(195, 126, 63, 0.2); }
.sepia .how-it-works::before { background: radial-gradient(ellipse, rgba(195,126,63,0.08) 0%, transparent 70%); }
.sepia .release-card.active { box-shadow: 0 0 0 1px rgba(195, 126, 63, 0.15), 0 8px 40px rgba(44, 31, 14, 0.2); }
.sepia .releases-arrow:hover { background: rgba(195, 126, 63, 0.08); }
.sepia .landing-pricing-container { box-shadow: 0 0 60px rgba(195, 126, 63, 0.06), var(--shadow); }
.sepia .landing-pricing-container::before { background: linear-gradient(135deg, rgba(195, 126, 63, 0.15), rgba(195, 126, 63, 0.02), rgba(195, 126, 63, 0.08)); }
.sepia .landing-plan-card.featured { box-shadow: 0 0 0 1px rgba(195, 126, 63, 0.12), 0 4px 32px rgba(195, 126, 63, 0.08); }
.sepia .landing-plan-btn.primary { box-shadow: 0 4px 20px rgba(195, 126, 63, 0.25); }
.sepia .landing-plan-btn.primary:hover { box-shadow: 0 6px 28px rgba(195, 126, 63, 0.35); }
.sepia .cta::before { background: radial-gradient(ellipse, rgba(195,126,63,0.10) 0%, transparent 70%); }

/* ── Sepia: auth page ── */
.sepia .auth-monsters-panel { background: linear-gradient(135deg, rgba(195,126,63,0.06) 0%, rgba(195,126,63,0.04) 50%, rgba(167,139,250,0.03) 100%); }
.sepia .auth-monsters-panel::before { background: radial-gradient(circle, rgba(195,126,63,0.08) 0%, transparent 60%); }
.sepia .auth-brand-i { text-shadow: 0 0 40px rgba(195,126,63,0.4); }

/* ── Sepia: comments ── */
.sepia .comment-resolve-btn.accept:hover { background: rgba(195, 126, 63, 0.15); color: #C37E3F; border-color: rgba(195, 126, 63, 0.3); }

/* ── Sepia: online dot ── */
.sepia .online-dot { background: #C37E3F; box-shadow: 0 0 6px rgba(195, 126, 63, 0.5); }

/* ── Sepia: session admin tag ── */
.sepia .session-admin-tag { background: rgba(195,126,63,0.12); }

/* ── Sepia: level up overlay ── */
.sepia .levelup-glow { background: radial-gradient(circle, rgba(195, 126, 63, 0.3) 0%, transparent 70%); }
.sepia .levelup-badge { box-shadow: 0 0 40px rgba(195, 126, 63, 0.4), 0 0 80px rgba(195, 126, 63, 0.15); }
.sepia .levelup-title { text-shadow: 0 0 30px rgba(195, 126, 63, 0.4); }

/* ── Sepia: notification badge ── */
.sepia .notification-badge { background: linear-gradient(135deg, rgba(195, 126, 63, 0.15), rgba(195, 126, 63, 0.05)); }

/* ── Sepia: mode selector ── */
.sepia .mode-selector button.active { box-shadow: 0 4px 16px rgba(195, 126, 63, 0.3); }
.sepia .mode-option.active.dangerous-opt { box-shadow: 0 4px 20px rgba(195, 126, 63, 0.3); }
.sepia .danger-mode-radial-bg { background: radial-gradient(circle, rgba(195,126,63,0.12) 0%, transparent 60%); }

/* ── Sepia: status/online dot ── */
.sepia .status-dot { background: #C37E3F; box-shadow: 0 0 6px rgba(195, 126, 63, 0.5); }

/* ── Sepia: podium ── */
.sepia .podium-ranking { box-shadow: 0 4px 16px rgba(195,126,63,0.3); }

/* ── Sepia: auth ── */
.sepia .auth-beta-badge { background: rgba(195,126,63,0.12); }

/* ── Sepia: dashboard hero before (landing) ── */
.sepia .dashboard-hero::before { background: linear-gradient(90deg, transparent, rgba(195,126,63,0.12), transparent); }

/* ── Sepia: release card ── */
.sepia .release-card.active { box-shadow: 0 0 0 1px rgba(195, 126, 63, 0.15), 0 8px 40px rgba(44, 31, 14, 0.15); }

/* ── Sepia: keyframe overrides — replace green pulse/glow animations ── */
@keyframes sepia-duel-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(195, 126, 63, 0.4), var(--shadow); }
  50% { box-shadow: 0 0 20px 8px rgba(195, 126, 63, 0.2), var(--shadow-lg); }
}
@keyframes sepia-online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(195, 126, 63, 0.4); }
  50% { box-shadow: 0 0 6px 2px rgba(195, 126, 63, 0.2); }
}
.sepia .duel-big-btn { animation-name: sepia-duel-pulse; background: var(--accent) !important; color: #ffffff !important; }
.sepia .duel-big-btn:hover { animation-name: sepia-duel-pulse; box-shadow: 0 8px 30px rgba(195, 126, 63, 0.4), var(--shadow-lg) !important; }
.sepia .online-dot, .sepia .status-dot { animation-name: sepia-online-pulse; }

/* ── Sepia: scrollbar ── */
.sepia ::-webkit-scrollbar-thumb { background: rgba(195, 126, 63, 0.25); }
.sepia ::-webkit-scrollbar-thumb:hover { background: rgba(195, 126, 63, 0.40); }
.sepia ::-webkit-scrollbar-track { background: rgba(44, 31, 14, 0.04); }

/* ── Sepia: share button — solid copper, no gradient ── */
.sepia .btn-share-analytics {
  background: #C37E3F;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(195, 126, 63, 0.3);
}
.sepia .btn-share-analytics:hover {
  box-shadow: 0 6px 20px rgba(195, 126, 63, 0.4);
}

/* ══════════════════════════════════════════════════════════════
   WRITER'S DESK STRUCTURE (.test) — applied to EVERY theme.
   This is now a structure/aesthetic layer, not a palette: all colours
   resolve from the active theme's variables (--accent-rgb, --ink-rgb,
   --bg-*, etc.). Light supplies the warm parchment palette; Dark and
   Sepia supply their own. Craft objects (polaroid, sticky note) keep
   constant colours since they read as physical paper on any background.
   ══════════════════════════════════════════════════════════════ */

/* ── Base canvas ── */
.test body, .test {
  background: var(--bg-primary);
  color: var(--text-primary);
}
/* Soft warm paper grain — Light (parchment) only; Dark/Sepia keep their own */
.light body::before {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent, transparent 2px,
      rgba(120, 95, 50, 0.035) 2px,
      rgba(120, 95, 50, 0.035) 3px,
      transparent 3px, transparent 6px
    ),
    repeating-linear-gradient(
      90deg,
      transparent, transparent 3px,
      rgba(120, 95, 50, 0.028) 3px,
      rgba(120, 95, 50, 0.028) 4px,
      transparent 4px, transparent 8px
    );
  background-size: auto;
  opacity: 1;
}
/* Vignette — gentle warm edge (Light only) */
.light body::after {
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(120, 95, 45, 0.08) 100%);
}

/* ── Test: typography — Fraunces serif headings ── */
.test .dashboard-hero-text h1,
.test .dashboard-header h1,
.test .docs-header h1,
.test .docs-header h2,
.test .tree-container h3,
.test .heatmap-title {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
}
.test .dashboard-hero-text h1 {
  font-family: 'Story Script', 'Caveat', cursive;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  font-size: 48px;
  line-height: 1.1;
}
.test .dashboard-hero-text h1 em {
  font-style: normal;
  font-weight: 400;
  color: var(--accent);
}
.test .dashboard-header h1,
.test .docs-header h1,
.test .docs-header h2 {
  font-weight: 600;
  letter-spacing: -0.3px;
}
.test .dashboard-hero-sub,
.test .dashboard-header p { font-weight: 400; }
/* Section labels that were tiny uppercase → readable serif titles */
.test .heatmap-title,
.test .tree-container h3 {
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-primary);
}

/* ── Test: nav ── */
.test .nav {
  background: var(--bg-glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.test .logo { text-shadow: none; color: var(--accent); }

/* ── Test: sidebar ── */
.test .sidebar {
  background: var(--bg-secondary);
  border-right-color: var(--border);
  box-shadow: 1px 0 10px rgba(var(--ink-rgb), 0.05);
}
.test .sidebar-nav-item.active {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  box-shadow: inset 0 0 16px rgba(var(--accent-rgb), 0.06);
}
.test .sidebar-nav-item:hover { background: rgba(var(--accent-rgb), 0.06); }
.test .user-avatar { box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.28); }

/* ── Test: buttons — olive pills, white text ── */
.test .btn-small,
.test .btn-primary {
  background: var(--gradient-accent);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.28);
}
.test .btn-small:hover,
.test .btn-primary:hover {
  background: var(--gradient-accent);
  filter: brightness(1.07);
  box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.34);
}
.test .btn-ghost { border-color: rgba(var(--accent-rgb), 0.28); color: var(--accent); }
.test .btn-ghost:hover { border-color: rgba(var(--accent-rgb), 0.45); background: rgba(var(--accent-rgb), 0.06); color: var(--accent); }
.test ::selection { background: var(--accent); color: #faf6ec; }

/* ── Test: stat cards + hero ── */
.test .stat-card,
.test .dash-stat-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-3d);
}
.test .stat-card::before,
.test .dash-stat-card::before { background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),0.20), transparent); }
.test .dash-stat-card:hover {
  box-shadow: 0 16px 40px rgba(var(--ink-rgb), 0.13);
  border-color: rgba(var(--accent-rgb), 0.20);
}
/* Uniform warm-ink stat numbers, like the reference — colour lives in the icons */
.test .dash-stat-words .dash-stat-value,
.test .dash-stat-sessions .dash-stat-value,
.test .dash-stat-streak .dash-stat-value,
.test .dash-stat-xp .dash-stat-value { color: var(--text-primary); }
.test .dashboard-hero { box-shadow: var(--shadow-3d); background: var(--bg-card); }
.test .dashboard-hero::before {
  background: radial-gradient(circle, rgba(var(--accent-rgb),0.10) 0%, transparent 70%);
}

/* ── Test: heatmap — forest-green scale on warm empty cells ── */
.test .heatmap-cell[data-level="0"] { background: rgba(var(--ink-rgb), 0.06); }
.test .heatmap-cell[data-level="1"] { background: rgba(var(--accent-rgb), 0.26); }
.test .heatmap-cell[data-level="2"] { background: rgba(var(--accent-rgb), 0.50); }
.test .heatmap-cell[data-level="3"] { background: rgba(var(--accent-rgb), 0.74); }
.test .heatmap-cell[data-level="4"] { background: var(--accent); }
.test .heatmap-cell:hover { box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.3); }
.test .heatmap-legend-cell[data-level="0"] { background: rgba(var(--ink-rgb), 0.06); }
.test .heatmap-legend-cell[data-level="1"] { background: rgba(var(--accent-rgb), 0.26); }
.test .heatmap-legend-cell[data-level="2"] { background: rgba(var(--accent-rgb), 0.50); }
.test .heatmap-legend-cell[data-level="3"] { background: rgba(var(--accent-rgb), 0.74); }
.test .heatmap-legend-cell[data-level="4"] { background: var(--accent); }
.test .heatmap-section { box-shadow: var(--shadow-3d); }
.test .heatmap-section::before { background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),0.16), transparent); }

/* ── Test: XP bar ── */
.test .xp-bar-fill { background: var(--gradient-accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.22); }
.test .xp-bar { background: rgba(var(--ink-rgb), 0.08); }

/* ── Test: tree ── */
.test .tree-container { box-shadow: var(--shadow-3d); }
.test .tree-container::before { background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),0.20), transparent); }

/* ── Test: document / session cards ── */
.test .doc-card { background: var(--bg-card); }
.test .doc-card:hover {
  box-shadow: 0 16px 40px rgba(var(--ink-rgb), 0.12), 0 0 30px rgba(var(--accent-rgb), 0.06);
  border-color: rgba(var(--accent-rgb), 0.20);
}
.test .doc-action-btn { background: rgba(var(--ink-rgb), 0.04); }
.test .doc-icon.doc-icon-completed { background: rgba(var(--accent-rgb), 0.16); color: var(--accent); }

/* ── Test: editor — writing on warm paper ── */
.test .editor-back-btn { background: rgba(var(--ink-rgb), 0.04); }
.test .danger-progress { background: rgba(var(--ink-rgb), 0.06); }
.test .danger-progress-fill { background: var(--accent); }
.test .editor-area,
.test .ql-editor,
.test #editor-container { background: var(--bg-card); }

/* ── Test: modals, toasts, popups ── */
.test .modal-overlay { background: rgba(59, 53, 42, 0.50); }
.test .modal { background: var(--bg-card); }
.test .toast { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.test .toast.success { border-color: rgba(var(--accent-rgb), 0.3); box-shadow: var(--shadow-lg), 0 0 20px rgba(var(--accent-rgb), 0.1); }
.test .selection-popup { background: var(--bg-card); border-color: var(--border); box-shadow: var(--shadow-lg); }

/* ── Test: inputs & forms ── */
.test input, .test textarea, .test select {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}
.test input:focus, .test textarea:focus, .test select:focus {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.10);
}
.test .editor-title-input,
.test .editor-topic-input,
.test .story-title-input-plain { background: transparent !important; }

/* ── Test: duels ── */
.test .duel-history-card.won { border-left-color: var(--accent); }
.test .dhc-badge.won { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.test .duel-sent-card { background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.05), var(--bg-card)); }
.test .duel-bar { background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), rgba(var(--accent-rgb), 0.05)); }
.test .duel-extra-time-accept { background: rgba(var(--accent-rgb), 0.15); color: var(--accent); }
.test .duel-extra-time-accept:hover { background: rgba(var(--accent-rgb), 0.25); }

/* ── Test: friends, analytics, presets ── */
.test .friend-card { background: var(--bg-card); }
.test .friend-card:hover { box-shadow: 0 8px 28px rgba(var(--ink-rgb), 0.10); }
.test .analytics-bar { background: var(--accent) !important; }
.test .analytics-milestone.unlocked { background: rgba(var(--accent-rgb), 0.08); }
.test .time-preset.active { box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3); }
.test .mode-option.active { box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3); }
.test .motivate-toast { box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.2); }
.test .session-complete::before { background: radial-gradient(circle, rgba(var(--accent-rgb),0.12) 0%, transparent 60%); }

/* ── Test: achievements, leaderboard, support ── */
.test .achievement-card.earned { border-color: rgba(var(--accent-rgb), 0.2); }
.test .achievement-card.earned:hover { border-color: rgba(var(--accent-rgb), 0.4); }
.test .podium-avatar { box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3); }
.test .leaderboard-table tr:hover td { background: rgba(var(--accent-rgb), 0.04); }
.test .leaderboard-me td { background: rgba(var(--accent-rgb), 0.08) !important; }
.test .ticket-type--suggestion,
.test .ticket-type--feedback,
.test .ticket-status--open,
.test .ticket-status--replied { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }

/* ── Test: pricing & upgrade cards ── */
.test .upgrade-card-featured { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.15), 0 4px 32px rgba(var(--accent-rgb), 0.08); }
.test .pricing-card.pro { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.15), 0 4px 32px rgba(var(--accent-rgb), 0.08); }
.test .plan-card-active { box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(var(--accent-rgb), 0.08); }

/* ── Test: landing surfaces ── */
.test .mock-editor { box-shadow: 0 30px 80px rgba(var(--ink-rgb), 0.22), 0 0 60px rgba(var(--accent-rgb), 0.08); }
.test .feature-card::before { background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb),0.18), transparent); }
.test .feature-card:hover { box-shadow: 0 20px 50px rgba(var(--ink-rgb), 0.14), 0 0 40px rgba(var(--accent-rgb), 0.08); border-color: rgba(var(--accent-rgb), 0.25); }
.test .how-it-works::before { background: radial-gradient(ellipse, rgba(var(--accent-rgb),0.08) 0%, transparent 70%); }
.test .cta::before { background: radial-gradient(ellipse, rgba(var(--accent-rgb),0.10) 0%, transparent 70%); }

/* ── Test: misc accents ── */
.test .online-dot, .test .status-dot { background: var(--accent); box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.5); }
.test .session-admin-tag { background: rgba(var(--accent-rgb), 0.12); }
.test .notification-badge { background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), rgba(var(--accent-rgb), 0.05)); }
.test .levelup-glow { background: radial-gradient(circle, rgba(var(--accent-rgb), 0.3) 0%, transparent 70%); }
.test .levelup-badge { box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.4), 0 0 80px rgba(var(--accent-rgb), 0.15); }
.test .auth-beta-badge { background: rgba(var(--accent-rgb), 0.12); }

/* ── Test: keyframe overrides — green pulse/glow → olive ── */
@keyframes test-duel-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.4), var(--shadow); }
  50% { box-shadow: 0 0 20px 8px rgba(var(--accent-rgb), 0.2), var(--shadow-lg); }
}
@keyframes test-online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.4); }
  50% { box-shadow: 0 0 6px 2px rgba(var(--accent-rgb), 0.2); }
}
.test .duel-big-btn { animation-name: test-duel-pulse; background: var(--gradient-accent) !important; color: #ffffff !important; }
.test .duel-big-btn:hover { animation-name: test-duel-pulse; box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.4), var(--shadow-lg) !important; }
.test .online-dot, .test .status-dot { animation-name: test-online-pulse; }

/* ── Test: scrollbar ── */
.test ::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.25); }
.test ::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb), 0.40); }
.test ::-webkit-scrollbar-track { background: rgba(var(--ink-rgb), 0.04); }

/* ── Test: share button ── */
.test .btn-share-analytics {
  background: var(--gradient-accent);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.3);
}
.test .btn-share-analytics:hover { box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.4); }

/* ══════════════════════════════════════════════════════════════
   TEST THEME — "Writer's Desk" dashboard STRUCTURE
   Layout + components that appear ONLY when .test is active, to
   match the iWrite4.me reference: polaroid hero, horizontal
   stat+level bar, Today's Progress ring, reflection sticky note,
   achievements panel, footer quote + maker's stamp.
   ══════════════════════════════════════════════════════════════ */
/* Test-only elements stay hidden in every other theme.
   `button.test-only` needs the extra element specificity to beat `.btn`'s
   own `display:inline-flex` (which is declared later in the file). */
.test-only { display: none; }
button.test-only { display: none; }

/* ── Hero: greeting | polaroid + handwritten quote | action buttons ── */
.test .dashboard-hero { gap: 28px; align-items: center; }
.test .dashboard-hero-text { flex: 1 1 auto; min-width: 220px; }
.test .td-hero-aside { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }
.test .td-polaroid {
  position: relative;
  background: #fffdf7;
  padding: 11px 11px 30px;
  border-radius: 3px;
  box-shadow: 0 12px 30px rgba(var(--ink-rgb), 0.22);
  transform: rotate(-4deg);
  flex-shrink: 0;
}
.test .td-polaroid-tape {
  position: absolute; top: -11px; left: 50%;
  transform: translateX(-50%) rotate(3deg);
  width: 74px; height: 22px;
  background: rgba(190, 172, 120, 0.5);
  box-shadow: 0 1px 3px rgba(var(--ink-rgb), 0.12);
}
.test .td-polaroid-photo {
  width: 170px; height: 134px; border-radius: 2px;
  background: linear-gradient(135deg, #c2a86f 0%, #9a8453 55%, #6f6240 100%);
  display: flex; align-items: center; justify-content: center; font-size: 90px; line-height: 1;
  box-shadow: inset 0 0 18px rgba(var(--ink-rgb), 0.25);
}
.test .td-polaroid-caption {
  font-family: 'Caveat', cursive; font-size: 22px; color: #6b5f48;
  text-align: center; margin-top: 9px; line-height: 1;
}
.test .td-hero-actions { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }

/* ── Stat bar: one horizontal pill — 4 stats + inline level segment ── */
.test .dashboard-stats-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-3d);
  padding: 4px 6px;
  margin-bottom: 24px;
}
.test .xp-bar-container { display: none; }
.test .dash-stat-card {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-light);
  border-radius: 0;
  box-shadow: none;
  flex: 1 1 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 14px;
  padding: 16px 20px;
}
.test .dash-stat-card:hover { transform: none; box-shadow: none; border-color: var(--border-light); }
.test .dash-stat-card::before { display: none; }
.test .dash-stat-emoji { grid-row: 1 / 4; grid-column: 1; font-size: 30px; margin: 0; align-self: center; }
.test .dash-stat-value { grid-column: 2; grid-row: 1; font-size: 28px; letter-spacing: -1px; }
.test .dash-stat-label { grid-column: 2; grid-row: 2; font-size: 11px; }
.test .dash-stat-sub { grid-column: 2; grid-row: 3; margin-top: 2px; }
.test .dash-level-segment {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  flex: 1.5 1 0;
  padding: 16px 22px;
}
.test .dls-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.test .dls-label { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 16px; color: var(--text-primary); }
.test .dls-xp { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.test .dls-bar { height: 8px; background: rgba(var(--ink-rgb), 0.10); border-radius: 99px; overflow: hidden; }
.test .dls-fill { height: 100%; background: var(--gradient-accent); border-radius: 99px; min-width: 2px; transition: width 0.8s ease; }

/* ── Test grid: heatmap | today+reflection  /  tree | achievements ──
   12-col so each row gets its own split: row 2 gives Achievements more
   width and the Writing Tree less. */
.test .dashboard-grid { grid-template-columns: repeat(12, 1fr); align-items: stretch; }
.test .dashboard-grid > .heatmap-section { grid-column: 1 / 8; grid-row: 1; }
.test .dashboard-grid > .td-mid-stack { grid-column: 8 / 13; grid-row: 1; }
.test .dashboard-grid > .tree-container { grid-column: 1 / 6; grid-row: 2; display: flex; flex-direction: column; justify-content: center; }
.test .dashboard-grid > .td-achievements-card { grid-column: 6 / 13; grid-row: 2; }
.test .dashboard-grid > .dashboard-recent { display: none; }   /* Recent Sessions removed */
/* Writing tree: smaller, centred */
.test .tree-container #tree-canvas { max-width: 196px; height: auto; display: block; margin: 0 auto; }

/* Achievements keeps its own panel chrome */
.test .td-achievements-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-3d);
}
/* Today's Progress + Reflection share ONE panel (the mid-stack) */
.test .td-mid-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-3d);
}
.test .td-mid-stack .td-progress-card,
.test .td-mid-stack .td-reflection-card {
  background: none; border: none; box-shadow: none; border-radius: 0; padding: 0;
}
.test .td-mid-stack .td-reflection-card { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-light); }
.test .td-achievements-card h3,
.test .td-reflection-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 15px; font-weight: 600; margin: 0; color: var(--text-primary);
}
/* Today's Progress: no title — ring + text vertically centred */
.test .td-progress-card { display: flex; flex-direction: column; justify-content: center; }
.test .td-progress-body { display: flex; align-items: center; gap: 20px; margin-top: 0; }
.test .td-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.test .td-ring svg { transform: rotate(-90deg); }
.test .td-ring-track { fill: none; stroke: rgba(var(--ink-rgb), 0.10); stroke-width: 9; }
.test .td-ring-fill {
  fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.test .td-ring-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 38px; }
.test .td-progress-text { min-width: 0; }
.test .td-progress-head { font-family: 'Fraunces', Georgia, serif; font-size: 19px; font-weight: 600; color: var(--text-primary); }
.test .td-progress-sub { font-size: 12px; color: var(--text-secondary); margin: 2px 0 10px; }
.test .td-progress-count { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }
.test .td-progress-goal-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }

/* ── Card heads + reflection sticky note (now in the mid-stack) ── */
.test .td-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.test .td-newprompt-btn {
  font-family: var(--font-sans); font-size: 11px; font-weight: 500;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 6px;
}
.test .td-newprompt-btn:hover { color: var(--accent); background: var(--accent-soft); }
.test .td-sticky {
  position: relative;
  background: linear-gradient(175deg, #fcf4c6 0%, #f6eaa8 100%);
  padding: 26px 26px 30px;
  border-radius: 2px;
  box-shadow: 0 10px 22px rgba(var(--ink-rgb), 0.14);
  transform: rotate(-1.2deg);
  margin-top: 14px;
}
.test .td-sticky p { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-size: 21px; color: #5a4a22; line-height: 1.4; margin: 0; }
.test .td-sticky-feather { position: absolute; right: 14px; bottom: 8px; font-size: 22px; opacity: 0.45; }

/* ── Achievements swiper (3 per page, circular indicators) ── */
.test .td-ach-nav { display: flex; gap: 6px; }
.test .td-ach-arrow {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-secondary); cursor: pointer;
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.test .td-ach-arrow:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.test .td-ach-arrow:disabled { opacity: 0.3; cursor: default; }
.test .td-ach-viewport { overflow: hidden; margin-top: 16px; flex: 1 1 auto; min-height: 0; }
.test .td-ach-track { display: flex; height: 100%; transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.test .td-ach-slide { flex: 0 0 100%; min-width: 100%; box-sizing: border-box; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; column-gap: 20px; row-gap: 8px; }
.test .td-ach-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-width: 0; }
/* single column when the panel is narrow */
@media (max-width: 1100px) { .test .td-ach-slide { grid-template-columns: 1fr; } }
.test .td-ach-icon { width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.test .td-ach-meta { flex: 1; min-width: 0; }
.test .td-ach-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.test .td-ach-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.test .td-ach-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
/* Circular progress indicator per achievement */
.test .td-ach-ring { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.test .td-ach-ring svg { transform: rotate(-90deg); display: block; }
.test .td-ach-ring-track { fill: none; stroke: rgba(var(--ink-rgb), 0.12); stroke-width: 4; }
.test .td-ach-ring-fill { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.test .td-ach-ring-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; }
.test .td-ach-ring-icon.done { color: var(--accent); }
.test .td-ach-ring-icon.pending { color: var(--text-muted); font-size: 11px; }
.test .td-ach-dots { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.test .td-ach-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-hover); border: none; cursor: pointer; padding: 0; transition: all 0.25s; }
.test .td-ach-dot.active { background: var(--accent); width: 18px; border-radius: 99px; }

/* ── Footer: centered quote + maker's stamp ── */
.test .td-footer { display: flex; align-items: center; justify-content: center; gap: 30px; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--border-light); }
.test .td-footer-quote { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-size: 18px; color: var(--text-secondary); text-align: center; max-width: 560px; margin: 0; border: none; padding: 0; line-height: 1.5; }
.test .td-footer-quote cite { display: block; font-size: 14px; font-style: normal; color: var(--text-muted); margin-top: 8px; }
.test .td-stamp { flex-shrink: 0; opacity: 0.72; }
.test .td-stamp-ring, .test .td-stamp-ring-inner { fill: none; stroke: var(--accent); stroke-width: 1; opacity: 0.55; }
.test .td-stamp-text { font-family: var(--font-mono); font-size: 7px; letter-spacing: 2px; fill: var(--accent); }
.test .td-stamp-center { font-size: 22px; }

/* ── Responsive: collapse the Test Mode rows on narrow viewports ── */
@media (max-width: 1100px) {
  .test .dashboard-stats-row { flex-wrap: wrap; }
  .test .dash-stat-card { flex: 1 1 40%; }
  .test .dash-level-segment { flex: 1 1 100%; }
  .test .dashboard-grid { grid-template-columns: 1fr; }
  /* Reset the per-panel 12-col placements with MATCHING specificity (0,3,0) so the
     panels actually stack — a universal `> *` reset (0,2,0) loses to them. */
  .test .dashboard-grid > .heatmap-section,
  .test .dashboard-grid > .td-mid-stack,
  .test .dashboard-grid > .tree-container,
  .test .dashboard-grid > .td-achievements-card {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .test .td-footer { flex-direction: column-reverse; gap: 18px; }
  .test .td-hero-aside { display: none; }
}

/* Phones: stack the Today's Progress ring above its text so it never squeezes */
@media (max-width: 480px) {
  .test .td-progress-body { flex-direction: column; align-items: flex-start; gap: 14px; text-align: left; }
}

/* ══════════════════════════════════════════════════════════════
   COLLAPSIBLE SIDEBAR ON DESKTOP (all themes)
   The X in the sidebar header collapses it; a floating menu button
   appears to bring it back. Mobile keeps its existing off-canvas flow.
   ══════════════════════════════════════════════════════════════ */
.main-content { transition: margin-left var(--transition); }
@media (min-width: 769px) {
  /* `.sidebar-header` prefix beats the later base `.sidebar-close-btn{display:none}` */
  .sidebar-header .sidebar-close-btn { display: flex; }
  body.sidebar-collapsed .sidebar { transform: translateX(-100%); box-shadow: none; }
  body.sidebar-collapsed .main-content { margin-left: 0; }
  body.sidebar-collapsed .mobile-sidebar-toggle { display: flex; }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE GATE — the writing app (app.html only) needs a desktop.
   Hidden on larger screens; covers everything on phones.
   ══════════════════════════════════════════════════════════════ */
#mobile-gate { display: none; }
@media (max-width: 768px) {
  #mobile-gate {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: var(--bg-primary);
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
  }
  .mobile-gate-inner { max-width: 360px; }
  .mobile-gate-mark { width: 56px; height: 56px; margin-bottom: 18px; }
  .mobile-gate-logo { font-family: var(--font-wordmark); font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--accent); margin-bottom: 18px; }
  #mobile-gate h1 { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: -0.5px; color: var(--text-primary); line-height: 1.25; margin: 0 0 12px; }
  #mobile-gate p { font-family: var(--font-sans); font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin: 0; }
}

/* ══════════════════════════════════════════════════════════════
   COMMUNITY — Popular Writers sidebar (right side of the feed)
   ══════════════════════════════════════════════════════════════ */
.stories-mode-feed .stories-feed-panel > #stories-feed { min-width: 0; }
.stories-mode-feed .stories-feed-panel > #stories-feed .stories-feed-shell { max-width: none; margin: 0; }
.stories-popular-panel { display: none; }
.stories-mode-feed .stories-popular-panel { display: block; position: sticky; top: 16px; align-self: start; margin-inline-end: 24px; }
.stories-popular-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 10px;
  box-shadow: var(--shadow-3d);
}
.stories-popular-card h3 {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); margin: 0 0 6px;
}
.stories-popular-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none; color: inherit;
}
.stories-popular-item:last-child { border-bottom: none; }
.stories-popular-item:hover .stories-popular-name { color: var(--accent); }
.stories-popular-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  background: var(--gradient-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
}
.stories-popular-meta { flex: 1; min-width: 0; }
.stories-popular-name {
  font-weight: 600; font-size: 13px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s;
}
.stories-popular-handle { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stories-popular-followers { font-size: 11px; color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) {
  .stories-mode-feed .stories-feed-panel { grid-template-columns: 1fr; }
  .stories-mode-feed .stories-popular-panel { display: none; }
}

/* ===== SESSION ANALYTICS ===== */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}
.analytics-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.analytics-stat-value {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.analytics-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
/* PRO badge inline */
.pro-badge-inline {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #000;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  padding: 2px 8px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 8px;
  letter-spacing: 0.5px;
}
/* Records grid */
.analytics-records-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.analytics-record {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.analytics-record-value {
  font-size: 34px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.analytics-record-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.analytics-record-detail {
  font-size: 11px;
  color: var(--text-muted);
}
/* Rhythm hero — award style */
.analytics-rhythm-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(139,92,246,0.08));
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius);
}
.analytics-rhythm-award {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.analytics-rhythm-emoji {
  font-size: 44px;
  filter: drop-shadow(0 4px 12px rgba(245,158,11,0.3));
}
.analytics-rhythm-type {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.2px;
}
.analytics-rhythm-type strong {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  margin-top: 2px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* Milestones */
.analytics-milestones {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.analytics-milestone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}
.analytics-milestone.unlocked {
  background: rgba(74, 222, 128, 0.08);
}
.analytics-milestone-icon { font-size: 20px; flex-shrink: 0; }
.analytics-milestone-info { flex: 1; min-width: 0; }
.analytics-milestone-bar {
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.analytics-milestone-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}
/* Pro locked sections */
.analytics-pro-locked {
  opacity: 1;
}
.analytics-pro-blur-content {
  filter: blur(6px) !important;
  -webkit-filter: blur(6px) !important;
  pointer-events: none !important;
  user-select: none !important;
  opacity: 0.7;
}
.analytics-pro-gate-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  z-index: 2;
  cursor: pointer;
}
.analytics-pro-gate-overlay .upgrade-label {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
.analytics-pro-badge {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #000;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  padding: 2px 12px;
  border-radius: 8px;
  letter-spacing: 1px;
  margin-left: 8px;
  vertical-align: middle;
  line-height: 1;
}
/* Share button */
.btn-share-analytics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent), #059669);
  color: #000;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-share-analytics:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}
.analytics-chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.analytics-chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.analytics-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
}
.analytics-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.analytics-bar {
  width: 100%;
  background: var(--accent-soft);
  border-radius: 4px 4px 0 0;
  transition: background 0.2s;
  min-height: 2px;
}
.analytics-bar:hover { background: var(--accent-glow); }
.analytics-bar-label {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
}
.analytics-hour-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  margin-bottom: 6px;
}
.analytics-hour-cell {
  height: 24px;
  border-radius: 3px;
  background: var(--bg-elevated);
}
.analytics-hour-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
}
/* Streak calendar (GitHub-style grid) */
.analytics-cal-grid {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: 3px;
  margin-bottom: 8px;
}
.analytics-cal-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  cursor: default;
  min-width: 0;
}
.analytics-cal-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 4px;
}
.analytics-pro-gate {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.analytics-pro-gate h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.analytics-pro-gate p {
  font-size: 14px;
  margin-bottom: 24px;
}
.analytics-pro-gate .btn-upgrade-analytics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
/* Analytics date range buttons */
.analytics-range-btns {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 2px;
  border: 1px solid var(--border);
}
.analytics-range-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.analytics-range-btn:hover { color: var(--text-primary); }
.analytics-range-btn.active {
  background: var(--accent);
  color: #000;
}
/* Interactive bar hover */
.analytics-bar-wrap {
  cursor: pointer;
}
.analytics-bar-wrap:hover .analytics-bar {
  filter: brightness(1.3);
}
@media (max-width: 768px) {
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-records-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-hour-grid { grid-template-columns: repeat(12, 1fr); }
  .analytics-cal-grid { grid-template-columns: repeat(10, 1fr); }
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 15px;
}

/* Grid background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

/* Vignette effect */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(0,0,0,0.45) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Ensure content sits above grid and vignette */
.nav, .sidebar, .main-content, .editor-container,
.modal-overlay, .app-container, .auth-container,
.landing, header, footer, section, main {
  position: relative;
  z-index: 2;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: #0a0a0a;
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: var(--maint-banner-h);
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.landing .nav {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  transition: background 0.25s ease, backdrop-filter 0.25s ease, border-color 0.25s ease;
}
.landing .nav.scrolled {
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.85) 0%, rgba(10, 10, 10, 0.65) 100%);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.light.landing .nav.scrolled {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.65) 100%);
}
.sepia.landing .nav.scrolled {
  background: linear-gradient(to bottom, rgba(244, 232, 209, 0.88) 0%, rgba(244, 232, 209, 0.65) 100%);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-shadow: 0 0 16px var(--accent-glow);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  padding-top: 5px;
}
.logo-img-light { display: none; }
html.light .logo-img-dark { display: none; }
html.light .logo-img-light { display: inline; }
.logo-knight {
  width: 20px;
  height: 20px;
  fill: currentColor;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.dream-only-link {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a:not(.btn) {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

.nav-links a:not(.btn):hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

.design-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}

.design-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}

.design-toggle:hover,
.design-toggle[aria-pressed="true"] {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--hover-bg);
  transform: translateY(-1px);
}

.nav-links .mobile-open {
  display: flex;
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  flex-direction: column;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu span {
  width: 18px;
  height: 1.5px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
}

.btn-small {
  padding: 8px 18px;
  font-size: 11px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #0a0a0a;
}

.btn-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74, 222, 128, 0.25);
  background: #86efac;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  border-radius: var(--radius-pill);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(74, 222, 128, 0.3);
  background: #86efac;
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(10px);
}
.btn-ghost.btn-small {
  background: transparent;
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: var(--hover-bg);
  border-color: rgba(74, 222, 128, 0.3);
  transform: translateY(-1px);
  color: var(--accent);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.btn-outline:hover {
  background: var(--hover-bg);
  border-color: var(--border-hover);
}

.btn-large {
  padding: 16px 40px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-full {
  width: 100%;
  padding: 14px 24px;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
}

.btn-danger {
  background: #ef4444;
  color: white;
  border-radius: var(--radius-pill);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
  background: #f87171;
}

/* ===== HERO ===== */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 180px 32px 100px;
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: var(--gradient-hero);
  pointer-events: none;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(60px, 10vw, 120px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -2px;
  margin-bottom: 32px;
  position: relative;
  text-transform: none;
}

.hero-title em {
  font-style: normal;
  color: var(--danger);
  text-shadow: 0 0 40px rgba(239, 68, 68, 0.5);
}

.hero-line {
  display: block;
}

.hero-sub {
  max-width: 480px;
  margin: 0 auto 48px;
  font-size: 19px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.6;
  letter-spacing: -0.2px;
  position: relative;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 100px;
  position: relative;
}

/* Mock Editor */
.hero-visual {
  max-width: 680px;
  margin: 0 auto;
  perspective: 1200px;
  position: relative;
}

.hero-object {
  display: none;
  pointer-events: none;
  user-select: none;
}

.mock-editor {
  background: var(--bg-card);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 50px 100px -20px rgba(0, 10, 0, 0.8), 0 30px 60px -30px rgba(0, 10, 0, 0.5), 0 0 80px rgba(74, 222, 128, 0.08);
  transform: rotateX(4deg);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
}

.mock-editor:hover {
  transform: rotateX(0deg);
  box-shadow: 0 50px 100px -20px rgba(0, 10, 0, 0.8), 0 30px 60px -30px rgba(0, 10, 0, 0.5), 0 0 120px rgba(74, 222, 128, 0.15);
}

.mock-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.mock-dots {
  display: flex;
  gap: 8px;
}

.mock-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.mock-dots span:nth-child(1) { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
.mock-dots span:nth-child(2) { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
.mock-dots span:nth-child(3) { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.3); }

.mock-timer {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

.mock-xp {
  font-size: 13px;
  color: var(--xp-color);
  font-weight: 600;
}

.mock-content {
  padding: 36px 32px;
  min-height: 160px;
  position: relative;
}

.mock-line {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 300;
  line-height: 2.2;
  opacity: 0;
}

.mock-line.typing {
  animation: typeIn 1s ease forwards;
  animation-delay: var(--delay);
}

.mock-cursor {
  display: inline-block;
  width: 2px;
  height: 18px;
  background: var(--accent);
  animation: blink 1s infinite;
  vertical-align: middle;
  margin-top: 8px;
  box-shadow: 0 0 8px var(--accent-glow);
}

@keyframes typeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ===== AD SHOWCASE ===== */
.ad-showcase {
  display: none;
  padding: 110px 32px 120px;
  background:
    radial-gradient(circle at 16% 18%, rgba(239, 68, 68, 0.12), transparent 30%),
    radial-gradient(circle at 86% 76%, rgba(74, 222, 128, 0.1), transparent 26%),
    var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.ad-showcase-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

.ad-copy {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ad-copy.visible {
  opacity: 1;
  transform: translateY(0);
}

.ad-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-glass);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ad-kicker::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.48);
}

.ad-copy h2 {
  margin: 22px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -1.5px;
}

.ad-copy p {
  max-width: 500px;
  color: var(--text-secondary);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.65;
}

.ad-option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 470px;
  margin-top: 30px;
}

.ad-option {
  min-height: 92px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.ad-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), transparent 44%);
  opacity: 0;
  transition: opacity var(--transition);
}

.ad-option:hover::before {
  opacity: 1;
}

.ad-option-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  margin-bottom: 16px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  grid-row: 1 / 3;
}

.ad-option h3 {
  margin: 1px 0 7px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.ad-option p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.ad-video-stage {
  min-height: 430px;
  width: 100%;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.ad-video-stage.visible {
  opacity: 1;
  transform: translateY(0);
}

.ad-video-shell {
  width: min(100%, 860px);
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--bg-card);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.34), 0 0 80px rgba(239, 68, 68, 0.08);
  overflow: hidden;
  transform: rotate(-1.5deg);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

.ad-video-shell:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.4), 0 0 90px rgba(239, 68, 68, 0.12);
}

.ad-video-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.ad-video-bar strong {
  margin-left: auto;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--danger);
}

.ad-dot:nth-child(2) {
  background: #f59e0b;
}

.ad-dot:nth-child(3) {
  background: var(--accent);
}

.ad-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #120a18;
  object-fit: cover;
}

.ad-flight-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.ad-fly {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
  animation: adFloat 7s ease-in-out infinite;
}

.ad-fly-tab {
  top: 8px;
  right: 78px;
  width: 78px;
  height: 42px;
  border-radius: 14px;
  background: #ef4444;
  transform: rotate(9deg);
}

.ad-fly-dm {
  left: 54px;
  top: 118px;
  width: 62px;
  height: 62px;
  border-radius: 20px 20px 20px 7px;
  background: #16a3b8;
  animation-delay: -1.6s;
}

.ad-fly-ai {
  right: 58px;
  bottom: 34px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #7c3aed;
  animation-delay: -3s;
}

.ad-fly-bolt {
  left: 108px;
  bottom: 48px;
  width: 28px;
  height: 66px;
  background: #f59e0b;
  clip-path: polygon(42% 0, 100% 0, 65% 39%, 100% 39%, 20% 100%, 44% 54%, 0 54%);
  animation-delay: -2.4s;
}

.ad-fly-paper {
  top: -20px;
  left: 138px;
  width: 52px;
  height: 68px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 0 16px, rgba(0, 0, 0, 0.12) 17px 25px, transparent 26px),
    repeating-linear-gradient(180deg, transparent 0 12px, rgba(53, 22, 79, 0.26) 13px 14px),
    #fff7ef;
  transform: rotate(-12deg);
  animation-delay: -4.2s;
}

@keyframes adFloat {
  0%, 100% { translate: 0 0; }
  35% { translate: 10px -14px; }
  70% { translate: -8px 10px; }
}

/* ===== DREAM LANDING STYLE ===== */
body.landing.dream-landing {
  --accent-rgb: 251, 104, 106;
  --ink-rgb: 60, 31, 84;
  --dream-image-section-bg:
    linear-gradient(135deg, rgba(255, 248, 242, 0.72), rgba(255, 235, 244, 0.46)),
    url('/media/hero-dream-background.png') center center / cover no-repeat;
  --bg-primary: #fff7ef;
  --bg-secondary: rgba(255, 239, 244, 0.72);
  --bg-card: rgba(255, 255, 255, 0.58);
  --bg-card-hover: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.58);
  --text-primary: #35164f;
  --text-secondary: rgba(76, 45, 92, 0.68);
  --text-muted: rgba(105, 74, 122, 0.46);
  --accent: #fb686a;
  --accent-soft: rgba(251, 104, 106, 0.12);
  --accent-glow: rgba(251, 104, 106, 0.25);
  --danger: #fb686a;
  --border: rgba(105, 74, 122, 0.14);
  --border-light: rgba(255, 255, 255, 0.72);
  --border-hover: rgba(251, 104, 106, 0.32);
  --hover-bg: rgba(255, 255, 255, 0.48);
  --shadow: 0 24px 80px rgba(113, 67, 132, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.68);
  --shadow-lg: 0 34px 90px rgba(108, 65, 126, 0.16);
  --shadow-3d: 0 26px 80px rgba(119, 68, 128, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --gradient-accent: linear-gradient(135deg, #ff6a68 0%, #f2546e 100%);
  --gradient-hero: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.72), transparent 66%);
  background:
    linear-gradient(120deg, rgba(255, 210, 219, 0.48) 0%, rgba(255, 249, 240, 0.94) 35%, rgba(255, 239, 227, 0.8) 68%, rgba(227, 188, 229, 0.66) 100%);
  color: var(--text-primary);
  font-family: 'Nunito', var(--font-sans);
  position: relative;
}

body.landing.dream-landing::before {
  position: absolute;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.72) 1.4px, transparent 1.6px),
    linear-gradient(135deg, rgba(255, 184, 204, 0.42), transparent 33%),
    linear-gradient(315deg, rgba(194, 145, 219, 0.36), transparent 36%);
  background-position: 54px 132px, left top, right top;
  background-size: 22px 22px, 52% 45%, 42% 70%;
  background-repeat: repeat, no-repeat, no-repeat;
}

body.landing.dream-landing::after {
  position: absolute;
  background:
    linear-gradient(105deg, transparent 0 55%, rgba(207, 161, 222, 0.28) 55% 100%),
    radial-gradient(ellipse at 14% 77%, rgba(245, 168, 208, 0.35) 0%, transparent 33%),
    radial-gradient(ellipse at 88% 54%, rgba(188, 140, 212, 0.28) 0%, transparent 34%);
}

body.landing.dream-landing .nav {
  top: 22px;
  left: 50%;
  right: auto;
  width: min(1120px, calc(100% - 48px));
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 24px 80px rgba(118, 75, 134, 0.14);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  overflow: hidden;
}

body.landing.dream-landing .nav.scrolled {
  background: rgba(255, 255, 255, 0.68);
  border-bottom: 1px solid rgba(255, 255, 255, 0.54);
}

body.landing.dream-landing .nav-inner {
  height: 64px;
  max-width: none;
  padding: 0 28px;
}

body.landing.dream-landing .logo {
  color: #35164f;
  font-family: 'Nunito', var(--font-sans);
  font-size: 23px;
  font-weight: 800;
  text-shadow: none;
}

body.landing.dream-landing .logo-img {
  width: 31px;
  height: 31px;
  padding-top: 0;
  filter: drop-shadow(0 8px 12px rgba(251, 104, 106, 0.22));
}

body.landing.dream-landing .logo-knight {
  width: 17px;
  height: 17px;
  fill: #35164f;
  filter: drop-shadow(0 8px 12px rgba(53, 22, 79, 0.16));
}

body.landing.dream-landing .logo-img-dark { display: none; }
body.landing.dream-landing .logo-img-light { display: inline; }

body.landing.dream-landing .nav-links {
  gap: 34px;
}

body.landing.dream-landing .nav-links a:not(.btn) {
  color: rgba(53, 22, 79, 0.82);
  font-family: 'Nunito', var(--font-sans);
  font-size: 14px;
  font-weight: 700;
}

body.landing.dream-landing .nav-links a:not(.btn):hover {
  background: rgba(251, 104, 106, 0.09);
  color: #35164f;
}

body.landing.dream-landing .design-toggle,
body.landing.dream-landing .btn-small {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7371 0%, #f65b70 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(246, 91, 112, 0.28);
  text-transform: none;
  letter-spacing: 0;
}

body.landing.dream-landing .design-toggle {
  background: rgba(255, 255, 255, 0.58);
  color: #6f4d83;
  border: 1px solid rgba(140, 103, 156, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body.landing.dream-landing .design-toggle[aria-pressed="true"],
body.landing.dream-landing .design-toggle:hover {
  background: #fff;
  color: #35164f;
  box-shadow: 0 14px 34px rgba(118, 75, 134, 0.12);
}

body.landing.dream-landing .hero {
  padding-top: 220px;
  padding-bottom: 92px;
  max-width: none;
  min-height: 980px;
  background:
    linear-gradient(180deg, rgba(255, 247, 242, 0.1), rgba(255, 239, 244, 0.24)),
    url('/media/hero-dream-background.png') center top / 100% 100% no-repeat;
  border-bottom: 1px solid rgba(196, 109, 132, 0.16);
  overflow: hidden;
}

body.landing.dream-landing .hero::before {
  display: none;
}

body.landing.dream-landing .hero::after {
  content: '';
  position: absolute;
  top: 156px;
  left: 50%;
  width: 34px;
  height: 34px;
  transform: translateX(-50%) rotate(45deg);
  background: #f65b70;
  border-radius: 9px 0 9px 0;
  box-shadow:
    -36px 0 0 -13px rgba(246, 91, 112, 0.72),
    36px 0 0 -13px rgba(246, 91, 112, 0.72);
}

body.landing.dream-landing .hero-title {
  max-width: 650px;
  margin: 0 auto 22px;
  color: #371555;
  font-family: "Nunito Sans", sans-serif;
  font-size: clamp(64px, 8.5vw, 106px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-shadow: 0 12px 30px rgba(55, 21, 85, 0.13);
}

body.landing.dream-landing .hero-title em {
  color: #fb686a;
  text-shadow: 0 18px 34px rgba(251, 104, 106, 0.28);
}

body.landing.dream-landing .hero-sub {
  max-width: 560px;
  margin-bottom: 30px;
  color: rgba(73, 44, 91, 0.68);
  font-family: 'Nunito', var(--font-sans);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.52;
  letter-spacing: 0;
}

body.landing.dream-landing .hero-actions {
  margin-bottom: 38px;
}

body.landing.dream-landing .btn {
  font-family: 'Nunito', var(--font-sans);
  text-transform: none;
  letter-spacing: 0;
}

body.landing.dream-landing .btn-primary {
  background: linear-gradient(135deg, #ff7371 0%, #f65b70 100%);
  color: #fff;
  box-shadow: 0 16px 36px rgba(246, 91, 112, 0.28);
}

body.landing.dream-landing .btn-primary:hover {
  background: linear-gradient(135deg, #ff827c 0%, #f65b70 100%);
  box-shadow: 0 20px 46px rgba(246, 91, 112, 0.34);
}

body.landing.dream-landing .btn-ghost {
  color: #76518b;
  border-color: rgba(118, 81, 139, 0.22);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.landing.dream-landing .btn-ghost:hover {
  color: #35164f;
  border-color: rgba(251, 104, 106, 0.24);
  background: rgba(255, 255, 255, 0.72);
}

body.landing.dream-landing .hero-visual {
  max-width: 735px;
  transform: translateY(-8px);
}

body.landing.dream-landing .hero-visual::before,
body.landing.dream-landing .hero-visual::after {
  display: none;
}

body.landing.dream-landing .hero-title,
body.landing.dream-landing .hero-sub,
body.landing.dream-landing .hero-actions,
body.landing.dream-landing .hero-visual {
  position: relative;
  z-index: 2;
}

body.landing.dream-landing .hero-object {
  display: block;
  position: absolute;
  z-index: 1;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 28px 42px rgba(136, 73, 116, 0.18));
  animation: dreamObjectFloat 8s ease-in-out infinite;
}

body.landing.dream-landing .hero-object-vase {
  width: clamp(238px, 22vw, 350px);
  left: clamp(44px, 5.4vw, 108px);
  bottom: -14px;
}

body.landing.dream-landing .hero-object-notebook {
  width: clamp(260px, 24vw, 390px);
  right: clamp(42px, 5vw, 96px);
  bottom: 8px;
  animation-delay: -1.5s;
}

body.landing.dream-landing .mock-editor {
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow:
    0 26px 70px rgba(117, 71, 132, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transform: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.landing.dream-landing .mock-editor:hover {
  transform: translateY(-4px);
  box-shadow:
    0 34px 86px rgba(117, 71, 132, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body.landing.dream-landing .mock-toolbar {
  padding: 18px 24px;
  border-bottom: 0;
  background: rgba(247, 223, 237, 0.68);
}

body.landing.dream-landing .mock-dots span:nth-child(1) { background: #ff646a; }
body.landing.dream-landing .mock-dots span:nth-child(2) { background: #ffc35f; }
body.landing.dream-landing .mock-dots span:nth-child(3) { background: #9369e8; }

body.landing.dream-landing .mock-timer,
body.landing.dream-landing .mock-xp {
  color: #4b2d60;
  font-family: 'Nunito', var(--font-sans);
  font-weight: 800;
}

body.landing.dream-landing .mock-xp {
  color: #8758e7;
}

body.landing.dream-landing .mock-content {
  margin: 0 20px 20px;
  padding: 52px 32px 46px;
  min-height: 210px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.landing.dream-landing .mock-line {
  color: rgba(53, 22, 79, 0.78);
  font-family: 'Nunito', var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

body.landing.dream-landing .mock-cursor {
  display: block;
  margin: 14px auto 0;
  background: #8758e7;
  box-shadow: 0 0 12px rgba(135, 88, 231, 0.34);
}

body.landing.dream-landing .dream-only-link {
  display: inline-flex;
}

body.landing.dream-landing .ad-showcase {
  display: block;
  padding-top: 96px;
  padding-bottom: 132px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.76) 0 10%, transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(126, 213, 222, 0.38), transparent 27%),
    radial-gradient(circle at 70% 82%, rgba(251, 93, 108, 0.18), transparent 28%),
    linear-gradient(135deg, #ffe1e6 0%, #fff6e8 46%, #ead7f2 100%);
}

body.landing.dream-landing .ad-showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 43%, rgba(255, 255, 255, 0.42) 43% 58%, transparent 58%),
    radial-gradient(circle at 64px 64px, rgba(251, 104, 106, 0.18) 0 3px, transparent 4px);
  background-size: auto, 34px 34px;
  pointer-events: none;
  opacity: 0.68;
}

body.landing.dream-landing .ad-showcase-inner {
  max-width: 980px;
}

body.landing.dream-landing .ad-video-stage {
  min-height: 560px;
}

body.landing.dream-landing .ad-video-shell {
  width: min(100%, 920px);
  border-radius: 34px;
  transform: rotate(-0.7deg);
}

body.landing.dream-landing .ad-kicker {
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(255, 255, 255, 0.68);
  color: #fb5d6c;
  font-family: 'Nunito', var(--font-sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

body.landing.dream-landing .ad-kicker::before {
  background: #7ed5de;
  box-shadow: 0 0 16px rgba(126, 213, 222, 0.6);
}

body.landing.dream-landing .ad-copy h2 {
  color: #35164f;
  font-family: 'Baloo 2', 'Nunito', var(--font-display);
  font-size: clamp(46px, 5vw, 76px);
  letter-spacing: 0;
  text-shadow: 0 12px 30px rgba(55, 21, 85, 0.1);
}

body.landing.dream-landing .ad-copy p {
  color: rgba(76, 45, 92, 0.68);
  font-family: 'Nunito', var(--font-sans);
  font-size: 18px;
  font-weight: 600;
}

body.landing.dream-landing .ad-option {
  min-height: 96px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.58);
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow: 0 18px 42px rgba(117, 71, 132, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.landing.dream-landing .ad-option:nth-child(2) {
  background: #fff8fb;
}

body.landing.dream-landing .ad-option:nth-child(3) {
  background: rgba(238, 250, 249, 0.72);
}

body.landing.dream-landing .ad-option-num {
  background: rgba(251, 93, 108, 0.13);
  color: #fb5d6c;
  font-family: 'Nunito', var(--font-sans);
}

body.landing.dream-landing .ad-option h3 {
  color: #35164f;
  font-family: 'Baloo 2', 'Nunito', var(--font-display);
  font-size: 20px;
  letter-spacing: 0;
}

body.landing.dream-landing .ad-option p {
  color: rgba(76, 45, 92, 0.6);
  font-family: 'Nunito', var(--font-sans);
  font-size: 13px;
  font-weight: 700;
}

body.landing.dream-landing .ad-video-stage {
  min-height: 470px;
}

body.landing.dream-landing .ad-video-shell {
  border: 3px solid rgba(255, 255, 255, 0.76);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 30px 84px rgba(117, 71, 132, 0.18), 0 0 0 12px rgba(255, 255, 255, 0.22);
}

body.landing.dream-landing .ad-video-bar {
  background: rgba(247, 223, 237, 0.78);
  border-bottom-color: rgba(255, 255, 255, 0.62);
}

body.landing.dream-landing .ad-video-bar strong {
  color: #6f4d83;
  font-family: 'Nunito', var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
}

body.landing.dream-landing .ad-dot:nth-child(1) { background: #ff646a; }
body.landing.dream-landing .ad-dot:nth-child(2) { background: #ffc35f; }
body.landing.dream-landing .ad-dot:nth-child(3) { background: #7ed5de; }

body.landing.dream-landing .ad-fly-tab {
  background: #fb5d6c;
}

body.landing.dream-landing .ad-fly-dm {
  background: #7ed5de;
  color: #35164f;
}

body.landing.dream-landing .ad-fly-ai {
  background: #8b5cf6;
}

body.landing.dream-landing .ad-fly-bolt {
  background: #ffbf57;
}

body.landing.dream-landing .ad-fly-paper {
  box-shadow: 0 18px 34px rgba(117, 71, 132, 0.18);
}

body.landing.dream-landing .ad-fly {
  box-shadow: 0 18px 34px rgba(117, 71, 132, 0.2);
}

body.landing.dream-landing .ad-video {
  background: #fff7ef;
}

body.landing.dream-landing .ad-video-shell::after {
  content: '';
  position: absolute;
  inset: 54px 0 0;
  border-radius: 0 0 27px 27px;
  background: linear-gradient(135deg, rgba(251, 93, 108, 0.1), transparent 32%, rgba(126, 213, 222, 0.13));
  pointer-events: none;
}

@media (max-width: 980px) {
  .ad-showcase-inner,
  body.landing.dream-landing .ad-showcase-inner {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .ad-copy {
    text-align: center;
  }

  .ad-copy p {
    margin-left: auto;
    margin-right: auto;
  }

  .ad-option-grid {
    margin-left: auto;
    margin-right: auto;
  }

  .ad-video-stage {
    min-height: auto;
  }
}

body.landing.dream-landing .stats-bar,
body.landing.dream-landing .features,
body.landing.dream-landing .how-it-works,
body.landing.dream-landing .growth-section,
body.landing.dream-landing .landing-pricing,
body.landing.dream-landing .cta,
body.landing.dream-landing .footer {
  border-color: rgba(118, 81, 139, 0.12);
}

body.landing.dream-landing .stats-bar {
  background:
    radial-gradient(circle at 18% 34%, rgba(255, 255, 255, 0.74), transparent 25%),
    radial-gradient(circle at 82% 42%, rgba(126, 213, 222, 0.26), transparent 30%),
    radial-gradient(circle at 54% 88%, rgba(251, 93, 108, 0.18), transparent 28%),
    linear-gradient(135deg, #ffd9e0 0%, #fff3e7 52%, #eadcf4 100%);
}

body.landing.dream-landing .how-it-works {
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 191, 87, 0.22), transparent 28%),
    radial-gradient(circle at 85% 72%, rgba(251, 93, 108, 0.18), transparent 30%),
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.68), transparent 25%),
    linear-gradient(135deg, #fff1e8 0%, #ffe0e8 48%, #eef8f7 100%);
}

body.landing.dream-landing .growth-section {
  max-width: none;
  background:
    radial-gradient(circle at 17% 24%, rgba(126, 213, 222, 0.34), transparent 28%),
    radial-gradient(circle at 82% 68%, rgba(139, 92, 246, 0.18), transparent 30%),
    radial-gradient(circle at 48% 8%, rgba(255, 255, 255, 0.62), transparent 24%),
    linear-gradient(135deg, #effafa 0%, #f8d7e8 48%, #fff2dc 100%);
}

body.landing.dream-landing .growth-section .section-header,
body.landing.dream-landing .growth-chart-wrap {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

body.landing.dream-landing .landing-pricing {
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.72), transparent 24%),
    radial-gradient(circle at 78% 22%, rgba(255, 191, 87, 0.24), transparent 28%),
    radial-gradient(circle at 68% 78%, rgba(126, 213, 222, 0.2), transparent 30%),
    linear-gradient(135deg, #f5e0f2 0%, #fff7ea 52%, #ffe1e5 100%);
}

body.landing.dream-landing .features {
  background:
    radial-gradient(circle at 12% 28%, rgba(251, 93, 108, 0.18), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(255, 191, 87, 0.2), transparent 26%),
    linear-gradient(135deg, #fff8f1 0%, #ffe4eb 52%, #edf7f6 100%);
  max-width: none;
}

body.landing.dream-landing .features .section-header,
body.landing.dream-landing .features-grid {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

body.landing.dream-landing .cta {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.72), transparent 24%),
    radial-gradient(circle at 78% 64%, rgba(126, 213, 222, 0.26), transparent 28%),
    linear-gradient(135deg, #ffe6e3 0%, #fff7eb 50%, #e9dcf5 100%);
}

body.landing.dream-landing .footer {
  background:
    radial-gradient(circle at 18% 18%, rgba(251, 93, 108, 0.18), transparent 30%),
    radial-gradient(circle at 86% 72%, rgba(126, 213, 222, 0.14), transparent 28%),
    linear-gradient(135deg, #271136 0%, #3b184b 48%, #2b234f 100%);
  color: rgba(255, 247, 252, 0.9);
  border-top-color: rgba(255, 255, 255, 0.1);
}

body.landing.dream-landing .feature-card,
body.landing.dream-landing .step,
body.landing.dream-landing .growth-chart-wrap,
body.landing.dream-landing .upgrade-card {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: 0 24px 70px rgba(117, 71, 132, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.landing.dream-landing .steps {
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr) 76px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}

body.landing.dream-landing .step {
  width: 100%;
  min-height: 350px;
  aspect-ratio: 0.94 / 1;
  border-radius: 42px;
  padding: 34px 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.landing.dream-landing .step::before {
  display: none;
}

body.landing.dream-landing .step-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 22px;
  border-radius: 32px;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.72), transparent 22%),
    linear-gradient(135deg, #ff7371 0%, #8b5cf6 100%);
  box-shadow: 0 18px 36px rgba(117, 71, 132, 0.2);
  animation: dreamStepPulse 3.6s ease-in-out infinite;
}

body.landing.dream-landing .step:nth-child(3) .step-icon {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.72), transparent 22%),
    linear-gradient(135deg, #7ed5de 0%, #8b5cf6 100%);
  animation-delay: 0.25s;
}

body.landing.dream-landing .step:nth-child(5) .step-icon {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.72), transparent 22%),
    linear-gradient(135deg, #ffbf57 0%, #fb5d6c 100%);
  animation-delay: 0.5s;
}

body.landing.dream-landing .step-icon svg {
  width: 46px;
  height: 46px;
}

body.landing.dream-landing .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 34px;
  border-radius: 999px;
  margin-bottom: 16px;
  background: rgba(251, 93, 108, 0.12);
  font-size: 15px;
  opacity: 1;
}

body.landing.dream-landing .step h3 {
  font-family: 'Baloo 2', 'Nunito', var(--font-display);
  min-height: 34px;
  font-size: 25px;
  letter-spacing: 0;
}

body.landing.dream-landing .step p {
  max-width: 230px;
  min-height: 68px;
}

body.landing.dream-landing .step-arrow {
  width: 76px;
  height: 76px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  color: #fb5d6c;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 42px rgba(117, 71, 132, 0.1);
  opacity: 0.8;
  padding-top: 0;
  font-weight: 800;
  font-size: 28px;
  margin: 0;
}

body.landing.dream-landing .feature-icon {
  background: rgba(251, 104, 106, 0.1);
  color: #fb686a;
}

body.landing.dream-landing .section-header h2,
body.landing.dream-landing .cta h2 {
  color: #35164f;
  font-family: 'Baloo 2', 'Nunito', var(--font-display);
  letter-spacing: 0;
}

body.landing.dream-landing .section-header h2 em,
body.landing.dream-landing .stat-num,
body.landing.dream-landing .step-num {
  color: #fb686a;
  text-shadow: 0 12px 28px rgba(251, 104, 106, 0.18);
}

body.landing.dream-landing .section-header p,
body.landing.dream-landing .feature-card p,
body.landing.dream-landing .step p,
body.landing.dream-landing .footer {
  color: rgba(76, 45, 92, 0.66);
}

body.landing.dream-landing .growth-chart-wrap {
  background:
    radial-gradient(circle at 18% 12%, rgba(34, 197, 94, 0.12), transparent 26%),
    rgba(255, 248, 251, 0.72);
  border-color: rgba(34, 197, 94, 0.22);
}

body.landing.dream-landing .growth-total-num {
  color: #16a34a;
  text-shadow: 0 12px 28px rgba(34, 197, 94, 0.18);
}

body.landing.dream-landing .growth-total-label {
  color: rgba(53, 22, 79, 0.62);
}

body.landing.dream-landing .upgrade-card {
  background: #fff7fb;
  border-color: rgba(98, 52, 118, 0.16);
}

body.landing.dream-landing .upgrade-card-featured {
  border-color: #fb5d6c;
  box-shadow: 0 0 0 1px rgba(251, 93, 108, 0.18), 0 24px 70px rgba(251, 93, 108, 0.14);
}

body.landing.dream-landing .upgrade-card-name,
body.landing.dream-landing .upgrade-card-price {
  color: #35164f;
}

body.landing.dream-landing .upgrade-price-original {
  background: none;
  -webkit-text-fill-color: #a76893;
  color: #a76893;
}

body.landing.dream-landing .upgrade-price-original::after {
  background: #fb5d6c;
}

body.landing.dream-landing .upgrade-card-btn {
  background: #35164f;
  color: #fff;
  border-color: #35164f;
  box-shadow: 0 14px 28px rgba(53, 22, 79, 0.16);
}

body.landing.dream-landing .upgrade-card-btn-primary {
  background: linear-gradient(135deg, #ff7371 0%, #f65b70 100%);
  color: #fff;
  box-shadow: 0 16px 34px rgba(246, 91, 112, 0.25);
}

body.landing.dream-landing .upgrade-card-features li::before {
  background: #fb5d6c;
  color: #fff;
}

body.landing.dream-landing .footer .logo,
body.landing.dream-landing .footer .logo-knight {
  color: #fff7fc;
  fill: #fff7fc;
}

body.landing.dream-landing .footer .logo-knight {
  width: 20px;
  height: 20px;
}

body.landing.dream-landing .footer-brand p,
body.landing.dream-landing .footer-col h4,
body.landing.dream-landing .footer-col a,
body.landing.dream-landing .footer-bottom p {
  color: rgba(255, 247, 252, 0.68);
}

body.landing.dream-landing .footer-col a:hover {
  color: #fff;
}

body.landing.dream-landing .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.1);
}

@keyframes dreamObjectFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

@keyframes dreamStepPulse {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

/* ===== STATS BAR ===== */
.stats-bar {
  background: var(--bg-secondary);
  padding: 72px 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
}

.stat {
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--text-primary);
  text-shadow: 0 0 30px var(--accent-glow);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 500;
  font-family: var(--font-mono);
  margin-top: 6px;
}

/* ===== FEATURES ===== */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 80px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  line-height: 1.0;
}

.section-header h2 em {
  font-style: normal;
  color: var(--accent);
}

.section-header p {
  font-size: 17px;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: -0.2px;
}

.features {
  max-width: 1080px;
  margin: 0 auto;
  padding: 140px 32px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  padding: 40px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(30px);
  box-shadow: var(--shadow-3d);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74,222,128,0.22), transparent);
}

.feature-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-6px);
  box-shadow: 0 30px 60px rgba(0, 10, 0, 0.5), 0 0 60px rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.25);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.2);
}

.feature-card:hover .feature-icon svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.feature-card:hover p {
  color: var(--text-secondary);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  padding: 11px;
  background: var(--accent-soft);
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-icon svg {
  width: 100%;
  height: 100%;
  transition: all var(--transition);
  stroke: var(--accent);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
  line-height: 1.15;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 300;
  transition: all var(--transition);
}

/* ===== HOW IT WORKS ===== */
.how-it-works {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 140px 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.how-it-works::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(74,222,128,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.steps {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.step {
  flex: 1;
  text-align: center;
  padding: 48px 32px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.visible {
  opacity: 1;
  transform: translateY(0);
}

.step-num {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.2;
  margin-bottom: 16px;
  line-height: 1;
}

.step h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.step p {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
}

.step-arrow {
  font-size: 24px;
  color: var(--accent);
  opacity: 0.25;
  padding-top: 72px;
  font-weight: 300;
}

/* ===== CTA ===== */
/* Releases section */
/* ===== GROWTH CHART ===== */
.growth-section {
  padding: 100px 32px 60px;
  max-width: 800px;
  margin: 0 auto;
}
.growth-chart-wrap {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px 24px;
  margin-top: 40px;
}
#growth-chart {
  width: 100%;
  height: auto;
  display: block;
}
.growth-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  gap: 4px;
}
.growth-total-num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}
.growth-total-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== RELEASES CAROUSEL ===== */
.releases {
  padding: 80px 0 100px;
  max-width: 100%;
  overflow: hidden;
}
.releases-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto 40px;
  padding: 0 32px;
}
.releases .section-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  margin: 0;
}
.releases-counter {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}
.releases-counter-slash {
  color: var(--text-muted);
  margin: 0 2px;
}
#release-total {
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 500;
}
.releases-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}
.releases-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
}
.releases-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.15, 1);
  will-change: transform;
}
.release-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  flex: 0 0 56%;
  margin: 0 2%;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.15, 1);
  opacity: 0.55;
  transform: scale(0.9);
}
.release-card.active {
  opacity: 1;
  transform: scale(1);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.15), 0 8px 40px rgba(0, 0, 0, 0.4);
}
.releases-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}
.releases-arrow:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(74, 222, 128, 0.08);
}
.releases-arrow:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}
.releases-arrow-left { left: 8px; }
.releases-arrow-right { right: 8px; }
.releases-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.releases-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--text-muted);
  opacity: 0.3;
  cursor: pointer;
  transition: all 0.35s ease;
  border: none;
  padding: 0;
}
.releases-dot.active {
  width: 24px;
  background: var(--accent);
  opacity: 1;
}
.release-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.release-version {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}
.release-date {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.release-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.release-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}
.release-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.release-list li strong {
  color: var(--text-primary);
}

/* ===== LANDING PRICING ===== */
.landing-pricing {
  padding: 100px 32px;
  position: relative;
}
.landing-pricing-container {
  max-width: 820px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  background: var(--bg-secondary);
  position: relative;
  box-shadow: 0 0 80px rgba(74, 222, 128, 0.04), var(--shadow);
}
.landing-pricing-container::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(74, 222, 128, 0.02), rgba(74, 222, 128, 0.1));
  -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;
  pointer-events: none;
}
.landing-pricing-header {
  text-align: center;
  margin-bottom: 40px;
}
.landing-pricing-header h2 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.landing-pricing-header p {
  color: var(--text-secondary);
  font-size: 15px;
}
.landing-pricing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 75%;
  margin: 0 auto;
}
.landing-plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  background: var(--bg-card);
  position: relative;
  transition: all 0.3s ease;
}
.landing-plan-card:hover {
  border-color: var(--border-hover);
}
.landing-plan-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.12), 0 4px 32px rgba(74, 222, 128, 0.08);
}
.landing-plan-popular {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-accent);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.landing-plan-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.landing-plan-price {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 6px;
}
.landing-plan-original {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-left: 10px;
  margin-bottom: 6px;
  vertical-align: baseline;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-plan-original::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 52%;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  pointer-events: none;
}
.landing-plan-original-dollar,
.landing-plan-original-num {
  font-size: inherit;
}
.landing-plan-uzs {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
  margin-bottom: 24px;
}
.landing-plan-6mo {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
}
.landing-plan-6mo strong {
  color: var(--accent);
}
.landing-plan-6mo span {
  opacity: 0.7;
}
.landing-plan-currency {
  font-size: 22px;
  vertical-align: super;
  font-weight: 600;
  letter-spacing: 0;
}
.landing-plan-period {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}
.landing-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.landing-plan-features li {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 22px;
  position: relative;
  line-height: 1.4;
}
.landing-plan-features li::before {
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 13px;
}
.landing-plan-features li.yes::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 700;
}
.landing-plan-features li.no {
  color: var(--text-muted);
  opacity: 0.5;
}
.landing-plan-features li.no::before {
  content: '\2717';
  color: var(--text-muted);
}
.landing-plan-btn {
  display: block;
  text-align: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  text-decoration: none;
  transition: all 0.25s ease;
  border: 1px solid var(--border);
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.landing-plan-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.landing-plan-btn.primary {
  background: var(--gradient-accent);
  color: #0a0a0a;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(74, 222, 128, 0.25);
}
.landing-plan-btn.primary:hover {
  box-shadow: 0 6px 28px rgba(74, 222, 128, 0.35);
  transform: translateY(-1px);
}

.cta {
  text-align: center;
  padding: 160px 32px;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(74,222,128,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 40px;
  line-height: 1.0;
  position: relative;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 64px 32px 32px;
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  margin-bottom: 48px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
  font-weight: 300;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  transition: color var(--transition);
  font-weight: 300;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  max-width: 1080px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ===== APP LAYOUT ===== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Mobile hamburger button — hidden on desktop */
.mobile-sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 9600;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  box-shadow: var(--shadow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When sidebar is open, hide fixed hamburger — close button is in sidebar header */
.mobile-sidebar-toggle.open {
  opacity: 0;
  pointer-events: none;
}

/* Story back-arrow mode: replace hamburger lines with SVG arrow */
.mobile-sidebar-toggle.story-back-mode {
  gap: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.mobile-sidebar-toggle.story-back-mode svg {
  display: block;
  color: var(--text-primary);
}

/* Close button inside sidebar header (hidden on desktop) */
.sidebar-close-btn {
  display: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.sidebar-close-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}
.mobile-sidebar-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}
.mobile-sidebar-toggle.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.mobile-sidebar-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-sidebar-toggle.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile sidebar backdrop overlay — hidden on desktop */
.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9400;
}

.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--maint-banner-h);
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.version-tag {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
}

.sidebar-nav-item:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

.sidebar-nav-item.active {
  background: rgba(74, 222, 128, 0.1);
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.2);
  box-shadow: inset 0 0 16px rgba(74, 222, 128, 0.06);
}

.sidebar-nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 12px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.user-level {
  font-size: 11px;
  color: var(--xp-color);
  font-weight: 500;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 40px;
  min-height: 100vh;
  background: var(--bg-primary);
}
body.public-profile .main-content { padding-top: 0; }

/* ===== DASHBOARD ===== */
.dashboard-header {
  margin-bottom: 40px;
}

.dashboard-header h1 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.0;
}

.dashboard-header p {
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 300;
  font-size: 15px;
}
#view-leaderboard .dashboard-header p { color: var(--text-primary); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3d);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74,222,128,0.18), transparent);
}

.stat-card-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 10px;
}

.stat-card-value {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}

.stat-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 300;
}

/* ===== TREE VISUALIZATION ===== */
.tree-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px 16px;
  margin-bottom: 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-3d);
}

.tree-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74,222,128,0.18), transparent);
}

.tree-container h3 {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.tree-canvas {
  width: 200px;
  height: 240px;
  margin: 0 auto 16px;
  position: relative;
}

.tree-info {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
}

.tree-stage-label {
  font-weight: 700;
  color: var(--xp-color);
}

/* ===== XP BAR ===== */
.xp-bar-container {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
}

.xp-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.xp-bar-level {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}

.xp-bar-progress-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
}

.xp-bar {
  height: 8px;
  background: var(--hover-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  min-width: 2px;
  transition: width 0.8s ease;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ===== DOCUMENTS LIST ===== */
.docs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.docs-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.session-search-wrap {
  position: relative;
  margin-bottom: 16px;
}
.session-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.session-search {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-main);
  outline: none;
  transition: border-color var(--transition);
}
.session-search:focus {
  border-color: var(--accent);
}
.session-search::placeholder {
  color: var(--text-muted);
}

.doc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}

.doc-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(74, 222, 128, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 10, 0, 0.4), 0 0 30px rgba(74, 222, 128, 0.08);
}

.doc-card:hover .doc-card-meta {
  color: var(--text-secondary);
}

.doc-card:hover .doc-action-btn {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.doc-card.doc-failed {
  opacity: 0.6;
  cursor: default;
  border-left: 3px solid var(--danger);
}

.doc-card.doc-failed:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: var(--border);
  border-left-color: var(--danger);
}

.doc-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.doc-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-icon svg {
  width: 16px;
  height: 16px;
}
.doc-icon.doc-icon-completed { background: rgba(74, 222, 128, 0.15); color: var(--accent); }
.doc-icon.doc-icon-failed { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.doc-icon.doc-icon-draft { background: rgba(149, 165, 166, 0.15); color: var(--text-muted); }
.doc-icon.doc-icon-dangerous { background: rgba(243, 156, 18, 0.15); color: #f39c12; }
.doc-card-text {
  min-width: 0;
  flex: 1;
}
.doc-card-info h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  transition: all var(--transition);
}

.doc-card-actions {
  display: flex;
  gap: 6px;
}

.doc-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.doc-action-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.doc-action-btn.delete:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

/* ===== FRIEND CARDS ===== */
/* Friends sort row */
.friends-sort-row {
  display: flex;
  gap: 4px;
}
.friends-sort-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.friends-sort-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}
.friends-sort-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Friends pager */
.friends-pager {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.friends-page-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.friends-page-btn:hover {
  border-color: var(--border-hover);
  background: var(--hover-bg);
}
.friends-page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.friend-card .doc-card-info {
  align-items: flex-start;
  gap: 1px;
  flex-direction: column;
}

.friend-handle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.friend-stats {
  display: flex;
  gap: 12px;
  margin-top: 2px;
}

.friend-stat {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.friend-stat svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.section-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 6px;
}
.section-icon svg {
  width: 20px;
  height: 20px;
}

/* ===== STORIES REFINEMENT ===== */
.stories-view {
  min-height: calc(100vh - 160px);
}

.stories-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.stories-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stories-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.stories-icon-btn:hover {
  color: var(--text-primary);
  border-color: rgba(74, 222, 128, 0.28);
  background: transparent;
}

.dark .stories-icon-btn {
  background: transparent;
}

.stories-primary-btn,
.stories-save-btn,
.stories-submit-btn {
  min-height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.stories-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.stories-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stories-filter-btn {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: var(--transition);
}

.stories-filter-btn:hover,
.stories-filter-btn.active {
  border-color: rgba(74, 222, 128, 0.24);
  color: var(--text-primary);
  background: rgba(74, 222, 128, 0.08);
}

.stories-toolbar-note {
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.stories-layout,
.stories-feed-panel,
.stories-detail-panel {
  min-height: 560px;
}

.stories-mode-feed .stories-feed-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
  align-items: start;
}

.stories-mode-feed .stories-detail-panel {
  display: none;
}

.stories-mode-read .stories-feed-panel,
.stories-mode-compose .stories-feed-panel {
  display: none;
}

.stories-mode-read .stories-detail-panel,
.stories-mode-compose .stories-detail-panel {
  display: block;
}

.stories-shell {
  max-width: 980px;
  margin: 0 auto;
}

.stories-lead {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.stories-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.stories-lead h2,
.story-feed-item h3,
.story-detail-title,
.story-title-input-plain {
  font-family: var(--font-display);
}

.stories-lead h2 {
  margin: 10px 0 8px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 0.98;
}

.stories-lead p {
  margin: 0;
  max-width: 720px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.stories-list {
  display: flex;
  flex-direction: column;
}

.story-feed-item {
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: var(--transition);
}

.story-feed-item:hover {
  transform: translateX(2px);
}

.story-feed-item-head,
.story-feed-item-badges,
.story-reader-topbar,
.story-detail-actions,
.story-reader-byline,
.story-comments-head,
.story-comment-card-head,
.story-comment-actions,
.story-comment-meta,
.story-comment-form-actions,
.story-composer-topbar,
.story-composer-topbar-left,
.story-composer-top-actions,
.story-composer-footer,
.story-composer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.story-feed-item-head {
  justify-content: space-between;
  align-items: flex-start;
}

.story-feed-item h3 {
  margin: 10px 0 8px;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.08;
}

.story-feed-excerpt,
.story-detail-dek,
.story-compose-note,
.story-comment-form-actions span,
.story-comments-head p,
.stories-group-head p {
  color: var(--text-secondary);
}

.story-feed-excerpt {
  margin: 0 0 10px;
  max-width: 740px;
  font-size: 14px;
  line-height: 1.75;
}

.story-feed-item-side {
  display: none;
}

/* --- Featured Hero Card --- */
.story-hero-card {
  padding: 32px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: var(--transition);
}

.story-hero-card h3 {
  margin: 12px 0 10px;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.05;
  font-family: var(--font-display);
  font-weight: 800;
}

.story-hero-card .story-feed-excerpt {
  font-size: 16px;
  line-height: 1.7;
  max-width: 640px;
  color: var(--text-secondary);
}

.story-hero-card .story-meta-line {
  margin-top: 14px;
}


/* --- Read More Button --- */
.stories-read-more-btn {
  display: block;
  width: 100%;
  padding: 16px;
  margin: 16px 0 32px;
  background: var(--hover-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.stories-read-more-btn:hover { background: var(--active-bg); border-color: var(--accent); }

/* --- Skeleton Loading Cards --- */
.story-skeleton-list {
  display: flex;
  flex-direction: column;
}

.story-skeleton-card {
  padding: 24px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.story-skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.story-skeleton-line.skeleton-author {
  width: 140px;
  height: 10px;
  margin-bottom: 14px;
}

.story-skeleton-line.skeleton-title {
  width: 75%;
  height: 20px;
  margin-bottom: 10px;
}

.story-skeleton-line.skeleton-excerpt {
  width: 90%;
  height: 12px;
  margin-bottom: 8px;
}

.story-skeleton-line.skeleton-excerpt-short {
  width: 60%;
  height: 12px;
  margin-bottom: 14px;
}

.story-skeleton-line.skeleton-meta {
  width: 180px;
  height: 10px;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- PRO Badge --- */
.pro-nav-badge {
  font-size: 9px;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: auto;
}

.story-feed-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.story-feed-note,
.story-moderation-note {
  margin-top: 12px;
  padding-left: 12px;
  border-left: 2px solid rgba(245, 158, 11, 0.5);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.story-meta-line,
.story-reader-social-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.story-meta-divider {
  color: var(--text-muted);
  font-size: 10px;
  margin: 0 4px;
}

.story-author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.story-author-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.16), rgba(34, 197, 94, 0.28));
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.story-author-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-author-copy {
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.story-author-copy strong {
  font-size: 13px;
  color: var(--text-primary);
}

.story-author-copy span {
  font-size: 12px;
  color: var(--text-muted);
}

.story-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.story-status-badge.success {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
}

.story-status-badge.warning {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.story-status-badge.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.story-status-badge.muted {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}

.stories-group-section + .stories-group-section {
  margin-top: 28px;
}

.stories-group-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}

.stories-group-head h3 {
  margin: 0;
  font-size: 22px;
  font-family: var(--font-display);
}

.stories-group-head p {
  margin: 4px 0 0;
  font-size: 13px;
}

.stories-group-count {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.story-empty-inline {
  padding: 14px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.story-reader-shell,
.story-composer-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 0 36px;
  position: relative;
}

.story-reader-topbar,
.story-composer-topbar {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
}

.stories-back-btn {
  margin-right: 2px;
}

.story-like-btn {
  gap: 7px;
  width: auto;
  padding: 0 12px;
  border-radius: 999px;
}

.stories-inline-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.stories-inline-btn:hover {
  color: var(--text-primary);
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.08);
}

.story-reader-article,
.story-compose-canvas {
  max-width: 680px;
  margin: 0 auto;
}

.story-detail-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.story-detail-title {
  margin: 0;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 0.95;
}

.story-detail-dek {
  margin: 16px 0 20px;
  font-size: 18px;
  line-height: 1.8;
}

.story-reader-byline {
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.story-reader-meta-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.story-detail-content {
  font-family: Georgia, 'Times New Roman', Charter, serif;
  font-size: 20px;
  line-height: 1.7;
  color: var(--text-primary);
  letter-spacing: -0.003em;
}

.story-detail-content h1,
.story-detail-content h2,
.story-detail-content h3,
.story-editor h1,
.story-editor h2,
.story-editor h3 {
  font-family: var(--font-display);
  line-height: 1.08;
}

.story-detail-content p,
.story-editor p {
  margin: 0 0 1.1em;
}

.story-detail-content p:empty,
.story-editor p:empty,
.story-detail-content p:has(> br:only-child),
.story-editor p:has(> br:only-child) {
  margin: 0.3em 0;
}

.story-detail-content blockquote,
.story-editor blockquote {
  margin: 1.6em 0;
  padding-left: 18px;
  border-left: 3px solid rgba(15, 23, 42, 0.14);
  color: var(--text-secondary);
}

.story-detail-content ul,
.story-detail-content ol,
.story-editor ul,
.story-editor ol {
  margin: 0 0 1.2em 1.5em;
}

.story-comments-panel {
  max-width: 680px;
  margin: 40px auto 0;
  padding-top: 28px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.story-comments-head {
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
}

.story-comments-head h3,
.story-comments-subhead {
  margin: 0;
  font-size: 22px;
  font-family: var(--font-display);
}

.story-comments-head p {
  margin: 6px 0 0;
  font-size: 13px;
}

.story-comment-pending-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
}

.story-comment-form {
  margin-bottom: 18px;
}

.story-comment-form textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: transparent;
  color: var(--text-primary);
  padding: 16px 18px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
}

.dark .story-comment-form textarea {
  background: transparent;
}

.story-comment-form textarea:focus {
  border-color: rgba(74, 222, 128, 0.3);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.08);
}

.story-comment-form-actions {
  justify-content: space-between;
  margin-top: 10px;
}

.story-comment-list,
.story-comment-pending-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-comment-pending-list {
  margin-top: 22px;
}

.story-comment-card {
  padding: 14px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.story-comment-card-head {
  justify-content: space-between;
  align-items: flex-start;
}

.story-comment-author-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.story-comment-actions {
  color: var(--text-muted);
  font-size: 12px;
}

.story-comment-card p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.story-comment-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
}

.story-comment-delete {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.story-comment-delete:hover {
  color: var(--danger);
}

/* ── Threaded comments ── */
.story-comment-thread {
  position: relative;
}

.story-comment-nested {
  margin-left: 24px;
  padding-left: 16px;
}

.comment-replying-to {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.story-comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Comment action row: like, reply */
.story-comment-action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.comment-like-btn,
.comment-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}

.comment-like-btn:hover {
  color: #ef4444;
}

.comment-like-btn.liked {
  color: #ef4444;
}

.comment-reply-btn:hover {
  color: var(--accent);
}

/* Thread controls (collapse/expand) */
.comment-thread-controls {
  margin-top: 4px;
}

.comment-collapse-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comment-collapse-btn:hover {
  color: var(--accent);
}

.collapse-icon {
  font-weight: 700;
  font-size: 14px;
}

/* Thread lines on nested comments via left border */
.comment-replies {
  position: relative;
  margin-bottom: 12px;
}

.comment-replies:empty {
  margin-bottom: 0;
}

.comment-replies > .story-comment-thread {
  position: relative;
  border-left: 2px solid var(--border);
  margin-left: 8px;
  padding-left: 16px;
}

.comment-replies > .story-comment-thread:hover {
  border-left-color: var(--text-muted);
}

/* Collapsed indicator */
.comment-collapsed-indicator {
  margin-left: 8px;
  padding-left: 16px;
}

.comment-expand-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}

.comment-expand-btn:hover {
  text-decoration: underline;
}

/* Inline reply form */
.story-comment-reply-form {
  margin: 8px 0 12px;
}

.story-comment-reply-form textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.story-comment-reply-form textarea:focus {
  outline: none;
  border-color: rgba(74, 222, 128, 0.4);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.08);
}

.reply-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.reply-cancel-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
}

.reply-cancel-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.reply-submit-btn {
  font-size: 13px !important;
  padding: 6px 16px !important;
  min-height: 32px;
}

/* Notification badge */
.notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
  flex-shrink: 0;
}

/* Stories notification dropdown */
.stories-notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 20px;
  width: 320px;
  max-height: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  z-index: 9999;
  overflow: hidden;
}
.stories-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.stories-notif-list {
  overflow-y: auto;
  max-height: 340px;
  padding: 4px 0;
}
.stories-notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(128,128,128,0.08);
}
.stories-notif-item:hover { background: rgba(128,128,128,0.06); }
.stories-notif-item.unread { background: rgba(74,222,128,0.04); }
.stories-notif-item.unread:hover { background: rgba(74,222,128,0.08); }
.stories-notif-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.stories-notif-icon.comment { background: rgba(59,130,246,0.12); color: #3b82f6; }
.stories-notif-icon.reply { background: rgba(168,85,247,0.12); color: #a855f7; }
.stories-notif-icon.follower { background: rgba(74,222,128,0.12); color: #4ade80; }
.stories-notif-body { flex: 1; min-width: 0; }
.stories-notif-text { font-size: 12px; line-height: 1.4; color: var(--text-primary); }
.stories-notif-text strong { font-weight: 600; }
.stories-notif-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.stories-notif-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.stories-notif-unread-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #3b82f6;
  flex-shrink: 0; margin-top: 4px;
}

@media (max-width: 600px) {
  .stories-notif-dropdown {
    width: calc(100vw - 24px);
    right: -60px;
  }
}

.story-comment-locked {
  padding: 18px 18px 18px;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
}

.story-composer-topbar-left {
  align-items: flex-start;
}

.story-composer-intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-composer-intro p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.story-composer-top-actions {
  justify-content: flex-end;
}

.story-composer-top-actions .doc-action-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.story-comments-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.story-comments-toggle input {
  accent-color: var(--accent);
}

.story-audio-wrap {
  position: relative;
}

.story-audio-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  z-index: 20;
}

.story-audio-track {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}

.story-audio-track.active .story-audio-track-name {
  color: var(--text-primary);
  font-weight: 700;
}

.story-audio-track-name {
  font-size: 13px;
  color: var(--text-secondary);
}

.story-composer-formatbar {
  max-width: 980px;
  margin: 0 auto 20px;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.story-compose-canvas {
  padding-top: 10px;
}

.story-compose-stamp {
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.story-title-input-plain {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  padding: 0 0 12px;
  margin: 0 0 16px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.95;
}

.story-title-input-plain::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

.story-title-input-plain.shake {
  animation: shake 0.4s ease;
  border-bottom-color: #ef4444;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.story-compose-note {
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.7;
}

.story-editor {
  min-height: 60vh;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 19px;
  line-height: 1.9;
}

.story-editor.font-serif {
  font-family: Georgia, 'Times New Roman', serif;
}

.story-editor.font-mono {
  font-family: var(--font-mono);
}

.story-editor.font-georgia {
  font-family: Georgia, serif;
}

.story-editor.font-garamond {
  font-family: Garamond, Georgia, serif;
}

.story-editor.font-courier {
  font-family: 'Courier New', monospace;
}

.story-composer-footer {
  max-width: 980px;
  margin: 24px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  justify-content: space-between;
}

.story-composer-note {
  max-width: 600px;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .story-feed-item,
  .story-reader-byline,
  .story-composer-footer {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .story-feed-item-side,
  .story-reader-meta-wrap {
    align-items: flex-start;
  }

  .story-detail-title,
  .story-title-input-plain {
    font-size: clamp(34px, 8vw, 48px);
  }
}

@media (max-width: 720px) {
  .stories-header,
  .stories-toolbar,
  .story-reader-topbar,
  .story-composer-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .stories-header-actions,
  .story-detail-actions,
  .story-composer-top-actions,
  .story-composer-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .story-detail-title,
  .story-title-input-plain {
    font-size: 34px;
  }

  .story-detail-content,
  .story-editor {
    font-size: 18px;
  }

  .story-comment-form-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== STORIES LAYOUT UPDATE ===== */
.stories-mode-read .stories-header-row,
.stories-mode-compose .stories-header-row {
  display: none;
}

/* Desktop: navbar + topbar form one header row */
.stories-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 18px;
  flex-wrap: wrap;
}

.stories-navbar {
  display: flex;
  align-items: center;
}

.stories-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.stories-topbar-filters,
.stories-topbar-quick-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stories-topbar-filters {
  min-width: 0;
}

.stories-topbar-quick-actions {
  margin-left: auto;
  padding-left: 12px;
}

.stories-primary-tabs .stories-filter-btn {
  min-width: 112px;
}

.stories-list,
.stories-mine-list {
  max-width: 980px;
  margin: 0 auto;
}

.story-feed-item {
  padding: 14px 0;
}

.story-feed-item h3 {
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.16;
}

.story-metric {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.story-metric.active {
  color: #dc2626;
}

.story-feed-item-side {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  min-width: 0;
  gap: 14px;
  padding-top: 8px;
}

.story-doc-card {
  margin: 15px 0;
  cursor: pointer;
}

.story-doc-card .doc-card-text h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.story-card-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .story-doc-card {
    flex-wrap: wrap;
    gap: 10px;
  }
  .story-card-right {
    width: 100%;
    justify-content: space-between;
  }
}

.story-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.story-card-note {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.story-reader-shell,
.story-composer-shell {
  max-width: 1080px;
}

.story-reader-topbar,
.story-composer-topbar,
.story-composer-footer {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.story-reader-article,
.story-compose-canvas,
.story-comments-panel {
  width: min(74vw, 860px);
  max-width: 100%;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.story-reader-article,
.story-compose-canvas {
  padding: 0 !important;
}

.story-reader-topbar,
.story-composer-topbar {
  margin-bottom: 18px;
}

.story-detail-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-reader-author-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 0;
}

.story-reader-author-meta {
  color: var(--text-muted);
  font-size: 13px;
}

.story-reader-action-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.story-action-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.story-action-btn:hover {
  color: var(--text-primary);
}

.story-action-btn.liked {
  color: #dc2626;
}

.story-comment-switch {
  margin-left: auto;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.story-comment-switch.active {
  color: var(--text-primary);
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

.dark .story-comment-switch {
  background: rgba(17, 24, 39, 0.72);
}

.story-reader-note {
  margin-bottom: 22px;
}

.story-comments-panel {
  margin-top: 34px;
  padding: 26px 0 0 !important;
  border-top: none;
}

.story-comments-panel .story-comment-list {
  gap: 10px;
}

.story-comments-panel .story-comment-card {
  padding: 18px 20px;
}

.story-comments-panel .story-comment-card p {
  margin: 10px 0 0;
}

.story-comments-head {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.story-comment-form textarea {
  min-height: 86px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: transparent;
  padding: 14px 16px;
  box-shadow: none;
}

.story-comment-form textarea:focus {
  border-color: rgba(74, 222, 128, 0.4);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.08);
}

.dark .story-comment-form textarea {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .story-comment-form textarea:focus {
  border-color: rgba(74, 222, 128, 0.45);
}

.story-comment-form-actions {
  justify-content: flex-end;
}

.story-comment-card {
  padding: 16px 0;
}

.story-comment-card + .story-comment-card {
  margin-top: 12px;
}

.story-comment-card-head {
  align-items: center;
}

.story-comment-author-wrap span {
  color: var(--text-muted);
  font-size: 12px;
}

.story-composer-topbar {
  justify-content: space-between;
}

.story-composer-top-actions {
  justify-content: flex-end;
}

.story-composer-top-actions .doc-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
}

.story-formatbar {
  width: min(82vw, 1080px);
  max-width: 100%;
  margin: 0 auto 22px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  border-radius: 16px;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.story-format-font {
  min-width: 190px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #191919;
  color: #f5f5f5;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
}

.story-format-separator {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.story-format-btn {
  min-width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: #f5f5f5;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.story-format-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.story-format-btn.muted {
  color: rgba(255, 255, 255, 0.45);
}

.story-format-btn.dash {
  font-size: 24px;
  line-height: 1;
}

.story-format-btn.strike {
  font-size: 18px;
}

.story-format-strike {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.story-format-btn.color {
  font-size: 20px;
}

.story-compose-canvas {
  padding-top: 0 !important;
}

.story-title-input-plain {
  margin-bottom: 20px;
}

.story-editor {
  min-height: 68vh;
}

.story-composer-footer {
  width: min(74vw, 860px);
  max-width: 100%;
  padding-top: 22px;
  justify-content: flex-end;
  border-top: none;
}

.stories-primary-btn,
.stories-save-btn,
.stories-submit-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.stories-primary-icon {
  display: none;
  font-size: 20px;
  line-height: 1;
}

.stories-topbar .stories-primary-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.stories-topbar .stories-primary-btn:hover {
  border-color: rgba(74, 222, 128, 0.28);
  background: transparent;
  color: var(--text-primary);
}

.stories-save-btn {
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.story-feed-excerpt {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.7;
}

.story-meta-line {
  margin-top: 10px;
  font-size: 12px;
}

.story-author {
  gap: 10px;
}

.story-author-avatar {
  width: 34px;
  height: 34px;
}

.story-author-copy strong {
  font-size: 12px;
}

.story-author-copy span {
  font-size: 11px;
}

.story-detail-content {
  font-size: 20px;
  line-height: 1.7;
}

.story-detail-content p:first-child {
  margin-top: 0;
}

.story-detail-content blockquote,
.story-editor blockquote {
  background: transparent;
  border-radius: 0;
  padding: 0 0 0 18px;
}

/* --- Bottom Action Bar (reader) --- */
.story-bottom-action-bar {
  max-width: 680px;
  margin: 32px auto 0;
  padding: 18px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- Feed Card Footer (metrics inline) --- */
.story-feed-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.story-feed-footer .story-metric {
  gap: 4px;
  font-size: 12px;
}

/* --- Floating Selection Toolbar --- */
.story-float-toolbar {
  position: absolute;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  white-space: nowrap;
  overflow: visible;
}

.story-float-toolbar.visible {
  display: inline-flex;
}

.story-float-toolbar button {
  min-width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #e5e5e5;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 8px;
}

.story-float-toolbar button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.story-float-toolbar .float-separator {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  margin: 0 2px;
}

/* Format dropdown */
.story-format-dropdown-wrap {
  position: relative;
}

.story-format-dropdown-btn {
  gap: 4px;
  min-width: auto !important;
  padding: 0 6px !important;
  font-size: 13px !important;
}

.story-format-dropdown-btn svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.story-format-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 140px;
  padding: 4px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 1001;
}

.story-format-dropdown.open {
  display: block;
}

.story-format-dropdown button {
  display: block;
  width: 100%;
  height: auto;
  min-width: unset;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 4px;
  color: var(--text-primary);
  font-weight: 400;
  white-space: normal;
}

.story-format-dropdown button[data-float-block="h1"] {
  font-size: 20px;
  font-weight: 700;
}
.story-format-dropdown button[data-float-block="h2"] {
  font-size: 17px;
  font-weight: 700;
}
.story-format-dropdown button[data-float-block="h3"] {
  font-size: 15px;
  font-weight: 600;
}
.story-format-dropdown button[data-float-block="h4"] {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.story-format-dropdown button:hover {
  background: var(--hover-bg);
}

.story-format-dropdown button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Inline link input */
.story-float-link-input {
  display: none;
  align-items: center;
  gap: 4px;
}

.story-float-link-input.visible {
  display: inline-flex;
}

.story-float-link-input input {
  width: 200px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #e5e5e5;
  font: inherit;
  font-size: 12px;
  padding: 0 8px;
  outline: none;
}

.story-float-link-input input:focus {
  border-color: rgba(74, 222, 128, 0.5);
}

.story-float-link-input button {
  min-width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  font-size: 16px !important;
}

@media (max-width: 900px) {
  .stories-topbar,
  .stories-topbar-actions,
  .story-reader-author-row,
  .story-reader-action-row {
    align-items: flex-start;
  }

  .story-comment-switch {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  /* Hide inner back button — hamburger becomes the back arrow */
  .stories-back-btn {
    display: none;
  }

  /* Break wrapper so navbar and topbar position independently */
  .stories-header-row {
    display: contents;
  }

  .story-reader-topbar,
  .story-composer-topbar,
  .story-composer-footer {
    flex-direction: column;
    align-items: stretch;
  }

  /* Row 1: Fixed navbar — Feed / My Stories */
  .stories-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9500;
    background: #000;
    border-bottom: 1px solid var(--border);
    padding: 16px 16px 14px 76px;
    justify-content: flex-end;
  }

  .stories-primary-tabs {
    justify-content: flex-end;
    min-width: 0;
    gap: 6px;
  }

  /* Mobile: inactive = plain text, active = pill border */
  .stories-navbar .stories-filter-btn,
  .stories-topbar .stories-filter-btn {
    border-color: transparent;
    background: transparent;
  }
  .stories-navbar .stories-filter-btn.active,
  .stories-topbar .stories-filter-btn.active {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.06);
  }

  .stories-primary-tabs .stories-filter-btn {
    min-width: 0;
    padding: 10px 18px;
    font-size: 14px;
  }

  /* Row 2: Scrollable — filters + quick actions */
  .stories-topbar {
    margin: 0 0 14px;
    gap: 10px;
  }

  .stories-topbar-filters {
    flex: 1;
    min-width: 0;
  }

  .stories-topbar-filters .stories-filter-row {
    justify-content: flex-start;
    gap: 4px;
  }

  .stories-topbar-filters .stories-filter-btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  .stories-topbar-quick-actions {
    margin-left: 0;
    justify-content: flex-end;
    flex-shrink: 0;
    padding-left: 0;
    border-left: none;
    gap: 8px;
  }

  .stories-topbar .stories-icon-btn {
    width: 40px;
    height: 40px;
  }

  #new-story-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
  }

  #new-story-btn .stories-primary-label {
    display: none;
  }

  #new-story-btn .stories-primary-icon {
    display: inline-block;
  }

  .story-reader-article,
  .story-compose-canvas,
  .story-comments-panel,
  .story-composer-footer {
    width: 100%;
  }

  .story-hero-card h3 {
    font-size: clamp(22px, 5vw, 28px);
  }

  .story-float-toolbar {
    left: 8px !important;
    right: 8px !important;
    max-width: calc(100vw - 16px);
    white-space: normal;
    flex-wrap: wrap;
    justify-content: center;
  }

  .story-float-link-input input {
    width: 140px;
  }
}

@media (max-width: 768px) {
  .story-feed-item {
    padding: 18px 0;
  }

  .story-hero-card {
    padding: 24px 0;
  }

  .story-reader-article,
  .story-compose-canvas {
    max-width: 100%;
  }

  .story-bottom-action-bar {
    max-width: 100%;
  }

  .story-action-btn,
  .story-comment-switch {
    min-height: 44px;
    min-width: 44px;
  }

  .story-float-toolbar button {
    min-width: 44px;
    min-height: 44px;
  }

  /* Mobile thread nesting: 16px instead of 24px */
  .comment-replies > .story-comment-thread {
    margin-left: 4px;
    padding-left: 12px;
  }

  .comment-collapsed-indicator {
    margin-left: 4px;
    padding-left: 12px;
  }

  .comment-like-btn,
  .comment-reply-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 4px 8px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .story-reader-article,
  .story-compose-canvas {
    max-width: 640px;
  }

  .story-bottom-action-bar {
    max-width: 640px;
  }
}

/* ===== STORIES THEME OVERRIDES ===== */

/* Dark theme */
.dark .story-feed-item,
.dark .story-hero-card,
.dark .story-skeleton-card {
  border-bottom-color: var(--border);
}

.dark .story-reader-author-row {
  border-bottom-color: var(--border);
}

.dark .story-bottom-action-bar {
  border-top-color: var(--border);
}

.dark .story-comments-head {
  border-bottom-color: var(--border);
}

.dark .story-comment-card {
  border-bottom-color: var(--border);
}

.dark .comment-replies > .story-comment-thread {
  border-left-color: var(--border);
}

.dark .story-comment-reply-form textarea {
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .story-comment-reply-form textarea:focus {
  border-color: rgba(74, 222, 128, 0.45);
}

.dark .story-skeleton-line {
  background: rgba(255, 255, 255, 0.06);
}

.dark .stories-lead {
  border-bottom-color: var(--border);
}

.dark .stories-filter-btn {
  border-color: rgba(255, 255, 255, 0.1);
}

.dark .stories-filter-btn:hover,
.dark .stories-filter-btn.active {
  border-color: rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.08);
}

.dark .story-composer-formatbar {
  border-top-color: var(--border);
  border-bottom-color: var(--border);
}

.dark .story-composer-footer {
  border-top-color: var(--border);
}

.dark .story-detail-content blockquote,
.dark .story-editor blockquote {
  border-left-color: rgba(255, 255, 255, 0.14);
}


/* Sepia theme */
.sepia .story-feed-item,
.sepia .story-hero-card,
.sepia .story-skeleton-card {
  border-bottom-color: var(--border);
}

.sepia .story-reader-author-row {
  border-bottom-color: var(--border);
}

.sepia .story-bottom-action-bar {
  border-top-color: var(--border);
}

.sepia .story-comments-head {
  border-bottom-color: var(--border);
}

.sepia .story-comment-card {
  border-bottom-color: var(--border);
}

.sepia .comment-replies > .story-comment-thread {
  border-left-color: var(--border);
}

.sepia .story-comment-reply-form textarea {
  border-color: rgba(44, 31, 14, 0.12);
}

.sepia .story-comment-reply-form textarea:focus {
  border-color: rgba(195, 126, 63, 0.45);
  box-shadow: 0 0 0 3px rgba(195, 126, 63, 0.08);
}

.sepia .comment-like-btn.liked {
  color: #c0392b;
}

.sepia .story-skeleton-line {
  background: rgba(44, 31, 14, 0.08);
}

.sepia .stories-lead {
  border-bottom-color: var(--border);
}

.sepia .stories-filter-btn {
  border-color: rgba(195, 126, 63, 0.2);
}

.sepia .stories-filter-btn:hover,
.sepia .stories-filter-btn.active {
  border-color: rgba(195, 126, 63, 0.4);
  color: var(--text-primary);
  background: rgba(195, 126, 63, 0.08);
}

.sepia .story-action-btn.liked {
  color: #c0392b;
}

.sepia .story-comment-switch {
  background: rgba(240, 230, 212, 0.72);
  border-color: rgba(195, 126, 63, 0.2);
}

.sepia .story-comment-switch.active {
  border-color: rgba(195, 126, 63, 0.4);
  background: rgba(195, 126, 63, 0.08);
}

.sepia .story-comment-form textarea {
  background: transparent;
  border-color: rgba(44, 31, 14, 0.12);
}

.sepia .story-comment-form textarea:focus {
  border-color: rgba(195, 126, 63, 0.45);
  box-shadow: 0 0 0 3px rgba(195, 126, 63, 0.08);
}

.sepia .story-composer-formatbar {
  border-top-color: var(--border);
  border-bottom-color: var(--border);
}

.sepia .story-composer-footer {
  border-top-color: var(--border);
}

.sepia .story-detail-content blockquote,
.sepia .story-editor blockquote {
  border-left-color: rgba(195, 126, 63, 0.3);
}


.sepia .story-status-badge.success {
  background: rgba(195, 126, 63, 0.16);
  color: #8B5E34;
}

.sepia .story-status-badge.warning {
  background: rgba(195, 126, 63, 0.16);
  color: #8B5E34;
}

.sepia .stories-icon-btn {
  border-color: rgba(195, 126, 63, 0.2);
}

.sepia .stories-icon-btn:hover {
  border-color: rgba(195, 126, 63, 0.4);
}

.sepia .stories-inline-btn {
  border-color: rgba(195, 126, 63, 0.2);
}

.sepia .stories-inline-btn:hover {
  border-color: rgba(195, 126, 63, 0.4);
  background: rgba(195, 126, 63, 0.08);
}

.sepia .story-comment-delete:hover {
  color: #c0392b;
}

.sepia .pro-nav-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
}

/* ===== DUELS ===== */
.duel-challenge-cta {
  display: flex;
  justify-content: center;
  margin: 24px 0 32px;
  position: relative;
}

@keyframes duel-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5), var(--shadow); }
  50% { box-shadow: 0 0 20px 8px rgba(74, 222, 128, 0.25), var(--shadow-lg); }
}

@keyframes duel-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.duel-big-btn {
  padding: 18px 52px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: var(--radius) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a0a0a !important;
  animation: duel-pulse 2.5s ease-in-out infinite;
  background: linear-gradient(110deg, var(--accent) 0%, var(--accent) 40%, #86efac 50%, var(--accent) 60%, var(--accent) 100%) !important;
  background-size: 200% 100% !important;
  transition: all 0.3s ease, transform 0.15s ease !important;
  position: relative;
  overflow: hidden;
}

.duel-big-btn:hover {
  transform: translateY(-3px) scale(1.04) !important;
  animation: duel-shimmer 1.2s linear infinite, duel-pulse 2s ease-in-out infinite;
  box-shadow: 0 8px 30px rgba(74, 222, 128, 0.4), var(--shadow-lg) !important;
}

.duel-big-btn:active {
  transform: translateY(0) scale(0.98) !important;
  animation: none;
}

.duel-section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.duel-count-badge {
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 6px;
}

.duel-request-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.duel-sent-card {
  border-color: var(--accent-soft);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.05), var(--bg-card));
}

.duel-request-info {
  flex: 1;
}

.duel-request-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.duel-request-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.duel-request-actions {
  display: flex;
  gap: 8px;
}

.duel-history-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  height: 38px;
  box-sizing: border-box;
}
.duel-history-card.won { border-left: 2px solid var(--success); }
.duel-history-card.lost { border-left: 2px solid var(--danger); }
.duel-history-card.tie { border-left: 2px solid var(--text-muted); }

.dhc-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  width: 38px;
  text-align: center;
}
.dhc-badge.won { background: rgba(34,197,94,0.12); color: var(--success); }
.dhc-badge.lost { background: rgba(239,68,68,0.1); color: var(--danger); }
.dhc-badge.tie { background: rgba(255,255,255,0.06); color: var(--text-muted); }

.dhc-vs {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.dhc-vs strong { color: var(--text-primary); font-weight: 600; margin-left: 6px; }
.dhc-handle { font-size: 11px; color: var(--text-muted); font-weight: 400; }

.dhc-score {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.dhc-date {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.dhc-info-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.dhc-info-btn:hover, .dhc-info-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.dhc-detail {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 8px 22px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.duel-history-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding: 8px 0;
}

.duel-history-pager-info {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.duel-history-pager .btn[disabled] {
  opacity: 0.3;
  pointer-events: none;
}

.duel-history-result {
  font-size: 13px;
  font-weight: 600;
}
.duel-history-result.won { color: var(--success); }
.duel-history-result.lost { color: var(--danger); }
.duel-history-result.tie { color: var(--text-muted); }

.duel-history-scores {
  font-size: 12px;
  color: var(--text-muted);
}

/* Duel countdown overlay */
.duel-countdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.duel-countdown-overlay.active {
  display: flex;
}

.duel-countdown-content {
  text-align: center;
}

.duel-countdown-emoji {
  font-size: 72px;
  margin-bottom: 16px;
  animation: duelPulse 1s ease infinite;
}

@keyframes duelPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.duel-countdown-timer {
  font-size: 96px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin: 16px 0;
  font-family: var(--font-mono);
}

.duel-countdown-vs {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 12px;
}

.duel-countdown-duration {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Compact rules block on the countdown overlay — explains scoring so
   players don't bail mid-duel thinking it's harmless. */
.duel-countdown-rules {
  margin: 20px auto 0;
  max-width: 420px;
  padding: 12px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  text-align: left;
}
.duel-countdown-rules-title {
  font-size: 12px;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.duel-countdown-rules-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.duel-skip-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.duel-skip-status {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 80px;
  text-align: center;
}

.duel-skip-status.ready {
  color: var(--success);
  border-color: var(--success);
}

#duel-skip-btn {
  padding: 12px 32px;
  font-size: 15px;
}

/* Stack the action buttons (Skip Wait / Cancel duel / Leave) vertically
   with consistent width + padding so they read as one cohesive group. */
.duel-countdown-content #duel-skip-btn,
.duel-countdown-content #duel-countdown-cancel-btn,
.duel-countdown-content #duel-leave-btn {
  display: block;
  width: 220px;
  margin: 10px auto 0;
  padding: 12px 24px;
  font-size: 14px;
  border-radius: 10px;
  box-sizing: border-box;
}
.duel-countdown-content #duel-skip-btn {
  margin-top: 18px;
  font-weight: 700;
}
.duel-countdown-content #duel-countdown-cancel-btn,
.duel-countdown-content #duel-leave-btn {
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.duel-countdown-content #duel-countdown-cancel-btn:hover,
.duel-countdown-content #duel-leave-btn:hover {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.4);
  color: #ef4444;
}

.duel-history-doc-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-family: var(--font-sans);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.duel-history-doc-btn:hover {
  background: var(--hover-bg);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Duel bar (during active duel in editor) */
.duel-bar {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(74, 222, 128, 0.05));
  border-bottom: 1px solid var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
}

.duel-bar.active {
  display: flex;
}

/* Opponent-left info notification — compact floating card, matches
   the extra-time-request style. Right-side, vertically centered.
   Persistent until the user dismisses it or the duel ends. */
.duel-opponent-left-notice {
  display: none;
  position: fixed;
  right: 24px;
  top: calc(50% + 80px);
  align-items: center;
  gap: 12px;
  background: var(--surface, var(--bg-card));
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 1000;
  max-width: 320px;
  animation: slideInRight 0.3s ease;
}
.duel-opp-left-icon {
  font-size: 24px;
  flex-shrink: 0;
  animation: duelOppLeftPulse 1.6s ease-in-out infinite;
}
@keyframes duelOppLeftPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12) rotate(-5deg); }
}
.duel-opp-left-text {
  flex: 1;
  min-width: 0;
}
.duel-opp-left-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 2px;
}
.duel-opp-left-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.duel-opp-left-finish {
  padding: 6px 12px;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: var(--accent);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.duel-opp-left-finish:hover { background: rgba(74, 222, 128, 0.25); }
.duel-opp-left-close {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.duel-opp-left-close:hover { background: var(--hover-bg); color: var(--text-primary); }

.duel-bar-vs {
  color: #e74c3c;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 2px;
  margin: 0 24px;
  text-shadow: 0 0 8px rgba(231, 76, 60, 0.3);
}

.duel-bar-scores {
  display: flex;
  align-items: center;
  gap: 0;
}

.duel-bar-left,
.duel-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.duel-bar-left strong,
.duel-bar-right strong {
  color: var(--text-primary);
  font-size: 15px;
}

.duel-bar-name {
  color: var(--accent);
  font-weight: 600;
}

.duel-bar-dash {
  color: var(--text-muted);
  font-weight: 300;
}

.duel-bar-extra-time-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.duel-bar-extra-time-btn:hover {
  background: var(--accent-hover);
}

.duel-bar-forfeit {
  color: var(--danger);
  font-size: 12px;
  margin-left: 16px;
  animation: duelPulse 1s ease infinite;
}

.duel-add-time-btn {
  margin-left: 4px;
  font-size: 14px;
  font-weight: 700;
  min-width: 28px;
  padding: 2px 8px;
}

.duel-extra-time-options {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

/* CS:GO-style extra time request notification */
.duel-extra-time-request {
  display: none;
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 1000;
  animation: slideInRight 0.3s ease;
}

.duel-extra-time-request span:first-child {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.duel-extra-time-accept,
.duel-extra-time-decline {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.duel-extra-time-accept {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}
.duel-extra-time-accept:hover {
  background: rgba(34, 197, 94, 0.3);
}

.duel-extra-time-decline {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}
.duel-extra-time-decline:hover {
  background: rgba(239, 68, 68, 0.3);
}

.duel-extra-time-request.waiting {
  border-color: var(--text-muted);
  opacity: 0.8;
}
.duel-extra-time-request.waiting span:first-child {
  color: var(--text-muted);
  font-size: 13px;
}

@keyframes slideInRight {
  from { transform: translateY(-50%) translateX(100px); opacity: 0; }
  to { transform: translateY(-50%) translateX(0); opacity: 1; }
}

/* Custom duel duration input */
.duel-custom-input {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
}
.duel-custom-input::-webkit-inner-spin-button,
.duel-custom-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.duel-custom-input[type=number] {
  -moz-appearance: textfield;
}

/* ===== FRIENDS SPLIT LAYOUT ===== */
.friends-split-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
}

.friends-right {
  border-left: 1px solid var(--border);
  padding-left: 32px;
}

@media (max-width: 900px) {
  .friends-split-layout {
    grid-template-columns: 1fr;
  }
  .friends-right {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 24px;
  }
}

/* ===== ACTIVITY FEED ===== */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: background 0.15s ease;
}

.activity-item:hover {
  background: var(--bg-card-hover);
}

.activity-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}
.activity-text .pro-inline-badge {
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== EDITOR ===== */
.editor-container {
  position: fixed;
  top: var(--maint-banner-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.editor-container.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Hide mobile hamburger when editor is active — toggled via body class */
body.editor-active .mobile-sidebar-toggle {
  display: none !important;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  position: relative;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  gap: 12px;
}

.editor-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 0;
  min-width: 0;
}

.editor-back-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.editor-back-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.editor-title-input {
  font-size: 15px;
  font-weight: 500;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--font-sans);
  min-width: 200px;
  color: var(--text-primary);
}
.editor-title-input:focus { background: transparent !important; box-shadow: none !important; }

.editor-toolbar-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.editor-timer {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -1px;
  min-width: 80px;
  text-align: center;
  color: var(--text-primary);
}

.editor-timer.warning {
  color: var(--warning);
  animation: pulse 1s infinite;
}

.editor-timer.danger {
  color: var(--danger);
  animation: pulse 0.5s infinite;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.editor-timer-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.editor-timer-toggle:hover { color: var(--text-primary); }
.editor-add-time {
  display: flex;
  gap: 4px;
}
.editor-add-time-btn {
  background: var(--hover-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.editor-add-time-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.editor-mode-badge {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.editor-mode-badge.normal {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.editor-mode-badge.dangerous {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.editor-mode-badge.research {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.editor-mode-badge.editing {
  background: var(--success-soft);
  color: var(--success);
  animation: editingPulse 2s ease-in-out infinite;
}

@keyframes dangerPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

@keyframes editingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* Global status bar (Google Docs style, bottom-left of full page) */
/* Global status bar: bottom-left corner, always visible in editor */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 9000;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0 5px 0 0;
  padding: 5px 16px 5px 20px;
  display: none;     /* shown via JS when editor is open */
  align-items: center;
  gap: 12px;
  min-width: 80px;
}

.editor-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  justify-content: flex-end;
  z-index: 2550;
}
#editor-audio-btn { position: relative; z-index: 3000; }

/* Word limit indicator for free tier */
.word-limit-indicator {
  position: fixed;
  bottom: 36px;
  left: 16px;
  z-index: 9001;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.word-limit-indicator.limit-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.word-limit-indicator.limit-reached {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: limitPulse 1.5s ease-in-out infinite;
}
@keyframes limitPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.status-bar #editor-word-count,
.editor-word-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.editor-xp-float {
  position: fixed;
  font-size: 16px;
  font-weight: 600;
  color: var(--xp-color);
  pointer-events: none;
  z-index: 3000;
  animation: xpFloat 1.5s ease forwards;
  text-shadow: 0 0 12px var(--accent-glow);
}

@keyframes xpFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-60px) scale(1); }
}

.editor-area {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  padding: 64px 24px 48px;
}

.editor-textarea {
  width: 100%;
  max-width: 760px;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 2;
  color: var(--text-primary);
  background: transparent;
  font-weight: 300;
  letter-spacing: -0.2px;
  min-height: 200px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.editor-textarea:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

/* Formatting toolbar — full-width row below the main toolbar */
.editor-format-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
#formatting-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fmt-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.fmt-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}
.fmt-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.fmt-size-label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 16px;
  text-align: center;
  font-weight: 600;
  line-height: 32px;
}
.fmt-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.fmt-color-btn {
  font-weight: 700;
  font-size: 14px;
}

.editor-textarea.fading {
  animation: textFade 3s forwards;
}

@keyframes textFade {
  0% { opacity: 1; }
  100% { opacity: 0; color: var(--danger); }
}

/* ===== SESSION MODAL EXTRA FIELDS ===== */
.session-topic-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  resize: none;
  transition: border-color var(--transition);
}
.session-topic-input::placeholder { color: var(--text-muted); font-size: 12px; }
.session-topic-input:focus { border-color: var(--accent); }

.session-target-input {
  width: 120px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.session-target-input:focus { border-color: var(--accent); }
.session-target-input::-webkit-inner-spin-button,
.session-target-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.session-target-input { -moz-appearance: textfield; }
.input-invalid, .input-invalid:focus { border-color: #e53e3e !important; box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.25) !important; }

.label-hint {
  font-size: 9px;
  font-weight: 400;
  color: #fff;
}

/* ===== EDITOR TOPIC BAR ===== */
.editor-topic-bar {
  padding: 6px 24px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.editor-topic-input {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  background: none;
  border: none;
  outline: none;
  width: 100%;
  text-align: center;
  font-family: inherit;
}
.editor-topic-input::placeholder {
  color: var(--text-muted);
}

/* ===== EDITOR FONT DROPDOWN ===== */
.editor-font-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 100;
  min-width: 150px;
  overflow: hidden;
}
.font-option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}
.font-option:hover { background: var(--hover-bg); color: var(--text-primary); }
.font-option.active { background: var(--accent-soft); color: var(--accent); }

/* ===== EDITOR AUDIO DROPDOWN ===== */
.editor-audio-dropdown {
  position: fixed;
  top: 52px;
  right: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 99999;
  min-width: 220px;
  padding: 8px 0;
}
.audio-section { padding: 4px 12px; }
.audio-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding: 4px 0;
}
.audio-option {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
}
.audio-option:hover { background: var(--hover-bg); color: var(--text-primary); }
.audio-option.active { background: var(--accent-soft); color: var(--accent); }
.audio-separator {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.audio-yt-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.audio-yt-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
}
.audio-yt-input:focus { border-color: var(--accent); }
.audio-yt-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.audio-yt-seek {
  flex: 1;
  height: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}
.audio-yt-controls .audio-track-vol {
  width: 60px;
}
.audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}
.audio-now-playing {
  font-size: 11px;
  color: var(--accent);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-ctrl-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--hover-bg);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.audio-ctrl-btn:hover { background: var(--accent-soft); color: var(--accent); }
.audio-volume {
  width: 60px;
  accent-color: var(--accent);
}

/* ===== FLOATING SELECTION POPUP ===== */
.selection-popup {
  position: fixed;
  z-index: 10000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
  animation: selPopIn 0.12s ease-out;
}
@keyframes selPopIn {
  from { opacity: 0; transform: translateY(4px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.sel-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.sel-btn:hover { background: var(--hover-bg); color: var(--text-primary); }
.sel-btn.active { background: var(--accent-soft); color: var(--accent); }
.sel-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}
.sel-size-label {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 14px;
  text-align: center;
  font-weight: 600;
}

/* ===== STATUS BAR EXTRAS ===== */
.status-separator {
  color: var(--border);
  font-size: 12px;
}
#editor-words-remaining {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ===== MOTIVATING TOAST ===== */
.motivate-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  z-index: 10001;
  animation: motivateIn 0.3s ease-out forwards;
  box-shadow: 0 4px 20px rgba(74, 222, 128, 0.2);
  pointer-events: none;
}
@keyframes motivateIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
.motivate-toast.out {
  animation: motivateOut 0.3s ease-in forwards;
}
@keyframes motivateOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(30px); }
}

/* ===== EDITOR FONT FAMILIES ===== */
/* Font-family swap only — size/line-height stay fixed (redesign.css) so
   the writing space itself never changes shape when you switch fonts. */
.editor-textarea.font-serif { font-family: 'Archivo', system-ui, sans-serif; }
.editor-textarea.font-mono { font-family: var(--font-mono); }
.editor-textarea.font-georgia { font-family: Georgia, 'Times New Roman', serif; }
.editor-textarea.font-garamond { font-family: 'EB Garamond', Garamond, 'Times New Roman', serif; }
.editor-textarea.font-courier { font-family: 'Courier New', Courier, monospace; }

/* Payment trust row in the pricing modal */
.pricing-payments {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border);
}
.pricing-payments-label {
  font-size: 12px; letter-spacing: 0.3px; color: var(--text-secondary);
}
.pricing-payments-logos {
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
}
.pay-logo { height: 26px; width: auto; opacity: 0.9; }
.pay-logo-stripe { height: 32px; }
.pay-logo-payme { height: 28px; border-radius: 7px; }
/* Stripe's logo is brand-purple; lift it on dark themes for contrast */
.dark .pay-logo-stripe, .sepia .pay-logo-stripe { filter: brightness(1.5); }

/* Upgrade-tab payment options (UZS providers + secure-payment logos) */
.upgrade-payments { max-width: 760px; margin: 6px auto 0; }
/* Secure-payment logos sit just under the hero subtitle, centered, no divider */
.upgrade-pay-logos { margin: 14px auto 2px; }
.upgrade-pay-logos .pricing-payments { margin-top: 0; padding-top: 0; border-top: none; gap: 6px; }
.uzs-pay { margin: 4px 0 18px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); }
.uzs-pay-head { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; text-align: center; }
.uzs-pay-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.uzs-pay-btn { flex: 1 1 200px; max-width: 280px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: rgba(127,127,127,0.07); color: var(--text-primary); font-weight: 600; font-size: 14px; cursor: pointer; transition: transform .08s ease, border-color .15s ease; }
.uzs-pay-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.uzs-pay-btn:disabled { opacity: .6; cursor: default; transform: none; }
.uzs-pay-payme { border-color: #33cccc; }
.uzs-pay-click { border-color: #0a74ff; }
.pay-chip { font-size: 13px; font-weight: 800; letter-spacing: .2px; padding: 4px 10px; border-radius: 6px; }
.pay-chip-payme { color: #008c8c; background: rgba(51,204,204,.14); }
.pay-chip-click { color: #0a74ff; background: rgba(10,116,255,.12); }

.upgrade-payment-comparison {
  display: grid;
  gap: 9px;
  margin: 16px 0 20px;
}
.upgrade-price-option {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(127,127,127,0.05);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.upgrade-price-option:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
}
.upgrade-price-option.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
}
.upgrade-price-option-main strong {
  display: block;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}
.upgrade-price-option-main span {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}
.upgrade-price-option-payments {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
}
.upgrade-provider-price {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 650;
  min-width: 0;
}
.upgrade-provider-price .pay-logo {
  width: 60px;
  height: auto;
  max-height: 22px;
  object-fit: contain;
  flex: none;
}
.upgrade-provider-price span {
  min-width: 0;
  white-space: nowrap;
  text-align: right;
}
.upgrade-provider-price-payme {
  color: var(--text-primary);
}
.upgrade-provider-price-payme em {
  color: var(--accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  justify-self: end;
}

.payment-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.payment-choice-modal.active { display: flex; }
.payment-choice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(10px);
}
.payment-choice-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: 0 26px 80px rgba(0,0,0,0.42);
  padding: 24px;
}
.payment-choice-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(127,127,127,0.08);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.payment-choice-head { padding-right: 34px; margin-bottom: 20px; }
.payment-choice-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.payment-choice-head h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.15;
}
.payment-choice-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}
.payment-choice-section { margin-top: 18px; }
.payment-choice-section > label {
  display: block;
  margin-bottom: 9px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 750;
}
.payment-choice-durations,
.payment-choice-methods {
  display: grid;
  gap: 9px;
}
.payment-choice-duration,
.payment-choice-method {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(127,127,127,0.06);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.payment-choice-duration {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
}
.payment-choice-duration strong,
.payment-choice-method-copy strong {
  font-size: 14px;
}
.payment-choice-duration span,
.payment-choice-method-copy small {
  color: var(--text-secondary);
  font-size: 12px;
}
.payment-choice-duration em,
.payment-choice-method > em {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  font-style: normal;
  text-transform: uppercase;
}
.payment-choice-method {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
}
.payment-choice-method .pay-logo {
  width: 74px;
  height: auto;
  max-height: 30px;
  object-fit: contain;
}
.payment-choice-method-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.payment-choice-duration:hover,
.payment-choice-method:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
}
.payment-choice-duration.active,
.payment-choice-method.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}
.payment-choice-continue {
  width: 100%;
  margin-top: 22px;
  padding: 13px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--gradient-accent);
  color: #0a0a0a;
  font-weight: 800;
  cursor: pointer;
}
.payment-choice-continue:disabled {
  opacity: .65;
  cursor: default;
}

/* OpenDyslexic — self-hosted accessibility font (SIL OFL) */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('/fonts/opendyslexic-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'OpenDyslexic';
  src: url('/fonts/opendyslexic-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
.editor-textarea.font-dyslexic { font-family: 'OpenDyslexic', Comic Sans MS, sans-serif; }
.story-editor.font-dyslexic {
  font-family: 'OpenDyslexic', Comic Sans MS, sans-serif;
  letter-spacing: 0.2px;
  line-height: 1.9;
}

/* Focus mode — dim everything except the block/line containing the caret. */
.editor-textarea.focus-mode > * { opacity: 0.2; transition: opacity 0.35s ease; }
.editor-textarea.focus-mode > .is-focus-line { opacity: 1; }

/* Pulse glow on the focused line when focus mode first activates */
@keyframes focusLineGlow {
  0%   { background: transparent; }
  25%  { background: rgba(var(--accent-rgb), 0.10); border-radius: 3px; }
  100% { background: transparent; }
}
.editor-textarea.focus-mode-entering > .is-focus-line {
  animation: focusLineGlow 0.65s ease forwards;
}

/* Active state for toolbar toggle buttons (focus mode) */
.doc-action-btn.is-active { color: var(--accent); background: rgba(var(--accent-rgb), 0.16); }

/* ── Focus mode dropdown ── */
.editor-focus-dropdown {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg, var(--shadow));
  z-index: 99999;
  width: 224px;
  padding: 14px 14px 12px;
}
.focus-drop-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.focus-drop-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 13px;
}
.focus-big-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
}
.focus-big-toggle.on {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}
.focus-toggle-track {
  width: 34px;
  height: 19px;
  border-radius: 10px;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.focus-big-toggle.on .focus-toggle-track { background: var(--accent); }
.focus-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.28);
}
.focus-big-toggle.on .focus-toggle-thumb { transform: translateX(15px); }
.focus-toggle-label { flex: 1; }

/* Writing-feel preference rows in the audio dropdown */
.audio-pref-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 4px; font-size: 13px;
  color: var(--text-primary); cursor: pointer;
}
.audio-pref-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ===== FORMAT BAR FONT SELECT ===== */
.fmt-font-wrap {
  display: flex;
  align-items: center;
}
.fmt-font-select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  min-width: 110px;
}
.fmt-font-select:focus {
  border-color: var(--accent);
}

/* ===== AUDIO TRACK ROWS ===== */
.audio-track {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  transition: var(--transition);
}
.audio-track:hover { background: var(--hover-bg); }
.audio-track.active { background: var(--accent-soft); }
.audio-play-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: var(--hover-bg);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.audio-play-btn:hover { background: var(--accent-soft); color: var(--accent); }
.audio-track.active .audio-play-btn { background: var(--accent); color: #0a0a0a; }
.audio-track-name {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}
.audio-track.active .audio-track-name { color: var(--accent); font-weight: 500; }
.audio-track-vol {
  width: 60px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* ===== BLOCKQUOTE STYLING ===== */
.editor-textarea blockquote {
  border-left: 3px solid var(--accent);
  margin: 8px 0;
  padding: 4px 16px;
  color: var(--text-secondary);
  font-style: italic;
}

/* ===== BOLD MORE VISIBLE ===== */
.editor-textarea b,
.editor-textarea strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== TAB WARNING OVERLAY ===== */
.tab-warning {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  backdrop-filter: blur(20px);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tab-warning.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tab-warning h2 {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.tab-warning p {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 300;
}

.tab-warning-timer {
  font-family: var(--font-display);
  font-size: 120px;
  font-weight: 700;
  color: var(--danger);
  animation: pulse 0.5s infinite;
  line-height: 1;
  text-shadow: 0 0 60px rgba(239, 68, 68, 0.4);
}

/* ===== SESSION START MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transform: scale(0.96);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-back-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.modal p {
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-size: 14px;
  font-weight: 300;
}

.modal-field {
  margin-bottom: 24px;
}

#session-modal .modal > p,
#session-modal .session-main-panel > p {
  margin-bottom: 16px;
}
#session-modal .modal-field {
  margin-bottom: 14px;
}

/* Topic input with generate-prompt button (✨ → pop open category picker) */
.topic-input-wrap {
  position: relative;
}
.topic-input-wrap .session-topic-input {
  padding-right: 42px;
}
.prompt-generate-btn {
  position: absolute;
  right: 9px;
  bottom: 16px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease, background 200ms ease, box-shadow 200ms ease, color 200ms ease;
  box-shadow: 0 2px 8px rgba(202, 138, 4, 0.3);
}
.prompt-generate-btn:hover { filter: brightness(1.1); transform: scale(1.05); }
.prompt-generate-btn:active { transform: scale(0.95); }
.prompt-generate-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.prompt-generate-btn.has-prompt {
  background: linear-gradient(135deg, #9ca3af, #6b7280);
  color: #fff;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

/* Topic textarea auto-grow with smooth transition */
.topic-input-wrap .session-topic-input {
  transition: height 260ms cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.prompt-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  min-width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 50;
  animation: promptPopoverIn 180ms cubic-bezier(.2,.8,.2,1);
  transform-origin: top right;
}
@keyframes promptPopoverIn {
  from { opacity: 0; transform: scale(0.92) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.prompt-popover-header {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.prompt-popover-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prompt-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--hover-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.prompt-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.prompt-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.prompt-popover-quota {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-muted);
}
.prompt-popover-quota.capped {
  color: #ef4444;
}

/* Two-panel session modal (template-ready: add modes by tagging .config-section with data-for-mode) */
#session-modal .session-modal-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-height: 90vh;
}
#session-modal .session-main-panel {
  flex: 0 0 auto;
  width: 480px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
}
#session-modal .session-config-panel {
  flex: 0 0 auto;
  width: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  transform: translateX(-24px);
  overflow: hidden;
  pointer-events: none;
  max-height: 90vh;
  transition: width 320ms cubic-bezier(.2,.8,.2,1),
              padding 320ms cubic-bezier(.2,.8,.2,1),
              opacity 220ms ease 80ms,
              transform 320ms cubic-bezier(.2,.8,.2,1);
}
#session-modal .session-modal-wrapper.has-config .session-config-panel {
  width: 380px;
  min-width: 380px;
  padding: 32px;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  overflow-y: auto;
}
#session-modal .config-panel-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 18px 0;
  color: var(--text-primary);
}
#session-modal .config-section {
  margin-bottom: 20px;
}
#session-modal .config-section:last-child {
  margin-bottom: 0;
}
#session-modal .config-section > label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  #session-modal .session-modal-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  #session-modal .session-main-panel {
    width: 92vw;
  }
  #session-modal .session-config-panel {
    transform: translateY(-16px);
  }
  #session-modal .session-modal-wrapper.has-config .session-config-panel {
    width: 92vw;
    max-width: 92vw;
    transform: translateY(0);
  }
}

.modal-field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.modal-field input,
.modal-field select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.modal-field input:focus,
.modal-field select:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}

.time-presets {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.time-preset {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.time-preset:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.time-preset.active {
  background: var(--gradient-accent);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(74, 222, 128, 0.3);
}

.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-option {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  background: var(--bg-elevated);
}

.mode-option:hover {
  border-color: var(--border-hover);
}

.mode-option.active {
  background: var(--gradient-accent);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(74, 222, 128, 0.3);
}

.mode-option.active[data-mode="normal"] {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  box-shadow: 0 4px 20px rgba(234, 179, 8, 0.3);
}

.mode-option.active.dangerous-opt {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.mode-option.active.research-opt {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.mode-option h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.mode-option p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.mode-option.active p {
  opacity: 0.8;
  color: white;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 36px;
}

.modal-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  justify-content: center;
}

/* ===== AUTH ===== */

.auth-card .logo {
  display: block;
  text-align: center;
  font-size: 28px;
  margin-bottom: 48px;
}

.auth-card h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.auth-card .auth-sub {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-size: 14px;
  font-weight: 300;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.auth-field input,
.auth-field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition: all var(--transition);
  background: var(--bg-card);
  color: var(--text-primary);
}

.auth-field input:focus,
.auth-field textarea:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}

.auth-field input:disabled,
.auth-field textarea:disabled {
  opacity: 0.4;
  background: var(--bg-elevated);
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.auth-error.visible {
  display: block;
}

.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-switch a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== SESSION COMPLETE OVERLAY ===== */
.session-complete {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.session-complete::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(74,222,128,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.session-complete.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.session-complete h2 {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -2px;
  position: relative;
}

.session-stats {
  display: flex;
  gap: 48px;
  margin: 40px 0;
  position: relative;
}

.session-stat {
  text-align: center;
}

.session-stat-value {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -2px;
}

.session-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-top: 4px;
}

.xp-gained {
  color: var(--xp-color);
  text-shadow: 0 0 20px var(--accent-glow);
}

.streak-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 40px;
  position: relative;
}

.streak-fire {
  font-size: 24px;
}

/* ===== SESSION FAILED OVERLAY ===== */
.session-failed {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.session-failed::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.session-failed.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.session-failed-icon {
  font-size: 72px;
  margin-bottom: 16px;
  filter: grayscale(0.2);
}

.session-failed h2 {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -2px;
  color: var(--danger);
  text-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
  position: relative;
}

.session-failed p {
  font-size: 17px;
  color: var(--text-secondary);
  font-weight: 300;
  position: relative;
}

/* ===== BADGE FAILED ===== */
.badge-failed {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--danger-soft);
  color: var(--danger);
  margin-left: 8px;
  vertical-align: middle;
}

/* ===== ACHIEVEMENT CARDS ===== */
.achievement-card {
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-3d);
  transition: all var(--transition);
  opacity: 0.35;
}

.achievement-card.earned {
  opacity: 1;
}

.achievement-card.earned:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: rgba(74, 222, 128, 0.4);
}

.referral-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.referral-dot.filled {
  background: var(--success);
  border-color: var(--success);
}

/* ── Upgrade to Pro View ── */
.upgrade-hero {
  text-align: center;
  padding: 48px 24px 32px;
}
.upgrade-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  animation: upgradeFadeUp 0.6s ease both;
}
.upgrade-pro-badge {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
}
.upgrade-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto;
  animation: upgradeFadeUp 0.6s 0.1s ease both;
}
.upgrade-cards {
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(360px, 1.18fr);
  gap: 18px;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
.upgrade-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: upgradeFadeUp 0.5s ease both;
  transition: all 0.3s ease;
}
.upgrade-card:hover {
  border-color: var(--border-hover);
}
.upgrade-card-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.12), 0 4px 32px rgba(74, 222, 128, 0.08);
}
.upgrade-card-current {
  border-color: var(--accent);
}
.upgrade-card-head {
  margin-bottom: 0;
}
.upgrade-card-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.upgrade-card-desc {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.upgrade-card-price {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 6px;
}
.upgrade-price-dollar {
  font-size: 22px;
  vertical-align: super;
  font-weight: 600;
  letter-spacing: 0;
}
.upgrade-price-amount {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}
.upgrade-price-period {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  letter-spacing: 0;
}
.upgrade-price-original {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-left: 10px;
  vertical-align: baseline;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.upgrade-price-original::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 52%;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  pointer-events: none;
}
.upgrade-price-uzs {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
  margin-bottom: 24px;
}
.upgrade-price-spacer {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 24px;
}
.upgrade-pro-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0 24px;
  width: 100%;
}
.upgrade-pro-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.upgrade-pro-status-row:last-child {
  border-bottom: none;
}
.upgrade-pro-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.upgrade-pro-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}
.upgrade-card-btn-wrap {
  margin-bottom: 24px;
}
.upgrade-card-btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.upgrade-card-btn-primary {
  background: var(--gradient-accent);
  color: #0a0a0a;
  border-color: transparent;
}
.upgrade-card-btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: scale(1.02);
}
.upgrade-card-btn:disabled {
  cursor: default;
}
.upgrade-card-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 24px;
}
.upgrade-card-features h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}
.upgrade-card-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upgrade-card-features li {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.upgrade-card-features li::before {
  content: '\2713';
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--success);
}
.upgrade-card-featured .upgrade-card-name {
  color: var(--accent);
}

/* ── Duration Tabs (Stripe pricing) ── */
.upgrade-duration-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.upgrade-duration-pill {
  flex: 1;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
}
.upgrade-duration-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.upgrade-duration-pill.active {
  background: var(--gradient-accent);
  color: #0a0a0a;
  border-color: transparent;
}
.upgrade-popular-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-top: 2px;
}
.upgrade-duration-pill.active .upgrade-popular-label {
  color: #0a0a0a;
}
.upgrade-price-savings {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.upgrade-trial-link {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
  cursor: pointer;
  transition: color 0.2s;
}
.upgrade-trial-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}
.upgrade-manage-billing-btn {
  background: var(--bg-elevated) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}
.upgrade-manage-billing-btn:hover {
  border-color: var(--border-hover) !important;
  color: var(--text-primary) !important;
}

/* ── Payment Failed Banner ── */
.payment-failed-banner {
  background: rgba(234, 179, 8, 0.1);
  border-bottom: 1px solid rgba(234, 179, 8, 0.2);
  color: #eab308;
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
}
.payment-failed-banner a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.payment-failed-banner a:hover {
  opacity: 0.8;
}
.light .payment-failed-banner {
  background: #fef9c3;
  border-bottom-color: #fde68a;
  color: #92400e;
}

/* ── Pro Celebration Overlay ── */
.pro-celebration-text {
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #f59e0b, #d97706, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
  animation: levelup-badge-spin 0.8s ease-out;
  filter: drop-shadow(0 0 30px rgba(245, 158, 11, 0.5));
}
.pro-glow {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.4) 0%, transparent 70%) !important;
}
.pro-title {
  text-shadow: 0 0 30px rgba(245, 158, 11, 0.5) !important;
}

/* ── Sepia: duration tabs + banner ── */
.sepia .upgrade-duration-pill.active {
  background: linear-gradient(135deg, #C37E3F, #d4944f);
  color: #fff;
}
.sepia .upgrade-duration-pill.active .upgrade-popular-label {
  color: #fff;
}
.sepia .upgrade-price-savings {
  color: #C37E3F;
}
.sepia .payment-failed-banner {
  background: rgba(195, 126, 63, 0.1);
  border-bottom-color: rgba(195, 126, 63, 0.2);
  color: #C37E3F;
}

/* ── Share Dropdown ── */
.share-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 190px;
  z-index: 50;
  padding: 4px;
  animation: dropIn 0.15s ease;
}
.share-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  white-space: nowrap;
}
.share-dropdown-item:hover {
  background: var(--bg-elevated);
}
.share-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes upgradeFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .upgrade-hero { padding: 32px 16px 24px; }
  .upgrade-title { font-size: 1.6rem; }
  .upgrade-cards { grid-template-columns: 1fr; padding: 0 16px 32px; }
  .upgrade-price-option { grid-template-columns: 1fr; gap: 11px; }
  .upgrade-price-option-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .upgrade-price-option-main span { margin-top: 0; }
  .upgrade-provider-price {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .upgrade-provider-price-payme em {
    grid-column: 2;
    justify-self: start;
    white-space: normal;
  }
}

.achievement-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.achievement-card h3 {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.achievement-card p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.3;
}

/* ===== SHARE VIEW ===== */
.shared-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 80px 32px;
}

.shared-header {
  margin-bottom: 48px;
}

.shared-header h1 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
}

.shared-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
}

.shared-content {
  font-size: 17px;
  line-height: 2;
  white-space: pre-wrap;
  font-weight: 300;
  color: var(--text-secondary);
}

.comments-section {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.comments-section h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
}

.comment {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.comment-author {
  font-weight: 600;
  font-size: 13px;
}

.comment-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}

.comment-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 300;
}

.comment-form {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.comment-form input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  background: var(--bg-card);
  color: var(--text-primary);
}

.comment-form input:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}

/* ===== ADMIN ===== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge-admin {
  background: var(--gradient-accent);
  color: white;
}

.badge-user {
  background: var(--hover-bg);
  color: var(--text-secondary);
}

.badge-free {
  background: var(--hover-bg);
  color: var(--text-secondary);
}

.badge-premium {
  background: var(--gradient-accent);
  color: white;
}

.badge-deleted {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-active {
  background: var(--success-soft);
  color: var(--success);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-weight: 300;
  font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .design-toggle {
    margin-left: auto;
  }

  .design-toggle span {
    display: none;
  }

  body.landing.dream-landing .nav {
    top: 12px;
    width: calc(100% - 24px);
  }

  body.landing.dream-landing .nav-inner {
    height: 58px;
    padding: 0 14px 0 18px;
    gap: 10px;
  }

  body.landing.dream-landing .design-toggle {
    position: absolute;
    top: 7px;
    right: 54px;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    margin-left: 0;
    z-index: 3;
    background: linear-gradient(135deg, #ff7371 0%, #f65b70 100%);
    color: #fff;
    box-shadow: 0 12px 26px rgba(246, 91, 112, 0.24);
  }

  body.landing.dream-landing .design-toggle svg {
    display: block;
  }

  body.landing.dream-landing .mobile-menu {
    position: absolute;
    top: 17px;
    right: 15px;
    z-index: 3;
  }

  body.landing.dream-landing .logo {
    min-width: 0;
    font-size: 17px;
    padding-right: 96px;
  }

  body.landing.dream-landing .logo-img {
    width: 26px;
    height: 26px;
  }

  body.landing.dream-landing .logo-knight {
    width: 15px;
    height: 15px;
  }

  body.landing.dream-landing .hero {
    padding-top: 122px;
    padding-left: 18px;
    padding-right: 18px;
    padding-bottom: 64px;
    max-width: none;
    min-height: 840px;
    background-size: auto 100%;
    background-position: center top;
    overflow: hidden;
  }

  body.landing.dream-landing .hero-title {
    max-width: min(420px, calc(100vw - 24px));
    font-size: clamp(58px, 17vw, 76px);
    line-height: 0.9;
    margin-bottom: 16px;
  }

  body.landing.dream-landing .hero::after {
    top: 106px;
    width: 24px;
    height: 24px;
    border-radius: 7px 0 7px 0;
    box-shadow:
      -27px 0 0 -10px rgba(246, 91, 112, 0.72),
      27px 0 0 -10px rgba(246, 91, 112, 0.72);
  }

  body.landing.dream-landing .hero-sub {
    max-width: min(330px, calc(100vw - 40px));
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 18px;
  }

  body.landing.dream-landing .hero-visual {
    max-width: calc(100vw - 32px);
    transform: none;
    margin-top: 12px;
  }

  body.landing.dream-landing .mock-editor {
    width: calc(100vw - 32px);
    border-radius: 22px;
  }

  body.landing.dream-landing .mock-content {
    margin: 0 12px 14px;
    padding: 24px 16px 26px;
  }

  body.landing.dream-landing .mock-line {
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
    line-height: 1.9;
    overflow-wrap: anywhere;
  }

  .ad-showcase {
    padding: 76px 18px 84px;
  }

  .ad-copy h2 {
    font-size: clamp(38px, 11vw, 48px);
    letter-spacing: 0;
  }

  body.landing.dream-landing .ad-copy h2 {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(34px, 9.5vw, 42px);
  }

  body.landing.dream-landing .ad-copy p {
    max-width: 330px;
    font-size: 16px;
  }

  .ad-option-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.landing.dream-landing .ad-option-grid {
    max-width: 340px;
  }

  .ad-option {
    min-height: auto;
  }

  .ad-video-shell {
    width: 100%;
    border-radius: 22px;
    transform: none;
  }

  .ad-video-shell:hover {
    transform: translateY(-3px);
  }

  .ad-video-bar {
    min-height: 42px;
    padding: 0 14px;
  }

  .ad-video-bar strong {
    font-size: 10px;
  }

  .ad-fly-tab {
    top: -18px;
    right: 6px;
    width: 62px;
    height: 36px;
  }

  .ad-fly-dm {
    left: -8px;
    top: 72px;
    width: 48px;
    height: 48px;
  }

  .ad-fly-ai {
    right: -8px;
    bottom: 28px;
    width: 46px;
    height: 46px;
  }

  .ad-fly-bolt,
  .ad-fly-paper {
    display: none;
  }

  body.landing.dream-landing .ad-showcase {
    padding-top: 78px;
    padding-bottom: 88px;
  }

  body.landing.dream-landing .ad-option:nth-child(2) {
    transform: none;
  }

  body.landing.dream-landing .ad-video-stage {
    min-height: 300px;
  }

  body.landing.dream-landing .ad-video-shell {
    border-width: 2px;
    border-radius: 24px;
    box-shadow: 0 22px 56px rgba(117, 71, 132, 0.18), 0 0 0 7px rgba(255, 255, 255, 0.18);
  }

  body.landing.dream-landing .hero-visual::before,
  body.landing.dream-landing .hero-visual::after {
    display: none;
  }

  body.landing.dream-landing .hero-object {
    display: none;
  }

  .hero {
    padding: 140px 24px 60px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .steps {
    flex-direction: column;
  }

  body.landing.dream-landing .steps {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .step-arrow {
    transform: rotate(90deg);
    padding: 0;
    text-align: center;
  }

  body.landing.dream-landing .step {
    max-width: 330px;
    min-height: 330px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
  }

  body.landing.dream-landing .step-arrow {
    width: 62px;
    height: 62px;
    margin: 0 auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    transform: translateX(-100%);
    z-index: 9500;
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 100px 16px 40px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .mobile-sidebar-toggle {
    display: flex;
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  /* .mobile-sidebar-overlay visibility is controlled via JS */

  .stats-inner {
    flex-direction: column;
    gap: 32px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }

  .session-stats {
    flex-direction: column;
    gap: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-fly,
  body.landing.dream-landing .step::before,
  body.landing.dream-landing .hero-visual::before,
  body.landing.dream-landing .hero-visual::after {
    animation: none;
  }
}

/* ===== LOADING ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 72px;
  left: 24px;
  padding: 14px 28px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 6000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  background: linear-gradient(135deg, rgba(239,68,68,0.9), rgba(220,38,38,0.9));
  color: white;
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.3);
}

.toast.success {
  background: var(--bg-card);
  border-color: rgba(74, 222, 128, 0.3);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(74, 222, 128, 0.1);
}
.toast-pro-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  padding: 1px 5px;
  border-radius: 8px;
  margin: 0 4px;
  vertical-align: middle;
}

/* ===== STREAK INDICATOR ===== */
.streak-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 6px;
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  border: 1px solid rgba(245, 158, 11, 0.18);
  letter-spacing: 0.03em;
  transition: background 0.2s;
}
.streak-indicator:hover {
  background: rgba(245, 158, 11, 0.14);
}
.streak-indicator .streak-fire {
  font-size: 12px;
  line-height: 1;
}

/* ===== STREAK POPUP ===== */
.streak-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 30000;
  align-items: center;
  justify-content: center;
}
.streak-popup-overlay.active {
  display: flex;
}
.streak-popup {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(245,158,11,0.15);
  min-width: 280px;
  animation: streakPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes streakPopIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.streak-popup-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}
.streak-popup-fire {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  margin-bottom: 12px;
  height: 80px;
}
.streak-flame {
  font-size: 48px;
  animation: flameFloat 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(245,158,11,0.6));
}
.streak-flame.flame-1 {
  font-size: 36px;
  animation-delay: 0.2s;
  opacity: 0.7;
}
.streak-flame.flame-2 {
  font-size: 56px;
  animation-delay: 0s;
}
.streak-flame.flame-3 {
  font-size: 36px;
  animation-delay: 0.4s;
  opacity: 0.7;
}
@keyframes flameFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}
.streak-popup-count {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  color: #f59e0b;
  line-height: 1;
  margin-bottom: 4px;
  text-shadow: 0 0 30px rgba(245,158,11,0.4);
}
.streak-popup-label {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.streak-popup-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.streak-popup-best {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== DANGEROUS MODE VISUAL ===== */
.editor-container.dangerous-active {
  transition: background-color 0.5s ease;
}

.editor-container.dangerous-active .editor-area {
  position: relative;
}

.danger-progress {
  position: fixed;
  top: 53px;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  z-index: 2001;
}

.danger-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--danger), #ff6b6b);
  transition: width 0.1s linear;
  width: 0%;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.screen-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2001;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(239, 68, 68, 0.35) 100%);
}

.screen-vignette.active {
  opacity: 1;
}

/* ===== DASHBOARD HERO ===== */
/* Two-column hero row: announcements left (33%), greeting right (67%) */
.dashboard-hero-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px; /* matches dashboard-stats-row → xp-bar-container gap */
}
.dashboard-hero-row.has-announcements {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: stretch;
}
@media (max-width: 900px) {
  .dashboard-hero-row,
  .dashboard-hero-row.has-announcements {
    grid-template-columns: 1fr !important;
  }
}

/* Compact announcements panel — title + subtitle only, click-to-expand
   Fixed-height layout so carousel slides don't jump when navigating. */
.dashboard-announcements {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-3d);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ann-slide {
  display: none;
  flex-direction: column;
  flex: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.ann-slide.active { display: flex; }
.ann-slide:hover { background: var(--bg-tertiary); }
.ann-content {
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.ann-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
/* Title takes the remaining vertical space; subtitle pinned to bottom */
.ann-title { flex: 1; display: flex; align-items: center; }
.ann-cat-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.ann-cat-update { background: rgba(99,102,241,0.15); color: #6366f1; }
.ann-cat-news { background: rgba(59,130,246,0.15); color: #3b82f6; }
.ann-cat-feature { background: rgba(34,197,94,0.15); color: #22c55e; }
.ann-cat-tip { background: rgba(245,158,11,0.15); color: #f59e0b; }
.ann-pinned { font-size: 12px; }
/* Title is the highest-priority element. Always fully shown — never
   line-clamped or shrunk. At narrow widths or high zoom it grows taller;
   subtitle and body preview yield space (or shrink to 1 line) instead. */
.ann-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.ann-title > span {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.ann-subtitle {
  font-size: clamp(11px, 1vw, 13px);
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.ann-expand-hint {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}
.ann-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 7px;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.ann-arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s;
  flex-shrink: 0;
}
.ann-arrow:hover:not(:disabled) {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}
.ann-arrow:disabled { opacity: 0.35; cursor: default; }
.ann-dots {
  display: flex;
  gap: 5px;
  flex: 1;
  justify-content: center;
}
.ann-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.15s;
}
.ann-dot.active { background: var(--accent); transform: scale(1.4); }

/* Expanded announcement modal — fade overlay + scale-in modal */
.ann-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: none;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.ann-modal-overlay.visible { display: block; }
.ann-modal-overlay.active { opacity: 1; }
.ann-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  width: min(760px, 95vw);
  max-height: 92vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  z-index: 10001;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.26s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.ann-modal.visible { display: flex; }
.ann-modal.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.ann-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s;
}
.ann-modal-close:hover { background: rgba(0,0,0,0.7); }
/* Image wrap is the flex item; pin it (no shrink) so body scrolls. */
#ann-modal-image-wrap { flex-shrink: 0; }
.ann-modal-image {
  display: block;
  width: 100%;
  max-height: min(480px, 50vh);
  object-fit: contain;
  background: var(--bg-tertiary);
}
.ann-modal-body {
  padding: 24px 32px 28px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0; /* allows the flex child to actually shrink + scroll */
}
.ann-modal-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.15;
  margin: 14px 0 12px;
  color: var(--text-primary);
}
.ann-modal-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 18px;
}
.ann-modal-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-wrap;
}
.ann-modal-link {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  background: var(--accent);
  color: #0a0a0a;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s;
}
.ann-modal-link:hover { filter: brightness(1.1); }

/* Like button */
.ann-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.ann-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
}
.ann-like-btn:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
  color: var(--text-primary);
}
.ann-like-btn.liked {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.ann-like-btn.liked:hover {
  background: rgba(239, 68, 68, 0.18);
}
.ann-like-btn .ann-like-heart {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease, fill 0.18s ease;
}
.ann-like-btn.liked .ann-like-heart {
  transform: scale(1.15);
}
.ann-like-btn .ann-like-heart path {
  transition: fill 0.18s ease;
}
.ann-like-btn:disabled { opacity: 0.5; cursor: wait; }

/* AI ✨ icon button next to admin inputs */
.ann-ai-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  margin-left: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--accent);
  transition: all 0.15s;
  vertical-align: middle;
}
.ann-ai-icon-btn:hover { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.ann-ai-icon-btn:disabled { opacity: 0.5; cursor: wait; }
.ann-ai-popover {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  padding: 10px;
  z-index: 50;
  width: 280px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 48px;
  box-shadow: var(--shadow-inset-glow);
  box-shadow: var(--shadow-3d);
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(74,222,128,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.dashboard-hero-text h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.dashboard-hero-text h1 em {
  font-style: italic;
  color: var(--accent);
}

.dashboard-hero-sub {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 300;
}

.online-indicator {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

#online-count {
  padding: 0px 3px;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.dashboard-start-btn {
  font-size: 16px;
  padding: 16px 36px;
  flex-shrink: 0;
}

/* ===== DASHBOARD STAT CARDS ===== */
.dashboard-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-3d), var(--shadow-inset-glow);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 10, 0, 0.5), 0 0 40px rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.15);
}

.dash-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74,222,128,0.18), transparent);
}

.dash-stat-emoji {
  font-size: 44px;
  margin-bottom: 10px;
  line-height: 1;
}

.dash-stat-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.dash-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dash-stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 300;
}

.dash-stat-words .dash-stat-value { color: #60a5fa; }
.dash-stat-sessions .dash-stat-value { color: #34d399; }
.dash-stat-streak .dash-stat-value { color: #fb923c; }
.dash-stat-xp .dash-stat-value { color: var(--xp-color); }

/* ===== DASHBOARD CHARTS ROW ===== */
/* --- Activity Heatmap --- */
.heatmap-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-inset-glow);
}

.heatmap-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74,222,128,0.15), transparent);
}

.heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.heatmap-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin: 0;
}

.heatmap-total {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.heatmap-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  flex: 1;
  display: flex;
  align-items: center;
}

.heatmap-scroll::-webkit-scrollbar {
  height: 4px;
}
.heatmap-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.heatmap-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.heatmap-grid {
  display: flex;
  gap: 0;
}

.heatmap-day-labels {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-right: 6px;
  flex-shrink: 0;
}

.heatmap-day-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  height: 27px;
  line-height: 27px;
  text-align: right;
  width: 26px;
}

.heatmap-weeks {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.heatmap-month-row {
  display: flex;
  gap: 5px;
  margin-bottom: 2px;
  height: 14px;
}

.heatmap-month-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  width: 27px;
  text-align: left;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: visible;
}

.heatmap-row {
  display: flex;
  gap: 5px;
}

.heatmap-cell {
  width: 27px;
  height: 27px;
  border-radius: 4px;
  background: var(--border-light);
  transition: outline 0.12s, transform 0.12s;
  flex-shrink: 0;
  cursor: default;
}

.heatmap-cell:hover {
  outline: 1.5px solid var(--text-muted);
  outline-offset: -0.5px;
  transform: scale(1.2);
  z-index: 1;
  position: relative;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.2);
}

.heatmap-cell-hidden {
  visibility: hidden;
}

.heatmap-cell[data-level="0"] {
  background: rgba(255, 255, 255, 0.04);
}

.heatmap-cell[data-level="1"] {
  background: rgba(74, 222, 128, 0.18);
}

.heatmap-cell[data-level="2"] {
  background: rgba(74, 222, 128, 0.38);
}

.heatmap-cell[data-level="3"] {
  background: rgba(74, 222, 128, 0.6);
}

.heatmap-cell[data-level="4"] {
  background: #4ade80;
}

.heatmap-cell-today {
  outline: 1.5px solid var(--accent);
  outline-offset: -0.5px;
}

.heatmap-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 3px;
}

.heatmap-legend-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  margin: 0 3px;
}

.heatmap-legend-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.heatmap-legend-cell[data-level="0"] { background: rgba(255,255,255,0.04); }
.heatmap-legend-cell[data-level="1"] { background: rgba(74,222,128,0.18); }
.heatmap-legend-cell[data-level="2"] { background: rgba(74,222,128,0.38); }
.heatmap-legend-cell[data-level="3"] { background: rgba(74,222,128,0.6); }
.heatmap-legend-cell[data-level="4"] { background: #4ade80; }

/* Light theme overrides */
@media (prefers-color-scheme: light) {
  .heatmap-cell[data-level="0"] { background: rgba(0, 0, 0, 0.04); }
  .heatmap-cell[data-level="1"] { background: rgba(74, 222, 128, 0.25); }
  .heatmap-cell[data-level="2"] { background: rgba(74, 222, 128, 0.45); }
  .heatmap-cell[data-level="3"] { background: rgba(74, 222, 128, 0.65); }
  .heatmap-legend-cell[data-level="0"] { background: rgba(0,0,0,0.04); }
  .heatmap-legend-cell[data-level="1"] { background: rgba(74,222,128,0.25); }
  .heatmap-legend-cell[data-level="2"] { background: rgba(74,222,128,0.45); }
  .heatmap-legend-cell[data-level="3"] { background: rgba(74,222,128,0.65); }
}

/* ===== DASHBOARD LAYOUT ===== */
/* Unified dashboard grid (auto-placement):
   default → heatmap | tree, then Recent Sessions full-width below.
   Test Mode (below) → heatmap | today+reflection / tree | achievements. */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  margin-bottom: 28px;
  align-items: stretch;
}
.dashboard-grid > .dashboard-recent { grid-column: 1 / -1; }

.dashboard-recent {
  margin-bottom: 0;
}

/* ===== PROFILE GRID ===== */
.profile-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

/* Settings uses a single unified scroll — no sticky/scroll per column */
.settings-layout {
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
}

.settings-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
}

.profile-left {
  min-width: 0;
}

.profile-left-inner {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-right {
  min-width: 0;
}

.profile-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-3d);
}

.profile-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

/* ===== LEADERBOARD ===== */
.lb-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 4px;
  width: fit-content;
}

.lb-tab {
  padding: 8px 20px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.lb-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.lb-tab:hover:not(.active) {
  color: var(--text-primary);
}

.leaderboard-container {
  width: calc(100% + 80px);
  max-width: none;
  margin-left: -40px;
  margin-right: -40px;
  padding-left: 40px;
  padding-right: 40px;
}

.leaderboard-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
  padding: 20px;
  width: 100%;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}

.podium-slot.empty {
  min-width: 120px;
}

.podium-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 8px;
  box-shadow: 0 4px 16px rgba(74,222,128,0.4);
}

.podium-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}
.podium-username {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 2px;
}
.lb-username {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
/* Profile links in leaderboard, friends, podium */
a.profile-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
  cursor: pointer;
}
a.profile-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
a.lb-name-link {
  color: var(--text-primary);
  font-weight: 600;
}
a.lb-name-link .lb-username {
  font-weight: 400;
}
.lb-pro-col {
  width: 24px;
  padding: 0 !important;
  text-align: center;
}
.lb-pro-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  vertical-align: middle;
  line-height: 1;
  margin-bottom: 3px;
}

.podium-words {
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.podium-pedestal {
  width: 100%;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 20px;
  position: relative;
  overflow: hidden;
}

.podium-slot:nth-child(1) .podium-pedestal {
  background: linear-gradient(180deg, rgba(192,192,192,0.15), rgba(192,192,192,0.05));
  border: 1px solid rgba(192,192,192,0.2);
}

.podium-slot:nth-child(2) .podium-pedestal {
  background: linear-gradient(180deg, rgba(255,215,0,0.15), rgba(255,215,0,0.05));
  border: 1px solid rgba(255,215,0,0.2);
  box-shadow: 0 0 30px rgba(255,215,0,0.1);
}

.podium-slot:nth-child(3) .podium-pedestal {
  background: linear-gradient(180deg, rgba(205,127,50,0.15), rgba(205,127,50,0.05));
  border: 1px solid rgba(205,127,50,0.2);
}

.podium-crown {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
  animation: crownFloat 3s ease-in-out infinite;
}

@keyframes crownFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.podium-medal {
  font-size: 36px;
  margin-bottom: 4px;
}

.podium-rank {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.leaderboard-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-3d);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.leaderboard-table td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.leaderboard-table tr:hover td {
  background: rgba(74,222,128,0.04);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.leaderboard-me td {
  background: rgba(74,222,128,0.08) !important;
}

/* ===== SUPPORT TICKETS ===== */
.ticket {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 8px;
  width: 100%;
  transition: border-color var(--transition);
}
.ticket:hover { border-color: var(--border-hover); }
.ticket-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ticket-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.ticket-type--bug { background: rgba(239,68,68,0.12); color: #ef4444; }
.ticket-type--suggestion { background: rgba(74,222,128,0.12); color: var(--accent); }
.ticket-type--feedback { background: rgba(34,197,94,0.12); color: #22c55e; }
.ticket-subject {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticket-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.ticket-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.ticket-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.ticket-status--open { background: rgba(34,197,94,0.12); color: #22c55e; }
.ticket-status--replied { background: rgba(74,222,128,0.12); color: var(--accent); }
.ticket-status--closed { background: rgba(107,114,128,0.12); color: var(--text-muted); }
.ticket-body {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}
.ticket-reply {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
}
.ticket-reply-label {
  font-weight: 700;
  color: var(--accent);
  margin-right: 4px;
}

.support-image-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 18px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.support-image-drop:hover { border-color: var(--accent); }
.support-image-drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.support-image-empty {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.support-image-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.support-image-preview img {
  max-width: 100%;
  max-height: 180px;
  border-radius: var(--radius-sm);
  display: block;
}
.support-image-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.support-image-remove:hover { background: #dc2626; }
.ticket-image-wrap { margin-top: 8px; }
.ticket-image-user {
  max-width: 240px;
  max-height: 160px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
}
.support-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.support-lightbox img {
  max-width: 95vw;
  max-height: 92vh;
  border-radius: 8px;
}
.support-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 22px;
  cursor: pointer;
}
.support-lightbox-close:hover { background: rgba(255,255,255,0.25); }

.lb-rank {
  font-weight: 600;
  font-size: 16px;
  min-width: 40px;
  text-align: center;
}

.lb-col-time,
.lb-col-words,
.lb-col-streak,
.lb-col-sessions,
.lb-col-level {
  text-align: center;
}

.lb-name {
  font-weight: 600;
  color: var(--text-primary);
}

.lb-you {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 1px;
}

.lb-level {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--xp-color);
}

/* Light mode podium: overrides moved to main .light theme section above */

/* ===== LANDING 3D ANIMATIONS ===== */
.landing .hero-title {
  animation: heroTitleIn 1s ease-out;
}

@keyframes heroTitleIn {
  from {
    opacity: 0;
    transform: translateY(40px) perspective(600px) rotateX(10deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) perspective(600px) rotateX(0deg);
  }
}

.landing .hero-sub {
  animation: fadeSlideUp 1s ease-out 0.3s both;
}

.landing .hero-actions {
  animation: fadeSlideUp 1s ease-out 0.5s both;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing .hero-visual {
  animation: heroVisualIn 1.2s ease-out 0.7s both;
}

@keyframes heroVisualIn {
  from {
    opacity: 0;
    transform: translateY(60px) perspective(1200px) rotateX(15deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) perspective(1200px) rotateX(4deg) scale(1);
  }
}

.landing .mock-editor {
  animation: float3d 6s ease-in-out infinite 2s;
}

@keyframes float3d {
  0%, 100% {
    transform: rotateX(4deg) translateY(0);
  }
  50% {
    transform: rotateX(2deg) translateY(-10px);
  }
}

.landing .feature-card[data-aos].visible {
  animation: card3dIn 0.6s ease-out both;
}

@keyframes card3dIn {
  from {
    opacity: 0;
    transform: translateY(30px) perspective(600px) rotateX(5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) perspective(600px) rotateX(0deg);
  }
}

.landing .stat-num {
  animation: countPulse 3s ease-in-out infinite;
}

@keyframes countPulse {
  0%, 100% { text-shadow: 0 0 30px var(--accent-glow); }
  50% { text-shadow: 0 0 60px var(--accent-glow), 0 0 100px rgba(74,222,128,0.15); }
}

.landing .step.visible {
  animation: step3dIn 0.6s ease-out both;
}

@keyframes step3dIn {
  from {
    opacity: 0;
    transform: translateY(40px) perspective(400px) rotateY(5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) perspective(400px) rotateY(0deg);
  }
}

.landing .cta h2 {
  animation: ctaPulse 4s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.landing .btn-primary {
  position: relative;
  overflow: hidden;
}

.landing .btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
  0% { transform: translateX(-100%) rotate(45deg); }
  30%, 100% { transform: translateX(100%) rotate(45deg); }
}

/* ===== RESPONSIVE DASHBOARD ===== */
@media (max-width: 768px) {
  .dashboard-hero {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 28px;
  }

  .dashboard-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .heatmap-section {
    overflow-x: auto;
  }

  .profile-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .settings-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .profile-left-inner {
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  .leaderboard-podium {
    gap: 8px;
    padding: 12px 8px;
    margin-bottom: 24px;
    justify-content: flex-start;
  }

  .podium-slot {
    min-width: 0;
    flex: 1 1 0;
    max-width: 120px;
  }

  .podium-avatar {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }

  .podium-name {
    font-size: 12px;
    text-align: left;
  }

  .podium-words {
    font-size: 11px;
  }

  .leaderboard-container {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .leaderboard-table-wrap {
    border-radius: var(--radius);
  }

  /* Hide Sessions, Words, Level columns on mobile */
  .lb-col-sessions,
  .lb-col-words,
  .lb-col-level {
    display: none;
  }

  /* Streaks tab: show Streak, hide Time */
  .lb-tab-streaks .lb-col-time {
    display: none;
  }

  /* Time tab: show Writing Time, hide Streak */
  .lb-tab-time .lb-col-streak {
    display: none;
  }
  .lb-tab-time .lb-col-time {
    display: table-cell;
  }

  .lb-pro-col {
    width: 18px;
    padding: 0 !important;
  }

  .leaderboard-table {
    table-layout: auto;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 11px 10px;
    font-size: 13px;
    text-align: left;
  }

  .leaderboard-table th {
    font-size: 9px;
    padding: 10px 10px;
  }

  .leaderboard-table th:first-child,
  .leaderboard-table td.lb-rank {
    width: 40px;
    text-align: center;
    padding-left: 6px;
    padding-right: 6px;
  }

  .leaderboard-table td.lb-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ===== AUTH BACK BUTTON ===== */
.auth-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 10;
}
.auth-back-btn:hover {
  color: var(--text-primary);
}

/* ===== PASSWORD FIELD WITH EYE TOGGLE ===== */
.auth-pw-wrap {
  position: relative;
}
.auth-pw-wrap input {
  padding-right: 44px;
}
.pw-eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.pw-eye-btn:hover { color: var(--text-primary); }
.pw-eye-btn svg { width: 16px; height: 16px; }

/* ===== MONSTERS (positioned within auth-monsters-panel) ===== */

/* ===== CUSTOM TIME INPUT ===== */
.time-preset-add {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  min-width: auto;
}
.time-custom-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.time-custom-row input {
  width: 90px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.time-custom-row input:focus {
  border-color: var(--accent);
}
.time-custom-row input::-webkit-inner-spin-button,
.time-custom-row input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.time-custom-row input[type="number"] {
  -moz-appearance: textfield;
}
.input-suffix {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Hide arrows on target word count input too */
#session-target-words::-webkit-inner-spin-button,
#session-target-words::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#session-target-words {
  -moz-appearance: textfield;
}

/* ===== HELP VIEW ===== */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.help-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-3d);
  position: relative;
  overflow: hidden;
}
.help-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
}
.help-icon {
  font-size: 24px;
  margin-bottom: 10px;
  line-height: 1;
}
.help-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.help-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0;
}
.help-list {
  margin: 10px 0 0 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.help-list li {
  margin-bottom: 4px;
}
.help-mode {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.help-mode p {
  margin-top: 8px;
  font-size: 13px;
}
.help-mode-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.normal-badge {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-glow);
}
.danger-badge {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
@media (max-width: 768px) {
  .help-grid { grid-template-columns: 1fr; }
  .help-buttons-grid { grid-template-columns: 1fr !important; }
}

/* ===== HELP BUTTONS + POPUP ===== */
.help-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 20px;
  max-width: 700px;
  position: relative;
}
.release-notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
  max-width: 700px;
}
.release-note-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  color: var(--text-primary);
}
.release-note-btn:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.release-note-version {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
  flex-shrink: 0;
  min-width: 36px;
}
.release-note-desc {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

.help-topic-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-sans);
  position: relative;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.help-topic-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.help-topic-icon {
  font-size: 26px;
  flex-shrink: 0;
}
.help-topic-title {
  font-size: 14px;
  font-weight: 600;
}
.help-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: none;
}
.help-popup-overlay.visible { display: block; }
.help-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 480px;
  max-width: 90vw;
  max-height: 75vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 201;
  overflow-y: auto;
  padding: 28px;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.help-popup.visible {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.help-popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: var(--transition);
}
.help-popup-close:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}
.help-popup-body h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}
.help-popup-body p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}
.help-popup-body ul, .help-popup-body ol {
  margin: 8px 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.help-popup-body li { margin-bottom: 4px; }

/* ===== TREE CANVAS CENTERING ===== */
#tree-canvas {
  display: block;
  margin: 0 auto;
}

/* ===== AUTH SPLIT LAYOUT ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--bg-primary);
  position: relative;
  padding: 0;
}

.auth-monsters-panel {
  flex: 1;
  position: relative;
  background: linear-gradient(135deg, rgba(59,130,246,0.06) 0%, rgba(74,222,128,0.07) 50%, rgba(167,139,250,0.04) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 100vh;
}

.auth-monsters-panel::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(74,222,128,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.auth-form-panel {
  width: 480px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  position: relative;
}

.auth-back-btn {
  position: absolute;
  top: 24px;
  left: 24px;
}

.auth-card {
  max-width: 380px;
  width: 100%;
  position: relative;
}

#auth-monsters {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-monster {
  position: absolute;
  opacity: 0;
  animation: monsterEntrance 0.8s ease-out forwards;
}

@keyframes monsterEntrance {
  0% { opacity: 0; transform: translateX(-50%) scale(0.3) translateY(30px); }
  60% { opacity: 1; transform: translateX(-50%) scale(1.05) translateY(-5px); }
  100% { opacity: 0.92; transform: translateX(-50%) scale(1) translateY(0); }
}

@keyframes monsterFloat1 {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-12px); }
}

@keyframes monsterFloat2 {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  50% { transform: translateX(-50%) translateY(-8px) rotate(3deg); }
}

@keyframes monsterFloat3 {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
  50% { transform: translateX(-50%) translateY(-15px) rotate(-2deg); }
}

@keyframes monsterFloat4 {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  33% { transform: translateX(-50%) translateY(-6px); }
  66% { transform: translateX(-50%) translateY(-10px); }
}

/* Monsters positioned around the iWrite4.me title (title sits near center vertically ~48%) */
.auth-monster-1 {
  left: 18%; top: 28%;
  animation: monsterEntrance 0.8s ease-out forwards, monsterFloat1 4s ease-in-out 0.8s infinite;
}
.auth-monster-2 {
  left: 68%; top: 22%;
  animation: monsterEntrance 0.8s ease-out 0.15s forwards, monsterFloat2 5s ease-in-out 0.95s infinite;
}
.auth-monster-3 {
  left: 12%; top: 60%;
  animation: monsterEntrance 0.8s ease-out 0.3s forwards, monsterFloat3 4.5s ease-in-out 1.1s infinite;
}
.auth-monster-4 {
  left: 72%; top: 58%;
  animation: monsterEntrance 0.8s ease-out 0.45s forwards, monsterFloat4 3.5s ease-in-out 1.25s infinite;
}

@media (max-width: 900px) {
  .auth-monsters-panel { display: none; }
  .auth-form-panel { width: 100%; min-height: 100vh; }
}

/* ===== AUTH REDESIGN ===== */
.auth-container {
  background: #f7f4ec;
}

.auth-visual-panel {
  flex: 1 1 50%;
  min-width: 0;
  border-right: 0;
  background:
    linear-gradient(135deg, rgba(22, 99, 79, 0.88), rgba(77, 95, 230, 0.76)),
    #16634f;
}

.auth-visual-panel::before {
  display: none;
}

.auth-visual-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #f7f2ea;
}

.auth-visual-bg-layer {
  position: absolute;
  inset: 0;
  display: block;
  background-position: center bottom;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  filter: saturate(0.94);
  transform: scale(1.02);
  transition: opacity 520ms ease;
}

.auth-visual-bg-layer.active,
.auth-visual-bg-layer.leaving {
  opacity: 1;
}

.auth-visual-bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(22, 99, 79, 0.50), rgba(143, 215, 173, 0.22));
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 80px));
  display: grid;
  justify-items: center;
  text-align: center;
  color: #ffffff;
}

.auth-visual-brand {
  position: absolute;
  top: -170px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 560;
  letter-spacing: 0;
}

.auth-visual-logo {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.auth-visual-slides {
  position: relative;
  width: 100%;
  min-height: 330px;
}

.auth-visual-slide {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 420ms ease, transform 420ms ease;
  pointer-events: none;
}

.auth-visual-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.auth-visual-icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin-bottom: 32px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-visual-icon svg {
  width: 42px;
  height: 42px;
}

.auth-visual-slide h1 {
  max-width: 460px;
  margin: 0 0 24px;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: clamp(32px, 3.5vw, 46px);
  font-weight: 520;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-visual-slide p {
  max-width: 470px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 19px;
  line-height: 1.55;
}

.auth-visual-dots {
  display: flex;
  gap: 10px;
  margin-top: 46px;
}

.auth-visual-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: width 220ms ease, background 220ms ease;
}

.auth-visual-dots button.active {
  width: 24px;
  border-radius: 999px;
  background: #ffffff;
}

.auth-visual-panel #auth-monsters {
  display: none;
}

.auth-form-panel {
  flex: 1 1 50%;
  width: auto;
  min-width: 520px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.86), transparent 42%),
    linear-gradient(180deg, #fffdf8 0%, #f7f4ec 100%);
  color: #17231f;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
}

.auth-back-btn {
  color: rgba(34, 52, 46, 0.58);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.auth-back-btn:hover {
  color: #17231f;
}

.auth-card {
  max-width: 480px;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
}

.auth-card .auth-card-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 30px;
  color: #17231f;
  text-decoration: none;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 560;
  letter-spacing: 0;
}

.auth-card-logo-mark {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 6px;
  margin-bottom: 34px;
  border: 1px solid rgba(42, 55, 48, 0.10);
  border-radius: 14px;
  background: rgba(22, 99, 79, 0.06);
}

.auth-mode-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(34, 52, 46, 0.58);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.auth-mode-tabs button.active {
  background: #16634f;
  color: #ffffff;
}

.auth-form-stack[hidden] {
  display: none;
}

.auth-card h2 {
  color: #17231f;
  text-align: left;
  margin-bottom: 10px;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: 36px;
  font-weight: 560;
  letter-spacing: 0;
}

.auth-card .auth-sub {
  color: rgba(34, 52, 46, 0.62);
  text-align: left;
  margin-bottom: 34px;
  font-size: 17px;
}

.auth-card .auth-field label,
.auth-password-row label {
  color: rgba(34, 52, 46, 0.78);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.auth-password-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.auth-password-row label {
  margin: 0;
}

.auth-password-row a {
  color: #16634f;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.auth-card .auth-field input {
  min-height: 54px;
  border-color: rgba(42, 55, 48, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #17231f;
}

.auth-card .auth-field input::placeholder {
  color: rgba(34, 52, 46, 0.36);
}

.auth-card .auth-field input:focus {
  border-color: rgba(143, 215, 173, 0.72);
  box-shadow: 0 0 0 4px rgba(22, 99, 79, 0.28);
}

.auth-submit-btn {
  width: 100%;
  min-height: 58px;
  margin-top: 6px;
  border-radius: 14px;
  background: #16634f;
  border-color: #16634f;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.auth-submit-btn:hover:not(:disabled) {
  background: #1c765f;
  border-color: #1c765f;
  transform: translateY(-1px);
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin: 30px 0 24px;
  color: rgba(34, 52, 46, 0.42);
  font-size: 14px;
}

.oauthButton {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  overflow: hidden;
  border: 2px solid rgba(23, 35, 31, 0.82);
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 4px 4px rgba(23, 35, 31, 0.82);
  font: inherit;
  font-size: 15px;
  font-weight: 680;
  cursor: pointer;
  transition: color 250ms ease, transform 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
}

.oauthButton::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: 0;
  background: transparent;
  transition: width 250ms ease;
}

.oauthButton:hover {
  color: #111827;
  border-color: #111827;
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px #111827;
}

.oauthButton:hover::before {
  width: 0;
}

.oauthButton .icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  height: 1px;
  background: rgba(42, 55, 48, 0.12);
}

.auth-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: start;
  margin: 4px 0 18px;
  color: rgba(34, 52, 46, 0.68);
  font-size: 13px;
  line-height: 1.45;
}

.auth-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: #16634f;
}

.auth-consent a,
.verification-copy strong,
.auth-resend-button {
  color: #16634f;
}

.register-verification {
  padding-top: 8px;
}

.verification-copy {
  margin: 0 0 24px;
  color: rgba(34, 52, 46, 0.66);
  font-size: 15px;
  line-height: 1.55;
}

.verification-code-field {
  margin-bottom: 22px;
}

.verification-code-value {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: -1px;
  padding: 0 !important;
  overflow: hidden;
  border: 0 !important;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.verification-code-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.auth-card .auth-field .verification-code-box {
  width: 100%;
  min-height: 58px;
  padding: 0;
  border: 1px solid rgba(42, 55, 48, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: #17231f;
  box-shadow: 0 12px 28px rgba(23, 35, 31, 0.06);
  font-family: "DM Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  caret-color: #16634f;
}

.auth-card .auth-field .verification-code-box:focus {
  border-color: rgba(22, 99, 79, 0.78);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(22, 99, 79, 0.16), 0 12px 28px rgba(23, 35, 31, 0.08);
}

.auth-resend-button {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.auth-resend-button:hover {
  color: #0f8067;
}

.auth-switch {
  color: rgba(34, 52, 46, 0.52);
}

.auth-switch a {
  color: #16634f;
  text-decoration: none;
}

.auth-error {
  color: #b42318;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
}

.auth-form-panel .auth-card-logo span,
.auth-form-panel .auth-card-logo {
  color: #17231f;
}

@media (max-width: 980px) {
  .auth-visual-panel {
    display: none;
  }

  .auth-form-panel {
    min-width: 0;
    width: 100%;
    min-height: 100vh;
    padding: 86px 24px 48px;
  }

  .verification-code-grid {
    gap: 8px;
  }

  .auth-card .auth-field .verification-code-box {
    min-height: 52px;
    border-radius: 12px;
    font-size: 23px;
  }
}

/* ===== LEADERBOARD GAP REDUCTION ===== */
#view-leaderboard .dashboard-header {
  margin-bottom: 16px;
}

/* ===== NOTIFICATION BADGE ===== */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  margin-left: auto;
  line-height: 1;
}

/* ===== HISTORY MODAL ===== */
.history-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.history-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.history-stat-val {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.history-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== DANGEROUS COUNTDOWN OVERLAY ===== */
.danger-countdown {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.danger-countdown.active {
  opacity: 1;
  visibility: visible;
}

.danger-countdown-inner {
  text-align: center;
}

.danger-countdown-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--danger);
  margin-bottom: 24px;
  opacity: 0.8;
}

.danger-countdown-num {
  font-family: var(--font-display);
  font-size: 180px;
  font-weight: 700;
  line-height: 1;
  color: var(--danger);
  text-shadow: 0 0 80px rgba(239, 68, 68, 0.5);
  animation: dangerCountPulse 1s ease infinite;
}

.danger-countdown-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 24px;
  font-weight: 300;
}

@keyframes dangerCountPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ===== STAT VALUES (compact redesign) ===== */

@media (max-width: 768px) {
  .history-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-monsters-panel { display: none; }
}

/* ===== COMMENT SYSTEM ===== */
.comment-highlight {
  background: rgba(255, 213, 79, 0.25);
  border-bottom: 2px solid rgba(255, 213, 79, 0.5);
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 2px;
}
.comment-highlight:hover,
.comment-highlight.active {
  background: rgba(255, 213, 79, 0.45);
}

.comment-add-btn {
  position: absolute;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 3000;
  display: none;
  white-space: nowrap;
}
.comment-add-btn:hover {
  background: var(--bg-card-hover);
}

.comments-panel {
  position: fixed;
  right: 0;
  top: 56px;
  width: 300px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 2001;
  display: none;
}
.comments-panel.active {
  display: block;
}
.comments-panel-header {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.comment-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
  transition: var(--transition);
}
.comment-bubble:hover {
  border-color: rgba(255, 213, 79, 0.4);
}
.comment-bubble-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.comment-bubble-author {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}
.comment-bubble-date {
  font-size: 11px;
  color: var(--text-muted);
}
.comment-bubble-quote {
  font-size: 12px;
  color: var(--text-muted);
  border-left: 2px solid rgba(255, 213, 79, 0.6);
  padding-left: 8px;
  margin: 8px 0;
  font-style: italic;
  line-height: 1.5;
}
.comment-bubble-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.comment-bubble-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.comment-resolve-btn {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.comment-resolve-btn.accept:hover {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}
.comment-resolve-btn.reject:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.comment-input-popup {
  position: absolute;
  z-index: 3001;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-lg);
  width: 280px;
  display: none;
}
.comment-input-popup.active {
  display: block;
}
.comment-input-popup textarea {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-sans);
  resize: vertical;
  outline: none;
}
.comment-input-popup textarea:focus {
  border-color: var(--accent);
}
.comment-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

/* Editor with comments panel open */
.editor-container.has-comments .editor-area {
  padding-right: 316px;
}

/* Shared page comments layout */
.shared-with-comments {
  display: flex;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.shared-main {
  flex: 1;
  min-width: 0;
}
.shared-comments-sidebar {
  width: 300px;
  flex-shrink: 0;
  padding-top: 20px;
}

/* ===== RIGHT SIDEBAR (History / Comment History) ===== */
.right-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 10000;
}
.right-sidebar-overlay.active {
  display: block;
}
/* ───── Duels matchmaking ───── */
.duel-matchmaking {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-3d);
}
.duel-mm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.duel-mm-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.duel-mm-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.duel-mm-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(74,222,128,0.12);
  color: #4ade80;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid rgba(74,222,128,0.3);
  cursor: pointer;
  transition: background 0.15s ease;
}
.duel-mm-pulse:hover { background: rgba(74,222,128,0.2); }
.duel-mm-pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74,222,128,0.7);
  animation: duelMmPulse 1.6s ease-out infinite;
}
@keyframes duelMmPulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.7); }
  70% { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.duel-mm-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.duel-mm-duration {
  display: inline-flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.duel-mm-dur-btn {
  padding: 6px 12px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.duel-mm-dur-btn:hover { color: var(--text-primary); }
.duel-mm-dur-btn.active {
  background: rgba(74,222,128,0.12);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74,222,128,0.18);
}
.duel-mm-find-btn { padding: 8px 18px; }

/* Custom (PRO) duration pill */
.duel-mm-dur-custom {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: visible; /* let the PRO chip break out of the pill */
}
.duel-mm-pro-badge {
  position: absolute;
  top: -7px;
  right: -10px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(245,158,11,0.4);
  pointer-events: none;
  line-height: 1;
}
.duel-mm-custom-input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

/* Lobby popover (per-duration breakdown) */
.duel-mm-lobby-popover {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
}
.duel-mm-lobby-head {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
/* Active Lobbies — vertical list of long, wide rows. One row per waiting user. */
.duel-mm-lobby-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.duel-mm-lobby-row:last-child { margin-bottom: 0; }
.duel-mm-lobby-row:hover { border-color: rgba(74,222,128,0.4); }
.duel-mm-lobby-user { min-width: 0; }
.duel-mm-lobby-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.duel-mm-lobby-pro {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.duel-mm-lobby-username {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.duel-mm-lobby-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.duel-mm-lobby-stat-label {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}
.duel-mm-lobby-dur {
  color: var(--text-primary);
  font-weight: 700;
}
.duel-mm-lobby-wait { color: #4ade80; font-weight: 700; }
.duel-mm-lobby-join-btn {
  position: relative;
  padding: 10px 28px;
  font-size: 13px;
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.18s ease, filter 0.15s ease;
  box-shadow: 0 2px 8px rgba(74,222,128,0.25);
  min-width: 110px;
}
.duel-mm-lobby-join-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 18px rgba(74,222,128,0.45);
  filter: brightness(1.08);
}
.duel-mm-lobby-join-btn:active { transform: translateY(0) scale(1); }
.duel-mm-lobby-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 20px 0;
  font-size: 12px;
}
@media (max-width: 600px) {
  .duel-mm-lobby-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .duel-mm-lobby-join-btn { width: 100%; }
}
.duel-mm-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 8px;
  gap: 12px;
}
.duel-mm-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: duelMmSpin 0.85s linear infinite;
}
@keyframes duelMmSpin { to { transform: rotate(360deg); } }
.duel-mm-waiting-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}
.duel-mm-waiting-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.duel-mm-cancel-btn {
  margin-top: 4px;
  padding: 8px 22px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.duel-mm-cancel-btn:hover {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.4);
  color: #ef4444;
}
.duel-mm-waiting-timeout {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -2px;
}

/* Strip native number input spinners on the custom-duration input */
.duel-mm-custom-input::-webkit-outer-spin-button,
.duel-mm-custom-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.duel-mm-custom-input { -moz-appearance: textfield; appearance: textfield; }

/* Sidebar duels-nav indicator — green chip with count when others are looking */
.duels-lobby-pulse {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(74,222,128,0.15);
  border: 1px solid rgba(74,222,128,0.4);
  color: #4ade80;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1;
}
.duels-lobby-pulse::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  animation: duelsLobbyPulse 1.6s ease-out infinite;
}
@keyframes duelsLobbyPulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.7); }
  70% { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* Back-to-top floating button (community tab) */
.back-to-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
  z-index: 100;
}
.back-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}
.back-to-top-btn:active {
  transform: translateY(0);
}

/* Subscription history button — top right of upgrade view */
.sub-history-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 2;
}
.sub-history-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* Subscription history sidebar entries */
.sub-history-entry {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.sub-history-entry:last-child { border-bottom: none; }
.sub-history-entry-left { flex: 1; min-width: 0; }
.sub-history-entry-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sub-history-entry-meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 4px;
}
.sub-history-entry-subtitle {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
  opacity: 0.8;
}
.sub-history-entry-right {
  text-align: right;
  flex-shrink: 0;
}
.sub-history-entry-amount {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}
.sub-history-entry-amount-muted {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}
.sub-history-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.sub-history-tag-paid { background: rgba(34,197,94,0.12); color: #22c55e; }
.sub-history-tag-trial { background: rgba(99,102,241,0.12); color: #818cf8; }
.sub-history-tag-renewed { background: rgba(59,130,246,0.12); color: #3b82f6; }
.sub-history-tag-cancelled { background: rgba(239,68,68,0.12); color: #ef4444; }
.sub-history-tag-failed { background: rgba(245,158,11,0.12); color: #f59e0b; }
.sub-history-tag-expired { background: rgba(156,163,175,0.12); color: #9ca3af; }
.sub-history-tag-promo { background: rgba(236,72,153,0.12); color: #ec4899; }
.sub-history-tag-admin { background: rgba(168,85,247,0.12); color: #a855f7; }
.sub-history-tag-referral { background: rgba(20,184,166,0.12); color: #14b8a6; }
.sub-history-current {
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.sub-history-current-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 4px;
}
.sub-history-current-row:first-child { margin-top: 0; }
.sub-history-current-label { color: var(--text-muted); }
.sub-history-current-value { color: var(--text-primary); font-weight: 500; }

.right-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  padding: 0 20px 20px;
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.right-sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.right-sidebar-body::-webkit-scrollbar {
  display: none;
}
.right-sidebar.active {
  right: 0;
}
.right-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  flex-shrink: 0;
}
.right-sidebar-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.right-sidebar-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: var(--transition);
}
.right-sidebar-close:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

/* ===== IN-APP BANNER (top notification) ===== */
.in-app-banner {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  pointer-events: none;
  white-space: nowrap;
  transition: top 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.in-app-banner.active {
  top: 24px;
}

/* ===== AUTH BRAND TITLE (monsters panel) ===== */
.auth-brand-title {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 6px;
  line-height: 1;
}
.auth-brand-i {
  font-family: 'Archivo', sans-serif;
  font-size: 80px;
  font-weight: 900;
  color: var(--accent);
  display: inline-block;
  letter-spacing: -4px;
  text-shadow: 0 0 40px rgba(74,222,128,0.4);
  font-style: normal;
}
.auth-brand-write {
  font-family: 'Archivo', sans-serif;
  font-size: 80px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -3px;
  display: inline-block;
}
.auth-brand-sub {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
}

/* Failed session tag in history */
.session-fail-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  margin-left: 4px;
}
.session-danger-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.10);
  color: var(--danger);
  margin-left: 4px;
}
.session-tab-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(245,158,11,0.12);
  color: var(--warning);
  margin-left: 4px;
}
.session-left-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(107,114,128,0.12);
  color: var(--text-muted);
  margin-left: 4px;
}
.session-admin-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(74,222,128,0.12);
  color: var(--accent);
  margin-left: 4px;
}
.session-entry {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  gap: 8px;
}
.session-entry.failed-entry {
  opacity: 0.7;
}
.session-entry.admin-deactivated-entry {
  opacity: 0.75;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

/* ===== FOLDER SYSTEM ===== */
.folder-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
  transition: all var(--transition);
  margin-bottom: 8px;
}
.folder-back-link:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.folder-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.folder-breadcrumb-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.folder-breadcrumb-link:hover {
  background: var(--accent-soft);
}
.folder-breadcrumb-sep {
  color: var(--text-muted);
  font-size: 11px;
}
.folder-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.folder-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  box-shadow: var(--shadow);
  min-height: 44px;
}
.folder-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}
.folder-card-icon {
  font-size: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--accent);
}
.folder-card-icon svg {
  width: 18px;
  height: 18px;
}
.folder-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.folder-card-count {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
}
.folder-card-menu {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
  flex-shrink: 0;
  margin-left: 4px;
  letter-spacing: 1px;
}
.folder-card-menu:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

/* Folder context menu */
.folder-context-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 10000;
  min-width: 140px;
}
.folder-context-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
}
.folder-context-menu button:hover {
  background: var(--hover-bg);
}
.folder-context-menu button svg {
  vertical-align: -2px;
  margin-right: 6px;
}

/* Document card three-dots menu */
.doc-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-mode-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 3px 7px;
  border-radius: 8px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.doc-mode-badge.doc-mode-time {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #1a1a1a;
}
.doc-mode-badge.doc-mode-dangerous {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
}
.doc-mode-badge.doc-mode-zen {
  background: linear-gradient(135deg, #9ca3af, #6b7280);
  color: #fff;
}
.doc-mode-badge.doc-mode-research {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}

.doc-card-menu-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  transition: var(--transition);
}
.doc-card-menu-btn:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

/* Pagination */
.docs-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 0;
}
.docs-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.docs-pagination-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.docs-pagination-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.docs-pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

/* Finder-style folder picker */
.finder-picker {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}
.finder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.finder-back {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  padding: 0;
  font-weight: 500;
}
.finder-back:hover {
  text-decoration: underline;
}
.finder-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.finder-current-loc {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.finder-current-loc strong {
  color: var(--text-secondary);
}
.finder-list {
  max-height: 260px;
  overflow-y: auto;
}
.finder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-light);
}
.finder-row:last-child {
  border-bottom: none;
}
.finder-row:hover {
  background: var(--hover-bg);
}
.finder-row.selected {
  background: var(--accent-soft);
}
.finder-row-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.finder-row-name {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finder-row-current {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.finder-row.current {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}
.finder-row-depth-0 .finder-row-name {
  font-weight: 600;
  font-size: 14px;
}
.finder-row-arrow {
  color: var(--text-muted);
  font-size: 16px;
  flex-shrink: 0;
}
.finder-empty {
  padding: 20px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== IN-APP CONFIRM DIALOG ===== */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 20000;
  align-items: center;
  justify-content: center;
}
.confirm-overlay.active {
  display: flex;
}
.confirm-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 380px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.confirm-message {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.confirm-actions .btn {
  min-width: 90px;
}

/* Editor container layout with format bar */
.editor-container {
  display: flex;
  flex-direction: column;
}

/* ===== GOOGLE SIGN-IN ===== */
.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  overflow: visible;
}
.google-signin-btn > div {
  overflow: visible !important;
  flex-shrink: 0;
}
.google-signin-btn iframe {
  border-radius: 6px !important;
  overflow: visible !important;
  clip-path: none !important;
  margin: 0 !important;
}

/* ===== PLAN BADGE ===== */
.user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none !important;
  color: inherit;
  padding: 0;
}
.plan-badge-pill {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  line-height: 1.4;
}
.plan-badge.pro .plan-badge-pill {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
}
.plan-badge.pro .plan-badge-pill.plan-badge-sub {
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0.2px;
}
button.plan-badge-pill.plan-badge-days {
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px 8px;
  line-height: 1.4;
  transition: filter 0.15s;
}
button.plan-badge-pill.plan-badge-days:hover { filter: brightness(1.15); }
.plan-badge-days-num,
.plan-badge-days-label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.plan-badge-days-label {
  transform: translateY(-1px);
}

/* Reusable inline PRO badge — used in friends list, activity feed, duels */
.pro-inline-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
  margin-right: 3px;
  vertical-align: middle;
  line-height: 1;
}

/* ===== PRICING MODAL ===== */
/* ── Pro Lock Overlay ── */
.pro-lock-wrap {
  position: relative;
}
.pro-lock-wrap.locked > *:not(.pro-lock-overlay) {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}
.pro-lock-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pro-lock-wrap.locked .pro-lock-overlay {
  display: flex;
}
.pro-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.3);
}
.pro-lock-badge svg {
  width: 14px;
  height: 14px;
}

/* Pro peek animation — brief unblur to tease content */
.pro-lock-wrap.locked.pro-peeking > *:not(.pro-lock-overlay) {
  filter: blur(0px);
  transition: filter 0.3s ease;
}
.pro-lock-wrap.locked > *:not(.pro-lock-overlay) {
  transition: filter 0.3s ease;
}

/* Pro upgrade card — shows after peek */
.pro-upgrade-card {
  position: fixed;
  z-index: 10001;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  max-width: 260px;
  animation: proCardIn 0.25s ease;
  pointer-events: auto;
}
.pro-upgrade-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--text-primary);
}
.pro-upgrade-card p {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.pro-upgrade-card button {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.pro-upgrade-card button:hover {
  filter: brightness(1.1);
}
@keyframes proCardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pricing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 20000;
  align-items: center;
  justify-content: center;
}
.pricing-overlay.active {
  display: flex;
}
.pricing-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 680px;
  width: 92%;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.pricing-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.pricing-close:hover {
  color: var(--text-primary);
}
.pricing-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.pricing-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}
.pricing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.pricing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  background: var(--bg-card);
  transition: all 0.3s ease;
}
.pricing-card:hover {
  border-color: var(--border-hover);
}
.pricing-card.pro {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.12), 0 4px 32px rgba(74, 222, 128, 0.08);
}
.pricing-card.current {
  border-color: var(--accent);
}
.pricing-card-soon-wrap {
  overflow: hidden;
}
.pricing-soon-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(5px);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.pricing-soon-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}
.pricing-current-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-top: 12px;
}
.pricing-popular {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-accent);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.pricing-card-header h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
/* pricing-original: see unified rule below */
.pricing-uzs {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
  margin-bottom: 24px;
}
.pricing-price {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 6px;
}
.pricing-card.pro .pricing-price {
  /* inherits from parent */
}
.pricing-price .pricing-currency {
  font-size: 22px;
  vertical-align: super;
  font-weight: 600;
  letter-spacing: 0;
}
.pricing-price .pricing-period {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  letter-spacing: 0;
}
.pricing-original {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-left: 10px;
  margin-bottom: 6px;
  vertical-align: baseline;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.pricing-original::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 52%;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  pointer-events: none;
}
.pricing-original-dollar,
.pricing-original-num {
  font-size: inherit;
}
.pricing-features {
  list-style: none;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pricing-features li {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pricing-features li::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pricing-features li.yes::before {
  content: '\2713';
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pricing-features li.no {
  color: var(--text-secondary);
}
.pricing-features li.no::before {
  content: '\2717';
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  opacity: 0.75;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pricing-btn {
  margin-top: auto;
}
@media (max-width: 600px) {
  .pricing-cards {
    grid-template-columns: 1fr;
  }
  .pricing-modal {
    padding: 28px 20px;
  }
}

/* ===== LEVEL UP CELEBRATION ===== */
.levelup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 25000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.levelup-overlay.active {
  opacity: 1;
}
.levelup-modal {
  text-align: center;
  position: relative;
  animation: levelup-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes levelup-pop {
  0% { transform: scale(0.3) translateY(40px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.levelup-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.4) 0%, transparent 70%);
  animation: levelup-glow-pulse 2s ease-in-out infinite;
}
@keyframes levelup-glow-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}
.levelup-badge {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 20px;
  box-shadow: 0 0 40px rgba(74, 222, 128, 0.5), 0 0 80px rgba(74, 222, 128, 0.2);
  position: relative;
  z-index: 1;
  animation: levelup-badge-spin 0.8s ease-out;
}
@keyframes levelup-badge-spin {
  0% { transform: rotateY(180deg) scale(0); }
  60% { transform: rotateY(-10deg) scale(1.1); }
  100% { transform: rotateY(0) scale(1); }
}
.levelup-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -1px;
  text-shadow: 0 0 30px rgba(74, 222, 128, 0.5);
}
.levelup-sub {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 4px;
}
.levelup-msg {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
}
.levelup-queue {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.levelup-btn {
  min-width: 200px;
  padding: 14px 32px;
  font-size: 16px;
}

/* ===== AVATAR UPLOAD ===== */
.profile-avatar-section {
  padding-bottom: 20px;
}
.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}
.profile-avatar-circle {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}
.profile-avatar-circle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
  border-radius: 50%;
  color: #fff;
}
.profile-avatar-circle:hover .profile-avatar-overlay {
  opacity: 1;
}
.profile-avatar-info {
  flex: 1;
  min-width: 0;
}
.profile-avatar-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 2px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.profile-avatar-username {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.profile-plan-info {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.profile-plan-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}
.profile-plan-badge.pro {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
}
.profile-plan-badge.free {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.profile-plan-expiry {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.profile-avatar-actions {
  display: flex;
  gap: 8px;
}

/* ===== PLAN CARDS ===== */
.plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  background: var(--bg-card);
}
.plan-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(74, 222, 128, 0.08);
}
.plan-card-soon {
  overflow: hidden;
}
.plan-card-blur-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(4px);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.plan-card-soon-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}
.plan-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.plan-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.plan-card-price {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.plan-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plan-card-features li {
  font-size: 12px;
  color: var(--text-secondary);
  padding-left: 14px;
  position: relative;
}
.plan-card-features li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.plan-card-active .plan-card-features li::before {
  content: '✓';
  color: var(--accent);
}
.plan-card-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* Confetti animation */
@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(60vh) rotate(720deg) scale(0.3);
    opacity: 0;
  }
}

/* ===== PHONE MEDIA (iPhone / small screens) ===== */
@media (max-width: 480px) {
  .dashboard-hero {
    padding: 20px;
    border-radius: 16px;
  }

  .dashboard-hero-text h1 {
    font-size: 22px;
  }

  .dashboard-start-btn {
    font-size: 13px;
    padding: 12px 24px;
  }

  .dashboard-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .dash-stat-card {
    padding: 16px;
    border-radius: 14px;
  }

  .dash-stat-emoji {
    font-size: 28px;
  }

  .dash-stat-value {
    font-size: 24px;
  }

  .xp-bar-container {
    border-radius: 12px;
  }

  /* Heatmap: smaller cells on phone */
  .heatmap-section {
    padding: 16px;
    border-radius: 16px;
  }

  .heatmap-cell {
    width: 18px;
    height: 18px;
  }

  .heatmap-day-label {
    height: 18px;
    line-height: 18px;
    font-size: 8px;
    width: 20px;
  }

  .heatmap-month-label {
    width: 18px;
    font-size: 8px;
  }

  .heatmap-weeks {
    gap: 3px;
  }

  .heatmap-month-row {
    gap: 3px;
  }

  .heatmap-row {
    gap: 3px;
  }

  .heatmap-day-labels {
    gap: 3px;
  }

  .tree-container {
    border-radius: 16px;
  }

  .tree-container canvas {
    max-width: 100%;
    height: auto;
  }

  .dashboard-recent .docs-header h2 {
    font-size: 18px;
  }

  .doc-card {
    border-radius: 12px;
    padding: 10px 14px;
  }

  .main-content {
    padding: 100px 12px 32px;
  }

  /* Sidebar full width on small phones */
  .sidebar {
    width: 100%;
  }
}

/* ===== MOBILE RESPONSIVENESS (iPhone / Android) ===== */

/* Prevent tap highlight and enforce box-sizing */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
}

/* Prevent font size inflation on orientation change */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ── Editor on mobile ── */
@media (max-width: 768px) {
  /* ── Editor toolbar: 2-row layout on mobile ── */
  .editor-toolbar {
    flex-wrap: wrap;
    padding: 8px 10px 6px;
    gap: 0;
    row-gap: 6px;
  }

  /* Row 1: back + title + buttons + Complete — ALL on one line */
  .editor-toolbar-left {
    order: 1;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
  }

  .editor-back-btn {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    font-size: 14px;
  }

  .editor-title-input {
    min-width: 0;
    flex: 1 1 0;
    max-width: none;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Row 1: right (buttons) stays on same line */
  .editor-toolbar-right {
    order: 2;
    gap: 3px;
    flex-shrink: 0;
    align-items: center;
  }

  /* Hide less-essential icon buttons on mobile to keep row 1 compact */
  .editor-toolbar-right #editor-theme-btn,
  .editor-toolbar-right #editor-fullscreen-btn {
    display: none !important;
  }

  .editor-toolbar-right .btn-small {
    font-size: 11px;
    padding: 6px 12px;
  }

  /* Row 2: timer + controls spans full width, centered */
  .editor-toolbar-center {
    order: 3;
    position: static;
    transform: none;
    flex: 0 0 100%;
    justify-content: center;
    padding: 4px 0 2px;
    border-top: 1px solid var(--border-light);
    gap: 8px;
  }

  .editor-timer {
    font-size: 20px;
    min-width: 68px;
  }

  .editor-add-time {
    gap: 4px;
  }

  .editor-add-time-btn {
    padding: 3px 10px;
    font-size: 10px;
  }

  .doc-action-btn {
    width: 28px !important;
    height: 28px !important;
  }

  .editor-area {
    padding: 24px 16px 80px;
  }

  .editor-textarea {
    font-size: 16px; /* prevents iOS zoom on focus */
    line-height: 1.8;
  }

  /* Format bar: wrap to 2 lines instead of horizontal scroll */
  .editor-format-bar {
    padding: 4px 12px;
    flex-wrap: wrap;
    gap: 2px;
    row-gap: 4px;
  }

  #formatting-toolbar {
    flex-wrap: wrap;
    gap: 2px;
  }

  .fmt-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .fmt-font-wrap {
    flex: 0 0 auto;
  }

  .status-bar {
    padding: 6px 12px;
    font-size: 11px;
  }

  .danger-countdown-num {
    font-size: 120px;
  }
}

/* ── Dashboard on mobile ── */
@media (max-width: 768px) {
  .view {
    padding-bottom: 20px;
  }

  .view-header {
    padding: 16px 0 12px;
    margin-top: 18px;
  }

  .view-header h1 {
    font-size: 22px;
  }

  .docs-grid {
    grid-template-columns: 1fr;
  }

  .doc-card-actions {
    opacity: 1; /* always visible on touch */
  }

  .modal-content {
    width: calc(100vw - 32px);
    max-height: 85vh;
    padding: 20px;
  }

  .session-modal {
    width: calc(100vw - 32px);
    padding: 24px 20px;
  }

  .session-duration-options {
    flex-wrap: wrap;
    gap: 8px;
  }

  .duration-btn {
    min-width: 60px;
    padding: 10px 14px;
    font-size: 14px;
  }

  .session-complete {
    padding: 28px 20px;
  }

  .sc-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .friends-list {
    gap: 8px;
  }

  .friend-card {
    padding: 12px;
  }

  .leaderboard-podium {
    gap: 4px;
    padding: 8px 4px;
  }

  .podium-slot {
    padding: 8px 4px;
  }

  .podium-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .podium-name {
    font-size: 10px;
  }

  .podium-words {
    font-size: 10px;
  }

  .podium-medal {
    font-size: 26px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .settings-section {
    padding: 16px;
  }

  .plan-cards {
    grid-template-columns: 1fr;
  }

  .support-form {
    max-width: 100% !important;
  }
}

/* ── Small phones (≤ 390px — iPhone SE, older Androids) ── */
@media (max-width: 390px) {
  .editor-title-input {
    max-width: 90px;
  }

  .editor-timer {
    font-size: 16px;
    min-width: 52px;
  }

  .editor-add-time {
    display: none;
  }

  .dashboard-stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .modal-content,
  .session-modal {
    width: calc(100vw - 16px);
    padding: 16px;
  }

  .view-header h1 {
    font-size: 19px;
  }
}

/* ── Landing page on mobile ── */
@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(36px, 10vw, 60px);
  }

  .hero-sub {
    font-size: 15px;
  }

  .stats-bar {
    padding: 24px 16px;
  }

  .stat-num {
    font-size: 32px;
  }

  .section-header h2 {
    font-size: clamp(24px, 6vw, 40px);
  }

  .features {
    padding: 60px 16px;
  }

  .how-it-works {
    padding: 60px 16px;
  }

  .cta {
    padding: 60px 16px;
  }

  .cta h2 {
    font-size: clamp(22px, 5.5vw, 36px);
  }

  .growth-section {
    padding: 60px 16px 40px;
    overflow: hidden;
  }

  .growth-chart-wrap {
    padding: 20px 12px 16px;
    overflow: hidden;
  }

  .growth-total-num {
    font-size: 28px;
  }

  .growth-total-num {
    font-size: 28px;
  }

  .releases {
    padding: 60px 0 80px;
  }

  .releases-header {
    padding: 0 16px;
  }

  .releases .section-title {
    font-size: 24px;
  }

  .releases-counter {
    font-size: 20px;
  }

  .releases-stage {
    padding: 0 12px;
  }

  .release-card {
    flex: 0 0 72%;
    margin: 0 2%;
    padding: 20px 18px;
  }

  .release-list li {
    font-size: 12px;
  }

  .releases-arrow {
    width: 32px;
    height: 32px;
  }

  .releases-arrow-left { left: 2px; }
  .releases-arrow-right { right: 2px; }

  .releases-dots {
    margin-top: 20px;
  }

  .landing-pricing {
    padding: 60px 16px;
  }

  .landing-pricing-container {
    padding: 32px 20px;
  }

  .landing-pricing-cards {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 100%;
  }

  .landing-plan-card {
    padding: 28px 22px;
  }

  .landing-plan-price {
    font-size: 40px;
  }

  .landing-pricing-header h2 {
    font-size: clamp(22px, 5.5vw, 32px);
  }
}

/* ── Touch — bigger tap targets ── */
@media (pointer: coarse) {
  .btn, button, .sidebar-nav-item, .doc-action-btn,
  .admin-nav-item, .duration-btn, .fmt-btn {
    min-height: 44px;
    touch-action: manipulation; /* remove 300ms tap delay on iOS */
  }

  .sidebar-nav-item {
    padding: 12px 16px;
  }

  .mobile-sidebar-toggle {
    touch-action: manipulation;
  }

  input, select, textarea {
    font-size: 16px; /* prevents iOS zoom */
  }
}

/* ===== USER PROFILE (PUBLIC) ===== */
.up-back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-primary); cursor: pointer;
  margin-bottom: 12px; transition: background 0.15s, border-color 0.15s;
}
.up-back-btn:hover { background: var(--hover-bg); border-color: var(--border-hover); }

.up-banner {
  width: 100%; height: 200px; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  background-size: cover; background-position: center; border-radius: 0 0 var(--radius) var(--radius);
}
.up-banner { display: flex; align-items: center; justify-content: center; }
.up-banner-placeholder { font-size: 13px; color: rgba(255,255,255,0.3); letter-spacing: 1px; text-transform: uppercase; font-weight: 600; }
.up-banner.up-skeleton { animation: upPulse 1.5s ease-in-out infinite; }
@keyframes upPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.up-header {
  display: flex; align-items: flex-start; gap: 20px; padding: 0 24px;
  margin-top: -40px; position: relative; z-index: 1;
}
.up-avatar-wrap { flex-shrink: 0; }
.up-avatar-circle {
  width: 120px; height: 120px; border-radius: 50%; background: var(--bg-primary);
  border: 4px solid var(--bg-primary); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--text-muted);
}
.up-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.up-skeleton-circle { animation: upPulse 1.5s ease-in-out infinite; background: var(--hover-bg); }

.up-header-info { flex: 1; padding-top: 60px; min-width: 0; }
.up-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; margin: 0; padding: 0; }
.up-name { font-family: var(--font-display); font-size: 28px; font-weight: 800; margin: 0; padding: 0; line-height: 1; color: var(--text-primary); }
.up-pro-badge { font-size: 10px; margin-left: 5px; padding: 0px 5px; vertical-align: middle; flex-shrink: 0; }
.up-username { font-size: 15px; color: var(--text-muted); margin-top: 2px; line-height: 1; }
.up-bio { font-size: 14px; color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }

.up-actions { flex-shrink: 0; padding-top: 64px; }
.up-follow-btn {
  padding: 8px 24px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; border: 1px solid var(--accent); background: transparent;
  color: var(--accent);
}
.up-follow-btn.following { background: var(--accent); color: #000; border-color: var(--accent); }
.up-follow-btn.following:hover { background: #ef4444; border-color: #ef4444; color: #fff; }
.up-follow-btn.following:hover::after { content: ''; }
.up-follow-btn:hover:not(.following) { background: var(--accent-soft); }
.up-follow-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.up-stats {
  display: flex; gap: 16px; padding: 16px 24px; font-size: 14px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.up-stats strong { color: var(--text-primary); margin-right: 2px; }
.up-stat-link { cursor: pointer; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; transition: background 0.15s; }
.up-stat-link:hover { background: var(--hover-bg); }

.follow-list-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; transition: background 0.15s; }
.follow-list-item:hover { background: var(--hover-bg); }
.follow-list-item .fl-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.follow-list-item .fl-avatar-fallback { display: flex; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.follow-list-item .fl-info { flex: 1; min-width: 0; }
.follow-list-item .fl-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.follow-list-item .fl-username { font-size: 12px; color: var(--text-muted); }
.follow-list-item .fl-username a { color: var(--text-muted); text-decoration: none; }
.follow-list-item .fl-username a:hover { color: var(--accent); }
.follow-list-empty { padding: 32px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

.up-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border); padding: 0 24px;
}
.up-tab {
  padding: 12px 20px; font-size: 14px; font-weight: 600; color: var(--text-muted);
  background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.up-tab:hover { color: var(--text-secondary); }
.up-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.up-tab-content { padding: 16px 24px; }

/* Posts tab */
.up-story-card {
  padding: 20px 0; border-bottom: 1px solid var(--border-light); cursor: pointer;
  transition: background 0.15s;
}
.up-story-card:hover { background: var(--hover-bg); margin: 0 -12px; padding: 20px 12px; border-radius: var(--radius-sm); }
.up-story-card:last-child { border-bottom: none; }
.up-story-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; color: var(--text-primary); }
.up-story-excerpt { font-size: 14px; color: var(--text-secondary); margin: 0 0 8px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.up-story-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; }

/* Activity tab */
.up-activity-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.up-stat-card { background: var(--bg-elevated, var(--hover-bg)); padding: 16px; border-radius: var(--radius-sm); text-align: center; }
.up-stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--text-primary); }
.up-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.up-stat-emoji { font-size: 20px; margin-bottom: 4px; }

/* Profile Heatmap (scoped under .streak-heatmap to avoid dashboard conflicts) */
.streak-heatmap { margin-top: 16px; }
.streak-heatmap .heatmap-cell { width: 12px; height: 12px; border-radius: 2px; background: var(--hover-bg); flex-shrink: 0; }
.streak-heatmap .heatmap-cell.level-1 { background: rgba(74, 222, 128, 0.3); }
.streak-heatmap .heatmap-cell.level-2 { background: #4ade80; }
.streak-heatmap .heatmap-legend { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.streak-heatmap .heatmap-legend .heatmap-cell { width: 10px; height: 10px; }

/* About tab */
.up-about-bio { font-size: 15px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 16px; }
.up-about-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.up-about-detail { font-size: 13px; color: var(--text-muted); padding: 10px 16px; background: var(--bg-elevated, var(--hover-bg)); border-radius: var(--radius-sm); display: flex; gap: 8px; }
.up-about-detail strong { color: var(--text-secondary); white-space: nowrap; }
.up-about-achievements { margin-top: 8px; }
.up-about-achievements-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--text-secondary); }

/* Empty states */
.up-empty { padding: 40px 0; text-align: center; color: var(--text-muted); font-size: 14px; }
.up-empty a { color: var(--accent); text-decoration: none; }
.up-empty a:hover { text-decoration: underline; }

/* Skeleton loading */
.up-skeleton-cards { display: flex; flex-direction: column; gap: 16px; }
.up-skeleton-card { height: 80px; background: var(--hover-bg); border-radius: var(--radius-sm); animation: upPulse 1.5s ease-in-out infinite; }

/* Username link */
.username-link { color: inherit; text-decoration: none; }
.username-link:hover { color: var(--accent); }
.username-link.is-username:hover { text-decoration: underline; }

/* Hover card */
.profile-hover-card {
  position: fixed; z-index: 9999; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; min-width: 260px; max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3); backdrop-filter: blur(12px);
}
.hc-header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.hc-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--hover-bg); display: flex; align-items: center; justify-content: center; }
.hc-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.hc-avatar-fallback { font-size: 16px; font-weight: 700; color: var(--text-muted); }
.hc-info { min-width: 0; }
.hc-info strong { font-size: 14px; color: var(--text-primary); }
.hc-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }

/* Achievements on profile */
.up-achievements-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.up-achievements-grid .achievement-card { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 8px; overflow: hidden; }
.up-achievements-grid .achievement-card h3 { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.up-achievements-grid .achievement-card p { font-size: 10px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 100%; }

/* Mobile profile */
@media (max-width: 768px) {
  .up-back-btn { margin-bottom: 8px; }
  .up-banner { height: 140px; }
  .up-header { flex-direction: column; align-items: center; text-align: center; padding: 0 16px; margin-top: -30px; }
  .up-avatar-circle { width: 80px; height: 80px; font-size: 28px; }
  .up-header-info { padding-top: 8px; text-align: center; }
  .up-name { font-size: 22px; justify-content: center; }
  .up-name-row { justify-content: center; }
  .up-actions { padding-top: 0; width: 100%; }
  .up-follow-btn { width: 100%; }
  .up-stats { justify-content: center; padding: 12px 16px; }
  .up-tabs { padding: 0 16px; }
  .up-tab { padding: 10px 14px; font-size: 13px; }
  .up-tab-content { padding: 12px 16px; }
  .up-story-title { font-size: 16px; }
  .profile-hover-card { display: none !important; }
}

/* ===== Danger Variant Tabs ===== */
.danger-variant-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 10px;
}
.danger-variant-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: background 180ms, color 180ms;
}
.danger-variant-tab:hover { color: var(--text-primary); }
.danger-variant-tab.active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.danger-variant-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  padding: 0 4px;
}

/* ===== Editor Hearts (Chill Danger) ===== */
.editor-hearts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding: 4px 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 999px;
}
.editor-hearts .heart {
  font-size: 15px;
  color: #ef4444;
  line-height: 1;
  display: inline-block;
  transition: color 200ms, transform 200ms;
}
.editor-hearts .heart.broken {
  color: #4b5563;
  opacity: 0.4;
}
.editor-hearts .heart.shattering {
  animation: heartShatter 400ms cubic-bezier(.5,.0,.8,.3) forwards;
}
/* ===== Research Drawer ===== */
.research-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: clamp(320px, 35vw, 520px);
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  box-shadow: -2px 0 16px rgba(0,0,0,0.1);
  z-index: 2500;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  box-sizing: border-box;
}
.research-drawer.open { transform: translateX(0); }
.research-drawer, .research-drawer * {
  -webkit-user-select: text;
  user-select: text;
}
.research-drawer button,
.research-drawer .research-tab,
.research-drawer .research-back-btn {
  -webkit-user-select: none;
  user-select: none;
}
.editor-container {
  transition: right 320ms cubic-bezier(.2,.8,.2,1);
}
.editor-container.has-docked-research {
  right: clamp(320px, 35vw, 520px);
}
.editor-container.has-docked-research .editor-toolbar {
  margin-right: calc(-1 * clamp(320px, 35vw, 520px));
  transition: margin-right 320ms cubic-bezier(.2,.8,.2,1);
  position: relative;
  z-index: 2600;
}
.editor-container .editor-toolbar {
  transition: margin-right 320ms cubic-bezier(.2,.8,.2,1);
}
.research-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.research-drawer-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.research-drawer-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  transition: background 160ms, color 160ms;
}
.research-drawer-close:hover { background: var(--bg-secondary); color: var(--text-primary); }

.research-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 8px;
}
.research-tab {
  flex: 1;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: background 180ms, color 180ms;
}
.research-tab:hover { color: var(--text-primary); }
.research-tab.active {
  background: var(--accent, #3b82f6);
  color: #fff;
}
.research-quota {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 2px 10px;
  min-height: 16px;
}
.research-quota.capped { color: #ef4444; font-weight: 600; }

.research-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.research-input-row { display: flex; gap: 6px; }
.research-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.research-input:focus { border-color: var(--accent, #3b82f6); }
.research-input-ai { resize: none; line-height: 1.5; }
.research-submit-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 160ms, transform 160ms;
}
.research-submit-btn:hover { opacity: 0.92; }
.research-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.research-submit-btn-full { width: 100%; margin-top: 8px; }
.research-hint { font-size: 11px; color: var(--text-muted); padding: 6px 2px 10px; }
.research-results {
  flex: 1;
  overflow-y: auto;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
  padding-right: 4px;
}
.research-result-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--bg-secondary);
}
.research-result-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.research-result-extract { color: var(--text-secondary, var(--text-primary)); margin-bottom: 8px; }
.research-result-link {
  font-size: 11px;
  color: var(--accent, #3b82f6);
  text-decoration: none;
}
.research-result-link:hover { text-decoration: underline; }
.research-alternatives { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; margin-bottom: 10px; }
.research-alt-link { color: var(--accent, #3b82f6); text-decoration: none; margin-right: 8px; }
.research-alt-link:hover { text-decoration: underline; }
.research-section-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin: 10px 0 6px;
}
.research-section-label:first-child { margin-top: 0; }
.research-alt-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 150ms, background 150ms;
}
.research-alt-card:hover { border-color: var(--accent, #3b82f6); }
.research-alt-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.research-alt-snippet { font-size: 12px; color: var(--text-secondary, var(--text-muted)); line-height: 1.45; }
.research-card-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.research-expand-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
}
.research-expand-btn:hover { border-color: var(--accent, #3b82f6); color: var(--accent, #3b82f6); }
.research-expand-btn:disabled { opacity: 0.6; cursor: wait; }
.research-full-slot { display: none; }
.research-full-text {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary, var(--text-primary));
  max-height: 420px;
  overflow-y: auto;
}
.research-full-text p { margin: 0 0 8px; }
.research-section-heading {
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 700;
}
.research-section-heading:first-child { margin-top: 0; }
.research-full-text h2.research-section-heading { font-size: 15px; }
.research-full-text h3.research-section-heading { font-size: 14px; }
.research-full-text h4.research-section-heading,
.research-full-text h5.research-section-heading,
.research-full-text h6.research-section-heading { font-size: 13px; border-bottom-style: dashed; }
.research-full-note { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* ===== AI Chat ===== */
.research-pane-ai { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.research-chat {
  flex: 1;
  overflow-y: auto;
  padding: 8px 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.research-chat-empty {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 24px 12px;
  font-style: italic;
}
.research-chat-bubble {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: chatBubbleIn 180ms cubic-bezier(.2,.8,.2,1);
}
@keyframes chatBubbleIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.research-chat-user {
  align-self: flex-end;
  background: var(--accent, #22c55e);
  color: #0a0a0a;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.research-chat-ai {
  align-self: flex-start;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.research-chat-md p { margin: 0 0 8px; }
.research-chat-md p:last-child { margin-bottom: 0; }
.research-chat-md strong { font-weight: 700; }
.research-chat-md em { font-style: italic; }
.research-chat-md a { color: var(--accent, #22c55e); text-decoration: underline; }
.research-chat-md .md-h { font-size: 13px; font-weight: 700; margin: 6px 0 4px; }
.research-chat-md ul, .research-chat-md ol { margin: 4px 0 8px; padding-left: 20px; }
.research-chat-md ul:last-child, .research-chat-md ol:last-child { margin-bottom: 0; }
.research-chat-md li { margin: 2px 0; }
.research-chat-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: rgba(127,127,127,0.15);
  padding: 1px 5px;
  border-radius: 4px;
}
.research-chat-md pre {
  background: rgba(127,127,127,0.12);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
  overflow-x: auto;
}
.research-chat-md pre code {
  background: transparent;
  padding: 0;
  font-size: 12px;
  white-space: pre;
}
.research-chat-err {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}
.research-chat-loading {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
}
.research-chat-loading span {
  width: 6px; height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: chatDot 1.2s infinite ease-in-out;
}
.research-chat-loading span:nth-child(2) { animation-delay: 0.15s; }
.research-chat-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}
/* Ask AI composer (#gem-box) — sits at the top of the drawer, right after the tabs */
#gem-box {
  display: none;
  flex-direction: row;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  margin-bottom: 10px;
  box-sizing: border-box;
  flex: 0 0 auto;
}
#gem-box.show { display: flex; }
#gem-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  max-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  resize: none;
  box-sizing: border-box;
  display: block;
}
#gem-input:focus { border-color: var(--accent, #22c55e); }
#gem-send {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--accent, #22c55e);
  color: #0a0a0a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 160ms, transform 120ms;
  padding: 0;
}
#gem-send:hover { opacity: 0.9; }
#gem-send:active { transform: scale(0.94); }
#gem-send:disabled { opacity: 0.5; cursor: not-allowed; }

.wiki-card { cursor: pointer; transition: border-color 150ms, transform 120ms, background 150ms; }
.wiki-card:hover { border-color: var(--accent, #3b82f6); }
.wiki-card:active { transform: scale(0.995); }
.research-card-hint {
  font-size: 11px;
  color: var(--accent, #3b82f6);
  margin-top: 6px;
  font-weight: 500;
}

.research-detail {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  animation: researchDetailIn 200ms cubic-bezier(.2,.8,.2,1);
}
@keyframes researchDetailIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}
.research-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color 150ms, color 150ms;
}
.research-back-btn:hover { border-color: var(--accent, #3b82f6); color: var(--accent, #3b82f6); }
.research-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.research-full-text-page {
  max-height: none;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  margin-bottom: 14px;
}
.research-loading { color: var(--text-muted); font-style: italic; padding: 8px 0; }
.research-error { color: #ef4444; padding: 8px 0; }
.research-ai-answer {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}
@media (max-width: 500px) {
  .research-drawer { width: 100vw; }
}

@keyframes heartShatter {
  0%   { transform: scale(1) rotate(0deg); opacity: 1; color: #ef4444; }
  30%  { transform: scale(1.4) rotate(-8deg); opacity: 1; color: #fca5a5; }
  60%  { transform: scale(1.1) rotate(12deg); opacity: 0.6; }
  100% { transform: scale(0.6) rotate(20deg); opacity: 0; }
}

/* ===== SOFT WRITING SPACE LANDING ===== */
body.landing.dream-landing {
  --accent-rgb: 99, 153, 196;
  --ink-rgb: 37, 54, 80;
  --bg-primary: #f7f9fc;
  --bg-secondary: #eef5fb;
  --bg-card: rgba(255, 255, 255, 0.82);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.76);
  --text-primary: #253650;
  --text-secondary: rgba(37, 54, 80, 0.68);
  --text-muted: rgba(37, 54, 80, 0.46);
  --accent: #6399c4;
  --accent-soft: rgba(99, 153, 196, 0.14);
  --accent-glow: rgba(99, 153, 196, 0.2);
  --danger: #d9787e;
  --border: rgba(57, 79, 111, 0.12);
  --border-light: rgba(255, 255, 255, 0.78);
  --border-hover: rgba(99, 153, 196, 0.32);
  --hover-bg: rgba(99, 153, 196, 0.09);
  --shadow: 0 18px 52px rgba(70, 93, 124, 0.12), 0 1px 0 rgba(255, 255, 255, 0.82) inset;
  --shadow-lg: 0 32px 82px rgba(70, 93, 124, 0.16);
  --shadow-3d: 0 18px 52px rgba(70, 93, 124, 0.12);
  --gradient-accent: linear-gradient(135deg, #7bb0d5 0%, #8fcfc7 100%);
  background:
    linear-gradient(180deg, rgba(247, 249, 252, 0.9) 0%, rgba(238, 245, 251, 0.88) 48%, rgba(250, 248, 244, 0.94) 100%),
    url('/media/hero-dream-background.png') center top / 100% auto repeat-y;
  color: var(--text-primary);
  font-family: 'Nunito', var(--font-sans);
}

body.landing.dream-landing::before {
  background:
    linear-gradient(90deg, rgba(99, 153, 196, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(99, 153, 196, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.65;
}

body.landing.dream-landing::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), transparent 18%),
    linear-gradient(90deg, rgba(226, 238, 247, 0.52), transparent 34%, transparent 66%, rgba(245, 235, 244, 0.42));
}

body.landing.dream-landing .design-toggle {
  display: none;
}

body.landing.dream-landing .nav {
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  transform: none;
  border: 0;
  border-bottom: 1px solid rgba(57, 79, 111, 0.08);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

body.landing.dream-landing .nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(57, 79, 111, 0.12);
  box-shadow: 0 10px 30px rgba(70, 93, 124, 0.06);
}

body.landing.dream-landing .nav-inner {
  max-width: 1160px;
  height: 58px;
  padding: 0 28px;
}

body.landing.dream-landing .logo,
body.landing.dream-landing .logo-knight {
  color: #253650;
  fill: #253650;
  filter: none;
  text-shadow: none;
}

body.landing.dream-landing .logo {
  font-family: 'Nunito', var(--font-sans);
  font-size: 21px;
  font-weight: 800;
}

body.landing.dream-landing .nav-links {
  gap: 24px;
}

body.landing.dream-landing .nav-links a:not(.btn) {
  color: rgba(37, 54, 80, 0.66);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 10px;
}

body.landing.dream-landing .nav-links a:not(.btn):hover {
  color: #253650;
  background: rgba(99, 153, 196, 0.1);
}

body.landing.dream-landing .dream-only-link {
  display: inline-flex;
}

body.landing.dream-landing .btn {
  font-family: 'Nunito', var(--font-sans);
  text-transform: none;
  letter-spacing: 0;
}

body.landing.dream-landing .btn-small,
body.landing.dream-landing .btn-primary {
  background: #a2d2ff;
  color: #1f3554;
  box-shadow: 0 10px 24px rgba(99, 153, 196, 0.22);
}

body.landing.dream-landing .btn-small:hover,
body.landing.dream-landing .btn-primary:hover {
  background: #8fcfc7;
  color: #17313d;
  box-shadow: 0 14px 34px rgba(95, 169, 162, 0.26);
}

body.landing.dream-landing .btn-ghost {
  color: #3e5877;
  border-color: rgba(57, 79, 111, 0.16);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

body.landing.dream-landing .btn-ghost:hover {
  color: #253650;
  border-color: rgba(99, 153, 196, 0.32);
  background: #ffffff;
}

body.landing.dream-landing .hero {
  max-width: none;
  min-height: 940px;
  padding: 176px 28px 78px;
  border-bottom: 1px solid rgba(57, 79, 111, 0.08);
  background:
    linear-gradient(180deg, rgba(247, 249, 252, 0.56) 0%, rgba(247, 249, 252, 0.82) 52%, rgba(239, 246, 252, 0.94) 100%),
    url('/media/hero-dream-background.png') center top / cover no-repeat;
  overflow: hidden;
}

body.landing.dream-landing .hero::before,
body.landing.dream-landing .hero::after {
  display: none;
}

body.landing.dream-landing .hero-title {
  max-width: 880px;
  margin: 0 auto 24px;
  color: #253650;
  font-family: 'Nunito', var(--font-sans);
  font-size: clamp(50px, 6vw, 84px);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: 0;
  text-shadow: none;
}

body.landing.dream-landing .hero-title em {
  color: #4f7fa6;
  text-shadow: none;
}

body.landing.dream-landing .hero-sub {
  max-width: 650px;
  margin-bottom: 30px;
  color: rgba(37, 54, 80, 0.68);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.58;
}

body.landing.dream-landing .hero-actions {
  margin-bottom: 52px;
}

body.landing.dream-landing .hero-visual {
  max-width: 990px;
  transform: none;
}

body.landing.dream-landing .hero-object {
  display: block;
  position: absolute;
  z-index: 1;
  height: auto;
  object-fit: contain;
  opacity: 0.72;
  filter: drop-shadow(0 22px 36px rgba(70, 93, 124, 0.14));
  animation: dreamObjectFloat 8s ease-in-out infinite;
}

body.landing.dream-landing .hero-object-vase {
  width: clamp(210px, 19vw, 300px);
  left: clamp(24px, 4vw, 76px);
  bottom: -10px;
}

body.landing.dream-landing .hero-object-notebook {
  width: clamp(230px, 22vw, 350px);
  right: clamp(22px, 4vw, 78px);
  bottom: 4px;
  animation-delay: -1.3s;
}

body.landing.dream-landing .mock-editor {
  position: relative;
  z-index: 2;
  border: 1px solid rgba(57, 79, 111, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 34px 88px rgba(70, 93, 124, 0.16);
  transform: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.landing.dream-landing .mock-editor:hover {
  transform: translateY(-4px);
  box-shadow: 0 42px 100px rgba(70, 93, 124, 0.18);
}

body.landing.dream-landing .mock-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(57, 79, 111, 0.1);
  background: rgba(248, 250, 252, 0.86);
}

body.landing.dream-landing .mock-timer,
body.landing.dream-landing .mock-xp {
  color: rgba(37, 54, 80, 0.68);
  font-family: 'Nunito', var(--font-sans);
  font-weight: 800;
}

body.landing.dream-landing .mock-xp {
  color: #4c9c8f;
}

body.landing.dream-landing .mock-dots span:nth-child(1) { background: #d9787e; box-shadow: none; }
body.landing.dream-landing .mock-dots span:nth-child(2) { background: #e9c46a; box-shadow: none; }
body.landing.dream-landing .mock-dots span:nth-child(3) { background: #8fcfc7; box-shadow: none; }

body.landing.dream-landing .soft-editor .mock-content {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  min-height: 430px;
  margin: 0;
  padding: 0;
  background: #ffffff;
}

.soft-editor-sidebar {
  border-right: 1px solid rgba(57, 79, 111, 0.1);
  background: rgba(247, 249, 252, 0.86);
  padding: 26px 18px;
  text-align: left;
}

.soft-sidebar-title {
  margin-bottom: 16px;
  color: rgba(37, 54, 80, 0.48);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.soft-sidebar-item {
  border-radius: 8px;
  padding: 12px 13px;
  color: rgba(37, 54, 80, 0.68);
  font-size: 14px;
  font-weight: 800;
}

.soft-sidebar-item.active {
  color: #253650;
  background: rgba(162, 210, 255, 0.22);
}

.soft-sidebar-progress {
  margin-top: 34px;
  border: 1px solid rgba(57, 79, 111, 0.1);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.soft-sidebar-progress span,
.soft-sidebar-progress strong {
  display: block;
}

.soft-sidebar-progress span {
  color: rgba(37, 54, 80, 0.5);
  font-size: 12px;
  font-weight: 800;
}

.soft-sidebar-progress strong {
  margin-top: 4px;
  color: #253650;
  font-size: 18px;
}

.soft-sidebar-progress i {
  display: block;
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fcfc7 72%, rgba(37, 54, 80, 0.08) 72%);
}

.soft-editor-page {
  padding: 58px 64px;
  text-align: left;
}

body.landing.dream-landing .soft-editor-page .mock-line {
  color: rgba(37, 54, 80, 0.78);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.95;
  text-align: left;
}

body.landing.dream-landing .mock-cursor {
  display: inline-block;
  margin: 8px 0 0;
  background: #6399c4;
  box-shadow: none;
}

body.landing.dream-landing .stats-bar,
body.landing.dream-landing .features,
body.landing.dream-landing .how-it-works,
body.landing.dream-landing .principles-section,
body.landing.dream-landing .growth-section,
body.landing.dream-landing .community-section,
body.landing.dream-landing .landing-pricing,
body.landing.dream-landing .cta {
  border-color: rgba(57, 79, 111, 0.1);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(240, 247, 252, 0.94));
}

body.landing.dream-landing .stats-bar {
  padding: 86px 32px;
}

.stats-kicker,
.section-kicker {
  margin: 0 auto 26px;
  color: rgba(37, 54, 80, 0.52);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

body.landing.dream-landing .stats-inner {
  max-width: 920px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

body.landing.dream-landing .stat {
  min-height: 136px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(57, 79, 111, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 16px 40px rgba(70, 93, 124, 0.08);
}

body.landing.dream-landing .stat-num,
body.landing.dream-landing .section-header h2,
body.landing.dream-landing .cta h2 {
  color: #253650;
  font-family: 'Nunito', var(--font-sans);
  letter-spacing: 0;
  text-shadow: none;
}

body.landing.dream-landing .stat-num {
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 800;
}

body.landing.dream-landing .stat-label {
  color: rgba(37, 54, 80, 0.48);
  font-family: 'Nunito', var(--font-sans);
  letter-spacing: 0.06em;
}

body.landing.dream-landing .features,
body.landing.dream-landing .how-it-works,
body.landing.dream-landing .principles-section {
  max-width: none;
  padding: 132px 32px;
}

body.landing.dream-landing .features .section-header,
body.landing.dream-landing .features-grid,
body.landing.dream-landing .steps,
body.landing.dream-landing .principles-grid {
  max-width: 1120px;
}

body.landing.dream-landing .section-header {
  max-width: 760px;
  margin-bottom: 72px;
}

body.landing.dream-landing .section-header h2 {
  font-size: clamp(40px, 5vw, 66px);
  font-weight: 700;
  line-height: 1.08;
}

body.landing.dream-landing .section-header h2 em,
body.landing.dream-landing .step-num {
  color: #4f7fa6;
}

body.landing.dream-landing .section-header p,
body.landing.dream-landing .feature-card p,
body.landing.dream-landing .step p {
  color: rgba(37, 54, 80, 0.64);
  font-weight: 600;
}

body.landing.dream-landing .features-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

body.landing.dream-landing .feature-card,
body.landing.dream-landing .step,
body.landing.dream-landing .principle-card,
body.landing.dream-landing .growth-chart-wrap,
body.landing.dream-landing .upgrade-card,
body.landing.dream-landing .community-card {
  border: 1px solid rgba(57, 79, 111, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 52px rgba(70, 93, 124, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.landing.dream-landing .feature-card {
  min-height: 318px;
  padding: 32px;
}

body.landing.dream-landing .feature-card:hover {
  border-color: rgba(99, 153, 196, 0.28);
  box-shadow: 0 26px 64px rgba(70, 93, 124, 0.13);
}

body.landing.dream-landing .feature-card::before,
body.landing.dream-landing .step::before {
  display: none;
}

body.landing.dream-landing .feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  color: #4f7fa6;
  background: rgba(162, 210, 255, 0.22);
}

body.landing.dream-landing .feature-icon svg {
  stroke: currentColor;
}

body.landing.dream-landing .feature-card h3 {
  color: #253650;
  font-family: 'Nunito', var(--font-sans);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.feature-widget {
  margin-top: 24px;
  border-radius: 8px;
  background: rgba(247, 249, 252, 0.9);
  border: 1px solid rgba(57, 79, 111, 0.08);
}

.soft-goal-widget,
.soft-danger-widget,
.soft-community-widget,
.soft-timer-widget {
  padding: 16px;
}

.soft-goal-widget span,
.soft-danger-widget span,
.soft-community-widget span,
.soft-timer-widget span {
  display: block;
  color: rgba(37, 54, 80, 0.52);
  font-size: 12px;
  font-weight: 800;
}

.soft-goal-widget strong,
.soft-danger-widget strong,
.soft-community-widget strong,
.soft-timer-widget strong {
  display: block;
  margin-top: 4px;
  color: #253650;
  font-size: 24px;
  font-weight: 900;
}

.soft-goal-widget i {
  display: block;
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fcfc7 72%, rgba(37, 54, 80, 0.08) 72%);
}

.soft-timer-widget strong {
  font-family: var(--font-mono);
  color: #4f7fa6;
}

.soft-danger-widget {
  background: rgba(255, 239, 240, 0.72);
}

.soft-danger-widget strong {
  color: #c36e74;
}

.soft-tree-widget {
  height: 92px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  padding: 14px;
}

.soft-tree-widget span {
  width: 26px;
  border-radius: 999px 999px 4px 4px;
  background: #8fcfc7;
}

.soft-tree-widget span:nth-child(1) { height: 26px; opacity: 0.45; }
.soft-tree-widget span:nth-child(2) { height: 44px; opacity: 0.64; }
.soft-tree-widget span:nth-child(3) { height: 64px; opacity: 0.88; }
.soft-tree-widget span:nth-child(4) { height: 76px; background: #7bb0d5; }

.soft-heatmap-widget {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 14px;
}

.soft-heatmap-widget span {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(143, 207, 199, 0.18);
}

.soft-heatmap-widget span:nth-child(3n) { background: rgba(143, 207, 199, 0.55); }
.soft-heatmap-widget span:nth-child(4n) { background: rgba(123, 176, 213, 0.72); }
.soft-heatmap-widget span:nth-child(7) { background: rgba(217, 120, 126, 0.52); }

body.landing.dream-landing .how-it-works {
  background: linear-gradient(180deg, rgba(250, 248, 244, 0.96), rgba(239, 246, 252, 0.96));
}

body.landing.dream-landing .how-it-works::before {
  display: none;
}

body.landing.dream-landing .steps {
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr) 56px minmax(0, 1fr);
  gap: 18px;
}

body.landing.dream-landing .step {
  min-height: 304px;
  aspect-ratio: auto;
  padding: 30px 24px;
}

body.landing.dream-landing .step-icon {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(135deg, #a2d2ff 0%, #8fcfc7 100%);
  box-shadow: 0 14px 28px rgba(99, 153, 196, 0.2);
}

body.landing.dream-landing .step:nth-child(3) .step-icon {
  background: linear-gradient(135deg, #e9c46a 0%, #a2d2ff 100%);
}

body.landing.dream-landing .step:nth-child(5) .step-icon {
  background: linear-gradient(135deg, #d9787e 0%, #b9a7d9 100%);
}

body.landing.dream-landing .step-icon svg {
  width: 34px;
  height: 34px;
}

body.landing.dream-landing .step-num {
  width: auto;
  height: auto;
  margin-bottom: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 900;
}

body.landing.dream-landing .step h3 {
  color: #253650;
  font-family: 'Nunito', var(--font-sans);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0;
}

body.landing.dream-landing .step-arrow {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #4f7fa6;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

body.landing.dream-landing .principles-section {
  background:
    linear-gradient(180deg, rgba(239, 246, 252, 0.96), rgba(248, 250, 252, 0.96)),
    radial-gradient(circle at 18% 8%, rgba(217, 120, 126, 0.12), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(143, 207, 199, 0.16), transparent 32%);
}

body.landing.dream-landing .principles-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0 auto;
}

body.landing.dream-landing .principle-card {
  min-height: 250px;
  padding: 28px;
}

body.landing.dream-landing .principle-card span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 28px;
  border-radius: 10px;
  background: rgba(22, 99, 79, 0.08);
  color: #16634f;
  font-size: 12px;
  font-weight: 900;
}

body.landing.dream-landing .principle-card h3 {
  margin: 0 0 12px;
  color: #253650;
  font-size: 22px;
  line-height: 1.12;
}

body.landing.dream-landing .principle-card p {
  margin: 0;
  color: rgba(37, 54, 80, 0.64);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
}

body.landing.dream-landing .growth-section {
  max-width: none;
  padding: 112px 32px;
}

body.landing.dream-landing .growth-section .section-header,
body.landing.dream-landing .growth-chart-wrap {
  max-width: 860px;
}

body.landing.dream-landing .growth-chart-wrap {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(99, 153, 196, 0.18);
}

body.landing.dream-landing .growth-total-num {
  color: #4f7fa6;
  text-shadow: none;
}

.community-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 56px;
  align-items: center;
  padding: 130px 32px;
}

.community-section > * {
  max-width: 1120px;
}

.community-copy {
  justify-self: end;
  max-width: 500px;
}

.community-copy .section-kicker {
  margin-left: 0;
  text-align: left;
}

.community-copy h2 {
  margin: 0 0 22px;
  color: #253650;
  font-family: 'Nunito', var(--font-sans);
  font-size: clamp(38px, 4.4vw, 58px);
  font-weight: 700;
  line-height: 1.08;
}

.community-copy p {
  margin: 0 0 28px;
  color: rgba(37, 54, 80, 0.66);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.7;
}

.community-stack {
  position: relative;
  min-height: 430px;
}

.community-card {
  position: absolute;
  width: min(520px, 100%);
  padding: 30px;
}

.community-card span,
.community-card i {
  display: block;
  color: rgba(37, 54, 80, 0.52);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.community-card strong {
  display: block;
  margin: 10px 0;
  color: #253650;
  font-size: 24px;
}

.community-card-one {
  top: 0;
  left: 0;
}

.community-card-two {
  top: 136px;
  left: 70px;
}

.community-card-three {
  top: 272px;
  left: 24px;
}

body.landing.dream-landing .landing-pricing {
  background: linear-gradient(180deg, rgba(239, 246, 252, 0.96), rgba(250, 248, 244, 0.96));
}

body.landing.dream-landing .landing-pricing-header h2 {
  color: #253650;
  font-family: 'Nunito', var(--font-sans);
  font-size: clamp(36px, 4vw, 54px);
  font-weight: 700;
  letter-spacing: 0;
}

body.landing.dream-landing .landing-pricing-header p {
  color: rgba(37, 54, 80, 0.64);
  font-weight: 600;
}

body.landing.dream-landing .upgrade-card {
  background: rgba(255, 255, 255, 0.82);
}

body.landing.dream-landing .upgrade-card-featured {
  border-color: rgba(99, 153, 196, 0.44);
  box-shadow: 0 0 0 1px rgba(99, 153, 196, 0.12), 0 24px 62px rgba(99, 153, 196, 0.12);
}

body.landing.dream-landing .upgrade-card-btn {
  background: #253650;
  border-color: #253650;
  color: #ffffff;
}

body.landing.dream-landing .upgrade-card-btn-primary {
  background: #a2d2ff;
  color: #1f3554;
  border-color: #a2d2ff;
}

body.landing.dream-landing .upgrade-card-features li::before {
  background: #8fcfc7;
}

body.landing.dream-landing .cta {
  padding: 132px 32px;
  background: linear-gradient(180deg, rgba(250, 248, 244, 0.96), rgba(239, 246, 252, 0.96));
}

body.landing.dream-landing .cta::before {
  display: none;
}

body.landing.dream-landing .cta h2 {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.08;
}

body.landing.dream-landing .footer {
  background: #253650;
  color: rgba(255, 255, 255, 0.78);
}

body.landing.dream-landing .footer .logo,
body.landing.dream-landing .footer .logo-knight {
  color: #ffffff;
  fill: #ffffff;
}

@media (max-width: 980px) {
  body.landing.dream-landing .nav-links {
    gap: 12px;
  }

  body.landing.dream-landing .hero {
    min-height: auto;
    padding-top: 132px;
  }

  body.landing.dream-landing .soft-editor .mock-content {
    grid-template-columns: 1fr;
  }

  .soft-editor-sidebar {
    display: none;
  }

  .soft-editor-page {
    padding: 38px 28px;
  }

  body.landing.dream-landing .features-grid,
  body.landing.dream-landing .stats-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-section {
    grid-template-columns: 1fr;
  }

  .community-copy {
    justify-self: center;
    text-align: center;
  }

  .community-copy .section-kicker {
    margin-left: auto;
    text-align: center;
  }

  .community-stack {
    max-width: 560px;
    width: 100%;
    justify-self: center;
  }
}

@media (max-width: 768px) {
  body.landing.dream-landing .nav {
    top: 0;
    width: 100%;
  }

  body.landing.dream-landing .nav-inner {
    height: 58px;
    padding: 0 18px;
  }

  body.landing.dream-landing .logo {
    padding-right: 48px;
    font-size: 18px;
  }

  body.landing.dream-landing .mobile-menu {
    top: 18px;
    right: 18px;
  }

  body.landing.dream-landing .nav-links.mobile-open {
    display: flex;
    top: 58px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(57, 79, 111, 0.1);
  }

  body.landing.dream-landing .hero {
    padding: 118px 18px 64px;
  }

  body.landing.dream-landing .hero-title {
    max-width: 360px;
    font-size: clamp(40px, 11vw, 54px);
  }

  body.landing.dream-landing .hero-sub {
    max-width: 340px;
    font-size: 16px;
  }

  body.landing.dream-landing .hero-actions {
    gap: 12px;
  }

  body.landing.dream-landing .hero-object {
    display: none;
  }

  body.landing.dream-landing .mock-editor {
    width: 100%;
  }

  body.landing.dream-landing .mock-toolbar {
    gap: 10px;
  }

  body.landing.dream-landing .mock-timer {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  body.landing.dream-landing .soft-editor-page .mock-line {
    font-size: 17px;
    line-height: 1.8;
  }

  body.landing.dream-landing .stats-inner,
  body.landing.dream-landing .features-grid,
  body.landing.dream-landing .steps {
    grid-template-columns: 1fr;
  }

  body.landing.dream-landing .stats-bar,
  body.landing.dream-landing .features,
  body.landing.dream-landing .how-it-works,
  body.landing.dream-landing .growth-section,
  body.landing.dream-landing .community-section,
  body.landing.dream-landing .landing-pricing,
  body.landing.dream-landing .cta {
    padding-left: 18px;
    padding-right: 18px;
  }

  body.landing.dream-landing .features,
  body.landing.dream-landing .how-it-works,
  body.landing.dream-landing .growth-section,
  body.landing.dream-landing .community-section,
  body.landing.dream-landing .landing-pricing,
  body.landing.dream-landing .cta {
    padding-top: 88px;
    padding-bottom: 88px;
  }

  body.landing.dream-landing .step {
    max-width: none;
    min-height: auto;
    aspect-ratio: auto;
  }

  body.landing.dream-landing .step-arrow {
    transform: rotate(90deg);
    margin: 0 auto;
  }

  .community-stack {
    min-height: 0;
    display: grid;
    gap: 14px;
  }

  .community-card {
    position: static;
    width: 100%;
  }
}

@media (max-width: 520px) {
  body.landing.dream-landing .stats-inner {
    gap: 12px;
  }

  body.landing.dream-landing .stat {
    min-height: 118px;
  }

  body.landing.dream-landing .stat-num {
    font-size: 34px;
  }

  .soft-editor-page {
    padding: 30px 20px;
  }

  body.landing.dream-landing .feature-card {
    min-height: auto;
    padding: 26px;
  }
}

/* ===== LANDING REFINEMENT: WRITING TRIAL + MANUSCRIPT MOTION ===== */
body.landing.dream-landing {
  background:
    linear-gradient(180deg, rgba(247, 249, 252, 0.92) 0%, rgba(238, 245, 251, 0.88) 48%, rgba(250, 248, 244, 0.94) 100%),
    repeating-linear-gradient(115deg, rgba(99, 153, 196, 0.035) 0 1px, transparent 1px 34px);
}

body.landing.dream-landing .btn,
body.landing.dream-landing .btn-small,
body.landing.dream-landing .btn-large,
body.landing.dream-landing .upgrade-card-btn,
body.landing.dream-landing .landing-plan-btn {
  border-radius: 10px;
}

body.landing.dream-landing .btn-small,
body.landing.dream-landing .btn-primary {
  background: #16634f;
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(22, 99, 79, 0.18);
}

body.landing.dream-landing .btn-small:hover,
body.landing.dream-landing .btn-primary:hover {
  background: #0f503f;
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(22, 99, 79, 0.23);
}

body.landing.dream-landing .btn-ghost {
  color: #16634f;
  border-color: rgba(22, 99, 79, 0.24);
  background: #ffffff;
}

body.landing.dream-landing .btn-ghost:hover {
  color: #0f503f;
  border-color: rgba(22, 99, 79, 0.38);
  background: #f7fbf8;
}

body.landing.dream-landing .logo {
  gap: 9px;
}

body.landing.dream-landing .brand-mark {
  width: 27px;
  height: 27px;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
  box-shadow: none;
}

body.landing.dream-landing .logo-knight,
body.landing.dream-landing .hero-object,
body.landing.dream-landing .ad-showcase {
  display: none;
}

body.landing.dream-landing .hero {
  min-height: 900px;
  background:
    linear-gradient(180deg, rgba(247, 249, 252, 0.75) 0%, rgba(247, 249, 252, 0.9) 54%, rgba(239, 246, 252, 0.98) 100%),
    repeating-linear-gradient(0deg, rgba(37, 54, 80, 0.025) 0 1px, transparent 1px 34px);
}

.hero-bg-motion {
  position: absolute;
  inset: 58px 0 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.motion-sheet,
.motion-line {
  position: absolute;
  display: block;
  border: 1px solid rgba(57, 79, 111, 0.08);
  background:
    repeating-linear-gradient(180deg, rgba(37, 54, 80, 0.08) 0 1px, transparent 1px 18px),
    rgba(255, 255, 255, 0.46);
  box-shadow: 0 22px 54px rgba(70, 93, 124, 0.08);
  opacity: 0.62;
}

.motion-sheet {
  width: 230px;
  height: 310px;
  border-radius: 10px;
  animation: manuscriptDrift 22s ease-in-out infinite;
}

.motion-sheet-one {
  top: 90px;
  left: max(18px, calc(50% - 650px));
  transform: rotate(-9deg);
}

.motion-sheet-two {
  top: 180px;
  right: max(26px, calc(50% - 680px));
  width: 260px;
  height: 340px;
  transform: rotate(8deg);
  animation-delay: -7s;
}

.motion-sheet-three {
  top: 560px;
  left: calc(50% + 360px);
  width: 180px;
  height: 230px;
  transform: rotate(12deg);
  animation-delay: -13s;
}

.motion-line {
  height: 42px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(37, 54, 80, 0.12), transparent 72%),
    rgba(255, 255, 255, 0.44);
  animation: manuscriptLineFlow 16s linear infinite;
}

.motion-line-one {
  top: 500px;
  left: -14vw;
  width: 38vw;
}

.motion-line-two {
  top: 640px;
  right: -18vw;
  width: 42vw;
  animation-delay: -5s;
}

.motion-line-three {
  top: 260px;
  left: 58vw;
  width: 34vw;
  animation-delay: -10s;
}

@keyframes manuscriptDrift {
  0%, 100% { translate: 0 0; }
  34% { translate: 22px -18px; }
  68% { translate: -18px 16px; }
}

@keyframes manuscriptLineFlow {
  0% { transform: translateX(-24px); opacity: 0.22; }
  18%, 78% { opacity: 0.56; }
  100% { transform: translateX(42px); opacity: 0.22; }
}

body.landing.dream-landing .hero-title {
  max-width: 840px;
  min-height: 178px;
}

body.landing.dream-landing .hero-title em {
  display: inline-block;
  min-width: 9ch;
  color: #16634f;
  transition: opacity 180ms ease, transform 180ms ease;
}

body.landing.dream-landing .hero-title em.is-changing {
  opacity: 0;
  transform: translateY(8px);
}

body.landing.dream-landing .hero-title,
body.landing.dream-landing .hero-sub,
body.landing.dream-landing .hero-actions,
body.landing.dream-landing .hero-visual {
  position: relative;
  z-index: 2;
}

body.landing.dream-landing .hero-actions {
  align-items: center;
}

body.trial-open {
  overflow: hidden;
}

.trial-writing-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 33, 48, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.trial-writing-modal.active {
  display: flex;
}

.trial-writing-dialog {
  position: relative;
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(57, 79, 111, 0.14);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 34px 96px rgba(31, 46, 68, 0.22);
  overflow: hidden;
}

.trial-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(57, 79, 111, 0.12);
  border-radius: 10px;
  background: #ffffff;
  color: #253650;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.trial-writing-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 74px 24px 34px;
  border-bottom: 1px solid rgba(57, 79, 111, 0.1);
  background: linear-gradient(180deg, #f9fbfd, #f3f8fb);
}

.trial-kicker {
  margin: 0 0 8px;
  color: rgba(37, 54, 80, 0.52);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trial-writing-head h2 {
  margin: 0;
  color: #253650;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.12;
}

.trial-timer {
  min-width: 88px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(22, 99, 79, 0.18);
  border-radius: 10px;
  background: #ffffff;
  color: #16634f;
  font-family: var(--font-mono);
  font-weight: 800;
}

.trial-writing-area {
  width: 100%;
  min-height: 330px;
  flex: 1;
  border: 0;
  resize: none;
  padding: 38px 44px;
  color: #253650;
  background: #ffffff;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px;
  line-height: 1.8;
  outline: none;
}

.trial-writing-area::placeholder {
  color: rgba(37, 54, 80, 0.34);
}

.trial-writing-area[readonly] {
  color: rgba(37, 54, 80, 0.58);
}

.trial-writing-foot {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 34px;
  border-top: 1px solid rgba(57, 79, 111, 0.1);
  color: rgba(37, 54, 80, 0.52);
  background: #f9fbfd;
  font-size: 13px;
  font-weight: 800;
}

.trial-lock {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(249, 251, 253, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.trial-lock[aria-hidden="false"] {
  display: flex;
}

.trial-lock-card {
  width: min(520px, 100%);
  border: 1px solid rgba(57, 79, 111, 0.14);
  border-radius: 10px;
  padding: 34px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(70, 93, 124, 0.16);
  text-align: center;
}

.trial-lock-card h3 {
  margin: 0 0 12px;
  color: #253650;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.08;
}

.trial-lock-card p {
  margin: 0 0 22px;
  color: rgba(37, 54, 80, 0.66);
  font-size: 16px;
  line-height: 1.6;
}

.trial-lock-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .hero-bg-motion {
    inset: 58px 0 0;
  }

  .motion-sheet {
    opacity: 0.34;
  }

  .motion-sheet-one {
    left: -120px;
  }

  .motion-sheet-two {
    right: -142px;
  }

  .motion-line {
    display: none;
  }

  body.landing.dream-landing .hero-title {
    min-height: 118px;
  }

  body.landing.dream-landing .hero-title em {
    min-width: 7.5ch;
  }

  .trial-writing-modal {
    padding: 12px;
  }

  .trial-writing-head {
    flex-direction: column;
    padding: 28px 64px 20px 22px;
  }

  .trial-timer {
    align-self: flex-start;
  }

  .trial-writing-area {
    min-height: 340px;
    padding: 28px 22px;
    font-size: 18px;
  }

  .trial-writing-foot {
    flex-direction: column;
    padding: 14px 22px;
  }

  .trial-lock-card {
    padding: 28px 22px;
  }
}

/* ===== HERO ENGRAVING BACKGROUND ===== */
body.landing.dream-landing .hero {
  background:
    linear-gradient(180deg, rgba(247, 249, 252, 0.62) 0%, rgba(247, 249, 252, 0.36) 44%, rgba(239, 246, 252, 0.84) 100%),
    linear-gradient(90deg, rgba(247, 249, 252, 0.62) 0%, rgba(247, 249, 252, 0.08) 50%, rgba(247, 249, 252, 0.62) 100%),
    url('/media/hero-classical-background.jpg') center top / cover no-repeat;
}

.hero-bg-motion {
  display: none;
}

body.landing.dream-landing .nav {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(37, 54, 80, 0.08);
  box-shadow: 0 8px 28px rgba(37, 54, 80, 0.04);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
}

body.landing.dream-landing .nav-inner {
  max-width: 1180px;
  height: 58px;
  padding: 0 28px;
}

body.landing.dream-landing .logo {
  font-family: 'Nunito', var(--font-sans);
  font-size: 20px;
  font-weight: 900;
  color: #253650;
}

body.landing.dream-landing .nav-links {
  gap: 30px;
}

body.landing.dream-landing .nav-links a:not(.btn) {
  padding: 8px 0;
  color: rgba(37, 54, 80, 0.68);
  font-size: 14px;
  font-weight: 800;
  background: transparent;
}

body.landing.dream-landing .nav-links a:not(.btn):hover {
  color: #16634f;
  background: transparent;
}

body.landing.dream-landing .nav-links .btn-small {
  margin-left: 4px;
  padding: 14px 22px;
  border-radius: 10px;
  background: #16634f;
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(22, 99, 79, 0.18);
}

body.landing.dream-landing .hero-actions {
  justify-content: center;
}

body.landing.dream-landing .hero-pressure {
  position: relative;
  z-index: 2;
  width: fit-content;
  margin: 0 auto 18px;
  padding: 8px 14px;
  border: 1px solid rgba(22, 99, 79, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.56);
  color: #16634f;
  box-shadow: 0 12px 32px rgba(37, 54, 80, 0.08);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

body.landing.dream-landing .hero-title em::after {
  content: '';
  display: inline-block;
  width: 0.07em;
  height: 0.82em;
  margin-left: 0.08em;
  translate: 0 0.1em;
  border-radius: 2px;
  background: currentColor;
  animation: projectCursorBlink 900ms steps(2, start) infinite;
}

@keyframes projectCursorBlink {
  0%, 42% { opacity: 1; }
  43%, 100% { opacity: 0; }
}

body.landing.dream-landing .hero-visual {
  position: relative;
}

.visual-writing-overlay,
.visual-try-button {
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.visual-writing-overlay {
  z-index: 3;
  width: min(420px, calc(100% - 48px));
  height: 148px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 22px 70px rgba(37, 54, 80, 0.18);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.visual-try-button {
  z-index: 4;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(22, 99, 79, 0.24);
  color: #16634f;
  box-shadow: 0 14px 34px rgba(37, 54, 80, 0.14);
}

body.landing.dream-landing .hero-visual:hover .visual-writing-overlay,
body.landing.dream-landing .hero-visual:hover .visual-try-button,
body.landing.dream-landing .hero-visual:focus-within .visual-writing-overlay,
body.landing.dream-landing .hero-visual:focus-within .visual-try-button {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

@media (max-width: 768px) {
  body.landing.dream-landing .hero {
    background:
      linear-gradient(180deg, rgba(247, 249, 252, 0.66) 0%, rgba(247, 249, 252, 0.42) 42%, rgba(239, 246, 252, 0.88) 100%),
      linear-gradient(90deg, rgba(247, 249, 252, 0.68) 0%, rgba(247, 249, 252, 0.16) 50%, rgba(247, 249, 252, 0.68) 100%),
      url('/media/hero-classical-background.jpg') center top / cover no-repeat;
    width: 100%;
    max-width: 100vw;
    padding-left: 16px;
    padding-right: 16px;
  }

  body.landing.dream-landing .nav-inner {
    height: 58px;
    padding: 0 18px;
  }

  body.landing.dream-landing .hero-title {
    width: min(100%, 300px);
    max-width: calc(100vw - 32px);
    min-height: 98px;
    margin-inline: auto;
    font-size: clamp(36px, 9.8vw, 42px);
    line-height: 1.04;
    overflow-wrap: normal;
  }

  body.landing.dream-landing .hero-title em {
    min-width: 0;
  }

  body.landing.dream-landing .hero-sub {
    width: min(100%, 286px);
    max-width: calc(100vw - 44px);
    margin-inline: auto;
    font-size: 16px;
  }

  body.landing.dream-landing .hero-pressure {
    margin-bottom: 16px;
    font-size: 13px;
  }

  body.landing.dream-landing .principles-section {
    padding: 86px 18px;
  }

  body.landing.dream-landing .principles-grid {
    grid-template-columns: 1fr;
  }

  body.landing.dream-landing .principle-card {
    min-height: 0;
    padding: 24px;
  }

  .visual-writing-overlay,
  .visual-try-button {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
  }

  .visual-writing-overlay {
    width: min(300px, calc(100% - 42px));
    height: 118px;
  }
}

/* ===== FEATURE BENTO SCENE ===== */
body.landing.dream-landing .features {
  position: relative;
  overflow: hidden;
  padding-top: 132px;
  padding-bottom: clamp(360px, 34vw, 560px);
  background:
    linear-gradient(180deg, #fbfaf4 0%, #fbf8ef 44%, rgba(251, 248, 239, 0.88) 68%, rgba(251, 248, 239, 0.18) 100%),
    url('/media/features-classical-background.jpg') center bottom / min(100%, 2200px) auto no-repeat;
}

body.landing.dream-landing .features::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: min(42vw, 620px);
  pointer-events: none;
  background:
    linear-gradient(180deg, #fbf8ef 0%, rgba(251, 248, 239, 0.52) 22%, rgba(251, 248, 239, 0) 48%),
    linear-gradient(90deg, rgba(251, 248, 239, 0.78), rgba(251, 248, 239, 0) 24%, rgba(251, 248, 239, 0) 76%, rgba(251, 248, 239, 0.66));
  z-index: 0;
}

body.landing.dream-landing .features .section-header,
body.landing.dream-landing .features-grid {
  position: relative;
  z-index: 1;
}

body.landing.dream-landing .features .section-header {
  margin-bottom: 58px;
}

body.landing.dream-landing .features-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 86px;
  align-items: stretch;
  gap: 18px;
  margin: 0 auto;
}

body.landing.dream-landing .feature-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 54px rgba(116, 101, 78, 0.09);
}

body.landing.dream-landing .feature-card:nth-child(1) {
  grid-column: span 5;
  grid-row: span 4;
}

body.landing.dream-landing .feature-card:nth-child(2) {
  grid-column: span 4;
  grid-row: span 3;
}

body.landing.dream-landing .feature-card:nth-child(3) {
  grid-column: span 3;
  grid-row: span 4;
}

body.landing.dream-landing .feature-card:nth-child(4) {
  grid-column: span 4;
  grid-row: span 3;
}

body.landing.dream-landing .feature-card:nth-child(5) {
  grid-column: span 3;
  grid-row: span 3;
}

body.landing.dream-landing .feature-card:nth-child(6) {
  grid-column: span 5;
  grid-row: span 3;
}

body.landing.dream-landing .feature-card p {
  margin-bottom: 0;
}

body.landing.dream-landing .feature-widget {
  margin-top: auto;
}

@media (max-width: 980px) {
  body.landing.dream-landing .features {
    padding-bottom: clamp(300px, 52vw, 480px);
    background-size: auto min(48vw, 460px);
    background-position: center bottom;
  }

  body.landing.dream-landing .features-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 78px;
  }

  body.landing.dream-landing .feature-card:nth-child(n) {
    grid-column: span 3;
    grid-row: span 4;
  }

  body.landing.dream-landing .feature-card:nth-child(1),
  body.landing.dream-landing .feature-card:nth-child(6) {
    grid-column: span 6;
    grid-row: span 3;
  }
}

@media (max-width: 768px) {
  body.landing.dream-landing .features {
    padding: 88px 18px clamp(250px, 64vw, 360px);
    background-size: auto min(66vw, 320px);
  }

  body.landing.dream-landing .features .section-header {
    margin-bottom: 38px;
  }

  body.landing.dream-landing .features-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 14px;
  }

  body.landing.dream-landing .feature-card:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  body.landing.dream-landing .feature-card {
    padding: 24px;
  }
}

/* ===== LANDING POLISH: CTA, NOTES, WRITER-OWNED SECTION ===== */
body.landing.dream-landing .nav-links a:not(.btn) {
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 350;
  letter-spacing: 0.01em;
  color: rgba(33, 45, 64, 0.74);
}

body.landing.dream-landing .nav-links a:not(.btn):hover {
  color: #1e2b3d;
}

body.landing.dream-landing .btn-primary,
body.landing.dream-landing .nav-links .btn-small,
body.landing.dream-landing .writer-owned-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 78px;
  padding: 0 28px;
  border: 0;
  border-radius: 10px;
  background: #a9d4ff;
  color: #1d2a3d;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: clamp(24px, 2.25vw, 32px);
  font-weight: 520;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: none;
}

body.landing.dream-landing .cta-shine-button {
  position: relative;
  gap: 10px;
  box-sizing: border-box;
  min-height: 62px;
  padding: 0.5rem 1.25rem;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.34);
  border-radius: 9999px;
  background: linear-gradient(135deg, #16634f 0%, #0f8067 100%);
  color: #ffffff;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(22, 99, 79, 0.22);
  transition: transform 0.3s ease-in-out, border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out, background 0.3s ease-in-out;
}

body.landing.dream-landing .btn-primary::after,
body.landing.dream-landing .nav-links .btn-small::after,
body.landing.dream-landing .writer-owned-cta::after {
  content: "\2192";
  font-size: 1.08em;
  line-height: 1;
}

body.landing.dream-landing .cta-shine-button::after {
  display: none;
}

body.landing.dream-landing .cta-shine-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100px;
  width: 100px;
  height: 100%;
  opacity: 0.6;
  background-image: linear-gradient(120deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 70%);
}

body.landing.dream-landing .cta-shine-icon {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  transition: transform 0.3s ease-in-out;
}

body.landing.dream-landing .cta-shine-button span {
  position: relative;
  z-index: 1;
}

body.landing.dream-landing .cta-shine-button:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.62);
  background: linear-gradient(135deg, #1b725c 0%, #109175 100%);
  box-shadow: 0 16px 34px rgba(22, 99, 79, 0.26);
}

body.landing.dream-landing .cta-shine-button:hover .cta-shine-icon {
  transform: translateX(4px);
}

body.landing.dream-landing .cta-shine-button:hover::before {
  animation: ctaShine 1.5s ease-out infinite;
}

@keyframes ctaShine {
  0% { left: -100px; }
  60%, 100% { left: 100%; }
}

body.landing.dream-landing .btn-primary:hover,
body.landing.dream-landing .nav-links .btn-small:hover,
body.landing.dream-landing .writer-owned-cta:hover {
  background: #98caff;
  color: #172337;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(83, 137, 196, 0.18);
}

body.landing.dream-landing .cta-shine-button:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #1b725c 0%, #109175 100%);
  box-shadow: 0 16px 34px rgba(22, 99, 79, 0.26);
}

body.landing.dream-landing .nav-links .btn-small {
  min-height: 34px;
  padding: 0.34rem 0.78rem;
  border-width: 2px;
  font-size: 12px;
  font-weight: 620;
}

body.landing.dream-landing .hero-actions .btn-primary {
  min-width: 286px;
}

body.landing.dream-landing .hero-actions .cta-shine-button {
  width: min(286px, calc(100vw - 64px));
  background: linear-gradient(135deg, #16634f 0%, #0f8067 100%);
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(22, 99, 79, 0.26);
}

body.landing.dream-landing .hero-actions .cta-shine-button:hover {
  background: linear-gradient(135deg, #1b725c 0%, #109175 100%);
  color: #ffffff;
  box-shadow: 0 18px 38px rgba(22, 99, 79, 0.3);
}

body.landing.dream-landing .nav-links .cta-shine-icon {
  width: 18px;
  height: 18px;
}

body.landing.dream-landing .hero-visual .mock-editor {
  transition: filter 220ms ease, opacity 220ms ease, transform 300ms ease;
}

body.landing.dream-landing .hero-visual:hover .mock-editor,
body.landing.dream-landing .hero-visual:focus-within .mock-editor {
  filter: blur(2.8px);
  opacity: 0.87;
}

.visual-writing-overlay {
  display: none;
}

body.landing.dream-landing .visual-try-button {
  z-index: 4;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #a9d4ff;
  color: #1d2a3d;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 560;
  box-shadow: 0 18px 44px rgba(32, 48, 70, 0.18);
}

body.landing.dream-landing .hero-visual:hover .visual-try-button,
body.landing.dream-landing .hero-visual:focus-within .visual-try-button {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

body.landing.dream-landing .writer-owned-section {
  position: relative;
  overflow: hidden;
  padding: clamp(96px, 10vw, 148px) 24px;
  background:
    linear-gradient(90deg, rgba(18, 25, 43, 0.98) 0%, rgba(18, 25, 43, 0.95) 42%, rgba(18, 25, 43, 0.9) 100%),
    url('/media/hero-classical-background.jpg') center center / cover no-repeat;
  color: #dfe7f5;
}

body.landing.dream-landing .writer-owned-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 25, 43, 0.48), rgba(18, 25, 43, 0.9)),
    radial-gradient(circle at 8% 16%, rgba(169, 212, 255, 0.12), transparent 28%);
  pointer-events: none;
}

body.landing.dream-landing .writer-owned-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(360px, 1fr);
  gap: clamp(42px, 7vw, 96px);
  width: min(1100px, 100%);
  margin: 0 auto;
  align-items: center;
}

body.landing.dream-landing .writer-owned-copy h2 {
  max-width: 560px;
  margin: 0 0 58px;
  color: #dfe7f5;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: clamp(44px, 5vw, 68px);
  font-weight: 360;
  letter-spacing: 0;
  line-height: 1.08;
}

body.landing.dream-landing .writer-owned-copy h2::after {
  content: '';
  display: block;
  width: min(280px, 54%);
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: #a9d4ff;
}

body.landing.dream-landing .writer-owned-values {
  max-width: 560px;
}

body.landing.dream-landing .writer-owned-values button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid rgba(223, 231, 245, 0.14);
  background: transparent;
  color: rgba(223, 231, 245, 0.9);
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 390;
  text-align: left;
}

body.landing.dream-landing .writer-owned-values span {
  color: rgba(223, 231, 245, 0.62);
  font-size: 24px;
}

body.landing.dream-landing .writer-owned-media p {
  max-width: 560px;
  margin: 30px 0 26px;
  color: rgba(223, 231, 245, 0.82);
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.42;
}

body.landing.dream-landing .writer-video-placeholder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #08110d;
}

body.landing.dream-landing .writer-video-placeholder::before {
  content: none;
  position: absolute;
  top: 22px;
  left: 24px;
  color: rgba(223, 231, 245, 0.48);
  font-size: 13px;
  font-weight: 520;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.landing.dream-landing .writer-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #08110d;
}

body.landing.dream-landing .writer-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(247, 244, 236, 0.88);
  color: #0c3b2b;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
  cursor: pointer;
}

body.landing.dream-landing .writer-video-play:hover {
  background: #ffffff;
  transform: translate(-50%, -50%) scale(1.04);
}

body.landing.dream-landing .writer-video-play span {
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid currentColor;
  transform: translateX(2px);
}

body.landing.dream-landing .writer-video-player.is-playing .writer-video-play {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.92);
}

body.landing.dream-landing .writer-video-progress {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  z-index: 2;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(247, 244, 236, 0.24);
  opacity: 0;
  transition: opacity 180ms ease;
  cursor: pointer;
}

body.landing.dream-landing .writer-video-player.has-played .writer-video-progress {
  opacity: 1;
}

body.landing.dream-landing .writer-video-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #f7f4ec;
}

body.landing.dream-landing .writer-owned-cta {
  min-height: 44px;
  padding: 0 16px;
  font-size: 18px;
}

body.landing.dream-landing .writer-notes-section {
  --notes-scroll-shift: 0px;
  --notes-scroll-shift-low: 0px;
  overflow: hidden;
  padding: clamp(76px, 8vw, 112px) 0 clamp(82px, 9vw, 122px);
  background: #f2f2f2;
}

body.landing.dream-landing .writer-notes-heading {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto 78px;
  text-align: center;
}

body.landing.dream-landing .writer-notes-heading h2 {
  margin: 0;
  color: #202020;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
}

body.landing.dream-landing .writer-notes-rails {
  display: grid;
  gap: 28px;
}

body.landing.dream-landing .writer-notes-rail {
  position: relative;
  left: 50%;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 22px);
  width: max-content;
  min-width: calc(100vw + 1580px);
  will-change: transform;
}

body.landing.dream-landing .writer-notes-rail.rail-left {
  transform: translateX(calc(-50% - 120px + var(--notes-scroll-shift)));
}

body.landing.dream-landing .writer-notes-rail.rail-right {
  transform: translateX(calc(-50% + 110px - var(--notes-scroll-shift)));
}

body.landing.dream-landing .writer-notes-rail.rail-low {
  transform: translateX(calc(-50% - 140px + var(--notes-scroll-shift-low)));
}

body.landing.dream-landing .writer-note {
  --tilt: 0deg;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  min-height: 92px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 54px rgba(28, 31, 38, 0.04);
  transform: rotate(clamp(-5deg, var(--tilt), 5deg));
  transform-origin: center center;
  transition: transform 180ms ease, box-shadow 180ms ease;
  will-change: transform;
}

body.landing.dream-landing .writer-note:hover {
  position: relative;
  z-index: 3;
  box-shadow: 0 22px 64px rgba(28, 31, 38, 0.12);
  transform: rotate(0deg) translateY(-4px);
}

body.landing.dream-landing .writer-note.wide {
  width: 390px;
}

body.landing.dream-landing .writer-note.compact {
  width: 286px;
}

body.landing.dream-landing .note-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #304f2f;
  color: #fff;
  font-weight: 700;
  overflow: hidden;
}

body.landing.dream-landing .note-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

body.landing.dream-landing .writer-note:nth-child(2n) .note-avatar {
  background: #b9d7fb;
  color: #1d2a3d;
}

body.landing.dream-landing .writer-note:nth-child(3n) .note-avatar {
  background: #d7b6ff;
  color: #1d2a3d;
}

body.landing.dream-landing .writer-note strong {
  display: block;
  margin-bottom: 4px;
  color: rgba(32, 43, 61, 0.68);
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 420;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

body.landing.dream-landing .writer-note p {
  margin: 0;
  color: #171717;
  font-size: 16px;
  font-weight: 560;
  line-height: 1.28;
}

body.landing.dream-landing .community-stats-section {
  position: relative;
  overflow: hidden;
  min-height: clamp(320px, 34vw, 430px);
  display: grid;
  place-items: center;
  padding: clamp(72px, 8vw, 118px) 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(247, 250, 252, 0.46)),
    url('/media/community-map-background.png') center / cover no-repeat,
    #ffffff;
}

body.landing.dream-landing .community-stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.42;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.72));
}

body.landing.dream-landing .community-stats-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  text-align: center;
}

body.landing.dream-landing .community-stats-inner p {
  margin: 0 0 34px;
  color: rgba(76, 89, 113, 0.78);
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 450;
}

body.landing.dream-landing .community-stats-inner h2 {
  margin: 0 auto;
  max-width: 980px;
  color: #4f596d;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 360;
  letter-spacing: 0;
  line-height: 1.3;
}

body.landing.dream-landing .community-stats-line {
  display: inline;
}

body.landing.dream-landing .community-stats-inner h2 span {
  color: inherit;
  font-weight: inherit;
}

body.landing.dream-landing .community-stats-inner h2 .community-stats-line {
  color: #4f596d;
  font-weight: 360;
}

@media (max-width: 900px) {
  body.landing.dream-landing .writer-owned-inner {
    grid-template-columns: 1fr;
  }

  body.landing.dream-landing .writer-owned-copy h2,
  body.landing.dream-landing .writer-owned-values,
  body.landing.dream-landing .writer-owned-media p {
    max-width: none;
  }
}

@media (max-width: 768px) {
  body.landing.dream-landing .btn-primary {
    min-height: 58px;
    min-width: 0;
    padding: 0 22px;
    font-size: 22px;
  }

  body.landing.dream-landing .nav-links .btn-small {
    min-height: 36px;
    font-size: 13px;
  }

  body.landing.dream-landing .hero-actions .btn-primary {
    min-width: min(286px, 100%);
  }

  body.landing.dream-landing .hero-actions .cta-shine-button {
    width: min(282px, calc(100vw - 54px));
    display: none;
  }

  body.landing a[href="/login"],
  body.landing a[href="/register"] {
    display: none !important;
  }

  body.landing.dream-landing .visual-try-button {
    display: none;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
  }

  body.landing.dream-landing .hero-visual .mock-editor {
    filter: blur(0.75px);
    opacity: 0.94;
  }

  body.landing.dream-landing .writer-notes-rails {
    gap: 22px;
  }

  body.landing.dream-landing .writer-notes-rail {
    gap: 18px;
  }

  body.landing.dream-landing .writer-note,
  body.landing.dream-landing .writer-note.wide,
  body.landing.dream-landing .writer-note.compact {
    width: min(330px, calc(100vw - 42px));
    min-height: 112px;
    padding: 20px;
  }

  body.landing.dream-landing .writer-note p {
    font-size: 16px;
  }

  body.landing.dream-landing .community-stats-section {
    min-height: 330px;
    padding: 72px 18px;
  }

  body.landing.dream-landing .community-stats-inner p {
    margin-bottom: 24px;
  }

  body.landing.dream-landing .community-stats-inner h2 {
    max-width: 292px;
    font-size: 25px;
    line-height: 1.24;
  }

  body.landing.dream-landing .writer-owned-section {
    padding: 86px 18px;
  }

  body.landing.dream-landing .writer-owned-copy h2 {
    margin-bottom: 34px;
  }
}

/* ===== PLATFORM DASHBOARD COLLAGE ===== */
body.landing.dream-landing .platform-dashboard-section {
  padding: clamp(34px, 4vw, 58px) 24px clamp(160px, 17vw, 300px);
  background:
    linear-gradient(180deg, rgba(251, 248, 239, 0.96) 0%, rgba(251, 248, 239, 0.88) 42%, rgba(251, 248, 239, 0.64) 72%, rgba(251, 248, 239, 0.3) 100%),
    url('/media/features-classical-background.jpg') center bottom / min(100%, 2200px) auto no-repeat;
}

body.landing.dream-landing .platform-dashboard-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  width: min(1360px, 100%);
  margin: 0 auto;
  align-items: start;
}

body.landing.dream-landing .dashboard-column {
  display: grid;
  gap: 20px;
}

body.landing.dream-landing .dashboard-column-center {
  padding-top: 16px;
}

body.landing.dream-landing .dashboard-column-right {
  padding-top: 4px;
}

body.landing.dream-landing .dashboard-panel {
  overflow: hidden;
  border: 1px solid rgba(135, 149, 173, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 38px rgba(40, 53, 76, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #263149;
}

body.landing.dream-landing .dashboard-panel h3 {
  margin: 0;
  color: #263149;
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 740;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.landing.dream-landing .dashboard-panel p {
  color: #6f7a94;
  font-size: 16px;
  line-height: 1.45;
}

body.landing.dream-landing .streak-panel {
  padding: 22px 24px;
  min-height: 154px;
}

body.landing.dream-landing .panel-title-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

body.landing.dream-landing .panel-title-row h3 {
  font-size: clamp(21px, 1.8vw, 26px);
  line-height: 1.12;
  letter-spacing: 0;
  text-transform: none;
}

body.landing.dream-landing .panel-title-row p {
  margin: 8px 0 0;
  font-size: 16px;
}

body.landing.dream-landing .panel-symbol {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(22, 99, 79, 0.12);
  color: #16634f;
  font-weight: 800;
}

body.landing.dream-landing .habit-copy {
  margin-bottom: 12px;
  color: #263149;
  font-size: 18px;
  font-weight: 650;
}

body.landing.dream-landing .progress-meta,
body.landing.dream-landing .goal-counts {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #7a849b;
  font-size: 15px;
}

body.landing.dream-landing .progress-meta strong {
  color: #2F4A3E;
}

body.landing.dream-landing .dashboard-progress {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1f7;
}

body.landing.dream-landing .dashboard-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

body.landing.dream-landing .dashboard-progress.purple span {
  width: 82%;
  background: #b92fd5;
}

body.landing.dream-landing .dashboard-progress.green span {
  width: 78%;
  background: #39d3bd;
}

body.landing.dream-landing .community-panel,
body.landing.dream-landing .playlists-panel,
body.landing.dream-landing .word-count-panel,
body.landing.dream-landing .productivity-panel,
body.landing.dream-landing .today-panel,
body.landing.dream-landing .time-panel,
body.landing.dream-landing .goals-panel,
body.landing.dream-landing .reading-panel,
body.landing.dream-landing .bars-panel {
  padding: 22px;
}

body.landing.dream-landing .community-panel {
  min-height: 254px;
}

body.landing.dream-landing .playlists-panel {
  min-height: 210px;
}

body.landing.dream-landing .word-count-panel {
  min-height: 198px;
}

body.landing.dream-landing .productivity-panel {
  min-height: 228px;
}

body.landing.dream-landing .today-panel {
  min-height: 180px;
}

body.landing.dream-landing .time-panel {
  min-height: 138px;
  padding-bottom: 18px;
}

body.landing.dream-landing .goals-panel {
  min-height: 248px;
}

body.landing.dream-landing .reading-panel {
  min-height: 306px;
  padding: 0;
}

body.landing.dream-landing .bars-panel {
  min-height: 250px;
}

body.landing.dream-landing .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

body.landing.dream-landing .panel-heading span,
body.landing.dream-landing .today-panel .panel-heading span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(22, 99, 79, 0.12);
  color: #16634f;
  font-size: 13px;
  font-weight: 750;
}

body.landing.dream-landing .community-panel > a,
body.landing.dream-landing .goals-panel > a,
body.landing.dream-landing .reading-panel > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  margin-top: 22px;
  padding: 0 12px;
  border-radius: 6px;
  background: rgba(80, 85, 250, 0.1);
  color: #5055fa;
  text-decoration: none;
  font-weight: 680;
}

body.landing.dream-landing .panel-link-list,
body.landing.dream-landing .mini-list {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

body.landing.dream-landing .panel-link-list span,
body.landing.dream-landing .mini-list span {
  display: flex;
  justify-content: space-between;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  background: #f0f1fb;
  color: #66718a;
  font-weight: 680;
}

body.landing.dream-landing .rhythm-tree-widget {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 10px 0 18px;
  padding: 14px;
  border: 1px solid rgba(22, 99, 79, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 26% 28%, rgba(22, 99, 79, 0.08), transparent 36%),
    rgba(247, 251, 248, 0.76);
}

body.landing.dream-landing .rhythm-tree {
  position: relative;
  width: 86px;
  height: 92px;
  border-radius: 999px 999px 16px 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.86), rgba(236,246,241,0.76));
}

body.landing.dream-landing .tree-trunk {
  position: absolute;
  left: 39px;
  bottom: 14px;
  width: 10px;
  height: 42px;
  border-radius: 999px;
  background: #8f6245;
}

body.landing.dream-landing .tree-leaf {
  position: absolute;
  display: block;
  border-radius: 999px 999px 999px 12px;
  background: #16634f;
  box-shadow: 0 8px 16px rgba(22, 99, 79, 0.16);
}

body.landing.dream-landing .leaf-1 {
  width: 38px;
  height: 30px;
  left: 17px;
  top: 26px;
  transform: rotate(-34deg);
}

body.landing.dream-landing .leaf-2 {
  width: 40px;
  height: 32px;
  right: 14px;
  top: 22px;
  background: #2a896d;
  transform: rotate(36deg) scaleX(-1);
}

body.landing.dream-landing .leaf-3 {
  width: 34px;
  height: 26px;
  left: 29px;
  top: 8px;
  background: #5abf91;
  transform: rotate(-5deg);
}

body.landing.dream-landing .leaf-4 {
  width: 32px;
  height: 24px;
  right: 18px;
  top: 48px;
  background: #8fd7ad;
  transform: rotate(28deg) scaleX(-1);
}

body.landing.dream-landing .rhythm-tree-copy strong {
  display: block;
  color: #16634f;
  font-size: 26px;
  line-height: 1;
}

body.landing.dream-landing .rhythm-tree-copy p {
  margin: 8px 0 0;
  font-size: 15px;
}

body.landing.dream-landing .rhythm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.landing.dream-landing .rhythm-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(22, 99, 79, 0.16);
  border-radius: 999px;
  background: rgba(22, 99, 79, 0.08);
  color: #16634f;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
}

body.landing.dream-landing .large-metric {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 30px 0 22px;
  color: #263149;
  font-size: clamp(34px, 3.4vw, 48px);
  font-weight: 800;
  letter-spacing: 0;
}

body.landing.dream-landing .large-metric span {
  color: #75809a;
  font-size: 19px;
  font-weight: 520;
}

body.landing.dream-landing .metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(135, 149, 173, 0.2);
}

body.landing.dream-landing .metric-row span {
  display: grid;
  gap: 8px;
  color: #75809a;
  font-size: 14px;
  font-weight: 650;
}

body.landing.dream-landing .metric-row strong {
  color: #263149;
  font-size: 20px;
}

body.landing.dream-landing .heatmap-preview {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 10px;
  margin: 24px 0 18px;
}

body.landing.dream-landing .heatmap-preview span {
  aspect-ratio: 1;
  border-radius: 5px;
  background: #e8edf4;
}

body.landing.dream-landing .heatmap-preview span:nth-child(3n) { background: #b9f2cf; }
body.landing.dream-landing .heatmap-preview span:nth-child(4n) { background: #54d98b; }
body.landing.dream-landing .heatmap-preview span:nth-child(7n) { background: #199956; }

body.landing.dream-landing .today-number {
  margin-top: 16px;
  color: #263149;
  font-size: 36px;
  font-weight: 820;
}

body.landing.dream-landing .line-chart-preview {
  position: relative;
  height: 64px;
  margin: 14px -22px -22px;
  background: linear-gradient(180deg, transparent 0%, rgba(150, 198, 255, 0.28) 100%);
}

body.landing.dream-landing .line-chart-preview span {
  position: absolute;
  inset: 18px 0 0;
  border-top: 4px solid #9ac9ff;
  border-radius: 60% 45% 0 0;
  transform: skewY(-6deg);
}

body.landing.dream-landing .goals-panel h3,
body.landing.dream-landing .reading-panel h3,
body.landing.dream-landing .bars-panel h3 {
  margin-bottom: 22px;
}

body.landing.dream-landing .goal-card {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(135, 149, 173, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

body.landing.dream-landing .goal-card strong,
body.landing.dream-landing .goal-card span {
  display: block;
}

body.landing.dream-landing .goal-card strong {
  margin-bottom: 10px;
  font-size: 18px;
}

body.landing.dream-landing .goal-card > span {
  margin-bottom: 10px;
  color: #7a849b;
}

body.landing.dream-landing .goal-card p {
  margin: 12px 0 0;
  font-size: 14px;
}

body.landing.dream-landing .reading-panel h3 {
  padding: 22px 22px 16px;
  border-bottom: 1px solid rgba(135, 149, 173, 0.2);
  font-size: 24px;
  letter-spacing: 0;
  text-transform: none;
}

body.landing.dream-landing .reading-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(135, 149, 173, 0.2);
}

body.landing.dream-landing .reading-item span {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(22, 99, 79, 0.24), rgba(169, 212, 255, 0.34)),
    url('/media/hero-classical-background.jpg') center / cover;
  filter: grayscale(100%);
}

body.landing.dream-landing .reading-item p {
  margin: 0;
  color: #263149;
  font-size: 17px;
  font-weight: 520;
}

body.landing.dream-landing .reading-panel > a {
  margin: 18px 22px 22px auto;
  width: fit-content;
  min-width: 132px;
  background: transparent;
  color: #6f7a94;
}

body.landing.dream-landing .bar-chart-preview {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 14px;
  height: 150px;
  padding: 16px 0 0;
  border-top: 1px solid rgba(135, 149, 173, 0.2);
}

body.landing.dream-landing .bar-chart-preview span {
  display: block;
  height: var(--h);
  min-height: 18px;
  border-radius: 6px 6px 0 0;
  background: #294ea5;
}

body.landing.dream-landing .time-visual {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 6px;
}

body.landing.dream-landing .clock-face {
  position: relative;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: #16634f;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.16), 0 12px 24px rgba(22, 99, 79, 0.16);
}

body.landing.dream-landing .clock-face span,
body.landing.dream-landing .clock-face i {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 4px;
  border-radius: 999px;
  background: #ffffff;
  transform-origin: center bottom;
}

body.landing.dream-landing .clock-face span {
  height: 24px;
  transform: translate(-50%, -100%) rotate(48deg);
}

body.landing.dream-landing .clock-face i {
  height: 18px;
  transform: translate(-50%, -100%) rotate(-34deg);
}

body.landing.dream-landing .time-visual strong {
  display: block;
  color: #263149;
  font-size: 34px;
  line-height: 1;
}

body.landing.dream-landing .time-visual p {
  margin: 8px 0 0;
  font-size: 15px;
}

body.landing.dream-landing .time-rings {
  display: none;
}

body.landing.dream-landing .time-rings span {
  display: block;
  width: var(--w);
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #16634f, #78d7c8);
}

/* ===== LANDING SECTION OVERRIDES ===== */
body.landing.dream-landing .growth-section {
  position: relative;
  overflow: hidden;
  padding: 98px 24px;
  background:
    linear-gradient(180deg, #f7fbf8 0%, #eef8f4 100%);
}

body.landing.dream-landing .growth-section::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(22, 99, 79, 0.1), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(169, 212, 255, 0.22), transparent 28%);
}

body.landing.dream-landing .growth-section .section-header,
body.landing.dream-landing .growth-chart-wrap {
  position: relative;
  z-index: 1;
}

body.landing.dream-landing .growth-section .section-header h2 {
  color: #173c35;
}

body.landing.dream-landing .growth-section .section-header p {
  color: rgba(23, 60, 53, 0.68);
}

body.landing.dream-landing .growth-chart-wrap {
  border: 1px solid rgba(22, 99, 79, 0.16);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 70px rgba(22, 99, 79, 0.12);
}

body.landing.dream-landing .growth-total {
  border-color: rgba(22, 99, 79, 0.14);
  background: rgba(247, 251, 248, 0.72);
}

body.landing.dream-landing .growth-total-num {
  color: #16634f;
}

body.landing.dream-landing .landing-pricing-header .pricing-free-word {
  color: #16634f;
}

body.landing.dream-landing .upgrade-card-featured,
body.landing.dream-landing .upgrade-card-featured:hover {
  box-shadow: 0 24px 62px rgba(99, 153, 196, 0.12);
}

body.landing.dream-landing .upgrade-card-btn-primary,
body.landing.dream-landing .upgrade-card-btn-primary:hover:not(:disabled) {
  background: #16634f;
  border-color: #16634f;
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(22, 99, 79, 0.16);
}

body.landing.dream-landing .upgrade-price-spacer,
body.landing.dream-landing .upgrade-price-uzs {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0;
}

body.landing.dream-landing .upgrade-price-uzs {
  color: #16634f;
}

body.landing.dream-landing .upgrade-card-features li.feature-unavailable {
  color: rgba(93, 105, 126, 0.6);
}

body.landing.dream-landing .upgrade-card-features li.feature-unavailable::before {
  content: '\00d7';
  color: #ffffff;
  background: #b7bfca;
}

body.landing.dream-landing .footer {
  position: relative;
  overflow: hidden;
  padding-top: 96px;
  background:
    linear-gradient(180deg, rgba(18, 25, 43, 0.97), rgba(13, 22, 32, 1));
}

body.landing.dream-landing .footer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(18, 25, 43, 0.95), rgba(18, 25, 43, 0.76), rgba(18, 25, 43, 0.95)),
    radial-gradient(circle at 20% 8%, rgba(169, 212, 255, 0.12), transparent 26%);
}

body.landing.dream-landing .footer::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  z-index: 0;
  height: min(58vw, 420px);
  pointer-events: none;
  opacity: 0.26;
  background: url('/media/footer-classical-lines.png') center bottom / cover no-repeat;
  mix-blend-mode: screen;
}

body.landing.dream-landing .footer-visual,
body.landing.dream-landing .footer-inner,
body.landing.dream-landing .footer-bottom {
  position: relative;
  z-index: 1;
}

body.landing.dream-landing .footer-visual {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(980px, calc(100% - 48px));
  margin: 0 auto 46px;
}

body.landing.dream-landing .footer-visual span {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #16634f, #a9d4ff);
  opacity: 0.86;
}

body.landing.dream-landing .footer-visual span:nth-child(2) { opacity: 0.54; }
body.landing.dream-landing .footer-visual span:nth-child(3) { opacity: 0.34; }
body.landing.dream-landing .footer-visual span:nth-child(4) { opacity: 0.72; }

body.landing.dream-landing .footer-inner {
  align-items: start;
}

body.landing.dream-landing .footer-brand {
  max-width: 520px;
}

body.landing.dream-landing .footer .brand-mark {
  width: 31px;
  height: 31px;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
}

body.landing.dream-landing .footer-brand p {
  max-width: 380px;
  margin-bottom: 24px;
  color: rgba(223, 231, 245, 0.72);
  font-size: 18px;
}

body.landing.dream-landing .footer-cta-button {
  width: fit-content;
  min-height: 34px;
  padding: 0.34rem 0.78rem;
  border-width: 2px;
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
}

body.landing.dream-landing .footer-cta-button .cta-shine-icon {
  width: 18px;
  height: 18px;
}

body.landing.dream-landing .footer-links {
  gap: 56px;
}

body.landing.dream-landing .footer-col h4 {
  color: #ffffff;
}

body.landing.dream-landing .footer-col a {
  color: rgba(223, 231, 245, 0.66);
}

body.landing.dream-landing .footer-col a:hover {
  color: #a9d4ff;
}

body.landing.dream-landing .footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  border-top-color: rgba(223, 231, 245, 0.12);
}

body.landing.dream-landing .footer-bottom p:last-child {
  margin-left: auto;
  text-align: right;
}

@media (max-width: 1100px) {
  body.landing.dream-landing .platform-dashboard-grid {
    grid-template-columns: 1fr;
    width: min(680px, 100%);
  }

  body.landing.dream-landing .dashboard-column {
    padding-top: 0;
  }
}

@media (max-width: 768px) {
  body.landing.dream-landing .platform-dashboard-section {
    padding: 48px 16px 180px;
    background-size: auto min(72vw, 340px);
  }

  body.landing.dream-landing .dashboard-panel {
    border-radius: 8px;
  }

  body.landing.dream-landing .streak-panel,
  body.landing.dream-landing .community-panel,
  body.landing.dream-landing .playlists-panel,
  body.landing.dream-landing .word-count-panel,
  body.landing.dream-landing .productivity-panel,
  body.landing.dream-landing .today-panel,
  body.landing.dream-landing .time-panel,
  body.landing.dream-landing .goals-panel,
  body.landing.dream-landing .bars-panel {
    min-height: 0;
    padding: 22px;
  }

  body.landing.dream-landing .reading-panel {
    min-height: 0;
  }

  body.landing.dream-landing .large-metric {
    display: grid;
    gap: 4px;
    margin: 30px 0 24px;
    font-size: 38px;
  }

  body.landing.dream-landing .metric-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body.landing.dream-landing .heatmap-preview {
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
  }

  body.landing.dream-landing .reading-item {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 16px 22px;
  }

  body.landing.dream-landing .reading-item span {
    width: 56px;
    height: 56px;
  }

  body.landing.dream-landing .reading-item p {
    font-size: 17px;
  }

  body.landing.dream-landing .time-visual {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  body.landing.dream-landing .clock-face {
    width: 62px;
    height: 62px;
  }

  body.landing.dream-landing .footer {
    padding-top: 72px;
  }

  body.landing.dream-landing .footer-visual {
    grid-template-columns: 1fr 0.7fr;
  }

  body.landing.dream-landing .footer-bottom {
    flex-direction: column;
    gap: 8px;
  }

  body.landing.dream-landing .footer-bottom p:last-child {
    margin-left: 0;
    text-align: left;
  }
}
