Nick Meslovich / Products / Gravitas

web/styles.css

44.6 KB · raw

/* Gravitas stylesheet.
   Refined multi-chat workspace UI with cosmic indigo/blue palette.
   Meets WCAG AA contrast (>= 4.5:1) in both light and dark themes and 44x44px touch targets on mobile. */

:root {
  color-scheme: light dark;

  --bg: #f5f7fc;
  --bg-elev: #ffffff;
  --bg-subtle: #ecf0f9;
  --bg-muted: #e0e7f5;
  --fg: #131724;
  --fg-muted: #475066;
  --fg-subtle: #5d6882;
  --border: #d4dceb;
  --border-strong: #b4c0dc;

  --accent: #2454d3;
  --accent-hover: #1b43b0;
  --accent-fg: #ffffff;
  --accent-soft: #e5edff;

  --user-bubble: #2454d3;
  --user-bubble-fg: #ffffff;

  --ok: #156e40;
  --ok-soft: #e2f5ea;
  --warn: #8a5100;
  --warn-soft: #fff4df;
  --danger: #b3261e;
  --danger-fg: #ffffff;
  --danger-soft: #fce8e6;

  --code-bg: #101421;
  --code-fg: #eef2ff;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 20, 35, 0.05), 0 1px 3px rgba(15, 20, 35, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 20, 35, 0.14);

  --sidebar-w: 304px;
  --topbar-h: 56px;
  --content-max: 860px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f1219;
    --bg-elev: #171b25;
    --bg-subtle: #1e2330;
    --bg-muted: #272d3d;
    --fg: #eef2ff;
    --fg-muted: #b5bfd8;
    --fg-subtle: #8b96b3;
    --border: #2a3042;
    --border-strong: #3d465f;

    --accent: #8ab4f8;
    --accent-hover: #a6c8ff;
    --accent-fg: #0b1323;
    --accent-soft: #1f2a42;

    --user-bubble: #253860;
    --user-bubble-fg: #f2f5ff;

    --ok: #6dd58c;
    --ok-soft: #143222;
    --warn: #fbbc04;
    --warn-soft: #36280c;
    --danger: #f28b82;
    --danger-fg: #280806;
    --danger-soft: #3c1917;

    --code-bg: #0a0d13;
    --code-fg: #eef2ff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1219;
  --bg-elev: #171b25;
  --bg-subtle: #1e2330;
  --bg-muted: #272d3d;
  --fg: #eef2ff;
  --fg-muted: #b5bfd8;
  --fg-subtle: #8b96b3;
  --border: #2a3042;
  --border-strong: #3d465f;

  --accent: #8ab4f8;
  --accent-hover: #a6c8ff;
  --accent-fg: #0b1323;
  --accent-soft: #1f2a42;

  --user-bubble: #253860;
  --user-bubble-fg: #f2f5ff;

  --ok: #6dd58c;
  --ok-soft: #143222;
  --warn: #fbbc04;
  --warn-soft: #36280c;
  --danger: #f28b82;
  --danger-fg: #280806;
  --danger-soft: #3c1917;

  --code-bg: #0a0d13;
  --code-fg: #eef2ff;
}

:root[data-theme="light"] {
  color-scheme: light;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

button, input, select, textarea, summary, a, [role="button"] {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* Thin subtle scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--fg-subtle);
  border: 2px solid transparent;
  background-clip: content-box;
}

/* App Shell */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  height: 100%;
  min-height: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  z-index: 30;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-icon {
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.brand-sub {
  font-size: 0.77rem;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-close {
  display: none;
}

.sidebar-actions {
  padding: 6px 14px 10px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.94rem;
  transition: background 120ms ease, transform 90ms ease;
}

.primary-button:hover {
  background: var(--accent-hover);
}

.primary-button:active {
  transform: scale(0.985);
}

.new-chat-button {
  width: 100%;
}

.sidebar-section {
  padding: 8px 14px;
}

/* Running Now Section in Sidebar */
.running-section {
  padding-top: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.running-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--warn);
}

.running-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  flex-shrink: 0;
  animation: pulse 1.15s ease-in-out infinite;
}

.running-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 185px;
  overflow-y: auto;
}

.running-row {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 4px 2px 2px;
  transition: border-color 120ms ease, background 120ms ease;
}

.running-row.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.running-row.needs-attention {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.running-item-btn {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 6px;
  text-align: left;
  min-height: 40px;
}

.running-item-btn:hover {
  background: rgba(128, 128, 128, 0.08);
}

.running-item-title {
  font-size: 0.86rem;
  font-weight: 600;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.running-item-status {
  font-size: 0.74rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.running-row.needs-attention .running-item-status {
  color: var(--warn);
  font-weight: 600;
}

.running-stop-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: background 120ms ease, opacity 120ms ease;
}

.running-stop-btn:hover {
  opacity: 1;
  background: var(--danger-soft);
}

.sessions-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.session-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

.link-button {
  font-size: 0.81rem;
  color: var(--accent);
  padding: 4px 6px;
  border-radius: 6px;
  font-weight: 500;
}

.link-button:hover {
  background: var(--accent-soft);
}

.cwd-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 0.84rem;
  color: var(--fg);
  transition: border-color 120ms ease;
}

.cwd-pill:hover {
  border-color: var(--border-strong);
}

.cwd-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.79rem;
}

.cwd-editor {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cwd-editor-buttons {
  display: flex;
  gap: 6px;
}

.session-search-wrap {
  margin-bottom: 6px;
}

.session-search-input {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 0.85rem;
}

.session-search-input:focus {
  border-color: var(--accent);
  outline: none;
}

.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.session-empty {
  font-size: 0.85rem;
  color: var(--fg-muted);
  padding: 10px 6px;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--radius-sm);
  transition: background 100ms ease;
}

.session-item {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  min-height: 44px;
  border: 1px solid transparent;
  transition: background 110ms ease, border-color 110ms ease;
}

.session-item:hover {
  background: var(--bg-muted);
}

.session-item[aria-current="true"] {
  background: var(--accent-soft);
  border-color: var(--border-strong);
}

.session-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.session-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.session-state-dot.is-busy {
  background: var(--warn);
  animation: pulse 1.15s ease-in-out infinite;
}

.session-state-dot.is-attention {
  background: var(--danger);
  animation: pulse 0.9s ease-in-out infinite;
}

.session-state-dot.is-unread {
  background: var(--ok);
}

.session-item-title {
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--fg);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item-meta {
  font-size: 0.75rem;
  color: var(--fg-muted);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-item-meta.is-attention {
  color: var(--warn);
  font-weight: 600;
}

.session-delete-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--fg-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  transition: opacity 110ms ease, color 110ms ease, background 110ms ease;
}

.session-row:hover .session-delete-btn,
.session-delete-btn:focus-visible {
  opacity: 0.95;
}

.session-delete-btn:hover {
  opacity: 1;
  color: var(--danger);
  background: var(--danger-soft);
}

.sidebar-footer {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-summary {
  font-size: 0.77rem;
  color: var(--fg-muted);
}

.footer-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ghost-button {
  min-height: 38px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: 0.81rem;
  font-weight: 500;
  transition: background 110ms ease, border-color 110ms ease;
}

.ghost-button:hover {
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

/* Main column */
.main-column {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

/* Drag-and-drop overlay */
.drop-overlay {
  position: absolute;
  inset: 12px;
  z-index: 45;
  background: rgba(15, 18, 28, 0.52);
  backdrop-filter: blur(3px);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 28px;
  background: var(--bg-elev);
  color: var(--fg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-weight: 600;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--topbar-h);
  padding: 6px 12px;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#menu-button {
  display: none;
}

.menu-running-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--warn);
  color: #11131a;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}

.menu-running-badge.is-attention {
  background: var(--danger);
  color: #ffffff;
}

.topbar-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.topbar-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.title-rename-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--fg-subtle);
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 110ms ease, background 110ms ease, color 110ms ease;
}

.topbar-title-group:hover .title-rename-btn,
.title-rename-btn:focus-visible {
  opacity: 1;
}

.title-rename-btn:hover {
  background: var(--bg-subtle);
  color: var(--fg);
}

.topbar-sub {
  font-size: 0.76rem;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.running-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 11px;
  background: var(--warn-soft);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--warn);
  white-space: nowrap;
}

.running-pill:hover {
  border-color: var(--warn);
}

.running-pill.is-attention {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

.icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--fg);
  flex-shrink: 0;
  transition: background 110ms ease;
}

.icon-button:hover {
  background: var(--bg-subtle);
}

.badge-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 11px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  transition: border-color 110ms ease;
}

.mode-pill:hover {
  border-color: var(--accent);
}

.model-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  max-width: 220px;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: border-color 110ms ease;
}

.model-pill:hover {
  border-color: var(--border-strong);
}

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

.model-dot[data-state="busy"] {
  background: var(--warn);
  animation: pulse 1.2s ease-in-out infinite;
}

.model-dot[data-state="reconnecting"] {
  background: var(--accent);
  animation: pulse 0.9s ease-in-out infinite;
}

.model-dot[data-state="error"] {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.88); }
}

.model-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Active Chats Tab Strip */
.chat-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-width: 0;
}

.chat-tabs-scroll {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1 1 auto;
  min-width: 0;
  scrollbar-width: none;
}

.chat-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.chat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  max-width: 210px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  flex-shrink: 0;
  transition: background 110ms ease, border-color 110ms ease, color 110ms ease;
}

.chat-tab:hover {
  border-color: var(--border-strong);
  color: var(--fg);
}

.chat-tab.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--fg);
  font-weight: 600;
}

.chat-tab.is-attention {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--fg);
}

.chat-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--fg-subtle);
  margin-right: -4px;
}

.chat-tab-close:hover {
  background: var(--bg-muted);
  color: var(--fg);
}

.chat-tab-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  flex-shrink: 0;
}

.chat-tab-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Background Attention Banner */
.bg-attention-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 14px;
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--fg);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.bg-attention-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 0.9s ease-in-out infinite;
  flex-shrink: 0;
}

.bg-attention-btn {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* Connection Banner */
.connection-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg);
  flex-shrink: 0;
}

.connection-banner.is-error {
  background: var(--danger-soft);
  border-bottom-color: var(--danger);
}

.jump-bottom-btn {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 20;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  font-size: 0.82rem;
  font-weight: 600;
  transition: transform 120ms ease, background 120ms ease;
}

.jump-bottom-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateX(-50%) translateY(-1px);
}

/* Transcript */
.transcript {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 18px;
  scroll-behavior: smooth;
}

.welcome, .messages {
  max-width: var(--content-max);
  margin: 0 auto;
}

.welcome-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  margin-top: 2vh;
}

.welcome-icon {
  border-radius: 14px;
  margin-bottom: 10px;
}

.welcome-heading {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.welcome-lead {
  margin: 0 auto 20px;
  max-width: 540px;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.quick-starters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  text-align: left;
}

.starter-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  min-height: 60px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease, transform 100ms ease;
}

.starter-chip:hover {
  background: var(--accent-soft);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.starter-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.starter-desc {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

/* Messages */
.messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: msgIn 140ms ease-out;
}

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

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

.msg-user .msg-bubble {
  background: var(--user-bubble);
  color: var(--user-bubble-fg);
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
  padding: 10px 15px;
  max-width: min(88%, 640px);
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
}

.msg-user-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.msg-user:hover .msg-user-actions,
.msg-user:focus-within .msg-user-actions {
  opacity: 0.9;
}

.msg-assistant .msg-bubble {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 18px;
  width: 100%;
  box-shadow: var(--shadow-sm);
  overflow-wrap: anywhere;
}

.msg-notice {
  align-self: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.84rem;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  max-width: 100%;
}

.msg-notice.is-error {
  background: var(--danger-soft);
  color: var(--fg);
  border-color: var(--danger);
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--fg-muted);
  padding: 0 4px;
}

.msg-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  opacity: 0.8;
}

.msg-actions:hover {
  opacity: 1;
}

.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--fg-muted);
  font-size: 0.76rem;
  font-weight: 500;
  transition: background 100ms ease, color 100ms ease;
}

.msg-action-btn:hover {
  background: var(--bg-muted);
  color: var(--fg);
}

.thinking-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
  max-width: 100%;
}

.thinking-status-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes dotBounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1.1); }
}

.thought-card.is-streaming > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
  flex-shrink: 0;
}

.tool-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.tool-item-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.tool-kind-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.tool-item-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--fg-muted);
  flex-shrink: 0;
}

.input-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.choice-chip {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--fg);
  font-size: 0.85rem;
  font-weight: 500;
}

.choice-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Thinking / Reasoning card */
.thought-card {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  margin: 0 0 10px;
  font-size: 0.85rem;
}

.thought-card > summary {
  cursor: pointer;
  padding: 8px 12px;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--fg-muted);
  user-select: none;
  list-style: none;
}

.thought-card > summary::-webkit-details-marker {
  display: none;
}

.thought-body {
  padding: 8px 12px 10px;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.84rem;
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
}

/* Markdown inside assistant bubbles */
.msg-content > :first-child { margin-top: 0; }
.msg-content > :last-child { margin-bottom: 0; }

.msg-content p { margin: 0.6em 0; }
.msg-content ul, .msg-content ol { margin: 0.6em 0; padding-left: 1.4em; }
.msg-content li { margin: 0.25em 0; }
.msg-content li.md-nested { margin-left: 1.2em; }
.msg-content .md-task {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.msg-content .md-inline-img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 4px 0;
}
.msg-content h1, .msg-content h2, .msg-content h3, .msg-content h4 {
  margin: 0.9em 0 0.4em;
  line-height: 1.3;
}
.msg-content h1 { font-size: 1.25rem; }
.msg-content h2 { font-size: 1.12rem; }
.msg-content h3 { font-size: 1.02rem; }

.msg-content code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--bg-subtle);
  padding: 2px 5px;
  border-radius: 5px;
}

.msg-content blockquote {
  margin: 0.7em 0;
  padding: 6px 12px;
  border-left: 3px solid var(--accent);
  color: var(--fg-muted);
  background: var(--bg-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.msg-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1em 0;
}

.code-block {
  margin: 0.75em 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--border);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.77rem;
  font-family: var(--font-mono);
}

.code-copy {
  padding: 4px 10px;
  min-height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--code-fg);
  font-size: 0.75rem;
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.22);
}

.code-block pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.5;
}

.code-block pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.table-wrap {
  overflow-x: auto;
  margin: 0.75em 0;
}

.msg-content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

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

.msg-content th {
  background: var(--bg-subtle);
  font-weight: 600;
}

/* Tool activity cards */
.tool-group {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  margin: 8px 0;
  font-size: 0.85rem;
}

.tool-group > summary {
  cursor: pointer;
  padding: 8px 12px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 500;
  color: var(--fg-muted);
  list-style: none;
  user-select: none;
}

.tool-group > summary::-webkit-details-marker {
  display: none;
}

.tool-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.tool-summary-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.tool-summary-toggle {
  flex-shrink: 0;
  font-size: 0.77rem;
  color: var(--fg-subtle);
}

.tool-badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}

.tool-badge.running {
  background: var(--warn);
  animation: pulse 1.1s infinite;
}

.tool-badge.error {
  background: var(--danger);
}

.tool-items {
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-item {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

.tool-item-title {
  font-weight: 600;
  font-size: 0.83rem;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.tool-item pre {
  margin: 5px 0 0;
  padding: 8px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  max-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Approval & input banners */
.approval-banner {
  max-width: var(--content-max);
  width: calc(100% - 24px);
  margin: 0 auto 8px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.approval-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.approval-detail {
  font-size: 0.83rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  word-break: break-word;
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
}

.approval-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.input-response-form {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  width: 100%;
}

/* Composer */
.composer-wrap {
  position: relative;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.attachment-strip {
  max-width: var(--content-max);
  margin: 0 auto 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.attachment-chip img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
}

.attachment-remove {
  color: var(--fg-muted);
  font-weight: 700;
  padding: 2px 5px;
}

.composer {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--bg-elev);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 6px 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.composer:focus-within {
  border-color: var(--accent);
}

.attach-button {
  width: 40px;
  height: 40px;
  color: var(--fg-muted);
}

.composer-input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  resize: none;
  min-height: 36px;
  max-height: 180px;
  padding: 6px 4px;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--fg);
}

.composer-input:focus {
  outline: none;
}

.composer-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.send-button, .stop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 110ms ease, opacity 110ms ease;
}

.send-button {
  background: var(--accent);
  color: var(--accent-fg);
}

.send-button:hover {
  background: var(--accent-hover);
}

.send-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stop-button {
  background: var(--danger);
  color: var(--danger-fg);
}

.composer-hint {
  max-width: var(--content-max);
  margin: 6px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--fg-muted);
  flex-wrap: wrap;
}

.composer-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-subtle);
}

/* Slash / @file command popover */
.slash-menu {
  position: absolute;
  bottom: calc(100% - 4px);
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 24px));
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 25;
}

.slash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
}

.slash-item:hover, .slash-item[aria-selected="true"] {
  background: var(--accent-soft);
}

.slash-cmd {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
}

.slash-desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inputs & buttons */
.text-input, .select-input {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--fg);
  font-size: 1rem;
}

.small-button {
  min-height: 40px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}

.small-button:hover {
  background: var(--bg-subtle);
}

.small-button.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.small-button.primary:hover {
  background: var(--accent-hover);
}

.small-button.danger {
  background: var(--danger);
  color: var(--danger-fg);
  border-color: var(--danger);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 18, 0.58);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal {
  width: min(540px, 100%);
  max-height: min(88vh, 720px);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 130ms ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal.modal-wide {
  width: min(760px, 100%);
  max-height: min(90vh, 780px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
}

.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  overflow-x: auto;
}

.modal-tab {
  padding: 9px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--fg-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.modal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.modal-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.settings-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.settings-help {
  margin: 0;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.auth-error {
  color: var(--danger);
  font-weight: 600;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.86rem;
  font-weight: 600;
}

.field-help {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--fg-muted);
}

.inline-field {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-field .text-input {
  flex: 1 1 180px;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.toggle-row span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-row small {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* Quota & Usage UI */
.quota-tier-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tier-badge, .credits-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}

.quota-buckets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quota-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.quota-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.quota-bar-track {
  height: 8px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}

.quota-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 260ms ease;
}

.quota-bar-fill.is-ok { background: var(--ok); }
.quota-bar-fill.is-warn { background: var(--warn); }
.quota-bar-fill.is-low { background: var(--danger); }

.quota-card-sub {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--fg-muted);
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.usage-stat-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.usage-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.usage-stat-lbl {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* Skills & Extensions */
.skills-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.skill-card-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.skill-card-desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 2px;
}

.skill-viewer {
  margin-top: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.skill-pre {
  margin: 8px 0 0;
  max-height: 260px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: pre-wrap;
}

.ext-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.84rem;
  font-family: var(--font-mono);
  white-space: pre-wrap;
}

/* Artifacts Modal Layout */
.artifacts-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 14px;
  min-height: 360px;
}

.artifacts-sidebar {
  border-right: 1px solid var(--border);
  padding-right: 10px;
}

.artifact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.artifacts-viewer {
  min-width: 0;
  overflow-y: auto;
  max-height: 60vh;
  padding: 4px;
}

/* Toast notifications — anchored below topbar so they never occlude the composer or mobile keyboard */
.toast-region {
  position: fixed;
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 10px);
  right: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  background: var(--fg);
  color: var(--bg);
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 100%;
  animation: toastIn 140ms ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.is-clickable {
  cursor: pointer;
}

.toast-action {
  font-weight: 700;
  text-decoration: underline;
  flex-shrink: 0;
}

.toast-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: -4px;
  border-radius: 50%;
  color: inherit;
  opacity: 0.72;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

.toast-dismiss:hover {
  opacity: 1;
  background: rgba(128, 128, 128, 0.25);
}

/* Responsive mobile / tablet drawer layout */
@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  #menu-button {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    transform: translateX(-104%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow-md);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-flex;
  }

  .drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 18, 0.5);
    z-index: 25;
  }

  .composer-hint {
    display: none;
  }

  .send-label {
    display: none;
  }

  .mode-pill {
    display: none;
  }

  .running-pill {
    display: none;
  }

  .title-rename-btn {
    display: none;
  }

  .model-pill {
    max-width: 140px;
    min-height: 44px;
    padding: 6px 10px;
  }

  .artifacts-layout {
    grid-template-columns: 1fr;
  }

  .artifacts-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 10px;
  }

  .toast-region {
    top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 8px);
    left: 12px;
    right: 12px;
    max-width: none;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}