/* ─── Reset & Variables ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #080b14;
  --surface:   #0d1120;
  --glass:     rgba(255,255,255,.04);
  --glass2:    rgba(255,255,255,.07);
  --border:    rgba(255,255,255,.08);
  --border-hl: rgba(108,99,255,.5);
  --purple:    #6c63ff;
  --teal:      #00d4aa;
  --orange:    #ff8c42;
  --blue:      #4facfe;
  --red:       #ff5c5c;
  --yellow:    #ffb347;
  --text:      #e4e8f1;
  --text-muted:#7a7f9a;
  --text-dim:  #4a4f6a;
  --sidebar-w: 240px;
  --topbar-h:  56px;
  --radius:    14px;
  --radius-sm: 8px;
  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
  --shadow:    0 8px 32px rgba(0,0,0,.4);
  --glow-p:    0 0 20px rgba(108,99,255,.35);
  --glow-t:    0 0 20px rgba(0,212,170,.35);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Animated Background ───────────────────────────────────────────────────── */
.bg-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.mesh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: float 12s ease-in-out infinite;
}

.orb-1 { width: 500px; height: 500px; background: var(--purple); top: -150px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: var(--teal);   bottom: -100px; right: -80px; animation-delay: 4s; }
.orb-3 { width: 300px; height: 300px; background: var(--blue);   top: 40%; left: 40%; animation-delay: 8s; }

@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(30px,-30px) scale(1.05); }
  66%      { transform: translate(-20px,20px) scale(.95); }
}

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(13,17,32,.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.brand-logo { flex-shrink: 0; }

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.brand-name span { color: var(--purple); }

.brand-sub {
  font-size: .65rem;
  color: var(--text-muted);
  font-family: var(--mono);
  letter-spacing: .05em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  overflow-y: auto;
}

.nav-section-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text-dim);
  padding: .75rem .5rem .35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: all .18s;
  position: relative;
}

.nav-item:hover {
  color: var(--text);
  background: var(--glass2);
}

.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(108,99,255,.18), transparent);
  border-left: 2px solid var(--purple);
  padding-left: calc(.75rem - 2px);
}

.nav-icon { display: flex; align-items: center; flex-shrink: 0; }

.nav-active-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 6px var(--purple);
  margin-left: auto;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.agent-status {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

.status-dot.pulse {
  box-shadow: 0 0 0 0 rgba(0,212,170,.6);
  animation: ping 2s ease-in-out infinite;
}

@keyframes ping {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,212,170,.6); }
  50%      { box-shadow: 0 0 0 6px rgba(0,212,170,0); }
}

.status-label { font-size: .7rem; color: var(--text-muted); }
.status-value { font-size: .8rem; color: var(--teal); font-weight: 600; font-family: var(--mono); }

/* ─── Main wrapper ──────────────────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── Top bar ───────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: rgba(8,11,20,.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
}

.page-breadcrumb {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.topbar-right { display: flex; gap: .5rem; align-items: center; }

.topbar-badge {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: .3rem .7rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.topbar-badge.accent2 { border-color: rgba(0,212,170,.25); color: var(--teal); }

/* ─── Content ───────────────────────────────────────────────────────────────── */
.content {
  padding: 2rem;
  flex: 1;
  max-width: 1200px;
  width: 100%;
}

/* ─── Glass card ────────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
  font-family: var(--font);
}

.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(.97); }

.btn-primary  { background: var(--purple); color: #fff; }
.btn-secondary{ background: var(--teal);   color: #0a0f1a; }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--glass2); }
.btn-outline  { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--purple); color: var(--purple); }

.btn-glow.btn-primary  { box-shadow: 0 0 0 0 rgba(108,99,255,.5); }
.btn-glow.btn-primary:hover:not(:disabled)  { box-shadow: var(--glow-p); transform: translateY(-1px); }
.btn-glow.btn-secondary{ box-shadow: 0 0 0 0 rgba(0,212,170,.5); }
.btn-glow.btn-secondary:hover:not(:disabled){ box-shadow: var(--glow-t); transform: translateY(-1px); }

.btn-lg  { padding: .85rem 1.75rem; font-size: .95rem; border-radius: 10px; }
.btn-sm  { padding: .45rem .95rem; font-size: .8rem; }

.btn-ghost-sm {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .75rem;
  cursor: pointer;
  padding: .15rem .4rem;
  border-radius: 4px;
  font-family: var(--font);
  transition: color .15s, background .15s;
}
.btn-ghost-sm:hover { color: var(--text); background: var(--glass2); }

.btn-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.btn-icon-sm:hover { background: var(--glass2); color: var(--text); }
.btn-icon-sm.btn-danger { color: var(--red); }
.btn-icon-sm.btn-danger:hover { background: rgba(255,92,92,.1); border-color: rgba(255,92,92,.3); }

/* ─── Hero section ──────────────────────────────────────────────────────────── */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: .75rem;
}

.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  animation: ping 2s ease-in-out infinite;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--purple), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 1.75rem;
}

.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Terminal card */
.terminal-card {
  background: rgba(0,0,0,.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .75rem 1rem;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
}

.t-dot { width: 11px; height: 11px; border-radius: 50%; }
.t-dot.red    { background: #ff5f57; }
.t-dot.yellow { background: #febc2e; }
.t-dot.green  { background: #28c840; }
.t-title { font-size: .75rem; color: var(--text-muted); margin-left: .5rem; font-family: var(--mono); }

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 2;
}

.t-line { white-space: pre; }
.t-blank { height: .5rem; }
.t-keyword { color: #c792ea; }
.t-fn      { color: #82aaff; }
.t-str     { color: #c3e88d; }
.t-comment { color: #546e7a; font-style: italic; }
.t-out     { color: var(--text-muted); }
.t-arrow   { color: var(--purple); }
.t-ok      { color: var(--teal); }

/* ─── Stats row ─────────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color .2s, transform .2s;
}

.stat-card:hover { border-color: rgba(108,99,255,.3); transform: translateY(-2px); }

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.purple { background: rgba(108,99,255,.2); color: var(--purple); }
.stat-icon.teal   { background: rgba(0,212,170,.15); color: var(--teal); }
.stat-icon.orange { background: rgba(255,140,66,.15); color: var(--orange); }
.stat-icon.blue   { background: rgba(79,172,254,.15); color: var(--blue); }

.stat-value { font-size: 1.4rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }

/* ─── Section title ─────────────────────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-title h2 { font-size: 1.1rem; font-weight: 700; }
.section-line { flex: 1; height: 1px; background: var(--border); }
.section-action { font-size: .8rem; color: var(--purple); text-decoration: none; font-weight: 600; }

/* ─── Feature grid ──────────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.feature-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all .25s;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.card-purple::before { background: linear-gradient(90deg, var(--purple), transparent); }
.card-teal::before   { background: linear-gradient(90deg, var(--teal),   transparent); }

.feature-card:hover {
  transform: translateY(-3px);
}
.card-purple:hover { border-color: rgba(108,99,255,.35); box-shadow: 0 8px 30px rgba(108,99,255,.1); }
.card-teal:hover   { border-color: rgba(0,212,170,.3);   box-shadow: 0 8px 30px rgba(0,212,170,.08); }

.fc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fc-icon { font-size: 2rem; }

.fc-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 20px;
  background: var(--glass2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.feature-card h3 { font-size: 1.1rem; font-weight: 700; }
.feature-card p  { color: var(--text-muted); line-height: 1.65; font-size: .875rem; flex: 1; }

.fc-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-chip {
  font-size: .68rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 20px;
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.fc-actions { display: flex; gap: .5rem; }

/* ─── Page header ───────────────────────────────────────────────────────────── */
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: .3rem;
}

.page-subtitle { color: var(--text-muted); font-size: .875rem; line-height: 1.6; }
.page-header-actions { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; }

/* ─── Agent pipeline chips ──────────────────────────────────────────────────── */
.agent-chips {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  padding: 1rem 1.25rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.agent-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .85rem;
}

.agent-chip.chip-db { border-color: rgba(0,212,170,.2); }

.chip-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.chip-db .chip-num { background: var(--teal); color: #0a0f1a; }

.chip-name { font-size: .78rem; font-weight: 700; font-family: var(--mono); color: var(--text); }
.chip-desc { font-size: .68rem; color: var(--text-muted); }

.agent-chip-arrow { color: var(--text-dim); font-size: .9rem; }

/* ─── Split layout ──────────────────────────────────────────────────────────── */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1.25rem;
  align-items: start;
}

.split-form { display: flex; flex-direction: column; gap: 1.25rem; }
.split-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.sidebar-card { padding: 1.1rem; }
.sidebar-card h4 { font-size: .85rem; font-weight: 700; margin-bottom: .75rem; color: var(--text-muted); }

.mini-history-item {
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}
.mini-history-item:last-of-type { border-bottom: none; }
.mhi-row { display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; }
.mini-lang { font-size: .7rem; font-weight: 700; font-family: var(--mono); color: var(--text-muted); }
.mhi-preview { font-size: .75rem; color: var(--text-muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mhi-meta { font-size: .65rem; color: var(--text-dim); margin-top: .2rem; }

/* ─── Form elements ─────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .5rem; }

label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .01em;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label-actions { display: flex; gap: .25rem; }

.optional-label {
  font-size: .7rem;
  font-weight: 400;
  color: var(--text-dim);
  font-style: italic;
}

textarea, select, input[type="text"] {
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: .875rem;
  padding: .75rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

textarea:focus, select:focus, input[type="text"]:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(108,99,255,.12);
}

textarea { resize: vertical; min-height: 100px; }
.code-textarea { font-family: var(--mono); font-size: .82rem; }
select { cursor: pointer; }

.char-count {
  font-size: .7rem;
  color: var(--text-dim);
  text-align: right;
  font-family: var(--mono);
}

.lang-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.severity-legend {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  color: var(--text-muted);
  padding-bottom: .75rem;
  white-space: nowrap;
}

.sev-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.sev-dot.critical { background: #fc8181; }
.sev-dot.error    { background: #ff5c5c; }
.sev-dot.warning  { background: #ffb347; }
.sev-dot.info     { background: #63b3ed; }

.form-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ─── Loader ────────────────────────────────────────────────────────────────── */
.loader-section { margin-top: 1.5rem; }

.loader-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.loader-agents {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.agent-running {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.agent-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(108,99,255,.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

.agent-spinner.teal {
  border-color: rgba(0,212,170,.2);
  border-top-color: var(--teal);
}

@keyframes spin { to { transform: rotate(360deg); } }

.agent-name { font-size: .82rem; font-weight: 600; font-family: var(--mono); }
.agent-task { font-size: .75rem; color: var(--text-muted); }

.loader-bar {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--teal));
  border-radius: 3px;
  animation: progress 2.5s ease-in-out infinite;
}

.loader-bar-fill.teal {
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

@keyframes progress {
  0%  { width: 0%; margin-left: 0; }
  50% { width: 70%; margin-left: 0; }
  100%{ width: 0%; margin-left: 100%; }
}

.loader-label {
  text-align: center;
  font-size: .78rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.hidden { display: none !important; }

/* ─── Results grid ──────────────────────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.result-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-card.full-width { grid-column: 1 / -1; }

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-card-title {
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.result-badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .15rem .5rem;
  border-radius: 20px;
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.result-timing {
  font-size: .7rem;
  color: var(--text-dim);
  font-family: var(--mono);
  background: var(--glass2);
  padding: .2rem .55rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.result-summary { color: var(--text-muted); font-size: .875rem; line-height: 1.65; }

/* Score ring */
.score-section { display: flex; align-items: center; gap: 1.25rem; }

.score-ring {
  position: relative;
  width: 72px; height: 72px;
  flex-shrink: 0;
}

.score-ring svg { transform: rotate(-90deg); }

.score-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
}

/* Issues */
.issues-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.issues-list { display: flex; flex-direction: column; gap: .4rem; }

.issue-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .55rem .75rem;
  border-radius: 8px;
  font-size: .82rem;
  border-left: 3px solid;
}

.issue-item.critical { background: rgba(252,129,129,.08); border-left-color: #fc8181; }
.issue-item.error    { background: rgba(255,92,92,.08);   border-left-color: var(--red); }
.issue-item.warning  { background: rgba(255,179,71,.08);  border-left-color: var(--yellow); }
.issue-item.info     { background: rgba(99,179,237,.08);  border-left-color: var(--blue); }

.issue-line {
  font-family: var(--mono);
  font-size: .7rem;
  background: var(--glass2);
  border-radius: 4px;
  padding: .1rem .4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.issue-text { flex: 1; line-height: 1.5; color: var(--text-muted); }
.issue-sev  { font-weight: 700; color: var(--text); }

.no-issues {
  text-align: center;
  color: var(--teal);
  padding: 1rem;
  font-weight: 600;
  font-size: .9rem;
  background: rgba(0,212,170,.06);
  border: 1px solid rgba(0,212,170,.15);
  border-radius: var(--radius-sm);
}

/* Topics */
.topics-wrap { display: flex; flex-wrap: wrap; gap: .4rem; }

.topic-chip {
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 20px;
  background: rgba(108,99,255,.12);
  border: 1px solid rgba(108,99,255,.2);
  color: var(--purple);
  font-family: var(--mono);
}

/* Onboarding phases */
.phases-list { display: flex; flex-direction: column; gap: 1rem; }

.phase-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.phase-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  background: var(--glass2);
}

.phase-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.phase-name { font-size: .85rem; font-weight: 700; }

.phase-tasks {
  list-style: none;
  padding: .75rem 1rem .75rem 2.75rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.phase-tasks li {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  position: relative;
}

.phase-tasks li::before {
  content: '→';
  position: absolute;
  left: -1.25rem;
  color: var(--teal);
}

/* Saved banner */
.saved-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.25rem;
  background: rgba(0,212,170,.06);
  border: 1px solid rgba(0,212,170,.2);
  border-radius: var(--radius-sm);
  font-size: .875rem;
}

.saved-banner strong { color: var(--teal); }

/* ─── History table ─────────────────────────────────────────────────────────── */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.table-count { font-size: .8rem; color: var(--text-muted); font-family: var(--mono); }

.table-search {
  width: 220px;
  padding: .4rem .8rem;
  font-size: .8rem;
  border-radius: var(--radius-sm);
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
}

.table-search:focus { border-color: var(--purple); }

.history-table-wrap { overflow-x: auto; }

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.history-table th {
  background: rgba(255,255,255,.02);
  padding: .65rem 1rem;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.history-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}

.history-row { transition: background .15s; }
.history-row:hover td { background: rgba(255,255,255,.02); }
.history-table tr:last-child td { border-bottom: none; }

.id-cell { font-family: var(--mono); font-size: .75rem; color: var(--text-dim); }
.lang-cell { font-family: var(--mono); font-size: .78rem; color: var(--text-muted); }
.score-cell { font-family: var(--mono); font-weight: 600; }
.preview-cell { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
.date-cell { white-space: nowrap; color: var(--text-dim); font-size: .75rem; font-family: var(--mono); }

.row-actions { display: flex; gap: .35rem; }

/* Tags */
.tag {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.tag-onboarding   { background: rgba(108,99,255,.15); color: var(--purple); border: 1px solid rgba(108,99,255,.2); }
.tag-code_review  { background: rgba(0,212,170,.1);   color: var(--teal);   border: 1px solid rgba(0,212,170,.2); }

/* Grade badges */
.grade-badge {
  display: inline-flex;
  width: 1.9rem; height: 1.9rem;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .78rem;
  color: #fff;
}

.grade-A { background: linear-gradient(135deg,#48bb78,#38a169); }
.grade-B { background: linear-gradient(135deg,#4299e1,#3182ce); }
.grade-C { background: linear-gradient(135deg,#ed8936,#c05621); }
.grade-D { background: linear-gradient(135deg,#e53e3e,#c53030); }

/* Empty state */
.empty-cta {
  text-align: center;
  padding: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}

.empty-icon { font-size: 3rem; }
.empty-cta h3 { font-size: 1.1rem; font-weight: 700; }
.empty-cta p  { color: var(--text-muted); font-size: .875rem; }
.empty-actions { display: flex; gap: .75rem; margin-top: .5rem; }

/* ─── Toast ─────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn .25s ease;
  max-width: 320px;
}

.toast.success { border-color: rgba(0,212,170,.3); color: var(--teal); }
.toast.error   { border-color: rgba(255,92,92,.3);  color: var(--red); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ─── Solutions & Code Diffs ────────────────────────────────────────────────── */
.solution-card {
  border-color: rgba(108,99,255,.3);
  background: linear-gradient(180deg, rgba(108,99,255,.05), rgba(13,17,32,.7));
}

.solution-count-tag {
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
  background: rgba(0,212,170,.15);
  color: var(--teal);
  border: 1px solid rgba(0,212,170,.3);
  margin-left: .5rem;
}

.solutions-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: .5rem;
}

.solution-item {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  transition: border-color .2s;
}

.solution-item:hover {
  border-color: rgba(108,99,255,.4);
}

.solution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

.solution-title-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.solution-badge {
  font-size: .7rem;
  font-weight: 800;
  font-family: var(--mono);
  background: var(--purple);
  color: #fff;
  padding: .2rem .55rem;
  border-radius: 4px;
}

.solution-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}

.solution-docs-link {
  font-size: .78rem;
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
  transition: color .15s;
}
.solution-docs-link:hover {
  text-decoration: underline;
  color: #fff;
}

.solution-explanation {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Code Diff Container */
.code-diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: .25rem;
}

@media (max-width: 768px) {
  .code-diff-container {
    grid-template-columns: 1fr;
  }
}

.diff-pane {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(8,11,20,.6);
}

.diff-before { border-color: rgba(255,92,92,.25); }
.diff-after  { border-color: rgba(0,212,170,.3); }

.diff-header {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .85rem;
  font-size: .75rem;
  font-weight: 600;
  font-family: var(--mono);
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
}

.diff-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.diff-dot.red   { background: var(--red); box-shadow: 0 0 6px var(--red); }
.diff-dot.green { background: var(--teal); box-shadow: 0 0 6px var(--teal); }

.diff-code {
  padding: .85rem 1rem;
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.5;
  overflow-x: auto;
  color: var(--text);
}
.diff-before .diff-code { background: rgba(255,92,92,.03); }
.diff-after .diff-code  { background: rgba(0,212,170,.03); }

/* Full Refactored Section */
.refactored-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.refactored-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.refactored-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--teal);
}

.refactored-subtitle {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

.refactored-pre {
  background: #050811;
  border: 1px solid rgba(0,212,170,.25);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.6;
  color: #a8b2d1;
  overflow-x: auto;
  max-height: 400px;
}

/* ─── Authentication & Profile ─────────────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-h) - 4rem);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(13,17,32,.75);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 0 40px rgba(108,99,255,.12);
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}

.auth-logo-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--glass2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(108,99,255,.25);
  margin-bottom: .25rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.auth-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
}

/* Flash alerts */
.auth-flash-container {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.auth-flash {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 500;
}

.auth-flash.error {
  background: rgba(255,92,92,.1);
  border: 1px solid rgba(255,92,92,.3);
  color: var(--red);
}

.auth-flash.success {
  background: rgba(0,212,170,.1);
  border: 1px solid rgba(0,212,170,.3);
  color: var(--teal);
}

.auth-flash.warning, .auth-flash.info {
  background: rgba(108,99,255,.1);
  border: 1px solid rgba(108,99,255,.3);
  color: var(--purple);
}

.flash-icon { font-weight: 800; }

/* Form inputs with icons */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .field-icon {
  position: absolute;
  left: .85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 2.4rem;
  padding-right: 2.4rem;
}

.btn-toggle-pwd {
  position: absolute;
  right: .75rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: .2rem;
  border-radius: 4px;
  transition: color .15s;
}

.btn-toggle-pwd:hover, .btn-toggle-pwd.active {
  color: var(--teal);
}

.auth-helper-link {
  font-size: .72rem;
  color: var(--teal);
  cursor: pointer;
  font-weight: 600;
}
.auth-helper-link:hover { text-decoration: underline; }

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--text-muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
}

.auth-submit-btn {
  width: 100%;
  margin-top: .35rem;
}

/* Quick demo access */
.demo-access-box {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: rgba(0,212,170,.06);
  border: 1px dashed rgba(0,212,170,.3);
  border-radius: var(--radius-sm);
  padding: .65rem .85rem;
  cursor: pointer;
  transition: all .2s;
}

.demo-access-box:hover {
  background: rgba(0,212,170,.12);
  border-color: var(--teal);
  transform: translateY(-1px);
}

.dab-icon { font-size: 1.25rem; flex-shrink: 0; }
.dab-title { font-size: .78rem; font-weight: 700; color: var(--teal); }
.dab-sub { font-size: .7rem; color: var(--text-muted); margin-top: .1rem; }
.dab-sub code { color: #fff; background: rgba(255,255,255,.08); padding: .1rem .3rem; border-radius: 3px; font-family: var(--mono); }

/* Auth footer */
.auth-footer {
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.auth-link {
  color: var(--purple);
  text-decoration: none;
  font-weight: 600;
  margin-left: .35rem;
}
.auth-link:hover { text-decoration: underline; color: #fff; }

/* Topbar user pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: .25rem .75rem .25rem .35rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .8rem;
  flex-shrink: 0;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name { font-size: .8rem; font-weight: 700; color: var(--text); }
.user-role { font-size: .65rem; color: var(--text-muted); }

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  padding: .2rem;
  border-radius: 4px;
  margin-left: .25rem;
  transition: color .15s;
}
.btn-logout:hover { color: var(--red); }

/* Sidebar user box */
.sidebar-user-box {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
}

.user-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: .75rem;
  flex-shrink: 0;
}

.user-box-info {
  flex: 1;
  overflow: hidden;
  line-height: 1.2;
}

.user-box-name {
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-box-role {
  font-size: .62rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  color: var(--text-dim);
  padding: .25rem;
  border-radius: 4px;
  transition: all .15s;
}
.sidebar-logout-btn:hover {
  color: var(--red);
  background: rgba(255,92,92,.1);
}

.nav-item-logout {
  color: var(--text-muted);
  transition: all .2s;
}
.nav-item-logout:hover {
  background: rgba(255,92,92,.12) !important;
  color: var(--red) !important;
  border-left: 3px solid var(--red);
}

.btn-topbar-logout {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--glass2);
  transition: all .2s;
  text-decoration: none;
}
.btn-topbar-logout:hover {
  color: var(--red);
  border-color: rgba(255,92,92,.4);
  background: rgba(255,92,92,.1);
  transform: translateY(-1px);
}

.auth-topbar-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ─── 97%+ Accuracy Engine & Benchmark Metrics ─────────────────────────────── */
.accuracy-kpi-pill {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(0,212,170,.08);
  border: 1px solid rgba(0,212,170,.3);
  box-shadow: 0 0 15px rgba(0,212,170,.15);
  border-radius: 30px;
  padding: .35rem .85rem;
  font-size: .78rem;
}

.ak-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
  animation: ping 2s infinite ease-in-out;
}

.ak-title {
  color: var(--text-muted);
  font-weight: 500;
}

.ak-value {
  color: var(--teal);
  font-weight: 800;
  font-family: var(--mono);
}

.accuracy-verified-tag {
  font-size: .7rem;
  font-weight: 800;
  padding: .2rem .65rem;
  border-radius: 20px;
  background: rgba(0,212,170,.15);
  color: var(--teal);
  border: 1px solid rgba(0,212,170,.35);
  box-shadow: 0 0 12px rgba(0,212,170,.2);
  margin-left: .5rem;
}

/* Accuracy Metrics Grid */
.accuracy-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem;
  margin: .25rem 0 .75rem;
}

@media (max-width: 800px) {
  .accuracy-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.am-card {
  background: rgba(0,0,0,.45);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  transition: transform .2s, border-color .2s;
}

.am-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0,212,170,.3);
}

.am-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}

.am-value {
  font-size: 1.3rem;
  font-weight: 900;
  font-family: var(--mono);
  color: var(--text);
  line-height: 1.2;
}

.am-value.highlight-cyan   { color: var(--teal); text-shadow: 0 0 12px rgba(0,212,170,.3); }
.am-value.highlight-purple { color: var(--purple); text-shadow: 0 0 12px rgba(108,99,255,.3); }
.am-value.highlight-green  { color: #48bb78; text-shadow: 0 0 12px rgba(72,187,120,.3); }

.am-sub {
  font-size: .68rem;
  color: var(--text-dim);
}

/* Solution header badges */
.solution-header-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.rule-id-badge {
  font-size: .68rem;
  font-weight: 700;
  font-family: var(--mono);
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: .15rem .5rem;
  border-radius: 4px;
}

.confidence-badge {
  font-size: .68rem;
  font-weight: 800;
  background: rgba(0,212,170,.12);
  border: 1px solid rgba(0,212,170,.25);
  color: var(--teal);
  padding: .15rem .55rem;
  border-radius: 20px;
}

/* ─── GitHub Actions CI/CD Integration ──────────────────────────────────────── */
.ci-features-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 900px) {
  .ci-features-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ci-feature-badge {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  transition: transform .2s, border-color .2s;
}

.ci-feature-badge:hover {
  transform: translateY(-2px);
  border-color: rgba(108,99,255,.3);
}

.cf-icon { font-size: 1.4rem; flex-shrink: 0; }
.cf-title { font-size: .82rem; font-weight: 700; color: var(--text); }
.cf-sub { font-size: .7rem; color: var(--text-muted); margin-top: .1rem; }

.ci-split-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 992px) {
  .ci-split-layout {
    grid-template-columns: 1fr;
  }
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.ci-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ci-checkboxes {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  font-size: .78rem;
}

.yaml-preview-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #050811;
}

.yaml-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .85rem;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-muted);
}

.yaml-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 4px;
  background: rgba(0,212,170,.12);
  color: var(--teal);
}

.yaml-code-block {
  padding: 1rem;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.55;
  color: #a8b2d1;
  overflow-x: auto;
  max-height: 380px;
}

/* 3-Step Setup Guide */
.setup-steps {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.setup-step {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .65rem .75rem;
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.step-num-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  color: #fff;
  font-weight: 800;
  font-size: .72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content { line-height: 1.35; }
.step-title { font-size: .82rem; font-weight: 700; color: var(--text); }
.step-desc { font-size: .72rem; color: var(--text-muted); margin-top: .15rem; }
.step-desc code { font-family: var(--mono); background: rgba(255,255,255,.08); padding: .1rem .3rem; border-radius: 3px; color: var(--teal); }

/* Simulator Card */
.simulator-card {
  border-color: rgba(0,212,170,.3);
}

.sim-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.sim-badge {
  font-size: .65rem;
  font-weight: 800;
  padding: .2rem .55rem;
  border-radius: 20px;
  background: rgba(0,212,170,.15);
  color: var(--teal);
  border: 1px solid rgba(0,212,170,.3);
}

.sim-code-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #050811;
  margin-bottom: 1rem;
}

.scp-header {
  padding: .35rem .75rem;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  font-family: var(--mono);
  color: var(--text-dim);
}

.sim-code-preview pre {
  padding: .75rem;
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.4;
  color: #ff8c42;
  overflow-x: auto;
}

.sim-result-box {
  background: rgba(0,0,0,.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem;
  animation: slideIn .25s ease;
}

.srb-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}

/* ─── Interactive Q&A Chatbot ───────────────────────────────────────────────── */
.chat-page-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  height: calc(100vh - var(--topbar-h) - 3.5rem);
  min-height: 580px;
}

@media (max-width: 900px) {
  .chat-page-container {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.chat-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  overflow-y: auto;
}

.csp-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.csp-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 16px rgba(108,99,255,.3);
}

.csp-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.csp-sub { font-size: .68rem; color: var(--teal); margin-top: .1rem; }

.quick-prompts-section {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.qp-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .25rem;
}

.qp-btn {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  color: var(--text);
  font-size: .78rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all .2s;
}

.qp-btn:hover {
  background: rgba(108,99,255,.1);
  border-color: rgba(108,99,255,.4);
  transform: translateX(3px);
}

.chat-specs-box {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .72rem;
}

.csb-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}
.csb-row strong { color: var(--teal); font-family: var(--mono); }

/* Main Chat Panel */
.chat-main-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.cmp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.25rem;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid var(--border);
}

.cmp-status {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.chat-messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  max-width: 90%;
  animation: slideIn .2s ease;
}

.chat-msg.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--glass2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-msg.user .msg-avatar {
  background: var(--purple);
  color: #fff;
}

.chat-msg.assistant .msg-avatar {
  background: rgba(0,212,170,.15);
  border-color: rgba(0,212,170,.3);
}

.msg-body {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  max-width: calc(100% - 45px);
}

.chat-msg.user .msg-body {
  align-items: flex-end;
}

.msg-author {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.msg-badge {
  font-size: .62rem;
  background: rgba(0,212,170,.12);
  color: var(--teal);
  padding: .1rem .4rem;
  border-radius: 10px;
}

.msg-time { font-size: .65rem; color: var(--text-dim); }

.msg-content {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1.1rem;
  font-size: .84rem;
  line-height: 1.6;
  color: var(--text);
}

.chat-msg.user .msg-content {
  background: rgba(108,99,255,.2);
  border-color: rgba(108,99,255,.4);
  color: #fff;
}

.chat-msg.assistant .msg-content {
  background: rgba(13,17,32,.7);
}

/* Chat Code Blocks */
.chat-code-block {
  margin: .75rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #050811;
}

.ccb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem .75rem;
  background: rgba(255,255,255,.04);
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-dim);
}

.ccb-copy {
  background: none;
  border: none;
  color: var(--teal);
  cursor: pointer;
  font-size: .7rem;
  font-weight: 600;
}
.ccb-copy:hover { text-decoration: underline; }

.chat-code-block pre {
  padding: .85rem;
  margin: 0;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.5;
  color: #a8b2d1;
  overflow-x: auto;
}

.inline-code {
  font-family: var(--mono);
  background: rgba(255,255,255,.08);
  padding: .1rem .35rem;
  border-radius: 4px;
  color: var(--teal);
  font-size: .8em;
}

.chat-h3 { font-size: .95rem; font-weight: 800; color: var(--teal); margin: .75rem 0 .35rem; }
.chat-h4 { font-size: .85rem; font-weight: 700; color: var(--text); margin: .6rem 0 .25rem; }

/* Typing indicator */
.typing-dots {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .6rem .85rem;
  background: rgba(255,255,255,.03);
  border-radius: 16px;
  width: fit-content;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Chat Suggestions Bar */
.chat-suggestions-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  background: rgba(0,0,0,.2);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
}

.sugg-chip {
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .25rem .75rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}

.sugg-chip:hover {
  background: rgba(0,212,170,.12);
  border-color: var(--teal);
  color: var(--text);
  transform: translateY(-1px);
}

/* Chat Input Bar */
.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(8,11,20,.6);
}

.chat-input-wrapper textarea {
  flex: 1;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .65rem .85rem;
  font-family: inherit;
  font-size: .84rem;
  line-height: 1.4;
  resize: none;
  outline: none;
}
.chat-input-wrapper textarea:focus { border-color: var(--purple); }

/* ─── Global Floating Chat Widget ───────────────────────────────────────────── */
#floating-chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
}

.fct-btn {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1.1rem;
  background: linear-gradient(135deg, #13172c, #0a0d18);
  border: 1px solid rgba(0,212,170,.4);
  box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 20px rgba(0,212,170,.25);
  border-radius: 30px;
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s ease;
  position: relative;
}

.fct-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 40px rgba(0,0,0,.8), 0 0 25px rgba(0,212,170,.4);
  border-color: var(--teal);
}

.fct-icon { font-size: 1.2rem; }
.fct-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
  animation: ping 2s infinite;
}

#floating-chat-drawer {
  position: absolute;
  bottom: calc(100% + .75rem);
  right: 0;
  width: 360px;
  height: 480px;
  background: rgba(13,17,32,.95);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(0,212,170,.3);
  box-shadow: 0 16px 48px rgba(0,0,0,.8), 0 0 30px rgba(108,99,255,.2);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp .25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fcd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
}

.fcd-title {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.fcd-name { font-size: .82rem; font-weight: 700; color: var(--text); }
.fcd-status { font-size: .65rem; color: var(--teal); }

.fcd-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.fcd-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: .2rem .4rem;
  font-size: .85rem;
  text-decoration: none;
  border-radius: 4px;
}
.fcd-btn:hover { color: #fff; background: rgba(255,255,255,.06); }

.fcd-body {
  flex: 1;
  overflow-y: auto;
  padding: .85rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.fcd-msg {
  display: flex;
  max-width: 88%;
  animation: slideIn .2s ease;
}
.fcd-msg.user { margin-left: auto; justify-content: flex-end; }

.fcd-bubble {
  padding: .6rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  line-height: 1.5;
}

.fcd-bubble.assistant {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text);
}

.fcd-bubble.user {
  background: var(--purple);
  color: #fff;
}

.fcd-footer {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem .85rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.3);
}

.fcd-footer input {
  flex: 1;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  padding: .45rem .85rem;
  font-size: .78rem;
  outline: none;
}
.fcd-footer input:focus { border-color: var(--teal); }

.fcd-footer button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--teal);
  color: #000;
  border: none;
  font-weight: 800;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s;
}
.fcd-footer button:hover { transform: scale(1.08); }


/* ═══════════════════════════════════════════════════════════════
   TECH DEBT & CODE HEATMAP DASHBOARD
   ═══════════════════════════════════════════════════════════════ */

/* ── Page Layout ─────────────────────────────────────────────────── */
.hm-page {
  padding: 2rem 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeSlideUp .4s ease both;
}

/* ── Header ──────────────────────────────────────────────────────── */
.hm-header {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.hm-header-left { display: flex; align-items: center; gap: 1.2rem; }
.hm-header-icon {
  width: 54px; height: 54px;
  background: linear-gradient(135deg,rgba(108,99,255,.25),rgba(0,212,170,.15));
  border: 1px solid rgba(108,99,255,.3);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--purple); box-shadow: var(--glow-p);
}
.hm-title { font-size: 1.55rem; font-weight: 800; color: var(--text); margin-bottom: .25rem; }
.hm-subtitle { font-size: .85rem; color: var(--text-muted); }
.hm-header-actions { display: flex; gap: .75rem; }

.hm-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.1rem; border-radius: 9px;
  font-size: .85rem; font-weight: 600;
  cursor: pointer; text-decoration: none; border: none; transition: all .2s;
}
.hm-btn-outline {
  background: var(--glass2); color: var(--text-muted); border: 1px solid var(--border);
}
.hm-btn-outline:hover { background: var(--glass); color: var(--text); }
.hm-btn-primary {
  background: linear-gradient(135deg,var(--purple),#8b5cf6);
  color: #fff; box-shadow: var(--glow-p);
}
.hm-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(108,99,255,.5); }

/* ── KPI Row ─────────────────────────────────────────────────────── */
.hm-kpi-row {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 1.1rem; margin-bottom: 1.5rem;
}
@media(max-width:900px){ .hm-kpi-row { grid-template-columns: repeat(2,1fr); } }
@media(max-width:550px){ .hm-kpi-row { grid-template-columns: 1fr; } }

.hm-kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.4rem;
  display: flex; align-items: center; gap: 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.hm-kpi-card:hover { border-color: var(--border-hl); box-shadow: var(--glow-p); }
.hm-kpi-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.hm-kpi-value { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1; }
.hm-kpi-label { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Card Base ────────────────────────────────────────────────────── */
.hm-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: border-color .2s;
}
.hm-card:hover { border-color: rgba(108,99,255,.25); }
.hm-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.4rem; border-bottom: 1px solid var(--border); background: var(--glass);
}
.hm-card-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: .9rem; font-weight: 700; color: var(--text);
}
.hm-card-title svg { color: var(--purple); }

/* ── Badge ────────────────────────────────────────────────────────── */
.hm-badge {
  font-size: .7rem; font-weight: 700; padding: .2rem .6rem;
  border-radius: 20px; letter-spacing: .05em; text-transform: uppercase;
}
.hm-badge-blue   { background: rgba(79,172,254,.15); color:#4facfe; border:1px solid rgba(79,172,254,.3); }
.hm-badge-purple { background: rgba(108,99,255,.15); color:var(--purple); border:1px solid rgba(108,99,255,.3); }
.hm-badge-green  { background: rgba(34,197,94,.15);  color:#22c55e; border:1px solid rgba(34,197,94,.3); }

/* ── Main Grid ────────────────────────────────────────────────────── */
.hm-main-grid {
  display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem;
}
@media(max-width:900px){ .hm-main-grid { grid-template-columns: 1fr; } }

.hm-trend-chart-wrap { padding: 1rem 1.25rem 1.2rem; position: relative; }
#trendCanvas { width: 100% !important; max-width: 100%; display: block; }
.hm-chart-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .75rem;
  padding: 2rem; color: var(--text-muted); font-size: .88rem; text-align: center;
}
.hm-chart-empty a { color: var(--teal); text-decoration: none; }
.hm-chart-empty a:hover { text-decoration: underline; }

/* Category donut */
.hm-cats-body {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.5rem 1.25rem; gap: 1.5rem;
}
.hm-donut-wrap { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.hm-donut-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: var(--text-muted);
  text-align: center; pointer-events: none;
}
.hm-cats-legend { width: 100%; display: flex; flex-direction: column; gap: .7rem; }
.hm-cat-row { display: flex; align-items: center; gap: .6rem; }
.hm-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.hm-cat-name { flex: 1; font-size: .82rem; color: var(--text-muted); }
.hm-cat-val { font-size: .9rem; font-weight: 700; color: var(--text); }

/* ── Grid Legend ─────────────────────────────────────────────────── */
.hm-grid-legend { display: flex; align-items: center; gap: .9rem; }
.hm-gl-item { display: flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--text-muted); }
.hm-gl-cell { width: 12px; height: 12px; border-radius: 3px; }

/* ── Heatmap Table ───────────────────────────────────────────────── */
.hm-grid-scroll { overflow-x: auto; }
.hm-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.hm-table thead { background: var(--glass2); }
.hm-table th {
  padding: .75rem 1rem; text-align: left;
  color: var(--text-muted); font-size: .75rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.hm-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.hm-tr:last-child td { border-bottom: none; }
.hm-tr:hover td { background: var(--glass); }
.hm-th-sec   { color: #ef4444 !important; }
.hm-th-maint { color: #f59e0b !important; }
.hm-th-style { color: #6c63ff !important; }

.hm-table-loading, .hm-table-empty {
  text-align: center; padding: 2.5rem !important;
  color: var(--text-muted); font-size: .88rem;
}
.hm-table-empty a { color: var(--teal); text-decoration: none; }
.hm-table-empty a:hover { text-decoration: underline; }

.hm-heat-cell {
  display: inline-block; padding: .25rem .65rem; border-radius: 6px;
  font-weight: 700; font-size: .82rem; font-family: var(--mono);
}
.hm-issue-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  font-weight: 700; font-size: .82rem;
}
.hm-ic-clean { background:rgba(34,197,94,.12); color:#22c55e; border:1px solid rgba(34,197,94,.25); }
.hm-ic-warn  { background:rgba(245,158,11,.12); color:#f59e0b; border:1px solid rgba(245,158,11,.25); }
.hm-ic-crit  { background:rgba(239,68,68,.12);  color:#ef4444; border:1px solid rgba(239,68,68,.25); }

.hm-run-badge {
  background:rgba(108,99,255,.15); color:var(--purple);
  border:1px solid rgba(108,99,255,.3);
  font-size:.75rem; font-weight:700; font-family:var(--mono);
  padding:.2rem .55rem; border-radius:5px;
}
.hm-date { color:var(--text-muted); font-family:var(--mono); font-size:.78rem; white-space:nowrap; }

.hm-spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border); border-top-color: var(--teal);
  border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: middle; margin-right: .5rem;
}

/* ── Rule Leaderboard ────────────────────────────────────────────── */
.hm-leaderboard { padding: 1rem 1.4rem; display: flex; flex-direction: column; gap: .6rem; }
.hm-leaderboard-loading, .hm-lb-empty {
  color: var(--text-muted); font-size: .88rem; padding: 1.5rem 0; text-align: center;
}
.hm-lb-empty a { color: var(--teal); text-decoration: none; }
.hm-lb-empty a:hover { text-decoration: underline; }
.hm-lb-row {
  display: flex; align-items: center; gap: .9rem;
  padding: .65rem .8rem; border-radius: 9px;
  background: var(--glass); border: 1px solid var(--border);
  transition: border-color .2s, background .2s;
}
.hm-lb-row:hover { background: var(--glass2); border-color: var(--border-hl); }
.hm-lb-rank { font-size: 1.1rem; width: 28px; text-align: center; flex-shrink: 0; }
.hm-lb-info { flex: 1; min-width: 0; }
.hm-lb-label {
  font-size: .86rem; font-weight: 600; color: var(--text); margin-bottom: .35rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hm-lb-bar-wrap { height: 5px; background: var(--glass2); border-radius: 99px; overflow: hidden; }
.hm-lb-bar { height: 100%; border-radius: 99px; transition: width .6s ease; }
.hm-lb-count { font-size: 1rem; font-weight: 800; min-width: 28px; text-align: right; }
.hm-lb-cat {
  font-size: .68rem; font-weight: 700; padding: .18rem .55rem;
  border-radius: 5px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE & TABLET  (DevFlow AI)
   Breakpoints:
     ≤ 1024px  → tablet (sidebar collapses to overlay)
     ≤ 768px   → large phone
     ≤ 480px   → small phone
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Hamburger Button ───────────────────────────────────────────── */
.hamburger-btn {
  display: none;                     /* hidden on desktop */
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .45rem;
  border-radius: 7px;
  margin-right: .5rem;
  flex-shrink: 0;
  transition: background .2s;
}
.hamburger-btn:hover { background: var(--glass2); }
.hamburger-btn span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

/* ── Sidebar close "×" button (only visible on mobile) ─────────── */
.sidebar-close-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: .3rem;
  border-radius: 6px; transition: color .2s, background .2s;
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
}
.sidebar-close-btn:hover { color: var(--text); background: var(--glass2); }

/* ── Sidebar Overlay (dark backdrop) ───────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
  z-index: 199;
  opacity: 0;
  transition: opacity .3s;
}
.sidebar-overlay.active { opacity: 1; }

/* ── Tablet & below (≤ 1024px) ─────────────────────────────────── */
@media (max-width: 1024px) {

  /* Show hamburger */
  .hamburger-btn { display: flex; }
  .sidebar-close-btn { display: flex; }

  /* Sidebar slides in as overlay from left */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 8px 0 40px rgba(0,0,0,.5);
    z-index: 300;
  }
  .sidebar.open { transform: translateX(0); }

  /* Show overlay when sidebar is open */
  .sidebar-overlay { display: block; }
  .sidebar-overlay.active { display: block; }

  /* Main wrapper takes full width */
  .main-wrapper { margin-left: 0 !important; }

  /* Topbar padding */
  .topbar { padding: 0 1rem; }

  /* Page content padding */
  .content { padding: 1.25rem; }

  /* Hide topbar badges on tablet to save space */
  .topbar-badge { display: none; }

  /* Dashboard grid → 2 columns */
  .metrics-grid,
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Heatmap page */
  .hm-page { padding: 1.25rem; }
}

/* ── Large Phone (≤ 768px) ──────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Typography scale down ── */
  .hm-title { font-size: 1.2rem; }
  .hm-subtitle { font-size: .78rem; }

  /* ── Content ── */
  .content { padding: 1rem; }
  .hm-page { padding: 1rem; }

  /* ── Topbar ── */
  .topbar { padding: 0 .85rem; gap: .5rem; }
  .page-breadcrumb { font-size: .78rem; }
  .topbar-right { gap: .35rem; }
  .auth-topbar-actions { gap: .35rem; }
  .auth-topbar-actions .btn { padding: .4rem .7rem; font-size: .78rem; }

  /* Hide user pill text on small screens; keep avatar */
  .user-meta { display: none; }
  .user-pill { gap: 0; }
  .btn-topbar-logout span { display: none; }
  .btn-topbar-logout { padding: .4rem; }

  /* ── Glass card ── */
  .glass-card { padding: 1.1rem; }

  /* ── Dashboard metrics: 1 column ── */
  .metrics-grid,
  .stats-grid { grid-template-columns: 1fr !important; }

  /* ── KPI grids ── */
  .hm-kpi-row { grid-template-columns: repeat(2, 1fr); }

  /* ── Header action rows ── */
  .hm-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .hm-header-actions { width: 100%; justify-content: flex-end; }

  /* ── Heatmap table: allow horizontal scroll ── */
  .hm-grid-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hm-table { min-width: 640px; }

  /* ── Trend canvas ── */
  #trendCanvas { height: 140px; }

  /* ── Chat page ── */
  .chat-page-container { flex-direction: column !important; height: auto !important; }
  .chat-sidebar-panel { width: 100% !important; height: auto; max-height: 220px; overflow-y: auto; }
  .chat-main-panel { flex: 1; height: calc(100vh - 300px); }

  /* ── Code review section ── */
  .cr-header,
  .cr-toolbar { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .cr-actions { width: 100%; }
  .cr-actions .btn { flex: 1; justify-content: center; }

  /* ── Floating chat widget ── */
  #floating-chat-drawer {
    width: calc(100vw - 2rem) !important;
    right: 1rem !important;
    bottom: 5rem !important;
  }
  .fct-label { display: none; }

  /* ── Login / Register cards ── */
  .auth-card { padding: 1.5rem 1.2rem !important; margin: 1rem !important; }

  /* ── GitHub Action page ── */
  .ga-grid,
  .ga-two-col { grid-template-columns: 1fr !important; }

  /* ── Onboarding ── */
  .ob-grid { grid-template-columns: 1fr !important; }

  /* ── Solution cards: diff side-by-side → stacked ── */
  .code-diff-container { flex-direction: column !important; }
  .diff-pane { min-width: 0 !important; }
}

/* ── Small Phone (≤ 480px) ──────────────────────────────────────── */
@media (max-width: 480px) {

  /* KPI → single column */
  .hm-kpi-row { grid-template-columns: 1fr; }

  /* Content */
  .content { padding: .75rem; }
  .hm-page { padding: .75rem; }

  /* Buttons full-width */
  .btn-group-mobile .btn { width: 100%; justify-content: center; }

  /* Topbar */
  .topbar { padding: 0 .65rem; }

  /* History page cards */
  .history-card-meta { flex-direction: column; gap: .25rem; }

  /* Chat layout */
  .chat-main-panel { height: calc(100vh - 260px); }

  /* Leaderboard rows */
  .hm-lb-row { flex-wrap: wrap; gap: .5rem; }
  .hm-lb-info { min-width: 100%; }

  /* Brand sub text */
  .brand-sub { display: none; }

  /* Floating chat */
  #floating-chat-drawer {
    width: calc(100vw - 1rem) !important;
    right: .5rem !important;
  }

  /* Auth forms */
  .auth-card { margin: .5rem !important; }
}

/* ── Touch-friendly tap targets ────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .nav-item { min-height: 44px; }
  .btn      { min-height: 44px; }
  .hm-btn   { min-height: 44px; }
  .hamburger-btn { min-height: 44px; min-width: 44px; }
  input, select, textarea { font-size: 16px; } /* prevent iOS zoom on focus */
}

/* ── Utility: hide on mobile ────────────────────────────────────── */
@media (max-width: 768px) {
  .hide-mobile  { display: none !important; }
}
@media (min-width: 769px) {
  .show-mobile  { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════════
   ARCHITECTURE & DEPENDENCY VISUALIZER
   ═══════════════════════════════════════════════════════════════ */

/* ── Page wrapper ─────────────────────────────────────────────── */
.vz-page {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--topbar-h));
  padding: 1.25rem 1.5rem;
  gap: 1rem;
  overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────────── */
.vz-header {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: .75rem;
}
.vz-header-left { display: flex; align-items: center; gap: 1rem; }
.vz-header-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg,rgba(108,99,255,.25),rgba(0,212,170,.12));
  border: 1px solid rgba(108,99,255,.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--purple); box-shadow: var(--glow-p);
}
.vz-title   { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.vz-subtitle { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }
.vz-header-actions { display: flex; gap: .5rem; align-items: center; }

.vz-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem; border-radius: 8px;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  text-decoration: none; border: none; transition: all .2s;
}
.vz-btn-outline {
  background: var(--glass2); color: var(--text-muted); border: 1px solid var(--border);
  font-family: var(--mono); font-size: .95rem;
}
.vz-btn-outline:hover { background: var(--glass); color: var(--text); }
.vz-btn-primary {
  background: linear-gradient(135deg, var(--purple), #8b5cf6);
  color: #fff; box-shadow: var(--glow-p);
}
.vz-btn-primary:hover { transform: translateY(-1px); }

/* ── KPI strip ────────────────────────────────────────────────── */
.vz-kpi-row {
  display: flex; gap: 1rem; flex-wrap: wrap;
}
.vz-kpi {
  flex: 1; min-width: 90px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .6rem 1rem;
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  transition: border-color .2s;
}
.vz-kpi:hover { border-color: var(--border-hl); }
.vz-kpi span  { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.vz-kpi small { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }

/* ── Main workspace ───────────────────────────────────────────── */
.vz-workspace {
  flex: 1; display: flex; gap: 1rem; min-height: 0;
}

/* ── Left sidebar panel ───────────────────────────────────────── */
.vz-sidebar-panel {
  width: 220px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: .75rem;
  overflow-y: auto;
}
@media (max-width: 900px) { .vz-sidebar-panel { display: none; } }

.vz-panel-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .9rem 1rem;
}
.vz-panel-title {
  font-size: .7rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: .6rem;
}

/* Legend */
.vz-legend { display: flex; flex-direction: column; gap: .45rem; }
.vz-leg-row { display: flex; align-items: center; gap: .55rem; }
.vz-leg-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.vz-leg-name { font-size: .78rem; color: var(--text-muted); }

/* Search */
.vz-search-input {
  width: 100%; padding: .4rem .65rem;
  background: var(--glass2); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-size: .8rem;
  outline: none; margin-bottom: .6rem;
  font-family: var(--font); transition: border-color .2s;
}
.vz-search-input:focus { border-color: var(--purple); }

/* Group filter buttons */
.vz-group-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.vz-filter-btn {
  font-size: .7rem; font-weight: 600; padding: .2rem .5rem;
  border-radius: 5px; cursor: pointer;
  background: var(--glass); color: var(--text-muted);
  border: 1px solid var(--border); transition: all .2s;
  text-transform: uppercase; letter-spacing: .04em;
}
.vz-filter-btn.active {
  background: color-mix(in srgb, var(--fc) 18%, transparent);
  color: var(--fc); border-color: color-mix(in srgb, var(--fc) 45%, transparent);
}

/* Node detail */
.vz-detail { display: flex; flex-direction: column; gap: .4rem; }
.vz-detail-name {
  font-size: .82rem; font-weight: 700; word-break: break-all; margin-bottom: .2rem;
  font-family: var(--mono);
}
.vz-detail-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .78rem; color: var(--text-muted);
}
.vz-detail-row strong { color: var(--text); }
.vz-tag {
  font-size: .68rem; font-weight: 700; padding: .15rem .45rem;
  border-radius: 4px; letter-spacing: .04em;
}
.vz-detail-list { margin-top: .4rem; }
.vz-dl-label { font-size: .68rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem; }
.vz-dl-item {
  display: inline-block; font-size: .7rem; font-family: var(--mono);
  background: var(--glass2); border: 1px solid var(--border);
  border-radius: 4px; padding: .1rem .4rem; margin: .15rem .1rem;
  color: var(--text-muted);
}

/* ── Canvas ───────────────────────────────────────────────────── */
.vz-canvas-wrap {
  flex: 1; position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
#vz-canvas { display: block; width: 100%; height: 100%; }

/* Loading overlay */
.vz-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1rem;
  background: rgba(13,17,32,.85); z-index: 10;
  color: var(--text-muted); font-size: .88rem;
}
.vz-spinner-lg {
  width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--teal);
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* Tooltip */
.vz-tooltip {
  position: absolute; display: none; pointer-events: none;
  background: rgba(13,17,32,.95); border: 1px solid var(--border);
  border-radius: 8px; padding: .45rem .75rem;
  font-size: .78rem; color: var(--text);
  backdrop-filter: blur(8px); z-index: 20;
  box-shadow: var(--shadow);
  max-width: 200px;
}

/* ═══════════════════════════════════════════════════════════════════════
   USER-FRIENDLY UI / UX ENHANCEMENTS  (DevFlow AI)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Modern Futuristic Scrollbars ────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 11, 20, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(108, 99, 255, 0.45);
}

/* ── Accessible Focus Rings ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--purple) !important;
  outline-offset: 2px !important;
}

/* ── Kbd Component ───────────────────────────────────────────────────── */
kbd {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  line-height: 1.4;
  vertical-align: middle;
}

/* ── Topbar Quick Search & Shortcut Button ───────────────────────────── */
.topbar-center {
  flex: 1;
  max-width: 380px;
  margin: 0 1rem;
}

.topbar-search-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}
.topbar-search-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(108, 99, 255, 0.4);
  color: var(--text);
  transform: translateY(-1px);
}
.search-placeholder {
  font-size: 0.82rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-kbd {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.68rem;
  padding: 1px 5px;
}

.topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.topbar-icon-btn:hover {
  background: var(--glass);
  color: var(--text);
  border-color: rgba(108, 99, 255, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .topbar-center {
    display: none;
  }
}

/* ── Quick Code Templates Pills ───────────────────────────────────────── */
.template-pills-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.tp-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.template-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.tp-btn {
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font);
}
.tp-btn:hover {
  background: rgba(108, 99, 255, 0.15);
  border-color: rgba(108, 99, 255, 0.4);
  color: var(--text);
  transform: translateY(-1px);
}
.tp-btn.tp-clean:hover {
  background: rgba(0, 212, 170, 0.15);
  border-color: rgba(0, 212, 170, 0.4);
  color: var(--teal);
}

/* ── Char Count & Helper Hints ────────────────────────────────────────── */
.char-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.char-hint {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.btn-kbd {
  margin-left: 0.4rem;
  font-size: 0.68rem;
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Button Copied State */
.btn-copied-state {
  background: rgba(0, 212, 170, 0.2) !important;
  color: var(--teal) !important;
  border-color: var(--teal) !important;
}

/* ── Floating Scroll-to-Top Button ───────────────────────────────────── */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
  box-shadow: var(--glow-p);
  transform: translateY(-2px);
}

/* ── Command Palette (Ctrl + K) ───────────────────────────────────────── */
.cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 1rem 1rem;
  animation: fadeIn 0.15s ease-out;
}
.cmd-palette {
  background: #0d1120;
  border: 1px solid rgba(108, 99, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), var(--glow-p);
  width: 100%;
  max-width: 620px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cmd-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--purple);
}
.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
}
.cmd-input::placeholder {
  color: var(--text-dim);
}
.cmd-esc-badge {
  cursor: pointer;
  font-size: 0.68rem;
  padding: 2px 6px;
  color: var(--text-muted);
}
.cmd-esc-badge:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.cmd-body {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cmd-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 0.5rem 0.65rem 0.25rem;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.cmd-item:hover,
.cmd-item.active {
  background: rgba(108, 99, 255, 0.18);
  border-left: 3px solid var(--purple);
}
.cmd-item-icon {
  font-size: 1.15rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.cmd-item-info {
  flex: 1;
  min-width: 0;
}
.cmd-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.cmd-item-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmd-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(0, 212, 170, 0.15);
  color: var(--teal);
  border: 1px solid rgba(0, 212, 170, 0.3);
}
.cmd-kbd {
  font-size: 0.68rem;
  color: var(--text-dim);
  border-color: rgba(255, 255, 255, 0.08);
}

.cmd-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.cmd-tip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.cmd-tip span {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 0 4px;
  font-family: var(--mono);
}

/* ── Keyboard Shortcuts Modal ─────────────────────────────────────────── */
.shortcuts-card {
  width: 100%;
  max-width: 580px;
  padding: 1.75rem;
  background: #0d1120;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  animation: modalSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.shortcuts-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.shortcuts-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
}
.shortcuts-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.sc-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sc-sec-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin-bottom: 0.25rem;
}
.sc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.sc-keys {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.sc-pills {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.sc-pill {
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.74rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ── Modern Toast Design with Animated Progress Bar ───────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  min-width: 280px;
  max-width: 420px;
  background: rgba(13, 17, 32, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s, transform 0.25s;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-fade-out {
  opacity: 0;
  transform: translateX(25px);
}
.toast.success { border-color: rgba(0, 212, 170, 0.4); }
.toast.error   { border-color: rgba(255, 92, 92, 0.4); }
.toast.warning { border-color: rgba(255, 179, 71, 0.4); }
.toast.info    { border-color: rgba(108, 99, 255, 0.4); }

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
}
.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.toast.success .toast-icon { background: rgba(0, 212, 170, 0.2); color: var(--teal); }
.toast.error   .toast-icon { background: rgba(255, 92, 92, 0.2); color: var(--red); }
.toast.warning .toast-icon { background: rgba(255, 179, 71, 0.2); color: var(--yellow); }
.toast.info    .toast-icon { background: rgba(108, 99, 255, 0.2); color: var(--purple); }

.toast-msg {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.4;
}
.toast-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 4px;
  font-size: 0.8rem;
  transition: color 0.15s;
}
.toast-close-btn:hover {
  color: var(--text);
}

.toast-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  width: 100%;
}
.toast-progress-bar {
  height: 100%;
  background: var(--purple);
  width: 100%;
  transform-origin: left;
  animation: toastCountdown linear forwards;
}
.toast.success .toast-progress-bar { background: var(--teal); }
.toast.error   .toast-progress-bar { background: var(--red); }
.toast.warning .toast-progress-bar { background: var(--yellow); }
.toast.info    .toast-progress-bar { background: var(--purple); }

@keyframes toastCountdown {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
