@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Fraunces:ital,wght@0,400;0,600;1,400&display=swap');
*{margin:0;padding:0;box-sizing:border-box}
:root{
  --bg:#F5F4F0;--s:#FFFFFF;--b:#E2E0D8;
  --t:#18181B;--m:#78716C;--f:#C4C0B8;
  --gold:#B45309;--gold-l:#FFFBEB;--gold-b:#FDE68A;
  --diamond:#6D28D9;--diamond-l:#F5F3FF;
  --green:#065F46;--green-l:#D1FAE5;
  --red:#B91C1C;--red-l:#FEE2E2;
  --blue:#1D4ED8;--blue-l:#DBEAFE;
  --cyan:#0891B2;--cyan-l:#ECFEFF;
  --orange:#EA580C;--orange-l:#FFF7ED;
  --r:14px;--rs:8px;
}
body{font-family:'Outfit',sans-serif;background:var(--bg);color:var(--t);min-height:100vh;display:flex;flex-direction:column}
.topbar{background:var(--t);color:#fff;padding:0 24px;display:flex;align-items:center;height:52px;gap:20px;flex-shrink:0}
.logo{font-family:'Fraunces',serif;font-size:20px;letter-spacing:-.5px}
.logo em{font-style:italic;color:#FDE68A}
.mode-toggle{display:flex;gap:2px;margin-left:auto;background:rgba(255,255,255,.1);padding:3px;border-radius:20px}
.mode-btn{padding:5px 16px;border-radius:16px;border:none;font-size:12px;font-weight:500;cursor:pointer;transition:all .2s;font-family:inherit;color:rgba(255,255,255,.6);background:transparent}
.mode-btn.active{background:#fff;color:var(--t)}
.layout{flex:1;display:flex;overflow:hidden;min-height:0}

/* SIDEBAR */
.sidebar{width:280px;flex-shrink:0;background:var(--s);border-right:1px solid var(--b);display:flex;flex-direction:column;overflow:hidden}
.sb-section{padding:14px 16px;border-bottom:1px solid var(--b)}
.sb-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--m);margin-bottom:10px}
.sb-flow{padding:8px 12px;border-radius:8px;border:1.5px solid var(--b);margin-bottom:6px;cursor:pointer;transition:all .15s;display:flex;align-items:center;gap:8px;font-size:13px}
.sb-flow.active{border-color:var(--t);background:var(--bg)}
.sb-flow .dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.sb-cases{flex:1;overflow-y:auto;padding:10px 16px}
.sb-cases::-webkit-scrollbar{width:3px}
.sb-cases::-webkit-scrollbar-thumb{background:var(--b);border-radius:2px}
.sb-case{padding:8px 10px;border-radius:8px;margin-bottom:4px;cursor:pointer;transition:all .12s;font-size:12px;display:flex;align-items:center;gap:8px}
.sb-case:hover{background:var(--bg)}
.sb-case.active{background:var(--bg);border:1px solid var(--b)}
.sb-case .oc-badge{font-size:10px;font-weight:700;padding:1px 6px;border-radius:10px;flex-shrink:0;margin-left:auto}
.oc-converted{background:var(--green-l);color:var(--green)}
.oc-intent{background:var(--gold-l);color:var(--gold)}
.oc-consider{background:var(--blue-l);color:var(--blue)}
.oc-friction{background:var(--orange-l);color:var(--orange)}
.oc-drop{background:var(--red-l);color:var(--red)}
.run-btn{width:100%;padding:12px;border-radius:var(--r);border:none;background:var(--t);color:#fff;font-size:14px;font-weight:700;cursor:pointer;font-family:inherit;transition:all .15s;letter-spacing:.02em;margin-top:6px}
.run-btn:hover{opacity:.9;transform:translateY(-1px)}
.filter-row{display:flex;gap:4px;flex-wrap:wrap;margin-top:8px}
.filter-pill{padding:3px 8px;border-radius:12px;font-size:10px;font-weight:600;cursor:pointer;border:1px solid var(--b);background:var(--s);color:var(--m);transition:all .12s}
.filter-pill.active{border-color:var(--t);color:var(--t);background:var(--bg)}

/* MAIN */
.main{flex:1;display:flex;flex-direction:column;overflow:hidden}
.main-tabs{display:flex;border-bottom:1px solid var(--b);background:var(--s);padding:0 20px}
.mtab{padding:13px 18px;font-size:13px;font-weight:500;cursor:pointer;color:var(--m);border-bottom:2px solid transparent;transition:all .15s;border:none;background:transparent;font-family:inherit}
.mtab.active{color:var(--t);border-bottom-color:var(--t)}
.main-content{flex:1;overflow-y:auto;padding:20px}
.mpanel{display:none}.mpanel.active{display:block}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}

/* KPI CARDS */
.kpi-row{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-bottom:20px}
.kpi-card{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px;text-align:center;animation:fadeUp .3s ease}
.kpi-card .num{font-size:28px;font-weight:700;font-family:'Fraunces',serif;line-height:1}
.kpi-card .lbl{font-size:11px;color:var(--m);margin-top:4px}
.kpi-card .delta{font-size:11px;font-weight:600;margin-top:4px}

/* SECTION HEADERS */
.sec-header{font-size:15px;font-weight:700;margin-bottom:12px;display:flex;align-items:center;gap:8px}
.sec-sub{font-size:12px;color:var(--m);font-weight:400}

/* BAR CHART */
.chart-row{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:20px}
.chart-box{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px;animation:fadeUp .3s ease}
.chart-title{font-size:13px;font-weight:600;margin-bottom:12px}
.bar-group{margin-bottom:10px}
.bar-label{font-size:11px;color:var(--m);margin-bottom:4px;display:flex;justify-content:space-between}
.bar-track{height:24px;background:var(--bg);border-radius:6px;overflow:hidden;display:flex;gap:2px}
.bar-fill{height:100%;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:#fff;transition:width .6s ease;min-width:0}
.bar-a{background:var(--blue)}.bar-b{background:var(--gold)}

/* INSIGHT CARD */
.insight-card{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px;margin-bottom:16px;animation:fadeUp .4s ease}
.insight-title{font-size:14px;font-weight:700;margin-bottom:10px;display:flex;align-items:center;gap:8px}
.insight-row{font-size:12px;color:var(--m);line-height:1.8;padding:6px 0;border-bottom:1px dashed var(--b)}
.insight-row:last-child{border-bottom:none}
.insight-row b{color:var(--t)}

/* EXPORT BTN */
.export-btn{padding:7px 14px;border-radius:8px;border:1px solid var(--b);background:var(--s);font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:all .15s;margin-left:auto}
.export-btn:hover{background:var(--bg);border-color:var(--m)}

/* LOADING */
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
.loading{text-align:center;padding:30px;font-size:13px;color:var(--m);animation:pulse 1.2s infinite}

/* STATS BAR */
.stats-bar{display:flex;gap:6px;margin-bottom:16px;padding:10px 14px;background:var(--s);border:1px solid var(--b);border-radius:10px;font-size:12px;align-items:center;flex-wrap:wrap}
.stats-bar .stat{display:flex;align-items:center;gap:4px}
.stats-bar .sep{color:var(--b)}

/* TABLE */
.data-table{width:100%;border-collapse:collapse;font-size:13px;background:var(--s);border:1px solid var(--b);border-radius:var(--r);overflow:hidden}
.data-table th{padding:10px 14px;text-align:left;font-weight:600;font-size:12px;color:var(--m);background:var(--bg);border-bottom:1px solid var(--b)}
.data-table td{padding:10px 14px;border-bottom:1px solid var(--b)}
.data-table tr:last-child td{border-bottom:none}
.data-table .prog{height:6px;background:var(--bg);border-radius:3px;overflow:hidden;width:100px;display:inline-block;vertical-align:middle;margin-left:8px}
.data-table .prog-fill{height:100%;border-radius:3px}

/* FUNNEL */
.funnel{max-width:500px;margin:0 auto}
.funnel-step{display:flex;align-items:center;gap:12px;margin-bottom:2px}
.funnel-bar{height:36px;border-radius:8px;display:flex;align-items:center;padding:0 14px;font-size:12px;font-weight:600;color:#fff;transition:width .6s ease}
.funnel-label{font-size:12px;color:var(--m);width:160px;text-align:right;flex-shrink:0}
.funnel-pct{font-size:13px;font-weight:700;width:50px;flex-shrink:0}

/* TRANSCRIPT */
.transcript-header{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px;margin-bottom:12px;display:flex;align-items:center;gap:14px}
.tr-av{width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}
.tr-info{flex:1}.tr-name{font-size:15px;font-weight:600}.tr-meta{font-size:12px;color:var(--m);margin-top:2px}
.tr-outcome{font-size:12px;font-weight:700;padding:4px 12px;border-radius:20px}
.score-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:14px}
.score-item{background:var(--s);border:1px solid var(--b);border-radius:10px;padding:10px;text-align:center}
.score-val{font-size:22px;font-weight:700;font-family:'Fraunces',serif}
.score-lbl{font-size:10px;color:var(--m);margin-top:2px;line-height:1.3}
.transcript-chat{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px;max-height:400px;overflow-y:auto}
.tc-msg{display:flex;gap:8px;margin-bottom:10px;align-items:flex-start}
.tc-msg.user{flex-direction:row-reverse}
.tc-bubble{max-width:75%;padding:9px 13px;border-radius:16px;font-size:13px;line-height:1.6}
.tc-msg.bot .tc-bubble{background:var(--bg);border:1px solid var(--b);border-bottom-left-radius:4px}
.tc-msg.user .tc-bubble{background:var(--t);color:#fff;border-bottom-right-radius:4px}
.tc-av{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;flex-shrink:0;color:#fff;background:var(--t)}

/* PERSONA GRID */
.persona-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}
.persona-card{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px;transition:all .15s}
.persona-card:hover{border-color:var(--m);transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.06)}
.pc-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.pc-emoji{width:40px;height:40px;border-radius:50%;background:var(--bg);display:flex;align-items:center;justify-content:center;font-size:20px;flex-shrink:0}
.pc-pname{font-size:14px;font-weight:600}
.pc-psub{font-size:11px;color:var(--m)}
.pc-detail{font-size:12px;color:var(--m);display:flex;flex-direction:column;gap:4px}
.pc-tag{display:inline-block;padding:2px 8px;border-radius:10px;font-size:10px;font-weight:600;margin-right:4px}

/* TWO COL */
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:20px}

/* NOTIF */
.notif{position:fixed;bottom:20px;left:50%;transform:translateX(-50%) translateY(10px);background:var(--t);color:#fff;padding:10px 20px;border-radius:20px;font-size:13px;opacity:0;transition:all .3s;z-index:999;pointer-events:none}
.notif.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* EMPTY STATE */
.empty-state{text-align:center;padding:40px;color:var(--m)}
.empty-state .icon{font-size:48px;margin-bottom:12px}
.empty-state .title{font-size:15px;font-weight:600;color:var(--t);margin-bottom:6px}
.empty-state .desc{font-size:12px;line-height:1.7}

/* HEATMAP */
.heatmap{display:grid;gap:2px;margin-bottom:16px}
.hm-cell{border-radius:4px;padding:6px 8px;font-size:11px;font-weight:600;text-align:center;transition:all .2s}
.hm-cell:hover{transform:scale(1.05);box-shadow:0 2px 8px rgba(0,0,0,.1)}
.hm-header{font-weight:700;color:var(--m);background:transparent;font-size:10px;text-transform:uppercase}

/* DISTRIBUTION */
.dist-container{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px;margin-bottom:16px}
.dist-bars{display:flex;align-items:flex-end;gap:4px;height:160px;padding:0 4px}
.dist-col{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px}
.dist-bar{width:100%;border-radius:4px 4px 0 0;transition:height .6s ease;position:relative;min-height:2px;cursor:pointer}
.dist-bar:hover{opacity:.85;transform:scaleY(1.02)}
.dist-bar .dist-val{position:absolute;top:-18px;left:50%;transform:translateX(-50%);font-size:10px;font-weight:700;white-space:nowrap}
.dist-label{font-size:10px;color:var(--m);font-weight:600;margin-top:6px}
.dist-legend{display:flex;gap:16px;justify-content:center;margin-top:12px;font-size:11px}
.dist-legend-dot{width:10px;height:10px;border-radius:50%;display:inline-block;margin-right:4px}

/* RADAR CHART */
.radar-wrap{position:relative;width:280px;height:280px;margin:0 auto}
.radar-bg{position:absolute;inset:0}
.radar-axis{position:absolute;width:1px;background:var(--b);transform-origin:bottom center;left:50%;bottom:50%}
.radar-label{position:absolute;font-size:11px;font-weight:600;color:var(--m);white-space:nowrap}
.radar-polygon{position:absolute;inset:0}
.radar-polygon svg{width:100%;height:100%}

/* SENTIMENT JOURNEY */
.sj-chart{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px;margin-bottom:14px}
.sj-canvas{position:relative;height:120px;display:flex;align-items:stretch}
.sj-grid{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:space-between}
.sj-grid-line{height:1px;background:var(--b);opacity:.5}
.sj-dots{display:flex;align-items:flex-end;gap:0;flex:1;position:relative;z-index:1}
.sj-col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;position:relative;height:100%}
.sj-dot{width:10px;height:10px;border-radius:50%;position:absolute;transition:all .3s;cursor:pointer;z-index:2}
.sj-dot:hover{transform:scale(1.4);box-shadow:0 2px 8px rgba(0,0,0,.2)}
.sj-line{position:absolute;height:2px;z-index:1;transform-origin:left center}
.sj-zero{position:absolute;left:0;right:0;height:1px;background:var(--m);opacity:.3}
.sj-y-labels{position:absolute;left:-30px;top:0;bottom:0;display:flex;flex-direction:column;justify-content:space-between;font-size:9px;color:var(--m)}

/* LEADERBOARD */
.lb-card{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px;margin-bottom:12px}
.lb-row{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;margin-bottom:4px;transition:all .15s;cursor:pointer}
.lb-row:hover{background:var(--bg)}
.lb-rank{font-size:18px;font-weight:700;font-family:'Fraunces',serif;width:30px;text-align:center;flex-shrink:0}
.lb-info{flex:1;min-width:0}
.lb-name{font-size:13px;font-weight:600}
.lb-sub{font-size:11px;color:var(--m)}
.lb-score{text-align:right}
.lb-score-val{font-size:18px;font-weight:700;font-family:'Fraunces',serif}
.lb-score-sub{font-size:10px;color:var(--m)}
.lb-gap{display:flex;align-items:center;gap:4px;padding:4px 8px;border-radius:6px;font-size:11px;font-weight:600}

/* FAILURE ANALYSIS */
.fail-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}
.fail-card{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px}
.fail-bar-row{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.fail-bar-label{font-size:12px;width:140px;flex-shrink:0;text-align:right;color:var(--m)}
.fail-bar-track{flex:1;height:20px;background:var(--bg);border-radius:4px;overflow:hidden}
.fail-bar-fill{height:100%;border-radius:4px;display:flex;align-items:center;padding:0 6px;font-size:10px;font-weight:700;color:#fff;transition:width .6s ease}
.fail-bar-val{font-size:12px;font-weight:700;width:40px;flex-shrink:0}

/* A/B STATS */
.ab-stat-card{background:var(--s);border:1px solid var(--b);border-radius:var(--r);padding:16px;margin-bottom:12px}
.ab-stat-row{display:flex;align-items:center;gap:12px;margin-bottom:8px}
.ab-stat-label{font-size:12px;color:var(--m);width:120px;flex-shrink:0}
.ab-stat-val{font-size:16px;font-weight:700;font-family:'Fraunces',serif}
.ab-ci{display:flex;align-items:center;gap:4px;height:24px;margin:4px 0}
.ab-ci-bar{height:8px;border-radius:4px;position:relative}
.ab-ci-marker{width:2px;height:16px;position:absolute;top:-4px;border-radius:1px;background:var(--t)}

/* RESPONSIVE */
@media(max-width:1200px){.chart-row{grid-template-columns:repeat(2,1fr)}.kpi-row{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.layout{flex-direction:column}.sidebar{width:100%;max-height:300px}.two-col{grid-template-columns:1fr}}
