/* ═══════════════════════════════════════════════════════════════════════
   SiberNebula — MONOCHROME THEME (Ink / Paper)
   ═══════════════════════════════════════════════════════════════════════
   A standalone, pixel-faithful port of ./v2.html. The server serves THIS
   stylesheet (instead of style.css) when SIBERNEBULA_THEME=monochrome, so the
   legacy cosmic theme never competes for the cascade — every value below is
   authoritative for the monochrome skin.

   Mapping note: v2.html uses its own class names (e.g. .btn-new-chat,
   .topbar, .chat-item, .chip, .message.ai). The live app uses different
   names (.sidebar-new-btn, .header, .history-item, .suggestion-chip,
   .msg-group.ai). This file targets the APP's real class names but applies
   v2's exact values, so no markup changes are needed.

   No avatars per message (the app has none) — everything else mirrors v2.
   ═══════════════════════════════════════════════════════════════════════ */

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

:root {
  /* Monochrome ink/paper palette. Ink is softened from pure black for comfort. */
  --bg:        #FAF9F6;
  --bg-panel:  #F3F1EB;
  --bg-raised: #FFFFFF;
  --ink:       #242424;
  --ink-2:     #444444;
  --ink-3:     #777777;
  --line:      #D6D2C8;
  --line-2:    #B8B3A6;
  --sel-bg:    #242424;
  --sel-fg:    #FAF9F6;
  --font-ui:   'IBM Plex Mono', ui-monospace, monospace;
  --font-body: 'Newsreader', Georgia, serif;
  --sidebar-w: 268px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Flat-everything: no shadows, no glow, no blur, no rounded corners — pure
   ink on paper. One rule covers the whole skin. */
*, *::before, *::after {
  box-shadow: none !important;
  text-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 0 !important;
}

/* Honor the [hidden] attribute over any `display` rule below. Several elements
   (.attach-preview, .client-folder-chip, .task-panel, file inputs) start hidden
   and must NOT be forced visible by their own display:flex/block rules. */
[hidden] { display: none !important; }

/* The cosmic nebula background isn't used — flat paper instead. */
#cosmic-bg,
#cosmic-bg::after {
  display: none !important;
  background: none !important;
}

/* ══════════════ LAYOUT ══════════════ */
.layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  position: relative;
  z-index: 2;
}

/* ══════════════ SIDEBAR ══════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.sidebar-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  padding: 2px;
}
.sidebar-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.2px;
}
.sidebar-badge,
.sidebar-version {
  font-size: 9px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  padding: 2px 6px;
  margin-left: auto;
}
.sidebar-close {
  display: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 16px;
  align-items: center;
  justify-content: center;
}
.sidebar-close:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* New-chat button: solid ink bar, like ./v2 .btn-new-chat. */
.sidebar-new-btn {
  width: 100%;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  transition: background 0.12s ease;
}
.sidebar-new-btn:hover { background: var(--ink-2); }
.sidebar-new-btn .icon {
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-section-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--ink-3);
  margin-bottom: 8px;
  padding-left: 2px;
  font-weight: 400;
}

/* History list = ./v2 .chat-list */
.sidebar-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 -8px;
  padding: 0 8px;
  min-height: 0;
}

/* History item = ./v2 .chat-item */
.history-item {
  padding: 9px 11px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.4;
  transition: background 0.1s ease, color 0.1s ease;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-item:hover { background: var(--bg-raised); color: var(--ink); }
.history-item.active {
  background: var(--sel-bg);
  color: var(--sel-fg);
  border-color: var(--ink);
}
.history-empty {
  padding: 9px 11px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-style: italic;
}
/* The app injects a per-session rainbow gradient on .h-icon via sessionColor();
   override it to a neutral ink chip. */
.history-item .h-icon {
  width: 22px;
  height: 22px;
  background: var(--bg-raised) !important;
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  position: relative;
}
.history-item .h-icon::after { display: none; }
.history-item .h-icon > span { position: static; z-index: auto; }
.history-item.active .h-icon {
  background: var(--bg) !important;
  border-color: var(--bg);
}
.history-item .h-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.history-item .h-title {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12.5px;
  color: inherit;
  line-height: 1.35;
  letter-spacing: 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item .h-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: inherit;
  opacity: 0.8;
}
.history-item .h-meta .dot { width: 3px; height: 3px; background: currentColor; opacity: 0.5; flex-shrink: 0; }
.history-item .h-delete {
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  font-size: 12px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  display: none;
}
.history-item:hover .h-delete { display: flex; }
.history-item .h-delete:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); opacity: 1; }

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 500; color: var(--ink); }
.user-plan,
.user-role { font-size: 9.5px; color: var(--ink-3); }
.user-settings {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-settings:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Settings menu popover */
.settings-menu {
  position: absolute;
  bottom: 100%;
  left: 12px;
  right: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--ink);
  box-shadow: none;
  padding: 6px 0;
  display: none;
  flex-direction: column;
  z-index: 100;
}
.settings-menu.open { display: flex; }
.settings-menu-header {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  text-transform: none;
  letter-spacing: 0;
}
.settings-item {
  padding: 9px 4px;
  font-size: 12px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-item:last-child { border-bottom: none; }
.settings-icon { font-size: 13px; color: var(--ink-3); width: 18px; text-align: center; }
.settings-label { flex: 1; }
.settings-value { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.4px; }
.settings-divider { height: 1px; background: var(--line); margin: 4px 0; }
.settings-about { font-size: 10px; color: var(--ink-3); padding-top: 8px; }

/* Toggle switch */
.toggle-switch {
  width: 34px;
  height: 18px;
  background: var(--line-2);
  display: inline-flex;
  align-items: center;
  position: relative;
  cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-slider {
  width: 14px;
  height: 14px;
  background: var(--bg-raised);
  margin-left: 2px;
  transition: transform 0.12s ease;
}
.toggle-switch:has(input:checked) { background: var(--ink); }
.toggle-switch:has(input:checked) .toggle-slider { transform: translateX(16px); }

/* Mobile drawer overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.35);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

/* ══════════════ MAIN / TOPBAR (app: .header) ══════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.header,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}
.header-left, .topbar-left { display: flex; align-items: center; gap: 12px; }
.header-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 15px;
  display: none;
  align-items: center;
  justify-content: center;
}
.header-toggle:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.header-mode, .topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--ink-2);
  text-transform: uppercase;
}
.mode-dot, .status-dot { width: 7px; height: 7px; background: var(--ink); }
.mode-label { color: var(--ink-2); }
.header-actions, .topbar-right { display: flex; align-items: center; gap: 6px; }
.model-picker {
  position: relative;
  width: fit-content;
  max-width: min(260px, calc(100vw - 96px));
}
.model-picker-btn {
  width: fit-content;
  min-width: 0;
  max-width: min(260px, calc(100vw - 96px));
  height: 31px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 0 9px;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}
.model-picker-btn span:first-child {
  min-width: 0;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-picker-btn:hover,
.model-picker-btn:focus,
.model-picker.open .model-picker-btn {
  border-color: var(--ink);
  color: var(--ink);
}
.model-picker-arrow {
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  flex-shrink: 0;
}
.model-picker.open .model-picker-arrow {
  transform: rotate(225deg) translateY(-1px);
}
.model-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: fit-content;
  min-width: 100%;
  max-width: min(280px, calc(100vw - 24px));
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--ink);
  z-index: 80;
}
.model-picker-option {
  width: auto;
  min-width: 100%;
  max-width: min(280px, calc(100vw - 24px));
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
}
.model-picker-option:last-child { border-bottom: 0; }
.model-picker-option:hover,
.model-picker-option.active {
  background: var(--ink);
  color: var(--bg);
}
.model-picker-option-alias {
  display: block;
  max-width: 240px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-picker-option-meta {
  display: block;
  max-width: 240px;
  margin-top: 3px;
  font-size: 9.5px;
  color: currentColor;
  opacity: 0.65;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-btn, .topbar-btn {
  padding: 6px 11px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.header-btn:hover, .topbar-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ══════════════ CHAT AREA ══════════════ */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── Welcome ── */
.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  animation: fadeUp 0.6s ease;
}
.welcome-icon { display: none; }
.welcome-rule {
  width: 44px;
  height: 1px;
  background: var(--ink);
  margin-bottom: 20px;
}
.welcome h1 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 27px;
  line-height: 1.3;
  margin-bottom: 12px;
  max-width: 460px;
  letter-spacing: -0.3px;
  color: var(--ink);
  background: none;
  -webkit-text-fill-color: var(--ink);
  filter: none;
}
.welcome h1 em { font-style: italic; }
.welcome p,
.welcome-desc {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 380px;
  margin-bottom: 26px;
  font-style: italic;
}
.welcome-suggestions,
.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  max-width: 520px;
}
.suggestion-chip, .chip {
  padding: 7px 13px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.suggestion-chip:hover, .chip:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* ══════════════ MESSAGES (app: .msg-group) ══════════════ */
/* The app renders a flat centered column, max-width 720px like ./v2 .messages. */
.chat-messages::after { content: none; }
.msg-group, .message {
  display: flex;
  gap: 14px;
  animation: msgIn 0.3s ease;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.msg-group.user, .message.user { flex-direction: row-reverse; }
.msg-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.msg-group.ai .msg-content,
.message.ai .msg-content {
  width: 100%;
  max-width: 100%;
}
.msg-group.user .msg-content,
.message.user .msg-content {
  max-width: 80%;
}
.msg-group.user .msg-content { align-items: flex-end; }

/* AI text: clean serif paragraph, no bubble background. */
.msg-group.ai .msg-bubble,
.message.ai .msg-bubble {
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.7;
  border: none;
  width: auto;
  max-width: 100%;
  padding: 0;
}
.msg-group.ai .msg-bubble p,
.message.ai .msg-bubble p { margin-bottom: 10px; }
.msg-group.ai .msg-bubble p:last-child,
.message.ai .msg-bubble p:last-child { margin-bottom: 0; }

/* User text: plain, right-aligned, no background — a typed line. */
.msg-group.user .msg-bubble,
.message.user .msg-bubble {
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  text-align: right;
  border: none;
  padding: 0;
  width: auto;
  max-width: 100%;
}
.msg-text { font: inherit; color: inherit; }
.msg-time, .msg-meta {
  font-size: 9px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 6px;
  padding: 0 3px;
}
.msg-group.user .msg-time,
.message.user .msg-meta { text-align: right; }

/* Markdown elements inside bubbles */
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3, .msg-bubble h4 {
  font-family: var(--font-body);
  color: var(--ink);
  margin: 14px 0 8px;
  line-height: 1.3;
}
.msg-bubble h1 { font-size: 21px; }
.msg-bubble h2 { font-size: 18px; }
.msg-bubble h3 { font-size: 16px; }
.msg-bubble p { margin-bottom: 10px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble strong { color: var(--ink); font-weight: 600; }
.msg-bubble em { font-style: italic; }
.msg-bubble a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.msg-bubble ul, .msg-bubble ol { margin: 8px 0 10px; padding-left: 22px; }
.msg-bubble li { margin-bottom: 4px; }
.msg-bubble blockquote {
  border-left: 2px solid var(--ink);
  padding-left: 12px;
  margin: 10px 0;
  color: var(--ink-2);
  font-style: italic;
  background: none;
}
.msg-bubble hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.msg-bubble table {
  display: block;
  border-collapse: collapse;
  margin: 10px 0;
  font-family: var(--font-ui);
  font-size: 12px;
  width: max-content;
  min-width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.msg-bubble table::-webkit-scrollbar {
  height: 6px;
}
.msg-bubble table::-webkit-scrollbar-track {
  background: transparent;
}
.msg-bubble table::-webkit-scrollbar-thumb {
  background: var(--line-2);
}
.msg-bubble th, .msg-bubble td {
  border: 1px solid var(--line-2);
  padding: 6px 10px;
  text-align: left;
  white-space: nowrap;
}
.msg-bubble th { background: var(--bg-panel); font-weight: 600; }
.msg-bubble img { max-width: 100%; height: auto; }

/* Inline code */
.msg-bubble code,
.inline-code,
.md-code-inline {
  font-family: var(--font-ui);
  font-size: 0.88em;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 1px 5px;
  color: var(--ink);
}

/* ── Code block (app: .code-block, mirrors ./v2 .md-code-block) ── */
.msg-bubble pre,
.code-block,
.md-code-block,
.rich-code {
  margin: 12px 0;
  border: 1px solid var(--line-2);
  background: var(--bg-raised);
  overflow: hidden;
}
.code-block-header,
.code-block-head,
.md-code-head,
.rich-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--bg-panel);
}
.code-block-lang { color: var(--ink-3); }
.code-block-lang::before { display: none; }
.code-block-copy,
.md-copy-btn,
.rich-code-copy {
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.code-block-copy:hover,
.md-copy-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.msg-bubble pre,
.code-block pre,
.md-code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: transparent;
  border: none;
}
.code-block code,
.md-code-block code,
.rich-code code {
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre;
  background: none;
  border: none;
  padding: 0;
}

/* highlight.js GitHub-Dark tokens are too dark for paper; neutralize. */
.hljs { color: var(--ink); background: transparent; }
.hljs-comment, .hljs-quote { color: var(--ink-3); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in { color: var(--ink); font-weight: 600; }
.hljs-string, .hljs-attr, .hljs-meta-string { color: var(--ink-2); }
.hljs-number, .hljs-literal { color: var(--ink-3); }
.hljs-title, .hljs-title.function_, .hljs-section { color: var(--ink); font-weight: 500; }
.hljs-name, .hljs-selector-id, .hljs-selector-class { color: var(--ink-2); }
.hljs-tag, .hljs-attribute { color: var(--ink-2); }
.hljs-variable, .hljs-template-variable { color: var(--ink); }
.hljs-addition { color: var(--ink); background: rgba(17, 17, 17, 0.06); }
.hljs-deletion { color: var(--ink); background: rgba(17, 17, 17, 0.12); text-decoration: line-through; }
.token-keyword { color: var(--ink); font-weight: 600; }
.token-string { color: var(--ink-2); }
.token-function { color: var(--ink-2); }
.token-number { color: var(--ink-3); }
.token-class { color: var(--ink-2); }

/* ══════════════ TYPING INDICATOR ══════════════ */
.typing-indicator, .typing {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 6px 0;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.typing-indicator.active, .typing.active { display: flex; }
.typing-dots {
  display: flex;
  gap: 5px;
  padding: 0;
  background: transparent;
  border: none;
}
.typing-dots span, .typing-dot {
  width: 7px;
  height: 7px;
  background: var(--ink);
  animation: monoBlink 1.3s infinite steps(1);
}
.typing-dots span:nth-child(2), .typing-dot:nth-child(2) { animation-delay: 0.25s; }
.typing-dots span:nth-child(3), .typing-dot:nth-child(3) { animation-delay: 0.5s; }
.typing-label { color: var(--ink-3); font-size: 12px; }

.session-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg);
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 10px;
}
.session-loading[hidden], .session-history-loader[hidden] { display: none; }
.session-loading-spinner {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line-2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: sessionSpin 0.75s linear infinite;
}
@keyframes sessionSpin { to { transform: rotate(360deg); } }
.session-history-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 0 7px;
}
.session-history-loader button {
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: 5px 9px;
  background: var(--bg-raised);
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 9px;
  cursor: pointer;
}
.session-history-loader button:hover { border-color: var(--ink); color: var(--ink); }
.session-history-loading { display: none; color: var(--ink-3); font-family: var(--font-ui); font-size: 9px; }
.session-history-loader.loading .session-history-loading { display: inline; }
.session-history-loader.loading::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border: 1px solid var(--line-2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: sessionSpin 0.75s linear infinite;
}
@keyframes monoBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.15; } }

/* ══════════════ TOOL PROCESS (app: .rich-process, mirrors ./v2 .tool-card) ══════════════ */
.rich-process, .tool-card {
  margin: 12px 0;
  border: 1px solid var(--line-2);
  background: var(--bg-panel);
}
.process-header, .tool-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-2);
}
.process-spinner, .tool-icon, .tool-spinner {
  border: 1px solid var(--ink-2);
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}
.process-spinner, .tool-spinner {
  border: 2px solid var(--line-2);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.process-title { color: var(--ink-2); font-weight: 500; }
.process-step .step-indicator { color: var(--ink); }
.process-step-detail { color: var(--ink-3); }
.tool-name { font-weight: 600; color: var(--ink); }
.process-bar-track, .tool-progress {
  height: 4px;
  background: var(--line);
  margin-top: 8px;
  overflow: hidden;
}
.process-bar-fill, .tool-progress-bar {
  height: 100%;
  background: var(--ink);
  width: 0;
  transition: width 0.4s ease;
}
.process-percent { color: var(--ink-3); font-size: 10px; }
.process-steps { display: flex; flex-direction: column; gap: 6px; }
.process-step { display: flex; align-items: center; gap: 8px; }
.step-indicator {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  color: transparent;
}
.step-indicator.active { background: var(--ink); border-color: var(--ink); color: transparent; }
.step-indicator.done { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.process-step-label { color: var(--ink-2); font-size: 11.5px; }
.process-step.is-active .process-step-label { color: var(--ink); }
.mini-spin {
  width: 12px;
  height: 12px;
  border: 2px solid var(--line-2);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.tool-body { padding: 10px 12px; font-family: var(--font-ui); font-size: 11.5px; line-height: 1.6; color: var(--ink-2); }
.tool-row { display: flex; gap: 8px; }
.tool-row .k { color: var(--ink-3); min-width: 70px; }
.tool-row .v { color: var(--ink); word-break: break-word; }
.tool-status { margin-left: auto; font-size: 9.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--ink-3); }
.tool-status.running, .tool-status.done { color: var(--ink); }

/* The rich-process body holds steps; give it panel padding. */
.rich-process .process-header { padding: 9px 12px; }
.rich-process > *:not(.process-header) { padding-left: 12px; padding-right: 12px; }
.rich-process .process-steps { padding: 10px 12px; }

/* ══════════════ FILES / RICH CONTENT ══════════════ */
.file-card, .youtube-card, .html-preview-card, .att-image {
  margin: 12px 0;
  border: 1px solid var(--line-2);
  background: var(--bg-raised);
  overflow: hidden;
}
.file-caption {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--bg-panel);
}
.att-image-cap {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.4px;
}
.file-media { background: var(--bg); }
.file-media img, .att-image img { display: block; width: 100%; height: auto; }
.file-media audio, .file-media video { width: 100%; display: block; }

.file-download {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s ease;
}
.file-download:hover { background: var(--bg-panel); }
.file-download-icon {
  width: 30px;
  height: 36px;
  border: 1px solid var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--bg);
  color: var(--ink);
}
.file-download-info, .file-meta { flex: 1; min-width: 0; }
.file-download-name, .file-name {
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-download-meta, .file-size { font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.file-download-arrow { color: var(--ink-3); font-size: 14px; flex-shrink: 0; }
.file-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
}
.file-footer a {
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.file-footer a:hover { background: var(--ink); color: var(--bg); }

.youtube-embed, .html-preview-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  border: 0;
  background: var(--ink);
}
.html-preview-frame { background: var(--bg-raised); }

/* User attachment badges + upload chips */
.user-attach, .attach-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  background: var(--bg-panel);
  color: var(--ink-2);
  font-size: 11.5px;
}
.user-attach.downloadable { border-color: var(--ink); }
.user-attach-icon, .attach-chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.attach-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--line-2);
  border-top-color: var(--ink);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.user-attach-info, .attach-chip-info { display: flex; flex-direction: column; min-width: 0; }
.user-attach-name, .attach-chip-name {
  color: var(--ink);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-attach-meta, .attach-chip-meta {
  color: var(--ink-3);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-chip-remove {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 13px;
  flex-shrink: 0;
}
.attach-chip-remove:hover { color: var(--ink); }

.client-folder-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  background: var(--bg-panel);
  color: var(--ink-2);
  font-size: 11px;
  margin: 0 auto 8px 0;
}
.client-folder-chip-icon { font-size: 13px; flex-shrink: 0; }
.client-folder-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.client-folder-chip-clear {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 14px;
  margin-left: 4px;
  flex-shrink: 0;
}
.client-folder-chip-clear:hover { color: var(--ink); }

.client-folder-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  background: var(--bg-panel);
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.5;
  z-index: 40;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}
.client-folder-info[hidden] { display: none; }
.client-folder-info-icon { flex-shrink: 0; color: var(--ink); }
.client-folder-info-body { flex: 1; min-width: 0; }
.client-folder-info-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}
.client-folder-info-action {
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.client-folder-info-action:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.client-folder-info-confirm {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 720px;
  max-height: 74px;
  margin: 0 auto 8px;
  padding: 0 2px;
  overflow-y: auto;
}
.attach-preview .attach-chip {
  width: fit-content;
  max-width: min(240px, 100%);
  padding: 6px 8px;
}

/* ══════════════ STREAMING ══════════════ */
/* The app toggles .stream-caret on .msg-text; render a block cursor. */
.stream-plain { white-space: pre-wrap; }
.stream-caret::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--ink);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: streamBlink 0.8s steps(2) infinite;
}
@keyframes streamBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.stream-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.stream-badge .pulse { width: 7px; height: 7px; background: var(--ink); animation: monoBlink 1s steps(2) infinite; }

/* Compacting notice + compacted summary */
.compact-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 8px 0;
}
.compacted-summary {
  background: var(--bg-panel);
  border: 1px solid var(--line-2);
  padding: 0;
}
.compacted-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.compacted-icon { font-size: 13px; }
.compacted-summary-body {
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}
.compacted-summary-body.open { max-height: 500px; }
.compacted-summary-toggle {
  display: block;
  width: 100%;
  padding: 7px 12px;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
}
.compacted-summary-toggle:hover { background: var(--ink); color: var(--bg); }

/* ══════════════ MESSAGE ACTIONS (regenerate/edit) ══════════════ */
.msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.msg-action-btn {
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 9.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.msg-action-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ══════════════ INPUT AREA ══════════════ */
.input-area {
  flex-shrink: 0;
  padding: 12px 22px calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.composer-content {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}
.input-wrapper {
  max-width: none;
  margin: 0;
}
/* The actual framed bar. The app's .input-wrapper IS the bar (children sit
   directly inside it), so we frame it like ./v2 .input-box. */
.input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--ink);
  background: var(--bg-raised);
  padding: 0;
  transition: none;
}
.input-wrapper:focus-within { border-color: var(--ink); }

.input-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin: 3px;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.input-btn:hover { background: var(--bg-panel); color: var(--ink); border-color: var(--ink-2); }

/* Extensible client connector picker (folder, SSH, future connectors). */
.client-connectors { position: relative; flex-shrink: 0; }
.client-connectors-trigger.active { background: var(--bg-panel); color: var(--ink); border-color: var(--ink); }
.client-connectors-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 60;
  display: flex;
  width: 218px;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--ink);
  background: var(--bg-raised);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}
.client-connectors-menu[hidden] { display: none; }
.connector-option {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.connector-option:hover { border-color: var(--line-2); background: var(--bg-panel); }
.connector-option-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  background: var(--bg-panel);
  color: var(--ink);
  font-size: 13px;
}
.connector-option-copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.connector-option-copy strong { font-family: var(--font-ui); font-size: 10px; font-weight: 600; }
.connector-option-copy small { overflow: hidden; color: var(--ink-3); font-family: var(--font-ui); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.connector-option-arrow { color: var(--ink-3); font-size: 15px; text-align: right; }
.connector-git-icon { color: var(--ink); }
.connector-auth-modal {
  width: min(340px, calc(100vw - 28px));
  max-width: 340px;
  padding: 20px;
  border: 1px solid var(--ink);
  background: var(--bg-raised);
  text-align: center;
}
.connector-auth-modal .modal-close { top: 10px; right: 10px; }
.connector-auth-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border: 1px solid var(--ink);
  background: var(--bg-panel);
  color: var(--ink);
  font-size: 19px;
}
.connector-auth-modal h2 { margin: 0; color: var(--ink); font-family: var(--font-ui); font-size: 15px; }
.connector-auth-modal p { margin: 7px 0 15px; color: var(--ink-3); font-family: var(--font-ui); font-size: 9.5px; line-height: 1.45; }
.connector-auth-actions { display: flex; justify-content: flex-end; gap: 7px; }
.ssh-history-modal { width: min(410px, calc(100vw - 28px)); max-width: 410px; padding: 0; overflow: hidden; background: var(--bg-raised); border: 1px solid var(--ink); }
.ssh-history-header { display: grid; grid-template-columns: 32px minmax(0, 1fr) 24px; align-items: start; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ssh-history-header .ssh-modal-icon { width: 32px; height: 32px; font-size: 19px; }
.ssh-history-header h2 { margin: 0; color: var(--ink); font-family: var(--font-ui); font-size: 15px; }
.ssh-history-header p { margin: 4px 0 0; color: var(--ink-3); font-family: var(--font-ui); font-size: 9.5px; line-height: 1.4; }
.ssh-history-header .modal-close { position: static; width: 24px; height: 24px; }
.ssh-history-list { display: flex; max-height: 240px; flex-direction: column; gap: 3px; overflow-y: auto; padding: 10px 12px 3px; }
.ssh-history-empty { padding: 18px; color: var(--ink-3); font-family: var(--font-ui); font-size: 9.5px; text-align: center; }
.ssh-history-item { display: grid; grid-template-columns: minmax(0, 1fr) 26px; gap: 4px; align-items: center; }
.ssh-history-select { display: grid; grid-template-columns: 26px minmax(0, 1fr) 12px; align-items: center; gap: 7px; min-width: 0; padding: 6px; border: 1px solid transparent; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.ssh-history-select:hover { border-color: var(--line-2); background: var(--bg-panel); }
.ssh-history-item-icon { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--bg-panel); color: var(--ink); font-size: 13px; }
.ssh-history-item-copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.ssh-history-item-copy strong { overflow: hidden; font-family: var(--font-ui); font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ssh-history-item-copy small { color: var(--ink-3); font-family: var(--font-ui); font-size: 8.5px; }
.ssh-history-use { color: var(--ink-3); font-size: 15px; text-align: right; }
.ssh-history-delete { width: 24px; height: 24px; border: 1px solid transparent; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 15px; }
.ssh-history-delete:hover { border-color: var(--line-2); background: var(--bg-panel); color: var(--ink); }
.ssh-history-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 18px 14px; border-top: 1px solid var(--line); }
.git-api-hint { color: var(--ink-3); font-family: var(--font-ui); font-size: 8.5px; line-height: 1.35; }

.input-field {
  flex: 1;
  padding: 12px 15px;
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  resize: none;
  min-width: 0;
}
.input-field::placeholder { color: var(--ink-3); }

/* Send button = ./v2 .input-btn.send (solid ink). */
.send-btn {
  width: 32px;
  height: 32px;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin: 3px;
  transition: background 0.12s ease;
}
.send-btn::after { display: none; }
.send-btn:hover { background: var(--ink-2); }
.send-btn.stopping { background: var(--ink); color: var(--bg); }
.send-btn:disabled {
  background: var(--bg-panel);
  color: var(--ink-3);
  border-color: var(--line-2);
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.input-bottom { text-align: center; }
.input-hint {
  text-align: center;
  font-size: 9.5px;
  letter-spacing: 0.4px;
  color: var(--ink-3);
  margin-top: 8px;
}
.input-hint kbd {
  border: 1px solid var(--line-2);
  padding: 1px 5px;
  font-size: 9.5px;
  background: var(--bg-panel);
  font-family: var(--font-ui);
}

/* Token footer (context meter) — borderless, flush above the input. */
.token-footer {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 8px;
  max-width: 720px;
  margin: 0 auto;
  font-size: 10.5px;
  color: var(--ink-3);
  background: transparent;
  border: none;
}
.token-footer.active { display: flex; }
.token-footer-section { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.token-footer-bar {
  flex: 1;
  height: 3px;
  background: var(--line);
  overflow: hidden;
}
.token-footer-bar-fill { height: 100%; background: var(--ink); transition: width 0.3s ease; }
.token-footer-bar-fill.ok { background: var(--ink); }
.token-footer-bar-fill.warn { background: var(--ink-2); }
.token-footer-bar-fill.crit { background: var(--ink); }
.token-footer-divider { width: 1px; height: 12px; background: var(--line-2); }
.token-footer-warn-text { color: var(--ink-2); }

/* Slash command menu — flat. */
.slash-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 18px;
  right: 18px;
  background: var(--bg-raised);
  border: 1px solid var(--ink);
  padding: 6px;
  display: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}
.slash-menu.open { display: block; }
.slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-2);
}
.slash-item:last-child { border-bottom: none; }
.slash-item:hover, .slash-item.active { background: var(--bg-panel); }
.slash-item.active { color: var(--ink); }
.slash-item-icon {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-2);
  background: var(--bg-panel) !important;
  color: var(--ink) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.slash-item-info { flex: 1; min-width: 0; }
.slash-item-label { font-size: 12.5px; color: var(--ink); }
.slash-item-desc { font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.shortcut {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  padding: 1px 5px;
  background: var(--bg-panel);
}

/* ══════════════ MODALS / OVERLAYS ══════════════ */
.auth-overlay, .ask-overlay, .lightbox, .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.auth-overlay.active, .ask-overlay.active, .lightbox.active, .modal-overlay.open { display: flex; }

.auth-modal, .ask-modal, .modal-box {
  background: var(--bg-raised);
  border: 1px solid var(--ink);
  width: 90%;
  max-width: 420px;
  position: relative;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.auth-modal, .ask-modal { animation: modalIn 0.22s ease; }

.auth-close, .ask-close, .modal-close {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-2);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}
.auth-close:hover, .ask-close:hover, .modal-close:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.auth-logo { width: 48px; height: 48px; margin: 24px auto 12px; display: block; border: 1px solid var(--ink); padding: 4px; object-fit: contain; }
.auth-title, .modal-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  text-align: center;
  padding: 0 18px;
  margin-bottom: 6px;
}
.auth-subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
  padding: 0 18px;
  margin-bottom: 18px;
}
.auth-error {
  font-size: 11px;
  color: var(--ink);
  background: var(--bg-panel);
  border: 1px solid var(--ink);
  padding: 8px 12px;
  margin: 0 18px 12px;
}
.auth-error:empty,
.auth-error[hidden] {
  display: none;
}
#loginForm { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.auth-input, .ask-input, .ssh-field input, .ssh-field select, .ssh-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  background: var(--bg-raised);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  outline: none;
}
.auth-input:focus, .ask-input:focus, .ssh-field input:focus, .ssh-field select:focus, .ssh-field textarea:focus { border-color: var(--ink); }
.auth-submit, .ask-submit, .modal-btn, .ssh-btn-confirm {
  padding: 9px 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease;
}
.auth-submit:hover, .ask-submit:hover, .ssh-btn-confirm:hover { background: var(--ink-2); }
.ssh-btn-cancel {
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
}
.ssh-btn-cancel:hover { background: var(--bg-panel); }
.ssh-field label { color: var(--ink-2); font-family: var(--font-ui); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
.ssh-dialog-title { font-family: var(--font-ui); color: var(--ink); }
.ssh-dialog-hint { color: var(--ink-3); }
.ssh-modal {
  width: min(560px, calc(100vw - 28px));
  max-width: 560px;
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  overflow: auto;
  background: var(--bg-raised);
  border: 1px solid var(--ink);
}
.ssh-modal-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  gap: 14px;
  align-items: start;
  padding: 22px 24px 19px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
}
.ssh-modal-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  background: var(--bg-panel);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}
.ssh-modal-heading { min-width: 0; padding-top: 1px; }
.ssh-dialog-kicker { display: block; margin-bottom: 4px; color: var(--ink-3); font-size: 9px; font-weight: 700; letter-spacing: 0.12em; }
.ssh-dialog-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 19px;
  letter-spacing: 0;
}
.ssh-dialog-hint { max-width: 400px; margin: 6px 0 0; color: var(--ink-3); font-family: var(--font-ui); font-size: 11px; line-height: 1.45; }
.ssh-form { display: flex; flex-direction: column; }
.ssh-modal-header .modal-close {
  position: static;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
}
.ssh-modal-section { padding: 18px 24px 5px; }
.ssh-auth-section { padding-top: 13px; }
.ssh-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.ssh-section-label {
  display: block;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.ssh-section-description {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 10.5px;
}
.ssh-section-index {
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 10px;
}
.ssh-field {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  margin-bottom: 10px;
}
.ssh-field-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 10px; }
.ssh-field-port { max-width: none; }
.ssh-field[hidden] { display: none !important; }
.ssh-field label {
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.ssh-field input,
.ssh-field select,
.ssh-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: 0 !important;
  background: var(--bg-raised);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
}
.ssh-field textarea { min-height: 94px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.45; }
.ssh-field input::placeholder, .ssh-field textarea::placeholder { color: var(--ink-3); }
.ssh-field input:focus,
.ssh-field select:focus,
.ssh-field textarea:focus {
  border-color: var(--ink);
  background: var(--bg-raised);
  box-shadow: 0 0 0 2px var(--line) !important;
}
.ssh-form-status {
  margin: 4px 24px 13px;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  background: var(--bg-panel);
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 10.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ssh-form-status.error { border-color: var(--ink); color: var(--ink); }
.ssh-form-status.success { border-color: var(--ink-2); color: var(--ink-2); }
.ssh-security-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 24px 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 0 !important;
  background: var(--bg-panel);
  color: var(--ink-3);
  font-family: var(--font-ui);
}
.ssh-security-icon { color: var(--ink); }
.ssh-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-panel);
}
.ssh-btn {
  cursor: pointer;
  min-height: 40px;
  padding: 0 17px;
  border-radius: 0 !important;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
}
.ssh-btn-cancel {
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
}
.ssh-btn-cancel:hover { background: var(--bg-raised); color: var(--ink); }
.ssh-btn-confirm {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
}
.ssh-btn-confirm:hover { background: var(--ink-2); }
@media (max-width: 480px) {
  .ssh-modal-header { grid-template-columns: 36px minmax(0, 1fr) 30px; gap: 11px; padding: 19px 18px 16px; }
  .ssh-modal-icon { width: 36px; height: 36px; font-size: 23px; }
  .ssh-dialog-title { font-size: 17px; }
  .ssh-modal-section { padding-right: 18px; padding-left: 18px; }
  .ssh-security-note, .ssh-form-status { margin-right: 18px; margin-left: 18px; }
  .ssh-dialog-actions { padding-right: 18px; padding-left: 18px; }
  .ssh-field-row { grid-template-columns: minmax(0, 1fr) 96px; gap: 9px; }
}
.auth-oauth-divider { display: flex; align-items: center; gap: 10px; margin: 0 18px 12px; color: var(--ink-3); font-size: 11px; }
.auth-oauth-divider::before, .auth-oauth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.oauth-login-buttons { display: flex; flex-direction: column; gap: 8px; padding: 0 18px 18px; }
.oauth-login-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line-2); color: var(--ink); background: transparent; text-decoration: none; font-size: 12px; }
.oauth-login-btn:hover { background: var(--bg-panel); }
.oauth-login-mark { width: 18px; font-weight: 700; }
.modal-btn { background: transparent; color: var(--ink); }
.modal-btn:hover { background: var(--ink); color: var(--bg); }
.modal-btn.primary { background: var(--ink); color: var(--bg); }
.modal-btn.primary:hover { background: var(--ink-2); }

/* Stop confirmation dialog */
.stop-confirm-modal {
  max-width: 380px;
  padding: 24px 24px 20px;
  animation: modalIn 0.22s ease;
}
.stop-confirm-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 12px;
}
.stop-confirm-title { padding: 0; margin: 0 0 8px; }
.stop-confirm-message {
  margin: 0;
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.stop-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* Ask dialog specifics */
.ask-modal { max-width: 480px; padding: 0 0 16px; }
.ask-header { padding: 16px 54px 8px 18px; }
.ask-badge {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  padding: 2px 7px;
  background: var(--bg-panel);
}
.ask-body { padding: 8px 18px; }
.ask-question {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 14px;
}
.ask-choices { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.ask-choice {
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.ask-choice:hover { background: var(--bg-panel); color: var(--ink); }
.ask-choice.selected { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.ask-choice-num {
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  opacity: 0.7;
}
.ask-input { width: 100%; margin-bottom: 10px; }
.ask-hint { font-size: 10px; color: var(--ink-3); padding: 0 18px 10px; }
.ask-hint kbd { border: 1px solid var(--line-2); padding: 1px 5px; font-size: 9.5px; background: var(--bg-panel); font-family: var(--font-ui); }
.ask-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0 18px; }
.ask-cancel {
  position: static;
  width: auto;
  height: auto;
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
}
.ask-cancel:hover { background: var(--bg-panel); color: var(--ink); border-color: var(--ink); }
.ask-close:disabled, .ask-cancel:disabled { opacity: 0.55; cursor: wait; }

/* Lightbox */
.lightbox img { max-width: 92%; max-height: 90%; border: 1px solid var(--line-2); }

/* Task panel (floating checklist) */
.task-panel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 280px;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--ink);
  z-index: 200;
}
.task-panel[hidden] { display: none; }
.task-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-2);
}
.task-panel-toggle { border: none; background: transparent; cursor: pointer; color: var(--ink-3); font-size: 14px; }
.task-panel-toggle:hover { color: var(--ink); }
.task-panel-body { overflow-y: auto; padding: 6px; }
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
}
.task-item:last-child { border-bottom: none; }
.task-check {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: transparent;
  flex-shrink: 0;
  margin-top: 1px;
}
.task-item.completed .task-check { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.task-item.in_progress .task-check { background: transparent; border-color: var(--ink); color: transparent; }
.task-dot { display: none; }
.task-text { color: var(--ink-2); line-height: 1.4; }
.task-item.completed .task-text { color: var(--ink-3); text-decoration: line-through; }
.task-item.in_progress .task-text { color: var(--ink); font-weight: 500; }

/* ══════════════ SCROLLBARS ══════════════ */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ══════════════ MOBILE ══════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .header-toggle, .mobile-menu-btn { display: flex; }
  .welcome h1 { font-size: 22px; }
  .welcome-desc { font-size: 13.5px; }
  .chat-messages { padding: 22px 14px; }
  .input-area { padding: 11px 14px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .msg-content { max-width: 86%; }
  .msg-group.ai .msg-content,
  .message.ai .msg-content {
    max-width: 100%;
  }
  .header, .topbar { padding: 11px 16px; }
  .task-panel { width: calc(100% - 32px); max-width: 320px; }
}

/* ══════════════ PRINT ══════════════ */
@media print {
  .sidebar, .header, .topbar, .input-area, .input-wrapper, .token-footer,
  .task-panel, .sidebar-overlay, .header-toggle, .mobile-menu-btn { display: none !important; }
  body { background: #fff; color: #000; height: auto; overflow: visible; }
  .chat-messages { overflow: visible; }
}

/* Reduced motion: collapse the functional animations. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Compact SSH connector scale */
.ssh-modal { width: min(480px, calc(100vw - 28px)); max-width: 480px; }
.ssh-modal-header { grid-template-columns: 32px minmax(0, 1fr) 24px; gap: 10px; padding: 16px 18px 14px; }
.ssh-modal-icon { width: 32px; height: 32px; font-size: 20px; }
.ssh-dialog-kicker { margin-bottom: 3px; font-size: 8px; }
.ssh-dialog-title { font-size: 16px; }
.ssh-dialog-hint { margin-top: 5px; font-size: 10px; line-height: 1.4; }
.ssh-modal-header .modal-close { width: 24px; height: 24px; font-size: 11px; }
.ssh-modal-section { padding: 14px 18px 3px; }
.ssh-auth-section { padding-top: 10px; }
.ssh-section-heading { gap: 10px; margin-bottom: 9px; }
.ssh-section-label { font-size: 9px; }
.ssh-section-description, .ssh-section-index { font-size: 9px; }
.ssh-section-description { margin-top: 2px; }
.ssh-field { gap: 4px; margin-bottom: 8px; }
.ssh-field-row { grid-template-columns: minmax(0, 1fr) 88px; gap: 8px; }
.ssh-field label { font-size: 10px; }
.ssh-field input, .ssh-field select, .ssh-field textarea { padding: 8px 10px; font-size: 11px; }
.ssh-field textarea { min-height: 78px; font-size: 10px; }
.ssh-security-note { gap: 7px; margin: 3px 18px 12px; padding: 8px 9px; font-size: 9px; line-height: 1.35; }
.ssh-security-icon { font-size: 10px; }
.ssh-dialog-actions { gap: 7px; padding: 11px 18px 14px; }
.ssh-btn { min-height: 33px; padding: 0 12px; font-size: 10px; }

/* Browser Session connector modal. Keep this in the monochrome theme too:
   the app swaps style.css for this file, so browser-specific rules cannot
   rely on the legacy stylesheet being present. */
.connector-browser-icon {
  background: var(--bg-panel);
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.browser-session-modal {
  box-sizing: border-box;
  width: min(500px, calc(100vw - 28px));
  max-width: 500px;
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--bg-raised);
  color: var(--ink);
}
.browser-session-header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 24px;
  gap: 10px;
  align-items: start;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.browser-session-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: var(--bg-panel);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}
.browser-session-header > div:nth-child(2) { min-width: 0; }
.browser-session-header .ssh-dialog-kicker { margin-bottom: 3px; font-size: 8px; }
.browser-session-header h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}
.browser-session-header p {
  margin: 5px 0 0;
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1.4;
}
.browser-session-header .modal-close {
  position: static;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 0;
  font-size: 11px;
}
.browser-session-body {
  display: grid;
  gap: 10px;
  padding: 15px 18px 13px;
  overflow-y: auto;
}
.browser-session-status {
  min-height: 15px;
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1.4;
}
.browser-session-status.success { color: var(--ink); }
.browser-session-status.error { color: var(--ink-2); }
.browser-session-tab-field { display: grid; gap: 7px; color: var(--ink-2); font-family: var(--font-ui); font-size: 10px; }
.browser-session-all-tabs { display: flex; align-items: center; gap: 7px; color: var(--ink); font-size: 10px; }
.browser-session-tab-list { display: grid; max-height: 150px; gap: 4px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); }
.browser-session-tab-option { display: flex; min-width: 0; align-items: flex-start; gap: 8px; padding: 7px; cursor: pointer; }
.browser-session-tab-option:hover { background: var(--bg-panel); }
.browser-session-tab-copy { display: grid; min-width: 0; gap: 2px; }
.browser-session-tab-copy strong, .browser-session-tab-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-session-tab-copy strong { color: var(--ink); font-size: 10px; font-weight: 600; }
.browser-session-tab-copy small { color: var(--ink-3); font-size: 9px; }
.browser-session-tab-empty { padding: 8px; color: var(--ink-3); font-size: 10px; }
.browser-session-full-access,
.browser-session-note {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg-panel);
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1.45;
}
.browser-session-full-access strong { color: var(--ink); font-size: 11px; font-weight: 600; }
.browser-session-note { display: flex; gap: 8px; background: transparent; }
.browser-session-install-guide {
  border: 1px solid var(--line);
  padding: 9px 11px;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1.5;
}
.browser-session-install-guide summary { color: var(--ink); cursor: pointer; font-weight: 600; }
.browser-session-install-guide ol { margin: 8px 0 0 17px; padding: 0; }
.browser-session-install-guide li + li { margin-top: 4px; }
.browser-session-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  padding: 11px 18px 14px;
  border-top: 1px solid var(--line);
}
.browser-session-actions .modal-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.browser-session-actions .modal-btn:hover { background: var(--ink); color: var(--bg); }
.browser-session-actions .modal-btn.primary { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.browser-session-actions .modal-btn.primary:hover { background: var(--ink-2); }

/* Compact composer: keep active connectors, context, and the hint shallow so
   the conversation remains the dominant surface. */
.input-area {
  padding-top: 6px;
  padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
}
.active-client-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  min-height: 0;
  margin: 0 0 3px;
}
.active-client-chips:not(:has(.client-folder-chip:not([hidden]))) { display: none; }
.active-client-chips .client-folder-chip {
  gap: 5px;
  margin: 0;
  padding: 3px 6px 3px 7px;
  border-radius: 5px;
  font-size: 9px;
  line-height: 1.2;
}
.active-client-chips .client-folder-chip-icon { font-size: 10px; }
.active-client-chips .client-folder-chip-clear {
  width: 15px;
  height: 15px;
  margin-left: 1px;
  font-size: 11px;
}
.token-footer {
  padding: 1px 8px 4px;
  font-size: 9px;
}
.token-footer-section { gap: 5px; }
.token-footer-bar { height: 2px; min-width: 40px; }
.input-wrapper { padding: 3px 4px 3px 6px; }
.input-field {
  font-size: 13px;
  line-height: 1.35;
  padding: 7px 0 7px 3px;
}
.input-bottom {
  min-height: 13px;
  padding-top: 3px;
}
.input-hint { margin-top: 0; font-size: 8.5px; }
.input-hint kbd { padding: 0 3px; font-size: 8px; }

@media (max-width: 520px) {
  .browser-session-actions { justify-content: stretch; }
  .browser-session-actions .modal-btn { flex: 1 1 auto; text-align: center; }
}
