* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f172a; color: #e2e8f0; min-height: 100vh; }

.header { background: #1e293b; border-bottom: 1px solid #334155; padding: 14px 24px; display: flex; align-items: center; gap: 12px; }
.header h1 { font-size: 18px; font-weight: 700; color: #fff; flex: 1; }
.badge { background: #6366f1; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.session-badge { background: #334155; color: #94a3b8; font-size: 12px; padding: 4px 12px; border-radius: 99px; }
.server-status { font-size: 12px; padding: 4px 12px; border-radius: 99px; }
.server-status.ok  { background: #14532d; color: #86efac; }
.server-status.err { background: #450a0a; color: #fca5a5; }
.server-status.off { background: #334155; color: #94a3b8; }

.layout { display: flex; height: calc(100vh - 53px); }

/* ── Sidebar ── */
.sidebar { width: 260px; min-width: 260px; background: #1e293b; border-right: 1px solid #334155; display: flex; flex-direction: column; overflow: hidden; }
.sidebar-header { padding: 14px; border-bottom: 1px solid #334155; }
.sidebar-header h3 { font-size: 12px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.load-btn { width: 100%; padding: 8px; background: #6366f1; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.load-btn:hover { background: #4f46e5; }
.clip-list { flex: 1; overflow-y: auto; padding: 8px; }
.clip-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; margin-bottom: 4px; border: 1px solid transparent; transition: all 0.15s; }
.clip-item:hover { background: #0f172a; }
.clip-item.active { background: #0f172a; border-color: #6366f1; }
.clip-item.done { border-color: #22c55e33; }
.ci-name { font-size: 12px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-score { font-size: 11px; margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.ci-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.sidebar-footer { padding: 12px; border-top: 1px solid #334155; display: flex; flex-direction: column; gap: 6px; }
.export-all-btn { width: 100%; padding: 8px; background: #22c55e; color: #000; border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.export-all-btn:hover { background: #16a34a; }
.clear-btn { width: 100%; padding: 6px; background: transparent; color: #64748b; border: 1px solid #334155; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.clear-btn:hover { background: #450a0a; color: #fca5a5; border-color: #7f1d1d; }
.session-stats { font-size: 11px; color: #64748b; text-align: center; }

/* ── Main ── */
.main { flex: 1; overflow-y: auto; padding: 20px; }
.card { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.card h2 { font-size: 12px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.info-row { display: flex; gap: 10px; }
.info-input { flex: 1; background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 7px 10px; color: #e2e8f0; font-size: 13px; font-family: inherit; }
.info-input:focus { outline: none; border-color: #6366f1; }
audio { width: 100%; border-radius: 8px; margin-bottom: 4px; }
.transcript-area { width: 100%; background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 10px; color: #e2e8f0; font-size: 14px; min-height: 60px; resize: vertical; font-family: inherit; }
.transcript-area:focus { outline: none; border-color: #6366f1; }
.btn-row { display: flex; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.btn { padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-secondary { background: #334155; color: #e2e8f0; }
.btn-secondary:hover { background: #475569; }
.btn-green { background: #22c55e; color: #000; }
.btn-green:hover { background: #16a34a; }
.btn-next { background: #6366f1; color: #fff; font-size: 13px; padding: 9px 20px; }
.status-bar { font-size: 12px; padding: 6px 10px; border-radius: 6px; margin-top: 6px; display: none; }
.status-bar.info    { background: #1e3a5f; color: #60a5fa; display: block; }
.status-bar.success { background: #14532d; color: #86efac; display: block; }
.status-bar.error   { background: #450a0a; color: #fca5a5; display: block; }

/* ── Words ── */
.words-grid { display: flex; flex-wrap: wrap; gap: 10px; min-height: 60px; }
.empty-state { color: #475569; font-size: 13px; padding: 20px; width: 100%; text-align: center; }
.word-card { background: #0f172a; border: 2px solid #334155; border-radius: 10px; padding: 8px 10px; min-width: 100px; cursor: pointer; transition: all 0.15s; }
.word-card:hover { transform: translateY(-2px); border-color: #6366f1; }
.word-card.active { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.3); }
.wc-text { font-size: 14px; font-weight: 700; color: #f1f5f9; display: block; margin-bottom: 5px; }
.wc-note { font-size: 10px; color: #64748b; font-family: monospace; display: block; margin-bottom: 5px; min-height: 13px; }
.score-display { display: flex; align-items: center; gap: 5px; }
.score-val { font-size: 16px; font-weight: 800; min-width: 38px; }
.score-bar-bg { flex: 1; height: 5px; background: #1e293b; border-radius: 99px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 99px; transition: width 0.3s; }

/* ── Slider ── */
.slider-panel { display: none; background: #0f172a; border: 1px solid #334155; border-radius: 10px; padding: 14px; margin-top: 10px; }
.slider-panel.visible { display: block; }
.slider-panel h3 { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.slider-panel h3 span { color: #6366f1; }
.quick-scores { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.qs-btn { padding: 4px 10px; border-radius: 5px; border: none; cursor: pointer; font-size: 12px; font-weight: 700; }
.qs-0   { background: #450a0a; color: #fca5a5; }
.qs-25  { background: #431407; color: #fdba74; }
.qs-50  { background: #422006; color: #fde68a; }
.qs-75  { background: #1a3320; color: #86efac; }
.qs-100 { background: #14532d; color: #4ade80; }
.slider-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.score-slider { flex: 1; -webkit-appearance: none; height: 7px; border-radius: 99px; background: #1e293b; outline: none; }
.score-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #6366f1; cursor: pointer; border: 3px solid #fff; }
.slider-val { font-size: 26px; font-weight: 900; min-width: 52px; text-align: right; }
.note-row { display: flex; gap: 7px; }
.note-input { flex: 1; background: #1e293b; border: 1px solid #334155; border-radius: 6px; padding: 6px 9px; color: #e2e8f0; font-size: 12px; font-family: monospace; }
.note-input:focus { outline: none; border-color: #6366f1; }
.note-input::placeholder { color: #475569; font-family: sans-serif; }
.nav-row { display: flex; gap: 7px; margin-top: 10px; justify-content: flex-end; }

/* ── Overall ── */
.overall-row { display: flex; align-items: center; gap: 20px; }
.overall-score { font-size: 56px; font-weight: 900; line-height: 1; }
.overall-right { flex: 1; }
.overall-label { font-size: 13px; color: #94a3b8; margin-bottom: 10px; }
.mini-stats { display: flex; gap: 0; border: 1px solid #334155; border-radius: 8px; overflow: hidden; }
.mini-stat { flex: 1; padding: 8px; text-align: center; border-right: 1px solid #334155; }
.mini-stat:last-child { border-right: none; }
.ms-val { font-size: 17px; font-weight: 800; }
.ms-lbl { font-size: 10px; color: #94a3b8; }
.words-progress { display: flex; gap: 3px; margin-top: 10px; flex-wrap: wrap; }
.wp-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ── Tabs ── */
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid #334155; padding-bottom: 0; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 18px; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer; margin-bottom: -1px; transition: all 0.15s; }
.tab:hover { color: #e2e8f0; }
.tab.active { color: #6366f1; border-bottom-color: #6366f1; }

/* ── Browse ── */
.browse-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.browse-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 8px; border: 1px solid #334155; margin-bottom: 6px; background: #0f172a; }
.browse-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.browse-name { font-size: 13px; font-weight: 700; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browse-meta { font-size: 11px; color: #64748b; }
.browse-target { font-size: 11px; color: #94a3b8; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browse-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.browse-count { font-size: 11px; color: #6366f1; font-weight: 700; white-space: nowrap; }
.browse-date { font-size: 11px; color: #475569; white-space: nowrap; }

/* ── Next bar ── */
.next-bar { background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 14px 18px; display: flex; align-items: center; gap: 14px; }
.next-bar-info { flex: 1; }
.nb-label { font-size: 11px; color: #64748b; }
.nb-clip  { font-size: 14px; font-weight: 700; color: #e2e8f0; }
