/* Cake automation — fintech-minimal design system */

:root {
  /* Neutrals (cool slate) */
  --bg: #F7F7F5;  /* warm cream (Canva/Linear-style) */
  --bg-elevated: #FFFFFF;
  --bg-subtle: #F7F8FA;
  --bg-muted: #F1F2F5;
  --border: #E6E8EC;
  --border-strong: #D5D8DE;
  --text: #0B0D12;
  --text-secondary: #474B55;
  --text-muted: #8A8F99;
  --text-faint: #B5B8BF;

  /* Accent — orange (matches onboarding) */
  --accent: #F97316;
  --accent-hover: #EA580C;
  --accent-pressed: #C2410C;
  --accent-soft: #FFEDD5;
  --accent-soft-2: #FED7AA;
  --accent-text: #FFFFFF;
  --focus-ring: rgba(249, 115, 22, 0.32);

  /* Semantic */
  --success: #10A968;
  --success-soft: #E6F7EE;
  --warning: #D97706;
  --warning-soft: #FEF3E2;
  --danger: #DC2626;
  --danger-soft: #FDECEC;

  /* Brand colors for social */
  --instagram: #E4405F;
  --facebook: #1877F2;
  --linkedin: #0A66C2;
  --pinterest: #E60023;
  --google: #4285F4;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;
  --r-full: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(11, 13, 18, 0.04);
  --shadow-sm: 0 1px 3px rgba(11, 13, 18, 0.06), 0 1px 2px rgba(11, 13, 18, 0.04);
  --shadow-md: 0 4px 12px rgba(11, 13, 18, 0.06), 0 2px 4px rgba(11, 13, 18, 0.04);
  --shadow-lg: 0 12px 28px rgba(11, 13, 18, 0.08), 0 4px 10px rgba(11, 13, 18, 0.04);
  --shadow-xl: 0 24px 56px rgba(11, 13, 18, 0.10), 0 8px 16px rgba(11, 13, 18, 0.04);

  /* Type scale */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Inter Display", "Inter", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0A0B0F;
  --bg-elevated: #111319;
  --bg-subtle: #14161D;
  --bg-muted: #1A1D26;
  --border: #23262F;
  --border-strong: #2E323D;
  --text: #F2F3F5;
  --text-secondary: #B5B8BF;
  --text-muted: #7B7F8A;
  --text-faint: #555964;

  --accent: #FB923C;
  --accent-hover: #FDBA74;
  --accent-pressed: #F97316;
  --accent-soft: #2A1A0A;
  --accent-soft-2: #3D2410;
  --accent-text: #0A0B0F;
  --focus-ring: rgba(251, 146, 60, 0.40);

  --success: #34D399;
  --success-soft: #0F2A20;
  --warning: #F59E0B;
  --warning-soft: #2A1F0A;
  --danger: #F87171;
  --danger-soft: #2A1414;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 24px 56px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  transition: background-color 200ms ease, color 200ms ease;
}

#root { min-height: 100vh; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--bg-subtle); border-color: var(--border-strong); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }

.btn-lg { height: 44px; padding: 0 18px; font-size: 14.5px; border-radius: var(--r-lg); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

/* Input */
.input, .textarea, .select-trigger {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.textarea { height: auto; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.input:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select-trigger:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.helper {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.field { margin-bottom: 16px; }

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-muted);
  color: var(--text-secondary);
}
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-warning { background: var(--warning-soft); color: var(--warning); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Display headings */
.h-display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.1;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 280ms ease both; }
.slide-up { animation: slideUp 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 0%, var(--bg-subtle) 40%, var(--bg-muted) 80%);
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--r-sm);
}

.spinner {
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* App layout */
.app-shell {
  display: grid;
  grid-template-columns: auto 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}
.main {
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
}

.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.18);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.015em;
}

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.workspace-switcher:hover { background: var(--bg-subtle); border-color: var(--border-strong); }

.ws-avatar {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #FF8A65, #E4405F);
  color: white;
  font-weight: 600;
  font-size: 11px;
  display: grid; place-items: center;
  flex-shrink: 0;
}

.ws-info { flex: 1; min-width: 0; }
.ws-name { font-size: 12.5px; font-weight: 500; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-plan { font-size: 11px; color: var(--text-muted); }

.nav-section {
  margin-top: 4px;
}
.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  color: var(--text-muted);
  padding: 12px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.nav-item:hover { background: var(--bg-subtle); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active svg { color: var(--accent); }
.nav-item .nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.user-tile {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 120ms ease;
}
.user-tile:hover { background: var(--bg-subtle); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FB923C, #F97316);
  color: white;
  font-size: 11.5px;
  font-weight: 600;
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* Main content */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.topbar-spacer { flex: 1; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  width: 240px;
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
}
.topbar-search:hover { border-color: var(--border-strong); }
.kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.page {
  padding: 28px 32px 64px;
  flex: 1;
  animation: fadeIn 240ms ease both;
}
.page-narrow { max-width: 1180px; margin: 0 auto; width: 100%; }

.page-header { margin-bottom: 24px; }
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
  line-height: 1.5;
}

/* Auth screens */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}

.auth-form-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 56px;
}
.auth-form-inner {
  max-width: 380px;
  width: 100%;
  margin: auto;
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
}

.auth-art-side {
  position: relative;
  background: var(--bg-subtle);
  border-left: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art-side { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* Divider with text */
.divider-text {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 18px 0;
}
.divider-text::before, .divider-text::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

/* Social buttons */
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 120ms ease, border-color 120ms ease;
  cursor: pointer;
}
.social-btn:hover { background: var(--bg-subtle); border-color: var(--border-strong); }

/* Onboarding wizard */
.onb-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg);
}
.onb-side {
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.onb-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 120ms ease;
}
.onb-step:hover { background: var(--bg-muted); }
.onb-step.active { background: var(--bg-elevated); box-shadow: var(--shadow-xs); }
.onb-step-num {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all 200ms ease;
}
.onb-step.active .onb-step-num {
  background: var(--accent); color: var(--accent-text); border-color: var(--accent);
}
.onb-step.done .onb-step-num {
  background: var(--success); color: white; border-color: var(--success);
}
.onb-step-label { font-size: 13px; font-weight: 500; line-height: 1.3; }
.onb-step-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.onb-step.active .onb-step-label { color: var(--text); }

.onb-main {
  display: flex; flex-direction: column;
  overflow-y: auto;
  height: 100vh;
}
.onb-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg);
  z-index: 5;
}
.onb-progress {
  flex: 1;
  max-width: 220px;
  margin: 0 24px;
  height: 4px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}
.onb-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.onb-content {
  flex: 1;
  padding: 48px 32px 80px;
  display: flex;
  justify-content: center;
}
.onb-form {
  max-width: 560px;
  width: 100%;
  animation: slideUp 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.onb-step-eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.onb-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
  margin: 0 0 8px;
}
.onb-subtitle {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.5;
  margin-bottom: 28px;
}

.onb-footer {
  padding: 16px 32px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg);
  position: sticky; bottom: 0;
}

/* Tile picker (radio cards) */
.tile-grid {
  display: grid; gap: 10px;
}
.tile {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.tile:hover { border-color: var(--border-strong); }
.tile.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.tile-check {
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  margin-top: 1px;
  display: grid; place-items: center;
  transition: all 120ms ease;
}
.tile.selected .tile-check {
  border-color: var(--accent);
  background: var(--accent);
}
.tile.selected .tile-check::after {
  content: ""; width: 6px; height: 6px; border-radius: 999px; background: white;
}
.tile-body { flex: 1; min-width: 0; }
.tile-title { font-size: 13.5px; font-weight: 500; }
.tile-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

/* Multi-checkbox tiles */
.tile-check-square {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  margin-top: 1px;
  display: grid; place-items: center;
  transition: all 120ms ease;
}
.tile.selected .tile-check-square {
  border-color: var(--accent);
  background: var(--accent);
}

/* Color swatch */
.swatch {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  position: relative;
}
.swatch:hover { transform: scale(1.06); }
.swatch.selected {
  box-shadow: 0 0 0 3px var(--bg-elevated), 0 0 0 5px var(--accent);
}

/* Tags input */
.tag-input {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  min-height: 40px;
  align-items: center;
}
.tag-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px;
  padding: 0 4px 0 10px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
.tag-x {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.7;
}
.tag-x:hover { opacity: 1; background: rgba(249, 115, 22, 0.15); }
.tag-input input {
  flex: 1; min-width: 80px;
  border: none; outline: none; background: transparent;
  font-size: 13.5px;
}

/* Social account row */
.social-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color 120ms ease, background 120ms ease;
}
.social-row + .social-row { margin-top: 8px; }
.social-row.connected { background: var(--bg-elevated); border-color: var(--border); }
.social-icon-wrap {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  flex-shrink: 0;
  color: white;
  font-weight: 600;
}
.si-instagram { background: linear-gradient(135deg, #FBAA47 0%, #D62976 50%, #962FBF 100%); }
.si-facebook { background: var(--facebook); }
.si-linkedin { background: var(--linkedin); }
.si-pinterest { background: var(--pinterest); }
.si-google { background: var(--google); }

.social-row-body { flex: 1; min-width: 0; }
.social-row-name { font-size: 14px; font-weight: 500; }
.social-row-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* Toggle */
.toggle {
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 160ms ease;
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: white;
  box-shadow: var(--shadow-xs);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }

/* Stats row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.stat-delta {
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* Calendar */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.cal-cell {
  background: var(--bg-elevated);
  min-height: 116px;
  padding: 8px;
  position: relative;
  cursor: pointer;
  transition: background 120ms ease;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-cell:hover { background: var(--bg-subtle); }
.cal-cell.outside { background: var(--bg-subtle); color: var(--text-faint); }
.cal-cell.today { background: var(--accent-soft); }
.cal-day-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.cal-cell.today .cal-day-num { color: var(--accent); font-weight: 600; }
.cal-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 8px 0;
}
.cal-header-cell {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

.cal-event {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
  font-weight: 500;
  background: var(--bg-muted);
  color: var(--text);
  cursor: pointer;
  transition: background 100ms ease;
  line-height: 1.2;
}
.cal-event:hover { background: var(--accent-soft); }
.cal-event.scheduled { background: var(--accent-soft); color: var(--accent); }
.cal-event.published { background: var(--success-soft); color: var(--success); }
.cal-event.draft { background: var(--bg-muted); color: var(--text-secondary); border: 1px dashed var(--border-strong); }
.cal-event-dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.cal-event-time { font-variant-numeric: tabular-nums; opacity: 0.7; font-size: 10.5px; }
.cal-event-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Editor */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: flex-start;
}
.editor-canvas {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 20px;
}
.editor-side {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 16px;
  position: sticky;
  top: 76px;
}

.preview-frame {
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  justify-content: center;
}

/* IG-style post preview */
.ig-post {
  width: 320px;
  background: white;
  border-radius: 8px;
  border: 1px solid #DBDBDB;
  font-family: var(--font-sans);
  color: #262626;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ig-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.ig-avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FBAA47, #D62976);
  padding: 1.5px;
}
.ig-avatar-inner {
  width: 100%; height: 100%;
  border-radius: 999px;
  background: white;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: #262626;
}
.ig-handle { font-weight: 600; flex: 1; font-size: 13px; }
.ig-image {
  width: 320px; height: 320px;
  background: #F0F0F0;
  position: relative;
  overflow: hidden;
}
.ig-actions { padding: 8px 12px; display: flex; gap: 14px; }
.ig-likes { padding: 0 12px; font-size: 13px; font-weight: 600; }
.ig-caption { padding: 4px 12px 12px; font-size: 13px; line-height: 1.4; }
.ig-caption .ig-handle-inline { font-weight: 600; margin-right: 6px; }

/* AI generation animated placeholder */
.ai-canvas {
  width: 100%; aspect-ratio: 1; max-width: 320px;
  border-radius: var(--r-md);
  background: var(--bg-muted);
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
}
.ai-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(249, 115, 22, 0.15) 50%, transparent 70%);
  background-size: 300% 100%;
  animation: shimmer 1.6s infinite linear;
}

/* Generated mock image — striped placeholder */
.mock-img {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.04) 0 1px, transparent 1px 14px);
}

/* Pill tabs */
.pill-tabs {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-muted);
  border-radius: var(--r-md);
  gap: 2px;
}
.pill-tab {
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 120ms ease;
}
.pill-tab.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.pill-tab:hover:not(.active) { color: var(--text); }

/* Mini chart sparkline area */
.spark {
  height: 56px;
  width: 100%;
  margin-top: 12px;
}

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 20px; right: 20px;
  display: flex; flex-direction: column-reverse; gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  animation: slideUp 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  max-width: 360px;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 13, 18, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: grid; place-items: center;
  animation: fadeIn 200ms ease both;
  padding: 20px;
}
[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, 0.6); }
.modal {
  background: var(--bg-elevated);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  max-width: 460px;
  width: 100%;
  padding: 24px;
  animation: slideUp 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Auth illustration */
.auth-illustration {
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1.05;
  position: relative;
}
.auth-illust-card {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 14px;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Step transitions */
.step-enter { animation: slideUp 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* Switch row */
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.switch-row + .switch-row { margin-top: 8px; }

/* Upload zone */
.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 28px 20px;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Plan cards */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.plan-card {
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  position: relative;
}
.plan-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.plan-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.plan-card.featured::before {
  content: "Recommended";
  position: absolute;
  top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.plan-name { font-size: 13.5px; font-weight: 500; color: var(--text-secondary); }
.plan-price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 8px 0 4px;
}
.plan-price small { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.plan-feats {
  list-style: none;
  padding: 16px 0 0;
  margin: 0;
  border-top: 1px solid var(--border);
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.plan-feats li {
  font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
}

/* Floating accent dots in art side */
.float-dot {
  position: absolute;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.45;
}

/* Dashboard activity feed */
.feed-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-icon {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--bg-muted);
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.feed-text { font-size: 13px; line-height: 1.45; flex: 1; }
.feed-time { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* Section title */
.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 4px;
}
.section-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

/* Two-col grid for dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}

/* Theme transition wrapper */
.theme-tx, .theme-tx * {
  transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease;
}

/* Hide stuff in light/dark when needed */
[data-theme="dark"] .ig-post {
  background: #161618;
  border-color: #2A2A2D;
  color: #F2F2F2;
}
[data-theme="dark"] .ig-post .ig-image { background: #232325; }
[data-theme="dark"] .ig-avatar-inner { background: #161618; color: #F2F2F2; }

/* Schedule timeline (post editor) */
.schedule-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-elevated);
}
.schedule-row.selected { border-color: var(--accent); background: var(--accent-soft); }

.tone-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 120ms ease;
}
.tone-pill:hover { border-color: var(--border-strong); }
.tone-pill.selected { background: var(--accent); color: white; border-color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════
   CAKE TECH/AI VISUAL LAYER v2 — additive, all selectors safety-verified
   Layout never touched. Just color, depth, motion to feel AI/tech and
   differentiate from Later. Every rule here uses valid CSS only — no
   experimental background-clip tricks.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Signature AI gradient — orange → magenta → violet (Cake's spectrum) */
  --cake-grad: linear-gradient(135deg, #FB923C 0%, #F97316 50%, #EA580C 100%);
  --cake-grad-h: linear-gradient(90deg, #FB923C 0%, #F97316 50%, #EA580C 100%);
  --cake-grad-soft: linear-gradient(135deg, rgba(251,146,60,0.10) 0%, rgba(249,115,22,0.12) 50%, rgba(234,88,12,0.10) 100%);
  --cake-magenta: #EA580C;
  --cake-violet: #C2410C;
  --cake-glow: 0 8px 24px -6px rgba(249,115,22,0.45);
  --cake-live: #22D3A4;
}

/* ── Subtle tech dot-grid background on the whole app ────────────────── */
html, body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(11,13,18,0.04) 1px, transparent 0);
  background-size: 22px 22px;
  background-attachment: fixed;
}
[data-theme="dark"] html, [data-theme="dark"] body {
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);
}

/* ── Primary button gets gradient + neon glow ────────────────────────── */
.btn-primary {
  background: var(--cake-grad);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 1px 2px rgba(11,13,18,0.08),
    0 4px 16px -4px rgba(249,115,22,0.40);
  transition: filter 140ms ease, box-shadow 140ms ease;
}
.btn-primary:hover {
  background: var(--cake-grad);
  filter: brightness(1.06) saturate(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    0 6px 22px -4px rgba(249,115,22,0.50);
}

/* ── Pulsing AI "live" dot — usable anywhere via className="live-dot" ── */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--cake-live);
  box-shadow: 0 0 0 0 rgba(34,211,164,0.55);
  animation: cake-live-pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  flex-shrink: 0;
  vertical-align: middle;
}
@keyframes cake-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,211,164,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(34,211,164,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,211,164,0); }
}

/* ── Mono font on technical bits — counts, times, IDs, shortcuts ────── */
.stat-value, .cal-event-time, .ws-plan, .kbd, .mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "ss01";
}

/* ── Frosted topbar — premium tech feel ──────────────────────────────── */
.topbar {
  background: rgba(247, 247, 245, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
}
[data-theme="dark"] .topbar { background: rgba(10, 11, 15, 0.72); }
.topbar-title { letter-spacing: -0.02em; font-weight: 700; }

/* ── Sharper modal backdrop with cool blur ───────────────────────────── */
.modal-backdrop {
  background: rgba(11, 13, 18, 0.55);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
          backdrop-filter: blur(6px) saturate(120%);
}

/* ── Toggle on uses gradient ─────────────────────────────────────────── */
.toggle.on { background: var(--cake-grad); }

/* ── Tone pill selected = gradient ───────────────────────────────────── */
.tone-pill.selected {
  background: var(--cake-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px -3px rgba(249,115,22,0.45);
}

/* ── Selected tiles & plan cards get magenta ring (no fragile bg trick) */
.tile.selected {
  border-color: var(--cake-magenta);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.18);
}
.plan-card.selected {
  border-color: var(--cake-magenta);
  box-shadow:
    0 0 0 2px rgba(249,115,22,0.20),
    0 12px 28px -10px rgba(249,115,22,0.30);
}
.schedule-row.selected {
  border-color: var(--cake-magenta);
  background: var(--bg-elevated);
}

/* ── Plan "Recommended" badge gradient ───────────────────────────────── */
.plan-card.featured::before {
  background: var(--cake-grad);
  box-shadow: 0 4px 12px -2px rgba(249,115,22,0.45);
  letter-spacing: 0.04em;
  font-weight: 700;
}

/* ── Calendar scheduled event keeps cam soft, add subtle ring ────────── */
.cal-event.scheduled {
  box-shadow: inset 0 0 0 1px rgba(249,115,22,0.22);
}

/* ── Upload zone hover = magenta dashed + soft gradient bg ───────────── */
.upload-zone:hover {
  border-color: var(--cake-magenta);
  background: var(--cake-grad-soft);
}

/* ── Tag chip inner border for crispness ─────────────────────────────── */
.tag { box-shadow: inset 0 0 0 1px rgba(249,115,22,0.18); }

/* ── Spinner uses magenta/orange dual color ──────────────────────────── */
.spinner {
  border-color: rgba(249,115,22,0.18);
  border-right-color: var(--cake-magenta);
  border-top-color: #F97316;
}

/* ── Slimmer scrollbar with gradient on hover ────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #FB923C 0%, #EA580C 100%);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ── Focus ring — soft dual gradient halo ────────────────────────────── */
.btn:focus-visible, .input:focus, .textarea:focus, .select-trigger:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(249,115,22,0.16),
    0 0 0 4px rgba(249,115,22,0.16);
}

/* ── Brand mark inline-style override is in app-shell.jsx ─────────────
     (CSS can't easily override inline style without !important; we set
      the gradient directly in JSX to keep specificity natural.) */

