/* 2BA chat — terminal-green identity per the brand book:
   near-black green surface, phosphor accents, amber CTA, JetBrains Mono. */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --bg: #081008;
  --panel: #0b160b;
  --panel-alt: #0e1a0e;
  --border: #1d2b1d;
  --border-green: rgba(112, 219, 121, 0.35);
  --green: #70db79;
  --green-dim: rgba(112, 219, 121, 0.14);
  --amber: #e0aa39;
  --amber-dim: rgba(224, 170, 57, 0.14);
  --text: #d7ddc8;
  --muted: #aebbaa;
  --dim: #829184;
  --red: #ff6b6b;
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(112, 219, 121, 0.06), transparent 60%),
    linear-gradient(rgba(112, 219, 121, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 219, 121, 0.028) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  color: var(--text);
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
}

::selection { background: var(--green); color: #06140a; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: var(--radius);
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */

.sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(8, 16, 8, 0.92);
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-head img { display: block; }

.sidebar-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.new-chat {
  display: block;
  width: calc(100% - 32px);
  margin: 16px;
  padding: 10px 14px;
  min-height: 44px;
  border: 1px solid var(--amber);
  background: var(--amber-dim);
  color: var(--amber);
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
}
.new-chat:hover { background: rgba(224, 170, 57, 0.22); }

.conversations {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}

.conv-label {
  padding: 8px 8px 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.conv {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
}
.conv:hover { background: var(--green-dim); }
.conv.active {
  border-color: var(--border-green);
  background: var(--green-dim);
  color: var(--text);
}

.conv-title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: left;
}

.conv-title-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: var(--panel-alt);
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  padding: 2px 6px;
}

.conv-action {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  border-radius: var(--radius);
  visibility: hidden;
}
.conv:hover .conv-action, .conv.active .conv-action { visibility: visible; }
.conv-action:hover { color: var(--green); background: var(--green-dim); }
.conv-action.danger:hover { color: var(--red); }

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--dim);
}

.quota-line { color: var(--muted); }
.quota-line.exhausted { color: var(--amber); }
.quota-line .bar {
  display: block;
  height: 3px;
  margin-top: 5px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.quota-line .bar span {
  display: block;
  height: 100%;
  background: var(--green);
}
.quota-line.exhausted .bar span { background: var(--amber); }

.foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}
.foot-row .who {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}

.foot-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ghost-link {
  color: var(--dim);
  font-size: 12px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}
.ghost-link:hover { color: var(--green); }

/* ---------- Main thread ---------- */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* Appears while the view is scrolled away from the streaming bottom. */
.jump-latest {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  min-height: 36px;
  padding: 6px 16px;
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  background: rgba(6, 13, 6, 0.95);
  color: var(--green);
  font-size: 11px;
  letter-spacing: 0.12em;
}
.jump-latest:hover { background: var(--green-dim); }

.thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 16, 8, 0.85);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--green);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.thread-title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  color: var(--text);
}

.chip {
  flex-shrink: 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  padding: 3px 8px;
}

.thread {
  flex: 1;
  overflow-y: auto;
  /* Deliberately no scroll-behavior: smooth — during streaming, programmatic
     follows must land instantly; smooth animations emit intermediate scroll
     events that read as the user scrolling away and break auto-follow. */
}

.thread-inner {
  max-width: 768px;
  margin: 0 auto;
  padding: 28px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.msg { display: flex; flex-direction: column; gap: 6px; }

.msg-role {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.msg.user .msg-role { color: var(--amber); }

/* MCP tool activity: one small chip per call, above the reply. */
.tool-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(8, 16, 8, 0.6);
}
.tool-chip.running { border-color: var(--border-green); color: var(--green); animation: tool-chip-pulse 1.2s ease-in-out infinite; }
.tool-chip.ok { border-color: var(--border-green); color: var(--green); }
.tool-chip.error { border-color: rgba(255, 107, 107, 0.5); color: var(--red); }
@keyframes tool-chip-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.msg-body { white-space: pre-wrap; word-break: break-word; }

.msg.user .msg-body {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid var(--amber);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.msg.assistant .msg-body { border-left: 2px solid var(--border-green); padding-left: 14px; }

.msg-body.md { white-space: normal; }
.msg-body.md > :first-child { margin-top: 0; }
.msg-body.md > :last-child { margin-bottom: 0; }
.msg-body.md p { margin: 0.6em 0; }
.msg-body.md h1, .msg-body.md h2, .msg-body.md h3 {
  color: var(--text);
  font-size: 1.05em;
  margin: 1.2em 0 0.5em;
  letter-spacing: -0.01em;
}
.msg-body.md ul, .msg-body.md ol { margin: 0.6em 0; padding-left: 1.4em; }
.msg-body.md li { margin: 0.25em 0; }
.msg-body.md code {
  background: var(--green-dim);
  color: var(--green);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.95em;
}
.msg-body.md pre {
  position: relative;
  background: #060d06;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0.8em 0;
}
.msg-body.md pre code { background: none; color: var(--text); padding: 0; font-size: 13px; }
.msg-body.md blockquote {
  margin: 0.8em 0;
  padding: 2px 14px;
  border-left: 2px solid var(--border-green);
  color: var(--muted);
}
.msg-body.md table { border-collapse: collapse; margin: 0.8em 0; }
.msg-body.md th, .msg-body.md td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
.msg-body.md a { text-decoration: underline; }

.code-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--green);
  border: 1px solid var(--border-green);
  border-radius: 3px;
  background: rgba(8, 16, 8, 0.9);
  padding: 3px 8px;
  min-height: 24px;
}
.code-copy:hover { background: var(--green-dim); }

.caret {
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--green);
  animation: caret-blink 1s steps(2, start) infinite;
}
@keyframes caret-blink { to { visibility: hidden; } }

/* Pre-first-token state: the model is generating and nothing has arrived
   yet. Dots pulse while the label carries the meaning — reduced motion
   keeps the label with static dots. */
.thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  color: var(--dim);
  font-size: 12px;
}
.thinking-dots { display: inline-flex; gap: 4px; }
.thinking-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: thinking-pulse 1.2s ease-in-out infinite;
}
.thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes thinking-pulse {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.msg-error {
  border-left: 2px solid var(--red);
  padding-left: 14px;
  color: var(--red);
  font-size: 13px;
}

.msg-actions {
  display: flex;
  gap: 8px;
  padding-left: 14px;
}

.action-btn {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.action-btn:hover { color: var(--green); border-color: var(--border-green); }

/* ---------- Empty state ---------- */

.empty {
  max-width: 620px;
  margin: 10vh auto 0;
  padding: 0 20px;
  text-align: left;
}

.empty-terminal {
  border: 2px solid var(--green);
  border-radius: var(--radius);
  background: #060d06;
  box-shadow: 0 0 24px rgba(112, 219, 121, 0.08);
}

.empty-terminal .bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-green);
  color: var(--dim);
  font-size: 11px;
}
.empty-terminal .dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--border-green);
}
.empty-terminal .dot.on { background: var(--green); }

.empty-terminal .body { padding: 16px; }
.empty-terminal .prompt { color: var(--green); }
.empty-terminal .out { color: var(--muted); margin-top: 8px; }

.suggestions { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }

.suggestion {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-height: 44px;
  color: var(--muted);
  background: rgba(8, 16, 8, 0.6);
}
.suggestion:hover { border-color: var(--border-green); color: var(--text); background: var(--green-dim); }

/* ---------- Composer ---------- */

.composer-wrap { padding: 12px 20px 20px; }

.reasoning-control { position: relative; }
.reasoning-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.reasoning-model { color: var(--text); }
.reasoning-trigger:hover, .reasoning-trigger[aria-expanded="true"] {
  background: var(--green-dim);
  border-color: var(--border-green);
}
.reasoning-trigger:disabled { opacity: 0.5; cursor: not-allowed; }
.reasoning-panel {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 12px);
  right: -52px;
  width: min(310px, calc(100vw - 64px));
  padding: 16px;
  border: 1px solid var(--border-green);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}
.reasoning-heading { display: flex; align-items: center; gap: 12px; color: var(--green); }
.reasoning-heading > div { flex: 1; }
.reasoning-heading label { color: var(--muted); font-size: 11px; }
.reasoning-value { color: var(--text); font-size: 16px; margin-top: 3px; }
.reasoning-reset {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
}
.reasoning-reset:hover { color: var(--green); background: var(--green-dim); }
.reasoning-slider {
  appearance: none;
  display: block;
  width: 100%;
  height: 44px;
  margin: 10px 0 0;
  background: transparent;
  cursor: pointer;
  --effort-fill: 25%;
}
.reasoning-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(to right, var(--green) var(--effort-fill), var(--border) var(--effort-fill));
}
.reasoning-slider::-moz-range-track { height: 8px; border-radius: 8px; background: var(--border); }
.reasoning-slider::-moz-range-progress { height: 8px; border-radius: 8px; background: var(--green); }
.reasoning-slider::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.reasoning-slider::-moz-range-thumb { width: 20px; height: 20px; border: 2px solid var(--green); border-radius: 50%; background: var(--text); }
.reasoning-steps { display: flex; justify-content: space-between; gap: 2px; }
.reasoning-steps button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}
.reasoning-steps button.selected { color: var(--green); text-decoration: underline; text-underline-offset: 5px; }
.reasoning-steps button:hover:not(:disabled) { background: var(--green-dim); }
.reasoning-steps button:disabled { color: var(--dim); cursor: not-allowed; }
.reasoning-panel p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 8px 0 0; }
.reasoning-panel .reasoning-access { color: var(--dim); }
.composer-toolbar { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.composer-actions { display: flex; align-items: center; gap: 8px; }

.composer {
  max-width: 768px;
  margin: 0 auto;
  border: 1px solid var(--border-green);
  border-radius: var(--radius);
  background: rgba(6, 13, 6, 0.92);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}
.composer:focus-within { box-shadow: 0 0 0 1px var(--border-green), 0 0 18px rgba(112, 219, 121, 0.12); }

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.attach-btn {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-green);
  background: transparent;
  color: var(--dim);
  border-radius: var(--radius);
}
.attach-btn:hover { color: var(--green); border-color: var(--green); }
.attach-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.composer textarea {
  width: 100%;
  resize: none;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  max-height: 200px;
  min-height: 48px;
  padding: 6px 2px;
  outline: none;
}
.composer textarea::placeholder { color: var(--dim); }

.send-btn {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--amber);
  background: var(--amber-dim);
  color: var(--amber);
  border-radius: var(--radius);
  font-weight: 700;
}
.send-btn:hover { background: rgba(224, 170, 57, 0.22); }
.send-btn.stop { border-color: var(--red); background: rgba(255, 107, 107, 0.12); color: var(--red); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.composer-note {
  max-width: 768px;
  margin: 8px auto 0;
  font-size: 11px;
  color: var(--dim);
  text-align: center;
}

/* ---------- Attachments ---------- */

/* Pending chips above the composer and sent chips above a message share the
   tool-chip visual language: small bordered mono chips, states by color. */
.composer-attachments {
  max-width: 768px;
  margin: 0 auto 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(8, 16, 8, 0.6);
}
.attachment-chip .attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-chip .attachment-status { color: var(--dim); flex-shrink: 0; }
.attachment-chip.reading { color: var(--green); border-color: var(--border-green); }

.attachment-mini {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.attachment-remove {
  flex-shrink: 0;
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: 11px;
  border-radius: var(--radius);
}
.attachment-remove:hover { color: var(--red); }

.attach-error {
  max-width: 768px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  padding: 6px 10px;
}

.attachment-error-dismiss {
  min-width: 24px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--amber);
  font-size: 11px;
}

/* Sent attachments in the message list. */
.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 6px;
}

.attachment-chip.static { padding: 4px 8px; }
.attachment-chip.dropped, .attachment-thumb.dropped { opacity: 0.55; }

.attachment-thumb {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.attachment-thumb img {
  display: block;
  max-width: 180px;
  max-height: 120px;
}
.attachment-dropped-note {
  font-size: 10px;
  color: var(--dim);
  padding: 6px 10px;
  white-space: nowrap;
}

/* Drag-over affordance for dropping files anywhere on the thread. */
.main.dragging { position: relative; }
.main.dragging::after {
  content: 'Drop files to attach';
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--green);
  border-radius: var(--radius);
  background: rgba(8, 16, 8, 0.82);
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.12em;
  pointer-events: none;
  z-index: 5;
}

@media (max-width: 720px) {
  /* Keep tap targets honest on touch screens. */
  .attachment-chip { min-height: 44px; }
  .attachment-remove { min-width: 44px; min-height: 44px; }
}

/* Exhausted-state upsell: the one place the chat sells. */
.quota-upsell {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.upsell-btn {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--amber);
  background: var(--amber-dim);
  color: var(--amber);
  border-radius: var(--radius);
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 700;
}
.upsell-btn:hover { background: rgba(224, 170, 57, 0.22); }
.upsell-btn:disabled { opacity: 0.5; cursor: wait; }

/* ---------- Login (shared dialog from /static/login-modal.css) ---------- */

.login-page {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}

.login-tagline {
  color: var(--dim);
  font-size: 12px;
}

/* ---------- Wizard ---------- */

.wizard-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 5, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.wizard {
  width: 100%;
  max-width: 480px;
  border: 2px solid var(--green);
  border-radius: var(--radius);
  background: #060d06;
  box-shadow: 0 0 28px rgba(112, 219, 121, 0.1);
  padding: 28px;
}

.wizard h1 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.wizard .kicker {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 18px;
}

.wizard p { color: var(--muted); margin: 0 0 14px; }
.wizard strong { color: var(--text); }

.wizard ul {
  margin: 0 0 18px;
  padding-left: 1.3em;
  color: var(--muted);
}
.wizard li { margin: 6px 0; }
.wizard li::marker { color: var(--green); }

.wizard .facts {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  margin-bottom: 18px;
  font-size: 11px;
  color: var(--dim);
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    background: var(--bg);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5); }

  .menu-toggle { display: inline-flex; }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 5, 0.7);
    z-index: 25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .caret, .thinking-dots i { animation: none; }
  .thread { scroll-behavior: auto; }
  .sidebar { transition: none; }
  * { scroll-behavior: auto !important; }
}

.tool-attribution {
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--dim);
  align-self: center;
  margin-left: 2px;
}
.tool-attribution a { color: var(--dim); text-decoration: underline; }
.tool-attribution a:hover { color: var(--green); }

/* First-run notice CTA (the shared login dialog ships its own button
   styles in login-modal.css; this is the chat's local equivalent). */
.btn-primary {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  border: 1px solid var(--amber);
  background: var(--amber-dim);
  color: var(--amber);
  border-radius: var(--radius);
  font-weight: 700;
}
.btn-primary:hover { background: rgba(224, 170, 57, 0.22); }
