/* ── Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1117; color: #e2e8f0;
  height: 100vh; overflow: hidden; display: flex;
}
#app { display: flex; width: 100%; height: 100vh; overflow: hidden; }

/* ── Login ──────────────────────────────────────────── */
.login-wrap {
  width: 100%; display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #1a1f2e; border: 1px solid #2d3748;
  border-radius: 16px; padding: 40px; width: 380px; text-align: center;
}
.login-logo  { font-size: 42px; margin-bottom: 14px; }
.login-title { font-size: 22px; font-weight: 700; color: #f7fafc; margin-bottom: 6px; }
.login-sub   { font-size: 13px; color: #718096; margin-bottom: 28px; }

/* ── Shell ──────────────────────────────────────────── */
.sidenav {
  width: 220px; flex-shrink: 0; height: 100vh;
  background: #1a1f2e; border-right: 1px solid #2d3748;
  display: flex; flex-direction: column;
}
.sidenav-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px; border-bottom: 1px solid #2d3748; flex-shrink: 0;
}
.brand-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.brand-name { font-size: 14px; font-weight: 700; color: #f7fafc; }
.brand-sub  { font-size: 11px; color: #718096; margin-top: 1px; }
.nav-links  { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-footer { padding: 8px; border-top: 1px solid #2d3748; flex-shrink: 0; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; background: none; border: none;
  cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500;
  color: #a0aec0; text-align: left; transition: background .12s, color .12s;
}
.nav-item:hover  { background: rgba(102,126,234,.1); color: #e2e8f0; }
.nav-item.active { background: rgba(102,126,234,.18); color: #f7fafc; }
.nav-icon-el { font-size: 15px; flex-shrink: 0; }
.content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* ── Split layout (sidebar + editor) ────────────────── */
.split-layout {
  display: grid; grid-template-columns: 264px 1fr;
  height: 100%; overflow: hidden;
}
.page-sidebar {
  background: #1a1f2e; border-right: 1px solid #2d3748;
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-top  { padding: 12px; border-bottom: 1px solid #2d3748; flex-shrink: 0; }
.sidebar-list { flex: 1; overflow-y: auto; padding: 8px; }
.sidebar-msg  { padding: 18px 12px; color: #4a5568; font-size: 13px; line-height: 1.6; }

/* ── Page header ─────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: #1a1f2e; border-bottom: 1px solid #2d3748; flex-shrink: 0;
}
.page-header-title { font-size: 15px; font-weight: 600; color: #f7fafc; }
.page-header-sub   { font-size: 11px; color: #718096; margin-top: 2px; }
.page-header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.status-bar {
  padding: 6px 24px; font-size: 13px; min-height: 30px; flex-shrink: 0;
  display: flex; align-items: center;
}
.page-body { flex: 1; overflow-y: auto; padding: 20px 24px 48px; }

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #4a5568; gap: 12px; height: 60vh;
}
.empty-icon { font-size: 44px; }
.empty-text { font-size: 14px; }

/* ── Status messages ─────────────────────────────────── */
.msg-ok      { color: #68d391; }
.msg-error   { color: #fc8181; }
.msg-loading { color: #90cdf4; }
.msg-success { color: #68d391; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  border-radius: 8px; padding: 7px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity .15s, transform .1s;
  border: none; white-space: nowrap; font-family: inherit;
}
.btn:hover   { opacity: .86; }
.btn:active  { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.btn-green   { background: linear-gradient(135deg, #48bb78, #2f855a); color: #fff; }
.btn-orange  { background: linear-gradient(135deg, #f6ad55, #ed64a6); color: #fff; }
.btn-ghost   { background: none; border: 1px solid #2d3748; color: #a0aec0; }
.btn-ghost:hover { border-color: #667eea; color: #e2e8f0; opacity: 1; }
.btn-danger  { background: none; border: 1px solid #742a2a; color: #fc8181; }
.btn-danger:hover { background: rgba(116,42,42,.2); opacity: 1; }
.btn-full    { width: 100%; }
.btn-new {
  width: 100%; background: linear-gradient(135deg, #667eea, #764ba2);
  border: none; border-radius: 10px; padding: 9px 0;
  font-size: 13px; font-weight: 600; color: #fff; cursor: pointer; transition: opacity .2s;
}
.btn-new:hover { opacity: .86; }
.btn-sm { border: none; border-radius: 6px; padding: 5px 11px; font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn-sm-ghost  { background: none; border: 1px solid #2d3748; color: #90cdf4; }
.btn-sm-ghost:hover  { background: #1a365d44; border-color: #90cdf4; }
.btn-sm-danger { background: none; border: 1px solid #742a2a; color: #fc8181; }
.btn-sm-danger:hover { background: #742a2a33; }

/* ── Form ────────────────────────────────────────────── */
.field { margin-top: 14px; }
.field-label {
  font-size: 11px; font-weight: 600; color: #718096;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}
.field-hint { font-size: 11px; color: #4a5568; margin-top: 5px; line-height: 1.5; }
input[type="text"], input[type="number"], input[type="password"],
input[type="file"], select, textarea {
  width: 100%; background: #0f1117; border: 1px solid #2d3748;
  border-radius: 8px; padding: 9px 12px; font-size: 14px; color: #f7fafc;
  outline: none; transition: border-color .18s; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: #667eea; }
input::placeholder, textarea::placeholder { color: #4a5568; }
input[readonly] { color: #718096; cursor: default; }
input[readonly]:focus { border-color: #2d3748; }
textarea { resize: vertical; font-family: "SF Mono","Fira Code",monospace; font-size: 12.5px; line-height: 1.65; }
select { cursor: pointer; }
select option { background: #1a1f2e; }
input[type="file"] { padding: 7px 12px; cursor: pointer; color: #a0aec0; }
input[type="file"]::-webkit-file-upload-button {
  background: #2d3748; border: none; border-radius: 5px; padding: 4px 10px;
  font-size: 12px; color: #e2e8f0; cursor: pointer; margin-right: 10px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── Toggle ──────────────────────────────────────────── */
.toggle-row   { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.toggle-label { font-size: 13px; color: #e2e8f0; }
.toggle       { position: relative; width: 38px; height: 21px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0; background: #2d3748;
  border-radius: 11px; cursor: pointer; transition: background .18s;
}
.toggle input:checked + .toggle-track { background: #667eea; }
.toggle-track::after {
  content: ""; position: absolute; width: 15px; height: 15px;
  background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: transform .18s;
}
.toggle input:checked + .toggle-track::after { transform: translateX(17px); }

/* ── Collapsible sections ────────────────────────────── */
.form-section { background: #1a1f2e; border: 1px solid #2d3748; border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.sec-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  cursor: pointer; user-select: none; transition: background .12s;
}
.sec-header:hover { background: rgba(102,126,234,.05); }
.sec-icon { width: 27px; height: 27px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.sec-name { font-size: 13px; font-weight: 600; color: #e2e8f0; flex: 1; }
.chevron  { color: #4a5568; font-size: 10px; transition: transform .18s; flex-shrink: 0; }
.sec-open .chevron   { transform: rotate(90deg); }
.sec-body            { display: none; padding: 2px 18px 18px; border-top: 1px solid #2d3748; }
.sec-open .sec-body  { display: block; }
.json-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.btn-fmt {
  background: none; border: 1px solid #2d3748; border-radius: 5px;
  padding: 2px 9px; font-size: 10px; color: #718096;
  cursor: pointer; font-family: inherit; transition: border-color .15s, color .15s;
}
.btn-fmt:hover { border-color: #667eea; color: #a0aec0; }
.char-count { font-size: 11px; color: #4a5568; margin-top: 5px; text-align: right; }

/* ── Cards ───────────────────────────────────────────── */
.card { background: #1a1f2e; border: 1px solid #2d3748; border-radius: 13px; padding: 18px 20px; }
.card-title { font-size: 11px; font-weight: 700; color: #718096; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 13px; }
.card-header { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid #2d3748; }
.card-icon   { width: 27px; height: 27px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.card-name   { font-size: 13px; font-weight: 600; color: #e2e8f0; flex: 1; }
.card-body   { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

/* ── Tabs ────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid #2d3748; padding: 0 24px; gap: 2px; flex-shrink: 0; background: #0f1117; }
.tab-btn {
  padding: 13px 16px 12px; font-size: 13px; font-weight: 600; color: #718096;
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; transition: color .15s, border-color .15s; margin-bottom: -1px; font-family: inherit;
}
.tab-btn:hover  { color: #a0aec0; }
.tab-btn.active { color: #e2e8f0; border-bottom-color: #48bb78; }
.tab-count { display: inline-block; background: #2d3748; border-radius: 20px; padding: 1px 7px; font-size: 11px; font-weight: 700; color: #a0aec0; margin-left: 6px; }
.tab-btn.active .tab-count { background: #2f4a38; color: #68d391; }

/* ── Table ───────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 10px; font-weight: 700; color: #718096; text-transform: uppercase; letter-spacing: .06em; padding: 0 14px 10px; border-bottom: 1px solid #2d3748; }
.data-table th:first-child { padding-left: 0; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #1e2535; vertical-align: middle; font-size: 13px; }
.data-table td:first-child { padding-left: 0; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #ffffff05; }

/* ── Drop zone ───────────────────────────────────────── */
.drop-zone {
  border: 2px dashed #2d3748; border-radius: 9px; padding: 24px 14px;
  text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
  position: relative; margin-bottom: 12px;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: #48bb78; background: #48bb7808; }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop-icon  { font-size: 26px; margin-bottom: 6px; }
.drop-title { font-size: 12px; font-weight: 600; color: #e2e8f0; margin-bottom: 3px; }
.drop-sub   { font-size: 11px; color: #718096; }
.file-pill  { display: inline-flex; align-items: center; gap: 6px; background: #0f1117; border: 1px solid #2d3748; border-radius: 20px; padding: 4px 10px; font-size: 11px; color: #a0aec0; margin-bottom: 10px; }
.file-pill .pname  { color: #e2e8f0; font-weight: 500; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pill .pclose { cursor: pointer; color: #718096; font-size: 14px; line-height: 1; transition: color .15s; }
.file-pill .pclose:hover { color: #fc8181; }
.progress-wrap { height: 3px; background: #2d3748; border-radius: 4px; margin-bottom: 10px; overflow: hidden; }
.progress-bar  { height: 100%; background: linear-gradient(90deg, #48bb78, #2f855a); border-radius: 4px; transition: width .4s; }

/* ── Spinner ─────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid #2d3748; border-top-color: #48bb78; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 5px; }

/* ── Character items ─────────────────────────────────── */
.char-item { padding: 10px 13px; border-radius: 10px; cursor: pointer; margin-bottom: 3px; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.char-item:hover  { background: rgba(102,126,234,.08); }
.char-item.active { background: rgba(102,126,234,.14); border-color: rgba(102,126,234,.28); }
.char-code { font-size: 12px; font-weight: 600; color: #f7fafc; font-family: "SF Mono","Fira Code",monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-meta { font-size: 11px; color: #718096; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── KB rows ─────────────────────────────────────────── */
.kb-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .15s; border: 1px solid transparent; margin-bottom: 2px; }
.kb-row:hover  { background: #ffffff08; }
.kb-row.active { background: #2f4a3844; border-color: #2f4a38; }
.kb-row-name   { flex: 1; font-size: 13px; font-weight: 500; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-row.active .kb-row-name { color: #68d391; }
.kb-row-count  { font-size: 11px; color: #718096; background: #2d3748; border-radius: 10px; padding: 1px 7px; flex-shrink: 0; }
.kb-row-del    { background: none; border: none; cursor: pointer; color: #4a5568; font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 4px; transition: color .15s; font-family: inherit; flex-shrink: 0; }
.kb-row-del:hover { color: #fc8181; background: #742a2a22; }

/* ── Search results ──────────────────────────────────── */
.result-card { background: #1a1f2e; border: 1px solid #2d3748; border-radius: 11px; overflow: hidden; margin-bottom: 10px; }
.result-card.open .result-chevron { transform: rotate(90deg); }
.result-card.open .result-body { display: block; }
.result-header   { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; user-select: none; }
.result-rank     { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #667eea, #764ba2); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }
.result-meta     { flex: 1; min-width: 0; }
.result-source   { font-size: 12px; font-weight: 600; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-score-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.score-bar-bg    { flex: 1; height: 4px; background: #2d3748; border-radius: 4px; overflow: hidden; }
.score-bar-fill  { height: 100%; border-radius: 4px; }
.score-label     { font-size: 10px; font-family: "SF Mono","Fira Code",monospace; white-space: nowrap; flex-shrink: 0; }
.score-good { color: #68d391; } .score-ok { color: #f6ad55; } .score-poor { color: #fc8181; }
.result-chevron  { color: #4a5568; font-size: 10px; transition: transform .2s; flex-shrink: 0; }
.result-body     { display: none; padding: 0 14px 14px; border-top: 1px solid #2d3748; }
.result-content  { font-size: 12px; color: #cbd5e0; line-height: 1.7; white-space: pre-wrap; word-break: break-word; padding-top: 12px; }

/* ── User Profile ────────────────────────────────────── */
.meta-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.meta-card  { background: #1a1f2e; border: 1px solid #2d3748; border-radius: 12px; padding: 16px 18px; }
.meta-card .mlabel { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #718096; margin-bottom: 6px; }
.meta-card .mvalue { font-size: 20px; font-weight: 700; color: #f7fafc; }
.meta-card .msub   { font-size: 12px; color: #a0aec0; margin-top: 4px; }
.section-card   { background: #1a1f2e; border: 1px solid #2d3748; border-radius: 14px; margin-bottom: 16px; overflow: hidden; }
.section-card.open .section-body  { display: block; }
.section-card.open .chevron { transform: rotate(90deg); }
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; cursor: pointer; user-select: none; transition: background .15s; }
.section-header:hover { background: rgba(102,126,234,.06); }
.section-title  { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: #e2e8f0; }
.section-icon   { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.section-body   { display: none; padding: 0 20px 20px; border-top: 1px solid #2d3748; }
.field-row      { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #1e2535; align-items: flex-start; }
.field-row:last-child { border-bottom: none; }
.field-key  { min-width: 180px; font-size: 12px; font-weight: 500; color: #718096; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; font-family: "SF Mono","Fira Code",monospace; }
.field-val  { font-size: 14px; color: #e2e8f0; flex: 1; line-height: 1.6; }
.val-null   { color: #4a5568; font-style: italic; }
.val-string { color: #68d391; }
.val-number { color: #f6ad55; }
.val-bool   { color: #76e4f7; }
.pill-list  { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { background: #2d3748; border-radius: 20px; padding: 4px 12px; font-size: 13px; color: #cbd5e0; }
.obs-item    { background: #0f1117; border-left: 3px solid #667eea; border-radius: 0 8px 8px 0; padding: 10px 14px; margin-bottom: 8px; }
.obs-ts      { font-size: 11px; color: #4a5568; margin-bottom: 4px; font-family: monospace; }
.obs-text    { font-size: 14px; color: #cbd5e0; line-height: 1.5; }
.memory-item { background: #0f1117; border-left: 3px solid #48bb78; border-radius: 0 8px 8px 0; padding: 10px 14px; margin-bottom: 8px; }
.memory-ts   { font-size: 11px; color: #4a5568; margin-bottom: 4px; font-family: monospace; }
.memory-text { font-size: 14px; color: #cbd5e0; line-height: 1.6; white-space: pre-wrap; }
.reminder-item  { background: #0f1117; border: 1px solid #2d3748; border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.reminder-title { font-size: 14px; font-weight: 600; color: #f7fafc; margin-bottom: 4px; }
.reminder-desc  { font-size: 13px; color: #a0aec0; margin-bottom: 8px; }
.reminder-meta  { display: flex; flex-wrap: wrap; gap: 8px; }
.reminder-badge { font-size: 11px; padding: 2px 10px; border-radius: 20px; background: #2d3748; color: #cbd5e0; font-family: "SF Mono","Fira Code",monospace; }
.reminder-badge.overdue  { background: #742a2a; color: #fc8181; }
.reminder-badge.upcoming { background: #1a365d; color: #90cdf4; }
.reminder-badge.recur    { background: #22543d; color: #68d391; }
.raw-json { display: none; margin-top: 8px; background: #0f1117; border: 1px solid #2d3748; border-radius: 7px; padding: 12px; font-family: "SF Mono","Fira Code",monospace; font-size: 11px; line-height: 1.6; color: #a0aec0; white-space: pre-wrap; word-break: break-word; overflow-x: auto; }

/* ── Voice Manager ───────────────────────────────────── */
.voice-item       { padding: 10px 13px; border-radius: 10px; cursor: pointer; margin-bottom: 3px; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.voice-item:hover  { background: rgba(246,173,85,.08); }
.voice-item.active { background: rgba(246,173,85,.14); border-color: rgba(246,173,85,.28); }
.voice-item-name   { font-size: 13px; font-weight: 600; color: #f7fafc; }
.voice-item-id     { font-size: 11px; color: #718096; margin-top: 3px; font-family: "SF Mono","Fira Code",monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.id-row            { display: flex; align-items: center; gap: 8px; }
.id-row input      { flex: 1; font-family: "SF Mono","Fira Code",monospace; font-size: 12px; }
.btn-copy          { background: none; border: 1px solid #2d3748; border-radius: 7px; padding: 8px 12px; font-size: 12px; color: #718096; cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s; flex-shrink: 0; font-family: inherit; }
.btn-copy:hover    { border-color: #f6ad55; color: #e2e8f0; }
.detail-grid       { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.audio-wrap audio  { width: 100%; border-radius: 8px; outline: none; margin-top: 10px; }

/* ── WebRTC ──────────────────────────────────────────── */
.webrtc-scroll   { flex: 1; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; }
.webrtc-card     { background: #1a1f2e; border: 1px solid #2d3748; border-radius: 20px; max-width: 600px; width: 100%; padding: 36px; }
.webrtc-title    { font-size: 22px; font-weight: 700; color: #f7fafc; text-align: center; margin-bottom: 6px; }
.webrtc-sub      { font-size: 14px; color: #718096; text-align: center; margin-bottom: 24px; }
.session-box     { background: #0f1117; border: 1px solid #2d3748; border-radius: 8px; padding: 8px 14px; margin-bottom: 16px; font-size: 12px; color: #718096; font-family: "SF Mono","Fira Code",monospace; word-break: break-all; }
.session-box.active { border-color: #2f4a38; color: #68d391; }
.wrtc-btns       { display: flex; gap: 12px; margin-bottom: 20px; }
.btn-connect     { flex: 1; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .3s; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; }
.btn-connect:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102,126,234,.4); }
.btn-connect:disabled { opacity: .5; cursor: not-allowed; }
.btn-disconnect  { flex: 1; background: #742a2a; color: #fff; border: none; border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .3s; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; }
.btn-disconnect:hover:not(:disabled) { background: #c53030; transform: translateY(-2px); }
.btn-disconnect:disabled { opacity: .5; cursor: not-allowed; background: #2d3748; }
.wrtc-status     { padding: 14px 20px; border-radius: 12px; text-align: center; font-weight: 500; margin-bottom: 16px; font-size: 14px; }
.wrtc-disconnected { background: #1e2535; color: #718096; }
.wrtc-connecting   { background: #2d2418; color: #f6ad55; }
.wrtc-connected    { background: #1a2e1a; color: #68d391; }
.wrtc-error        { background: #2d1a1a; color: #fc8181; }
.mic-indicator   { display: none; padding: 22px; border-radius: 12px; background: linear-gradient(135deg, #667eea, #764ba2); text-align: center; margin-bottom: 16px; }
.mic-indicator.active { display: block; }
.mic-icon        { font-size: 50px; display: block; margin-bottom: 8px; }
.audio-level     { width: 100%; height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.audio-level-bar { height: 100%; background: linear-gradient(to right, #4caf50, #ffc107, #f44336); border-radius: 4px; transition: width .1s; }
.transcript-box  { background: #0f1117; border: 1px solid #2d3748; border-radius: 10px; padding: 14px; min-height: 120px; max-height: 260px; overflow-y: auto; font-family: "SF Mono","Fira Code",monospace; font-size: 13px; line-height: 1.6; color: #a0aec0; }
.t-user      { border-left: 3px solid #667eea; padding-left: 10px; margin-bottom: 6px; color: #e2e8f0; }
.t-assistant { border-left: 3px solid #48bb78; padding-left: 10px; margin-bottom: 6px; color: #a0aec0; }
.wrtc-info   { background: #1a2d4a; border: 1px solid #1a365d; border-radius: 10px; padding: 14px; font-size: 13px; color: #90cdf4; margin-top: 16px; line-height: 1.6; }
.wrtc-info strong { display: block; margin-bottom: 5px; }

/* ── Page wrap (scrollable full-page content) ─────── */
.page-wrap { flex: 1; overflow-y: auto; min-height: 0; }
.page-header-icon { font-size: 24px; flex-shrink: 0; }
.page-title { font-size: 16px; font-weight: 700; color: #f7fafc; }
.page-sub   { font-size: 12px; color: #718096; margin-top: 2px; }

/* ── User Profile ────────────────────────────────────── */
.up-search-wrap { padding: 24px 24px 0; }
.up-results     { padding: 20px 24px 48px; }
.up-meta-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.up-meta-card   { background: #1a1f2e; border: 1px solid #2d3748; border-radius: 12px; padding: 14px 16px; }
.up-meta-label  { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #718096; margin-bottom: 6px; }
.up-meta-value  { font-size: 18px; font-weight: 700; color: #f7fafc; }
.sec-card       { background: #1a1f2e; border: 1px solid #2d3748; border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.sec-card .sec-header { justify-content: space-between; padding: 14px 18px; }
.sec-card.open .sec-body    { display: block; }
.sec-card.open .sec-chevron { transform: rotate(90deg); }
.sec-title  { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #e2e8f0; flex: 1; }
.sec-chevron { color: #4a5568; font-size: 10px; transition: transform .18s; flex-shrink: 0; }
.up-prompt-body { padding: 14px 18px; border-top: 1px solid #2d3748; white-space: pre-wrap; font-family: "SF Mono","Fira Code",monospace; font-size: 12px; color: #a0aec0; line-height: 1.7; max-height: 300px; overflow-y: auto; }
.up-raw-json    { margin-top: 12px; background: #0f1117; border: 1px solid #2d3748; border-radius: 10px; padding: 16px; font-family: "SF Mono","Fira Code",monospace; font-size: 11px; line-height: 1.6; color: #a0aec0; white-space: pre-wrap; word-break: break-word; overflow-x: auto; }
.val-array-item { background: #0f1117; border: 1px solid #2d3748; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 6px; }

/* ── Split layout sidebar (voice manager) ────────────── */
.split-sidebar      { background: #1a1f2e; border-right: 1px solid #2d3748; display: flex; flex-direction: column; overflow: hidden; }
.split-sidebar-top  { padding: 12px; border-bottom: 1px solid #2d3748; flex-shrink: 0; }
.split-sidebar-list { flex: 1; overflow-y: auto; padding: 8px; }
.sidebar-empty      { padding: 18px 12px; color: #4a5568; font-size: 13px; line-height: 1.6; }
.list-item          { padding: 10px 13px; border-radius: 10px; cursor: pointer; margin-bottom: 3px; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.list-item:hover    { background: rgba(246,173,85,.08); }
.list-item.active   { background: rgba(246,173,85,.14); border-color: rgba(246,173,85,.28); }
.list-item-name     { font-size: 13px; font-weight: 600; color: #f7fafc; }
.list-item-sub      { font-size: 11px; color: #718096; margin-top: 3px; font-family: "SF Mono","Fira Code",monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split-main         { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.split-panel-body   { flex: 1; overflow-y: auto; padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 16px; }
.panel-title-row    { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; }
.panel-title        { font-size: 15px; font-weight: 600; color: #f7fafc; display: block; }
.panel-sub          { font-size: 11px; color: #718096; margin-top: 2px; font-family: "SF Mono","Fira Code",monospace; display: block; }
.empty-state-icon   { font-size: 44px; }
.empty-state-text   { font-size: 14px; }

/* ── WebRTC (Vue component) ──────────────────────────── */
.webrtc-session-bar          { background: #0f1117; border: 1px solid #2d3748; border-radius: 8px; padding: 8px 14px; margin-bottom: 16px; font-size: 12px; color: #718096; font-family: "SF Mono","Fira Code",monospace; word-break: break-all; }
.webrtc-session-bar.active   { border-color: #2f4a38; color: #68d391; }
.webrtc-status-card          { padding: 14px 20px; border-radius: 12px; text-align: center; font-weight: 500; margin-bottom: 16px; font-size: 14px; transition: all .3s; }
.webrtc-status-disconnected  { background: #1e2535; color: #718096; }
.webrtc-status-connecting    { background: #2d2418; color: #f6ad55; }
.webrtc-status-connected     { background: #1a2e1a; color: #68d391; }
.webrtc-status-error         { background: #2d1a1a; color: #fc8181; }
.webrtc-mic-panel   { padding: 22px; border-radius: 12px; background: linear-gradient(135deg, #667eea, #764ba2); text-align: center; color: #fff; margin-bottom: 16px; }
.webrtc-mic-icon    { font-size: 54px; display: block; margin-bottom: 8px; }
.webrtc-level-track { width: 100%; height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.webrtc-level-bar   { height: 100%; background: linear-gradient(to right, #4caf50, #ffc107, #f44336); border-radius: 4px; transition: width .1s; }
.webrtc-transcript  { background: #0f1117; border: 1px solid #2d3748; border-radius: 10px; padding: 14px; min-height: 100px; max-height: 240px; overflow-y: auto; font-size: 13px; line-height: 1.6; }
.webrtc-transcript-line { padding: 4px 8px; border-left: 3px solid #667eea; margin-bottom: 6px; color: #e2e8f0; word-break: break-word; }
