/* Sha4owX Flow — Premium UI (huashu-design) */
:root {
  --flow-bg: #08080a;
  --flow-bg2: #111114;
  --flow-bg3: #18181c;
  --flow-surface: oklch(0.14 0.018 255 / 0.72);
  --flow-card: oklch(0.15 0.02 255 / 0.85);
  --flow-cyan: oklch(0.82 0.14 195);
  --flow-cyan-dim: oklch(0.82 0.14 195 / 0.12);
  --flow-teal: oklch(0.65 0.1 195);
  --flow-green: oklch(0.72 0.17 145);
  --flow-wa: oklch(0.68 0.16 155);
  --flow-yellow: oklch(0.82 0.14 95);
  --flow-red: oklch(0.62 0.2 25);
  --flow-white: oklch(0.93 0.01 255);
  --flow-w80: oklch(0.93 0.01 255 / 0.8);
  --flow-w60: oklch(0.93 0.01 255 / 0.58);
  --flow-w40: oklch(0.93 0.01 255 / 0.38);
  --flow-w25: oklch(0.93 0.01 255 / 0.22);
  --flow-w12: oklch(0.93 0.01 255 / 0.1);
  --flow-w06: oklch(0.93 0.01 255 / 0.05);
  --flow-border: oklch(0.93 0.01 255 / 0.08);
  --flow-border-hi: oklch(0.82 0.14 195 / 0.22);
  --flow-font: 'Space Grotesk', system-ui, sans-serif;
  --flow-display: 'Cabinet Grotesk', var(--flow-font);
  --flow-serif: 'Newsreader', Georgia, serif;
  --flow-mono: 'JetBrains Mono', monospace;
  --flow-r: 12px;
  --flow-r-lg: 18px;
  --flow-r-xl: 24px;
  --flow-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --flow-shadow: 0 24px 64px oklch(0.05 0.02 255 / 0.55);
  --flow-glow: 0 0 80px oklch(0.82 0.14 195 / 0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  background: var(--flow-bg);
  color: var(--flow-white);
  font-family: var(--flow-font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: oklch(0.82 0.14 195 / 0.25); }

/* Grain overlay */
.flow-premium::before {
  content: '';
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.035;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ── Buttons ── */
.flow-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--flow-r);
  font-weight: 600; font-size: 0.82rem;
  transition: transform 0.2s var(--flow-ease), box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.flow-btn-primary {
  background: #f2efe8;
  color: #0a0a0c;
  box-shadow: none;
  border-radius: 100px;
}
.flow-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  background: #fff;
}
.flow-btn-outline {
  border: 1px solid var(--flow-border);
  color: var(--flow-w80);
  background: var(--flow-w06);
  backdrop-filter: blur(8px);
}
.flow-btn-outline:hover { border-color: var(--flow-border-hi); color: var(--flow-cyan); }

/* ── Logo ── */
.flow-logo {
  font-family: var(--flow-display);
  font-weight: 900; font-size: 1.15rem; letter-spacing: -0.02em;
}
.flow-logo span { color: var(--flow-cyan); }
.flow-logo small {
  display: block; font-size: 0.55rem; font-family: var(--flow-mono);
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--flow-w40);
  font-weight: 500; margin-top: 2px;
}

/* ── Landing nav ── */
.flow-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem); height: 68px;
  background: oklch(0.11 0.015 255 / 0.72);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--flow-border);
}
.flow-nav-links { display: flex; align-items: center; gap: 1.75rem; }
.flow-nav-links a:not(.flow-btn) {
  font-size: 0.8rem; color: var(--flow-w60);
  transition: color 0.2s; letter-spacing: 0.01em;
}
.flow-nav-links a:not(.flow-btn):hover { color: var(--flow-white); }

/* ── Hero split ── */
.flow-hero {
  padding: clamp(6.5rem, 12vw, 9rem) clamp(1.5rem, 5vw, 3rem) clamp(3rem, 6vw, 5rem);
  position: relative; overflow: hidden;
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.flow-hero-glow {
  position: absolute; inset: -20% -10%; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 20% 30%, oklch(0.82 0.14 195 / 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at 85% 70%, oklch(0.55 0.06 195 / 0.06) 0%, transparent 50%);
}
.flow-hero-content { position: relative; z-index: 1; text-align: left; }
.flow-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--flow-mono); font-size: 0.62rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--flow-cyan); margin-bottom: 1.25rem;
  padding: 7px 14px; border-radius: 999px;
  background: var(--flow-cyan-dim); border: 1px solid var(--flow-border-hi);
}
.flow-hero h1 {
  font-family: var(--flow-display);
  font-size: clamp(2.4rem, 5.5vw, 3.6rem); font-weight: 900;
  line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 1.25rem;
}
.flow-hero h1 em { font-style: normal; color: var(--flow-cyan); }
.flow-hero-lead {
  font-family: var(--flow-serif);
  font-size: clamp(1rem, 2vw, 1.12rem); color: var(--flow-w60);
  line-height: 1.65; margin-bottom: 2rem; max-width: 480px;
  font-weight: 400; font-style: italic;
}
.flow-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.flow-hero-visual {
  position: relative; z-index: 1;
  border-radius: var(--flow-r-xl);
  border: 1px solid var(--flow-border);
  background: linear-gradient(165deg, oklch(0.16 0.02 255 / 0.95), oklch(0.12 0.015 255 / 0.98));
  box-shadow: var(--flow-shadow), var(--flow-glow);
  overflow: hidden;
  aspect-ratio: 4/3;
  min-height: 320px;
}
.flow-hero-visual::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 36px;
  background: oklch(0.1 0.015 255 / 0.6);
  border-bottom: 1px solid var(--flow-border);
  display: flex;
}
.flow-mock-topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 36px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font-size: 0.62rem; font-family: var(--flow-mono); color: var(--flow-w40);
  border-bottom: 1px solid var(--flow-border);
  background: oklch(0.1 0.015 255 / 0.5);
}
.flow-mock-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-top: 36px; }
.flow-mock-row { display: flex; gap: 8px; }
.flow-mock-chip {
  height: 28px; border-radius: 8px; background: var(--flow-w06);
  border: 1px solid var(--flow-border); flex: 1;
}
.flow-mock-chip.on { background: var(--flow-cyan-dim); border-color: var(--flow-border-hi); }
.flow-mock-chat {
  margin-top: 8px; display: flex; flex-direction: column; gap: 8px;
}
.flow-mock-bubble {
  max-width: 72%; padding: 8px 12px; border-radius: 12px;
  font-size: 0.68rem; line-height: 1.45; color: var(--flow-w60);
}
.flow-mock-bubble.in {
  align-self: flex-start; background: oklch(0.18 0.02 255);
  border: 1px solid var(--flow-border); border-radius: 12px 12px 12px 4px;
}
.flow-mock-bubble.out {
  align-self: flex-end; background: oklch(0.68 0.16 155 / 0.15);
  border: 1px solid oklch(0.68 0.16 155 / 0.25);
  border-radius: 12px 12px 4px 12px; color: var(--flow-w80);
}
.flow-mock-badge {
  position: absolute; bottom: 16px; right: 16px;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: oklch(0.68 0.16 155 / 0.12);
  border: 1px solid oklch(0.68 0.16 155 / 0.28);
  font-size: 0.65rem; font-family: var(--flow-mono); color: oklch(0.78 0.12 155);
}
.flow-mock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--flow-green); animation: flowPulse 1.4s infinite; }

/* ── Stats ── */
.flow-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  max-width: 1100px; margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem) clamp(3rem, 6vw, 4rem);
  gap: 1px;
  background: var(--flow-border);
  border: 1px solid var(--flow-border);
  border-radius: var(--flow-r-xl);
  overflow: hidden;
}
.flow-stat {
  text-align: center; padding: 1.75rem 1rem;
  background: var(--flow-bg2);
}
.flow-stat-num {
  font-family: var(--flow-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900;
  color: var(--flow-cyan); letter-spacing: -0.02em;
}
.flow-stat-label {
  font-size: 0.72rem; color: var(--flow-w40); margin-top: 6px;
  font-family: var(--flow-mono); letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── Sections ── */
.flow-section { padding: clamp(4rem, 9vw, 7rem) clamp(1.5rem, 5vw, 3rem); }
.flow-section-dark { background: var(--flow-bg2); }
.flow-container { max-width: 1100px; margin: 0 auto; }
.flow-section-head { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); max-width: 640px; }
.flow-section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.flow-section-head h2 {
  font-family: var(--flow-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 900;
  line-height: 1.1; letter-spacing: -0.025em;
}
.flow-section-head h2 em { font-style: normal; color: var(--flow-cyan); }
.flow-section-head p {
  color: var(--flow-w60); margin-top: 1rem; font-size: 0.92rem; line-height: 1.65;
}

/* ── Features ── */
.flow-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.flow-feature {
  padding: 1.75rem 1.5rem; border-radius: var(--flow-r-lg);
  background: var(--flow-card); border: 1px solid var(--flow-border);
  transition: border-color 0.25s, transform 0.25s var(--flow-ease);
}
.flow-feature:hover {
  border-color: var(--flow-border-hi);
  transform: translateY(-2px);
}
.flow-feature-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--flow-cyan-dim); border: 1px solid var(--flow-border-hi);
  display: flex; align-items: center; justify-content: center;
  color: var(--flow-cyan); margin-bottom: 1.1rem;
}
.flow-feature h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.flow-feature p { font-size: 0.82rem; color: var(--flow-w60); line-height: 1.6; }

/* ── Channels ── */
.flow-channels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.flow-channel {
  padding: 1.35rem 1.1rem; border-radius: var(--flow-r-lg);
  background: var(--flow-card); border: 1px solid var(--flow-border);
  text-align: center; transition: border-color 0.2s, transform 0.2s var(--flow-ease);
}
.flow-channel:hover { border-color: var(--flow-border-hi); transform: translateY(-2px); }
.flow-channel-icon {
  width: 44px; height: 44px; border-radius: 12px; margin: 0 auto 0.75rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--flow-w06); border: 1px solid var(--flow-border);
  color: var(--flow-cyan);
}
.flow-channel-icon.live { background: oklch(0.68 0.16 155 / 0.1); border-color: oklch(0.68 0.16 155 / 0.22); color: var(--flow-wa); }
.flow-channel strong { font-size: 0.85rem; display: block; margin-bottom: 4px; }
.flow-channel span { font-size: 0.72rem; color: var(--flow-w40); font-family: var(--flow-mono); }

/* ── Ask widget ── */
.flow-ask {
  max-width: 720px; margin: 0 auto;
  background: var(--flow-card); border: 1px solid var(--flow-border);
  border-radius: var(--flow-r-xl); overflow: hidden;
  box-shadow: var(--flow-shadow);
}
.flow-ask-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--flow-border);
  font-size: 0.7rem; font-family: var(--flow-mono); color: var(--flow-w40);
}
.flow-ask-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--flow-green);
  display: inline-block; margin-right: 6px; animation: flowPulse 1.4s infinite;
}
@keyframes flowPulse { 0%,100%{opacity:1} 50%{opacity:0.35} }
.flow-ask-chat {
  min-height: 180px; max-height: 300px; overflow-y: auto;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
}
.flow-ask-msg { display: flex; gap: 10px; align-items: flex-start; }
.flow-ask-msg.user { justify-content: flex-end; }
.flow-ask-bubble {
  background: oklch(0.17 0.02 255); border: 1px solid var(--flow-border);
  padding: 12px 15px; border-radius: 16px 16px 16px 4px;
  font-size: 0.86rem; line-height: 1.6; max-width: 85%; color: var(--flow-w80);
  text-wrap: pretty;
}
.flow-ask-msg.user .flow-ask-bubble {
  background: var(--flow-cyan-dim); border-color: var(--flow-border-hi);
  border-radius: 16px 16px 4px 16px;
}
.flow-ask-bubble strong { color: var(--flow-cyan); font-weight: 600; }
.flow-ask-suggestions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 0 20px 16px;
}
.flow-ask-q {
  text-align: left; padding: 12px 14px; border-radius: var(--flow-r);
  background: var(--flow-w06); border: 1px solid var(--flow-border);
  font-size: 0.76rem; color: var(--flow-w60); line-height: 1.45;
  transition: all 0.2s var(--flow-ease);
}
.flow-ask-q:hover { background: var(--flow-cyan-dim); border-color: var(--flow-border-hi); color: var(--flow-white); }
.flow-ask-q:disabled { opacity: 0.4; cursor: not-allowed; }
.flow-ask-input {
  display: flex; gap: 10px; padding: 16px 20px;
  border-top: 1px solid var(--flow-border);
  background: oklch(0.1 0.015 255 / 0.4);
}
.flow-ask-input input {
  flex: 1; background: var(--flow-w06); border: 1px solid var(--flow-border);
  border-radius: var(--flow-r); padding: 12px 16px; outline: none; font-size: 0.86rem;
}
.flow-ask-input input:focus { border-color: var(--flow-border-hi); box-shadow: 0 0 0 3px oklch(0.82 0.14 195 / 0.1); }
.flow-ask-input button {
  width: 44px; height: 44px; border-radius: var(--flow-r);
  background: var(--flow-cyan); color: oklch(0.12 0.02 255);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.flow-ask-input button:hover { transform: scale(1.04); }
.flow-ask-typing { display: flex; gap: 4px; padding: 4px 0; }
.flow-ask-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--flow-cyan); opacity: 0.5; animation: flowBounce 1.4s infinite;
}
.flow-ask-typing span:nth-child(2) { animation-delay: 0.2s; }
.flow-ask-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes flowBounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-5px)} }

/* ── CTA + footer ── */
.flow-cta {
  text-align: center; padding: clamp(4rem, 8vw, 6rem) 1.5rem;
  border-top: 1px solid var(--flow-border);
  background: linear-gradient(180deg, var(--flow-bg2), var(--flow-bg));
  position: relative;
}
.flow-cta::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 100%, oklch(0.82 0.14 195 / 0.06), transparent);
}
.flow-cta h2 {
  font-family: var(--flow-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900;
  margin-bottom: 0.75rem; letter-spacing: -0.02em; position: relative;
}
.flow-cta p { color: var(--flow-w60); margin-bottom: 1.75rem; font-size: 0.92rem; position: relative; }
.flow-footer {
  padding: 2rem clamp(1.5rem, 5vw, 3rem);
  border-top: 1px solid var(--flow-border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: 0.75rem; color: var(--flow-w40);
}
.flow-footer a { color: var(--flow-w60); transition: color 0.2s; }
.flow-footer a:hover { color: var(--flow-cyan); }

/* ═══ AUTH — split layout ═══ */
.flow-auth-screen {
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100dvh;
}
.flow-auth-brand {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2rem, 6vw, 4rem);
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, oklch(0.82 0.14 195 / 0.12), transparent 55%),
    linear-gradient(160deg, oklch(0.13 0.02 255), oklch(0.1 0.015 255));
  border-right: 1px solid var(--flow-border);
  position: relative; overflow: hidden;
}
.flow-auth-brand h1 {
  font-family: var(--flow-display); font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; margin: 1.5rem 0 1rem;
}
.flow-auth-brand h1 em { font-style: normal; color: var(--flow-cyan); }
.flow-auth-brand p {
  font-family: var(--flow-serif); font-style: italic;
  color: var(--flow-w60); font-size: 1.05rem; line-height: 1.65; max-width: 380px;
}
.flow-auth-perks {
  list-style: none; margin-top: 2.5rem; display: flex; flex-direction: column; gap: 14px;
}
.flow-auth-perks li {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.84rem; color: var(--flow-w80);
}
.flow-auth-perk-icon {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: var(--flow-cyan-dim); border: 1px solid var(--flow-border-hi);
  display: flex; align-items: center; justify-content: center; color: var(--flow-cyan);
}
.flow-auth-panel-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 2rem clamp(1.5rem, 4vw, 3rem);
  background: var(--flow-bg);
}
.flow-auth-wrap {
  width: 100%; max-width: 400px;
}
.flow-auth-wrap .flow-logo { margin-bottom: 2rem; display: inline-block; }
.flow-auth-tabs {
  display: flex; gap: 4px; background: var(--flow-w06);
  padding: 4px; border-radius: var(--flow-r); margin-bottom: 1.5rem;
  border: 1px solid var(--flow-border);
}
.flow-auth-tab {
  flex: 1; padding: 10px; border-radius: 9px; font-size: 0.8rem;
  font-weight: 600; color: var(--flow-w40); transition: all 0.2s var(--flow-ease);
}
.flow-auth-tab.active {
  background: var(--flow-cyan-dim); color: var(--flow-cyan);
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.05) inset;
}
.flow-auth-panel { display: none; }
.flow-auth-panel.active { display: block; }
.flow-auth-panel h2 {
  font-family: var(--flow-display); font-size: 1.35rem;
  font-weight: 900; letter-spacing: -0.02em; margin-bottom: 0.35rem;
}
.flow-auth-sub { font-size: 0.84rem; color: var(--flow-w40); margin-bottom: 1.5rem; }
.flow-auth-panel input {
  width: 100%; padding: 13px 16px; margin-bottom: 10px;
  border-radius: var(--flow-r); border: 1px solid var(--flow-border);
  background: oklch(0.1 0.015 255 / 0.5); outline: none; font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.flow-auth-panel input:focus {
  border-color: var(--flow-border-hi);
  box-shadow: 0 0 0 3px oklch(0.82 0.14 195 / 0.1);
}
.flow-auth-submit { width: 100%; margin-top: 8px; }
.flow-auth-error { color: var(--flow-red); font-size: 0.78rem; text-align: center; margin-top: 1rem; min-height: 1.2em; }
.flow-auth-foot { text-align: center; margin-top: 1.5rem; font-size: 0.75rem; }
.flow-auth-foot a { color: var(--flow-w40); }
.flow-auth-foot a:hover { color: var(--flow-cyan); }

/* ═══ DASHBOARD ═══ */
.app-shell { display: none; height: 100dvh; flex-direction: column; }
.app-shell.active { display: flex; }

.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 1.25rem; flex-shrink: 0;
  border-bottom: 1px solid var(--flow-border);
  background: oklch(0.11 0.015 255 / 0.8);
  backdrop-filter: blur(20px) saturate(1.15);
}
.app-topbar-logo {
  font-family: var(--flow-display); font-weight: 900;
  font-size: 0.95rem; letter-spacing: -0.02em;
}
.app-topbar-logo span { color: var(--flow-cyan); }
.app-topbar-right { display: flex; align-items: center; gap: 12px; }
.app-user-label { font-size: 0.78rem; color: var(--flow-w60); }
.app-sub-pill {
  font-size: 0.62rem; font-family: var(--flow-mono); padding: 5px 11px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.08em;
}
.app-sub-pill.active {
  background: oklch(0.72 0.17 145 / 0.12); color: var(--flow-green);
  border: 1px solid oklch(0.72 0.17 145 / 0.25);
}
.app-sub-pill.inactive {
  background: oklch(0.62 0.2 25 / 0.1); color: oklch(0.75 0.12 25);
  border: 1px solid oklch(0.62 0.2 25 / 0.22);
}

.app-body { display: flex; flex: 1; overflow: hidden; }
.app-sidebar {
  width: 240px; flex-shrink: 0;
  border-right: 1px solid var(--flow-border);
  background: oklch(0.12 0.015 255 / 0.6);
  backdrop-filter: blur(12px);
  padding: 1.25rem 0.85rem;
  display: flex; flex-direction: column; gap: 2px;
}
.app-nav-label {
  font-size: 0.6rem; font-family: var(--flow-mono); letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--flow-w40); padding: 0 12px 10px;
}
.app-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: var(--flow-r);
  font-size: 0.82rem; color: var(--flow-w60);
  transition: all 0.2s var(--flow-ease); text-align: left; width: 100%;
  border: 1px solid transparent;
}
.app-nav-item:hover { background: var(--flow-w06); color: var(--flow-white); }
.app-nav-item.active {
  background: var(--flow-cyan-dim); color: var(--flow-cyan);
  border-color: var(--flow-border-hi);
}
.app-nav-item svg { flex-shrink: 0; opacity: 0.75; }
.app-nav-item.active svg { opacity: 1; }
.app-sidebar-footer {
  margin-top: auto; padding-top: 1rem;
  border-top: 1px solid var(--flow-border);
}
.app-sidebar-footer a {
  font-size: 0.72rem; color: var(--flow-w40);
  display: block; padding: 9px 12px; transition: color 0.2s;
}
.app-sidebar-footer a:hover { color: var(--flow-cyan); }

.app-main {
  flex: 1; overflow-y: auto; padding: clamp(1.25rem, 3vw, 2rem);
  background: transparent; position: relative;
}
.app-main::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 40% at 80% 0%, oklch(0.82 0.14 195 / 0.04), transparent 55%);
}
.app-page { display: none; position: relative; z-index: 1; animation: pageIn 0.35s var(--flow-ease); }
.app-page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.app-page-header { margin-bottom: 1.75rem; }
.app-page-title {
  font-family: var(--flow-display); font-size: 1.5rem;
  font-weight: 900; letter-spacing: -0.025em; margin-bottom: 0.35rem;
}
.app-page-desc { font-size: 0.84rem; color: var(--flow-w60); line-height: 1.55; max-width: 560px; }
.app-page-desc strong { color: var(--flow-w80); font-weight: 600; }

.app-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.app-status-dot.on { background: var(--flow-green); box-shadow: 0 0 8px oklch(0.72 0.17 145 / 0.5); }
.app-status-dot.off { background: var(--flow-red); }

/* Cards */
.app-card, .premium-card {
  background: var(--flow-card);
  border: 1px solid var(--flow-border);
  border-radius: var(--flow-r-lg);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset;
  transition: border-color 0.25s;
}
.premium-card:hover { border-color: var(--flow-border-hi); }
.app-card-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.9rem; font-weight: 600; margin-bottom: 1.1rem;
}
.app-card-title svg { color: var(--flow-cyan); }

.app-form-group { margin-bottom: 1.1rem; }
.app-form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--flow-w60);
  margin-bottom: 8px;
  font-family: var(--flow-font);
  letter-spacing: 0.01em;
}
.app-form-group input,
.app-form-group textarea,
.app-form-group select {
  width: 100%; padding: 12px 14px; border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: oklch(0.1 0.015 255 / 0.45);
  color: var(--flow-white); font-size: 0.84rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.app-form-group textarea { resize: vertical; font-family: var(--flow-mono); line-height: 1.5; }
.app-form-group input:focus,
.app-form-group textarea:focus,
.app-form-group select:focus {
  border-color: var(--flow-border-hi);
  box-shadow: 0 0 0 3px oklch(0.82 0.14 195 / 0.08);
}
.app-field-hint { font-size: 0.72rem; color: var(--flow-w40); margin-top: 6px; }
.flow-profile-preview {
  padding: 14px 16px; border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: oklch(0.12 0.02 255 / 0.55);
  font-size: 0.84rem; line-height: 1.6; color: var(--flow-w80);
  min-height: 72px; white-space: pre-wrap;
}
.flow-profile-preview.empty {
  color: var(--flow-w40); font-style: italic;
}

.app-toggle {
  width: 44px; height: 24px; border-radius: 12px; flex-shrink: 0;
  background: var(--flow-w12); position: relative; transition: background 0.25s;
}
.app-toggle.on { background: var(--flow-cyan); }
.app-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform 0.25s var(--flow-ease);
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.3);
}
.app-toggle.on::after { transform: translateX(20px); }
.flow-bot-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}

/* QR connect */
.flow-connect-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start;
}
.flow-qr-card {
  border-radius: var(--flow-r-xl); overflow: hidden;
  border: 1px solid var(--flow-border);
  background: var(--flow-card);
  box-shadow: var(--flow-shadow);
}
.flow-qr-status {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--flow-border);
  font-size: 0.78rem; font-family: var(--flow-mono); color: var(--flow-w60);
}
.flow-qr-body { padding: 2rem 1.75rem; text-align: center; }
.flow-qr-placeholder { color: var(--flow-w40); }
.flow-qr-placeholder .flow-qr-icon-wrap {
  width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 1.25rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--flow-w06); border: 1px solid var(--flow-border);
  color: var(--flow-cyan);
}
.flow-qr-placeholder p { font-size: 0.86rem; margin-bottom: 1.5rem; line-height: 1.55; }
.flow-qr-img-wrap {
  background: #fff; border-radius: 18px; padding: 16px;
  display: inline-block; margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.25);
}
.flow-qr-steps {
  text-align: left; font-size: 0.82rem; color: var(--flow-w60);
  padding-left: 1.25rem; line-height: 1.9;
}
.flow-qr-steps strong { color: var(--flow-white); font-weight: 600; }
.flow-connected-badge {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0.68 0.16 155 / 0.12);
  border: 1px solid oklch(0.68 0.16 155 / 0.28);
  color: var(--flow-wa);
}
.flow-qr-connected h3 {
  font-family: var(--flow-display); font-size: 1.2rem;
  font-weight: 900; margin-bottom: 0.5rem;
}
.flow-qr-connected p { font-size: 0.84rem; color: var(--flow-w60); line-height: 1.55; }

.flow-connect-info {
  display: flex; flex-direction: column; gap: 12px;
}
.flow-info-card {
  padding: 1.15rem 1.25rem; border-radius: var(--flow-r-lg);
  background: var(--flow-card); border: 1px solid var(--flow-border);
}
.flow-info-card h4 {
  font-size: 0.78rem; font-family: var(--flow-mono);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--flow-w40); margin-bottom: 6px;
}
.flow-info-card p { font-size: 0.84rem; color: var(--flow-w80); line-height: 1.5; }

/* Inbox */
.flow-inbox-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: 14px;
  min-height: calc(100dvh - 180px);
}
.flow-inbox-list {
  background: var(--flow-card); border: 1px solid var(--flow-border);
  border-radius: var(--flow-r-lg); overflow-y: auto;
}
.flow-inbox-empty {
  padding: 2rem 1.5rem; font-size: 0.82rem; color: var(--flow-w40);
  text-align: center; line-height: 1.55;
}
.flow-inbox-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 13px 15px; border: none;
  border-bottom: 1px solid var(--flow-border);
  background: none; text-align: left; cursor: pointer;
  transition: background 0.15s;
}
.flow-inbox-item:hover, .flow-inbox-item.active {
  background: var(--flow-cyan-dim);
}
.flow-inbox-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: oklch(0.68 0.16 155 / 0.12);
  color: var(--flow-wa); font-weight: 700; font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid oklch(0.68 0.16 155 / 0.2);
}
.flow-inbox-info { flex: 1; min-width: 0; }
.flow-inbox-info strong {
  display: block; font-size: 0.84rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.flow-inbox-info span {
  display: block; font-size: 0.72rem; color: var(--flow-w40);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.flow-inbox-time {
  font-size: 0.62rem; color: var(--flow-w40);
  font-family: var(--flow-mono); flex-shrink: 0;
}
.flow-inbox-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.flow-inbox-refresh-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: oklch(0.14 0.02 255 / 0.6);
  color: var(--flow-w80); font-size: 0.78rem; font-weight: 500;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.flow-inbox-refresh-btn:hover {
  background: var(--flow-cyan-dim);
  border-color: oklch(0.68 0.16 155 / 0.35);
  color: var(--flow-wa);
}
.flow-inbox-refresh-btn.spinning i {
  animation: flow-spin 0.8s linear infinite;
}
@keyframes flow-spin {
  to { transform: rotate(360deg); }
}

.flow-chat-panel {
  background: var(--flow-card); border: 1px solid var(--flow-border);
  border-radius: var(--flow-r-lg);
  display: flex; flex-direction: column; overflow: hidden;
  min-height: 480px;
}
.flow-chat-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--flow-w40); gap: 0.85rem; padding: 2rem;
}
.flow-chat-active { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.flow-chat-head {
  padding: 14px 18px; border-bottom: 1px solid var(--flow-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: oklch(0.1 0.015 255 / 0.3);
}
.flow-chat-head-info {
  display: flex; align-items: baseline; gap: 10px; min-width: 0;
}
.flow-chat-head strong { font-size: 0.92rem; font-weight: 600; }
.flow-chat-head span { font-size: 0.72rem; color: var(--flow-w40); font-family: var(--flow-mono); }
.flow-chat-delete-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: var(--flow-r);
  border: 1px solid oklch(0.55 0.18 25 / 0.35);
  background: oklch(0.55 0.18 25 / 0.08);
  color: oklch(0.72 0.16 25); font-size: 0.72rem; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
  flex-shrink: 0;
}
.flow-chat-delete-btn:hover {
  background: oklch(0.55 0.18 25 / 0.18);
}
.flow-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 300px;
}
.flow-chat-bubble {
  max-width: 78%; padding: 11px 14px; border-radius: 16px;
  font-size: 0.86rem; line-height: 1.55; word-break: break-word;
  text-wrap: pretty;
}
.flow-chat-bubble.in {
  align-self: flex-start;
  background: oklch(0.17 0.02 255);
  border: 1px solid var(--flow-border);
  border-radius: 16px 16px 16px 4px;
}
.flow-chat-bubble.out {
  align-self: flex-end;
  background: oklch(0.68 0.16 155 / 0.14);
  border: 1px solid oklch(0.68 0.16 155 / 0.22);
  border-radius: 16px 16px 4px 16px;
}
.flow-chat-send {
  display: flex; gap: 10px; padding: 14px 16px;
  border-top: 1px solid var(--flow-border);
  background: oklch(0.1 0.015 255 / 0.35);
}
.flow-chat-send input {
  flex: 1; padding: 12px 16px; border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: oklch(0.1 0.015 255 / 0.5);
  outline: none; font-size: 0.86rem;
}
.flow-chat-send input:focus { border-color: var(--flow-border-hi); }
.flow-chat-send button {
  width: 44px; height: 44px; border-radius: var(--flow-r);
  background: var(--flow-wa); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, filter 0.15s;
}
.flow-chat-send button:hover { transform: scale(1.04); filter: brightness(1.08); }

/* Bulk */
.flow-bulk-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px;
}
.flow-bulk-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.1rem;
}
.flow-bulk-stat {
  text-align: center; padding: 14px 10px; border-radius: var(--flow-r);
  background: oklch(0.1 0.015 255 / 0.4); border: 1px solid var(--flow-border);
}
.flow-bulk-stat-num {
  display: block; font-size: 1.5rem; font-weight: 900;
  color: var(--flow-cyan); font-family: var(--flow-display);
  letter-spacing: -0.02em;
}
.flow-bulk-stat-label {
  font-size: 0.62rem; color: var(--flow-w40);
  text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--flow-mono);
}
.flow-bulk-bar-wrap {
  height: 5px; border-radius: 3px;
  background: var(--flow-w06); overflow: hidden; margin-bottom: 0.75rem;
}
.flow-bulk-bar {
  height: 100%; width: 0; border-radius: 3px;
  background: var(--flow-cyan);
  transition: width 0.45s var(--flow-ease);
}
.flow-bulk-status-text { font-size: 0.82rem; color: var(--flow-w60); }
.flow-bulk-errors { margin-top: 0.75rem; }
.flow-bulk-err {
  font-size: 0.72rem; color: oklch(0.75 0.12 25);
  padding: 7px 11px; margin-top: 5px;
  background: oklch(0.62 0.2 25 / 0.08); border-radius: 8px;
  font-family: var(--flow-mono);
}

/* Subscription banner + modal */
.flow-sub-banner {
  margin-bottom: 1.25rem; padding: 13px 17px; border-radius: var(--flow-r-lg);
  background: oklch(0.62 0.2 25 / 0.08);
  border: 1px solid oklch(0.62 0.2 25 / 0.2);
  color: oklch(0.78 0.1 25); font-size: 0.84rem; line-height: 1.55;
}
.flow-sub-banner.warn {
  background: oklch(0.82 0.14 95 / 0.08);
  border-color: oklch(0.82 0.14 95 / 0.22);
  color: oklch(0.88 0.1 95);
}
.flow-sub-banner strong { color: var(--flow-white); }

.flow-modal-bg {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: oklch(0.05 0.02 255 / 0.88);
  backdrop-filter: blur(16px) saturate(1.1);
  align-items: center; justify-content: center; padding: 1.5rem;
}
.flow-modal-bg.open { display: flex; }
.flow-modal.premium-modal {
  width: 100%; max-width: 420px;
  background: var(--flow-card);
  border: 1px solid var(--flow-border-hi);
  border-radius: var(--flow-r-xl); padding: 2.25rem 2rem;
  box-shadow: var(--flow-shadow), var(--flow-glow);
  text-align: center;
}
.flow-modal-lock {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 1.1rem;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0.62 0.2 25 / 0.1);
  border: 1px solid oklch(0.62 0.2 25 / 0.2);
  color: oklch(0.78 0.1 25);
}
.flow-modal h3 {
  font-family: var(--flow-display);
  font-size: 1.4rem; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 0.65rem;
}
.flow-modal-text {
  font-size: 0.88rem; color: var(--flow-w60); line-height: 1.65; margin-bottom: 1.35rem;
}
.flow-modal-features {
  list-style: none; text-align: left; margin-bottom: 1.5rem;
  padding: 1rem 1.1rem; border-radius: var(--flow-r);
  background: oklch(0.1 0.015 255 / 0.4); border: 1px solid var(--flow-border);
}
.flow-modal-features li {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem; color: var(--flow-w80); padding: 7px 0;
}
.flow-modal-features svg { color: var(--flow-green); flex-shrink: 0; }
.flow-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.flow-modal-actions .flow-btn { width: 100%; }

.sub-inactive .app-nav-item:not([data-page="connect"]) { opacity: 0.42; }
.sub-inactive .app-nav-item:not([data-page="connect"]):hover { opacity: 0.65; }

.flow-save-hint { font-size: 0.75rem; color: var(--flow-green); margin-left: 12px; }

.flow-commerce-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.flow-catalog-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1.6fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: start;
}
.flow-catalog-row input,
.flow-catalog-row textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--flow-r);
  border: 1px solid var(--flow-border);
  background: oklch(0.1 0.015 255 / 0.45);
  color: var(--flow-white);
  font-size: 0.8rem;
  font-family: var(--flow-font);
}
.flow-catalog-row textarea { min-height: 38px; resize: vertical; }
.flow-catalog-del {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid oklch(0.62 0.2 25 / 0.25);
  background: oklch(0.62 0.2 25 / 0.08);
  color: var(--flow-red); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.flow-leads-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1rem;
  align-items: start;
}
.flow-lead-q-row {
  display: flex; gap: 8px; margin-bottom: 8px; align-items: center;
}
.flow-lead-q-row input { flex: 1; }
.flow-lead-q-row button {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--flow-border);
  background: transparent; color: var(--flow-red); cursor: pointer;
}
.flow-leads-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.flow-leads-table-wrap { overflow-x: auto; }
.flow-leads-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
}
.flow-leads-table th,
.flow-leads-table td {
  text-align: left; padding: 10px 8px;
  border-bottom: 1px solid var(--flow-border);
  vertical-align: top;
}
.flow-leads-table th {
  color: var(--flow-w40); font-weight: 600; font-size: 0.72rem;
}
.flow-leads-empty {
  color: var(--flow-w40); font-size: 0.82rem; text-align: center; padding: 2rem 1rem;
}
.flow-lead-details { color: var(--flow-w60); line-height: 1.45; max-width: 220px; }

/* Responsive */
@media (max-width: 960px) {
  .flow-hero { grid-template-columns: 1fr; text-align: center; }
  .flow-hero-content { text-align: center; }
  .flow-hero-lead { margin-left: auto; margin-right: auto; }
  .flow-hero-actions { justify-content: center; }
  .flow-hero-visual { max-width: 480px; margin: 0 auto; }
  .flow-stats { grid-template-columns: repeat(2, 1fr); }
  .flow-features { grid-template-columns: 1fr 1fr; }
  .flow-channels { grid-template-columns: repeat(2, 1fr); }
  .flow-auth-screen { grid-template-columns: 1fr; }
  .flow-auth-brand { display: none; }
  .flow-connect-layout { grid-template-columns: 1fr; }
  .flow-inbox-layout { grid-template-columns: 1fr; }
  .flow-bulk-grid { grid-template-columns: 1fr; }
  .flow-commerce-grid { grid-template-columns: 1fr; }
  .flow-leads-layout { grid-template-columns: 1fr; }
  .flow-catalog-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .flow-features { grid-template-columns: 1fr; }
  .flow-ask-suggestions { grid-template-columns: 1fr; }
  .flow-nav-links a:not(.flow-btn) { display: none; }
  .app-sidebar { width: 64px; padding: 0.75rem 0.35rem; }
  .app-nav-label, .app-sidebar-footer, .app-nav-item span { display: none; }
  .app-nav-item { justify-content: center; padding: 12px; }
  .flow-bulk-stats { grid-template-columns: repeat(2, 1fr); }
}
