/* DaVinci Resolve GUI -- SubEtha-style dark theme */

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

:root {
  --bg:       #1a1a1e;
  --bg2:      #22222a;
  --bg3:      #2a2a34;
  --border:   #333344;
  --accent:   #5b8def;
  --accent2:  #3f6dcc;
  --text:     #d4d4e0;
  --text2:    #8888a0;
  --green:    #3dab5a;
  --red:      #c0392b;
  --orange:   #e67e22;
  --topbar-h: 40px;
  --col-w:    240px;
  --chat-w:   1fr;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ─────────────────────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.logo { font-weight: 700; color: var(--accent); font-size: 14px; letter-spacing: 0.5px; }
.project-label { color: var(--text2); font-size: 12px; }

/* version topbar pill */
.version-topbar-pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: monospace;
  font-size: 11px;
  color: var(--text2);
  padding: 3px 9px;
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.version-topbar-pill:hover { background: var(--bg2); border-color: var(--accent); }
.version-topbar-pill.vtpill-ok  { color: #5ecf7e; border-color: #2d7a45; }
.version-topbar-pill.vtpill-warn { color: #f0a040; border-color: #a05000; }

/* version popover -- SubEtha profile-card style, position set by JS */
.version-popover {
  position: fixed;
  z-index: 200;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 300px;
  max-width: 340px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

/* profile header row */
.vp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
}
.vp-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.vp-identity { flex: 1; min-width: 0; }
.vp-name { font-weight: 600; font-size: 13px; color: var(--text); }
.vp-version-line { font-family: monospace; font-size: 11px; margin-top: 2px; }
.vp-close {
  background: none; border: none; cursor: pointer;
  color: var(--text2); font-size: 14px; padding: 2px 4px;
  border-radius: 4px; flex-shrink: 0;
}
.vp-close:hover { background: var(--bg3); color: var(--text); }

.vp-updated { padding: 0 16px 10px; font-size: 11px; color: var(--text2); }
.vp-ok   { color: #5ecf7e; }
.vp-warn { color: #f0a040; }
.vp-divider { border-top: 1px solid var(--border); }

/* settings sections inside popover */
.vp-section { padding: 10px 16px; display: flex; flex-direction: column; gap: 7px; }
.vp-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text2); margin-bottom: 2px; }
.vp-row { display: flex; align-items: center; gap: 8px; }
.vp-row-right { justify-content: flex-end; }
.vp-label { font-size: 11px; color: var(--text2); min-width: 72px; flex-shrink: 0; }
.vp-select {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: 5px; padding: 3px 6px; font-size: 12px;
}
.vp-input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: 5px; padding: 3px 6px; font-size: 12px;
}
.theme-picker-sm { gap: 5px; }
.theme-picker-sm .theme-swatch { width: 20px; height: 20px; }
.theme-picker-sm .theme-opt span { display: none; }

.vp-action {
  display: block; width: 100%;
  padding: 10px 16px;
  text-align: left;
  background: none; border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 13px;
}
.vp-action:last-child { border-bottom: none; }
.vp-action:hover { background: var(--bg3); }
.vp-action-warn { color: #f0a040; }

/* light-theme overrides */
body.theme-sn .version-topbar-pill.vtpill-ok  { color: #1e6b2e; }
body.theme-sn .version-topbar-pill.vtpill-warn { color: #7a5500; }
body.theme-sn .version-popover { background: #fff; border-color: #cdd1da; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
body.theme-sn .vp-avatar { background: #1a7f8e; }
body.theme-sn .vp-ok   { color: #1e6b2e; }
body.theme-sn .vp-warn { color: #7a5500; }
body.theme-sn .vp-action:hover { background: #f2f4f7; }

/* ── Grid ───────────────────────────────────────────────────────────────── */
#grid {
  display: grid;
  grid-template-columns: var(--col-w) var(--col-w) var(--chat-w) var(--col-w) var(--col-w);
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

.col {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
.col:last-child { border-right: none; }

.col-header {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn, .btn-sm, .btn-icon, .btn-send {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn { padding: 6px 12px; width: 100%; margin-bottom: 4px; font-size: 12px; }
.btn-sm { padding: 4px 8px; font-size: 11px; }
.btn-icon { padding: 3px 7px; font-size: 13px; background: transparent; border: none; }
.btn-send {
  background: var(--accent);
  border-color: var(--accent2);
  color: #fff;
  padding: 8px 14px;
  font-size: 16px;
  border-radius: 6px;
}
.btn:hover, .btn-sm:hover { background: var(--border); }
.btn-send:hover { background: var(--accent2); }
.btn-icon:hover { color: var(--accent); }
.btn-sec { background: transparent; border-color: var(--border); }
.btn-green { background: var(--green); border-color: #2e8044; color: #fff; }
.btn-red { background: var(--red); border-color: #922b21; color: #fff; }
.btn-green:hover { background: #2e8044; }
.btn-red:hover { background: #922b21; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-row { display: flex; gap: 4px; }
.page-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.render-row { display: flex; gap: 6px; }
.render-row .btn { width: auto; flex: 1; }
.mt4 { margin-top: 6px; }

/* ── Inputs / selects ──────────────────────────────────────────────────── */
.field-label { display: block; font-size: 11px; color: var(--text2); margin-bottom: 3px; }
.field-input, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 4px 7px;
  font-size: 12px;
}
.field-input:focus, select:focus { outline: 1px solid var(--accent); }

/* small selects in topbar / col-header */
#lang-select, #ai-provider, #ai-model {
  width: auto;
  padding: 2px 5px;
  font-size: 11px;
}

/* ── Badges / dots ─────────────────────────────────────────────────────── */
.badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.badge-off  { background: #3a2222; color: var(--red); }
.badge-on   { background: #1e3a26; color: var(--green); }
.badge-busy { background: #3a2e0a; color: var(--orange); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.dot-off  { background: var(--red); }
.dot-on   { background: var(--green); }
.dot-busy { background: var(--orange); }

.status-row { display: flex; align-items: center; margin-bottom: 7px; font-size: 12px; }

/* ── Progress bar ──────────────────────────────────────────────────────── */
.progress-bar { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); transition: width 0.3s; }

/* ── Info text ─────────────────────────────────────────────────────────── */
.info-text { font-size: 11px; color: var(--text2); line-height: 1.5; }
.path-label { font-size: 11px; color: var(--text2); word-break: break-all; }

/* ── Drives list ───────────────────────────────────────────────────────── */
.drives-list { display: flex; flex-wrap: wrap; gap: 4px; }
.drive-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.1s;
}
.drive-chip:hover, .drive-chip.active { background: var(--accent); color: #fff; border-color: var(--accent2); }

/* ── File list ─────────────────────────────────────────────────────────── */
.file-browser-card { flex: 1; display: flex; flex-direction: column; }
.file-actions { display: flex; gap: 4px; margin-bottom: 6px; }
.file-actions .btn-sm { flex: 1; }
.file-list { flex: 1; overflow-y: auto; max-height: 320px; }
.file-entry {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  gap: 6px;
  user-select: none;
}
.file-entry:hover  { background: var(--bg3); }
.file-entry.selected { background: #2a3050; }
.file-icon { flex-shrink: 0; width: 16px; text-align: center; }
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--text2); font-size: 10px; }
.file-dir { color: var(--accent); }

/* ── Marker list ──────────────────────────────────────────────────────── */
.marker-list { max-height: 160px; overflow-y: auto; }
.marker-entry {
  font-size: 11px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
}
.marker-tc { color: var(--accent); font-family: monospace; }
.marker-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Recent list ──────────────────────────────────────────────────────── */
.recent-list { max-height: 120px; overflow-y: auto; }
.recent-entry {
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
}
.recent-entry:hover { color: var(--text); }

/* ── Git log ───────────────────────────────────────────────────────────── */
.git-log { max-height: 140px; overflow-y: auto; font-size: 11px; }
.git-entry { display: flex; gap: 6px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.git-hash { color: var(--accent); font-family: monospace; flex-shrink: 0; }
.git-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }

/* ── Chat zone ─────────────────────────────────────────────────────────── */
#chat-zone {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-controls { display: flex; align-items: center; gap: 6px; }
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg { max-width: 85%; padding: 8px 11px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.msg-user { align-self: flex-end; background: var(--accent2); color: #fff; }
.msg-ai   { align-self: flex-start; background: var(--bg3); border: 1px solid var(--border); }
.msg-error { align-self: flex-start; background: #3a1a1a; border: 1px solid var(--red); color: #e8a0a0; }
.msg-sys   { align-self: center; font-size: 11px; color: var(--text2); font-style: italic; }
.msg-label { font-size: 10px; color: var(--text2); margin-bottom: 3px; }
.msg-ai .msg-content code { background: var(--bg); padding: 1px 4px; border-radius: 3px; font-size: 11px; }
.msg-ai .msg-content pre { background: var(--bg); padding: 8px; border-radius: 4px; overflow-x: auto; font-size: 11px; margin: 6px 0; }

#chat-input-row {
  border-top: 1px solid var(--border);
  padding: 8px;
  display: flex;
  gap: 6px;
  background: var(--bg2);
}
#chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
}
#chat-input:focus { outline: 1px solid var(--accent); }
.btn-send { align-self: flex-end; }
.thinking { display: flex; gap: 4px; align-items: center; padding: 6px 11px; }
.thinking span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text2); animation: bounce 1.2s infinite;
}
.thinking span:nth-child(2) { animation-delay: 0.2s; }
.thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* ── SubEtha-style git log ───────────────────────────────────────────────── */
.git-log-se { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.git-se-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.git-se-pills { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.git-se-msg   { color: var(--text2); line-height: 1.4; }

/* SubEtha-style pills */
.se-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.se-pill-hash   { background: #2a3050; color: #8ab4f8; font-family: monospace; }
.se-pill-muted  { background: var(--bg3); border: 1px solid var(--border); color: var(--text2); }
.se-pill-accent { background: var(--accent); color: #fff; }
.se-pill-ok     { background: #1a4a2a; border: 1px solid #2d7a45; color: #5ecf7e; }
.se-pill-warn   { background: #4a2a00; border: 1px solid #a05000; color: #f0a040; }
.se-pill-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.mb4 { margin-bottom: 4px; }

/* version card: col-a full card, scrollable log, compact B panel */
.version-card { flex-shrink: 0; }
.version-compact-card { flex-shrink: 0; }
.version-compact-card .info-text { font-size: 11px; color: var(--text2); margin-top: 3px; }

/* SubEtha-style version pill: "20260728-291c.221 ✓ up to date" */
.version-ver-pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
body.theme-sn .version-ver-pill { background: #eef1f6; border-color: #cdd1da; }

/* light theme overrides for pills */
body.theme-sn .se-pill-hash { background: #d8e6fb; color: #1a5ca8; }
body.theme-sn .se-pill-ok   { background: #d4edda; border-color: #5cb85c; color: #1e6b2e; }
body.theme-sn .se-pill-warn { background: #fff3cd; border-color: #d4a017; color: #7a5500; }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.15s;
}
.btn-pill:hover { opacity: 0.85; }
.btn-pill-accent { background: var(--accent); color: #fff; }
.git-commit-row { display: flex; flex-direction: column; gap: 4px; }

/* ── Settings modal ──────────────────────────────────────────────────────── */
.settings-box { width: 400px; }
.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  gap: 2px;
}
.stab {
  padding: 7px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.stab:hover  { color: var(--text); }
.stab.active { color: var(--accent); border-bottom-color: var(--accent); }
.stab-panel  { padding: 14px; }
.stab-panel.hidden { display: none; }

/* ── Theme picker ────────────────────────────────────────────────────────── */
.theme-picker { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.theme-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text2);
}
.theme-opt.active { color: var(--accent); }
.theme-swatch {
  width: 48px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid var(--border);
  transition: border-color 0.15s;
}
.theme-opt.active .theme-swatch { border-color: var(--accent); }
.dark-swatch    { background: linear-gradient(135deg, #1a1a1e 50%, #22222a 50%); }
.darker-swatch  { background: linear-gradient(135deg, #111115 50%, #18181e 50%); }
.resolve-swatch { background: linear-gradient(135deg, #1a1a1e 50%, #e5a00d 50%); }
.sn-swatch      { background: linear-gradient(135deg, #1e3a48 40%, #f2f4f7 40%); }

/* ── Dialog ─────────────────────────────────────────────────────────────── */
.dialog {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.dialog.hidden { display: none; }
.dialog-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; width: 380px; }
.dialog-title { padding: 12px 14px; font-weight: 600; border-bottom: 1px solid var(--border); }
.dialog-body  { padding: 14px; }
.dialog-footer { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.dialog-footer .btn { width: auto; margin: 0; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 18px; right: 18px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  z-index: 200;
  transition: opacity 0.3s;
}
.toast.hidden { display: none; }

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

/* ── Themes ─────────────────────────────────────────────────────────────── */
body.theme-darker { --bg: #111115; --bg2: #18181e; --bg3: #22222a; }
body.theme-resolve { --accent: #e5a00d; --accent2: #c48a0a; }

/* ServiceNow light -- matches SubEtha's light palette */
body.theme-sn {
  --bg:     #f2f4f7;
  --bg2:    #e8eaee;
  --bg3:    #ffffff;
  --border: #cdd1da;
  --accent: #1a7f8e;
  --accent2:#136e7c;
  --text:   #1a1d27;
  --text2:  #5c6375;
  --green:  #1a8060;
  --red:    #c0392b;
  --orange: #d4860a;
}
/* topbar keeps the dark nav look (like SubEtha) */
body.theme-sn #topbar {
  background: #1e3a48;
  border-bottom-color: #162e3a;
  color: #e8eef2;
}
body.theme-sn .logo          { color: #7ed8e8; }
body.theme-sn #bridge-badge.badge-off  { background: #3a1212; color: #f08080; }
body.theme-sn #bridge-badge.badge-on   { background: #0a2e20; color: #50d0a0; }
body.theme-sn #lang-select,
body.theme-sn #topbar select { background: #162e3a; color: #d0e0e8; border-color: #2a4a58; }
body.theme-sn .project-label { color: #a0c8d8; }
body.theme-sn .btn-icon      { color: #c0d8e4; }
body.theme-sn .btn-icon:hover{ color: #7ed8e8; }

/* col-headers: medium gray strip */
body.theme-sn .col-header {
  background: #dde1e8;
  color: #3a4455;
  border-bottom-color: #c4c9d4;
}
body.theme-sn .col-header .col-toggle { color: #7a8090; }

/* cards: white with light border */
body.theme-sn .card { background: #ffffff; border-bottom-color: #e0e4ea; }
body.theme-sn .card-title { color: #4a5268; }

/* inputs */
body.theme-sn .field-input,
body.theme-sn select {
  background: #ffffff;
  border-color: #c4c9d4;
  color: #1a1d27;
}
body.theme-sn .field-input:focus,
body.theme-sn select:focus { outline-color: #1a7f8e; }

/* buttons */
body.theme-sn .btn,
body.theme-sn .btn-sm {
  background: #edf0f4;
  border-color: #c4c9d4;
  color: #1a1d27;
}
body.theme-sn .btn:hover,
body.theme-sn .btn-sm:hover { background: #dde1e8; }
body.theme-sn .btn-sec { background: transparent; }

/* chat */
body.theme-sn #chat-zone { background: #f2f4f7; }
body.theme-sn #chat-input-row { background: #edf0f4; border-top-color: #cdd1da; }
body.theme-sn #chat-input {
  background: #ffffff;
  border-color: #c4c9d4;
  color: #1a1d27;
}
body.theme-sn .msg-ai {
  background: #ffffff;
  border-color: #d4d8e2;
  color: #1a1d27;
}
body.theme-sn .msg-user { background: #1a7f8e; color: #fff; }

/* file list */
body.theme-sn .file-entry:hover  { background: #e8ecf2; }
body.theme-sn .file-entry.selected { background: #d0e4ea; }
body.theme-sn .drive-chip {
  background: #edf0f4;
  border-color: #c4c9d4;
  color: #1a1d27;
}
body.theme-sn .drive-chip:hover,
body.theme-sn .drive-chip.active { background: #1a7f8e; color: #fff; border-color: #136e7c; }

/* git / misc */
body.theme-sn .git-hash { color: #1a7f8e; }
body.theme-sn .recent-entry { color: #1a7f8e; }
body.theme-sn .toast { background: #ffffff; border-color: #cdd1da; color: #1a1d27; }
body.theme-sn ::-webkit-scrollbar-thumb { background: #c4c9d4; }

/* ── Column collapse ─────────────────────────────────────────────────────── */
.col-toggle {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
  color: var(--text2);
  border: none;
  background: transparent;
  flex-shrink: 0;
  transition: color 0.15s;
}
.col-toggle:hover { color: var(--accent); }

.col.collapsed {
  min-width: 32px;
  max-width: 32px;
  width: 32px;
  overflow: hidden;
}
.col.collapsed .col-header {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 10px 6px;
  gap: 0;
  justify-content: flex-start;
  cursor: pointer;
}
.col.collapsed .col-header .col-label { display: none; }
.col.collapsed .col-header .col-toggle { display: none; }
.col.collapsed .card { display: none; }
.col.collapsed .col-header::after {
  content: attr(data-label);
  writing-mode: vertical-rl;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text2);
}

#grid {
  transition: grid-template-columns 0.2s ease;
}

/* chat zone must not collapse */
#chat-zone .col-toggle { display: none; }
