:root {
  color-scheme: dark;
  --glass-rgb: 48, 52, 56;
  /* Surface overlays + borders are "light on dark" by default. A light theme
     (or any light --glass-rgb) flips these to dark via JS so panels/borders stay
     visible on a pale background — see themeCssVarEntries(). */
  --overlay-rgb: 255, 255, 255;
  --line-rgb: 232, 238, 244;
  /* Recessed surfaces: the settings panel/tooltip card (--panel-rgb) and sunken
     tracks/inputs (--sunken-rgb). Both flip light on a light theme. */
  --panel-rgb: 16, 21, 30;
  --sunken-rgb: 4, 8, 13;
  --glass-alpha: 0.68;
  --line-alpha: 0.138;
  --line-strong-alpha: 0.238;
  --control-alpha: 0.049;
  --highlight-alpha: 0.07;
  --glass: rgba(var(--glass-rgb), var(--glass-alpha));
  --glass-strong: rgba(31, 35, 41, 0.56);
  --glass-soft: rgba(var(--overlay-rgb), 0.05);
  --line: rgba(var(--line-rgb), var(--line-alpha));
  --line-strong: rgba(var(--line-rgb), var(--line-strong-alpha));
  --text: #eef5fb;
  --muted: #a3adbb;
  --green: #b7ead4;
  /* RGB triplet of the accent (--green), for the accent-tinted borders / glows /
     active states. Driven from the chosen accent so they flip together — see
     themeCssVarEntries(). Must match --green above. */
  --accent-rgb: 183, 234, 212;
  --number: #f3fbf7;
  --blue: #73bdf5;
  --orange: #f4a073;
  --purple: #b394f4;
  --yellow: #f1d973;
  --red: #f47788;
  --shadow: rgba(0, 0, 0, 0.36);
}
* { box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: transparent;
  border-radius: 14px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  user-select: none;
  -webkit-user-select: none;
}
button, input, select { font: inherit; }
button:focus, button:focus-visible { outline: none; }
input, textarea, [contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}
.shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 12px 14px 14px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  clip-path: inset(0 round 14px);
  background:
    linear-gradient(180deg, rgba(var(--overlay-rgb), var(--highlight-alpha)), rgba(var(--overlay-rgb), 0.022)),
    linear-gradient(135deg, rgba(var(--overlay-rgb), 0.035), rgba(0, 0, 0, 0.09)),
    var(--glass);
  box-shadow: 0 22px 55px var(--shadow), inset 0 1px 0 rgba(var(--overlay-rgb), 0.13);
  -webkit-backdrop-filter: blur(32px) saturate(115%);
  backdrop-filter: blur(32px) saturate(115%);
}
html.is-windows, html.is-windows body {
  border-radius: 8px;
}
html.is-windows .shell {
  border-radius: 8px;
  /* No clip-path on Windows: Chromium renders clip-path with a hard, non-AA
     edge on a transparent window, which made the bottom corners look truncated.
     border-radius + overflow:hidden round the corners (and clip the backdrop
     blur) with proper anti-aliasing instead. */
  clip-path: none;
}

html.is-mac-legacy, html.is-mac-legacy body {
  border-radius: 10px;
}
html.is-mac-legacy .shell {
  border-radius: 10px;
  clip-path: inset(0 round 10px);
}
.shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(var(--overlay-rgb), 0.08), transparent 36%);
}
.floating-bubble-tab {
  -webkit-app-region: no-drag;
  -webkit-appearance: none;
  appearance: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: grab;
  box-shadow: none;
  outline: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.floating-bubble-tab span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  padding: 0 2px;
}
.floating-bubble-tab span.bars { padding: 0; }
.floating-bubble-tab span.bars img {
  display: block;
  width: auto;
  height: 24px;
}
.floating-bubble-tab.dragging { cursor: grabbing; }
html.floating-bubble-collapsed-left,
body.floating-bubble-collapsed-left,
html.floating-bubble-collapsed-right,
body.floating-bubble-collapsed-right {
  background:
    linear-gradient(180deg, rgba(var(--overlay-rgb), var(--highlight-alpha)), rgba(var(--overlay-rgb), 0.022)),
    linear-gradient(135deg, rgba(var(--overlay-rgb), 0.035), rgba(0, 0, 0, 0.09)),
    var(--glass),
    rgb(var(--glass-rgb));
}
html.floating-bubble-collapsed-left,
body.floating-bubble-collapsed-left {
  border-radius: 0;
}
html.floating-bubble-collapsed-right,
body.floating-bubble-collapsed-right {
  border-radius: 0;
}
html.floating-bubble-collapsed-left body .shell,
html.floating-bubble-collapsed-right body .shell,
body.floating-bubble-collapsed-left .shell,
body.floating-bubble-collapsed-right .shell {
  opacity: 0;
  pointer-events: none;
}
html.floating-bubble-collapsed-left body .floating-bubble-tab,
body.floating-bubble-collapsed-left .floating-bubble-tab {
  display: flex;
  border-radius: 0;
}
html.floating-bubble-collapsed-right body .floating-bubble-tab,
body.floating-bubble-collapsed-right .floating-bubble-tab {
  display: flex;
  border-radius: 0;
}
.floating-bubble-tab:hover {
  color: var(--text);
}
.titlebar {
  -webkit-app-region: drag;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
}
.shell.desktop-mode .titlebar { -webkit-app-region: no-drag; }
.titlebar > div:first-child { min-width: 0; flex: 1 1 auto; }
.app-title {
  display: flex;
  align-items: baseline;
  min-width: 0;
  font-size: clamp(13px, 4.5vw, 16px);
  font-weight: 700;
  line-height: 1.12;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}
.app-title-text {
  min-width: 0;
  flex: 0 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-title-mark {
  display: none;
  font-weight: 700;
  line-height: 1;
}
/* Offscreen probe: rendered with the same font/size as the title, used by JS */
/* to detect "would Token Monitor still fit?". Independent of the live text */
/* element so toggling its visibility never disturbs the measurement. */
.app-title-measure {
  position: absolute;
  top: 0;
  left: -9999px;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
}
/* Swap text → Σ at the exact width where the title would start to truncate, */
/* driven by JS overflow detection (see renderer/app.js). */
.shell.title-collapsed .app-title-text, .shell.title-icon-only .app-title-text { display: none; }
.shell.title-collapsed .app-title-mark, .shell.title-icon-only .app-title-mark { display: inline; }
.live-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-left: 5px;
  vertical-align: baseline;
  border-radius: 50%;
  background: #5b6471;
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0);
  transition: background 200ms ease, box-shadow 200ms ease;
}
.live-dot.live {
  background: var(--green);
  box-shadow: 0 0 4px rgba(var(--accent-rgb), 0.55);
}
/* One-shot flare on data update — flares, then settles back to the resting
   .live glow. No `infinite`, so the GPU compositor can idle between updates. */
.live-dot.pulse {
  animation: live-pulse 1.2s ease-out;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 3px rgba(var(--accent-rgb), 0.45); }
  35%  { box-shadow: 0 0 9px rgba(var(--accent-rgb), 0.95); }
  100% { box-shadow: 0 0 4px rgba(var(--accent-rgb), 0.55); }
}
.status { display: none; margin-top: 4px; color: var(--muted); font-size: 11px; }
.status.error { display: block; }
.title-controls {
  -webkit-app-region: no-drag;
  position: relative;
  flex: 0 1 148px;
  min-width: 100px;
  width: 148px;
  height: 30px;
}
.actions-hotspot {
  position: absolute;
  top: -14px;
  right: -12px;
  width: 28px;
  height: 22px;
  z-index: 5;
}
.window-actions {
  position: absolute;
  top: 0;
  right: 0;
  width: 154px;
  height: 30px;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 160ms ease 280ms, transform 160ms ease 280ms;
  z-index: 4;
}
#titlebarActionSlot { display: contents; }
#footerActionSlot { display: contents; }
/* Size the swappable action button by its slot, not by its element identity,
   so Settings/Refresh look right in either location. */
#titlebarActionSlot .icon-button, #titlebarActionSlot .refresh-button { width: 34px; height: 28px; font-size: 14px; }
#footerActionSlot .icon-button, #footerActionSlot .refresh-button { width: 34px; height: 30px; font-size: 16px; }
.actions-hotspot:hover ~ .window-actions, .window-actions:hover, .window-actions:focus-within, .shell.settings-open .window-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0ms;
}
.title-controls .tabs {
  position: absolute;
  inset: 0;
  width: 100%;
  transition: opacity 160ms ease 280ms, transform 160ms ease 280ms;
}
.title-controls:has(.actions-hotspot:hover) .tabs, .title-controls:has(.window-actions:hover) .tabs, .title-controls:has(.window-actions:focus-within) .tabs, .shell.settings-open .title-controls .tabs {
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
  transition-delay: 0ms;
}
.icon-button, .refresh-button, .settings-actions button, .shortcut-recorder button, .tab, .mode-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(var(--overlay-rgb), var(--control-alpha));
  color: var(--text);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(var(--overlay-rgb), 0.08);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.icon-button { width: 34px; height: 28px; padding: 0; font-size: 14px; line-height: 1; }
.icon-button:hover, .refresh-button:hover, .mode-button:hover, .settings-actions button:hover, .shortcut-recorder button:hover { border-color: var(--line-strong); background: rgba(var(--overlay-rgb), 0.072); }
.icon-button.active { border-color: rgba(var(--accent-rgb), 0.58); color: var(--green); background: rgba(var(--accent-rgb), 0.08); }
.settings-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  min-width: 0;
  max-height: calc(100vh - 72px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(var(--panel-rgb), 0.72);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  opacity: 1;
  overflow: hidden auto;
  scrollbar-width: none;
  transform: translateY(0);
  transition: max-height 140ms ease, opacity 120ms ease, padding 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.settings-panel::-webkit-scrollbar { width: 0; height: 0; }
.settings-panel.hidden {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.settings-panel label, .settings-field { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: 11px; }
.settings-field-label { min-width: 0; }
.settings-panel .checkbox-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.settings-panel .checkbox-label input {
  width: auto;
  accent-color: var(--green);
}
.settings-group { display: grid; min-width: 0; gap: 8px; }
.settings-group.hidden, .settings-subgroup.hidden, .settings-actions button.hidden { display: none; }
.settings-group-header { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.settings-group-header span:last-child:not(:first-child) { font-size: 9px; opacity: 0.72; }
.settings-collapsible-group {
  gap: 0;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.09);
}
.settings-collapsible-group:last-child {
  border-bottom: 0;
}
.settings-section-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 4px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.settings-section-toggle:hover,
.settings-section-toggle:focus-visible {
  background: rgba(var(--overlay-rgb), var(--control-alpha));
  color: var(--text);
}
.settings-section-toggle:focus-visible {
  outline: 1px solid rgba(115, 189, 245, 0.72);
  outline-offset: 1px;
}
.settings-section-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}
.settings-section-heading > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-section-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.settings-section-disclosure {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  color: var(--muted);
  font-size: 0;
  line-height: 0;
  transform-origin: center;
  transition: transform 140ms ease;
}
.settings-section-disclosure::before {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1.5px) rotate(45deg);
}
.settings-section-summary,
.settings-subgroup-summary {
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.25;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-subheader-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}
.settings-subgroup-summary {
  max-width: 86px;
}
.accordion-animated-container {
  display: grid !important;
  grid-template-rows: 1fr;
  transition: grid-template-rows 250ms cubic-bezier(0.4, 0, 0.2, 1), margin-top 250ms cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}
.accordion-animated-container.hidden {
  grid-template-rows: 0fr;
  pointer-events: none;
  margin-top: 0 !important;
}

/* Convert Grid Gaps to animatable margins for accordion containers */
.settings-group, .settings-subgroup, .presence-feature, .tool-preference-list, .cursor-settings-details-inner, .hub-mode-fields > .accordion-animation-inner {
  gap: 0 !important;
}
.settings-group > * + *,
.settings-subgroup > * + *,
.presence-feature > * + *,
.cursor-settings-details-inner > * + *,
.hub-mode-fields > .accordion-animation-inner > * + * {
  margin-top: 8px;
}
.tool-preference-list > * + * {
  margin-top: 6px;
}
.accordion-animation-inner {
  overflow: hidden;
  opacity: 1;
  transition: opacity 250ms ease;
  min-height: 0;
}
.accordion-animated-container.hidden > .accordion-animation-inner {
  opacity: 0;
}

.settings-section-details {
  min-width: 0;
}
.settings-section-details-inner {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding-left: 4px;
}
.settings-section-details-inner > :first-child {
  padding-top: 2px;
}
.settings-section-details-inner > :last-child {
  padding-bottom: 10px;
}
.settings-subgroup {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(var(--line-rgb), 0.075);
}
.settings-section-details-inner > .settings-subgroup:first-child {
  padding-top: 0;
  border-top: 0;
}
.presence-feature { display: grid; min-width: 0; gap: 8px; }
.presence-feature + .presence-feature {
  padding-top: 10px;
  border-top: 1px solid rgba(var(--line-rgb), 0.09);
}
.presence-feature-body {
  min-width: 0;
  padding-left: 12px;
  border-left: 1px solid rgba(var(--line-rgb), 0.14);
}
.presence-feature-body > .accordion-animation-inner {
  display: grid;
  min-width: 0;
  gap: 8px;
}
.settings-collapsible-group.expanded > .settings-section-toggle .settings-section-disclosure {
  transform: rotate(180deg);
}
.settings-section-icon {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  color: var(--green);
  opacity: 0.9;
  -webkit-mask: var(--settings-section-icon-url) center / contain no-repeat;
  mask: var(--settings-section-icon-url) center / contain no-repeat;
}
.settings-section-icon-general { --settings-section-icon-url: url("icons/settings/general.svg"); }
.settings-section-icon-main { --settings-section-icon-url: url("icons/settings/main.svg"); }
.settings-section-icon-window { --settings-section-icon-url: url("icons/settings/window.svg"); }
.settings-section-icon-tools { --settings-section-icon-url: url("icons/settings/collection.svg"); }
.settings-section-icon-limits { --settings-section-icon-url: url("icons/settings/limits.svg"); }
.settings-section-icon-accounts { --settings-section-icon-url: url("icons/settings/accounts.svg"); }
.settings-section-icon-sync { --settings-section-icon-url: url("icons/settings/sync.svg"); }
.settings-section-icon-appearance { --settings-section-icon-url: url("icons/settings/appearance.svg"); }
.cursor-settings-toggle {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: inherit;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.cursor-settings-toggle:hover { color: var(--text); }
.cursor-settings-toggle:focus-visible {
  outline: 1px solid rgba(115, 189, 245, 0.72);
  outline-offset: 3px;
  border-radius: 4px;
}
.settings-group-header .cursor-settings-summary {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 58%;
  font-size: 9px;
  opacity: 1;
}
.cursor-status-pill {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.045);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cursor-disclosure-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  color: var(--muted);
  font-size: 0;
  line-height: 0;
  transform-origin: center;
  transition: transform 140ms ease;
}
.cursor-disclosure-icon::before {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1.5px) rotate(45deg);
}
.cursor-account-group.expanded .cursor-disclosure-icon {
  transform: rotate(180deg);
}
.cursor-settings-details {
  min-width: 0;
}
.cursor-settings-details-inner {
  display: grid;
  min-width: 0;
  gap: 8px;
}
.settings-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.settings-note code { padding: 1px 5px; border-radius: 3px; background: rgba(var(--overlay-rgb), 0.06); font-size: 10px; }
.inline-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: inherit;
}
.inline-link:hover { color: var(--text); }
.hub-mode-options {
  display: grid;
  min-width: 0;
  gap: 4px;
}
.settings-panel .hub-mode-option {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(var(--overlay-rgb), var(--control-alpha));
  cursor: pointer;
}
.settings-panel .hub-mode-option:hover { border-color: var(--line-strong); }
.settings-panel .hub-mode-option input[type="radio"] {
  width: auto;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--green);
}
.settings-panel .hub-mode-option:has(input:checked) {
  border-color: rgba(115, 189, 245, 0.62);
  background: rgba(115, 189, 245, 0.07);
}
.hub-mode-text { display: grid; gap: 1px; min-width: 0; }
.hub-mode-text strong { color: var(--text); font-size: 11px; font-weight: 500; }
.hub-mode-text span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.hub-mode-fields { min-width: 0; }
.hub-mode-fields > .accordion-animation-inner { display: grid; min-width: 0; gap: 8px; }
.hub-secret-row { display: flex; min-width: 0; align-items: center; gap: 6px; }
.settings-panel .hub-secret-row input { flex: 1 1 0; width: 0; min-width: 0; }
.hub-secret-row .icon-button { width: 30px; height: 30px; flex: 0 0 auto; font-size: 13px; }
.shortcut-recorder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  min-width: 0;
}
.shortcut-value {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 30px;
  padding: 0 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(var(--overlay-rgb), 0.052);
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shortcut-value.recording {
  border-color: rgba(115, 189, 245, 0.72);
  color: var(--blue);
}
.shortcut-recorder button {
  height: 30px;
  padding: 0 8px;
  font-size: 11px;
  white-space: nowrap;
}
.shortcut-recorder button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.shortcut-recorder button:disabled:hover {
  border-color: var(--line);
  background: rgba(var(--overlay-rgb), var(--control-alpha));
}
.hub-status {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(var(--overlay-rgb), var(--control-alpha));
  color: var(--muted);
  font-size: 10px;
}
.hub-status.ok { color: var(--green); border-color: rgba(var(--accent-rgb), 0.32); }
.hub-status.error { color: var(--red); border-color: rgba(244, 119, 136, 0.42); }
.hub-address-list { display: grid; min-width: 0; gap: 5px; }
.hub-address-header { color: var(--muted); font-size: 10px; }
.hub-address-empty { color: var(--muted); font-size: 10px; line-height: 1.4; }
.hub-address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(var(--overlay-rgb), var(--control-alpha));
}
.hub-address-row code {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-address-iface { color: var(--muted); font-size: 9.5px; flex: 0 0 auto; }
.hub-address-row .icon-button { width: 26px; height: 26px; flex: 0 0 auto; font-size: 12px; }
.settings-note.hub-warning { color: var(--orange); }
.tokscale-lines {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}
.tokscale-lines > div {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 10px;
}
.tokscale-lines > div.hidden { display: none; }
.tokscale-lines strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 500;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tokscale-lines small { color: var(--muted); font-size: 9px; }
.tokscale-message {
  min-height: 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.tokscale-message.error { color: var(--red); }
.tokscale-message.success { color: var(--green); }
.settings-panel .client-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding: 2px;
}
.settings-panel .client-checkboxes label.client-checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--fg);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.settings-panel .client-checkboxes label.client-checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  accent-color: var(--green);
}
.settings-panel .client-checkboxes label.client-checkbox > span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-actions button:disabled {
  opacity: 0.38;
  cursor: default;
}
.settings-actions button:disabled:hover {
  border-color: var(--line);
  background: rgba(var(--overlay-rgb), var(--control-alpha));
}
.settings-note-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tool-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}
.tool-header-action {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.tool-header-action:hover:not(:disabled),
.tool-header-action:focus-visible {
  border-color: var(--line-strong);
  background: rgba(var(--overlay-rgb), var(--control-alpha));
  color: var(--text);
}
.tool-header-action:focus-visible {
  outline: 1px solid rgba(var(--accent-rgb), 0.5);
  outline-offset: 1px;
}
.tool-header-action:disabled {
  opacity: 0.34;
  cursor: default;
}
.tool-header-eye {
  width: 13px;
  height: 8px;
  border: 1.5px solid currentColor;
  border-radius: 999px / 80%;
}
.tool-header-eye::after {
  display: block;
  width: 3px;
  height: 3px;
  margin: 1px auto 0;
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.tool-preference-list {
  display: grid;
  min-width: 0;
  gap: 6px;
}
.tool-preference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, 22px);
  align-items: center;
  column-gap: 5px;
  margin: 0 -2px;
  padding: 1px 2px;
  border-radius: 6px;
  min-width: 0;
  flex-wrap: nowrap;
  transition: background 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}
.view-preference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, 22px);
  align-items: center;
  column-gap: 5px;
  margin: 0 -2px;
  padding: 1px 2px;
  border-radius: 6px;
  min-width: 0;
  flex-wrap: nowrap;
  transition: background 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}
.tool-preference-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--fg);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-preference-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tool-preference-label .tool-preference-name {
  flex: 0 1 auto;
}
.tool-status-tag {
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  padding: 1px 5px;
  border: 1px solid rgba(var(--line-rgb), 0.13);
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-status-tag-ok {
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--green);
}
.tool-status-tag-neutral {
  border-color: rgba(var(--line-rgb), 0.2);
  color: var(--muted);
}
.tool-status-tag-muted {
  border-color: rgba(var(--line-rgb), 0.13);
  color: var(--muted);
  opacity: 0.72;
}
.tool-status-tag-setup {
  border-color: rgba(244, 160, 115, 0.32);
  color: var(--orange);
}
.tool-preference-row.is-hidden .tool-preference-name,
.view-preference-row.is-hidden .tool-preference-name {
  opacity: 0.58;
}
.view-preference-row.is-disabled .tool-preference-name,
.view-preference-row.is-disabled .tool-visibility-button,
.view-preference-row.is-disabled .view-subgroup-toggle,
.view-preference-row.is-disabled .preference-order-handle {
  opacity: 0.42;
}
.view-preference-row.is-disabled .tool-visibility-button:hover,
.view-preference-row.is-disabled .view-subgroup-toggle:hover,
.view-preference-row.is-disabled .preference-order-handle:hover:not(:disabled) {
  opacity: 0.72;
}
.tool-preference-actions {
  display: contents;
}
.tool-preference-toggle {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 0;
  margin: 0;
}
.tool-preference-toggle input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--green);
}
.tool-visibility-button,
.tool-pin-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
}
.tool-visibility-button:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.06);
}
.tool-visibility-button:focus-visible,
.tool-pin-button:focus-visible {
  outline: 1px solid rgba(var(--accent-rgb), 0.5);
  outline-offset: 1px;
}
.tool-visibility-button.is-hidden {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.tool-visibility-button.is-hidden:hover {
  border-color: var(--line-strong);
  color: var(--text);
}
.tool-pin-button {
  color: var(--muted);
}
.tool-pin-button:hover {
  border-color: var(--line-strong);
  background: rgba(var(--overlay-rgb), var(--control-alpha));
  color: var(--text);
}
.tool-pin-button.is-pinned {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--green);
}
.tool-visibility-button svg,
.tool-pin-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.settings-panel .limit-provider-list {
  grid-template-columns: 1fr;
  gap: 6px;
}
.settings-panel .limit-provider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 -2px;
  padding: 1px 2px;
  border-radius: 6px;
  transition: background 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}
.settings-panel .limit-provider-row label.client-checkbox {
  min-width: 0;
}
.settings-panel .limit-provider-toggle {
  align-items: flex-start;
}
.limit-provider-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
  white-space: normal;
}
.limit-provider-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.limit-provider-tags {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 3px;
}
.limit-provider-tag {
  max-width: 100%;
  overflow: hidden;
  padding: 1px 5px;
  border: 1px solid rgba(var(--line-rgb), 0.13);
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.limit-provider-tag-status {
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--green);
}
.limit-provider-tag-source {
  border-color: rgba(115, 189, 245, 0.24);
  color: var(--blue);
}
.limit-provider-tag-device {
  border-color: rgba(var(--line-rgb), 0.18);
}
.limit-provider-tag-local {
  border-color: rgba(var(--accent-rgb), 0.24);
  color: var(--green);
}
.limit-provider-tag-remote {
  border-color: rgba(241, 217, 115, 0.32);
  color: var(--yellow);
}
.limit-provider-tag-multi {
  border-color: rgba(115, 189, 245, 0.3);
  color: var(--blue);
}
.limit-provider-tag-setup {
  border-color: rgba(244, 160, 115, 0.32);
  color: var(--orange);
}
.limit-provider-tag-sync {
  border-color: rgba(115, 189, 245, 0.3);
  color: var(--blue);
}
.limit-provider-tag-warn,
.limit-provider-tag-stale {
  border-color: rgba(241, 217, 115, 0.32);
  color: var(--yellow);
}
.limit-provider-tag-muted {
  color: var(--muted);
}
.preference-order-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.preference-order-handle::before {
  width: 10px;
  height: 14px;
  background-image: radial-gradient(currentColor 1.15px, transparent 1.25px);
  background-position: 0 0;
  background-size: 5px 5px;
  content: "";
  opacity: 0.78;
}
.preference-order-handle:hover:not(:disabled),
.preference-order-handle:focus-visible {
  border-color: var(--line-strong);
  background: rgba(var(--overlay-rgb), var(--control-alpha));
  color: var(--text);
}
.preference-order-handle:active:not(:disabled) {
  cursor: grabbing;
}
.preference-order-handle:focus-visible {
  outline: 1px solid rgba(var(--accent-rgb), 0.5);
  outline-offset: 1px;
}
.preference-order-handle:disabled {
  opacity: 0.34;
  cursor: default;
}
.tool-preference-row.is-dragging,
.view-preference-row.is-dragging,
.settings-panel .limit-provider-row.is-dragging {
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.28);
  opacity: 0.9;
}
.reset-appearance-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(var(--overlay-rgb), var(--control-alpha));
  color: var(--muted);
  cursor: pointer;
}
.reset-appearance-button:hover { border-color: var(--line-strong); color: var(--text); }
.slider-label { display: flex; align-items: center; justify-content: space-between; }
.reset-inline { width: 18px; height: 18px; font-size: 10px; line-height: 1; }

/* Appearance: interface theme presets + colour pickers */
.theme-preset-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), var(--control-alpha));
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.theme-preset-chip:hover { border-color: var(--line-strong); color: var(--text); }
.theme-preset-chip.active { border-color: rgba(var(--accent-rgb), 0.58); color: var(--green); background: rgba(var(--accent-rgb), 0.08); }
.theme-preset-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25); }
.color-picker-grid { display: grid; gap: 6px; }
.color-picker-row, .vendor-color-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.color-picker-name, .vendor-color-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-panel input.color-picker-input {
  width: 30px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.settings-panel input.color-picker-input::-webkit-color-swatch-wrapper { padding: 2px; }
.settings-panel input.color-picker-input::-webkit-color-swatch { border: none; border-radius: 4px; }
.vendor-color-list {
  display: grid;
  gap: 6px;
  max-height: 196px;
  overflow-y: auto;
  padding-right: 4px;
}
.settings-panel input, .settings-panel select {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(var(--sunken-rgb), 0.48);
  color: var(--text);
  outline: none;
}
.settings-panel select { appearance: none; cursor: pointer; }
.settings-panel input[type="range"] {
  height: 22px;
  padding: 0;
  accent-color: var(--green);
  background: transparent;
}
.settings-panel input:focus { border-color: rgba(115, 189, 245, 0.72); }
.settings-actions { display: flex; gap: 8px; }
.settings-actions button { height: 30px; padding: 0 10px; font-size: 11px; }
.refresh-button { width: 34px; height: 30px; padding: 0; font-size: 16px; line-height: 1; }
.tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  width: 100%;
  border: 1px solid rgba(var(--line-rgb), 0.09);
  border-radius: 10px;
  background: rgba(var(--overlay-rgb), 0.026);
  box-shadow: inset 0 1px 0 rgba(var(--overlay-rgb), 0.045);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.tab {
  height: 22px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  box-shadow: none;
}
.tab:hover { color: var(--text); }
.tab.active {
  border-color: rgba(var(--line-rgb), 0.13);
  color: var(--green);
  background: rgba(var(--overlay-rgb), 0.06);
  box-shadow: inset 0 1px 0 rgba(var(--overlay-rgb), 0.075);
}
.total-panel {
  position: relative;
  z-index: 1;
  padding: 2px 2px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.total-number {
  margin-top: 8px;
  color: var(--number);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: clamp(30px, 11vw, 46px);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cost { margin-top: 6px; color: var(--muted); font-size: 12px; }
.breakdown {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow: hidden auto;
  padding-right: 2px;
  scrollbar-width: none;
}
.breakdown.hidden { display: none; }
.breakdown::-webkit-scrollbar { width: 0; height: 0; }

.row { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid rgba(var(--line-rgb), 0.12); }
.row-head { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.row-name { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 8px; color: var(--text); }
.dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--blue);
}
.row-mark { flex: 0 0 auto; }
.row-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain;    mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.row-icon-claude     { -webkit-mask-image: url(../../../assets/icons/claude.svg);        mask-image: url(../../../assets/icons/claude.svg); }
.row-icon-codex      { -webkit-mask-image: url(../../../assets/icons/codex.svg);         mask-image: url(../../../assets/icons/codex.svg); }
.row-icon-hermes     { -webkit-mask-image: url(../../../assets/icons/hermes-agent.svg);  mask-image: url(../../../assets/icons/hermes-agent.svg); }
.row-icon-gemini     { -webkit-mask-image: url(../../../assets/icons/gemini.svg);        mask-image: url(../../../assets/icons/gemini.svg); }
.row-icon-cursor     { -webkit-mask-image: url(../../../assets/icons/cursor.svg);        mask-image: url(../../../assets/icons/cursor.svg); }
.row-icon-antigravity { -webkit-mask-image: url(../../../assets/icons/antigravity.svg);   mask-image: url(../../../assets/icons/antigravity.svg); }
.row-icon-cline      { -webkit-mask-image: url(../../../assets/icons/cline.svg);         mask-image: url(../../../assets/icons/cline.svg); }
.row-icon-opencode   { -webkit-mask-image: url(../../../assets/icons/opencode.svg);      mask-image: url(../../../assets/icons/opencode.svg); }
.row-icon-openclaw   { -webkit-mask-image: url(../../../assets/icons/openclaw.svg);      mask-image: url(../../../assets/icons/openclaw.svg); }
.row-icon-deepseek   { -webkit-mask-image: url(../../../assets/icons/deepseek.svg);      mask-image: url(../../../assets/icons/deepseek.svg); }
.row-icon-xai        { -webkit-mask-image: url(../../../assets/icons/xai.svg);           mask-image: url(../../../assets/icons/xai.svg); }
.row-icon-meta       { -webkit-mask-image: url(../../../assets/icons/meta.svg);          mask-image: url(../../../assets/icons/meta.svg); }
.row-icon-mistral    { -webkit-mask-image: url(../../../assets/icons/mistral.svg);       mask-image: url(../../../assets/icons/mistral.svg); }
.row-icon-qwen       { -webkit-mask-image: url(../../../assets/icons/qwen.svg);          mask-image: url(../../../assets/icons/qwen.svg); }
.row-icon-moonshot   { -webkit-mask-image: url(../../../assets/icons/moonshot.svg);      mask-image: url(../../../assets/icons/moonshot.svg); }
.row-icon-zai        { -webkit-mask-image: url(../../../assets/icons/zai.svg);           mask-image: url(../../../assets/icons/zai.svg); }
.row-icon-cohere     { -webkit-mask-image: url(../../../assets/icons/cohere.svg);        mask-image: url(../../../assets/icons/cohere.svg); }
.row-icon-xiaomi     { -webkit-mask-image: url(../../../assets/icons/xiaomi.svg);        mask-image: url(../../../assets/icons/xiaomi.svg); }
.row-icon-minimax    { -webkit-mask-image: url(../../../assets/icons/minimax.svg);       mask-image: url(../../../assets/icons/minimax.svg); }
.row-icon-os-apple   { -webkit-mask-image: url(../../../assets/icons/os-apple.svg);      mask-image: url(../../../assets/icons/os-apple.svg); }
.row-icon-os-linux   { -webkit-mask-image: url(../../../assets/icons/os-linux.svg);      mask-image: url(../../../assets/icons/os-linux.svg); }
.row-icon-os-windows { -webkit-mask-image: url(../../../assets/icons/os-windows.svg);    mask-image: url(../../../assets/icons/os-windows.svg); }
.limit-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  background-color: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.limit-icon-claude {
  -webkit-mask-image: url(../../../assets/icons/claude.svg);
  mask-image: url(../../../assets/icons/claude.svg);
}
.limit-icon-codex {
  -webkit-mask-image: url(../../../assets/icons/codex.svg);
  mask-image: url(../../../assets/icons/codex.svg);
}
.limit-icon-cursor {
  -webkit-mask-image: url(../../../assets/icons/cursor.svg);
  mask-image: url(../../../assets/icons/cursor.svg);
}
.limit-icon-antigravity {
  -webkit-mask-image: url(../../../assets/icons/antigravity.svg);
  mask-image: url(../../../assets/icons/antigravity.svg);
}
.limit-icon-opencode {
  -webkit-mask-image: url(../../../assets/icons/opencode.svg);
  mask-image: url(../../../assets/icons/opencode.svg);
}
.limit-icon-deepseek {
  -webkit-mask-image: url(../../../assets/icons/deepseek.svg);
  mask-image: url(../../../assets/icons/deepseek.svg);
}
.row-label {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.row-title, .row-subtitle, .row-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-subtitle, .row-detail {
  color: var(--muted);
  font-size: 10px;
}
.row-detail {
  opacity: 0.84;
}
.row-subtitle.hidden, .row-detail.hidden { display: none; }
.row-metrics { display: grid; flex: 0 0 auto; gap: 2px; min-width: max-content; text-align: right; }
.row-value { color: var(--text); white-space: nowrap; }
.row-cost { color: var(--muted); font-size: 10px; white-space: nowrap; }
.bar { width: 100%; height: 6px; overflow: hidden; border-radius: 3px; background: rgba(var(--sunken-rgb), 0.46); box-shadow: inset 0 1px 0 rgba(var(--overlay-rgb), 0.04); }
.bar-fill { height: 100%; width: 0; border-radius: 3px; background: var(--blue); transition: width 450ms ease; }
.row.stale .row-name, .row.stale .row-value, .row.stale .row-cost { color: var(--muted); }
.row.local .row-name::after {
  content: 'you';
  flex: 0 0 auto;
  padding: 1px 5px;
  border: 1px solid rgba(var(--line-rgb), 0.13);
  border-radius: 5px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.row.local.stale .row-name::after { display: none; }
.shell.session-mode .breakdown {
  gap: 7px;
}
.shell.session-mode .row {
  gap: 5px;
  padding-bottom: 8px;
}
.shell.session-mode .row-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(66px, max-content);
  align-items: start;
  gap: 8px;
}
.shell.session-mode .row-name {
  align-items: start;
  gap: 7px;
}
.shell.session-mode .row-icon {
  width: 11px;
  height: 11px;
  margin-top: 2px;
}
.shell.session-mode .dot {
  margin-top: 3px;
}
.shell.session-mode .row-label {
  gap: 1px;
}
.shell.session-mode .row-subtitle {
  font-size: 10px;
  line-height: 1.2;
}
.shell.session-mode .row-detail {
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.shell.session-mode .row-metrics {
  min-width: 66px;
}
.shell.session-mode .row-value {
  font-size: 12px;
  line-height: 1.15;
}
.shell.session-mode .row-cost {
  line-height: 1.1;
}
.shell.session-mode .bar {
  height: 5px;
}
.limits-panel {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  min-height: 0;
  align-content: start;
  gap: 12px;
  overflow: hidden auto;
  padding: 0 2px 0 0;
  scrollbar-width: none;
}
.limits-panel::-webkit-scrollbar { width: 0; height: 0; }
.limits-panel.hidden { display: none; }
.service-status-panel {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  min-height: 0;
  align-content: start;
  gap: 10px;
  overflow: hidden auto;
  padding: 0 2px 0 0;
  scrollbar-width: none;
}
.service-status-panel::-webkit-scrollbar { width: 0; height: 0; }
.service-status-panel.hidden { display: none; }
.service-status-row {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 5px;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.12);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.service-status-row:hover .service-status-description {
  color: var(--text);
}
.service-status-row:focus-visible {
  outline: 1px solid rgba(var(--accent-rgb), 0.5);
  outline-offset: 2px;
}
.service-status-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.service-status-head strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.service-status-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}
.service-status-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.service-status-pill {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid rgba(var(--line-rgb), 0.14);
  border-radius: 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.1;
}
.service-status-ok .service-status-pill {
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--green);
}
.service-status-degraded .service-status-pill {
  border-color: rgba(241, 217, 115, 0.32);
  color: var(--yellow);
}
.service-status-outage .service-status-pill {
  border-color: rgba(244, 119, 136, 0.42);
  color: var(--red);
}
.service-status-description {
  overflow: hidden;
  color: var(--fg);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.service-status-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.limit-row {
  display: grid;
  gap: 10px;
  padding: 0 0 13px;
  border-bottom: 1px solid rgba(var(--line-rgb), 0.12);
}
.limit-head, .limit-window-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.limit-head { align-items: start; }
.limit-title {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.limit-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
}
.limit-name span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.limit-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.limit-plan {
  flex: 0 0 auto;
  max-width: 42%;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.limit-windows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.limit-windows-cursor {
  grid-template-columns: 1fr;
  gap: 8px;
}
.limit-window { display: grid; gap: 5px; min-width: 0; }
.limit-window-wide {
  grid-column: 1 / -1;
}
.limit-window-text { color: var(--muted); font-size: 10px; }
.limit-window-text span:last-child { color: var(--text); white-space: nowrap; }
.limit-meter {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(var(--sunken-rgb), 0.44);
}
.limit-meter-fill {
  width: 0;
  height: 100%;
  border-radius: 3px;
  transition: width 420ms ease;
}
.limit-reset {
  min-height: 11px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.limit-window-note {
  gap: 3px;
}
.limit-window-note .limit-reset {
  min-height: 0;
  font-size: 10px;
  white-space: normal;
}
.limit-window-no-reset .limit-reset {
  display: none;
  min-height: 0;
}
.limit-row.stale .limit-name, .limit-row.stale .limit-window-text span:last-child { color: var(--muted); }
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.mode-button { width: auto; max-width: 52%; min-width: 0; height: 30px; padding: 0 10px; overflow: hidden; color: var(--muted); text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.mode-button:hover { border-color: rgba(115, 189, 245, 0.62); color: var(--blue); }
.error { color: var(--red); }
.update-pill {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(115, 189, 245, 0.12);
  border: 1px solid rgba(115, 189, 245, 0.32);
  color: var(--blue);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.update-pill.hidden { display: none; }
.update-pill:hover { background: rgba(115, 189, 245, 0.18); border-color: rgba(115, 189, 245, 0.52); }
.update-pill-action {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  display: inline-flex;
  align-items: center;
  font: inherit;
  line-height: 1;
  padding: 3px 4px 3px 8px;
  cursor: pointer;
}
.update-pill-label { letter-spacing: 0.02em; }
.update-pill-dismiss {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--blue);
  opacity: 0.6;
  font-size: 12px;
  line-height: 1;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  padding: 0;
  cursor: pointer;
}
.update-pill-dismiss:hover { opacity: 1; }

/* Progressive collapse as the window gets shorter. Width is intentionally not a */
/* trigger — a narrow but tall window is a valid sidebar layout. Sections drop */
/* in order of least → most important: footer, then secondary panels, then breakdown. */
@media (max-height: 280px) {
  .footer { display: none; }
}
@media (max-height: 240px) {
  .limits-panel,
  .service-status-panel,
  .trends-panel { display: none; }
}
@media (max-height: 200px) {
  .shell { gap: 8px; padding: 12px 14px; }
  .titlebar { min-height: clamp(28px, 8vh, 38px); }
  .total-panel { padding: 2px 2px; }
  .label-row { font-size: clamp(11px, 2.6vw, 16px); }
  .total-number { margin-top: clamp(2px, 1.2vh, 8px); font-size: clamp(22px, 13vw, 60px); }
  .cost { margin-top: clamp(2px, 1vh, 6px); font-size: clamp(12px, 2.8vw, 18px); }
  .breakdown,
  .service-status-panel { display: none; }
}

#cursorManualPanel.hidden,
#opencodeManualPanel.hidden,
#deepseekManualPanel.hidden,
#cursorErrorMessage.hidden,
#opencodeErrorMessage.hidden,
#deepseekErrorMessage.hidden { display: none; }
#cursorManualPanel,
#opencodeManualPanel,
#deepseekManualPanel {
  min-width: 0;
}
#cursorManualPanel > .accordion-animation-inner,
#opencodeManualPanel > .accordion-animation-inner,
#deepseekManualPanel > .accordion-animation-inner {
  display: grid;
  min-width: 0;
  gap: 8px;
}
#cursorManualPanel textarea,
#opencodeManualPanel textarea,
#deepseekManualPanel input {
  width: 100%;
  font-family: monospace;
  font-size: 12px;
}
.link-button {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.settings-note.error {
  color: var(--red);
}
.client-checkbox.disabled,
.tool-preference-row.disabled .tool-preference-name {
  opacity: 0.5;
}
.tool-preference-row.disabled input[data-preference="track"] {
  cursor: not-allowed;
}
.session-detail { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 6px; overflow: hidden auto; scrollbar-width: none; font-size: 12px; }
.session-detail::-webkit-scrollbar { width: 0; height: 0; }
.session-detail.hidden { display: none; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.detail-head.hidden { display: none; }
.detail-back { background: transparent; border: 0; color: var(--muted, #8a8a90); font: inherit; cursor: pointer; padding: 0; }
.detail-sort { background: transparent; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; color: var(--muted, #8a8a90); font: inherit; font-size: 11px; cursor: pointer; padding: 2px 8px; margin-block: -4px; }
.detail-note { color: var(--muted, #8a8a90); padding: 16px 4px; text-align: center; }
.detail-exchange { border-bottom: 1px dashed rgba(255,255,255,0.08); padding: 6px 0; }
.detail-exchange .bar { height: 3px; margin-left: 20px; width: auto; }
.detail-ex-head { display: flex; align-items: baseline; gap: 8px; cursor: pointer; }
.detail-chev { width: 12px; flex: 0 0 12px; color: var(--muted, #8a8a90); }
.detail-ex-label { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.detail-ex-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-ex-sub { font-size: 10px; color: var(--muted, #8a8a90); }
.detail-ex-metrics { text-align: right; white-space: nowrap; display: flex; flex-direction: column; }
.detail-ex-cost, .detail-turn-cost { font-size: 10px; color: var(--muted, #8a8a90); }
.detail-turns { margin: 4px 0 4px 20px; padding-left: 12px; border-left: 2px solid rgba(255,255,255,0.08); }
.detail-turns.hidden { display: none; }
.detail-turn { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 0; }
.detail-turn-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.detail-turn-split, .detail-turn-tools { font-size: 10px; color: var(--muted, #8a8a90); }
.detail-turn-metrics { text-align: right; white-space: nowrap; display: flex; flex-direction: column; }
.detail-role-user { color: #bda5f5; }
.detail-role-sep { color: var(--muted); }
.detail-turn-title { color: var(--muted); }
.row.session-row[data-client="claude"], .row.session-row[data-client="codex"], .row.session-row[data-client="opencode"] { cursor: pointer; }
.row.session-row[data-client="claude"] .row-metrics::after, .row.session-row[data-client="codex"] .row-metrics::after, .row.session-row[data-client="opencode"] .row-metrics::after { content: '›'; color: var(--muted); font-size: 14px; line-height: 1; }
.view-preference-row.has-subgroup {
  grid-template-columns: minmax(0, 1fr) repeat(3, 22px);
}
.view-subgroup-toggle {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.view-subgroup-icon {
  width: 13px;
  height: 13px;
  background: currentColor;
  -webkit-mask: url("icons/settings/general.svg") center / contain no-repeat;
  mask: url("icons/settings/general.svg") center / contain no-repeat;
}
.view-subgroup-toggle:hover,
.view-subgroup-toggle:focus-visible,
.view-subgroup-toggle.is-expanded {
  color: var(--green);
}
.view-subgroup-toggle:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.35);
  outline-offset: 1px;
}
.status-provider-list {
  display: grid;
  gap: 6px;
  margin: 2px 0 6px 14px;
  padding-left: 8px;
  border-left: 1px solid rgba(var(--line-rgb), 0.14);
}
.trend-settings-list {
  display: grid;
  gap: 6px;
  margin: 2px 0 6px 14px;
  padding-left: 8px;
  border-left: 1px solid rgba(var(--line-rgb), 0.14);
}
.trend-settings-row {
  padding: 2px 0;
}
.status-provider-header { margin-bottom: 2px; }
.status-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.status-provider-row.is-hidden .tool-preference-name { opacity: 0.45; }
.service-status-empty {
  padding: 12px 0;
  color: var(--muted);
  font-size: 11px;
}
.status-provider-interval {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}
.status-provider-interval select { font-size: 11px; }

.trends-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; overflow: hidden; }
.trends-panel.hidden { display: none; }
.trends-cap { flex: none; display: flex; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.6; }
.trends-open-hint { opacity: 0.75; cursor: pointer; font-size: 13px; }
.trends-spark { flex: 1 1 auto; min-height: 0; display: flex; cursor: pointer; border-radius: 8px; padding: 6px 4px; transition: background 0.12s ease; }
.trends-spark:hover { background: rgba(var(--overlay-rgb), 0.05); }
.trends-spark .sparkline { width: 100%; height: 100%; display: block; }
.trends-spark .spark-bar { fill: #6ab4f0; opacity: 0.5; }
.trends-spark .spark-bar--last { opacity: 1; }
.trends-axis { flex: none; display: flex; justify-content: space-between; padding: 0 4px; font-size: 10px; opacity: 0.45; font-variant-numeric: tabular-nums; }
.trends-stats { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trends-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: rgba(var(--overlay-rgb), 0.04); }
.trends-stat-v { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trends-stat-k { font-size: 10px; opacity: 0.55; }
.trends-empty { flex: 1; display: flex; align-items: center; justify-content: center; opacity: 0.6; font-size: 12px; }

/* Row Accordion for Cache Stats */
.row.has-accordion { cursor: pointer; }
.row-body {
  min-width: 0;
}
.row-accordion {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 250ms cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}
.row.expanded .row-accordion {
  grid-template-rows: 1fr;
}
.row-accordion-inner {
  overflow: hidden;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid rgba(var(--overlay-rgb), 0.08);
  min-height: 0;
  opacity: 1;
  transition: opacity 250ms ease;
}
.accordion-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 5px;
  padding-bottom: 2px;
}
.row:not(.expanded) .row-accordion-inner {
  opacity: 0;
}
.accordion-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 11px;
}
.accordion-label {
  color: var(--muted);
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.accordion-pct {
  font-size: 10px;
  opacity: 0.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.accordion-value {
  flex: 0 0 auto;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
  text-align: right;
}
