/* Shared chrome theme.
   Top bars, common icon/buttons, and select triggers read the same semantic
   colors as input/message components. Status visuals live in status-theme.css. */

:root {
  --wv-chrome-bg: var(--bg-1);
  --wv-chrome-hover-bg: var(--bg-2);
  --wv-chrome-active-bg: var(--bg-3);
  --wv-chrome-line: var(--line);
  --wv-chrome-line-strong: var(--line-strong);
  --wv-chrome-fg: var(--fg-0);
  --wv-chrome-muted: var(--fg-2);
}

.topbar,
.pane-head {
  background: var(--wv-chrome-bg);
  border-color: var(--wv-chrome-line);
}

.tb-divider {
  background: var(--wv-chrome-line-strong);
}

.tb-select,
.compact-select select,
.select,
.wv-input-select,
.cb-target {
  color: var(--wv-chrome-fg);
}

.tb-select:hover,
.tb-select[aria-expanded="true"],
.tb-iconbtn:hover,
.surface-mode:hover,
.ghost-btn:hover,
.btn:hover:not(:disabled),
button:hover:not(:disabled) {
  background: var(--wv-chrome-hover-bg);
  border-color: var(--wv-chrome-line-strong);
  color: var(--accent);
}

.tb-select .lab-glyph,
.tb-select .caret,
.field-label,
.input-mode-label,
.wv-input-meta,
.wv-meta-row,
.msg-time {
  color: var(--wv-chrome-muted);
}

.tb-select .val {
  color: var(--wv-chrome-fg);
}

.tb-iconbtn,
.tb-iconbtn.primary,
.power-btn.power-connected {
  border-color: color-mix(in oklab, var(--st-c, var(--accent)) 34%, transparent);
}

.tb-iconbtn.primary,
.btn-primary,
.send-btn,
.power-btn.power-connected {
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 18%, var(--wv-chrome-hover-bg)) 0%, var(--wv-chrome-hover-bg) 100%);
  color: var(--accent-2, var(--accent));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 12%, transparent);
}

.tb-iconbtn.primary:hover,
.btn-primary:hover:not(:disabled),
.send-btn:hover:not(:disabled) {
  background: color-mix(in oklab, var(--accent) 24%, var(--wv-chrome-hover-bg));
  color: var(--fg-0);
}

.top-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.top-actions button svg,
.rail-icon svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.rail-icon svg {
  width: 16px;
  height: 16px;
}

/* Shared tweaks theme. Keep per-surface controls in each page, but make the
   drawer geometry, typography, and row rhythm identical across the four UIs. */
.twk-panel {
  width: min(318px, calc(100vw - 20px));
  max-height: min(520px, calc(100dvh - 24px));
  border-radius: 10px;
  font: 11.5px/1.28 var(--font-sans, inherit);
}

.twk-hd {
  min-height: 30px;
  padding: 6px 8px 6px 10px;
}

.twk-hd b {
  font-size: 11.5px;
  letter-spacing: 0;
}

.twk-x {
  width: 22px;
  height: 22px;
}

.twk-body {
  gap: 7px;
  padding: 8px 10px 10px;
  max-height: calc(min(520px, 100dvh - 24px) - 31px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.twk-sect {
  padding: 4px 0 0;
  font-size: 9.5px;
  line-height: 1.15;
  letter-spacing: 0.055em;
}

.twk-row {
  gap: 4px;
}

.twk-row-h {
  gap: 8px;
  min-height: 24px;
}

.twk-lbl {
  gap: 8px;
  min-height: 16px;
  font-size: 11.5px;
  line-height: 1.25;
}

.twk-val {
  font-size: 10.5px;
}

.twk-seg {
  border-radius: 7px;
  padding: 2px;
}

.twk-seg button {
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 5px;
  line-height: 1.15;
  font-size: 11px;
}

.twk-range {
  width: 100%;
  height: 18px;
  accent-color: var(--accent);
}

.twk-select,
.twk-field {
  min-height: 24px;
  height: 24px;
  font-size: 11.5px;
  border-radius: 6px;
  padding: 2px 8px;
}

.twk-toggle {
  width: 31px;
  height: 18px;
}

.twk-toggle i {
  width: 14px;
  height: 14px;
}

.twk-toggle[data-on="1"] i {
  transform: translateX(13px);
}

.twk-trigger {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}
