/* ============================================================
   Cloak Design System — Web Surface
   Adapted from Sovereign Executive / Architectural Ledger tokens
   ============================================================ */

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

/* --- Tokens --- */
:root {
  --bg-0: #09090B;
  --bg-1: #0F0F12;
  --bg-2: #161619;
  --bg-3: #1C1C20;
  --bg-4: #232328;

  --border-subtle: #1E1E23;
  --border: #27272D;
  --border-strong: #38383F;

  --text-0: #F5F5F4;
  --text-1: #D4D4D3;
  --text-2: #8E8E93;
  --text-3: #5C5C62;

  --accent: #C9A87C;
  --accent-hover: #D4B88E;
  --accent-dim: rgba(201,168,124,.10);
  --accent-text: #111;

  --success: #4ADE80;
  --error: #F87171;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', monospace;

  --ease: cubic-bezier(.4,0,.2,1);
  --dur: 160ms;

  --radius: 6px;
  --radius-lg: 10px;
}

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Global Cursor Spotlight ──────────────────────────────── */
.cursor-glow {
  position: fixed;
  width: 500px; height: 500px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  background: radial-gradient(circle, rgba(201,168,124,0.045) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  opacity: 0;
  will-change: left, top;
}
.cursor-glow.active { opacity: 1; }
.cursor-glow.donate-mode {
  background: radial-gradient(circle, rgba(255,107,107,0.05) 0%, transparent 70%);
}

/* ── Universal Hover Micro-Animations ─────────────────────── */
.btn { transition: all 0.25s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(201,168,124,0.2);
}
.btn-secondary:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
}

.btn-icon {
  background: none; border: none; padding: 6px;
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: all var(--ease);
}
.btn-icon:hover {
  color: var(--accent);
  background: var(--surface-1);
}

.tpl-vanguard {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

/* Chat bubbles */
.chat-bubble { transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.chat-bubble:hover { transform: translateX(2px); }
.chat-bubble.system:hover { transform: translateX(-2px); }

/* ATS keyword tags */
.ats-gap-tag, .ats-match-tag { transition: all 0.2s var(--ease); }
.ats-gap-tag:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(248,113,113,0.2); }
.ats-match-tag:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(74,222,128,0.15); }

/* Donate chips */
.donate-chip { transition: all 0.25s ease, transform 0.2s ease; }
.donate-chip:hover { transform: translateY(-2px) scale(1.05); }

/* Nav links */
.nav-links a { transition: color 0.2s var(--ease), transform 0.2s var(--ease); }
.nav-links a:hover { transform: translateY(-1px); }

/* Review cards */
.review-card { transition: all 0.35s var(--ease); }

/* Upload zone */
.upload-zone { transition: all 0.25s var(--ease); }
.upload-zone:hover { transform: scale(1.01); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* --- Views --- */
.view { display: none; min-height: 100vh; }
.view.active { display: flex; flex-direction: column; }

/* --- Navigation --- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 56px;
  background: rgba(9,9,11,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-brand {
  font-size: 1.05rem; font-weight: 600; letter-spacing: -.02em;
  color: var(--text-0);
}
.nav-brand span { color: var(--text-3); font-weight: 400; margin-left: 6px; font-size: .8rem; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  font-size: .8rem; color: var(--text-2); font-weight: 450;
  transition: color var(--dur) var(--ease);
}
.nav-links a:hover { color: var(--text-0); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border: none; border-radius: var(--radius);
  font-family: var(--font); font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: all var(--dur) var(--ease);
  line-height: 1.4;
}
.btn-primary {
  background: var(--accent); color: var(--accent-text);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary {
  background: transparent; color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-strong); color: var(--text-0); }
.btn-ghost {
  background: transparent; color: var(--text-2); padding: 8px 14px;
}
.btn-ghost:hover { color: var(--text-0); background: var(--bg-3); }
.btn:disabled { opacity: .45; pointer-events: none; }

/* Beautiful Donate Button */
.btn-donate {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  color: #ffffff !important;
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 14px rgba(255, 107, 107, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-donate::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: all 0.5s ease;
}
.btn-donate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}
.btn-donate:hover::before {
  left: 100%;
}
.donate-banner {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.donate-banner::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 150px; height: 100%;
  background: radial-gradient(circle at right, rgba(255, 107, 107, 0.05) 0%, transparent 70%);
  pointer-events: none;
}
.donate-banner-text {
  flex: 1;
}
.donate-banner-text strong {
  font-size: 0.95rem;
  color: var(--text-0);
  margin-bottom: 4px;
  display: block;
}

/* ============================================================
   DONATE OVERLAY — Unique Full-Screen Experience
   ============================================================ */
.donate-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: none;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1a0a0a 0%, #0d0608 40%, #080408 100%);
  overflow: hidden;
}
.donate-overlay.visible { display: flex; }

#donate-hearts-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

.donate-ambient-top {
  position: absolute; top: -20%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(circle, rgba(255, 107, 107, 0.08) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.donate-ambient-bottom {
  position: absolute; bottom: -10%; left: 30%;
  width: 500px; height: 300px;
  background: radial-gradient(circle, rgba(255, 142, 83, 0.05) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

.donate-close-x {
  position: absolute; top: 24px; right: 24px;
  z-index: 10;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}
.donate-close-x:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.donate-content {
  position: relative; z-index: 2;
  max-width: 420px; width: 90%;
  text-align: center;
}

.donate-step { }

.donate-heart-pulse {
  font-size: 4rem;
  display: inline-block;
  margin-bottom: 20px;
  animation: donateHeartbeat 1.8s infinite cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.4));
}
.donate-thankyou-icon {
  font-size: 3.5rem;
  display: inline-block;
  margin-bottom: 16px;
  animation: donateFloat 3s ease-in-out infinite;
}

@keyframes donateHeartbeat {
  0%, 100% { transform: scale(1); }
  10% { transform: scale(1.2); }
  20% { transform: scale(1); }
  30% { transform: scale(1.15); }
  40%, 100% { transform: scale(1); }
}
@keyframes donateFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.donate-headline {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 16px 0;
  line-height: 1.15;
}
.donate-headline span {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 50%, #FFD93D 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.donate-story {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
  margin: 0 0 28px 0;
}

/* ── Amount Chips — Warm Palette ── */
.donate-amounts {
  display: flex; gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}
.donate-chip {
  padding: 10px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font);
}
.donate-chip:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}
.donate-chip.active {
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(255, 107, 107, 0.35);
}

/* ── Donate Buttons ── */
.donate-actions {
  display: flex; flex-direction: column;
  gap: 12px; align-items: center;
}

.donate-btn-main {
  width: 100%; padding: 14px 24px;
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  color: #fff; font-weight: 600; font-size: 1rem;
  border: none; border-radius: 12px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 24px rgba(255, 107, 107, 0.3);
  transition: all 0.3s ease;
  position: relative; overflow: hidden;
  font-family: var(--font);
}
.donate-btn-main::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s ease;
}
.donate-btn-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 107, 107, 0.4);
}
.donate-btn-main:hover::before {
  left: 100%;
}

.donate-btn-skip {
  background: none; border: none;
  color: rgba(255,255,255,0.35);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.3s ease;
  font-family: var(--font);
}
.donate-btn-skip:hover { color: rgba(255,255,255,0.6); }

/* ── QR Section ── */
.donate-qr-wrap {
  margin-bottom: 24px;
}
.donate-qr-inner {
  background: #fff;
  padding: 18px;
  border-radius: 16px;
  display: inline-block;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  margin-bottom: 12px;
}
.donate-qr-inner img {
  width: 200px; height: 200px; display: block;
}
.donate-upi-id {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-family: 'JetBrains Mono', monospace;
}

.donate-pay-mobile {
  margin-bottom: 12px;
}

/* Modal Animations */
.animate-up {
  opacity: 0;
  animation: slideUpFade 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Keep old amount-chip for backward compat (unused now) */
.amount-chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.amount-chip.active {
  background: var(--accent);
  color: var(--accent-text) !important;
  border-color: var(--accent);
}

.score-circle-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 32px auto;
}
.score-circle-glow {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(24px);
  opacity: 0.15;
  transition: all 1s ease;
}
.score-circle {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 8px rgba(0,0,0,0.5));
}
.score-circle-bg {
  fill: none;
  stroke: var(--bg-3);
  stroke-width: 8;
}
.score-circle-prog {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s ease;
}
.score-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  z-index: 2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  transition: color 0.5s ease;
}
.premium-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.premium-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: var(--text-1);
  line-height: 1.5;
}
.premium-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--text-3);
  font-size: 1.2rem;
  top: -2px;
}
.premium-cta-box {
  background: linear-gradient(145deg, var(--bg-2) 0%, var(--bg-1) 100%);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 20px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}
.premium-cta-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}

/* ============================================================
   LANDING
   ============================================================ */
#view-landing {
  justify-content: center; align-items: center;
  padding: 56px 40px 40px;
  overflow-y: auto; min-height: 100vh;
  position: relative;
}

/* ── Particle Canvas ─────────────────────────────────────── */
#particle-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Ambient Glow ────────────────────────────────────────── */
.landing-glow {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    600px circle at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(201, 168, 124, 0.06) 0%,
    transparent 60%
  );
  transition: opacity 0.3s ease;
  opacity: 0;
}
.landing-glow.active {
  opacity: 1;
}

.landing-inner {
  max-width: 720px; width: 100%;
  display: flex; flex-direction: column; align-items: flex-start;
  position: relative;
  z-index: 1;
}

.landing-tag {
  font-size: .75rem; font-weight: 500; color: var(--accent);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.landing-tag::before {
  content: ''; width: 20px; height: 1px; background: var(--accent); display: block;
}

.landing-h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 650; line-height: 1.1; letter-spacing: -.035em;
  color: var(--text-0); margin-bottom: 22px;
}
.landing-h1 em {
  font-style: normal; color: var(--accent);
}

.landing-sub {
  font-size: 1.05rem; color: var(--text-2); line-height: 1.65;
  max-width: 520px; margin-bottom: 36px;
}

.landing-actions { display: flex; gap: 14px; margin-bottom: 64px; }

.landing-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  width: 100%; background: var(--border-subtle); border-radius: var(--radius-lg);
  overflow: visible;
  perspective: 1000px;
}
.feature-card {
  background: var(--bg-1); padding: 28px 24px;
  transition: background 0.3s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
  overflow: hidden;
}
.feature-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(
    250px circle at var(--card-x, 50%) var(--card-y, 50%),
    rgba(201, 168, 124, 0.08) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.feature-card:hover::after { opacity: 1; }
.feature-card:hover {
  background: var(--bg-2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(201, 168, 124, 0.05);
  z-index: 2;
}
.feature-label {
  font-size: .7rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3); margin-bottom: 8px;
}
.feature-value {
  font-size: 1.5rem; font-weight: 600; color: var(--text-0);
  letter-spacing: -.02em; margin-bottom: 6px;
}
.feature-desc { font-size: .8rem; color: var(--text-2); line-height: 1.5; }

/* ============================================================
   CHAT
   ============================================================ */
#view-chat {
  padding-top: 56px; height: 100vh;
  flex-direction: row;
}

.chat-main {
  flex: 1; display: flex; flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  min-width: 0;
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(201,168,124,0.03) 0%, transparent 60%),
    var(--bg-0);
}

/* ── Chat Header ─────────────────────────────────────────── */
.chat-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: rgba(15, 15, 18, 0.6);
  backdrop-filter: blur(16px);
  position: relative;
}
.chat-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 28px; right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,124,0.3), transparent);
}
.chat-header-title {
  font-size: .85rem; font-weight: 500; color: var(--text-1);
}
.chat-header-badge {
  margin-left: auto; font-size: .7rem; font-weight: 500;
  padding: 3px 10px; border-radius: 99px;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(201,168,124,0.15);
}

/* ── Status dot (online indicator) ───────────────────────── */
.chat-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(74,222,128,0.4);
  animation: statusPulse 2s var(--ease) infinite;
  flex-shrink: 0;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(74,222,128,0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 4px rgba(74,222,128,0.2); }
}

/* ── Chat Messages ───────────────────────────────────────── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 28px;
  display: flex; flex-direction: column; gap: 24px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--border) 0%, rgba(201,168,124,0.3) 100%);
  border-radius: 99px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(201,168,124,0.5);
}

/* ── Message Layout ──────────────────────────────────────── */
.msg {
  max-width: 82%;
  animation: msgSlideIn 0.35s var(--ease);
  display: flex;
  flex-direction: column;
}
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-assistant { align-self: flex-start; align-items: flex-start; }

/* ── Message Label (with avatar) ─────────────────────────── */
.msg-label {
  font-size: .68rem; color: var(--text-3); margin-bottom: 6px;
  font-weight: 500; letter-spacing: .03em;
  display: flex; align-items: center; gap: 6px;
}
.msg-user .msg-label { flex-direction: row-reverse; }
.msg-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
  flex-shrink: 0;
}
.msg-user .msg-avatar {
  background: linear-gradient(135deg, var(--accent) 0%, #8B7355 100%);
  color: var(--accent-text);
}
.msg-assistant .msg-avatar {
  background: linear-gradient(135deg, var(--bg-4) 0%, var(--bg-3) 100%);
  color: var(--accent);
  border: 1px solid var(--border);
}

/* ── Message Bubbles ─────────────────────────────────────── */
.msg-bubble {
  padding: 14px 18px; border-radius: 16px;
  font-size: .88rem; line-height: 1.65;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  position: relative;
}
.msg-bubble:hover {
  transform: translateY(-1px);
}

/* User bubble — gradient with glow */
.msg-user .msg-bubble {
  background: linear-gradient(135deg, var(--accent) 0%, #B8944F 50%, #A07D3F 100%);
  color: var(--accent-text);
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 16px rgba(201,168,124,0.15);
}
.msg-user .msg-bubble:hover {
  box-shadow: 0 6px 24px rgba(201,168,124,0.25);
}

/* Assistant bubble — glassmorphic */
.msg-assistant .msg-bubble {
  background: rgba(22, 22, 28, 0.7);
  backdrop-filter: blur(12px);
  color: var(--text-1);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.msg-assistant .msg-bubble:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.msg-assistant .msg-bubble p { margin-bottom: 10px; }
.msg-assistant .msg-bubble p:last-child { margin-bottom: 0; }
.msg-assistant .msg-bubble strong { color: var(--accent); font-weight: 600; }
.msg-assistant .msg-bubble ul,
.msg-assistant .msg-bubble ol { padding-left: 18px; margin: 8px 0; }
.msg-assistant .msg-bubble li { margin-bottom: 4px; }
.msg-assistant .msg-bubble li::marker { color: var(--accent); }
.msg-assistant .msg-bubble code {
  font-family: var(--mono); font-size: .82em;
  background: rgba(201,168,124,0.08); padding: 2px 6px; border-radius: 4px;
  color: var(--accent);
  border: 1px solid rgba(201,168,124,0.1);
}
.msg-assistant .msg-bubble a {
  color: var(--accent); text-decoration: underline;
  text-decoration-color: rgba(201,168,124,0.3);
  text-underline-offset: 2px;
}
.msg-assistant .msg-bubble a:hover {
  text-decoration-color: var(--accent);
}

/* ── Typing Indicator ────────────────────────────────────── */
.typing-indicator {
  align-self: flex-start; padding: 14px 22px;
  background: rgba(22, 22, 28, 0.7);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid var(--border);
  display: none; gap: 4px; align-items: center;
  animation: msgSlideIn 0.3s var(--ease);
}
.typing-indicator.visible { display: flex; }
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: typingWave 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingWave {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Chat Input ──────────────────────────────────────────── */
.chat-input-area {
  padding: 16px 28px 20px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: rgba(15, 15, 18, 0.4);
  backdrop-filter: blur(8px);
  position: relative;
}
.chat-input-area::before {
  content: '';
  position: absolute;
  top: 0; left: 28px; right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,124,0.2), transparent);
}
.chat-input-wrap {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px 6px 6px 18px;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  position: relative;
}
.chat-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,168,124,0.08), 0 4px 20px rgba(0,0,0,0.2);
}

#chat-input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--text-0); font-family: var(--font); font-size: .88rem;
  resize: none; min-height: 24px; max-height: 120px;
  line-height: 1.5; padding: 6px 0;
}
#chat-input::placeholder { color: var(--text-3); }

#btn-send {
  flex-shrink: 0; width: 38px; height: 38px;
  border-radius: 10px; border: none;
  background: linear-gradient(135deg, var(--accent) 0%, #A07D3F 100%);
  color: var(--accent-text);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.25s var(--ease);
  box-shadow: 0 2px 8px rgba(201,168,124,0.2);
}
#btn-send:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #B8944F 100%);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(201,168,124,0.3);
}
#btn-send:active:not(:disabled) {
  transform: scale(0.95);
}
#btn-send:disabled {
  opacity: .3; cursor: default;
  background: var(--bg-4);
  box-shadow: none;
}
#btn-send svg { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
#btn-send:hover:not(:disabled) svg { transform: translateX(1px); }

/* ── Preview Panel ───────────────────────────────────────── */
.preview-panel {
  width: 380px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg-1);
  position: relative;
}
.preview-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(15, 15, 18, 0.6);
  backdrop-filter: blur(16px);
  position: relative;
}
.preview-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,124,0.2), transparent);
}
.preview-header-title {
  font-size: .8rem; font-weight: 500; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; gap: 8px;
}
.preview-header-title::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(201,168,124,0.4);
}
.preview-body {
  flex: 1; overflow-y: auto; padding: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(201,168,124,0.02) 0%, transparent 50%),
    var(--bg-0);
  display: flex; justify-content: center; align-items: flex-start;
}
.preview-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%;
  color: var(--text-3); font-size: .82rem; text-align: center;
  line-height: 1.6;
  padding: 40px 20px;
}
.preview-empty::before {
  content: '';
  display: block;
  width: 48px; height: 48px;
  margin-bottom: 16px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  opacity: 0.4;
}

/* True Live Preview - Sovereign Executive */
.true-preview-paper {
  background: #F9F9F7; color: #1A1A2E;
  width: 100%; max-width: 320px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  font-family: 'Helvetica', 'Inter', sans-serif;
  line-height: 1.4; font-size: 7.5px;
  border-radius: 2px; transition: all 0.3s ease;
  transform-origin: top center;
  animation: paperIn 0.5s var(--ease);
}
.tp-header, .tp-section {
  animation: slideUpFade 0.4s var(--ease) backwards;
}
.tp-section:nth-child(2) { animation-delay: 0.05s; }
.tp-section:nth-child(3) { animation-delay: 0.1s; }
.tp-section:nth-child(4) { animation-delay: 0.15s; }
.tp-section:nth-child(5) { animation-delay: 0.2s; }
.tp-section:nth-child(6) { animation-delay: 0.25s; }
.tp-header {
  text-align: center; border-bottom: 1px solid #1A1A2E;
  padding-bottom: 6px; margin-bottom: 10px;
}
.tp-name {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 3px;
}
.tp-contact { font-size: 6.5px; color: #333; }
.tp-section { margin-bottom: 8px; }
.tp-section-title {
  font-size: 8.5px; font-weight: 700; text-transform: uppercase;
  border-bottom: 0.5px solid #1A1A2E;
  margin-bottom: 4px; padding-bottom: 2px; letter-spacing: 0.5px;
}
.tp-summary { font-size: 7px; text-align: justify; }
.tp-item { margin-bottom: 5px; }
.tp-item-header { display: flex; justify-content: space-between; align-items: baseline; }
.tp-item-title { font-weight: 700; font-size: 7.5px; }
.tp-item-date { font-size: 6.5px; color: #444; }
.tp-item-sub { font-size: 7px; font-style: italic; margin-bottom: 2px; }
.tp-bullets { padding-left: 10px; font-size: 7px; margin-top: 2px; }
.tp-bullets li { margin-bottom: 1.5px; }
.tp-skills { font-size: 7px; }
.tp-skill-line { margin-bottom: 1.5px; }

/* Vanguard Style overrides */
.tpl-vanguard {
  color: #1A332B; /* Deep Forest Green */
}
.tpl-vanguard .tp-header {
  text-align: left;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tpl-vanguard .tp-header-text {
  flex: 1;
}
.tpl-vanguard .tp-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #A5C5B5;
}
.tpl-vanguard .tp-name {
  text-transform: none;
}
.tpl-vanguard .tp-section-title {
  border-bottom: 0.5px solid #A5C5B5;
}

/* ============================================================
   TEMPLATE PICKER  — Premium 3D Redesign
   ============================================================ */
#view-onboarding,
#view-template {
  padding-top: 56px; align-items: center;
  position: relative;
}

/* ── Particle Canvas (same as landing) ── */
#template-particle-canvas,
#onboarding-particle-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Ambient Mouse Glow ── */
.template-glow {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    600px circle at var(--tpl-glow-x, 50%) var(--tpl-glow-y, 50%),
    rgba(201, 168, 124, 0.06) 0%,
    transparent 60%
  );
  transition: opacity 0.3s ease;
  opacity: 0;
}
.template-glow.active { opacity: 1; }

.template-inner {
  max-width: 920px; width: 100%; padding: 48px 40px;
  position: relative;
  z-index: 1;
}

.template-tag {
  font-size: .75rem; font-weight: 500; color: var(--accent);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.template-tag::before {
  content: ''; width: 20px; height: 1px; background: var(--accent); display: block;
}

.template-heading {
  font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 650; letter-spacing: -.03em;
  margin-bottom: 6px; line-height: 1.1; color: var(--text-0);
}
.template-heading em {
  font-style: normal; color: var(--accent);
}
.template-sub {
  font-size: 1rem; color: var(--text-2); margin-bottom: 40px; line-height: 1.6;
  max-width: 520px;
}

/* ── Template Cards Grid ── */
.template-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 48px;
  perspective: 1000px;
}

.template-card {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0;
  cursor: pointer; transition: all 0.35s var(--ease);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}
.template-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(
    300px circle at var(--card-x, 50%) var(--card-y, 50%),
    rgba(201, 168, 124, 0.08) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.template-card:hover::before { opacity: 1; }
.template-card:hover {
  border-color: var(--border-strong); background: var(--bg-2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(201, 168, 124, 0.05);
  z-index: 2;
}
.template-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(201, 168, 124, 0.12);
}

.template-card-img-wrap {
  width: 100%;
  aspect-ratio: 8.5 / 11;
  background: var(--surface-1);
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.template-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.template-card:hover .template-card-img {
  transform: scale(1.05);
}

.template-card-content {
  padding: 20px;
  background: var(--bg-1);
  flex: 1;
}
.template-card.selected .template-card-content {
  background: var(--accent-dim);
}
.template-card-name {
  font-size: .95rem; font-weight: 600; margin-bottom: 6px; color: var(--text-0);
}
.template-card-desc {
  font-size: .82rem; color: var(--text-2); line-height: 1.55; margin-bottom: 14px;
}
.template-card-ats {
  font-size: .72rem; font-weight: 600; color: var(--accent);
  letter-spacing: .03em;
  display: flex; align-items: center; gap: 6px;
}
.template-card-ats::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 6px rgba(201, 168, 124, 0.5);
}
.template-card-check {
  position: absolute;
  top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--bg-0);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.8);
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 10;
}
.template-card.selected .template-card-check {
  opacity: 1; transform: scale(1);
}

/* ── ATS Section — Glassmorphism ── */
.ats-section {
  background: linear-gradient(145deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  margin-bottom: 32px;
  position: relative; overflow: hidden;
}
.ats-section::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.2;
}
.ats-section-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: var(--accent);
}
.ats-section-title {
  font-size: .95rem; font-weight: 600; margin-bottom: 4px;
}
.ats-section-sub {
  font-size: .82rem; color: var(--text-2); margin-bottom: 16px;
}

/* ── Download Section — Premium Card ── */
.download-section {
  background: linear-gradient(145deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 32px;
  position: relative; overflow: hidden;
}
.download-section::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.2;
}
.download-section-inner {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 20px;
}
.download-icon-wrap {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.download-icon-wrap::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 18px;
  background: var(--accent);
  filter: blur(14px);
  opacity: 0.12;
  z-index: -1;
}
.download-title {
  font-size: 1.05rem; font-weight: 600; color: var(--text-0); margin-bottom: 4px;
}
.download-desc {
  font-size: .85rem; color: var(--text-2); line-height: 1.5;
}
.download-actions {
  display: flex; gap: 12px; align-items: center;
}
.btn-download-main {
  box-shadow: 0 0 20px rgba(201, 168, 124, 0.15);
  transition: all 0.3s var(--ease);
}
.btn-download-main:hover {
  box-shadow: 0 0 30px rgba(201, 168, 124, 0.25);
  transform: translateY(-1px);
}

/* ── Donate Banner Glow ── */
.donate-glow-orb {
  position: absolute;
  top: -20px; right: 20%;
  width: 120px; height: 120px;
  background: var(--accent);
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.06;
  pointer-events: none;
}

#jd-input {
  width: 100%; min-height: 100px; padding: 12px 14px;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-0);
  font-family: var(--font); font-size: .82rem; line-height: 1.6;
  resize: vertical; outline: none;
  transition: border-color var(--dur) var(--ease);
}
#jd-input:focus { border-color: var(--accent); }
#jd-input::placeholder { color: var(--text-3); }
.ats-actions { margin-top: 12px; display: flex; gap: 10px; align-items: center; }
.ats-result {
  margin-top: 16px; padding: 16px; background: var(--bg-1);
  border-radius: var(--radius); display: none;
}
.ats-result.visible { display: block; }
.ats-score {
  font-size: 1.3rem; font-weight: 700; margin-bottom: 8px;
}
.ats-score.good { color: var(--success); }
.ats-score.mid { color: #FBBF24; }
.ats-score.low { color: var(--error); }
.ats-gaps { margin-top: 10px; }
.ats-gap-tag {
  display: inline-block; padding: 3px 10px; margin: 3px 4px 3px 0;
  background: rgba(248,113,113,.1); color: var(--error);
  font-size: .75rem; border-radius: 4px; font-weight: 500;
}
.ats-match-tag {
  display: inline-block; padding: 3px 10px; margin: 3px 4px 3px 0;
  background: rgba(74,222,128,.08); color: var(--success);
  font-size: .75rem; border-radius: 4px; font-weight: 500;
}

/* Tailor result */
.tailor-result {
  display: none; margin-top: 16px; padding: 20px;
  background: var(--bg-1); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  animation: slideUpFade 0.3s var(--ease);
}
.tailor-result.visible { display: block; }
.tailor-result.loading {
  display: block;
  background: linear-gradient(90deg, var(--bg-1) 25%, var(--bg-2) 50%, var(--bg-1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.tailor-result-title {
  font-size: .85rem; font-weight: 600; color: var(--accent);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.tailor-result-desc {
  font-size: .82rem; color: var(--text-2); line-height: 1.6;
  margin-bottom: 14px;
}
.tailor-changes {
  display: flex; flex-direction: column; gap: 8px;
}
.tailor-change-item {
  font-size: .78rem; color: var(--text-1); line-height: 1.5;
  padding: 8px 12px;
  background: var(--bg-2); border-radius: var(--radius);
  border-left: 2px solid var(--accent);
}
.tailor-change-label {
  font-size: .68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent); margin-bottom: 4px;
}
.tailor-actions {
  display: flex; gap: 10px; margin-top: 16px;
}

.download-status {
  font-size: .82rem; color: var(--text-2); display: none;
  margin-top: 12px;
}
.download-status.visible { display: block; }

/* ============================================================
   FILE UPLOAD MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.visible { display: flex; }
.modal-box {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  max-width: 440px; width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.modal-desc { font-size: .82rem; color: var(--text-2); margin-bottom: 20px; line-height: 1.6; }
.upload-zone {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: all var(--dur) var(--ease);
  margin-bottom: 16px;
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-dim); }
.upload-zone-text { font-size: .82rem; color: var(--text-2); }
.upload-zone-hint { font-size: .72rem; color: var(--text-3); margin-top: 6px; }
#file-input { display: none; }

/* ============================================================
   ERROR CARD
   ============================================================ */
.error-card {
  padding: 14px 18px; border-radius: var(--radius);
  background: rgba(248,113,113,.06);
  border: 1px solid rgba(248,113,113,.15);
}
.error-card-title {
  font-size: .78rem; font-weight: 600; color: var(--text-1);
  margin-bottom: 4px;
}
.error-card-msg {
  font-size: .82rem; color: var(--text-2); line-height: 1.5;
  margin-bottom: 10px;
}
.error-retry-btn {
  font-family: var(--font); font-size: .75rem; font-weight: 500;
  padding: 5px 14px; border-radius: var(--radius);
  background: var(--bg-3); color: var(--text-1);
  border: 1px solid var(--border); cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.error-retry-btn:hover {
  background: var(--bg-4); color: var(--text-0); border-color: var(--border-strong);
}

/* ============================================================
   REVIEWS SECTION
   ============================================================ */
.reviews-section {
  width: 100%;
  margin-top: 64px;
}
.reviews-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.reviews-tag {
  font-size: .75rem; font-weight: 500; color: var(--accent);
  letter-spacing: .06em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.reviews-tag::before {
  content: ''; width: 20px; height: 1px; background: var(--accent); display: block;
}
.btn-leave-review {
  font-size: .75rem !important;
  padding: 6px 14px !important;
}
.reviews-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  width: 100%;
}
.reviews-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 40px 20px;
  color: var(--text-3); font-size: .85rem;
}

.review-card {
  background: rgba(15, 15, 18, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.4s var(--ease), transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  animation: slideUpFade 0.4s var(--ease) backwards;
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.review-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(
    200px circle at var(--card-x, 50%) var(--card-y, 50%),
    rgba(201, 168, 124, 0.06) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.review-card:hover::after { opacity: 1; }
.review-card:nth-child(2) { animation-delay: 0.08s; }
.review-card:nth-child(3) { animation-delay: 0.16s; }
.review-card:hover {
  border-color: var(--border-strong);
  background: rgba(22, 22, 25, 0.8);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(201, 168, 124, 0.04);
  z-index: 2;
}
.review-card-stars {
  display: flex; gap: 2px; margin-bottom: 12px;
}
.review-card-star {
  color: var(--accent); font-size: 14px; line-height: 1;
}
.review-card-star.empty {
  color: var(--text-3); opacity: 0.3;
}
.review-card-comment {
  font-size: .84rem; color: var(--text-1); line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.review-card-footer {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.review-card-name {
  font-size: .78rem; font-weight: 600; color: var(--text-0);
}
.review-card-meta {
  font-size: .68rem; color: var(--text-3);
}

/* ── Review Modal ─────────────────────────────────────────── */
.review-stars {
  display: flex; gap: 6px; justify-content: center;
  margin: 20px 0 8px;
}
.review-star {
  font-size: 32px; color: var(--text-3); cursor: pointer;
  transition: all 0.15s var(--ease);
  opacity: 0.3;
  user-select: none;
}
.review-star.active {
  color: var(--accent); opacity: 1;
  transform: scale(1.15);
}
.review-star:hover {
  color: var(--accent); opacity: 0.7;
  transform: scale(1.1);
}
.review-star-label {
  text-align: center; font-size: .78rem; color: var(--text-3);
  margin-bottom: 20px; min-height: 18px;
}
.review-input,
.review-textarea {
  width: 100%; box-sizing: border-box;
  padding: 10px 14px;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-0);
  font-family: var(--font); font-size: .85rem;
  outline: none; transition: border-color var(--dur) var(--ease);
}
.review-input:focus,
.review-textarea:focus { border-color: var(--accent); }
.review-input { margin-bottom: 12px; }
.review-textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
.review-input::placeholder,
.review-textarea::placeholder { color: var(--text-3); }
.review-feedback {
  text-align: center; font-size: .82rem; margin-top: 12px;
  min-height: 20px; color: var(--success);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes paperIn {
  from { opacity: 0; transform: scale(0.98) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes typePulse {
  0%, 80%, 100% { opacity: .3; transform: scale(.85); }
  40% { opacity: 1; transform: scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroFloat {
  from { opacity: 0; transform: translateY(30px) translateZ(-40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) translateZ(0) scale(1); }
}
@keyframes tagSlide {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes featureRise {
  from { opacity: 0; transform: translateY(40px) rotateX(8deg); }
  to   { opacity: 1; transform: translateY(0) rotateX(0deg); }
}
.landing-tag { animation: tagSlide 0.6s var(--ease) 0.1s backwards; }
.landing-h1 { animation: heroFloat 0.7s var(--ease) 0.2s backwards; }
.landing-sub { animation: heroFloat 0.7s var(--ease) 0.35s backwards; }
.landing-actions { animation: heroFloat 0.6s var(--ease) 0.5s backwards; }
.landing-features { animation: featureRise 0.8s var(--ease) 0.65s backwards; }
.reviews-section { animation: featureRise 0.8s var(--ease) 0.85s backwards; }
.fade-in { animation: fadeIn .35s var(--ease); }
.slide-up { animation: slideUp .4s var(--ease); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  #view-chat { flex-direction: column; }
  .chat-main { 
    height: 55vh; flex: none; 
    border-right: none; 
    border-bottom: 1px solid var(--border-subtle); 
  }
  .preview-panel { 
    width: 100%; height: 45vh; flex: none; 
    display: flex;
  }
  .landing-features { grid-template-columns: 1fr; }
  .reviews-grid { grid-template-columns: 1fr; }
  .site-nav { padding: 0 20px; }
  #view-landing { padding: 56px 20px 40px; height: auto; min-height: 100vh; overflow-y: auto; }
  .template-inner { padding: 32px 20px; }
  .msg { max-width: 90%; }
}
@media (max-width: 600px) {
  .landing-h1 { font-size: 2rem; }
  .landing-actions { flex-direction: column; width: 100%; }
  .landing-actions .btn { width: 100%; justify-content: center; }
  .chat-messages { padding: 16px; gap: 18px; }
  .chat-input-area { padding: 12px 16px 16px; }
  .chat-input-area::before { left: 16px; right: 16px; }
  .chat-header::after { left: 16px; right: 16px; }
  .template-grid { grid-template-columns: 1fr; }
  .chat-header-badge { display: none; }
  .chat-header-title { font-size: 0.75rem; }
  .chat-status-dot { display: none; }
  .msg-bubble { padding: 12px 14px; font-size: .84rem; }
  .msg-avatar { width: 16px; height: 16px; font-size: 8px; }
}
