*{box-sizing:border-box;margin:0;padding:0}
body{min-height:100vh;color:#18181B;background:radial-gradient(circle at top right,rgba(180,83,9,.10),transparent 28%),linear-gradient(180deg,#F7F4EE 0%,#F3EFE6 100%);font-family:'Outfit',sans-serif}
::-webkit-scrollbar{width:4px}::-webkit-scrollbar-thumb{background:rgba(0,0,0,.12);border-radius:4px}
@keyframes pulse{0%,100%{opacity:.4}50%{opacity:1}}
@keyframes fadeUp{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes blink{0%,100%{opacity:1}50%{opacity:0}}
.streaming-dot::after{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:#9A5D0B;margin-left:4px;animation:blink .8s infinite}
button{cursor:pointer;font-family:inherit}

.shell{width:min(1480px,calc(100vw - 32px));margin:0 auto;padding:20px 0 30px;display:flex;flex-direction:column;height:100vh}

/* ── TOPBAR ── */
.topbar{display:flex;align-items:center;gap:12px;padding:14px 20px;background:rgba(255,255,255,.86);border:1px solid rgba(165,142,112,.18);border-radius:16px;box-shadow:0 6px 20px rgba(24,24,27,.05);backdrop-filter:blur(12px);margin-bottom:14px;flex-shrink:0}
.brand{display:flex;align-items:center;gap:10px}
.brand-icon{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,#9A5D0B,#B45309);display:flex;align-items:center;justify-content:center;color:#fff;font-size:15px;font-weight:800;flex-shrink:0}
.brand-name{font-size:14px;font-weight:800;color:#18181B;letter-spacing:-.01em}
.brand-sub{font-size:10px;color:#92400E;opacity:.7}
.sep{width:1px;height:28px;background:rgba(165,142,112,.2);margin:0 4px}

.stat{text-align:center;padding:0 14px;border-left:1px solid rgba(165,142,112,.1)}
.stat-label{font-size:9px;color:#92400E;opacity:.6;letter-spacing:.08em;font-weight:600;text-transform:uppercase;margin-bottom:2px}
.stat-val{font-size:15px;font-weight:800;color:#18181B;letter-spacing:-.01em}

.tb-btn{border:1px solid rgba(165,142,112,.25);background:rgba(255,251,235,.9);color:#9A5D0B;border-radius:9px;padding:8px 16px;font-size:12px;font-weight:700;transition:all .15s}
.tb-btn:hover{background:rgba(180,83,9,.12);border-color:rgba(180,83,9,.3)}
.tb-btn.primary{background:linear-gradient(135deg,#9A5D0B,#B45309);color:#fff;border-color:transparent}
.tb-btn.primary:hover{opacity:.9}
.tb-btn.danger{background:#DC2626;color:#fff;border-color:transparent}
.tb-btn.warn{background:#D97706;color:#fff;border-color:transparent}

/* ── BODY 3-COL ── */
.body{flex:1;display:grid;grid-template-columns:310px 1fr 300px;gap:12px;overflow:hidden;min-height:0}

/* ── CARDS ── */
.card{background:rgba(255,255,255,.86);border:1px solid rgba(165,142,112,.18);border-radius:16px;box-shadow:0 6px 20px rgba(24,24,27,.05);backdrop-filter:blur(12px);display:flex;flex-direction:column;overflow:hidden}
.card-header{padding:12px 16px;border-bottom:1px solid rgba(165,142,112,.12);display:flex;align-items:center;gap:8px;flex-shrink:0}
.card-title{font-size:12px;font-weight:700;color:#18181B;text-transform:uppercase;letter-spacing:.06em}
.card-body{flex:1;overflow-y:auto;padding:10px}

/* ── TABS ── */
.tabs{display:flex;border-bottom:1px solid rgba(165,142,112,.12);flex-shrink:0}
.tab{flex:1;padding:10px 0;font-size:12px;font-weight:600;color:#92400E;opacity:.5;background:none;border:none;border-bottom:2px solid transparent;transition:all .15s}
.tab.active{opacity:1;border-bottom-color:#9A5D0B}
.tab:hover{opacity:.8}

/* ── TEST CARD ── */
.tc{padding:10px 12px;border:1.5px solid rgba(165,142,112,.15);border-radius:10px;margin-bottom:6px;cursor:pointer;transition:all .15s;background:rgba(255,255,255,.5)}
.tc:hover{border-color:rgba(165,142,112,.3)}
.tc.active{border-color:#9A5D0B;background:rgba(255,251,235,.6)}
.tc.scored-good{border-color:rgba(5,150,105,.3);background:rgba(236,253,245,.5)}
.tc.scored-mid{border-color:rgba(217,119,6,.3);background:rgba(255,251,235,.5)}
.tc.scored-bad{border-color:rgba(220,38,38,.3);background:rgba(254,242,242,.5)}
.tc-input{font-size:12px;color:#18181B;line-height:1.45}
.tc-kw{display:inline-block;font-size:9.5px;background:rgba(165,142,112,.1);color:#92400E;padding:1px 6px;border-radius:4px;font-family:monospace;margin:2px 2px 0 0}
.tc-actions{display:flex;gap:6px;margin-top:6px;justify-content:flex-end}
.tc-actions button{font-size:10px;color:#92400E;opacity:.5;background:none;border:none;transition:opacity .15s}
.tc-actions button:hover{opacity:1}

/* ── SCORE PILLS ── */
.pill{display:inline-flex;align-items:center;padding:2px 8px;border-radius:100px;font-family:monospace;font-size:11px;font-weight:700}
.pill.good{background:#ECFDF5;border:1px solid #A7F3D0;color:#059669}
.pill.mid{background:#FFFBEB;border:1px solid #FDE68A;color:#D97706}
.pill.bad{background:#FEF2F2;border:1px solid #FECACA;color:#DC2626}
.pill.lg{padding:4px 12px;font-size:14px}
.pill.none{background:rgba(165,142,112,.08);border:1px solid rgba(165,142,112,.15);color:#92400E}

/* ── METRIC BAR ── */
.mrow{margin-bottom:8px}
.mrow-top{display:flex;justify-content:space-between;margin-bottom:3px;align-items:center}
.mrow-label{font-size:11px;color:#92400E;opacity:.7;font-family:monospace}
.mrow-val{font-family:monospace;font-size:11px;font-weight:700}
.mrow-bar{height:5px;background:rgba(165,142,112,.1);border-radius:100px;overflow:hidden}
.mrow-fill{height:100%;border-radius:100px;transition:width .7s cubic-bezier(.25,.46,.45,.94)}
.mrow-delta{font-size:10px;font-weight:700;margin-right:4px}

/* ── LOG ── */
.log-item{display:flex;gap:7px;padding:5px 8px;border-radius:6px;margin-bottom:4px;animation:fadeUp .15s ease;border:1px solid rgba(165,142,112,.1)}
.log-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0;margin-top:5px}
.log-msg{font-size:11px;line-height:1.45;flex:1}
.log-time{font-size:9px;color:rgba(165,142,112,.4);flex-shrink:0;padding-top:2px}

/* ── PROMPT AREA ── */
.prompt-box{background:rgba(255,251,235,.5);border:1px solid rgba(165,142,112,.15);border-radius:10px;padding:10px 12px;font-size:13px;line-height:1.65;color:#374151;white-space:pre-wrap;max-height:100px;overflow-y:auto;position:relative}
.prompt-edit{width:100%;border:1.5px solid #9A5D0B;border-radius:10px;padding:10px 12px;font-size:13px;line-height:1.6;resize:vertical;background:#FFFEF8;color:#18181B;font-family:inherit}

/* ── PROPOSAL ── */
.proposal{padding:10px 12px;background:rgba(124,58,237,.06);border:1.5px solid rgba(124,58,237,.2);border-radius:10px;animation:fadeUp .25s ease;margin-top:8px}

/* ── SPARKLINE ── */
.spark-empty{height:40px;display:flex;align-items:center;justify-content:center;font-size:11px;color:rgba(165,142,112,.4)}

/* ── VERSION ── */
.ver{padding:10px 12px;border:1.5px solid rgba(165,142,112,.15);border-radius:9px;margin-bottom:6px;cursor:pointer;transition:all .15s;background:rgba(255,255,255,.5)}
.ver:hover{border-color:rgba(165,142,112,.3)}
.ver.current{border-color:#9A5D0B;background:rgba(255,251,235,.6)}

/* ── DETAIL ── */
.detail-input{padding:10px 14px;background:rgba(255,251,235,.6);border:1px solid rgba(165,142,112,.2);border-radius:9px;margin-bottom:10px}
.detail-output{padding:10px 14px;background:rgba(255,255,255,.6);border:1.5px solid rgba(165,142,112,.15);border-radius:9px;margin-bottom:12px}
.detail-metrics{padding:12px 14px;background:rgba(255,251,235,.4);border:1px solid rgba(165,142,112,.15);border-radius:9px}
.section-label{font-size:10px;font-weight:700;color:#9A5D0B;margin-bottom:6px;text-transform:uppercase;letter-spacing:.07em}

/* ── EMPTY STATE ── */
.empty-state{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;opacity:.4}
.empty-state p{font-size:13px;color:#92400E;text-align:center}

/* ── TEST SCORE GRID ── */
.score-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.score-tile{padding:8px 10px;border:1.5px solid rgba(165,142,112,.15);border-radius:8px;cursor:pointer;transition:all .15s;background:rgba(255,255,255,.5)}
.score-tile:hover{border-color:rgba(165,142,112,.3)}
.score-tile.selected{border-color:#9A5D0B;background:rgba(255,251,235,.6)}