:root {
  /* ── Palette ──────────────────────────────── */
  --bg-root: #0B0D10;
  --bg-surface: #151A22;
  --bg-surface-secondary: #1B212B;
  --bg-hover: #232B37;
  --border-subtle: rgba(255,255,255,.05);
  --border-card: rgba(255,255,255,.06);

  /* ── Accent (Content People) ──────────────── */
  --accent: #FF6B00;
  --accent-hover: #FF8C1A;
  --accent-gradient: linear-gradient(135deg, #FF6B00, #FF8C1A);
  --accent-dim: rgba(255,107,0,.12);
  --accent-glow: 0 0 30px rgba(255,107,0,.15);

  /* ── Semantic ─────────────────────────────── */
  --green: #22C55E;
  --green-dim: rgba(34,197,94,.12);
  --red: #EF4444;
  --red-dim: rgba(239,68,68,.12);
  --blue: #3B82F6;
  --blue-dim: rgba(59,130,246,.12);
  --purple: #A855F7;
  --purple-dim: rgba(168,85,247,.12);

  /* ── Text ──────────────────────────────────── */
  --text-primary: rgba(255,255,255,.92);
  --text-secondary: rgba(255,255,255,.55);
  --text-muted: rgba(255,255,255,.32);
  --text-accent: #FF6B00;

  /* ── Typography ────────────────────────────── */
  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  --text-hero: 28px;
  --text-section: 20px;
  --text-card: 18px;
  --text-body: 15px;
  --text-caption: 13px;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* ── Radius ────────────────────────────────── */
  --radius-card: 20px;
  --radius-button: 16px;
  --radius-player: 24px;
  --radius-input: 16px;
  --radius-lg: 28px;

  /* ── Shadows ───────────────────────────────── */
  --shadow-card: 0 12px 40px rgba(0,0,0,.35);
  --shadow-glow: 0 0 60px rgba(255,107,0,.06);
  --shadow-elevated: 0 20px 60px rgba(0,0,0,.45);

  /* ── Spacing ───────────────────────────────── */
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 32px;

  /* ── Animation ─────────────────────────────── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 400ms;

  /* ── Layout ────────────────────────────────── */
  --max-width: 420px;
}

/* ── Reset ──────────────────────────────────── */

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-root);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  line-height: 1.5;
}

body {
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: var(--max-width);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-root);
  position: relative;
  overflow: hidden;
}

#app-header { flex-shrink: 0; }
#app-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
#app-content::-webkit-scrollbar { width: 0; }
#app-tabbar { flex-shrink: 0; }

/* ── Shared ──────────────────────────────────── */

.screen {
  padding: var(--space-xl);
  animation: fadeUp var(--duration-normal) var(--ease-out);
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .6; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Skeleton loading ───────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface-secondary) 25%, var(--bg-hover) 50%, var(--bg-surface-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

/* ── Card base ───────────────────────────────── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(255,255,255,.015) 0%, transparent 70%);
  pointer-events: none;
}

.card:active {
  transform: scale(.98);
  background: var(--bg-hover);
}

/* ── Buttons ─────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  letter-spacing: -0.2px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(255,107,0,.25);
}

.btn-primary:active {
  transform: scale(.98);
  box-shadow: 0 2px 10px rgba(255,107,0,.15);
}

.btn-secondary {
  background: var(--bg-surface-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:active {
  background: var(--bg-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}

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

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: var(--text-caption); }

/* ── Input ───────────────────────────────────── */

.input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  outline: none;
  transition: all var(--duration-normal) var(--ease-out);
}

.input:focus {
  border-color: rgba(255,107,0,.3);
  box-shadow: 0 0 0 3px rgba(255,107,0,.08);
}

.input::placeholder {
  color: var(--text-muted);
}

/* ── Section ─────────────────────────────────── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-title {
  font-size: var(--text-section);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: var(--text-caption);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Badge ───────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: var(--weight-semibold);
}

.badge-accent { background: var(--accent-dim); color: var(--accent); }
.badge-green  { background: var(--green-dim); color: var(--green); }
.badge-blue   { background: var(--blue-dim); color: var(--blue); }

/* ── Divider ─────────────────────────────────── */

.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-xl) 0;
}

/* ── Empty state ─────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px var(--space-xl);
  color: var(--text-muted);
}

.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: .6; }
.empty-state-text { font-size: var(--text-body); line-height: 1.6; }

/* ── Spinner / Pulsing indicator ─────────────── */

.ai-pulse {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  margin: 0 auto;
  animation: aiPulse 2s var(--ease-out) infinite;
  box-shadow: var(--accent-glow);
}

@keyframes aiPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.08); opacity: .8; }
}

/* ── Toast ───────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface-secondary);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-button);
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  z-index: 1000;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  animation: toastIn .3s var(--ease-out);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Scrollbar hide ──────────────────────────── */

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
