/* WiserFin — premium app layout */
:root {
  --wf-sidebar-w: 272px;
  --wf-indigo: #4f46e5;
  --wf-indigo-2: #6366f1;
  --wf-indigo-soft: rgba(99,102,241,0.09);
  --wf-bg: #f6f7fb;
  --wf-card: #ffffff;
  --wf-text: #0f172a;
  --wf-muted: #64748b;
  --wf-border: #e5e7eb;
  --wf-green: #10b981;
  --wf-red: #f43f5e;
  --wf-amber: #f59e0b;
  --wf-header-h: 74px;
}

* { box-sizing: border-box; }

body.wf-app {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--wf-bg);
  color: var(--wf-text);
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════
   WELCOME SCREEN — no-scroll, data-rich layout
   ═══════════════════════════════════════════════════ */
body.wf-app:not(.wf-has-data) {
  height: 100vh;
  overflow: hidden;
}
body.wf-app:not(.wf-has-data) .wf-app-main {
  height: 100vh;
  overflow: hidden;
}
body.wf-app:not(.wf-has-data) .wf-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 14px 22px 10px;
  display: flex;
  flex-direction: column;
}
body.wf-app:not(.wf-has-data) .wf-disclaimer {
  flex-shrink: 0;
  padding: 6px 22px 10px;
}

/* Welcome root: facts bar on top, body grid fills rest */
.wf-welcome {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  animation: wf-fade-up 0.5s ease-out both;
}

/* ── Facts bar ── */
.wf-facts-bar {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--wf-border);
  border-radius: 12px;
  padding: 0;
  flex-shrink: 0;
  overflow: hidden;
}
.wf-fact-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 12px;
}
.wf-fact-chip strong {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--wf-text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.wf-fact-chip span {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--wf-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.wf-fact-sep {
  width: 1px;
  height: 28px;
  background: var(--wf-border);
  flex-shrink: 0;
}

/* ── Main body grid ── */
.wf-body-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
  overflow: hidden;
}

/* ── Left: hero gradient card ── */
.wf-hero-card {
  position: relative;
  background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 55%, #db2777 100%);
  border-radius: 18px;
  padding: 26px 28px;
  color: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: wf-pulse-glow 6s ease-in-out infinite;
}
.wf-hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.wf-hero-card-inner { position: relative; z-index: 1; }

.wf-hero-h2 {
  margin: 10px 0 8px;
  font-size: clamp(1.1rem, 1.7vw, 1.55rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: #fff;
}
.wf-hero-desc {
  margin: 0 0 14px;
  font-size: 0.84rem;
  line-height: 1.55;
  opacity: 0.9;
  max-width: 50ch;
  color: #fff;
}
.wf-hero-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.wf-hero-pill {
  padding: 4px 10px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.26);
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── Right: data column ── */
.wf-data-col {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

/* Spending preview */
.wf-spend-card {
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow: hidden;
}
.wf-spend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.wf-spend-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--wf-text);
}
.wf-spend-tag {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--wf-indigo-soft);
  color: var(--wf-indigo);
  padding: 3px 8px;
  border-radius: 999px;
}
.wf-spend-note {
  margin: 0;
  font-size: 0.65rem;
  color: var(--wf-muted);
  text-align: center;
  flex-shrink: 0;
}

/* 2×2 insight tiles */
.wf-insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}
.wf-insight-tile {
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 12px;
  padding: 11px 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wf-insight-tile:hover {
  border-color: rgba(99,102,241,0.32);
  box-shadow: 0 3px 10px rgba(15,23,42,0.06);
}
.wf-insight-tile--indigo {
  background: linear-gradient(135deg, rgba(99,102,241,0.07), rgba(139,92,246,0.05));
  border-color: rgba(99,102,241,0.2);
}
.wf-insight-tile--green {
  background: linear-gradient(135deg, rgba(16,185,129,0.07), rgba(5,150,105,0.05));
  border-color: rgba(16,185,129,0.2);
}
.wf-insight-num {
  font-size: 1.12rem;
  font-weight: 900;
  color: var(--wf-text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.wf-insight-label {
  font-size: 0.63rem;
  color: var(--wf-muted);
  font-weight: 600;
  margin-top: 3px;
  line-height: 1.35;
}

/* ── Mobile: simplify ── */
@media (max-width: 900px) {
  .wf-body-grid { grid-template-columns: 1fr; }
  .wf-data-col { display: none; }
  body.wf-app:not(.wf-has-data) .wf-hero-card { border-radius: 14px; padding: 22px 20px; }
}
@media (max-width: 600px) {
  .wf-facts-bar { display: none; }
}

/* Main area shifts right when sidebar is permanent (desktop) */
.wf-app-main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .wf-app-main { margin-left: var(--wf-sidebar-w); }
}

/* ═══ HEADER (sticky) ═══ */
.wf-top {
  height: var(--wf-header-h);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wf-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.wf-top-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wf-top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.wf-top-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 12px;
  border-radius: 10px;
  font-family: inherit;
  color: inherit;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.wf-top-title:hover { background: rgba(99,102,241,0.06); }

.wf-top-title h1 {
  margin: 0;
  font-size: clamp(1.22rem, 1.75vw, 1.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.wf-top-title p,
.wf-powered-by {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--wf-muted);
  opacity: 0.72;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Timeline icon */
.wf-icon-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--wf-border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--wf-muted);
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.wf-icon-btn:hover { background: var(--wf-indigo-soft); color: var(--wf-indigo); }

.wf-badge {
  position: absolute; top: -4px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 5px;
  background: var(--wf-indigo); color: #fff;
  font-size: 9px; font-weight: 800;
  border-radius: 999px; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
}

/* Upload button */
.wf-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--wf-indigo), var(--wf-indigo-2));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.87rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 18px rgba(99,102,241,0.32);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.wf-upload-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(99,102,241,0.4);
}
.wf-upload-btn:active { transform: translateY(0); }

/* Leaderboard button — upload-style, green */
.wf-leaderboard-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #059669, var(--wf-green));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.87rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 18px rgba(16,185,129,0.32);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.wf-leaderboard-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(16,185,129,0.42);
}
.wf-leaderboard-btn:active { transform: translateY(0); }

/* ═══ BODY (fills full width — no side gaps) ═══ */
.wf-body {
  flex: 1;
  padding: 22px 26px 20px;
  width: 100%;
}

.wf-error {
  color: #b91c1c;
  font-size: 13px;
  padding: 10px 26px 0;
  width: 100%;
}

.wf-disclaimer {
  padding: 18px 26px 28px;
  width: 100%;
  font-size: 0.72rem;
  color: #94a3b8;
  text-align: center;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

/* ═══ ODOO-STYLE LAYOUT ═══ */

/* KPI strip */
.wf-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  animation: wf-fade-up 0.45s ease-out both;
}
.wf-kpi-tile {
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 12px;
  padding: 14px 16px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.wf-kpi-tile:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}
.wf-kpi-tile-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wf-muted);
  margin-bottom: 6px;
}
.wf-kpi-tile-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--wf-text);
  line-height: 1.1;
  margin-bottom: 4px;
}
.wf-kpi-tile-hint {
  font-size: 0.72rem;
  color: var(--wf-muted);
  font-weight: 600;
}

/* Hero row: hero on left, sidebar on right */
.wf-hero-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.wf-side-panel {
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
}
.wf-side-panel h3 {
  margin: 0 0 14px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--wf-text);
}
.wf-side-preview {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--wf-border);
}
.wf-side-preview-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wf-muted);
  margin-bottom: 10px;
}
.wf-side-preview .wf-bar-row { margin-bottom: 8px; }
.wf-side-preview .wf-bar-track { height: 6px; }

/* Feature strip (4 columns) */
.wf-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  animation: wf-fade-up 0.5s ease-out 0.1s both;
}
.wf-feature {
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.wf-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
  border-color: rgba(99, 102, 241, 0.35);
}
.wf-feature-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--wf-indigo-soft);
  color: var(--wf-indigo);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.wf-feature-body { min-width: 0; }
.wf-feature-body h3 { margin: 0 0 3px; font-size: 0.85rem; font-weight: 800; color: var(--wf-text); }
.wf-feature-body p { margin: 0; font-size: 0.75rem; color: var(--wf-muted); line-height: 1.4; }

/* Split row (2 panels side-by-side) */
.wf-split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  animation: wf-fade-up 0.55s ease-out 0.15s both;
}
.wf-panel {
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 16px;
  padding: 20px 24px;
}
.wf-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.wf-panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--wf-text);
}
.wf-panel-tag {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--wf-indigo);
  background: var(--wf-indigo-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.wf-panel-foot {
  margin: 14px 0 0;
  font-size: 0.72rem;
  color: var(--wf-muted);
}

.wf-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.wf-check-list li {
  position: relative;
  padding-left: 26px;
  font-size: 0.85rem;
  color: var(--wf-text);
  line-height: 1.5;
}
.wf-check-list li::before {
  content: '✓';
  position: absolute;
  left: 0; top: 0;
  width: 18px; height: 18px;
  background: var(--wf-indigo-soft);
  color: var(--wf-indigo);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
}

/* ═══ WELCOME animations ═══ */
@keyframes wf-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes wf-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes wf-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes wf-pulse-glow {
  0%, 100% { box-shadow: 0 20px 60px rgba(99,102,241,0.28); }
  50% { box-shadow: 0 24px 72px rgba(99,102,241,0.42); }
}

.wf-welcome { animation: wf-fade-up 0.5s ease-out both; }

/* Hero (inside hero-row grid) */
.wf-hero {
  position: relative;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);
  border-radius: 18px;
  padding: 32px 34px 30px;
  color: #fff;
  overflow: hidden;
  animation: wf-pulse-glow 6s ease-in-out infinite;
}
.wf-hero::before {
  content: '';
  position: absolute;
  top: -60%; right: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.wf-hero::after {
  content: '';
  position: absolute;
  bottom: -50%; left: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.wf-hero-inner { position: relative; z-index: 1; max-width: 640px; }

.wf-hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.18);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}
.wf-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.wf-hero p {
  margin: 0 0 18px;
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0.92;
  max-width: 52ch;
}

.wf-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: #fff;
  color: #6366f1;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.wf-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.24);
}
.wf-hero-hint {
  margin: 14px 0 0;
  font-size: 0.78rem;
  opacity: 0.8;
}

/* Hero insight pills */
.wf-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 20px;
}
.wf-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  min-width: 110px;
}
.wf-hero-stat strong {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.wf-hero-stat span {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
}
.wf-hero-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  background-size: 200% 100%;
  animation: wf-shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

/* Floating icons in hero */
.wf-hero-orbs {
  position: absolute;
  top: 0; right: 0;
  width: 300px; height: 100%;
  pointer-events: none;
  z-index: 0;
}
.wf-hero-orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  animation: wf-float 4s ease-in-out infinite;
}
.wf-hero-orb--1 { top: 20px; right: 40px; width: 70px; height: 70px; animation-delay: 0s; }
.wf-hero-orb--2 { top: 100px; right: 140px; width: 44px; height: 44px; animation-delay: 1s; }
.wf-hero-orb--3 { bottom: 40px; right: 80px; width: 90px; height: 90px; animation-delay: 2s; }

@media (max-width: 780px) {
  .wf-hero-orbs { display: none; }
  .wf-hero { padding: 32px 24px; }
}

/* Feature strip */
.wf-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 22px;
  animation: wf-fade-up 0.55s ease-out 0.1s both;
}
.wf-feature {
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.wf-feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(15,23,42,0.08);
  border-color: rgba(99,102,241,0.35);
}
.wf-feature-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--wf-indigo-soft);
  color: var(--wf-indigo);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.wf-feature h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--wf-text);
}
.wf-feature p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--wf-muted);
  line-height: 1.5;
}

/* Preview grid */
.wf-preview-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  animation: wf-fade-up 0.55s ease-out 0.2s both;
}

.wf-preview-panel {
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 18px;
  padding: 24px 26px;
  position: relative;
  overflow: hidden;
}
.wf-preview-panel h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 800;
}
.wf-preview-panel .wf-hint {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: var(--wf-muted);
}

.wf-preview-bars { display: grid; gap: 12px; }
.wf-bar-row { }
.wf-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--wf-text);
}
.wf-bar-track {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.wf-bar-fill {
  height: 100%;
  border-radius: 4px;
  transform-origin: left;
  animation: wf-bar-grow 0.9s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes wf-bar-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.wf-preview-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--wf-indigo);
  background: var(--wf-indigo-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* Steps panel */
.wf-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.wf-steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--wf-text);
}
.wf-step-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wf-indigo), var(--wf-indigo-2));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(99,102,241,0.28);
}

.wf-cta-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  padding: 13px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--wf-indigo), var(--wf-indigo-2));
  color: #fff;
  border: none;
  cursor: pointer;
  width: 100%;
  font-weight: 800;
  font-size: 0.9rem;
  font-family: inherit;
  box-shadow: 0 8px 22px rgba(99,102,241,0.28);
  transition: transform 0.15s, filter 0.15s;
}
.wf-cta-secondary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.wf-cta-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.74rem;
  color: var(--wf-muted);
}

/* ═══ POST-UPLOAD DASHBOARD ═══ */
.wf-dash {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  animation: wf-fade-up 0.4s ease-out both;
}
.wf-span-full { grid-column: 1 / -1; }

.wf-card {
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  border-radius: 16px;
  padding: 22px 24px;
}
.wf-card h3 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--wf-text);
}
.wf-card p { font-size: 0.87rem; line-height: 1.55; color: var(--wf-muted); margin: 0 0 4px; }

.wf-story p { color: var(--wf-text) !important; font-size: 0.98rem !important; line-height: 1.6; }
.wf-period {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.72rem;
  background: var(--wf-indigo-soft); color: var(--wf-indigo);
  padding: 4px 12px; border-radius: 999px; font-weight: 700;
}

.wf-total-row {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--wf-border);
  font-size: 0.87rem;
  font-weight: 800;
  color: var(--wf-text);
}

.wf-tag {
  font-size: 0.68rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
  color: #fff; text-transform: uppercase; letter-spacing: 0.05em;
}
.wf-tag-good { background: #16a34a; }
.wf-tag-bad  { background: #dc2626; }
.wf-tag-mid  { background: #ea580c; }

.wf-cmp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 12px;
}

.wf-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.wf-dual-item {
  background: var(--wf-bg);
  border-radius: 12px;
  padding: 14px 16px;
}
.wf-dual-item-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.wf-dual-item-value {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.wf-insight {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.04));
  border-color: rgba(99,102,241,0.28);
}
.wf-insight p {
  color: var(--wf-text) !important;
  font-size: 0.94rem !important;
  font-weight: 500;
}

.wf-peer-bracket {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--wf-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.wf-peer-status { font-size: 0.98rem; font-weight: 800; margin: 0 0 6px; }
.wf-good { color: #15803d; }
.wf-warn { color: #c2410c; }

.wf-muted { color: var(--wf-muted); font-size: 0.85rem; }

/* Loading + Timeline modal */
.wf-loading[hidden], .wf-modal[hidden] { display: none !important; }
.wf-loading {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9900;
  backdrop-filter: blur(4px);
}
.wf-loading-box {
  background: #fff;
  padding: 32px 40px;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.24);
}
.wf-spinner {
  width: 34px; height: 34px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--wf-indigo);
  border-radius: 50%;
  animation: wf-spin 0.8s linear infinite;
  margin: 0 auto 14px;
}
@keyframes wf-spin { to { transform: rotate(360deg); } }

.wf-modal {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 9800;
  backdrop-filter: blur(4px);
}
.wf-modal-panel {
  background: #fff; width: 100%;
  max-width: min(960px, 100%);
  max-height: 78vh;
  border-radius: 22px 22px 0 0;
  padding: 26px 26px 32px;
  overflow-y: auto;
  animation: wf-fade-up 0.3s ease-out both;
}
.wf-modal-panel h2 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 800; }

.wf-tl-item {
  padding: 14px 16px;
  border: 1px solid var(--wf-border);
  border-radius: 12px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.wf-tl-item:hover { border-color: var(--wf-indigo); }
.wf-tl-item.active { border-color: var(--wf-indigo); background: var(--wf-indigo-soft); }
.wf-tl-item strong { display: block; font-size: 0.92rem; }
.wf-tl-item span { display: block; font-size: 0.76rem; color: var(--wf-muted); margin-top: 4px; }

/* ═══ MOBILE ═══ */
@media (max-width: 1023px) {
  .wf-app-main { margin-left: 0; }
  .wf-body { padding: 16px 14px; }
  .wf-error, .wf-disclaimer { padding-left: 14px; padding-right: 14px; }
  .wf-top { padding: 0 14px; height: 66px; gap: 8px; }
  .wf-top-title h1 { font-size: 1.18rem; }
  .wf-top-title p,
  .wf-powered-by { font-size: 0.52rem; }
  .wf-upload-btn-text { display: none; }
  .wf-upload-btn { padding: 10px 12px; }
  .wf-leaderboard-btn-text { display: none; }
  .wf-leaderboard-btn { padding: 10px 12px; }
  .wf-hero { padding: 26px 20px; border-radius: 16px; }
  .wf-hero h1 { font-size: 1.35rem; }
  .wf-hero-orbs { display: none; }
  .wf-kpi-strip { grid-template-columns: 1fr 1fr; }
  .wf-hero-row { grid-template-columns: 1fr; }
  .wf-features { grid-template-columns: 1fr 1fr; }
  .wf-split-row { grid-template-columns: 1fr; }
  .wf-preview-grid { grid-template-columns: 1fr; }
  .wf-dash { grid-template-columns: 1fr; }
  .wf-dual { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .wf-kpi-strip { grid-template-columns: 1fr; }
  .wf-features { grid-template-columns: 1fr; }
  .wf-kpi-tile-value { font-size: 1.35rem; }
}
