/* ═══════════════════════════════════════════════
   toomanyideas — Calm SaaS + Builder Dopamine
   Intentional · Minimal · Alive · Rewarding
   ═══════════════════════════════════════════════ */

/* ─── Design Tokens ────────────────────────────── */
:root {
  /* Surfaces */
  --bg: #fbfbfc;
  --card: #ffffff;
  --border: #e6e6ea;
  --border-hover: #d1d1d6;
  --border-focus: #9ca3af;

  /* Text */
  --text: #1c1c1e;
  --text-secondary: #666;
  --muted: #888;
  --text-faint: #b0b0b0;

  /* Accent — orange (builder energy) */
  --accent: #f97316;
  --accent-light: #fff7ed;
  --accent-border: #fdba74;
  --accent-hover: #ea580c;

  /* Semantic */
  --success: #16a34a;
  --success-light: #f0fdf4;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --info: #2563eb;
  --info-light: #eff6ff;
  --ai: #7c3aed;
  --ai-light: #f5f3ff;

  /* Shape */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --radius-modal: 14px;

  /* Shadows */
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-modal: 0 16px 48px rgba(0,0,0,0.12);

  /* Motion */
  --ease-pop: cubic-bezier(.2,.8,.2,1);
  --ease-out: ease-out;
  --dur-hover: 140ms;
  --dur-press: 100ms;
  --dur-enter: 200ms;

  /* Code blocks */
  --code-bg: #1c1c1e;
  --code-text: #e4e4e7;
  --inline-code-bg: #f3f3f6;
  --inline-code-text: #d6336c;
}

/* ─── Dark Mode Tokens ─────────────────────────── */
[data-theme="dark"] {
  /* Surfaces */
  --bg: #1a1a1f;
  --card: #232328;
  --border: #35353b;
  --border-hover: #48484f;
  --border-focus: #5a5a63;

  /* Text */
  --text: #e8e8ec;
  --text-secondary: #a0a0a8;
  --muted: #78787f;
  --text-faint: #55555c;

  /* Accent — orange (stays vibrant) */
  --accent: #f97316;
  --accent-light: #2c2318;
  --accent-border: #6b3a14;
  --accent-hover: #fb923c;

  /* Semantic */
  --success: #22c55e;
  --success-light: #162316;
  --danger: #f87171;
  --danger-light: #2c1616;
  --info: #60a5fa;
  --info-light: #161e2c;
  --ai: #a78bfa;
  --ai-light: #1e162c;

  /* Shadows */
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-card-hover: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-modal: 0 16px 48px rgba(0,0,0,0.4);

  /* Helpers */
  --sidebar-hover: #2c2c32;
  --code-bg: #2a2a30;
  --code-text: #e4e4e7;
  --inline-code-bg: #3a3a42;
  --inline-code-text: #f0abfc;
  --hover-overlay: rgba(255,255,255,0.04);

  color-scheme: dark;
}

/* ─── Dark Mode Component Overrides ────────────── */
[data-theme="dark"] body::before {
  opacity: 0.04;
}
[data-theme="dark"] .hero-pattern::before {
  background-image: linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px), linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  opacity: 1;
}
[data-theme="dark"] .video-placeholder {
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.06) 100%);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .video-placeholder::after {
  background-color: rgba(255,255,255,0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1' stroke='%23555'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z'/%3E%3C/svg%3E");
}
[data-theme="dark"] .progress-track,
[data-theme="dark"] .tm-progress-track {
  background: #2a2a30;
}
[data-theme="dark"] .np-toggle .np-mode-btn {
  color: var(--text-secondary);
}

/* ─── Dark Mode — Tailwind Utility Overrides ───── */
/* Backgrounds */
[data-theme="dark"] .bg-white { background-color: var(--card) !important; }
[data-theme="dark"] .bg-neutral-50 { background-color: #28282e !important; }
[data-theme="dark"] .bg-neutral-100 { background-color: #2a2a30 !important; }
[data-theme="dark"] .bg-neutral-200 { background-color: #35353b !important; }
[data-theme="dark"] .hover\:bg-neutral-50:hover { background-color: #2a2a30 !important; }
[data-theme="dark"] .hover\:bg-neutral-100:hover { background-color: #2a2a30 !important; }
[data-theme="dark"] .active\:bg-neutral-100:active { background-color: #35353b !important; }
[data-theme="dark"] .group:hover .group-hover\:border-neutral-300 { border-color: var(--border-hover) !important; }
[data-theme="dark"] .group:active .group-active\:border-neutral-400 { border-color: var(--border-focus) !important; }

/* Borders */
[data-theme="dark"] .border-neutral-200 { border-color: var(--border) !important; }
[data-theme="dark"] .border-neutral-300 { border-color: var(--border-hover) !important; }
[data-theme="dark"] .border-neutral-400 { border-color: var(--border-focus) !important; }
[data-theme="dark"] .border-neutral-700 { border-color: #3a3a40 !important; }
[data-theme="dark"] .focus\:border-neutral-400:focus { border-color: var(--border-focus) !important; }

/* Text — bump for readability on dark */
[data-theme="dark"] .text-neutral-300 { color: #78787f !important; }
[data-theme="dark"] .text-neutral-400 { color: #8a8a92 !important; }
[data-theme="dark"] .text-neutral-500 { color: #9a9aa2 !important; }
[data-theme="dark"] .text-neutral-600 { color: #b0b0b8 !important; }
[data-theme="dark"] .text-neutral-700 { color: #c8c8ce !important; }
[data-theme="dark"] .hover\:text-neutral-600:hover { color: #c0c0c6 !important; }
[data-theme="dark"] .hover\:text-neutral-700:hover { color: #d0d0d6 !important; }
[data-theme="dark"] .placeholder-neutral-300::placeholder { color: #55555c !important; }

/* Semantic: Red / Danger */
[data-theme="dark"] .bg-red-50 { background-color: #2c1616 !important; }
[data-theme="dark"] .border-red-200 { border-color: #7f1d1d !important; }
[data-theme="dark"] .text-red-500 { color: #f87171 !important; }
[data-theme="dark"] .text-red-600 { color: #f87171 !important; }
[data-theme="dark"] .text-red-700 { color: #fca5a5 !important; }
[data-theme="dark"] .hover\:bg-red-100:hover { background-color: #3c1616 !important; }
[data-theme="dark"] .active\:bg-red-100:active { background-color: #3c1616 !important; }

/* Semantic: Emerald / Success */
[data-theme="dark"] .bg-emerald-50 { background-color: #162316 !important; }
[data-theme="dark"] .border-emerald-200 { border-color: #065f46 !important; }
[data-theme="dark"] .text-emerald-600 { color: #34d399 !important; }
[data-theme="dark"] .text-emerald-700 { color: #6ee7b7 !important; }

/* Semantic: Amber / Warning */
[data-theme="dark"] .bg-amber-50 { background-color: #2c2316 !important; }
[data-theme="dark"] .border-amber-200 { border-color: #92400e !important; }
[data-theme="dark"] .text-amber-600 { color: #fbbf24 !important; }
[data-theme="dark"] .text-amber-700 { color: #fcd34d !important; }

/* Semantic: Violet / AI */
[data-theme="dark"] .bg-violet-50 { background-color: #1e162c !important; }
[data-theme="dark"] .border-violet-200 { border-color: #5b21b6 !important; }
[data-theme="dark"] .text-violet-600 { color: #a78bfa !important; }

/* Semantic: Sky / Building */
[data-theme="dark"] .bg-sky-50 { background-color: #161e2c !important; }
[data-theme="dark"] .border-sky-200 { border-color: #075985 !important; }
[data-theme="dark"] .text-sky-600 { color: #38bdf8 !important; }

/* Semantic: Stone / Idea */
[data-theme="dark"] .bg-stone-100 { background-color: #2a2823 !important; }
[data-theme="dark"] .text-stone-500 { color: #a8a29e !important; }
[data-theme="dark"] .border-stone-300 { border-color: #57534e !important; }

/* Semantic: Orange */
[data-theme="dark"] .bg-orange-50 { background-color: #2c2318 !important; }
[data-theme="dark"] .border-orange-200 { border-color: #9a3412 !important; }
[data-theme="dark"] .hover\:bg-orange-50:hover { background-color: #2c2318 !important; }
[data-theme="dark"] .active\:bg-orange-50:active { background-color: #2c2318 !important; }

/* Ring colors */
[data-theme="dark"] .ring-faint { --tw-ring-color: var(--border) !important; }

/* ─── Public Header ────────────────────────────── */
html { scroll-behavior: smooth; }

.public-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.public-header.scrolled {
  background: rgba(251, 251, 252, 0.8);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 1px 0 var(--border);
}

[data-theme="dark"] .public-header.scrolled {
  background: rgba(26, 26, 31, 0.82);
}

.public-nav-link {
  color: var(--muted);
  transition: color 0.15s ease;
}
.public-nav-link:hover {
  color: var(--text);
}

.public-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.public-cta-btn:hover {
  background: var(--accent-hover);
}

.public-mobile-menu {
  background: var(--card);
  border-top: 1px solid var(--border);
}
.public-header.scrolled .public-mobile-menu {
  border-top-color: var(--border);
}

/* ─── Base ─────────────────────────────────────── */
body {
  background-color: var(--bg);
  color: var(--text);
}

/* Subtle noise texture for depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

/* ─── Hero Pattern ─────────────────────────────── */
.hero-pattern {
  position: relative;
  background-color: var(--bg);
}
.hero-pattern::before {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, #0000000a 1px, #0000 1px), linear-gradient(#0000000a 1px, #0000 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(100% 100% at 50% 50%, #000 40%, #0000 80%);
  mask-image: radial-gradient(100% 100% at 50% 50%, #000 40%, #0000 80%);
}

/* ─── Landing Page — Element Polish ────────────── */

/* Hero word flip */
.hero-word-wrap {
  display: inline-flex;
  position: relative;
  overflow: hidden;
  vertical-align: baseline;
  align-items: baseline;
  transition: width 0.3s var(--ease-pop);
}
.hero-word {
  display: inline-block;
  white-space: nowrap;
  transition: transform 0.2s var(--ease-pop), opacity 0.2s;
}
.hero-headline {
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero-subcopy {
  color: var(--text-secondary);
  line-height: 1.75;
  text-wrap: pretty;
}
.hero-word--out {
  transform: translateY(-110%);
  opacity: 0;
}
.hero-word--in {
  animation: heroWordIn 0.25s var(--ease-pop);
}
@keyframes heroWordIn {
  from { transform: translateY(60%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* Demo video placeholder slots */
.demo-video-slot {
  position: relative;
  background: linear-gradient(135deg, var(--bg) 0%, var(--border) 100%);
  transition: background 0.3s;
}
.demo-video-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video placeholder containers */
.video-placeholder {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.05) 100%);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-placeholder::after {
  content: '';
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1' stroke='%23ccc'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px;
}
.video-placeholder--dark {
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.06) 100%);
  border-color: rgba(255,255,255,0.1);
}
.video-placeholder--dark::after {
  background-color: rgba(255,255,255,0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1' stroke='%23555'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z'/%3E%3C/svg%3E");
}

/* ─── Demo Tabs ────────────────────────────────── */
.demo-tab {
  color: rgba(255,255,255,0.4);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
}
.demo-tab:hover {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.15);
}
.demo-tab--active {
  color: #ffffff;
  background: rgba(249,115,22,0.15);
  border-color: rgba(249,115,22,0.4);
}
.demo-tab--active:hover {
  color: #ffffff;
  border-color: rgba(249,115,22,0.5);
}
.demo-panel {
  display: none;
  animation: demoPanelIn 0.3s ease both;
}
.demo-panel--active {
  display: block;
}
@keyframes demoPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Bridge Video (straddles hero ↔ section 2) ──── */
.bridge-video-wrap {
  position: relative;
  z-index: 10;
  margin-top: -15.75rem;
  margin-bottom: -15.75rem;
  padding: 0 1rem;
  pointer-events: none;
}

.bridge-video-inner {
  max-width: 56rem;
  margin: 0 auto;
  position: relative;
  pointer-events: auto;
}
.bridge-callout {
  position: absolute;
  left: -2rem;
  top: -1.5rem;
  transform: translateX(-100%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}
.bridge-callout-text {
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  line-height: 1.2;
}
.bridge-callout-arrow {
  color: var(--text-muted, #64748b);
  width: 60px;
  height: 68px;
  margin-top: -4px;
  margin-right: -0.75rem;
  transform: rotate(-25deg);
}
.bridge-video-frame {
  background: var(--card);
  border-radius: 12px;
  padding: 6px;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.08),
    0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid var(--border, #e5e7eb);
}
.bridge-video-frame .video-placeholder {
  border-radius: 8px;
  border-style: dashed;
}

/* Hide callout on small screens — not enough room */
@media (max-width: 1023px) {
  .bridge-callout {
    display: none;
  }
}
/* Adjust spacing on mobile */
@media (max-width: 639px) {
  .bridge-video-wrap {
    margin-top: -8rem;
    margin-bottom: -8rem;
    padding: 0 0.75rem;
  }
}

/* Feature cards: tilt + glow on hover */
.landing-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.19,1,0.22,1), box-shadow 0.4s cubic-bezier(0.19,1,0.22,1), border-color 0.3s;
}
.landing-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 1;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(249,115,22,0.08) 0%, transparent 70%);
  transition: opacity 0.4s;
  pointer-events: none;
}
.landing-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06), 0 0 0 1px rgba(249,115,22,0.1);
}
.landing-card:hover::before {
  opacity: 1;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(249,115,22,0.14) 0%, transparent 70%);
}
[data-theme="dark"] .landing-card:hover {
  box-shadow: 0 8px 30px rgba(249,115,22,0.06), 0 0 0 1px rgba(249,115,22,0.15);
}

.landing-card-with-video {
  display: flex;
  flex-direction: column;
  padding-bottom: 0 !important;
}

.landing-card-with-video .feature-video-slot {
  margin-top: auto !important;
  padding-top: 1rem;
}

.feature-video-slot {
  width: calc(100% + 3rem);
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  margin-bottom: 0;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .feature-video-slot {
    width: calc(100% + 3.5rem);
    margin-left: -1.75rem;
    margin-right: -1.75rem;
    margin-bottom: 0;
  }
}

.feature-video-media {
  display: block;
  width: 100%;
  aspect-ratio: 968 / 720;
  border-radius: 0;
  border: 0;
  background: var(--bg-soft);
  object-fit: cover;
}

.feature-video-placeholder {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 3%, var(--bg-soft)) 0%, var(--bg-soft) 100%);
}

[data-theme="dark"] .feature-video-placeholder {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg-soft)) 0%, var(--bg-soft) 100%);
}

/* Feature icons: real mini DOM components */
.feature-dom {
  width: 1.25rem;
  height: 1.25rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-task-check {
  width: 16px;
  height: 16px;
  border-color: var(--border-hover);
  box-shadow: none;
  pointer-events: none;
  animation: featureTaskRingLoop 2.6s ease-in-out infinite;
}
.feature-task-check .check-svg path {
  stroke-dasharray: 18;
  stroke-dashoffset: 18;
  animation: featureTaskMarkLoop 2.6s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}
@keyframes featureTaskRingLoop {
  0%, 12%, 100% {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 0 rgba(249,115,22,0);
    transform: scale(1);
  }
  30%, 62% {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.14);
    transform: scale(1.03);
  }
  78% {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 0 rgba(249,115,22,0);
    transform: scale(0.96);
  }
}
@keyframes featureTaskMarkLoop {
  0%, 12%, 100% { stroke-dashoffset: 18; opacity: 0; }
  34%, 60% { stroke-dashoffset: 0; opacity: 1; }
  80% { stroke-dashoffset: 18; opacity: 0; }
}

.feature-icon-pitch .fi-pulse-dot {
  fill: currentColor;
  transform-origin: 20.6px 8.8px;
  animation: featurePulse 1.8s ease-in-out infinite;
}
@keyframes featurePulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  45% { opacity: 0.95; transform: scale(1.08); }
}

.feature-icon-spec .fi-gear {
  transform-origin: 12px 12px;
  animation: featureGearSpin 6s linear infinite;
}
.feature-icon-spec .fi-core {
  animation: featureCorePulse 1.8s ease-in-out infinite;
}
@keyframes featureGearSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes featureCorePulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.feature-icon-style .fi-style-diamond {
  animation: featureDiamondBreathe 2.6s ease-in-out infinite;
}
.feature-icon-style .fi-style-spark {
  animation: featureSparkBlink 1.6s ease-in-out infinite;
}
@keyframes featureDiamondBreathe {
  0%, 100% { transform: scale(0.96); opacity: 0.7; }
  50% { transform: scale(1.04); opacity: 1; }
}
@keyframes featureSparkBlink {
  0%, 100% { opacity: 0.35; }
  40%, 60% { opacity: 1; }
}

.feature-icon-notepad .fi-note-line {
  stroke-dasharray: 14;
  stroke-dashoffset: 14;
  animation: featureWriteLine 2.2s ease-in-out infinite;
}
.feature-icon-notepad .fi-note-line--2 {
  animation-delay: 0.25s;
}
@keyframes featureWriteLine {
  0%, 18%, 100% { stroke-dashoffset: 14; opacity: 0.35; }
  48%, 70% { stroke-dashoffset: 0; opacity: 1; }
}

.feature-icon-progress .fi-bar {
  fill: currentColor;
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: featureBarsLift 1.9s ease-in-out infinite;
}
.feature-icon-progress .fi-bar-2 {
  animation-delay: 0.15s;
}
.feature-icon-progress .fi-bar-3 {
  animation-delay: 0.3s;
}
@keyframes featureBarsLift {
  0%, 100% { opacity: 0.55; transform: scaleY(0.72); }
  45% { opacity: 1; transform: scaleY(1); }
}

/* Step circles: idle pulse ring + hover scale */
.step-circle {
  position: relative;
  transition: transform 0.35s cubic-bezier(0.19,1,0.22,1), box-shadow 0.35s;
}
.step-circle::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: stepRingPulse 2.5s ease-in-out infinite;
}
.step-circle:hover {
  transform: scale(1.18);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
[data-theme="dark"] .step-circle:hover {
  box-shadow: 0 4px 16px rgba(249,115,22,0.1);
}
@keyframes stepRingPulse {
  0%, 100% { transform: scale(1); opacity: 0; }
  50%      { transform: scale(1.25); opacity: 0.25; }
}

/* Section labels: line grows from center on reveal */
.section-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  letter-spacing: 0.11em;
}
.section-label::after {
  content: '';
  display: block;
  width: 0;
  height: 1px;
  background: var(--border);
  transition: width 0.6s cubic-bezier(0.19,1,0.22,1);
}
.section-label.is-visible::after {
  width: 48px;
}

/* Problem list items: stagger slide-in from left */
.problem-item {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.19,1,0.22,1);
}
.problem-item.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Checklist feature rows: left border reveal on hover */
.feature-row {
  position: relative;
  border-left: 2px solid transparent;
  transition: border-color 0.3s, background 0.3s, transform 0.3s cubic-bezier(0.19,1,0.22,1);
  border-radius: 8px;
  padding-left: 0.25rem;
}
.feature-row:hover {
  border-left-color: var(--accent);
  background: rgba(249,115,22,0.03);
  transform: translateX(4px);
}
[data-theme="dark"] .feature-row:hover {
  background: rgba(249,115,22,0.06);
}

/* Pricing card: selected glow ring */
.pricing-card {
  transition: transform 0.4s cubic-bezier(0.19,1,0.22,1), box-shadow 0.4s;
}
.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
[data-theme="dark"] .pricing-card:hover {
  box-shadow: 0 12px 40px rgba(249,115,22,0.08);
}
.pricing-popular {
  position: relative;
}
.pricing-popular::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid var(--accent);
  opacity: 0.4;
  animation: pricingGlow 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pricingGlow {
  0%, 100% { opacity: 0.2; box-shadow: 0 0 0 0 rgba(249,115,22,0); }
  50%      { opacity: 0.5; box-shadow: 0 0 20px rgba(249,115,22,0.1); }
}

/* Founder quote: subtle border-left shimmer */
.founder-quote {
  position: relative;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}
.founder-quote::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  background-size: 100% 200%;
  animation: quoteShimmer 3s ease-in-out infinite;
  border-radius: 1px;
}
@keyframes quoteShimmer {
  0%   { background-position: 0 -100%; opacity: 0; }
  50%  { background-position: 0 100%; opacity: 1; }
  100% { background-position: 0 300%; opacity: 0; }
}

/* Login btn: border-fill from center */
.btn-secondary-landing {
  position: relative;
  overflow: hidden;
}
.btn-secondary-landing::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  z-index: -1;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.btn-secondary-landing:hover::before {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.btn-secondary-landing:hover {
  color: var(--accent);
}

/* Final CTA tagline: typewriter underline */
.cta-tagline {
  position: relative;
  display: inline-block;
}
.cta-tagline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.19,1,0.22,1);
}
.cta-tagline.is-visible::after {
  width: 100%;
}

/* Founder image: hover ring expand */
.founder-img {
  transition: transform 0.35s cubic-bezier(0.19,1,0.22,1), box-shadow 0.35s;
}
.founder-img:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.2), 0 4px 12px rgba(0,0,0,0.1);
}
[data-theme="dark"] .founder-img:hover {
  box-shadow: 0 0 0 3px rgba(249,115,22,0.25), 0 4px 12px rgba(0,0,0,0.3);
}

#features,
#how-it-works,
#pricing {
  scroll-margin-top: 88px;
}

.feature-chat-bubble {
  width: 1.05rem;
  height: 0.78rem;
  border: 1.4px solid currentColor;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
}
.feature-chat-bubble::after {
  content: '';
  position: absolute;
  left: 2px;
  bottom: -4px;
  width: 6px;
  height: 6px;
  border-left: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  border-bottom-left-radius: 4px;
  transform: skewX(-18deg);
}
.feature-chat-dot {
  width: 2.5px;
  height: 2.5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.28;
  animation: featureChatDots 1.6s ease-in-out infinite;
}
.feature-chat-dot:nth-child(2) {
  animation-delay: 0.12s;
}
.feature-chat-dot:nth-child(3) {
  animation-delay: 0.24s;
}
@keyframes featureChatDots {
  0%, 100% { opacity: 0.28; transform: translateY(0); }
  45% { opacity: 1; transform: translateY(-1px); }
}

.feature-dom-spec {
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
}
.feature-spec-row {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
  animation: featureSpecSweep 2.1s ease-in-out infinite;
}
.feature-spec-row-title {
  width: 16px;
  opacity: 0.75;
}
.feature-spec-row-short {
  width: 10px;
  animation-delay: 0.15s;
}
@keyframes featureSpecSweep {
  0%, 100% { opacity: 0.3; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(1px); }
}

.feature-dom-style {
  gap: 2px;
}
.feature-style-swatch {
  width: 5px;
  height: 14px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.4;
  transform-origin: center bottom;
  animation: featureStyleShift 2.2s ease-in-out infinite;
}
.feature-style-swatch-2 {
  opacity: 0.7;
  animation-delay: 0.12s;
}
.feature-style-swatch-3 {
  opacity: 0.95;
  animation-delay: 0.24s;
}
@keyframes featureStyleShift {
  0%, 100% { transform: scaleY(0.76); }
  45% { transform: scaleY(1); }
}

.feature-dom-note {
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
}
.feature-note-line {
  width: 14px;
  height: 1.8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.3;
  transform-origin: left center;
  transform: scaleX(0.15);
  animation: featureNoteWrite 2.3s ease-in-out infinite;
}
.feature-note-line-head {
  width: 16px;
  opacity: 0.75;
}
.feature-note-line-short {
  width: 10px;
  animation-delay: 0.2s;
}
@keyframes featureNoteWrite {
  0%, 16%, 100% { transform: scaleX(0.15); opacity: 0.25; }
  50%, 70% { transform: scaleX(1); opacity: 1; }
}

.feature-dom-progress {
  flex-direction: column;
  gap: 2px;
}
.feature-mini-progress-track {
  width: 16px;
  height: 2.5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0,0,0,0.08);
}
.feature-mini-progress-fill {
  width: 72%;
  height: 100%;
  animation: featureProgressFill 2.4s ease-in-out infinite;
}
.feature-mini-progress-label {
  font-size: 7px;
  line-height: 1;
  font-weight: 700;
  color: currentColor;
  opacity: 0.78;
  letter-spacing: 0.01em;
  animation: featureProgressLabel 2.4s ease-in-out infinite;
}
@keyframes featureProgressFill {
  0%, 100% { width: 42%; }
  50% { width: 86%; }
}
@keyframes featureProgressLabel {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

[data-theme="dark"] .feature-mini-progress-track {
  background: rgba(255,255,255,0.12);
}

@media (prefers-reduced-motion: reduce) {
  .feature-task-check,
  .feature-task-check .check-svg path,
  .feature-chat-dot,
  .feature-spec-row,
  .feature-style-swatch,
  .feature-note-line,
  .feature-mini-progress-fill,
  .feature-mini-progress-label {
    animation: none !important;
  }
}

/* ─── Restored Core App Shell ─────────────────────── */
.app-sidebar {
  background: var(--card);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--dur-hover) var(--ease-out);
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--sidebar-hover, #f5f5f5);
  color: var(--text);
}

.sidebar-link-active {
  background: var(--accent);
  color: #ffffff;
}

.sidebar-link-active:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.sidebar-link svg {
  flex-shrink: 0;
}

.wire-card, .tm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover) var(--ease-out);
}

.wire-card:hover, .tm-card:hover {
  border-color: var(--border-hover);
}

.progress-track, .tm-progress-track {
  height: 4px;
  background: #ebebeb;
  border: none;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-track-lg {
  height: 6px;
}

.progress-fill, .tm-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s var(--ease-pop);
  min-width: 0;
  position: relative;
  background: var(--accent) !important;
}

/* ─── Buttons ──────────────────────────────────── */
.btn, .tm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--dur-hover) var(--ease-out),
              color var(--dur-hover) var(--ease-out),
              box-shadow var(--dur-hover) var(--ease-out),
              transform var(--dur-hover) var(--ease-out);
  text-decoration: none;
}

.btn:hover, .tm-btn:hover {
  border-color: var(--border-focus);
  color: var(--text);
}

.btn:active, .tm-btn:active {
  transform: scale(0.97);
  transition-duration: var(--dur-press);
}

.btn-primary, .tm-btn-primary {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s,
    box-shadow 0.4s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Orange-text base is always visible — never changes color */

/* Overlay: orange bg + white text, revealed by clip-path */
.btn-primary .btn-fill, .tm-btn-primary .btn-fill {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: inherit;
  background-color: var(--accent);
  color: #ffffff;
  border-radius: inherit;
  clip-path: inset(0 100% 0 0);
  pointer-events: none;
  overflow: hidden;
}

/* Shine inside the fill overlay */
.btn-primary .btn-fill::after, .tm-btn-primary .btn-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background-image: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255,255,255,0) 40%,
    rgba(255,255,255,0.35) 50%,
    rgba(255,255,255,0) 60%,
    transparent 80%
  );
  transform: skewX(-20deg);
  opacity: 0;
}

.btn-primary:hover, .tm-btn-primary:hover {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent),
    0 4px 20px color-mix(in srgb, var(--accent) 25%, transparent),
    0 0 40px color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateY(-1px);
}

.btn-primary:hover .btn-fill::after, .tm-btn-primary:hover .btn-fill::after {
  opacity: 1;
  animation: btnShine 0.8s 0.15s ease-out forwards;
}

.btn-primary:active, .tm-btn-primary:active {
  border-color: var(--accent-hover);
  transform: scale(0.97) translateY(0);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent),
    0 1px 4px color-mix(in srgb, var(--accent) 15%, transparent);
  transition-duration: var(--dur-press);
}

.btn-primary:active .btn-fill, .tm-btn-primary:active .btn-fill {
  background-color: var(--accent-hover);
}

@keyframes btnShine {
  0%   { left: -75%; }
  100% { left: 125%; }
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.btn-danger, .tm-btn-danger {
  border-color: #fca5a5;
  color: var(--danger);
}

.btn-danger:hover, .tm-btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

/* ─── Social Login Buttons ─────────────────────────── */
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: all var(--dur-hover) var(--ease-out);
  cursor: pointer;
}
.social-btn:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
}
.social-btn:active {
  transform: scale(0.98);
}
.social-btn-google:hover {
  border-color: #4285F4;
  background: #f8faff;
}
.social-btn-github:hover {
  border-color: #333;
  background: #f6f6f6;
}
[data-theme="dark"] .social-btn-google:hover {
  border-color: #4285F4;
  background: #1e2a3a;
}
[data-theme="dark"] .social-btn-github:hover {
  border-color: #888;
  background: #2a2a30;
}

/* ─── Stage-aware Accent Override ──────────────────── */
#project-page[data-status="Idea"] {
  --accent: #78716c;
  --accent-light: #f5f5f4;
  --accent-hover: #57534e;
  --accent-border: #a8a29e;
}
#project-page[data-status="Building"] {
  --accent: #0284c7;
  --accent-light: #f0f9ff;
  --accent-hover: #0369a1;
  --accent-border: #7dd3fc;
}
#project-page[data-status="Releasing"] {
  --accent: #059669;
  --accent-light: #ecfdf5;
  --accent-hover: #047857;
  --accent-border: #6ee7b7;
}
#project-page[data-status="Scaling"] {
  --accent: #7c3aed;
  --accent-light: #f5f3ff;
  --accent-hover: #6d28d9;
  --accent-border: #c4b5fd;
}
#project-page[data-status="Paused"] {
  --accent: #d97706;
  --accent-light: #fffbeb;
  --accent-hover: #b45309;
  --accent-border: #fcd34d;
}

/* ─── Status Tabs ──────────────────────────────────── */
.status-tab {
  cursor: pointer;
  position: relative;
  z-index: 1;
  color: #a3a3a3;
  background: transparent;
  transition: color 0.2s ease;
}
.status-tab:not(.status-tab-active):hover {
  color: #737373;
}

/* The sliding pill that moves behind tabs */
.status-pill {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  border-radius: 0;
  pointer-events: none;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.4s ease,
              border-radius 0.4s ease;
}

.status-tab-active {
  color: #ffffff !important;
  background: transparent !important;
}

/* Marching chevrons hint — 3 arrows ripple-march right */
@keyframes marchChevron {
  0%   { opacity: 0; transform: translateX(-2px); }
  15%  { opacity: 0.9; transform: translateX(0); }
  60%  { opacity: 0.5; transform: translateX(3px); }
  100% { opacity: 0; transform: translateX(6px); }
}
.status-tab-active:not([data-status="Paused"]) .stage-arrows {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 3px;
  pointer-events: none;
}
.stage-arrows {
  display: none;
}
.stage-arrows .chevron {
  font-size: 10px;
  line-height: 1;
  color: rgba(255,255,255,0.8);
  animation: marchChevron 1.8s ease-in-out infinite;
  opacity: 0;
}
.stage-arrows .chevron:nth-child(2) {
  animation-delay: 0.25s;
}
.stage-arrows .chevron:nth-child(3) {
  animation-delay: 0.5s;
}

/* ─── Inputs ───────────────────────────────────── */
.input, .tm-input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover) var(--ease-out);
}

.input::placeholder, .tm-input::placeholder {
  color: var(--text-faint);
}

.input:focus, .tm-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

/* ─── Select ───────────────────────────────────── */
.select {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 2rem 0.375rem 0.625rem;
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--dur-hover) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23999' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
}

.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

/* ─── Status Pills / Badges ────────────────────── */
.pill, .tm-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  border: 1px solid;
  transition: all var(--dur-hover) var(--ease-out);
}

/* Shipped badge */
.tm-badge-shipped {
  background: var(--success-light);
  color: var(--success);
  border-color: #bbf7d0;
}

/* ─── Callout ──────────────────────────────────── */
.tm-callout {
  border: 1px solid;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}
.tm-callout-info {
  border-color: #bfdbfe;
  background: var(--info-light);
  color: var(--info);
}
.tm-callout-warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #d97706;
}
.tm-callout-success {
  border-color: #bbf7d0;
  background: var(--success-light);
  color: var(--success);
}
.tm-callout-danger {
  border-color: #fca5a5;
  background: var(--danger-light);
  color: var(--danger);
}

/* ─── Animations ───────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes popIn {
  0%   { transform: scale(0.95); opacity: 0; }
  60%  { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes checkPop {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.45); }
  40%  { transform: scale(0.85); }
  60%  { transform: scale(1.15); }
  80%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

@keyframes glowFade {
  0%   { box-shadow: 0 0 0 6px rgba(249,115,22,0.35); }
  100% { box-shadow: 0 0 0 8px rgba(249,115,22,0); }
}

@keyframes rowHighlight {
  0%   { background-color: rgba(249,115,22,0.06); }
  100% { background-color: transparent; }
}

@keyframes microToastUp {
  0%   { opacity: 0; transform: translateY(4px); }
  20%  { opacity: 1; transform: translateY(0); }
  80%  { opacity: 1; transform: translateY(-2px); }
  100% { opacity: 0; transform: translateY(-6px); }
}

@keyframes shippedGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
  50%      { box-shadow: 0 0 12px 2px rgba(22,163,74,0.15); }
}

/* Progress bar shimmer */
@keyframes progressShimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Milestone progress glow */
@keyframes milestoneGlow {
  0%   { box-shadow: 0 0 0 0 rgba(249,115,22,0.35); }
  50%  { box-shadow: 0 0 10px 3px rgba(249,115,22,0.2); }
  100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); }
}

/* Tab crossfade */
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Empty state float */
@keyframes gentleFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* CTA attention pulse */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0); }
  50%      { box-shadow: 0 0 0 6px rgba(249,115,22,0.12); }
}

/* Confetti burst */
@keyframes confettiBurst {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-120px) rotate(360deg); opacity: 0; }
}

/* Tech button select pop */
@keyframes selectPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Scroll reveal */
@keyframes scrollRevealUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Inline save check */
@keyframes saveFlash {
  0%   { opacity: 0; transform: scale(0.8); }
  30%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes saveFade {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* Card entrance */
.wire-card, .tm-card {
  animation: fadeInUp var(--dur-enter) var(--ease-pop) forwards;
}

.project-list > .dash-project-row:nth-child(1) { animation: fadeInUp var(--dur-enter) var(--ease-pop) 0ms both; }
.project-list > .dash-project-row:nth-child(2) { animation: fadeInUp var(--dur-enter) var(--ease-pop) 40ms both; }
.project-list > .dash-project-row:nth-child(3) { animation: fadeInUp var(--dur-enter) var(--ease-pop) 80ms both; }
.project-list > .dash-project-row:nth-child(4) { animation: fadeInUp var(--dur-enter) var(--ease-pop) 120ms both; }
.project-list > .dash-project-row:nth-child(5) { animation: fadeInUp var(--dur-enter) var(--ease-pop) 160ms both; }
.project-list > .dash-project-row:nth-child(6) { animation: fadeInUp var(--dur-enter) var(--ease-pop) 200ms both; }
.project-list > .dash-project-row:nth-child(7) { animation: fadeInUp var(--dur-enter) var(--ease-pop) 240ms both; }
.project-list > .dash-project-row:nth-child(8) { animation: fadeInUp var(--dur-enter) var(--ease-pop) 280ms both; }
.project-list > .dash-project-row:nth-child(9) { animation: fadeInUp var(--dur-enter) var(--ease-pop) 320ms both; }
.project-list > .dash-project-row:nth-child(10) { animation: fadeInUp var(--dur-enter) var(--ease-pop) 360ms both; }

/* ─── Motion Utilities ─────────────────────────── */
.pressable {
  transition: transform var(--dur-press) var(--ease-pop);
}
.pressable:active {
  transform: scale(0.96);
}

.hoverLift {
  transition: transform var(--dur-hover) var(--ease-out), border-color var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover) var(--ease-out);
}
.hoverLift:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}

.fadeInUp {
  animation: fadeInUp var(--dur-enter) var(--ease-pop) both;
}

.pulseDot {
  animation: genPulse 1s ease infinite;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, color-mix(in srgb, var(--border) 72%, var(--card) 28%) 0%, color-mix(in srgb, var(--border) 84%, var(--card) 16%) 45%, color-mix(in srgb, var(--border) 72%, var(--card) 28%) 100%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.15s linear infinite;
}

.skeleton.round {
  border-radius: 999px;
}

.skeleton.soft {
  border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
  0% { background-position: 220% 0; }
  100% { background-position: -220% 0; }
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #303038 0%, #3a3a42 45%, #303038 100%);
  background-size: 220% 100%;
}

/* ─── Progress Bar Shimmer ─────────────────────── */
/* Shimmer disabled — flat design */
.progress-fill::after {
  display: none;
}

/* Milestone glow on progress track */
.progress-track.milestone-glow {
  animation: milestoneGlow 600ms var(--ease-pop) forwards;
}

/* ─── Tab Crossfade ────────────────────────────── */
.tab-panel:not(.hidden) {
  animation: tabFadeIn 180ms var(--ease-pop) both;
  min-height: 70vh;
}

/* ─── Empty State Float ────────────────────────── */
.empty-float {
  animation: gentleFloat 3s ease-in-out infinite;
}

/* ─── CTA Attention Pulse ──────────────────────── */
.cta-pulse {
  animation: ctaPulse 2s ease infinite 1s;
}

/* ─── Tech Button Select Pop ───────────────────── */
.onboarding-tech-btn.selected {
  animation: selectPop 200ms var(--ease-pop);
}

/* ─── Scroll Reveal ────────────────────────────── */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
}
.scroll-reveal.is-visible {
  animation: scrollRevealUp 0.5s var(--ease-pop) both;
}

/* ─── Inline Save Indicator ────────────────────── */
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--success);
  animation: saveFlash 250ms var(--ease-pop) forwards;
  pointer-events: none;
}
.save-indicator.fade-out {
  animation: saveFade 400ms ease forwards;
}

.field-save-pending {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: box-shadow 0.18s ease;
}

.field-save-error {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 48%, transparent);
  transition: box-shadow 0.18s ease;
}

.submit-progress {
  position: relative;
  overflow: hidden;
}

.submit-progress::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: var(--progress-pct, 0%);
  background: color-mix(in srgb, #ffffff 85%, var(--accent) 15%);
  transition: width 240ms var(--ease-pop);
  opacity: 0.9;
}

/* ─── Confetti Particle ────────────────────────── */
.confetti-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiBurst 1.2s cubic-bezier(.2,.8,.2,1) forwards;
  pointer-events: none;
}

/* ─── Task Check Animation ─────────────────────── */
.task-check-pop {
  animation: checkPop 400ms var(--ease-pop);
}
.task-check-glow {
  animation: glowFade 500ms var(--ease-out) forwards;
}
.task-row-highlight {
  animation: rowHighlight 500ms var(--ease-out) forwards;
}

/* ─── Micro Toast ──────────────────────────────── */
.micro-toast {
  position: absolute;
  pointer-events: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  animation: microToastUp 800ms var(--ease-pop) forwards;
  z-index: 10;
}

/* ─── Shipped Banner ───────────────────────────── */
.shipped-banner {
  background: var(--success-light);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeInUp 180ms var(--ease-pop) both;
}
.shipped-banner-text {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--success);
}
.shipped-banner-sub {
  font-size: 0.75rem;
  color: #4ade80;
  margin-left: 0.25rem;
}

/* Task rows */
.task-row {
  transition: background-color 0.15s var(--ease-out);
  border-radius: var(--radius-sm);
}

/* Smooth reorder animation when siblings shift during drag — handled via FLIP in JS */
.task-row-wrapper.is-dragging {
  transition: none;
}

/* Animated strikethrough */
.task-text {
  position: relative;
  text-decoration: none !important;
}
.task-text::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 1.5px;
  background: currentColor;
  opacity: 0.45;
  transition: width 0.3s var(--ease-pop);
  pointer-events: none;
}
.task-text.task-struck::after {
  width: 100%;
}

/* Task completion celebration */
.task-celebrate-particle {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: taskParticleBurst 0.7s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes taskParticleBurst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1.2);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--px), var(--py)) scale(0);
  }
}

.task-row:hover {
  background-color: var(--sidebar-hover, #fafafa);
}

.task-row button {
  transition: all var(--dur-hover) var(--ease-out);
}

.task-row button:active {
  transform: scale(0.9);
}

/* ─── Divider ──────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
}

/* ─── Scrollbar ────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

/* ─── Task Notes ───────────────────────────────── */
.task-notes-inline {
  line-height: 1.4;
  font-family: inherit;
}
.task-notes-inline:focus::placeholder {
  color: #bbb;
}

/* Inline note textarea below task title */
.task-note-input {
  line-height: 1.4;
  font-family: inherit;
  font-size: 11px;
  outline: none;
}
.task-note-input::placeholder {
  transition: opacity 0.15s ease;
}

/* ─── Task Title Input ─────────────────────────────── */
.task-title-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  line-height: 1.35;
  width: 100%;
  padding: 0;
  margin: 0;
  font-size: 13px;
  resize: none;
  overflow: hidden;
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}
.task-title-input:focus {
  outline: none;
}

/* ─── Task inputs mobile sizing ────────────────────── */
@media (max-width: 639px) {
  .task-title-input {
    font-size: 14px;
    /* 16px triggers iOS zoom, 14px is a good compromise */
  }
  .task-note-input {
    font-size: 12px;
  }
  #task-input {
    font-size: 16px;  /* prevent iOS zoom on focus */
  }
}

/* ─── Status Tab Icons ─────────────────────────── */
.status-tab svg {
  flex-shrink: 0;
}

.status-tab-active svg {
  stroke: #ffffff !important;
}

/* ─── Sticky Project Header ───────────────────────── */
#header-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  overflow-anchor: none;
  pointer-events: none; /* clicks pass through the empty gap below the card */
}
.project-header {
  pointer-events: auto; /* card itself is interactive */
  will-change: transform;
  position: relative;
  overflow: hidden;
  transition: border-radius var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover) var(--ease-out), padding var(--dur-hover) var(--ease-out);
}

/* Status fill colors for project header waves */
.project-header[data-status="Idea"]      { --fill-rgb: 120, 113, 108; }
.project-header[data-status="Building"]  { --fill-rgb: 14, 165, 233; }
.project-header[data-status="Releasing"] { --fill-rgb: 16, 185, 129; }
.project-header[data-status="Scaling"]   { --fill-rgb: 139, 92, 246; }
.project-header[data-status="Paused"]    { --fill-rgb: 245, 158, 11; }

/* On mobile, project header sticks directly below the 56px mobile header */
@media (max-width: 767px) {
  #header-wrap {
    top: 56px;
  }
  .project-header {
    border-top: none;
  }
  /* Remove bottom-margin of back-to-dash link when hidden on mobile */
  #project-page > .mb-6:first-child {
    margin-bottom: 0;
  }
}

.project-header.emoji-picker-open {
  z-index: 55;
  overflow: visible;
}

.project-header-stuck {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-top-color: transparent;
  padding: 12px 24px !important;
}

/* Hide secondary elements when stuck */
.project-header-stuck .header-desc,
.project-header-stuck .header-hide-stuck {
  display: none !important;
}

/* Shrink emoji + title in stuck mode */
.project-header-stuck .header-emoji {
  font-size: 1.15rem;
}
.project-header-stuck .header-title {
  font-size: 0.875rem;
}

/* Compact progress in stuck mode */
.project-header-stuck .header-progress-full {
  display: none !important;
}
.project-header-stuck .header-progress-mini {
  display: flex !important;
}

/* Status tabs compact in stuck mode */
.project-header-stuck .status-tab {
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 10px;
}
.project-header-stuck .status-tab svg {
  width: 12px;
  height: 12px;
}

/* ─── Description Clamp ───────────────────────────── */
.desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Copy Button ─────────────────────────────────── */
.copy-btn {
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* ─── Content Tabs ────────────────────────────────── */
.content-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--dur-hover) var(--ease-out), border-color var(--dur-hover) var(--ease-out);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.content-tab:hover {
  color: var(--text-secondary);
}

.content-tab-active {
  color: var(--accent);
}

/* Sliding underline indicator for content tabs */
.content-slider {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 1;
}

.content-tab svg {
  flex-shrink: 0;
}

/* ─── Tab Editors ─────────────────────────────────── */
.tab-editor {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Courier New', monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  min-height: 300px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;
}

/* ─── Notepad Sub-Tabs ────────────────────────────── */
.notepad-tab-bar {
  min-height: 40px;
}
.notepad-tabs-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.notepad-tabs-scroll::-webkit-scrollbar {
  display: none;
}
.notepad-sub-tab {
  cursor: pointer;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  transition: all var(--dur-hover) var(--ease-out);
}
.notepad-sub-tab:hover {
  background: var(--hover-overlay);
  color: var(--text);
}
.notepad-sub-tab.notepad-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--hover-overlay);
  font-weight: 600;
}
.notepad-sub-tab.notepad-tab-active .notepad-tab-close {
  opacity: 0.5;
}
.notepad-sub-tab.notepad-tab-active .notepad-tab-close:hover {
  opacity: 1;
}
@keyframes notepadTabIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes notepadTabOut {
  from { opacity: 1; transform: translateY(0) scale(1); max-width: 200px; padding: 0.625rem 0.875rem; }
  to   { opacity: 0; transform: translateY(-4px) scale(0.9); max-width: 0; padding: 0.625rem 0; }
}
.notepad-tab-enter {
  animation: notepadTabIn 250ms var(--ease-out) forwards;
}
.notepad-tab-exit {
  animation: notepadTabOut 200ms var(--ease-out) forwards;
  overflow: hidden;
}

/* ─── Editor Mode Toggle ──────────────────────────── */
.editor-mode-btn {
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--dur-hover) var(--ease-out);
  border: none;
}
.editor-mode-btn:hover {
  color: var(--text);
  background: var(--sidebar-hover, #f5f5f5);
}
.editor-mode-btn.editor-mode-active {
  background: var(--accent);
  color: #fff;
}

/* ─── Task Drag Placeholder ───────────────────────── */
.task-drag-placeholder {
  background: var(--sidebar-hover, #f5f5f5);
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius);
  margin: 2px 0;
  transition: height 0.2s cubic-bezier(.2,.8,.2,1);
}

/* ─── Drag Handle ─────────────────────────────────── */
.drag-handle {
  touch-action: none;
  user-select: none;
}

/* ─── Long-press drag feedback on mobile ──────────── */
.task-row-wrapper.long-press-ready .task-row {
  background: var(--accent-light);
  box-shadow: 0 0 0 1px var(--accent-border);
}

/* Prevent body scroll during touch drag */
body.is-touch-dragging {
  overflow: hidden !important;
  touch-action: none;
}

/* ─── Markdown Preview ────────────────────────────── */
.markdown-preview {
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text);
  min-height: 300px;
}
.markdown-preview h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.markdown-preview h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}
.markdown-preview h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  color: var(--text);
}
.markdown-preview h4, .markdown-preview h5, .markdown-preview h6 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.75rem 0 0.375rem;
  color: var(--text);
}
.markdown-preview p {
  margin: 0.625rem 0;
}
.markdown-preview ul, .markdown-preview ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}
.markdown-preview ul { list-style: disc; }
.markdown-preview ol { list-style: decimal; }
.markdown-preview li {
  margin: 0.25rem 0;
}
.markdown-preview li > ul, .markdown-preview li > ol {
  margin: 0.125rem 0;
}
.markdown-preview code {
  background: var(--inline-code-bg, #f5f5f5);
  color: var(--inline-code-text, #d6336c);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.125rem 0.375rem;
  font-size: 0.8125rem;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
}
.markdown-preview pre {
  background: var(--code-bg, #1c1c1e);
  color: var(--code-text, #e4e4e7);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}
.markdown-preview pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 0.8125rem;
}
.markdown-preview blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  margin: 0.75rem 0;
  color: var(--text-secondary);
  font-style: italic;
}
.markdown-preview hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}
.markdown-preview a {
  color: #0284c7;
  text-decoration: underline;
}
.markdown-preview a:hover {
  color: #0369a1;
}
.markdown-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.8125rem;
}
.markdown-preview th, .markdown-preview td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.markdown-preview th {
  background: var(--sidebar-hover, #f9fafb);
  font-weight: 600;
}
.markdown-preview strong {
  font-weight: 600;
  color: var(--text);
}
.markdown-preview img {
  max-width: 100%;
  border-radius: 6px;
  margin: 0.75rem 0;
}

/* ─── HTML Preview Blocks (rendered code tabs) ─────── */
.html-preview-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 0.75rem 0;
}
.html-preview-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.html-preview-tab-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.html-preview-tab-btn:hover {
  color: var(--text);
}
.html-preview-tab-btn.active {
  background: var(--accent);
  color: #fff;
}
.html-preview-iframe {
  width: 100%;
  border: none;
  min-height: 120px;
  background: #fff;
  display: block;
}
.html-preview-code {
  display: none;
}
.html-preview-code pre {
  margin: 0;
  border-radius: 0;
}
.html-preview-code.active {
  display: block;
}
.html-preview-iframe-wrap {
  display: block;
}
.html-preview-iframe-wrap.hidden-panel {
  display: none;
}

[data-theme="dark"] .html-preview-tabs {
  background: var(--card);
}
/* Iframe always keeps white bg — component previews are designed for light mode */

/* ─── Skeleton Screens & Shimmer ───────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

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

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 12px;
  width: 60%;
  border-radius: 4px;
}

.skeleton-text-sm {
  height: 10px;
  width: 40%;
  border-radius: 3px;
}

.skeleton-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-bar {
  height: 6px;
  width: 100%;
  border-radius: var(--radius-sm);
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.skeleton-row + .skeleton-row {
  margin-top: 8px;
}

.skeleton-task-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 8px;
}

.skeleton-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Hide skeletons once real content loads */
[data-skeleton-for]:has(~ [data-skeleton-content]:not(:empty)) {
  display: none;
}

/* ─── Generation Progress ─────────────────────────── */
.gen-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-sm);
  background: var(--border);
  overflow: hidden;
  margin-top: 10px;
  margin-bottom: 6px;
}

.gen-progress-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #a78bfa, #7c3aed, #6d28d9);
  transition: width 0.8s cubic-bezier(.2,.8,.2,1);
  position: relative;
}

.gen-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

.gen-step {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-faint);
  transition: color 0.3s ease;
}

.gen-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s ease, transform 0.3s var(--ease-pop);
  font-size: 0;
}

.gen-step-done {
  color: #059669;
}
.gen-step-done .gen-dot {
  background: #059669;
  transform: scale(1);
  font-size: 10px;
  color: #fff;
}
.gen-step-done .gen-dot::after {
  content: '\2713';
}

.gen-step-active {
  color: var(--ai);
  font-weight: 600;
}
.gen-step-active .gen-dot {
  background: var(--ai);
  animation: genPulse 1.2s ease infinite;
}

.gen-step-pending {
  color: var(--text-faint);
}
.gen-step-pending .gen-dot {
  background: var(--border);
}

@keyframes genPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

/* ─── Onboarding Flow (Multi-Step) ─────────────────── */

.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: obFadeIn 0.25s ease;
}

@keyframes obFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ob-modal {
  background: var(--card);
  border-radius: var(--radius-modal);
  width: 92vw;
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  animation: obSlideUp 0.3s var(--ease-pop);
  overflow: hidden;
  position: relative;
}

@keyframes obSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Progress dots */
.ob-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 24px 0;
  flex-shrink: 0;
}
.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}
.ob-dot.active {
  background: var(--accent);
  transform: scale(1.25);
}
.ob-dot.done {
  background: var(--accent);
  opacity: 0.5;
}

/* Steps */
.ob-step {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.ob-step.active {
  display: flex;
  animation: obStepIn 0.3s ease;
}
@keyframes obStepIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.ob-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent-light) 72%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ob-step-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 30px 18px;
}
.ob-step-tech .ob-step-body,
.ob-step-body.ob-step-tech {
  /* noop — tech step gets its own internal scroll */
}

/* Icon at top of each step */
.ob-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-light);
  margin: 0 auto 18px;
  box-shadow: 0 14px 30px rgba(249, 115, 22, 0.12);
}
.ob-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.ob-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.ob-subtitle {
  font-size: 14px;
  text-align: center;
  color: var(--muted);
  margin: 0 auto 24px;
  line-height: 1.6;
  max-width: 420px;
}
.ob-subtitle-tight {
  margin-bottom: 18px;
}

/* Footer */
.ob-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ob-back-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
}
.ob-back-link:hover { color: var(--text); }
.ob-next-btn { min-width: 140px; text-align: center; }
.ob-next-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Step 1: Pain Chips ──────────────────────────── */
.ob-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.ob-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
  text-align: left;
  line-height: 1.4;
}
.ob-chip:hover {
  border-color: var(--border-hover);
  background: var(--sidebar-hover, #f9fafb);
}
.ob-chip.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-hover);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}
.ob-chip-count {
  font-size: 12px;
  color: var(--muted);
}

/* ─── Step 2: Empathy Text ────────────────────────── */
.ob-empathy-text {
  max-width: 440px;
  margin: 0 auto;
  min-height: 150px;
}
.ob-empathy-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  text-align: left;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-light) 40%, transparent), transparent 85%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.06);
}
.ob-empathy-content p {
  margin: 0 0 12px;
}
.ob-empathy-content p:last-child {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--accent);
}
.ob-empathy-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 260px;
  padding: 22px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-light) 24%, transparent), transparent 85%);
}
.ob-empathy-loading-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.ob-empathy-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}
.ob-typing-dots {
  display: flex;
  gap: 6px;
}
.ob-typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: obTypingBounce 1.4s infinite ease-in-out both;
}
.ob-typing-dots span:nth-child(1) { animation-delay: 0s; }
.ob-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ob-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes obTypingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── Step 3: Solution Cards ─────────────────────── */
.ob-solutions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ob-solution-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-light) 18%, transparent), transparent 80%), var(--bg);
  animation: obCardIn 0.4s ease both;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.04);
}
.ob-solution-card:nth-child(1) { animation-delay: 0s; }
.ob-solution-card:nth-child(2) { animation-delay: 0.08s; }
.ob-solution-card:nth-child(3) { animation-delay: 0.16s; }
.ob-solution-card:nth-child(4) { animation-delay: 0.24s; }
.ob-solution-card:nth-child(5) { animation-delay: 0.32s; }
.ob-solution-card:nth-child(6) { animation-delay: 0.40s; }
@keyframes obCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.ob-solution-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ob-solution-icon svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.ob-solution-pain {
  display: inline-flex;
  align-items: center;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.ob-solution-text h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.ob-solution-text p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* ─── Step 4: Tech Stack (reuses existing tech btn styles) ── */
.ob-tech-search {
  margin-bottom: 12px;
}
.ob-tech-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
  background: var(--bg);
  color: var(--text);
}
.ob-tech-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}
.ob-tech-body {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

/* ─── Step 5: Project Form ───────────────────────── */
.ob-project-form {
  max-width: 420px;
  margin: 0 auto;
}
.ob-project-form label {
  color: var(--text);
}
.ob-ship-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
}

/* ─── Mobile: Full-screen modal ──────────────────── */
@media (max-width: 639px) {
  .ob-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .ob-step-body {
    padding: 20px 20px 16px;
  }
  .ob-footer {
    padding: 14px 20px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .ob-title { font-size: 19px; }
  .ob-chip { padding: 10px 14px; font-size: 13px; }
  .ob-tech-body { max-height: none; flex: 1; }
}

/* ─── Onboarding Dark Mode ─────────────────────────── */
[data-theme="dark"] .ob-modal {
  background: #2c2c32;
  border: 1px solid #48484f;
}
[data-theme="dark"] .ob-footer {
  border-top-color: #3e3e45;
}
[data-theme="dark"] .ob-chip {
  background: #2a2a30;
  border-color: #42424a;
  color: #d4d4da;
}
[data-theme="dark"] .ob-chip:hover {
  background: #38383f;
  border-color: #58585f;
}
[data-theme="dark"] .ob-chip.selected {
  background: #3a2a1a;
  border-color: #f97316;
  color: #fb923c;
}
[data-theme="dark"] .ob-kicker {
  background: rgba(249, 115, 22, 0.14);
  color: #fb923c;
}
[data-theme="dark"] .ob-tech-search-input {
  background: #232328;
  border-color: #48484f;
  color: #e8e8ec;
}
[data-theme="dark"] .ob-tech-search-input:focus {
  border-color: #f97316;
}
[data-theme="dark"] .ob-solution-card {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.08), transparent 75%), #2a2a30;
  border-color: #42424a;
}
[data-theme="dark"] .ob-solution-icon {
  background: #3a2a1a;
}
[data-theme="dark"] .ob-icon-wrap {
  background: #3a2a1a;
}
[data-theme="dark"] .ob-empathy-content,
[data-theme="dark"] .ob-empathy-loading-card {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.08), rgba(58, 42, 26, 0.08));
  border-color: #42424a;
}

/* ─── Onboarding Paywall (on project page) ────────── */
.ob-paywall-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: obFadeIn 0.3s ease;
}
.ob-paywall-modal {
  background: var(--card);
  border-radius: var(--radius-modal);
  width: 92vw;
  max-width: 480px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: obSlideUp 0.35s var(--ease-pop);
  padding: 40px 32px 32px;
  text-align: center;
}
.ob-reveal-modal {
  max-width: 560px;
}
.ob-paywall-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}
.ob-paywall-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.ob-paywall-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 28px;
  line-height: 1.5;
}
.ob-reveal-preview {
  text-align: left;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-light) 36%, transparent), transparent 75%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin: 0 0 24px;
}
.ob-reveal-preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.ob-reveal-emoji {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}
.ob-reveal-project-label {
  margin: 0 0 2px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.ob-reveal-project-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.ob-reveal-highlights {
  display: grid;
  gap: 10px;
}
.ob-reveal-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
}
.ob-reveal-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  flex-shrink: 0;
}
.ob-reveal-item-copy strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.ob-reveal-item-copy span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.ob-paywall-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin: 0 0 4px;
}
.ob-paywall-amount {
  font-size: 40px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.ob-paywall-period {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
}
.ob-paywall-billing {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 24px;
}
.ob-paywall-features {
  list-style: none;
  padding: 0;
  margin: 0 auto 28px;
  max-width: 320px;
  text-align: left;
}
.ob-paywall-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  padding: 8px 0;
}
.ob-paywall-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  margin-bottom: 12px;
}
.ob-paywall-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.ob-paywall-cta:active {
  transform: translateY(0);
}
.ob-paywall-skip {
  display: inline-block;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.15s;
  opacity: 0.7;
}
.ob-paywall-skip:hover {
  color: var(--text);
  opacity: 1;
}
.ob-paywall-compare {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.ob-paywall-compare-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 12px;
}
.ob-paywall-compare-table {
  width: 100%;
  font-size: 13px;
  text-align: left;
}
.ob-paywall-compare-table th {
  font-weight: 600;
  padding: 6px 8px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.ob-paywall-compare-table td {
  padding: 6px 8px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.ob-paywall-compare-table td.highlight {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 639px) {
  .ob-paywall-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 20px;
  }
}

[data-theme="dark"] .ob-paywall-modal {
  background: #2c2c32;
  border: 1px solid #48484f;
}
[data-theme="dark"] .ob-paywall-badge {
  background: #3a2a1a;
}
[data-theme="dark"] .ob-reveal-preview {
  border-color: #42424a;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.14), rgba(58, 42, 26, 0.08));
}
[data-theme="dark"] .ob-reveal-emoji,
[data-theme="dark"] .ob-reveal-item {
  background: #2a2a30;
  border-color: #42424a;
}
[data-theme="dark"] .ob-reveal-item-icon {
  background: #3a2a1a;
  color: #fb923c;
}

/* ─── Onboarding Nav Lock (generation in progress) ─── */
body.ob-nav-lock .app-sidebar,
body.ob-nav-lock .mobile-header {
  filter: blur(4px) saturate(0.5);
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s ease;
}
body.ob-nav-lock #drawer-overlay {
  pointer-events: none;
}
body.ob-nav-lock .ob-exit-link {
  pointer-events: none !important;
  user-select: none;
}
body.ob-nav-lock #project-page .ob-exit-link {
  filter: blur(3px);
  opacity: 0.65;
}

/* ─── Onboarding Lockdown (blur sidebar/header until paywall dismissed) ─── */
body.ob-lockdown .app-sidebar,
body.ob-lockdown .mobile-header {
  filter: blur(4px) saturate(0.5);
  pointer-events: none;
  user-select: none;
  transition: filter 0.3s ease;
}
body.ob-lockdown #drawer-overlay {
  pointer-events: none;
}
body.ob-lockdown .ob-exit-link {
  pointer-events: none;
  user-select: none;
}
/* Also disable the "Back to dashboard" link inside the project page */
body.ob-lockdown #project-page .ob-exit-link {
  filter: blur(3px);
  opacity: 0.65;
}

/* ─── Keep existing tech btn styles (reused in both onboarding & tech-preferences) ─── */

.onboarding-category {
  margin-bottom: 20px;
}
.onboarding-category-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 10px;
}
.onboarding-tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.onboarding-tech-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text);
  white-space: nowrap;
}
.onboarding-tech-btn:hover {
  border-color: var(--border-hover);
  background: var(--sidebar-hover, #f9fafb);
}
.onboarding-tech-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-hover);
}
.onboarding-tech-btn.selected:hover {
  background: #fed7aa;
}
.onboarding-tech-btn.hidden-tech {
  display: none;
}
.onboarding-tech-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.onboarding-tech-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.onboarding-tech-name {
  font-size: 13px;
  font-weight: 500;
}
[data-theme="dark"] .onboarding-category-title {
  color: #a0a0a8;
}
[data-theme="dark"] .onboarding-tech-btn {
  background: #2a2a30;
  border-color: #42424a;
  color: #d4d4da;
}
[data-theme="dark"] .onboarding-tech-btn:hover {
  background: #38383f;
  border-color: #58585f;
}
[data-theme="dark"] .onboarding-tech-btn.selected {
  background: #3a2a1a;
  border-color: #f97316;
  color: #fb923c;
}
[data-theme="dark"] .onboarding-tech-btn.selected:hover {
  background: #4a3520;
}

/* ─── Tech Preferences Overview Chips ─────────────── */
.techpref-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.techpref-chip-saved {
  background: var(--success-light, #f0fdf4);
  color: var(--success, #16a34a);
  border: 1px solid rgba(22, 163, 74, 0.2);
}
.techpref-chip-new {
  background: var(--accent-light, #fff7ed);
  color: var(--accent, #f97316);
  border: 1px solid rgba(249, 115, 22, 0.25);
}
.techpref-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 1px;
  opacity: 0.5;
  color: inherit;
}
.techpref-chip-remove:hover {
  opacity: 1;
}

/* ─── Dashboard Stage Tabs ─────────────────────────── */

.dash-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--dur-hover) var(--ease-out);
  white-space: nowrap;
}
.dash-tab:hover {
  border-color: var(--border-hover);
  color: var(--text);
}
.dash-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.dash-tab.active svg {
  stroke: #fff;
}

/* ─── Shipping Loop Panel ─────────────────────────── */
#ship-loop-panel .input {
  min-height: 30px;
}

#ship-win-log p {
  margin: 0;
  line-height: 1.35;
}

#ship-control-card .input {
  font-size: 12px;
}

#ready-checklist {
  line-height: 1.35;
}

/* ─── Task Filter ──────────────────────────────────── */
.task-row-wrapper.task-filtered-out,
.task-row-wrapper.task-search-hidden {
  display: none;
}

/* ─── Dashboard Pagination ─────────────────────────── */

.dash-page-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--dur-hover) var(--ease-out);
}
.dash-page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.dash-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dash-project-row.dash-hidden {
  display: none !important;
}

/* ─── Dashboard Project Row Hover ──────────────────── */
.dash-project-row {
  transition: border-color var(--dur-hover) var(--ease-out), transform var(--dur-hover) var(--ease-out), box-shadow var(--dur-hover) var(--ease-out), opacity 0.2s ease;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  z-index: 0;
}
/* When preview is open, allow overflow for the panel height */
.dash-project-row.preview-open {
  overflow: visible;
}
/* Disable hover lift/scale when preview is expanded */
.dash-project-row.preview-open:hover {
  transform: none;
}
.dash-project-row.preview-open:active {
  transform: none;
}

/* ── Dashboard row inner layout ────────────────────────────── */

.dash-row-link {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

/* Emoji column — fixed width, vertically centered */
.dash-row-emoji {
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

/* Content column — title, progress, bottom all left-aligned */
.dash-row-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

/* Row 1: title + pct */
.dash-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.dash-row-title {
  flex: 1;
  min-width: 0;
}

/* Row 2: progress bar */
.dash-row-progress {
  display: flex;
  align-items: center;
  padding-right: 56px;
}

/* Row 3: stage + tasks + description inline */
.dash-row-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 56px;
  padding-bottom: 18px;
}

/* Privacy eye toggle — absolute top-right, left of delete */
.dash-row-privacy {
  position: absolute;
  top: 8px;
  right: 28px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.dash-row-privacy:hover {
  color: var(--text);
  background: var(--hover-overlay, rgba(0,0,0,0.04));
}
.dash-row-privacy:active {
  transform: scale(0.88);
}
.dash-row-privacy svg {
  width: 15px;
  height: 15px;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(.4,.0,.2,1);
}
/* Show/hide the two eye states */
.dash-row-privacy .privacy-eye-open   { display: block; }
.dash-row-privacy .privacy-eye-closed { display: none; position: absolute; }
.project-masked .dash-row-privacy .privacy-eye-open   { display: none; }
.project-masked .dash-row-privacy .privacy-eye-closed { display: block; position: static; }

/* Masked state: animate eye icon swap */
.project-masked .dash-row-privacy {
  color: var(--accent);
}

/* Delete button — absolute top-right */
.dash-row-delete {
  position: absolute;
  top: 8px;
  right: 4px;
  z-index: 2;
}

/* ── Project Masked (Banking-style hide details) ──────────── */

/* All text elements blur smoothly */
.project-masked .dash-row-title,
.project-masked .dash-pct,
.project-masked .dash-row-bottom > span,
.project-masked .dash-row-progress,
.project-masked .dash-row-emoji {
  filter: blur(4px);
  opacity: 0.7;
  user-select: none;
  transition: filter 0.35s cubic-bezier(.4,.0,.2,1), opacity 0.35s ease;
}

/* Un-masked state transitions (for the reveal) */
.dash-row-title,
.dash-pct,
.dash-row-bottom > span,
.dash-row-progress,
.dash-row-emoji {
  transition: filter 0.3s cubic-bezier(.4,.0,.2,1), opacity 0.3s ease;
}

/* Preview toggle — stays visible but blurred + disabled when masked */
.project-masked .dash-preview-toggle {
  filter: blur(4px);
  opacity: 0.5;
  pointer-events: none;
  transition: filter 0.35s ease, opacity 0.35s ease;
}
.dash-preview-toggle {
  transition: filter 0.3s ease, opacity 0.3s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

/* Disable link when masked */
.project-masked .dash-row-link {
  pointer-events: none;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .project-masked .dash-row-title,
  .project-masked .dash-pct,
  .project-masked .dash-row-bottom > span,
  .project-masked .dash-preview-toggle,
  .dash-row-privacy svg {
    transition: none !important;
  }
}

/* ── Ocean-wave canvas fill per project row ────────────────── */

.wave-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
}

/* Status fill colors (matching STATUS_COLORS in helpers.js) */
.dash-project-row[data-status="Idea"]      { --fill-rgb: 120, 113, 108; }  /* stone */
.dash-project-row[data-status="Building"]  { --fill-rgb: 14, 165, 233; }   /* sky */
.dash-project-row[data-status="Releasing"] { --fill-rgb: 16, 185, 129; }   /* emerald */
.dash-project-row[data-status="Scaling"]   { --fill-rgb: 139, 92, 246; }   /* violet */
.dash-project-row[data-status="Paused"]    { --fill-rgb: 245, 158, 11; }   /* amber */

/* Border + progress bar inherit the stage color */
.dash-project-row {
  border-color: rgba(var(--fill-rgb), 0.18);
}
.dash-project-row .progress-fill {
  background: rgb(var(--fill-rgb)) !important;
}

.dash-project-row:hover {
  border-color: rgba(var(--fill-rgb), 0.45);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card-hover);
}
/* Tap press feedback on mobile */
.dash-project-row:active {
  transform: scale(0.985);
  transition-duration: var(--dur-press);
}

/* ─── Quick Preview Toggle Button ────────────────── */
.dash-preview-toggle {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  line-height: 1;
}
.dash-preview-toggle-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-smooth);
}
.dash-preview-toggle-label {
  pointer-events: none;
}
.dash-preview-toggle:hover {
  color: var(--accent);
  border-color: rgba(249,115,22,0.35);
  background: rgba(249,115,22,0.04);
  box-shadow: 0 1px 4px rgba(249,115,22,0.08);
}
.dash-preview-toggle:active {
  transform: translateX(-50%) scale(0.96);
}
.dash-preview-toggle.open {
  color: var(--accent);
  border-color: rgba(249,115,22,0.35);
  background: rgba(249,115,22,0.06);
}
.dash-preview-toggle.open .dash-preview-toggle-icon {
  transform: rotate(180deg);
}
.dash-preview-toggle.open .dash-preview-toggle-label::after {
  content: none;
}
[data-theme="dark"] .dash-preview-toggle {
  background: var(--card);
  border-color: var(--border);
}
[data-theme="dark"] .dash-preview-toggle:hover {
  background: rgba(249,115,22,0.08);
  border-color: rgba(249,115,22,0.3);
}

/* ─── Quick Preview Panel (smooth height animation) ─ */
.dash-preview-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.52s cubic-bezier(.22,.61,.36,1);
  width: 100%;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}
.dash-preview-panel-inner-wrap {
  overflow: hidden;
}

.dash-preview-inner {
  border-top: 1px solid var(--border);
  padding: 12px 8px 8px;
  margin-top: 8px;
}

/* Skeleton Loading */
.preview-skeleton {
  border-top: 1px solid var(--border);
  padding: 14px 8px 12px;
  margin-top: 8px;
}
.preview-skeleton-row {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.42) 18%, rgba(226, 232, 240, 0.82) 50%, rgba(203, 213, 225, 0.42) 82%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.7s ease-in-out infinite;
  margin-bottom: 8px;
}
[data-theme="dark"] .preview-skeleton-row {
  background: linear-gradient(90deg, rgba(100, 116, 139, 0.30) 18%, rgba(148, 163, 184, 0.44) 50%, rgba(100, 116, 139, 0.30) 82%);
  background-size: 220% 100%;
}
.preview-skeleton-row:nth-child(1) { width: 100%; height: 26px; border-radius: var(--radius-sm); }
.preview-skeleton-row:nth-child(2) { width: 100%; height: 6px; margin-bottom: 12px; }
.preview-skeleton-row:nth-child(3) { width: 70%; }
.preview-skeleton-row:nth-child(4) { width: 90%; }
.preview-skeleton-row:nth-child(5) { width: 55%; }
.preview-skeleton-row:nth-child(6) { width: 80%; }
.preview-skeleton-row:nth-child(7) { width: 40%; }
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Preview Stage Tabs — mirrors project page status-tabs exactly */
.preview-stage-tabs {
  position: relative;
  display: flex;
  margin-bottom: 10px;
  background: var(--card);
  border-radius: var(--radius-sm);
}
.preview-status-pill {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  border-radius: 0;
  pointer-events: none;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.4s ease,
              border-radius 0.4s ease;
}
.preview-stage-tab {
  cursor: pointer;
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
  background: transparent;
  color: #a3a3a3;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.preview-stage-tab:not(:first-child) {
  margin-left: -1px;
}
.preview-stage-tab.rounded-l { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.preview-stage-tab.rounded-r { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.preview-stage-tab:not(.preview-stage-tab-active):hover {
  color: #737373;
}
.preview-stage-tab-active {
  color: #ffffff !important;
  background: transparent !important;
}
.preview-stage-tab-active:not([data-status="Paused"]) .stage-arrows {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 3px;
  pointer-events: none;
}
.preview-stage-tab .stage-arrows {
  display: none;
}
.preview-stage-tab .stage-arrows .chevron {
  font-size: 10px;
  line-height: 1;
  color: rgba(255,255,255,0.8);
  animation: marchChevron 1.8s ease-in-out infinite;
  opacity: 0;
}
.preview-stage-tab .stage-arrows .chevron:nth-child(2) {
  animation-delay: 0.25s;
}
.preview-stage-tab .stage-arrows .chevron:nth-child(3) {
  animation-delay: 0.5s;
}

/* Preview Progress */
.preview-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.preview-progress-wrap .progress-track {
  flex: 1;
}
.preview-progress-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* Preview Content Tabs */
.preview-content-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.preview-content-tabs::-webkit-scrollbar {
  display: none;
}
.preview-content-tab {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.preview-content-tab:hover {
  color: var(--text);
}
.preview-content-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.preview-content-tab svg {
  width: 12px;
  height: 12px;
}

/* Preview Tab Panels */
.preview-tab-panel {
  display: none;
  max-height: 320px;
  overflow-y: auto;
}
.preview-tab-panel.active {
  display: block;
  animation: previewFadeIn 0.2s ease both;
}
@keyframes previewFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Preview Task List */
.preview-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.preview-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}
.preview-task-item:hover {
  background: rgba(0,0,0,0.02);
}
[data-theme="dark"] .preview-task-item:hover {
  background: rgba(255,255,255,0.03);
}
.preview-task-title {
  display: block;
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}
.preview-task-title.done {
  color: var(--text);
  opacity: 0.58;
  text-decoration: line-through;
}
[data-theme="dark"] .preview-task-title.done {
  color: var(--text);
  opacity: 0.78;
}
.preview-task-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
  line-height: 1.3;
}

/* Preview task checkbox contrast + centering */
.preview-task-item .task-check {
  margin: 0;
  align-self: center;
  border-color: rgba(148, 163, 184, 0.72);
  background: transparent;
}
[data-theme="dark"] .preview-task-item .task-check {
  border-color: rgba(148, 163, 184, 0.9);
}
.preview-task-item .task-check:hover {
  border-color: var(--accent);
}

/* Preview Markdown Content */
.preview-md-content {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  padding: 4px 0;
}
.preview-md-content h1, .preview-md-content h2, .preview-md-content h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 8px 0 4px;
}
.preview-md-content p { margin: 4px 0; }
.preview-md-content ul, .preview-md-content ol { padding-left: 18px; margin: 4px 0; }
.preview-md-content li { margin: 2px 0; }
.preview-md-content code { font-size: 11px; background: rgba(0,0,0,0.04); padding: 1px 4px; border-radius: 3px; }
.preview-md-content pre { background: rgba(0,0,0,0.04); padding: 8px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 11px; margin: 6px 0; }
[data-theme="dark"] .preview-md-content code { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .preview-md-content pre { background: rgba(255,255,255,0.06); }

.preview-empty-state {
  text-align: center;
  padding: 20px 8px;
  color: var(--muted);
  font-size: 11px;
}

/* Open link to full project */
.preview-open-full {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  margin-top: 8px;
  padding: 4px 0;
  transition: color 0.15s;
}
.preview-open-full:hover {
  color: var(--accent-hover);
}

/* ─── Task Checkbox (custom, hand-drawn) ─────────── */
.task-check {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border-hover);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transition: border-color 0.2s, box-shadow 0.3s;
}
.task-check:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(249,115,22,0.08);
}
.task-check:active {
  transform: scale(0.88);
}
[data-theme="dark"] .task-check {
  border-color: var(--border);
}
[data-theme="dark"] .task-check:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}

/* Checked state — orange border, no fill */
.task-check-done {
  border-color: var(--accent) !important;
  background: transparent !important;
}
.task-check-done:hover {
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}
[data-theme="dark"] .task-check-done {
  border-color: var(--accent) !important;
  background: transparent !important;
}

/* Hand-drawn checkmark SVG — intentionally bigger than the circle */
.check-svg {
  position: absolute;
  width: 30px;
  height: 30px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
}
.check-svg path {
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: 18;
  stroke-dashoffset: 18;
  transition: none;
}

/* Draw ON: stroke draws from start to end */
.task-check-done .check-svg path {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s;
}

/* Erase OFF: stroke reverses from tip to start */
.task-check-erasing .check-svg path {
  stroke-dashoffset: 18;
  transition: stroke-dashoffset 0.25s cubic-bezier(0.55, 0, 1, 0.45);
}

/* ─── Reduced Motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .progress-fill, .tm-progress-fill {
    transition: none !important;
  }
  .progress-fill::after {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════
   MOBILE-FIRST RESPONSIVE SYSTEM
   ═══════════════════════════════════════════════════ */

/* ─── Safe Areas (iOS notch) ──────────────────────── */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.pt-safe {
  padding-top: env(safe-area-inset-top, 0px);
}

/* ─── Scrollbar Hide Utility ──────────────────────── */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ─── Mobile Header ───────────────────────────────── */
.mobile-header {
  padding-left: max(1rem, env(safe-area-inset-left, 1rem));
  padding-right: max(1rem, env(safe-area-inset-right, 1rem));
}

#dashboard-page,
#project-page,
#techpref-root {
  overflow-x: clip;
}

/* On desktop there's no mobile header, so tech-pref fills full viewport */
@media (min-width: 768px) {
  #techpref-root {
    height: 100dvh !important;
  }
}

/* ─── Drawer Overlay ──────────────────────────────── */
#drawer-overlay {
  -webkit-tap-highlight-color: transparent;
}

/* ─── Sidebar / Drawer ────────────────────────────── */
#app-sidebar {
  will-change: transform;
}

/* ─── Context Wrap (AI mode collapsible) ──────────── */
.np-context-wrap {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s ease;
}
.np-context-wrap--hidden {
  grid-template-rows: 0fr;
  opacity: 0;
}
.np-context-inner {
  overflow: hidden;
}
.np-context-counter {
  font-size: 11px;
  color: #9ca3af;
  text-align: right;
  margin-top: 4px;
  transition: color 0.15s;
}
.np-context-counter--warn { color: #f97316; }
.np-context-counter--max  { color: #ef4444; }

/* ─── Mode Toggle (New Project) ───────────────────── */
.np-toggle {
  position: relative;
  display: flex;
  background: var(--sidebar-hover, #f3f4f6);
  border-radius: 10px;
  padding: 4px;
}
.np-toggle-pill {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
.np-toggle-pill--right {
  transform: translateX(100%);
}
.np-toggle .np-mode-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary, #6b7280);
  transition: color 0.2s, font-weight 0.15s;
}
.np-toggle .np-mode-btn--active {
  color: var(--text);
  font-weight: 600;
}
.np-toggle .np-mode-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ─── Language Picker — Trigger Button ────────────── */
.lang-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}
.lang-picker-trigger:hover {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent);
}
.lang-picker-trigger:active {
  border-color: var(--accent);
}
.lang-picker-trigger-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.lang-picker-flag {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.lang-picker-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.lang-picker-native {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text);
}
.lang-picker-english {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.lang-picker-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 0.15s;
}
.lang-picker-trigger:hover .lang-picker-chevron {
  color: var(--text-secondary);
}

/* ─── Language Picker — Modal Overlay ─────────────── */
.lang-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px);
  transition: opacity 0.18s ease;
}
@media (min-width: 640px) {
  .lang-modal-overlay {
    align-items: center;
  }
}
.lang-modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.1);
  transition: transform 0.22s cubic-bezier(0.2,0.8,0.2,1);
  /* Mobile: bottom sheet */
  border-radius: 20px 20px 0 0;
  padding: 0 0 env(safe-area-inset-bottom, 0px);
  overflow: hidden;
}
@media (min-width: 640px) {
  .lang-modal-box {
    border-radius: 16px;
    max-width: 440px;
    width: 90%;
    max-height: 520px;
  }
}
.lang-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
}
.lang-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}
.lang-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.lang-modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

/* Search */
.lang-modal-search-wrap {
  position: relative;
  padding: 14px 20px 10px;
}
.lang-modal-search-icon {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.lang-modal-search {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.lang-modal-search::placeholder {
  color: var(--muted);
}
.lang-modal-search:focus {
  border-color: var(--border-focus);
}

/* Language List */
.lang-modal-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lang-modal-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  text-align: left;
  font-size: 14px;
  color: var(--text);
}
.lang-modal-item:hover {
  background: var(--bg);
  border-color: var(--border);
}
.lang-modal-item:active {
  transform: scale(0.98);
  transition-duration: 60ms;
}
.lang-modal-item--active {
  background: var(--accent-light);
  border-color: var(--accent-border);
}
.lang-modal-item--active:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}
.lang-modal-item-flag {
  width: 32px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.lang-modal-item-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.lang-modal-item-native {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  color: var(--text);
}
.lang-modal-item-english {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.2;
}
.lang-modal-item-check {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}
/* Dark mode overrides for language picker */
[data-theme="dark"] .lang-modal-item:hover {
  background: var(--sidebar-hover, #2c2c32);
}
[data-theme="dark"] .lang-modal-item-flag,
[data-theme="dark"] .lang-picker-flag {
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}

/* ─── Modal System — Responsive ───────────────────── */
#modal-overlay {
  display: none;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 640px) {
  #modal-overlay {
    align-items: center;
  }
}

.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s ease, max-width 0.3s cubic-bezier(0.4,0,0.2,1);
  /* Mobile: bottom sheet */
  border-radius: 16px 16px 0 0;
  padding: 28px 24px calc(28px + env(safe-area-inset-bottom, 0px));
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

@media (min-width: 640px) {
  .modal-box {
    border-radius: 16px;
    padding: 32px 36px;
    max-width: 520px;
    width: 90%;
    max-height: none;
    overflow-y: visible;
  }
}

.modal-drag-handle {
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-hover);
  margin: 0 auto 20px;
}

@media (min-width: 640px) {
  .modal-drag-handle {
    display: none;
  }
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-direction: column-reverse;
  margin-top: 4px;
}

@media (min-width: 640px) {
  .modal-actions {
    flex-direction: row;
  }
}

.modal-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: center;
}

@media (min-width: 640px) {
  .modal-btn {
    padding: 8px 20px;
    font-size: 13px;
    width: auto;
  }
}

.modal-btn-cancel {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
}
.modal-btn-cancel:hover {
  background: var(--sidebar-hover, #f3f4f6);
}
.modal-btn-cancel:active {
  border-color: var(--border-hover);
}

.modal-btn-primary {
  border: none;
  background: #f97316;
  color: #fff;
}
.modal-btn-primary:hover {
  background: #ea580c;
}
.modal-btn-primary:active {
  background: #c2410c;
}

.modal-btn-danger {
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #dc2626;
}
.modal-btn-danger:hover {
  background: #fee2e2;
}
.modal-btn-danger:active {
  background: #fecaca;
}

[data-theme="dark"] .modal-btn-danger {
  border-color: #7f1d1d;
  background: #2c1616;
  color: #f87171;
}
[data-theme="dark"] .modal-btn-danger:hover {
  background: #3c1616;
}
[data-theme="dark"] .modal-btn-danger:active {
  background: #4c1e1e;
}

/* ─── Input Mobile Sizing ─────────────────────────── */
/* Prevent iOS auto-zoom: inputs must be >= 16px */
.input, .tm-input, .onboarding-search-input,
input[type="text"], input[type="email"], input[type="password"],
textarea, select {
  font-size: 16px !important;
}

@media (min-width: 640px) {
  .input, .tm-input, .onboarding-search-input,
  input[type="text"], input[type="email"], input[type="password"],
  textarea, select {
    font-size: 0.875rem !important;
  }
}

/* ─── Touch UX ────────────────────────────────────── */
/* Remove hover-only dependencies — add active equivalents */
.sidebar-link:active {
  background: var(--sidebar-hover, #f5f5f5);
  color: var(--text);
}

.sidebar-link-active:active {
  background: var(--accent-hover);
  color: #ffffff;
}

.wire-card:active, .tm-card:active {
  border-color: var(--border-hover);
}

.btn:active, .tm-btn:active {
  border-color: var(--border-focus);
  color: var(--text);
}

.btn-primary:active, .tm-btn-primary:active {
  border-color: var(--accent);
}

.btn-primary:active .btn-fill, .tm-btn-primary:active .btn-fill {
  clip-path: inset(0 0 0 0) !important;
  background-color: var(--accent-hover);
}

.btn-danger:active, .tm-btn-danger:active {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.status-tab:not(.status-tab-active):active {
  background: var(--sidebar-hover, #f5f5f5);
}

.dash-tab:active:not(.active) {
  border-color: var(--border-hover);
  color: var(--text);
}

.content-tab:active {
  color: var(--text-secondary);
}

.dash-project-row:active {
  border-color: var(--border-hover);
}

/* Disable hover transforms on touch devices */
@media (hover: none) {
  .dash-project-row:hover {
    transform: none;
    box-shadow: none;
    border-top: 1px solid var(--border);
  }
  .hoverLift:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Make task delete always visible on touch */
@media (hover: none) {
  .notepad-tab-close.opacity-0 {
    opacity: 0.5 !important;
  }
  .task-delete-btn {
    opacity: 0.5 !important;
  }
  .task-note-input:placeholder-shown {
    min-height: 16px;
  }
}

/* ─── Task Delete Button ───────────────────────────── */
.task-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0;
}
.task-row:hover .task-delete-btn {
  opacity: 1;
}
.task-delete-btn:hover {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}
.task-delete-btn:active {
  color: #dc2626;
  background: #fee2e2;
  border-color: #fca5a5;
}

/* ─── Task note textarea auto-sizing ──────────── */
.task-note-input {
  min-height: 16px;
  max-height: 200px;
  overflow-y: hidden;
  padding: 0;
}
/* Hide empty notes until row hover or focus */
.task-note-input:placeholder-shown {
  min-height: 16px;
}
.tab-editor,
.editable-desc {
  min-height: 40px;
}

/* ─── Editable Project Title / Description ────────── */
.editable-title {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 1px 4px;
  margin: -1px -4px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.editable-title:hover {
  border-color: var(--border);
}
.editable-title:focus {
  border-color: var(--border-hover);
  background: var(--card);
}
.editable-desc {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
  outline: none;
  resize: none;
  overflow-y: hidden;
  min-height: 22px;
  max-height: 2.8em; /* ~2 lines when not focused */
  transition: border-color 0.15s ease, background 0.15s ease, max-height 0.2s ease;
  line-height: 1.4;
}
.editable-desc:hover {
  border-color: var(--border);
}
.editable-desc:focus {
  border-color: var(--border-hover);
  background: var(--card);
  max-height: 400px;
}

/* ─── Editable Emoji Button & Picker ──────────────── */
.editable-emoji-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
  line-height: 1;
}
.editable-emoji-btn:hover {
  border-color: var(--border);
  background: var(--faint);
}

/* ─── emoji-picker-element popover ────────────────── */
.emoji-popover {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  margin-top: 4px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  overflow: hidden;
}
.emoji-popover emoji-picker {
  --num-columns: 8;
  --emoji-size: 1.2rem;
  --border-color: var(--border);
  --border-radius: var(--radius);
  --background: var(--card);
  --input-border-color: var(--border);
  --input-border-radius: 6px;
  --input-font-size: 0.8rem;
  --input-padding: 0.3rem 0.5rem;
  --category-font-size: 0.75rem;
  height: 320px;
  width: 320px;
}
@media (max-width: 767px) {
  .emoji-popover {
    position: fixed;
    top: auto;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    margin-top: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 100%;
  }
  .emoji-popover emoji-picker {
    width: 100%;
    height: 280px;
    --num-columns: 9;
  }
}
.emoji-popover-backdrop {
  display: none;
}
@media (max-width: 767px) {
  .emoji-popover-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(0,0,0,0.2);
  }
}

/* ─── Onboarding Tech Buttons Mobile ──────────────── */
.onboarding-tech-btn {
  padding: 8px 14px;
  min-height: 40px;
}
.onboarding-tech-btn:active {
  border-color: var(--border-hover);
  background: var(--sidebar-hover, #f9fafb);
}
.onboarding-tech-btn.selected:active {
  background: #fed7aa;
}

/* ─── Content Tab Overflow ────────────────────────── */
.content-tabs-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.content-tabs-wrap::-webkit-scrollbar {
  display: none;
}
@media (max-width: 639px) {
  .content-tab {
    padding: 0.5rem 0.5rem;
    font-size: 0.75rem;
    gap: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  /* Status tabs: scroll horizontally on mobile instead of cramped flex-1 */
  .status-tab {
    font-size: 10px;
    padding: 6px 10px;
    min-width: fit-content;
    flex: 0 0 auto;
  }
  .status-tab svg {
    width: 12px;
    height: 12px;
  }
}

@media (max-width: 430px) {
  .mobile-quick-link {
    min-height: 44px;
    font-size: 12px;
    padding: 8px 6px;
  }

  .dash-tab {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .dash-row-bottom .pill {
    max-width: 94px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .project-header-stuck {
    padding: 8px 12px !important;
  }

  .project-header-stuck .header-progress-mini {
    min-width: 96px !important;
  }

  #add-task-sticky {
    z-index: 32;
  }

  .modal-box {
    max-height: 92dvh;
    padding: 20px 14px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    background: var(--card);
    padding-top: 10px;
    margin-top: 10px;
  }
}

@media (max-width: 390px) {
  .content-tab {
    padding: 0.45rem 0.4rem;
    font-size: 11px;
  }

  .status-tab {
    min-height: 34px;
    padding: 5px 8px;
    gap: 4px;
  }

  .status-tab .stage-arrows {
    display: none;
  }

  .dash-row-delete {
    top: 4px;
    right: 2px;
  }

  .task-delete-btn {
    width: 26px;
    height: 26px;
    opacity: 0.6;
  }
}

/* ─── Content Tabs Full Border ────────────────────── */
#content-tabs {
  position: relative;
}
#content-tabs::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
  z-index: -1;
}

/* ─── Project Header Mobile ───────────────────────── */
@media (max-width: 639px) {
  .project-header {
    padding: 16px !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    width: calc(100% + 2rem) !important;
  }
  .project-header-stuck {
    padding: 10px 16px !important;
  }
}

/* ─── Task Add Form Mobile ────────────────────────── */
@media (max-width: 639px) {
  #add-task-sticky {
    margin-left: -1rem !important;
    margin-right: -1rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-bottom: calc(0.625rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ─── Prevent body scroll when drawer/modal open ──── */
body.drawer-open,
body.modal-open {
  overflow: hidden;
}

/* ─── Tap highlight removal ───────────────────────── */
button, a, input, textarea, select {
  -webkit-tap-highlight-color: transparent;
}

/* ─── Dashboard pagination mobile ─────────────────── */
@media (max-width: 639px) {
  .dash-page-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════════
   Admin Panel
   ═══════════════════════════════════════════════ */

/* ─── Admin Sidebar Nav Links ─────────────────────── */
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #a3a3a3;
  transition: background var(--dur-hover) var(--ease-smooth),
              color var(--dur-hover) var(--ease-smooth);
}
.admin-nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #e5e5e5;
}
.admin-nav-active {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

/* ─── Admin Tables ────────────────────────────────── */
.admin-table {
  border-collapse: collapse;
}
.admin-table thead {
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  padding: 0.625rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: left;
}
.admin-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr {
  transition: background var(--dur-hover) var(--ease-smooth);
}
.admin-table tbody tr:hover {
  background: rgba(0,0,0,0.015);
}

/* ─── Billing Toggle ─────────────────────────────── */
.billing-toggle-wrap {
  display: flex;
  justify-content: center;
}
.billing-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
}
.billing-toggle-btn {
  position: relative;
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: color var(--dur-hover) var(--ease-smooth),
              background var(--dur-hover) var(--ease-smooth),
              box-shadow var(--dur-hover) var(--ease-smooth);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.billing-toggle-btn:hover {
  color: var(--text);
}
.billing-toggle-btn.active {
  color: var(--text);
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.billing-toggle-btn.interval-yearly.active {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.billing-toggle-btn.interval-monthly.active {
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.billing-save-badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  white-space: nowrap;
}

/* ─── Content Tab Slide Animations ─────────────────── */
@keyframes tabSlideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes tabSlideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tab-panel.slide-in-right { animation: tabSlideInRight 0.25s ease-out both; }
.tab-panel.slide-in-left  { animation: tabSlideInLeft  0.25s ease-out both; }

/* ─── Day / Night Theme Switch ─────────────────────── */
.theme-switch {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 0.1875rem;
  cursor: pointer;
  overflow: hidden;
}
.theme-switch-option {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  flex: 1;
  padding: 0.375rem 0;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  color: var(--muted);
  transition: color 0.25s ease;
  user-select: none;
}
/* Thumb — slides left/right */
.theme-switch-thumb {
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: calc(50% - 0.1875rem);
  height: calc(100% - 0.375rem);
  border-radius: 9999px;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Light mode: Day is active (thumb left) */
.theme-switch-day { color: var(--text); }
.theme-switch-night { color: var(--muted); }

/* Dark mode: Night is active (thumb right) */
[data-theme="dark"] .theme-switch-thumb {
  transform: translateX(100%);
}
[data-theme="dark"] .theme-switch-day { color: var(--muted); }
[data-theme="dark"] .theme-switch-night { color: var(--text); }

/* Compact variant for public header */
.theme-switch-sm {
  height: 30px;
  border-radius: 15px;
  padding: 2px;
}
.theme-switch-sm .theme-switch-option {
  padding: 0 10px;
  font-size: 11px;
  gap: 3px;
}
.theme-switch-sm .theme-switch-option svg {
  width: 12px;
  height: 12px;
}
.theme-switch-sm .theme-switch-thumb {
  height: 26px;
  border-radius: 13px;
}

/* ─── Demo Badge ───────────────────────────────────── */
.demo-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  flex-shrink: 0;
  line-height: 1.4;
}
[data-theme="dark"] .demo-badge {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
}

/* ─── Demo Banner (project detail) ─────────────────── */
.demo-banner-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.demo-banner-text {
  color: #92400e;
}
.demo-banner-dismiss {
  color: #b45309;
}
.demo-banner-dismiss:hover {
  color: #92400e;
}
[data-theme="dark"] .demo-banner-box {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}
[data-theme="dark"] .demo-banner-text {
  color: #fbbf24;
}
[data-theme="dark"] .demo-banner-dismiss {
  color: #f59e0b;
}
[data-theme="dark"] .demo-banner-dismiss:hover {
  color: #fbbf24;
}

.demo-dismiss-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.dash-project-row:hover .demo-dismiss-btn,
.dash-project-row:focus-within .demo-dismiss-btn {
  opacity: 1;
}

/* ─── intro.js Tour Overrides ──────────────────────── */
.tmi-tour-tooltip .introjs-tooltip {
  border-radius: 12px;
  max-width: 340px;
  font-family: 'Inter', system-ui, sans-serif;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
@media (max-width: 767px) {
  .introjs-tooltip {
    max-width: calc(100vw - 32px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .introjs-tooltip.tmi-welcome-step {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }
}
.introjs-tooltip.tmi-welcome-step {
  max-width: 480px;
  padding: 20px 24px 16px;
}
.introjs-tooltip.tmi-welcome-step .introjs-tooltip-title {
  font-size: 20px;
}
.introjs-tooltip.tmi-welcome-step .introjs-tooltiptext {
  font-size: 15px;
  line-height: 1.6;
}
.introjs-tooltip.tmi-welcome-step .introjs-skipbutton {
  display: none !important;
}
.tmi-tour-tooltip .introjs-tooltip-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.introjs-tooltiptext {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.introjs-button {
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 6px 16px !important;
  text-shadow: none !important;
  border: 1px solid var(--border) !important;
}
.introjs-button:focus {
  box-shadow: none !important;
}
.introjs-donebutton {
  background: #f97316 !important;
  color: #fff !important;
  border-color: #f97316 !important;
}
.introjs-donebutton:hover {
  background: #ea580c !important;
}
.tmi-tour-highlight {
  border-radius: 12px;
}
[data-theme="dark"] .introjs-tooltip {
  background: #2c2c32;
  border: 1px solid #48484f;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
[data-theme="dark"] .introjs-tooltiptext {
  color: #c8c8ce;
}
[data-theme="dark"] .introjs-arrow.top {
  border-bottom-color: #2c2c32;
}
[data-theme="dark"] .introjs-arrow.bottom {
  border-top-color: #2c2c32;
}
[data-theme="dark"] .introjs-arrow.left {
  border-right-color: #2c2c32;
}
[data-theme="dark"] .introjs-arrow.right {
  border-left-color: #2c2c32;
}
[data-theme="dark"] .introjs-button {
  background: #38383f !important;
  color: #e8e8ec !important;
  border-color: #48484f !important;
}
[data-theme="dark"] .introjs-button:hover {
  background: #42424a !important;
}
[data-theme="dark"] .introjs-helperLayer {
  background: rgba(0,0,0,0.5);
}
[data-theme="dark"] .introjs-overlay {
  background: rgba(0,0,0,0.6) !important;
}
[data-theme="dark"] .introjs-bullets ul li a {
  background: #48484f;
}
[data-theme="dark"] .introjs-bullets ul li a.active {
  background: #f97316;
}

/* Mobile quick-links bar (visible only < md) */
.mobile-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.mobile-quick-link:hover {
  background: var(--bg);
  border-color: var(--text-muted);
}
.mobile-quick-link-accent {
  background: #f97316;
  color: #fff;
  border-color: #f97316;
}
.mobile-quick-link-accent:hover {
  background: #ea580c;
  border-color: #ea580c;
  color: #fff;
}

/* ═══════════════════════════════════════════════
   Help Center — /help page
   ═══════════════════════════════════════════════ */

/* Layout */
.help-page {
  display: flex;
  min-height: 100vh;
  padding-top: 80px; /* clear fixed header h-20 */
}

/* Sidebar TOC */
.help-toc {
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  width: 260px;
  min-width: 260px;
  border-right: 1px solid var(--border);
  background: var(--card);
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 20;
}
.help-toc-inner {
  padding: 2rem 1.5rem;
}
.help-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.help-toc-list li {
  margin-bottom: 2px;
}
.help-toc-list a {
  display: block;
  padding: 6px 10px;
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--dur-hover), background var(--dur-hover);
  line-height: 1.4;
}
.help-toc-list a:hover {
  color: var(--text);
  background: var(--bg);
}
.help-toc-list a.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

/* Mobile TOC toggle */
.help-toc-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(249,115,22,0.3);
  align-items: center;
  gap: 6px;
  transition: transform var(--dur-hover) var(--ease-pop);
}
.help-toc-toggle:active {
  transform: scale(0.95);
}
.help-toc-toggle-active {
  background: var(--text);
}

/* Main content */
.help-content {
  flex: 1;
  min-width: 0;
  padding: 3rem 2rem;
}

/* Sections */
.help-section {
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 2rem;
}
.help-section:last-child {
  border-bottom: none;
}
.help-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  tracking: -0.01em;
}
.help-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}
.help-summary {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.help-section p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.help-section ul,
.help-section ol {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
.help-section li {
  margin-bottom: 0.5rem;
}
.help-section a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.help-section a:hover {
  color: var(--accent-hover);
}
.help-section code {
  background: var(--inline-code-bg);
  color: var(--inline-code-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Help Tables */
.help-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}
.help-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.help-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}
.help-table-trouble td:first-child {
  font-weight: 500;
  color: var(--text);
  min-width: 180px;
}

/* FAQ accordion (help page) */
.help-faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.help-faq summary {
  padding: 14px 18px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--dur-hover);
}
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--muted);
  transition: transform var(--dur-hover);
  flex-shrink: 0;
  margin-left: 1rem;
}
.help-faq[open] summary::after {
  content: '\2212';
}
.help-faq summary:hover {
  background: var(--bg);
}
.help-faq p {
  padding: 0 18px 14px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}
.help-faq p:first-of-type {
  padding-top: 4px;
}

/* Glossary */
.help-glossary {
  margin-top: 1rem;
}
.help-glossary dt {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9375rem;
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
}
.help-glossary dd {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin-left: 0;
  padding-left: 0;
  margin-bottom: 0;
}

/* Callouts inside help page */
.help-section .tm-callout-info,
.help-section .tm-callout-warn,
.help-section .tm-callout-success,
.help-section .tm-callout-danger {
  margin: 1rem 0 1.25rem;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 1023px) {
  .help-toc {
    position: fixed;
    top: 80px;
    left: 0;
    height: calc(100vh - 80px);
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease-pop);
    box-shadow: var(--shadow-modal);
  }
  .help-toc-open {
    transform: translateX(0);
  }
  .help-toc-toggle {
    display: flex;
  }
  .help-content {
    padding: 2rem 1.25rem;
  }
}

/* ═══════════════════════════════════════════════
   Homepage FAQ Accordion
   ═══════════════════════════════════════════════ */
.home-faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--dur-hover);
}
.home-faq:hover {
  border-color: var(--border-hover);
}
.home-faq summary {
  padding: 16px 20px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--dur-hover);
}
.home-faq summary::-webkit-details-marker { display: none; }
.home-faq summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--muted);
  transition: transform var(--dur-hover);
  flex-shrink: 0;
  margin-left: 1rem;
}
.home-faq[open] summary::after {
  content: '\2212';
}
.home-faq summary:hover {
  background: var(--bg);
}
.home-faq-body {
  padding: 0 20px 16px;
}
.home-faq-body p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 0.5rem;
}
.home-faq-body p:last-child {
  margin-bottom: 0;
}
.home-faq-link {
  margin-top: 0.25rem;
}
.home-faq-link a {
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.home-faq-link a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

