/* ═══════════════════════════════════════════════════════════════════
   hcli · Clinical Intelligence — chat workbench stylesheet
   Dark professional theme with two-column layout
   ═══════════════════════════════════════════════════════════════════ */

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

/* ── Design tokens ──────────────────────────────────────────────── */
:root {
  /* backgrounds */
  --bg:       #080d16;
  --surface:  #0d1421;
  --surface2: #121929;

  /* borders */
  --border:   #1e2d47;
  --border2:  #253555;

  /* text */
  --text:  #e2eaf6;
  --text2: #8ba3c7;
  --text3: #4d6a96;

  /* accent palette */
  --accent:  #38bdf8;
  --accent2: #0ea5e9;
  --green:   #34d399;
  --amber:   #fbbf24;
  --red:     #f87171;
  --purple:  #a78bfa;

  /* typography */
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* shape */
  --r:    10px;
  --r-sm:  6px;
  --r-lg: 14px;
}

/* ── Base ───────────────────────────────────────────────────────── */
html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ──────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────── */
#hdr {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  background: #1A0E5C;
  flex-shrink: 0;
  z-index: 10;
}

#hdr-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

#hdr-logo em {
  font-style: normal;
  font-weight: 700;
}

#hdr-sep-dot {
  color: rgba(255,255,255,0.3);
  font-weight: 300;
}

#hdr-sub {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* animated pulse dot */
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  flex-shrink: 0;
  animation: pulse-ring 2.5s ease infinite;
}

#hdr-spacer {
  flex: 1;
}

#hdr-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

#hdr-info {
  font-size: 11px;
  font-family: var(--mono);
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
}

#provider-select {
  font-family: var(--sans);
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  appearance: auto;
}

#provider-select:focus,
#provider-select:hover {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.15);
}

#provider-select option {
  background: #1A0E5C;
  color: #fff;
}

#hdr-home {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

#hdr-home:hover {
  color: #fff;
}

#new-btn {
  font-family: var(--sans);
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

#new-btn:hover {
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

/* ── Main two-column layout ─────────────────────────────────────── */
#main {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Conversation column ────────────────────────────────────────── */
#conv-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

/* ── Messages area ──────────────────────────────────────────────── */
#msgs {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

#msgs::-webkit-scrollbar { width: 5px; }
#msgs::-webkit-scrollbar-track { background: transparent; }
#msgs::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Input area ─────────────────────────────────────────────────── */
#input-area {
  flex-shrink: 0;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

#code-detector {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--accent);
}

#code-detector.visible {
  display: flex;
}

#cd-icon {
  font-size: 14px;
  flex-shrink: 0;
}

#input-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-end;
}

#user-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  resize: none;
  min-height: 44px;
  max-height: 180px;
  outline: none;
  transition: border-color 0.15s;
}

#user-input:focus {
  border-color: var(--accent);
}

#user-input::placeholder {
  color: var(--text3);
}

#send-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--accent2);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
}

#send-btn:hover {
  background: #38bef9;
}

#send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#send-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

#input-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
}

/* ── Knowledge panel ────────────────────────────────────────────── */
#kp {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}

#kp-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}

#kp-hdr > span:first-child {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text2);
  font-weight: 600;
}

#kp-badge {
  background: var(--border2);
  color: var(--text2);
  border-radius: 20px;
  font-size: 10px;
  font-family: var(--mono);
  padding: 1px 7px;
  font-weight: 600;
}

#kp-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#kp-body::-webkit-scrollbar { width: 5px; }
#kp-body::-webkit-scrollbar-track { background: transparent; }
#kp-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

#kp-empty {
  color: var(--text3);
  font-size: 12px;
  text-align: center;
  margin: auto;
  padding: 20px;
  line-height: 1.8;
}

/* ── Knowledge panel cards ──────────────────────────────────────── */
.kp-card {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface2);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.kp-card:hover {
  border-color: var(--accent);
}

.kp-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.kp-card-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.kp-card-code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.kp-card-type {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: auto;
  flex-shrink: 0;
}

.kp-card-desc {
  font-size: 11.5px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Message bubbles ────────────────────────────────────────────── */
.msg-user {
  align-self: flex-end;
  max-width: 78%;
  background: linear-gradient(135deg, #1a3a5c, #0d2a4a);
  border: 1px solid #1e4a7a;
  border-radius: var(--r-lg);
  border-bottom-right-radius: 3px;
  padding: 10px 16px;
  font-size: 14px;
  color: #c8dffa;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.msg-assistant {
  align-self: flex-start;
  max-width: 88%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  border-bottom-left-radius: 3px;
  padding: 12px 18px;
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.msg-assistant.streaming::after {
  content: "\25AE";
  color: var(--accent);
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
}

/* Markdown inside assistant messages */
.msg-assistant p { margin: 0.4em 0; }
.msg-assistant p:first-child { margin-top: 0; }
.msg-assistant p:last-child { margin-bottom: 0; }
.msg-assistant strong { color: var(--text); font-weight: 600; }
.msg-assistant em { color: var(--text2); font-style: italic; }

.msg-assistant code {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.msg-assistant pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin: 8px 0;
  overflow-x: auto;
  font-size: 12.5px;
  font-family: var(--mono);
}

.msg-assistant pre code {
  background: none;
  color: var(--text);
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.msg-assistant table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12.5px;
  width: 100%;
}

.msg-assistant th,
.msg-assistant td {
  border: 1px solid var(--border);
  padding: 5px 10px;
  text-align: left;
}

.msg-assistant th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
}

.msg-assistant td {
  color: var(--text2);
}

.msg-assistant ul,
.msg-assistant ol {
  margin: 0.4em 0;
  padding-left: 1.6em;
}

.msg-assistant li { margin: 0.2em 0; color: var(--text2); }

.msg-assistant a { color: var(--accent); text-decoration: none; }
.msg-assistant a:hover { text-decoration: underline; }

.msg-assistant h1, .msg-assistant h2, .msg-assistant h3 {
  color: var(--text);
  font-weight: 600;
  margin: 0.8em 0 0.3em;
  line-height: 1.3;
}

.msg-assistant h1 { font-size: 16px; }
.msg-assistant h2 { font-size: 14.5px; }
.msg-assistant h3 { font-size: 13.5px; }

/* ── Error message ──────────────────────────────────────────────── */
.msg-error {
  align-self: center;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--red);
  border-radius: var(--r);
  padding: 8px 14px;
  font-size: 13px;
}

/* ── Tool stream ────────────────────────────────────────────────── */
.tool-stream {
  width: 100%;
  flex-shrink: 0;   /* prevent flex column from compressing this to zero height */
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
  max-height: 480px;
  overflow-y: auto;
}

.tool-stream-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}

.tool-stream-hdr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ts-chevron {
  font-size: 9px;
  color: var(--text3);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.tool-stream.collapsed .ts-chevron {
  transform: rotate(-90deg);
}

.tool-stream.collapsed .tc-item,
.tool-stream.collapsed .tc-detail {
  display: none;
}

.ts-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}

.ts-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  margin-left: auto;
}

/* tool call item row */
.tc-item {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}

/* Remove border between the last tc-item and the widget border.
   :last-of-type doesn't work here (both tc-item and tc-detail are divs),
   so we use :not(:has(~ .tc-item)) to select the last tc-item sibling. */
.tc-item:not(:has(~ .tc-item)) {
  border-bottom: none;
}

.tc-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  justify-self: center;
}

.tc-dot.running {
  background: var(--amber);
  animation: throb 0.8s ease-in-out infinite;
}

.tc-dot.done {
  background: var(--green);
}

.tc-dot.error {
  background: var(--red);
}

.tc-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-args {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.tc-ms {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
  white-space: nowrap;
}

/* tool detail panel (inline result) */
.tc-detail {
  display: none;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 10px 14px;
}

.tc-detail.open {
  display: block;
}

/* ── Data cards ─────────────────────────────────────────────────── */
.data-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface2);
  overflow: hidden;
}

.dc-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.dc-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.dc-type {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text2);
}

.dc-code {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-left: auto;
}

.dc-body {
  padding: 10px 12px;
}

.dc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.dc-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  font-size: 11.5px;
}

.dc-lbl {
  color: var(--text3);
  font-weight: 500;
  white-space: nowrap;
}

.dc-val {
  color: var(--text2);
  word-break: break-word;
}

/* badges */
.dc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
}

.badge-green {
  color: var(--green);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge-red {
  color: var(--red);
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge-amber {
  color: var(--amber);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge-blue {
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-purple {
  color: var(--purple);
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

/* ── Validation card ────────────────────────────────────────────── */
.val-card {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface2);
}

.val-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.val-body {
  flex: 1;
  min-width: 0;
}

.val-code {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.val-desc {
  font-size: 11.5px;
  color: var(--text2);
  margin-top: 2px;
}

.val-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Search results ─────────────────────────────────────────────── */
.search-results {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface2);
}

.sr-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text2);
  font-weight: 600;
}

.sr-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.sr-item:last-child {
  border-bottom: none;
}

.sr-code {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.sr-desc {
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.sr-more {
  padding: 6px 12px;
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── Coverage / LCD card ────────────────────────────────────────── */
.cov-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface2);
  overflow: hidden;
}

.cov-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
}

.cov-banner.covered {
  background: rgba(52, 211, 153, 0.08);
  color: var(--green);
  border-bottom: 1px solid rgba(52, 211, 153, 0.2);
}

.cov-banner.not-covered {
  background: rgba(248, 113, 113, 0.08);
  color: var(--red);
  border-bottom: 1px solid rgba(248, 113, 113, 0.2);
}

.cov-banner.partial {
  background: rgba(251, 191, 36, 0.08);
  color: var(--amber);
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.cov-list {
  padding: 8px 12px;
  font-size: 12px;
}

.cov-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  color: var(--text2);
}

.cov-item-code {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Provider card ──────────────────────────────────────────────── */
.prov-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface2);
}

.prov-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.prov-info {
  flex: 1;
  min-width: 0;
}

.prov-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.prov-spec {
  font-size: 11.5px;
  color: var(--text2);
  margin-top: 1px;
}

.prov-npi {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

/* ── Entity annotation ──────────────────────────────────────────── */
.entity-text {
  font-size: 13px;
  line-height: 2;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--r);
  border: 1px solid var(--border);
  word-wrap: break-word;
}

.ent-drug {
  background: rgba(52, 211, 153, 0.12);
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-underline-offset: 2px;
  border-radius: 3px;
  padding: 0 2px;
}

.ent-diagnosis {
  background: rgba(251, 191, 36, 0.12);
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-underline-offset: 2px;
  border-radius: 3px;
  padding: 0 2px;
}

.ent-procedure {
  background: rgba(56, 189, 248, 0.12);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
  border-radius: 3px;
  padding: 0 2px;
}

.ent-label {
  font-size: 10px;
  font-weight: 700;
  display: inline-block;
  padding: 0 4px;
  border-radius: 3px;
  margin-left: 2px;
  vertical-align: middle;
}

.ent-label.drug      { background: rgba(52,211,153,0.18); color: var(--green); }
.ent-label.diagnosis { background: rgba(251,191,36,0.18); color: var(--amber); }
.ent-label.procedure { background: rgba(56,189,248,0.18); color: var(--accent); }

/* ── Generic JSON card ──────────────────────────────────────────── */
.generic-card {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text2);
  white-space: pre-wrap;
  word-break: break-word;
}

.generic-card::-webkit-scrollbar { width: 5px; }
.generic-card::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Welcome screen ─────────────────────────────────────────────── */
#welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 32px;
  gap: 28px;
  text-align: center;
  min-height: 0;
}

.welcome-logo {
  font-size: 32px;
  line-height: 1;
}

#welcome h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
}

#welcome p {
  font-size: 14px;
  color: var(--text2);
  max-width: 380px;
  line-height: 1.6;
}

#starters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 580px;
  width: 100%;
}

.starter {
  text-align: left;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.starter:hover {
  border-color: var(--border2);
  background: #162035;
}

.starter-cat {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin-bottom: 4px;
  font-weight: 600;
}

.starter-q {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.5;
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes pulse-ring {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0);
  }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes throb {
  50% { opacity: 0.3; }
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 700px) {
  #kp {
    display: none;
  }

  #starters {
    grid-template-columns: 1fr;
  }

  .msg-user,
  .msg-assistant {
    max-width: 96%;
  }

  .tool-stream {
    max-width: 100%;
  }
}

/* ── genesis-ui dark-theme overrides ────────────────────────────── */
/* gn-streaming-output: full dark-theme text/surface overrides.
   CSS custom properties pierce the shadow boundary so these cascade in. */
gn-streaming-output {
  --gn-text-primary:   #e2eaf6;
  --gn-text-secondary: #8ba3c7;
  --gn-text-muted:     #4d6a96;
  --gn-surface:        transparent;
  --gn-surface-alt:    #121929;
  --gn-border:         #1e2d47;
  --gn-border-strong:  #253555;
  --gn-neutral-light:  #121929;
  --gn-neutral-text:   #e2eaf6;
}

/* gn-code-badge: keep its own light-pill colours intact;
   only anchor it to the chat's dark container background. */
gn-code-badge {
  --gn-surface:    transparent;
  --gn-border:     #1e2d47;
}
