:root {
  --bg-0: #0a0d12;
  --bg-1: #0f141b;
  --bg-2: #141a23;
  --bg-3: #1a212c;
  --bg-4: #232b38;
  --line: #232b38;
  --line-strong: #2d3848;
  --fg-0: #e6ebf2;
  --fg-1: #b6c0cf;
  --fg-2: #7d8898;
  --fg-3: #525c6b;
  --accent: #22d3ee;
  --accent-soft: rgba(34, 211, 238, .14);
  --accent-line: rgba(34, 211, 238, .35);
  --user-bubble: var(--accent-soft);
  --user-bubble-line: var(--accent-line);
  --user-bubble-meta: var(--accent);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --shadow-drawer: -8px 0 24px rgba(0, 0, 0, .45);
  --pane-header-h: 32px;
  --left-col: minmax(320px, 1fr);
  --center-col: minmax(560px, 1fr);
  --msg-font-size: 13px;
  --code-font-size: 12px;
  --bg: var(--bg-0);
  --panel: var(--bg-1);
  --panel-2: var(--bg-2);
  --text: var(--fg-0);
  --muted: var(--fg-2);
  --soft: var(--fg-1);
  --border: var(--line);
  --surface: var(--bg-1);
  color-scheme: dark;
  font-family: Pretendard, Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f6f7f9;
  --bg-1: #ffffff;
  --bg-2: #fafbfc;
  --bg-3: #f1f3f6;
  --bg-4: #e7eaee;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --fg-0: #0f172a;
  --fg-1: #334155;
  --fg-2: #64748b;
  --fg-3: #94a3b8;
  --accent: #0891b2;
  --accent-soft: rgba(8, 145, 178, .10);
  --accent-line: rgba(8, 145, 178, .30);
  --bg: var(--bg-0);
  --panel: var(--bg-1);
  --panel-2: var(--bg-2);
  --text: var(--fg-0);
  --muted: var(--fg-2);
  --soft: var(--fg-1);
  --border: var(--line);
  --surface: var(--bg-1);
}

html[data-accent="violet"] {
  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, .14);
  --accent-line: rgba(167, 139, 250, .35);
}
html[data-accent="emerald"] {
  --accent: #10b981;
  --accent-soft: rgba(16, 185, 129, .14);
  --accent-line: rgba(16, 185, 129, .35);
}
html[data-accent="slate"] {
  --accent: #64748b;
  --accent-soft: rgba(100, 116, 139, .14);
  --accent-line: rgba(100, 116, 139, .35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}

button:hover { border-color: var(--accent-line); background: var(--bg-3); color: var(--accent); }

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: 40px 1fr;
  position: relative;
  background: var(--bg-0);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  user-select: none;
}

.brand, .brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 30% 30%, var(--accent) 0%, transparent 60%),
    linear-gradient(135deg, #a78bfa 0%, var(--accent) 100%);
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 4px 10px rgba(34, 211, 238, .25);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 4px;
  background: var(--bg-1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: 2px;
  z-index: 1;
}

.brand-name { color: var(--fg-0); font-weight: 650; font-size: 13.5px; letter-spacing: 0; }

.top-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.compact-select {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 26px;
}

.compact-select span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.compact-select strong {
  height: 26px;
  min-width: 116px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1620;
  color: var(--fg-2);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.compact-select select {
  height: 26px;
  min-width: 148px;
  max-width: 210px;
  background: #0f1620;
  color: var(--fg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 10px;
}

.compact-select.session select { min-width: 130px; }

select,
select option {
  color: var(--fg-2);
  font-size: 10px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.top-actions button, .input-tools button {
  width: 28px;
  height: 26px;
  padding: 0;
  font-size: 13px;
}

.employee-pill {
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  font-size: 11px;
  white-space: nowrap;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--left-col) 4px var(--center-col);
  height: calc(100vh - 40px);
  gap: 0;
  background: var(--line);
  position: relative;
}

.chat-pane, .work-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
}

.col-resizer {
  background: var(--line);
  cursor: col-resize;
  position: relative;
  z-index: 4;
  transition: background .12s;
  user-select: none;
  touch-action: none;
}

.col-resizer:hover {
  background: var(--accent);
}

.col-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  right: -3px;
}

.pane-head {
  height: var(--pane-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}

.pane-head strong { font-size: 12px; }
.pane-head span { display: block; font-size: 10px; color: var(--muted); }
.ghost-btn { height: 24px; padding: 0 8px; font-size: 11px; background: transparent; }

.chat-feed {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-4) transparent;
  padding: 8px 14px;
}

.message {
  max-width: none;
}

.wv-messages-container,
.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-input {
  border-top: 1px solid var(--line);
  background: var(--bg-1);
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-tools {
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  margin: 0;
  background: transparent;
}

.input-tools span { flex: 1; }

.input-mode-label {
  flex: 0 0 auto !important;
  color: var(--fg-3);
  font-family: "Menlo", "Consolas", monospace;
  font-size: 10px;
  white-space: nowrap;
}

.input-mode-label.readonly {
  color: var(--warn);
}

.input-tools button:disabled,
.chat-input textarea:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.chat-input textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  max-height: calc((12px * 1.25) * 8 + 6px);
  margin: 0;
  resize: none;
  background: var(--bg-2);
  color: var(--fg-0);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: "Menlo", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.25;
  outline: none;
  overflow-y: hidden;
}

.chat-input textarea:disabled {
  background: var(--bg-1);
  color: var(--fg-2);
}

.surface-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.surface-mode {
  height: 24px;
  padding: 0 8px;
  color: var(--fg-2);
  font-size: 10px;
  background: #0f1620;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.surface-mode.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.surface-actions select {
  height: 24px;
  background: #0f1620;
  color: var(--fg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
  padding: 0 6px;
}

.surface {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #000;
  overflow: hidden;
  border-top: 1px solid var(--line-strong);
}

.surface iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.surface-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--fg-2);
  background: repeating-linear-gradient(45deg, #2d3748 0 8px, #364152 8px 16px);
  padding: 32px;
}

.surface-empty strong { color: var(--text); font-size: 14px; }
.surface-empty p { margin: 8px auto 0; max-width: 360px; font-size: 12px; line-height: 1.5; }

.bottom-row {
  flex: 0 0 200px;
  height: 200px;
  min-height: 100px;
  display: grid;
  grid-template-columns: 60% minmax(0, 1fr);
  gap: 12px;
  padding: 8px;
  background: var(--bg-0);
  border-top: 1px solid var(--line);
  overflow: visible;
  position: relative;
  z-index: 5;
}

.clipboard-card, .suggest-card {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.suggest-card {
  background: var(--bg-2);
  border-style: dashed;
}

.suggest-card.expanded {
  align-self: end;
  height: auto;
  min-height: 100%;
  max-height: min(560px, calc(100vh - 88px));
  position: relative;
  z-index: 7;
  box-shadow: 0 -10px 28px rgba(0, 0, 0, .24);
}

.suggest-expand {
  width: 22px;
  min-width: 22px;
  font-size: 10px !important;
  color: var(--fg-2);
}

.mini-head {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  flex-shrink: 0;
}

.mini-head strong { font-size: 12px; }
.mini-head span { margin-left: auto; color: var(--muted); font-size: 10px; }
.mini-head .clip-agent-chk {
  margin-left: 8px;
}
.mini-head button {
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  flex-shrink: 0;
}

.clip-agent-chk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--fg-2);
  cursor: pointer;
  user-select: none;
  font-size: 10px;
  white-space: nowrap;
}
.clip-agent-chk input[type="checkbox"] {
  width: 11px;
  height: 11px;
  accent-color: var(--accent);
}
.clip-agent-chk:hover { color: var(--accent); }

.clipboard-card textarea {
  flex: 1;
  min-height: 0;
  margin: 0;
  resize: none;
  background: var(--bg-2);
  color: var(--fg-0);
  border: 0;
  border-radius: 0;
  padding: 10px 14px;
  line-height: 1.45;
  outline: none;
  font-family: "Menlo", "Consolas", monospace;
  font-size: 12px;
}
.clipboard-card textarea.drag-over {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.button-row {
  height: 34px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.clip-status {
  margin-right: auto;
  color: var(--fg-3);
  font-family: "Menlo", "Consolas", monospace;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clip-status.ok { color: var(--ok); }
.clip-status.warn { color: var(--warn); }
.clip-status.err { color: var(--err); }

.button-row button { height: 26px; padding: 0 10px; font-size: 11px; }

html[data-density="tight"] .chat-feed { padding: 6px 10px; }
html[data-density="tight"] .wv-msg { padding: 6px 8px; line-height: 1.42; }
html[data-density="tight"] .pane-head,
html[data-density="tight"] .mini-head { height: 28px; }

html[data-vnc-full="1"] .workspace {
  grid-template-columns: 0 0 minmax(0, 1fr);
}
html[data-vnc-full="1"] .chat-pane,
html[data-vnc-full="1"] .col-resizer,
html[data-vnc-full="1"] .bottom-row {
  display: none;
}

.suggestions {
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(200px - 34px);
  overflow: auto;
  padding: 8px;
}

.suggest-card.expanded .suggestions {
  max-height: calc(min(560px, calc(100vh - 88px)) - 34px);
}

.suggestion {
  position: relative;
  padding: 8px;
  padding-right: 28px;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0e151e;
  font-size: var(--msg-font-size);
  line-height: 1.5;
  cursor: grab;
}
.suggestion:active { cursor: grabbing; }
.suggestion-dismiss {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 18px;
  height: 18px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--fg-3);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.suggestion-dismiss:hover {
  color: var(--fg-0);
  background: var(--bg-3);
}

.rail-drawer {
  position: fixed;
  top: 36px;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: min(96vw, 420px);
  background: var(--bg-1);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow-drawer);
  z-index: 40;
  transform: translateX(0);
  transition: transform .18s cubic-bezier(.3, .7, .4, 1), visibility .18s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rail-drawer[hidden] {
  display: flex !important;
  transform: translateX(calc(100% + 8px));
  pointer-events: none;
  visibility: hidden;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  flex-shrink: 0;
}

.drawer-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-0);
}

.drawer-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.drawer-close:hover {
  background: var(--bg-3);
  color: var(--fg-0);
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  color: var(--fg-1);
  font-size: 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  background: transparent;
  color: var(--fg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.tabs button:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

.tabs button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.file-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--fg-1);
  user-select: none;
}

.file-row:hover {
  background: var(--bg-2);
  color: var(--accent);
}

.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.file-size { color: var(--fg-3); font-size: 10px; }
.notice {
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.55;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px dashed var(--line);
  border-radius: 6px;
}
.error { color: var(--err); }

.drawer-section {
  margin-bottom: 16px;
  padding: 0;
}

.drawer-section:last-child { margin-bottom: 0; }

.drawer-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 8px;
  padding: 0;
}

.drawer-status-row,
.drawer-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  gap: 12px;
  min-width: 0;
}

.drawer-status-row:last-child,
.drawer-live-row:last-child { border-bottom: none; }

.drawer-status-key,
.drawer-live-key {
  color: var(--fg-2);
  font-size: 11px;
  flex-shrink: 0;
}

.drawer-status-val,
.drawer-live-val {
  color: var(--fg-0);
  font-family: "Menlo", "Consolas", monospace;
  font-size: 11px;
  text-align: right;
  word-break: break-all;
  min-width: 0;
}

.drawer-search-input {
  width: 100%;
  height: 28px;
  padding: 0 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  outline: none;
  color: var(--fg-0);
  font-family: inherit;
  font-size: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.drawer-search-input:focus { border-color: var(--accent); }

.drawer-search-meta,
.drawer-search-empty {
  color: var(--fg-3);
  font-size: 11px;
  font-family: "Menlo", "Consolas", monospace;
}

.twk-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2147483646;
  width: 280px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  color: var(--fg-0);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  font: 12px/1.4 inherit;
  overflow: hidden;
}
.twk-panel.hidden { display: none; }
.twk-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 10px 14px;
  user-select: none;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.twk-hd b { font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.twk-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.twk-x:hover { background: var(--bg-3); color: var(--fg-0); }
.twk-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}
.twk-sect {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 6px 0 0;
}
.twk-sect:first-child { padding-top: 0; }
.twk-row { display: flex; flex-direction: column; gap: 6px; }
.twk-row-h {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.twk-lbl {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: var(--fg-1);
}
.twk-lbl > span:first-child { font-weight: 500; }
.twk-val {
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
  font-family: "Menlo", "Consolas", monospace;
}
.twk-seg {
  position: relative;
  display: flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--bg-2);
  user-select: none;
  border: 1px solid var(--line);
}
.twk-seg button {
  appearance: none;
  position: relative;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  font-weight: 500;
  min-height: 24px;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1.2;
}
.twk-seg button.active {
  background: var(--bg-4);
  color: var(--fg-0);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04);
}
.twk-seg button:hover:not(.active) { color: var(--fg-1); }
.twk-toggle {
  position: relative;
  width: 32px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-4);
  transition: background .15s;
  cursor: pointer;
  padding: 0;
}
.twk-toggle[data-on="1"] { background: var(--ok); }
.twk-toggle i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.twk-toggle[data-on="1"] i { transform: translateX(14px); }
.twk-range {
  width: 100%;
  accent-color: var(--accent);
}
.twk-trigger {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2147483645;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--fg-1);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-drawer);
}
.twk-trigger:hover { background: var(--bg-3); color: var(--fg-0); }

.login {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.login-box {
  width: min(360px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-title { margin: 18px 0 6px; font-size: 18px; font-weight: 700; }
.login-sub { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.login-form { display: flex; gap: 8px; }
.login-form input {
  flex: 1;
  min-width: 0;
  height: 34px;
  background: #0c121b;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
}
.login-form button { height: 34px; padding: 0 12px; }
.login-error { min-height: 18px; margin: 10px 0 0; color: var(--err); font-size: 12px; }

@media (max-width: 860px) {
  body { overflow: auto; }
  .app { min-height: 100%; height: auto; grid-template-rows: auto 1fr; }
  .topbar { height: auto; min-height: 36px; flex-wrap: wrap; }
  .brand { min-width: auto; }
  .compact-select select { min-width: 112px; max-width: 148px; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(420px, 58vh) minmax(500px, 1fr); }
  .col-resizer { display: none; }
  .bottom-row { grid-template-columns: 1fr; flex-basis: 300px; }
  .rail-drawer { top: 0; width: 100vw; max-width: 100vw; }
}
