/* ======================================================
   QuantumCrypto LLM — Design System (CSS Custom Properties)
   Dark/Light theme · Responsive · Quantum aesthetic
   ====================================================== */

/* ========== Claude-inspired warm neutral palette ==========
   Dark base: warm charcoal; light base: off-white paper. Accent: Claude
   coral-brick (#C96442). Minimal shadows, tighter typography, restraint. */
:root {
  /* Dark theme — warm charcoal */
  --bg-primary: #262624;
  --bg-secondary: #2D2C29;
  --bg-card: #2D2C29;
  --bg-card-hover: #343330;
  --bg-input: #30302D;
  --bg-input-hover: #38373A;
  --bg-input-focus: rgba(201,100,66,0.08);
  --bg-sidebar: #1F1E1D;
  --bg-header: transparent;
  --bg-modal: #2D2C29;
  --bg-overlay: rgba(20,19,18,0.66);
  --bg-toast: rgba(45,44,41,0.95);
  --bg-code: #1F1E1D;
  --bg-badge: #35342F;
  --bg-chip: #35342F;
  --bg-chip-hover: #403E38;
  --bg-user-bubble: #3C3A35;
  --bg-assistant: transparent;

  --text-primary: #E4E3DE;
  --text-secondary: #A9A69B;
  --text-muted: #7A766B;
  --text-heading: #F4F2EE;
  --text-link: #E38263;
  --text-code: #E8B783;

  --border-primary: rgba(255,255,255,0.06);
  --border-secondary: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --border-focus: #C96442;
  --border-card: rgba(255,255,255,0.05);

  /* Brand/accent — Claude coral-brick */
  --brand-500: #C96442;
  --brand-600: #B54D2A;
  --brand-700: #9A3F21;
  --accent-400: #E7B897;
  --accent-500: #D69872;

  --shadow-glow: rgba(201,100,66,0.22);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.10);

  --scrollbar-thumb: rgba(255,255,255,0.10);
  --scrollbar-thumb-hover: rgba(255,255,255,0.20);

  --gauge-bg: rgba(255,255,255,0.08);
  --progress-bg: rgba(255,255,255,0.06);

  color-scheme: dark;
}

[data-theme="light"] {
  /* Light theme — Claude's off-white paper */
  --bg-primary: #FAF9F5;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FCFBF7;
  --bg-input: #F5F3EE;
  --bg-input-hover: #EDEAE1;
  --bg-input-focus: rgba(201,100,66,0.06);
  --bg-sidebar: #F3F0E9;
  --bg-header: transparent;
  --bg-modal: #FFFFFF;
  --bg-overlay: rgba(38,36,32,0.40);
  --bg-toast: rgba(255,255,255,0.95);
  --bg-code: #F3F0E9;
  --bg-badge: #EDEAE1;
  --bg-chip: #EDEAE1;
  --bg-chip-hover: #E3DFD3;
  --bg-user-bubble: #EDEAE1;
  --bg-assistant: transparent;

  --text-primary: #2D2C29;
  --text-secondary: #60594C;
  --text-muted: #8C8473;
  --text-heading: #1A1918;
  --text-link: #C96442;
  --text-code: #B54D2A;

  --border-primary: rgba(45,44,41,0.08);
  --border-secondary: rgba(45,44,41,0.12);
  --border-hover: rgba(45,44,41,0.20);
  --border-focus: #C96442;
  --border-card: rgba(45,44,41,0.08);

  --shadow-glow: rgba(201,100,66,0.12);
  --shadow-card: 0 1px 2px rgba(45,44,41,0.06);

  --scrollbar-thumb: rgba(45,44,41,0.10);
  --scrollbar-thumb-hover: rgba(45,44,41,0.22);

  --gauge-bg: rgba(45,44,41,0.08);
  --progress-bg: rgba(45,44,41,0.06);

  color-scheme: light;
}

/* ========== Base ========== */
html, body { height: 100%; }
body {
  font-feature-settings: "cv11", "ss01";
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
*::-webkit-scrollbar-track { background: transparent; }

/* ========== Ambient glow ========== */
.ambient-glow { transition: opacity 0.3s ease; }
[data-theme="light"] .ambient-glow { opacity: 0.3; }

/* ========== Theme toggle ========== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  color: var(--text-secondary);
  background: transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}
.theme-toggle:hover {
  background: var(--bg-input-hover);
  color: var(--text-heading);
}

/* ========== Sidebar nav ========== */
#sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
  backdrop-filter: blur(20px);
  transition: background-color 0.3s ease;
}
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  width: 100%;
  padding: .55rem .75rem;
  border-radius: .625rem;
  font-size: .875rem;
  color: var(--text-secondary);
  transition: all .15s ease;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
}
.nav-item:hover { background: var(--bg-input-hover); color: var(--text-heading); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(6,182,212,.15));
  color: var(--text-heading);
  box-shadow: inset 0 0 0 1px rgba(99,102,241,.3);
}
.nav-ico {
  width: 1.75rem; height: 1.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-badge);
  border-radius: .5rem;
  font-size: .95rem;
}

/* ========== Cards ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 1rem;
  padding: 1.25rem;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-card);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.card-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border-primary);
}
.card-header h2 {
  font-size: .95rem; font-weight: 600;
  background: linear-gradient(90deg, var(--text-heading) 0%, var(--text-link) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ========== Inputs ========== */
.field { display: flex; flex-direction: column; gap: .375rem; }
.field > span:first-child {
  font-size: .7rem; font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.input {
  width: 100%;
  padding: .5625rem .75rem;
  font-size: .875rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-secondary);
  border-radius: .625rem;
  transition: all .15s ease;
  font-family: inherit;
}
.input::placeholder { color: var(--text-muted); }
.input:hover { border-color: var(--border-hover); }
.input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
textarea.input { resize: vertical; min-height: 3rem; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'><path d='M5.5 7.5L10 12l4.5-4.5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right .5rem center;
  padding-right: 2rem;
}
.checkbox {
  appearance: none;
  width: 1rem; height: 1rem;
  border: 1px solid var(--border-hover);
  border-radius: .25rem;
  background: var(--bg-input);
  cursor: pointer; transition: all .15s;
}
.checkbox:checked {
  background: var(--brand-500);
  border-color: var(--brand-500);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'><path d='M13.485 4.429a.75.75 0 010 1.06l-6.364 6.364a.75.75 0 01-1.06 0L2.515 8.308a.75.75 0 111.06-1.06l2.86 2.858 5.834-5.836a.75.75 0 011.06.06z'/></svg>");
  background-size: 12px; background-position: center; background-repeat: no-repeat;
}
.toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .375rem .75rem;
  font-size: .8rem;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  cursor: pointer; transition: all .15s;
}
.toggle:hover { background: var(--bg-input-hover); }
.toggle input { accent-color: var(--brand-500); }
.toggle:has(input:checked) {
  background: rgba(99,102,241,.15);
  border-color: rgba(99,102,241,.4);
  color: var(--text-link);
}

/* ========== Buttons ========== */
.btn-primary, .btn-ghost, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-weight: 500;
  cursor: pointer; transition: all .15s ease;
  white-space: nowrap;
  border: none;
}
.btn-primary {
  padding: .5625rem 1rem;
  font-size: .875rem;
  color: white;
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: .625rem;
  box-shadow: 0 4px 14px var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #7c7ef8 0%, #5b54e8 100%);
  box-shadow: 0 6px 20px rgba(99,102,241,.45), inset 0 1px 0 rgba(255,255,255,.2);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: .6; cursor: not-allowed;
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  box-shadow: none; transform: none;
}
.btn-ghost {
  padding: .5rem .875rem;
  font-size: .8rem;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-secondary);
  border-radius: .625rem;
}
.btn-ghost:hover { background: var(--bg-input-hover); color: var(--text-heading); }
.icon-btn {
  width: 2rem; height: 2rem;
  font-size: .875rem;
  color: var(--text-secondary);
  background: transparent;
  border-radius: .5rem;
}
.icon-btn:hover { background: var(--bg-input-hover); color: var(--text-heading); }

kbd {
  font-family: ui-monospace, monospace;
  padding: 1px 5px;
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  background: var(--bg-code);
}

/* ========== Status badge ========== */
.status-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .2rem .55rem;
  font-size: .7rem; font-weight: 500;
  border-radius: 999px;
}
.status-dot { width: .375rem; height: .375rem; border-radius: 999px; }
.status-unknown { color: var(--text-secondary); background: rgba(148,163,184,.1); }
.status-unknown .status-dot { background: var(--text-secondary); }
.status-ok { color: rgb(74 222 128); background: rgba(74,222,128,.1); }
.status-ok .status-dot { background: rgb(74 222 128); box-shadow: 0 0 8px rgb(74 222 128); }
.status-err { color: rgb(248 113 113); background: rgba(248,113,113,.12); }
.status-err .status-dot { background: rgb(248 113 113); }

/* ========== Chat bubbles ========== */
.msg { display: flex; gap: .75rem; animation: fadeUp .25s ease; }
.msg-avatar {
  width: 2rem; height: 2rem; flex-shrink: 0;
  border-radius: .625rem;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
}
.msg-user .msg-avatar { background: linear-gradient(135deg, #475569, #334155); }
.msg-assistant .msg-avatar {
  background: linear-gradient(135deg, rgba(99,102,241,.3), rgba(6,182,212,.2));
  box-shadow: 0 0 0 1px rgba(99,102,241,.3);
}
.msg-body {
  min-width: 0; flex: 1;
  padding: .75rem 1rem;
  border-radius: .875rem;
  font-size: .875rem;
  line-height: 1.65;
}
.msg-user .msg-body {
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
}
.msg-assistant .msg-body {
  background: linear-gradient(180deg, rgba(99,102,241,.08) 0%, rgba(99,102,241,.03) 100%);
  border: 1px solid rgba(99,102,241,.15);
}
.msg-body > :first-child { margin-top: 0; }
.msg-body > :last-child { margin-bottom: 0; }

.streaming::after {
  content: "\25CB";
  animation: blink 1s infinite;
  color: var(--brand-500);
  margin-left: 2px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ========== Spinner ========== */
.spinner {
  width: .875rem; height: .875rem;
  border: 2px solid rgba(99,102,241,.2);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== Prose ========== */
.prose { color: var(--text-primary); }
.prose :where(h1,h2,h3,h4) { color: var(--text-heading); letter-spacing: -.01em; }
.prose :where(strong) { color: var(--text-heading); }
.prose :where(a) { color: var(--text-link); }
.prose :where(code) {
  color: var(--text-code);
  background: var(--bg-badge);
  padding: 1px 5px; border-radius: 4px;
  font-size: .85em;
}
.prose :where(pre) {
  background: var(--bg-code) !important;
  border: 1px solid var(--border-primary);
  border-radius: .75rem;
  padding: 1rem !important;
  overflow: auto;
  font-size: .8rem;
  line-height: 1.55;
}
.prose :where(pre) :where(code) {
  background: transparent; padding: 0; color: inherit; font-size: inherit;
}
.prose :where(table) { font-size: .85em; }
.prose :where(th, td) { border-color: var(--border-primary); padding: .5rem .75rem; }
.prose :where(blockquote) { border-left-color: var(--brand-500); color: var(--text-secondary); }

/* ========== Example chips ========== */
.examples {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  padding: .375rem 0;
}
.example-label {
  font-size: .68rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-right: .25rem;
}
.chip {
  padding: .3rem .7rem;
  font-size: .72rem; font-weight: 500;
  color: var(--text-link);
  background: var(--bg-chip);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover {
  background: var(--bg-chip-hover);
  border-color: rgba(99,102,241,.4);
  color: var(--text-heading);
}

/* ========== Search result cards ========== */
.result-card {
  padding: .875rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: .75rem;
  transition: all .15s;
}
.result-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99,102,241,.25);
}
.result-rank {
  font-size: .7rem; font-weight: 600;
  color: var(--text-secondary);
  padding: .1rem .45rem;
  background: var(--bg-badge);
  border-radius: .35rem;
  font-family: ui-monospace, monospace;
}
.result-chip {
  font-size: .65rem; font-weight: 500;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--bg-badge);
  color: var(--text-secondary);
}
.result-chip-accent {
  background: rgba(6,182,212,.15);
  color: rgb(103 232 249);
}
.result-text {
  font-size: .78rem; line-height: 1.55;
  color: var(--text-secondary);
  background: transparent;
  padding: .25rem 0 0;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  max-height: 240px; overflow: auto;
}
.score-bar {
  width: 80px; height: 4px;
  background: var(--gauge-bg);
  border-radius: 999px; overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
  border-radius: 999px;
}

/* ========== Workflow timeline ========== */
.wf-timeline {
  position: relative;
  padding-left: 1rem;
  list-style: none;
}
.wf-timeline::before {
  content: "";
  position: absolute;
  left: 6px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, rgba(99,102,241,.4), rgba(99,102,241,.05));
}
.wf-step {
  position: relative;
  padding: .65rem 0 .65rem 1.25rem;
}
.wf-dot {
  position: absolute; left: -1rem; top: 1rem;
  width: .875rem; height: .875rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 2px solid var(--text-secondary);
}
.wf-ok .wf-dot { border-color: rgb(74 222 128); box-shadow: 0 0 10px rgba(74,222,128,.6); }
.wf-error .wf-dot { border-color: rgb(248 113 113); }
.wf-skipped .wf-dot { border-color: var(--text-muted); background: transparent; }
.wf-body {
  padding: .75rem .95rem;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: .625rem;
}
.wf-status-badge {
  font-size: .65rem; font-weight: 600;
  padding: .1rem .5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.wf-status-badge.status-ok { background: rgba(74,222,128,.12); color: rgb(134 239 172); }
.wf-status-badge.status-error { background: rgba(248,113,113,.12); color: rgb(252 165 165); }
.wf-status-badge.status-skipped { background: rgba(148,163,184,.12); color: var(--text-secondary); }
.wf-error {
  margin-top: .5rem;
  padding: .5rem .75rem;
  font-size: .7rem;
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.2);
  color: rgb(252 165 165);
  border-radius: .5rem;
  white-space: pre-wrap;
  max-height: 180px; overflow: auto;
}
.wf-preview {
  margin-top: .4rem;
  font-size: .72rem;
  color: var(--text-secondary);
  font-family: ui-monospace, monospace;
  white-space: pre-wrap;
}

/* ========== Toast ========== */
.toast {
  padding: .65rem .875rem;
  font-size: .8rem;
  color: var(--text-primary);
  background: var(--bg-toast);
  border: 1px solid var(--border-secondary);
  border-radius: .625rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  backdrop-filter: blur(12px);
  opacity: 0; transform: translateX(12px);
  transition: all .2s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-ok   { border-color: rgba(74,222,128,.35); color: rgb(74 222 128); }
.toast-err  { border-color: rgba(248,113,113,.35); color: rgb(248 113 113); }
.toast-warn { border-color: rgba(253,186,116,.35); color: rgb(253 186 116); }

/* ========== Code block — legacy absolute copy button is superseded by
   the .code-head strip below. Keep the hover target selector for any
   pre that hasn't been upgraded yet. ========== */
.prose pre, pre { position: relative; }

/* ========== Responsive / mobile ========== */
@media (max-width: 767px) {
  #sidebar {
    position: fixed; inset: 0 auto 0 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
  }
  #sidebar.sidebar-open { transform: translateX(0); }
  main { width: 100%; }
  .main-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========== Modal ========== */
#settingsModal:not(.hidden) { display: flex !important; animation: fadeIn .15s ease; }
#settingsModal > div { animation: popIn .2s ease; }
#helpModal:not(.hidden) { display: flex !important; animation: fadeIn .15s ease; }
#helpModal > div { animation: popIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ========== Language toggle ========== */
.lang-toggle {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-badge);
  border: 1px solid var(--border-primary);
  border-radius: .5rem;
}
.lang-toggle .lang-opt {
  flex: 1;
  padding: .3rem .5rem;
  font-size: 11px;
  color: var(--text-secondary);
  border-radius: .375rem;
  transition: all .15s ease;
  border: none;
  background: none;
  cursor: pointer;
}
.lang-toggle .lang-opt:hover { color: var(--text-primary); }
.lang-toggle .lang-opt.active {
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(6,182,212,.25));
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

/* ==============================================================
   NEW VIEWS
   ============================================================== */

/* ========== CBOM Explorer ========== */
.cbom-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.cbom-filters .input {
  flex: 1;
  min-width: 120px;
}
.cbom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.cbom-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: var(--bg-badge);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-primary);
}
.cbom-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
}
.cbom-table tr:hover td {
  background: var(--bg-card-hover);
}
.cbom-expand-btn {
  cursor: pointer;
  color: var(--text-link);
  font-size: 0.75rem;
  background: none;
  border: none;
  padding: 0.2rem 0.5rem;
}
.cbom-detail-row td {
  padding: 0.75rem 1rem;
  background: var(--bg-input);
}
.cbom-graph-container {
  margin-top: 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--bg-secondary);
}
.cbom-graph-container canvas {
  width: 100%;
  display: block;
}

/* ========== Migration Dashboard ========== */
.migration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.industry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 1rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.industry-card:hover {
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.15);
}
.industry-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
}

/* CSS-only radial gauge */
.gauge-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 0.75rem;
}
.gauge-bg, .gauge-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.gauge-bg {
  background: conic-gradient(var(--gauge-bg) 0deg, var(--gauge-bg) 360deg);
}
.gauge-fill {
  background: conic-gradient(
    var(--brand-500) 0deg,
    var(--accent-400) var(--gauge-angle, 0deg),
    transparent var(--gauge-angle, 0deg)
  );
  mask: radial-gradient(transparent 55%, black 56%);
  -webkit-mask: radial-gradient(transparent 55%, black 56%);
}
.gauge-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
}

/* Severity bars */
.severity-bar-container {
  margin: 0.5rem 0;
}
.severity-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.severity-bar {
  height: 6px;
  background: var(--progress-bg);
  border-radius: 999px;
  overflow: hidden;
}
.severity-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}
.severity-critical .severity-bar-fill { background: #ef4444; }
.severity-high .severity-bar-fill { background: #f97316; }
.severity-medium .severity-bar-fill { background: #eab308; }
.severity-low .severity-bar-fill { background: #22c55e; }

/* Stacked bar */
.stacked-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--progress-bg);
  margin-top: 0.5rem;
}
.stacked-bar > div {
  height: 100%;
  transition: width 0.5s ease;
}
.stacked-migrated { background: #22c55e; }
.stacked-inprogress { background: #eab308; }
.stacked-pending { background: var(--text-muted); }

/* Migration detail */
.migration-detail {
  animation: fadeUp 0.25s ease;
}
.migration-detail .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-link);
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: 1rem;
}
.migration-detail .back-btn:hover { text-decoration: underline; }

/* ========== Scan Progress ========== */
.scan-progress-container {
  padding: 1rem 0;
}
.scan-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}
.scan-step.active {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.05);
}
.scan-step.done {
  border-color: rgba(74,222,128,0.3);
}
.scan-step-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  background: var(--bg-badge);
  border: 2px solid var(--border-secondary);
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.scan-step.done .scan-step-icon {
  background: rgba(74,222,128,0.15);
  border-color: rgb(74,222,128);
  color: rgb(74,222,128);
}
.scan-step.active .scan-step-icon {
  background: rgba(99,102,241,0.15);
  border-color: var(--brand-500);
}
.scan-step-info {
  flex: 1;
  min-width: 0;
}
.scan-step-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
}
.scan-step-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.scan-overall-bar {
  margin-top: 1rem;
  height: 8px;
  background: var(--progress-bg);
  border-radius: 999px;
  overflow: hidden;
}
.scan-overall-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-400));
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ========== Cost Monitor ========== */
.cost-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.cost-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
}
.cost-card .cost-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.25rem;
}
.cost-card .cost-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cost-pie-container {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 1rem auto;
}
.cost-pie {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  position: relative;
}
.cost-pie-center {
  position: absolute;
  inset: 25%;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.cost-pie-center .cost-total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
}
.cost-pie-center .cost-unit {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.cost-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}
.cost-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.cost-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ========== Header bar ========== */
.main-header {
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  transition: background-color 0.3s ease;
}

/* ========== Result area ========== */
.result-area {
  background: var(--bg-secondary);
  transition: background-color 0.3s ease;
}
.result-header {
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-header);
}

/* ========== Status card ========== */
.status-card-wrap {
  background: var(--bg-badge);
  border-radius: 0.5rem;
}

/* Hidden utility */
.hidden { display: none !important; }

/* ========== Section group label ========== */
.nav-group-label {
  padding: 1rem 0.75rem 0.25rem;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ================================================================
   v3 — Claude-inspired calm minimalism
   Warm neutrals, subdued accents, typography first, restraint.
   ================================================================ */

/* ---- SVG icons ---- */
.i {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  stroke: currentColor;
  display: inline-block;
  vertical-align: middle;
}
.i-lg { width: 1.5rem; height: 1.5rem; }
.i-sm { width: .85rem; height: .85rem; }

/* ---- Paper background (subtle warm tint, no animation) ---- */
.paper-bg {
  background: var(--bg-primary);
}
[data-theme="light"] .paper-bg {
  background:
    radial-gradient(circle at 18% 12%, rgba(201,100,66,0.035), transparent 40%),
    radial-gradient(circle at 82% 88%, rgba(201,100,66,0.025), transparent 45%),
    var(--bg-primary);
}

/* ---- Logo mark — small, calm ---- */
.logo-mark {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-500);
  flex-shrink: 0;
}
.logo-mark .i { color: var(--brand-500); }

/* ---- Brand text — solid color, no animation ---- */
.brand-gradient {
  color: var(--text-heading);
  letter-spacing: -0.01em;
  font-weight: 600;
}

/* ---- Nav item — flat, quiet active state ---- */
.nav-item {
  position: relative;
  transition: background-color .12s ease, color .12s ease;
  border-radius: .5rem;
}
.nav-item:hover {
  background: var(--bg-input-hover);
  color: var(--text-heading);
}
.nav-item.active {
  background: var(--bg-input-hover);
  color: var(--text-heading);
  font-weight: 500;
}
.nav-item.active .nav-ico { color: var(--brand-500); }
.nav-ico {
  background: transparent;
  color: var(--text-muted);
  width: 1.5rem;
  height: 1.5rem;
  transition: color .12s ease;
}
.nav-item:hover .nav-ico { color: var(--text-primary); }

/* ---- Card — flat, minimal border ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: .75rem;
  padding: 1.25rem;
  transition: border-color .15s ease;
}
.card:hover { border-color: var(--border-secondary); }
.card-header h2 {
  background: none;
  -webkit-background-clip: unset;
  color: var(--text-heading);
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* ---- Primary button — solid brand, no shimmer ---- */
.btn-primary {
  background: var(--brand-500);
  color: #FFF;
  border: 1px solid var(--brand-600);
  font-weight: 500;
  transition: background .15s ease;
}
.btn-primary:hover { background: var(--brand-600); }
.btn-primary:disabled {
  background: var(--bg-input);
  color: var(--text-muted);
  border-color: var(--border-primary);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
  transition: background .15s ease, color .15s ease;
}
.btn-ghost:hover {
  background: var(--bg-input-hover);
  color: var(--text-heading);
}

/* ---- Settings button ---- */
.settings-btn { color: var(--text-secondary); }
.settings-btn:hover {
  background: var(--bg-input-hover);
  color: var(--text-heading);
}

/* ---- Theme toggle ---- */
.theme-toggle {
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-primary);
  transition: all .15s ease;
  position: relative;
}
.theme-toggle:hover {
  background: var(--bg-input-hover);
  color: var(--text-heading);
}
.theme-toggle .theme-sun,
.theme-toggle .theme-moon {
  position: absolute;
  transition: opacity .2s ease;
}
:root .theme-toggle .theme-sun { opacity: 0; }
:root .theme-toggle .theme-moon { opacity: 1; }
[data-theme="light"] .theme-toggle .theme-sun { opacity: 1; }
[data-theme="light"] .theme-toggle .theme-moon { opacity: 0; }

/* ---- Header pill ---- */
.header-pill {
  background: var(--bg-badge);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  letter-spacing: .01em;
  font-size: .7rem;
  padding: .2rem .625rem;
  border-radius: 999px;
}
.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--brand-500);
  opacity: 0.8;
}

/* ---- Hero empty state — Claude minimal welcome ---- */
.hero-empty {
  padding: 3rem 1.5rem;
  gap: 1rem;
  max-width: 32rem;
  margin: auto;
}
.hero-mark {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: var(--bg-badge);
  color: var(--brand-500);
  margin-bottom: .5rem;
}
.hero-mark .i-lg { width: 1.75rem; height: 1.75rem; }
.hero-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  max-width: 26rem;
  color: var(--text-heading);
}
.hero-sub {
  font-size: .9rem;
  color: var(--text-secondary);
  max-width: 24rem;
  line-height: 1.6;
  letter-spacing: 0;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  margin-top: .75rem;
}
.hero-chip {
  padding: .2rem .625rem;
  font-size: .7rem;
  letter-spacing: .01em;
  border-radius: 999px;
  background: var(--bg-badge);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  transition: background .15s ease, color .15s ease;
}
.hero-chip:hover {
  background: var(--bg-input-hover);
  color: var(--text-primary);
}
.hero-hint {
  margin-top: 1.25rem;
  font-size: .75rem;
  color: var(--text-muted);
}

/* ---- Chat thread — center column, readable max-width ---- */
#chatThread {
  max-width: 48rem;
  margin: 0 auto;
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}
#resultView { scroll-behavior: smooth; }
#rendered {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Chat message bubbles (Claude-style: user bubble right, assistant no bubble) ---- */
.msg { font-size: .95rem; line-height: 1.65; position: relative; }
.msg-user {
  background: var(--bg-user-bubble);
  color: var(--text-primary);
  border-radius: 1.125rem;
  padding: .625rem 1rem;
  margin-left: auto;
  max-width: 85%;
  display: block;
  width: fit-content;
}
.msg-assistant {
  background: transparent;
  color: var(--text-primary);
  padding: .25rem 0;
  max-width: 100%;
}
.msg-assistant::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--brand-500);
  margin-right: .5rem;
  opacity: 0.8;
}

/* Per-message toolbar — shown on hover, holds timestamp + copy */
.msg-tools {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .35rem;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .15s ease, transform .15s ease;
  font-size: .68rem;
  color: var(--text-muted);
}
.msg:hover .msg-tools,
.msg.streaming .msg-tools { opacity: 1; transform: translateY(0); }
.msg-ts {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .02em;
}
.msg-copy {
  font-size: .68rem;
  padding: .1rem .45rem;
  border-radius: .3rem;
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.msg-copy:hover {
  background: var(--bg-input-hover);
  color: var(--text-heading);
  border-color: var(--border-secondary);
}
.msg-user .msg-tools { justify-content: flex-end; }

/* Code-block header strip — shows language label + copy button */
.prose pre {
  position: relative;
}
.prose pre.has-code-head { padding-top: 0 !important; }
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -1rem .625rem -1rem;
  padding: .35rem .875rem .35rem 1rem;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border-primary);
  border-radius: .625rem .625rem 0 0;
  font-size: .65rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .04em;
  color: var(--text-muted);
}
[data-theme="light"] .code-head {
  background: rgba(45, 44, 41, 0.04);
}
.code-lang { text-transform: uppercase; }
.code-copy {
  font-size: .65rem;
  padding: .1rem .5rem;
  border-radius: .25rem;
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  cursor: pointer;
  position: static;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.code-copy:hover {
  background: var(--bg-input-hover);
  color: var(--text-heading);
  border-color: var(--border-secondary);
}

/* ---- Prose polish (Markdown rendered output) ---- */
.prose { color: var(--text-primary); }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text-heading);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.prose h2 { font-size: 1.2rem; margin-top: 1.5em; margin-bottom: .6em; }
.prose h3 { font-size: 1.05rem; margin-top: 1.25em; }
.prose p { line-height: 1.7; }
.prose code:not(pre code) {
  background: var(--bg-badge);
  border: 1px solid var(--border-primary);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--text-code);
}
.prose pre {
  background: var(--bg-code) !important;
  border: 1px solid var(--border-primary);
  border-radius: .625rem;
  padding: .875rem 1rem;
  font-size: .82rem;
  line-height: 1.55;
}
.prose blockquote {
  border-left: 2px solid var(--brand-500);
  background: var(--bg-badge);
  padding: .5rem .75rem;
  color: var(--text-secondary);
  font-style: normal;
}
.prose a { color: var(--text-link); text-decoration: underline; text-underline-offset: 2px; }
.prose table {
  font-size: .85rem;
  border: 1px solid var(--border-primary);
}
.prose th {
  background: var(--bg-badge);
  color: var(--text-heading);
  font-weight: 600;
}
.prose th, .prose td {
  border: 1px solid var(--border-primary);
  padding: .35rem .6rem;
}

/* ---- Chips (form example chips) — warm neutral ---- */
.chip {
  background: var(--bg-chip);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: .25rem .75rem;
  font-size: .75rem;
  transition: background .15s ease, color .15s ease;
}
.chip:hover {
  background: var(--bg-chip-hover);
  color: var(--text-primary);
  transform: none;
  border-color: var(--border-secondary);
}

/* ---- Input & select ---- */
.input {
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: .5rem;
  transition: border-color .15s ease, background .15s ease;
}
.input:hover { border-color: var(--border-secondary); }
.input:focus {
  border-color: var(--brand-500);
  background: var(--bg-secondary);
  box-shadow: 0 0 0 3px var(--bg-input-focus);
}

/* ---- Sidebar subtlety ---- */
aside#sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
}

/* ---- Reduce card animations (just subtle fade-in once) ---- */
.card { animation: soft-in .25s ease both; }
@keyframes soft-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-empty { animation: soft-in .3s ease both; }

/* ---- Scrollbar polish ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
  transition: background .2s ease;
}
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ---- Streaming typewriter ---- */
.stream-typewriter {
  position: relative;
  line-height: 1.65;
  animation: fade-up .25s ease both;
}
.stream-typewriter::after {
  content: "▍";
  display: inline-block;
  color: var(--text-link);
  margin-left: 2px;
  animation: blink-cursor 1s steps(2) infinite;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ======================================================
   Our Model panel — specialist / registry / base candidates
   ====================================================== */
.our-model-root {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 960px;
}
.om-section { display: flex; flex-direction: column; gap: .75rem; }
.om-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border-primary);
}
.om-section-head h3 {
  margin: 0;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.om-updated { font-size: .7rem; color: var(--text-muted); font-family: "JetBrains Mono", monospace; }

.om-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem;
}
.om-stack { display: flex; flex-direction: column; gap: .75rem; }

.om-card, .om-reg, .om-cand {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: .75rem;
  padding: 1rem;
  transition: border-color .15s ease, transform .15s ease;
}
.om-card:hover, .om-reg:hover, .om-cand:hover {
  border-color: var(--border-secondary);
}
.om-card-hero {
  background: linear-gradient(135deg, rgba(201,100,66,0.10) 0%, var(--bg-card) 60%);
  border-color: rgba(201,100,66,0.35);
}
.om-card-hero:hover { border-color: rgba(201,100,66,0.55); }

.om-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.om-kind {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.om-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: var(--bg-badge);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}
.om-status .status-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--text-muted);
}
.om-status.ok       { color: rgb(134 239 172); background: rgba(74,222,128,.10); border-color: rgba(74,222,128,.22); }
.om-status.ok .status-dot { background: rgb(74, 222, 128); box-shadow: 0 0 6px rgba(74,222,128,.55); }
.om-status.warn     { color: rgb(253 224 71); background: rgba(234,179,8,.10); border-color: rgba(234,179,8,.24); }
.om-status.warn .status-dot { background: rgb(234, 179, 8); }
.om-status.info     { color: rgb(165 180 252); background: rgba(99,102,241,.10); border-color: rgba(99,102,241,.25); }
.om-status.info .status-dot { background: rgb(99, 102, 241); }

.om-id {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .78rem;
  color: var(--text-heading);
  word-break: break-all;
  margin-bottom: .25rem;
}
.om-name {
  font-size: .72rem;
  color: var(--text-secondary);
  margin-bottom: .5rem;
}
.om-notes {
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: .5rem;
}

.om-reg-id {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-heading);
}
.om-reg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  font-size: .7rem;
  color: var(--text-secondary);
  margin-top: .25rem;
}
.om-reg-meta code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .68rem;
  padding: .05rem .35rem;
  background: var(--bg-badge);
  border-radius: .25rem;
  color: var(--text-code);
}
.om-links {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .5rem;
}
.om-link {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .65rem;
  padding: .1rem .4rem;
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  border-radius: .3rem;
  color: var(--text-secondary);
  word-break: break-all;
}
.om-license { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .65rem; color: var(--text-muted); }

.om-rank {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-500);
}
.om-cand-score {
  font-size: .7rem;
  color: var(--text-muted);
}
.om-cand-score b { color: var(--text-heading); font-weight: 600; }

.om-empty {
  padding: 1.25rem;
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border-secondary);
  border-radius: .75rem;
}

.om-flags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.om-flag {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .65rem;
  padding: .15rem .45rem;
  border-radius: .3rem;
  background: var(--bg-badge);
  color: var(--text-muted);
  border: 1px solid var(--border-primary);
}
.om-flag.on { color: rgb(134 239 172); border-color: rgba(74,222,128,.25); background: rgba(74,222,128,.06); }
.om-flag.off { color: rgb(252 165 165); border-color: rgba(248,113,113,.25); background: rgba(248,113,113,.06); }

/* ======================================================
   Small polish: status card in sidebar, nav header, chat bubble
   ====================================================== */
.status-card-wrap {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-card);
  border-radius: .625rem;
  transition: border-color .15s ease;
}
.status-card-wrap:hover { border-color: var(--border-secondary); }

/* Brighter active nav state on hover (subtle) */
.nav-item {
  padding-left: .625rem;
  padding-right: .625rem;
  padding-top: .425rem;
  padding-bottom: .425rem;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--brand-500);
  opacity: .8;
}

/* ======================================================
   Modal refresh — shared container for settings + help
   ====================================================== */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg-overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: modal-fade .18s ease;
}
.modal-root.hidden { display: none; }
.modal-card {
  width: 100%;
  max-width: 28rem;
  background: var(--bg-modal);
  border: 1px solid var(--border-secondary);
  border-radius: 1rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: modal-pop .22s cubic-bezier(.2, .8, .2, 1);
}
.modal-root-wide .modal-card { max-width: 36rem; }
[data-theme="light"] .modal-card {
  box-shadow: 0 12px 40px rgba(45, 44, 41, 0.16), 0 2px 8px rgba(45, 44, 41, 0.08);
}
@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem 1rem 1.25rem;
  border-bottom: 1px solid var(--border-primary);
  background: linear-gradient(180deg, rgba(201,100,66,0.05) 0%, transparent 100%);
}
.modal-head-title { display: flex; align-items: center; gap: .8rem; }
.modal-head-ico {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .6rem;
  background: rgba(201, 100, 66, 0.12);
  color: var(--brand-500);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-head-ico .i { width: 1.1rem; height: 1.1rem; }
.modal-head-h {
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-heading);
  margin: 0;
}
.modal-head-sub {
  font-size: .72rem;
  color: var(--text-muted);
  margin: .15rem 0 0 0;
  line-height: 1.45;
}

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.modal-body-loose { padding: 1.25rem 1.25rem 1.5rem; gap: 1.25rem; }
.modal-foot {
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--border-primary);
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  background: linear-gradient(0deg, rgba(255,255,255,0.015) 0%, transparent 100%);
}

.modal-note {
  font-size: .68rem;
  color: var(--text-muted);
  line-height: 1.55;
  padding: .5rem .75rem;
  border-left: 2px solid var(--border-secondary);
  background: rgba(255, 255, 255, 0.015);
  border-radius: 0 .3rem .3rem 0;
}
[data-theme="light"] .modal-note {
  background: rgba(45, 44, 41, 0.025);
}

/* Input with a leading icon (settings modal) */
.input-with-ico {
  position: relative;
  display: block;
}
.input-with-ico .input-ico {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}
.input-with-ico .input {
  padding-left: 2.1rem;
}

/* Model preview inside settings — quick visual confirmation of selection */
.cfg-preview {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .75rem;
  border-radius: .5rem;
  background: var(--bg-badge);
  border: 1px solid var(--border-primary);
  font-size: .72rem;
  color: var(--text-secondary);
}
.cfg-preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--brand-500);
  box-shadow: 0 0 6px rgba(201, 100, 66, 0.45);
}
.cfg-preview code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .7rem;
  color: var(--text-code);
}

/* ======================================================
   Main header — model chip (dynamic replacement for static pill)
   ====================================================== */
.model-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .75rem .3rem .55rem;
  border-radius: 999px;
  background: var(--bg-badge);
  border: 1px solid var(--border-primary);
  font-size: .7rem;
  color: var(--text-secondary);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.model-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-secondary);
  color: var(--text-heading);
}
.model-chip .mc-ico {
  width: 1rem;
  height: 1rem;
  color: var(--brand-500);
}
.model-chip .mc-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-muted);
}
.model-chip[data-health="ok"] .mc-dot {
  background: rgb(74, 222, 128);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.55);
}
.model-chip[data-health="warn"] .mc-dot {
  background: rgb(234, 179, 8);
}
.model-chip[data-health="err"] .mc-dot {
  background: rgb(248, 113, 113);
}
.model-chip .mc-id { font-weight: 600; color: var(--text-heading); }

/* ---- Reduce motion support ---- */
@media (prefers-reduced-motion: reduce) {
  .logo-mark .i,
  .brand-gradient,
  .orbit-group, .orbit-1,
  .electron-1, .electron-2, .electron-3,
  .animate-float-slow, .animate-float-slow-reverse, .animate-pulse-slow,
  .pulse-dot {
    animation: none !important;
  }
  .card, .hero-empty { animation: none !important; }
}
