:root,
[data-theme='midnight'] {
  --bg-0: #06080d;
  --bg-1: #0a1018;
  --bg-2: #111827;
  --surface: rgba(14, 20, 32, 0.66);
  --surface-strong: rgba(10, 16, 26, 0.92);
  --stroke: rgba(200, 210, 225, 0.09);
  --stroke-strong: rgba(143, 176, 212, 0.2);
  --text: #eef2f8;
  --text-dim: #9aa8bc;
  --text-faint: #66748a;
  --accent: #8fb0d4;
  --accent-rgb: 143, 176, 212;
  --accent-2: #c9a962;
  --accent-deep: #2a4568;
  --gold: #c9a962;
  --gold-rgb: 201, 169, 98;
  --glow: rgba(143, 176, 212, 0.22);
  --danger: #ff6b7a;
  --danger-rgb: 255, 107, 122;
  --warn: #c9a962;
  --ok: #8fb0d4;
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.46);
  --panel: rgba(10, 16, 26, 0.58);
  --panel-strong: rgba(10, 16, 26, 0.82);
  --overlay-bg: rgba(4, 8, 14, 0.58);
  --input-bg: rgba(0, 0, 0, 0.26);
  --chrome-bg: rgba(10, 16, 26, 0.76);
  --ambient-a: #243a58;
  --ambient-b: #121a28;
  --ambient-vignette: rgba(0, 0, 0, 0.52);
  --ambient-opacity: 0.16;
  --orb-spin: 1.15;
  --orb-breathe: 2.8;
  --orb-ring-ms: 2.4s;
  --radius: 22px;
  --radius-sm: 14px;
  --sidebar: 236px;
  --header: 72px;
  --titlebar-bg: transparent;
  --titlebar-border: 0 solid transparent;
  --menubar-bg: transparent;
  --menubar-radius: 0px;
  --menubar-border: 0 solid transparent;
  --menubar-item-bg: transparent;
  --menubar-item-hover-bg: color-mix(in srgb, rgba(var(--accent-rgb), 0.18) 70%, transparent);
  --menubar-item-color: var(--text);
  --menubar-item-hover-color: var(--accent);
  --menubar-item-radius: 8px;
  --menubar-panel-bg: color-mix(in srgb, var(--panel) 94%, #000 6%);
  --session-tabs-bg: transparent;
  --session-tab-bg: rgba(255, 255, 255, 0.03);
  --session-tab-border: 1px solid var(--stroke);
  --session-tab-radius: 999px;
  --session-tab-color: var(--text-dim);
  --session-tab-shadow: none;
  --session-tab-height: 32px;
  --session-tab-active-bg: rgba(var(--accent-rgb), 0.12);
  --session-tab-active-border: 1px solid rgba(var(--accent-rgb), 0.45);
  --session-tab-active-color: var(--text);
  --session-tab-active-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.06);
  --session-new-bg: rgba(255, 255, 255, 0.03);
  --shell-sidebar-opacity: 1;
  --shell-stage-opacity: 1;
  --shell-canvas-opacity: 1;
  --shell-app-opacity: 1;
  --font: 'Outfit', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.38) transparent;
}

html {
  color-scheme: dark;
}

html[data-theme='light'] {
  color-scheme: light;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.5), rgba(var(--gold-rgb), 0.28));
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(var(--gold-rgb), 0.7), rgba(var(--accent-rgb), 0.45));
  background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-button,
*::-webkit-scrollbar-button:single-button,
*::-webkit-scrollbar-button:vertical:start:decrement,
*::-webkit-scrollbar-button:vertical:end:increment,
*::-webkit-scrollbar-button:horizontal:start:decrement,
*::-webkit-scrollbar-button:horizontal:end:increment {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

html,
body,
#root {
  margin: 0;
  width: 100%;
  height: 100%;
  height: var(--app-h, 100%);
  max-height: var(--app-h, 100%);
  min-height: 0;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font);
  user-select: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  height: 100%;
  height: var(--app-h, 100%);
  max-height: var(--app-h, 100%);
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  position: relative;
  transition: grid-template-columns 0.22s ease;
}

.app-shell.sidebar-min {
  --sidebar: 72px;
}

html[data-motion='reduce'] .app-shell {
  transition: none;
}

.ambient {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.ambient-base {
  position: absolute;
  inset: 0;
  opacity: var(--shell-app-opacity, 1);
  background:
    var(--shell-app-image, none),
    var(--shell-app-bg, linear-gradient(168deg, var(--bg-1) 0%, var(--bg-0) 46%, var(--bg-2) 100%));
  background-size: var(--shell-app-size, cover), auto;
  background-position: var(--shell-app-position, center), center;
  background-repeat: var(--shell-app-repeat, no-repeat), no-repeat;
}

html[data-shell-ambient='off'] .ambient-glow,
html[data-shell-ambient='off'] .ambient-vignette,
html[data-shell-ambient='off'] .ambient-grain {
  display: none;
}

.ambient-glow {
  position: absolute;
  width: min(640px, 72vw);
  height: min(640px, 72vh);
  border-radius: 50%;
  filter: blur(88px);
  opacity: var(--ambient-opacity);
}

.ambient-glow-a {
  top: -24%;
  left: 14%;
  background: radial-gradient(circle, var(--ambient-a) 0%, transparent 72%);
}

.ambient-glow-b {
  bottom: -30%;
  right: 8%;
  background: radial-gradient(circle, var(--ambient-b) 0%, transparent 74%);
  opacity: calc(var(--ambient-opacity) * 0.55);
}

.ambient-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 42%, var(--ambient-vignette) 100%);
  opacity: 0.62;
}

.ambient-grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.titlebar {
  grid-row: 1;
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: var(--header);
  min-height: var(--header);
  max-height: var(--header);
  padding: 0 0 0 18px;
  position: relative;
  z-index: 5;
  overflow: visible;
  -webkit-app-region: drag;
  background: var(--titlebar-bg);
  border-bottom: var(--titlebar-border);
}

body.voice-holding .titlebar,
body.voice-holding .main {
  -webkit-app-region: no-drag;
}

.titlebar-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding-top: 8px;
  padding-bottom: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.app-shell.sidebar-min .brand-copy {
  display: none;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-copy span {
  font-size: 11px;
  color: var(--text-dim);
}

.title-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 0 0 10px;
  -webkit-app-region: no-drag;
  position: relative;
  z-index: 30;
}

.title-actions .voice-mode-picker {
  margin-top: 2px;
  margin-right: 2px;
}

.title-actions .voice-mode-menu {
  left: auto;
  right: 0;
  transform: none;
}

.titlebar.is-menu-open,
.titlebar:has(.app-menubar.is-open) {
  z-index: 35;
}

.app-menubar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  padding-top: 16px;
  padding-left: var(--menubar-pad-x, 0px);
  padding-right: var(--menubar-pad-x, 0px);
  -webkit-app-region: no-drag;
  position: relative;
  z-index: 40;
  background: var(--menubar-bg);
  border: var(--menubar-border);
  border-radius: var(--menubar-radius);
}

.app-menu-slot {
  position: relative;
}

.app-menu-top {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--menubar-item-radius);
  background: var(--menubar-item-bg);
  color: var(--menubar-item-color);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.app-menu-top:hover,
.app-menu-top.is-open {
  background: var(--menubar-item-hover-bg);
  color: var(--menubar-item-hover-color);
}

.app-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 228px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--menubar-panel-bg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  display: grid;
  gap: 2px;
  z-index: 40;
}

.app-menu-flyout {
  top: -6px;
  left: calc(100% + 4px);
  min-width: 260px;
  max-width: min(380px, calc(100vw - 48px));
  max-height: min(360px, calc(100vh - 96px));
  overflow: auto;
  overscroll-behavior: contain;
}

.app-menu-subwrap {
  position: relative;
}

.app-menu-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
}

.app-menu-row.stacked {
  align-items: flex-start;
}

.app-menu-row.has-sub {
  padding-right: 8px;
}

.app-menu-row:hover,
.app-menu-row.is-active,
.app-menu-subwrap.is-open > .app-menu-row {
  background: color-mix(in srgb, rgba(var(--accent-rgb), 0.18) 70%, transparent);
}

.app-menu-row:disabled {
  opacity: 0.45;
  cursor: default;
}

.app-menu-row-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.app-menu-row-copy strong {
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-menu-row-copy span {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-menu-row svg {
  flex: 0 0 auto;
  color: var(--text-dim);
}

.app-menu-row.is-active svg {
  color: var(--accent);
}

.app-menu-provider-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.app-menu-provider-icon img,
.app-menu-provider-icon svg {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 4px;
}

.app-menu-sep {
  height: 1px;
  margin: 4px 8px;
  background: var(--stroke);
}

.app-menu-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.app-prompt-overlay {
  z-index: 50;
}

.app-prompt-dialog {
  width: min(560px, 92vw);
}

.app-prompt-dialog .field textarea {
  height: 180px;
  min-height: 140px;
}

.circle-btn {
  width: 32px;
  height: 32px;
  margin: 0 6px 0 0;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: 0.2s ease;
}

.circle-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.window-controls {
  display: flex;
  align-items: stretch;
  height: 32px;
}

.window-btn {
  width: 46px;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-dim);
  display: grid;
  place-items: center;
  transition: 0.15s ease;
}

.window-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.window-btn.close:hover {
  background: #e81123;
  color: #fff;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(140deg, #8fb0d4, #3d5f86 58%, #d4a35a);
}

.profile-pill b {
  font-size: 13px;
  font-weight: 500;
}

.sidebar {
  grid-row: 2;
  grid-column: 1;
  position: relative;
  z-index: 3;
  padding: 4px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    var(--shell-sidebar-image, none),
    var(--shell-sidebar-bg, transparent);
  background-size: var(--shell-sidebar-size, cover);
  background-position: var(--shell-sidebar-position, center);
  background-repeat: var(--shell-sidebar-repeat, no-repeat);
}

.sidebar > *:not(.shell-particles) {
  position: relative;
  z-index: 1;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  -webkit-app-region: no-drag;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--accent);
}

.sidebar-toggle span {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.sidebar.collapsed {
  padding: 4px 8px 8px;
  align-items: center;
}

.sidebar.collapsed .sidebar-toggle {
  justify-content: center;
  padding: 6px 0;
}

.sidebar.collapsed .sidebar-toggle span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-item .meta,
.sidebar.collapsed .nav-item .nav-count {
  display: none;
}

.workspace-tip {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-right: 2px;
}

.workspace-tip-btn.has-path {
  border-color: rgba(var(--accent-rgb), 0.36);
  color: var(--accent);
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.16), rgba(var(--gold-rgb), 0.06)),
    rgba(255, 255, 255, 0.03);
}

.workspace-tip.is-open .workspace-tip-btn {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.workspace-tip-hover {
  pointer-events: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  min-width: 180px;
  max-width: min(360px, 48vw);
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(10, 14, 22, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.workspace-tip:hover:not(.is-open) .workspace-tip-hover {
  opacity: 1;
  transform: translateY(0);
}

.workspace-tip-hover-label {
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.workspace-tip-hover-path {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text);
  font-family: var(--mono);
  word-break: break-all;
}

.workspace-tip-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  width: min(320px, 72vw);
  padding: 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(var(--accent-rgb), 0.1), transparent 52%),
    rgba(9, 13, 20, 0.97);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: workspace-tip-in 0.16s ease;
}

.workspace-tip-panel::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 14px;
  width: 10px;
  height: 10px;
  border-left: 1px solid rgba(var(--accent-rgb), 0.22);
  border-top: 1px solid rgba(var(--accent-rgb), 0.22);
  background: rgba(9, 13, 20, 0.97);
  transform: rotate(45deg);
}

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

html[data-motion='reduce'] .workspace-tip-panel,
html[data-motion='reduce'] .workspace-tip-hover {
  animation: none;
  transition: none;
}

.workspace-tip-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  min-width: 0;
}

.workspace-tip-panel-head strong {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.workspace-tip-panel-head em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-size: 10px;
  color: var(--text-faint);
}

.workspace-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 12px;
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.1), transparent 58%),
    rgba(8, 12, 20, 0.72);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.workspace-card:hover {
  border-color: rgba(var(--accent-rgb), 0.34);
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.16), transparent 58%),
    rgba(10, 16, 26, 0.88);
}

.workspace-card:active {
  transform: translateY(1px);
}

.workspace-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.12);
}

.workspace-tip.has-path .workspace-card-icon {
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.28), rgba(var(--gold-rgb), 0.12));
  color: #e8f1fa;
}

.workspace-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.workspace-card-copy strong {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-card-copy em {
  font-style: normal;
  font-size: 10px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-card-action {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-card:hover .workspace-card-action {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.1);
}

.workspace-path-edit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.workspace-path-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.workspace-path-input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  max-height: 96px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
  font-family: var(--mono);
  outline: none;
  resize: vertical;
  overflow-x: hidden;
  overflow-y: auto;
  word-break: break-all;
  white-space: pre-wrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.workspace-path-input::placeholder {
  color: var(--text-faint);
  font-family: var(--font);
}

.workspace-path-input:hover {
  background: rgba(0, 0, 0, 0.34);
}

.workspace-path-input:focus {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(0, 0, 0, 0.4);
}

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

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar.collapsed .sidebar-nav {
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding-top: 4px;
}

.sidebar.collapsed .nav-label {
  display: none;
}

.sidebar.collapsed .nav-item .meta {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 5px 0;
  gap: 0;
}

.sidebar.collapsed .nav-item.active::before {
  display: none;
}

.nav-item-row {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin: 0 4px;
}

.nav-item-row .nav-item {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.nav-item-refresh {
  flex: 0 0 auto;
  width: 28px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-faint);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-item-refresh:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.22);
}

.sidebar.collapsed .nav-item-row {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 0 4px;
}

.sidebar.collapsed .nav-item-row .nav-item {
  width: 100%;
}

.sidebar.collapsed .nav-item-refresh {
  width: 28px;
  height: 24px;
}

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

.nav-section.is-open {
  flex: 1 1 auto;
}

.nav-section-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  width: calc(100% - 8px);
  margin: 2px 4px 0;
  padding: 2px 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  flex: 0 0 auto;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-section-toggle:hover {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.025);
}

.nav-section.is-open .nav-section-toggle {
  color: var(--text-dim);
}

.nav-section-chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
  transform: rotate(-90deg);
}

.nav-section.is-open .nav-section-chevron {
  transform: rotate(0deg);
}

.nav-section-count {
  margin-left: auto;
  min-width: 16px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-faint);
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0;
  display: inline-grid;
  place-items: center;
}

.nav-section.is-open .nav-section-count {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
}

.nav-section-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-height: 52px;
  overflow: hidden;
}

.nav-overflow {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 8px);
  margin: 2px 4px 0;
  padding: 4px 8px;
  border: 1px dashed rgba(var(--accent-rgb), 0.28);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  flex: 0 0 auto;
}

.nav-more-btn:hover {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.45);
}

.nav-cat-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  cursor: pointer;
  flex: 0 0 auto;
}

.nav-cat-btn:hover,
.nav-cat-btn.is-open {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.28);
}

.nav-cat-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.9);
  color: #0a1018;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.nav-cat-btn .nav-skill-orb {
  position: absolute;
  left: -2px;
  bottom: -2px;
}

.nav-flyout {
  position: fixed;
  z-index: 80;
  width: min(420px, calc(100vw - 96px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--stroke-strong);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  color: var(--text);
}

.nav-flyout-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.nav-flyout-head strong {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.nav-flyout-head em {
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
  display: inline-grid;
  place-items: center;
}

.nav-flyout-close {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.nav-flyout-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.nav-flyout-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text-faint);
}

.nav-flyout-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
}

.nav-flyout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 6px;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.nav-flyout-grid .nav-item-row {
  margin: 0;
}

.nav-flyout-grid .nav-item {
  padding: 6px 8px;
}

.nav-flyout-grid .nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-flyout-grid .nav-item-refresh {
  display: none;
}

.nav-flyout-empty {
  grid-column: 1 / -1;
  margin: 18px 8px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
}

[data-theme='light'] .nav-more-btn {
  background: rgba(var(--accent-rgb), 0.08);
}

[data-theme='light'] .nav-cat-badge {
  color: #fff;
}

[data-theme='light'] .nav-flyout {
  background: var(--panel-strong);
}

.nav-label {
  margin: 6px 8px 2px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 4px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  position: relative;
  text-align: left;
  font-size: 11px;
  transition: 0.18s ease;
}

.nav-item span {
  font-size: 11px;
  line-height: 1.15;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.14), transparent);
  color: var(--accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.nav-count {
  margin-left: auto;
  margin-right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0;
  display: inline-grid;
  place-items: center;
}

.nav-item .meta {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}

.nav-item .meta.ready {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.nav-item .meta.missing {
  background: var(--warn);
}

.nav-skill-orb {
  position: relative;
  width: 9px;
  height: 9px;
  margin-left: 2px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-style: normal;
  pointer-events: none;
  animation: nav-skill-orb-in 0.22s ease-out;
}

.nav-skill-orb b {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff 0 16%, rgba(var(--accent-rgb), 1) 40%, rgba(var(--accent-rgb), 0.55) 100%);
  box-shadow:
    0 0 8px rgba(var(--accent-rgb), 0.95),
    0 0 16px rgba(var(--accent-rgb), 0.45);
  animation: nav-skill-orb-core 1.45s ease-in-out infinite;
}

.nav-skill-orb::before,
.nav-skill-orb::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--accent-rgb), 0.6);
  pointer-events: none;
  animation: voice-orb-ring 2.1s ease-out infinite;
}

.nav-skill-orb::after {
  inset: -8px;
  border-width: 1px;
  animation-delay: 0.7s;
  opacity: 0.75;
}

.sidebar.collapsed .nav-skill-orb {
  position: absolute;
  top: 1px;
  right: 2px;
  margin: 0;
  width: 8px;
  height: 8px;
}

.sidebar.collapsed .nav-skill-orb b {
  width: 6px;
  height: 6px;
}

[data-motion='reduce'] .nav-skill-orb,
[data-motion='reduce'] .nav-skill-orb b,
[data-motion='reduce'] .nav-skill-orb::before,
[data-motion='reduce'] .nav-skill-orb::after {
  animation: none;
}

@keyframes nav-skill-orb-in {
  from {
    opacity: 0;
    transform: scale(0.35);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes nav-skill-orb-core {
  0%,
  100% {
    transform: scale(0.86);
    filter: brightness(0.95);
  }
  50% {
    transform: scale(1.12);
    filter: brightness(1.28);
  }
}

.nav-voice {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: auto;
  padding: 10px 0 8px;
  width: 100%;
  overflow: visible;
  -webkit-app-region: no-drag;
}

.nav-foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--stroke);
  width: 100%;
  overflow: visible;
  -webkit-app-region: no-drag;
}

.sidebar.collapsed .nav-voice {
  padding: 6px 0 4px;
  width: 100%;
}

.main {
  grid-row: 2;
  grid-column: 2;
  position: relative;
  z-index: 2;
  padding: 8px 18px 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  isolation: isolate;
  background:
    var(--shell-stage-image, none),
    var(--shell-stage-bg, transparent);
  background-size: var(--shell-stage-size, cover);
  background-position: var(--shell-stage-position, center);
  background-repeat: var(--shell-stage-repeat, no-repeat);
}

.main > .shell-particles {
  z-index: 0;
}

.status-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 24px;
  margin: 0 -18px;
  padding: 0 10px;
  border-top: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--chrome-bg) 88%, transparent);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-app-region: no-drag;
}

.status-bar-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  height: 22px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.status-chip:hover {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

.status-chip-k {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.status-chip-v {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: 0 0 auto;
}

.status-chip.is-ok .status-dot {
  background: var(--ok);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ok) 70%, transparent);
}

.status-chip.is-ok .status-chip-v {
  color: var(--ok);
}

.status-chip.is-warn .status-dot {
  background: var(--warn);
  box-shadow: 0 0 8px color-mix(in srgb, var(--warn) 70%, transparent);
}

.status-chip.is-warn .status-chip-v {
  color: var(--warn);
}

.status-chip.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 8px color-mix(in srgb, var(--danger) 55%, transparent);
}

.status-chip.is-error .status-chip-v {
  color: var(--danger);
}

.session-tabs {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  -webkit-app-region: no-drag;
  background: var(--session-tabs-bg);
  border-radius: var(--session-tabs-radius, 0);
  padding: var(--session-tabs-pad, 0);
}

/* Workspace button sits directly left of the new-session '+' button */
.session-tabs .workspace-tip {
  margin-right: 0;
  align-items: center;
}

.session-tabs .workspace-tip .circle-btn {
  margin: 0;
}

.canvas-topbar .workspace-tip-panel {
  top: calc(100% + 8px);
  right: 0;
}

.canvas-topbar .workspace-tip-panel::before {
  right: 22px;
}

.session-tab-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding: 1px;
}

.session-tab {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 2px;
  height: var(--session-tab-height);
  max-width: 220px;
  flex: 0 0 auto;
  padding: 0 4px 0 12px;
  border-radius: var(--session-tab-radius);
  border: var(--session-tab-border);
  background: var(--session-tab-bg);
  color: var(--session-tab-color);
  box-shadow: var(--session-tab-shadow);
  cursor: grab;
  user-select: none;
}

.session-tab.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.session-tab.is-drop-before {
  border-color: rgba(var(--accent-rgb), 0.7);
  box-shadow: inset 3px 0 0 rgba(var(--accent-rgb), 0.85);
}

.session-tab.is-drop-after {
  border-color: rgba(var(--accent-rgb), 0.7);
  box-shadow: inset -3px 0 0 rgba(var(--accent-rgb), 0.85);
}

.session-tab.active {
  color: var(--session-tab-active-color);
  border: var(--session-tab-active-border);
  background: var(--session-tab-active-bg);
  box-shadow: var(--session-tab-active-shadow);
}

.session-tab.is-audible {
  border-color: rgba(var(--accent-rgb), 0.5);
  color: var(--text);
}

.session-tab.is-audible:not(.active) {
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.04)),
    rgba(255, 255, 255, 0.03);
}

.session-tab-eq {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 6px 18px 5px;
  pointer-events: none;
  opacity: 0.55;
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

.session-tab-eq i {
  display: block;
  width: 2.5px;
  height: 28%;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--accent), rgba(var(--accent-rgb), 0.35));
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.35);
  transform-origin: bottom center;
  animation: session-tab-eq 0.92s ease-in-out infinite;
}

.session-tab-eq i:nth-child(1) { animation-delay: -0.7s; animation-duration: 0.78s; }
.session-tab-eq i:nth-child(2) { animation-delay: -0.35s; animation-duration: 1.05s; }
.session-tab-eq i:nth-child(3) { animation-delay: -0.15s; animation-duration: 0.86s; }
.session-tab-eq i:nth-child(4) { animation-delay: -0.55s; animation-duration: 1.18s; }
.session-tab-eq i:nth-child(5) { animation-delay: -0.25s; animation-duration: 0.94s; }
.session-tab-eq i:nth-child(6) { animation-delay: -0.45s; animation-duration: 1.1s; }
.session-tab-eq i:nth-child(7) { animation-delay: -0.05s; animation-duration: 0.82s; }

@keyframes session-tab-eq {
  0%,
  100% {
    height: 18%;
    opacity: 0.35;
  }
  35% {
    height: 78%;
    opacity: 0.95;
  }
  60% {
    height: 42%;
    opacity: 0.55;
  }
}

html[data-motion='reduce'] .session-tab-eq i {
  animation: none;
  height: 42%;
  opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
  .session-tab-eq i {
    animation: none;
    height: 42%;
    opacity: 0.45;
  }
}

.session-tab-name,
.session-tab-btn {
  position: relative;
  z-index: 1;
}

.session-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  padding-right: 4px;
  pointer-events: none;
}

.session-tab-btn {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
  opacity: 0.68;
  flex: 0 0 auto;
  cursor: pointer;
}

.session-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  opacity: 1;
  color: var(--text);
}

.session-tab-btn.audio.is-live {
  opacity: 1;
  color: var(--accent);
}

.session-tab-btn.audio.is-muted {
  opacity: 1;
  color: var(--warn, #e8a45a);
}

.session-tab-btn.close:hover {
  background: rgba(255, 107, 122, 0.16);
  color: #ff8a96;
}

.session-new {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--session-new-bg);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.session-new:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
}

.session-stack {
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.shell-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.session-layer {
  position: absolute;
  inset: 0;
  height: 100%;
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
}

.session-layer.is-active {
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

/* Keep guest media alive when the session is hidden. visibility:hidden on
   the layer hides chrome, but visible off-screen webviews keep playing. */
.session-layer:not(.is-active) webview,
.session-layer:not(.is-active) iframe {
  visibility: visible !important;
  position: fixed !important;
  left: -14000px !important;
  top: 0 !important;
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  min-height: 8px !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

.session-dialog {
  width: min(420px, 90vw);
  padding: 22px 24px 20px;
  border-radius: 20px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.session-dialog h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.session-dialog p {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

.session-dialog .field {
  margin-bottom: 18px;
}

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

.session-dialog-actions button {
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.session-dialog-actions button:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
}

.session-dialog-actions .primary {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
}

.session-dialog-actions .primary:disabled {
  opacity: 0.45;
}

.session-dialog-actions .danger {
  background: rgba(255, 107, 122, 0.16);
  border-color: rgba(255, 107, 122, 0.4);
  color: #ff8a96;
}

.canvas-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--canvas-shell-radius, 28px);
  border: var(--canvas-shell-border, 1px solid var(--stroke));
  background:
    var(--shell-canvas-image, none),
    var(--shell-canvas-bg, linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008)));
  background-size: var(--shell-canvas-size, cover);
  background-position: var(--shell-canvas-position, center);
  background-repeat: var(--shell-canvas-repeat, no-repeat);
  box-shadow: var(--canvas-shell-shadow, var(--shadow));
  overflow: visible;
}

.canvas-topbar {
  position: relative;
  z-index: 20;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--stroke-strong, var(--stroke));
  border-radius: 28px 28px 0 0;
  background: color-mix(in srgb, var(--bg-2) 78%, var(--chrome-bg));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.canvas-topbar-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  user-select: none;
}

.canvas-topbar-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}

.canvas-topbar .workspace-tip {
  margin: 0;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

.canvas-workspace-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: min(280px, 52vw);
  height: 26px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  min-width: 0;
}

.canvas-workspace-btn:hover,
.workspace-tip.is-open .canvas-workspace-btn {
  border-color: rgba(var(--accent-rgb), 0.42);
  color: var(--accent);
}

.canvas-workspace-btn.has-path {
  border-color: rgba(var(--accent-rgb), 0.28);
  color: var(--text);
}

.canvas-workspace-btn svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.canvas-workspace-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-wrap {
  flex: 1 1 0;
  min-height: 0;
  border-radius: 0 0 27px 27px;
  border: 0;
  background: var(--canvas-wrap-bg, linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 28%));
  box-shadow: none;
  overflow: hidden;
  padding: 16px;
  position: relative;
  isolation: isolate;
  overscroll-behavior: none;
}

.canvas-wrap:focus {
  outline: none;
}

.canvas-wrap:focus-visible {
  box-shadow: var(--shadow), 0 0 0 2px rgba(var(--accent-rgb), 0.35);
}

.canvas-wrap.panning {
  cursor: grabbing;
}

.widget-chrome:active {
  cursor: grabbing;
}

.canvas-zoom {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--chrome-bg);
  backdrop-filter: blur(16px);
  -webkit-app-region: no-drag;
  flex-shrink: 0;
}

/* Inside the session bar the pill loses its heavy drop shadow. */
.session-tabs .canvas-zoom {
  box-shadow: none;
}

.canvas-zoom-label {
  min-width: 64px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.canvas-world {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  transform-origin: 0 0;
}

.canvas-world.is-transformed {
  will-change: transform;
}

.free-widget {
  position: absolute;
  min-width: 280px;
  min-height: 180px;
  overflow: hidden;
  isolation: isolate;
}

.free-widget.is-agent-hidden {
  opacity: 0;
  pointer-events: none;
}

.agent-widget-dock {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: min(640px, 52vw);
  padding: 3px;
  overflow-x: auto;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--chrome-bg);
  backdrop-filter: blur(16px);
  -webkit-app-region: no-drag;
  flex-shrink: 1;
  scrollbar-width: none;
}

.session-tabs .agent-widget-dock {
  box-shadow: none;
}

.agent-widget-dock::-webkit-scrollbar {
  display: none;
}

.agent-widget-pill {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0 3px 0 1px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
}

.agent-widget-pill.is-visible {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.agent-widget-pill.is-active {
  border-color: rgba(var(--accent-rgb), 0.72);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}

.agent-widget-pill.is-focused {
  border-color: rgba(var(--accent-rgb), 0.85);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
}

.agent-widget-pill-main,
.agent-widget-pill-btn {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.agent-widget-pill-main {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.agent-widget-pill-main:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.agent-widget-pill-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  opacity: 0.92;
  color: var(--text);
}

.agent-widget-pill-btn.hide[aria-pressed='true'] {
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--text-dim);
}

.agent-widget-pill-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.agent-widget-pill-btn.close:hover {
  background: rgba(255, 107, 122, 0.18);
  color: #ff8a96;
}

html[data-theme='light'] .agent-widget-pill-main:hover,
html[data-theme='light'] .agent-widget-pill-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.free-widget.is-ai-active {
  overflow: visible;
  z-index: 9998 !important;
}

.free-widget.is-ai-active .widget-frame {
  border-color: rgba(var(--accent-rgb), 1);
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb), 0.95),
    0 0 0 6px rgba(var(--accent-rgb), 0.28),
    0 0 32px rgba(var(--accent-rgb), 0.55),
    0 16px 40px rgba(0, 0, 0, 0.28);
  animation: widget-ai-border-pulse 0.9s ease-in-out infinite;
}

/* Transcription mode: brief flash on the widget that received the transcript. */
.free-widget.is-paste-target .widget-frame {
  border-color: rgba(var(--accent-rgb), 1) !important;
  box-shadow:
    0 0 0 2px rgba(var(--accent-rgb), 0.95),
    0 0 0 6px rgba(var(--accent-rgb), 0.3),
    0 0 28px rgba(var(--accent-rgb), 0.5),
    0 16px 40px rgba(0, 0, 0, 0.28);
  animation: widget-paste-flash 1.2s ease-out 1;
}

@keyframes widget-paste-flash {
  0% {
    box-shadow:
      0 0 0 3px rgba(var(--accent-rgb), 1),
      0 0 0 10px rgba(var(--accent-rgb), 0.45),
      0 0 44px rgba(var(--accent-rgb), 0.65),
      0 16px 40px rgba(0, 0, 0, 0.28);
  }
  100% {
    box-shadow:
      0 0 0 2px rgba(var(--accent-rgb), 0.35),
      0 0 0 4px rgba(var(--accent-rgb), 0.12),
      0 0 18px rgba(var(--accent-rgb), 0.25),
      0 16px 40px rgba(0, 0, 0, 0.28);
  }
}

.free-resize {
  position: absolute;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  z-index: 20;
  pointer-events: auto;
  touch-action: none;
  opacity: 0.42;
  transition: opacity 0.15s ease;
}

.free-resize:hover {
  opacity: 0.78;
}

.free-resize.se {
  right: 8px;
  bottom: 8px;
  border-right: 2px solid rgba(var(--accent-rgb), 0.85);
  border-bottom: 2px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 0 0 4px 0;
  cursor: nwse-resize;
}

.free-resize.sw {
  left: 8px;
  bottom: 8px;
  border-left: 2px solid rgba(var(--accent-rgb), 0.85);
  border-bottom: 2px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 0 0 0 4px;
  cursor: nesw-resize;
}

.free-resize.ne {
  right: 8px;
  top: 8px;
  border-right: 2px solid rgba(var(--accent-rgb), 0.85);
  border-top: 2px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 0 4px 0 0;
  cursor: nesw-resize;
}

.free-resize.nw {
  left: 8px;
  top: 8px;
  border-left: 2px solid rgba(var(--accent-rgb), 0.85);
  border-top: 2px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 4px 0 0 0;
  cursor: nwse-resize;
}

.free-resize.n,
.free-resize.s {
  left: 50%;
  width: 28px;
  height: 10px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.free-resize.n {
  top: 4px;
  border-top: 2px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 2px 2px 0 0;
}

.free-resize.s {
  bottom: 4px;
  border-bottom: 2px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 0 0 2px 2px;
}

.free-resize.e,
.free-resize.w {
  top: 50%;
  width: 10px;
  height: 28px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.free-resize.e {
  right: 4px;
  border-right: 2px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 0 2px 2px 0;
}

.free-resize.w {
  left: 4px;
  border-left: 2px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 2px 0 0 2px;
}

.session-menu {
  z-index: 10050;
  pointer-events: auto;
}

.widget-menu {
  position: fixed;
  /* Portaled to body so native/portaled browser guests cannot composite above it. */
  z-index: 10060;
  min-width: 188px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface-strong);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.widget-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.widget-menu button:hover {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

.canvas-empty {
  height: 100%;
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-dim);
}

.canvas-empty h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 560;
}

.react-resizable-handle {
  opacity: 0.55;
}

.react-resizable-handle::after {
  border-color: rgba(var(--accent-rgb), 0.55) !important;
}

.react-grid-item.react-grid-placeholder {
  background: rgba(var(--accent-rgb), 0.12) !important;
  border: 1px dashed rgba(var(--accent-rgb), 0.45);
  border-radius: var(--radius);
}

.widget-frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.widget-frame.is-ai-active {
  border-color: rgba(var(--accent-rgb), 1);
  box-shadow:
    inset 0 0 0 2px rgba(var(--accent-rgb), 0.95),
    0 0 0 2px rgba(var(--accent-rgb), 0.85),
    0 0 28px rgba(var(--accent-rgb), 0.5),
    0 16px 40px rgba(0, 0, 0, 0.28);
  animation: widget-ai-border-pulse 0.9s ease-in-out infinite;
}

@keyframes widget-ai-border-pulse {
  0%,
  100% {
    border-color: rgba(var(--accent-rgb), 0.65);
    box-shadow:
      inset 0 0 0 1px rgba(var(--accent-rgb), 0.55),
      0 0 0 2px rgba(var(--accent-rgb), 0.35),
      0 0 14px rgba(var(--accent-rgb), 0.28),
      0 16px 40px rgba(0, 0, 0, 0.28);
  }
  50% {
    border-color: rgba(var(--accent-rgb), 1);
    box-shadow:
      inset 0 0 0 2px rgba(var(--accent-rgb), 1),
      0 0 0 4px rgba(var(--accent-rgb), 0.55),
      0 0 34px rgba(var(--accent-rgb), 0.7),
      0 16px 40px rgba(0, 0, 0, 0.28);
  }
}

.widget-frame:has(.xterm-wrap) {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--surface-strong);
}

.widget-chrome {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  border-bottom: 1px solid var(--stroke);
  cursor: grab;
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.widget-chrome .icon-ghost {
  position: relative;
  z-index: 5;
}

.widget-chrome .icon-ghost.is-busy {
  animation: browser-reload-spin 0.75s linear infinite;
}

.widget-audio-btn.is-live {
  color: var(--accent);
}

.widget-audio-btn.is-muted {
  color: var(--warn, #e8a45a);
}

.widget-chrome span {
  font-size: 13px;
  font-weight: 500;
}

.widget-title-label {
  cursor: text;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-title-input {
  min-width: 120px;
  max-width: 240px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: var(--input-bg, rgba(0, 0, 0, 0.28));
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
}

.widget-chrome small {
  color: var(--text-faint);
  margin-left: 2px;
}

.widget-scale {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  margin-right: 4px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
}

.widget-chrome .widget-scale span {
  min-width: 34px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.widget-scale .icon-ghost {
  width: 24px;
  height: 24px;
}

.widget-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.icon-ghost {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.icon-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.xterm-wrap {
  height: 100%;
  padding: 8px 8px 8px 10px;
  overflow: hidden;
  contain: layout paint style;
  isolation: isolate;
}

.xterm-wrap.is-drop-target {
  outline: 1px dashed rgba(var(--accent-rgb), 0.7);
  outline-offset: -4px;
  background: rgba(var(--accent-rgb), 0.08);
}

.xterm-host {
  width: 100%;
  height: 100%;
  overflow: hidden;
  contain: layout paint style;
}

.xterm-host .xterm {
  height: 100%;
}

.xterm-host .xterm-screen canvas {
  display: block;
}

.xterm-viewport {
  overflow-y: auto !important;
}

.xterm-viewport::-webkit-scrollbar {
  width: 7px;
}

.xterm-viewport::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.42);
  border-radius: 99px;
}

.browser-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.browser-shell:not(.is-locked) .browser-bar {
  padding-top: 6px;
}

.browser-zoom {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
}

.browser-zoom span {
  min-width: 38px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.browser-bar input {
  flex: 1;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--input-bg);
  padding: 0 14px;
  outline: none;
}

.browser-bar input:focus {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
}

.browser-url-field {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}

.browser-url-field input {
  width: 100%;
  flex: 1;
  padding-left: 14px;
}

.browser-url-field.is-loading input {
  padding-left: 34px;
}

.browser-url-loading {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 1;
}

.browser-locked-heading .browser-url-loading {
  position: static;
  transform: none;
  flex-shrink: 0;
}

.browser-url-loading img,
.browser-url-spinner {
  display: block;
  width: 14px;
  height: 14px;
  color: var(--accent);
  animation: browser-reload-spin 0.7s linear infinite;
}

.browser-locked-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.browser-reload-spin {
  animation: browser-reload-spin 0.75s linear infinite;
}

@keyframes browser-reload-spin {
  to {
    transform: rotate(360deg);
  }
}

.browser-bar-locked {
  justify-content: space-between;
}

.browser-bar-minimal {
  justify-content: flex-end;
  padding: 6px 10px;
}

.browser-tabstrip,
.browser-bar {
  position: relative;
  z-index: 20;
  pointer-events: auto;
  -webkit-app-region: no-drag;
}

.browser-tabstrip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 0;
  min-height: 26px;
  flex-shrink: 0;
}

.browser-tab-list {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.browser-tab-list::-webkit-scrollbar {
  height: 0;
  width: 0;
}

.browser-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  max-width: 118px;
  min-width: 52px;
  padding: 0 5px 0 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--bg-2);
  color: var(--text-dim);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  flex: 0 1 auto;
  user-select: none;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-app-region: no-drag;
}

.browser-pill.is-active {
  background: var(--accent-deep);
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.browser-pill-favicon {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.browser-pill-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-pill-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  margin-left: 0;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: inherit;
  opacity: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.browser-pill:hover .browser-pill-close,
.browser-pill.is-active:hover .browser-pill-close {
  opacity: 0.85;
}

.browser-pill-close:hover {
  background: rgba(255, 255, 255, 0.14);
  opacity: 1;
}

.browser-pill-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--text-dim);
  flex-shrink: 0;
  cursor: pointer;
}

.browser-pill-add:hover {
  color: var(--text);
  background: var(--accent-deep);
}

.browser-pill-add:disabled {
  opacity: 0.35;
  cursor: default;
}

.browser-webview-stack {
  position: relative;
  z-index: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

.browser-webview-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.browser-webview-layer {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: visible;
}

.browser-webview-layer webview {
  position: fixed !important;
  margin: 0;
  border: 0;
  background: var(--bg-1);
  pointer-events: none;
}

.browser-webview-layer webview.is-active:not(.is-parked) {
  pointer-events: auto !important;
}

.browser-webview-stack webview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  flex: none;
  /* visibility:hidden on <webview> leaves a native guest view that steals
     clicks from the tab strip / address bar. Park inactive tabs off-screen. */
  pointer-events: none;
  z-index: 0;
}

.browser-webview-stack webview:not(.is-active) {
  position: fixed !important;
  left: -14000px !important;
  top: 0 !important;
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  min-height: 8px !important;
  pointer-events: none !important;
}

.browser-webview-stack webview.is-active {
  position: absolute !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  pointer-events: auto;
  z-index: 1;
}

.browser-locked-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  padding-left: 4px;
}

webview {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
  background: var(--bg-1);
}

.browser-webview-placeholder {
  flex: 1;
  min-height: 0;
  background: var(--bg-1);
}

.hyperframes-wait {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(var(--accent-rgb), 0.12), transparent 52%),
    rgba(4, 8, 14, 0.72);
}

.hyperframes-wait-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 280px;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--chrome-bg) 78%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  text-align: center;
}

.hyperframes-wait-panel strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}

.hyperframes-wait-panel p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-dim);
}

.hyperframes-wait-retry {
  margin-top: 4px;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.hyperframes-wait-retry:hover {
  background: rgba(var(--accent-rgb), 0.26);
}

.video-player-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  background: #05080d;
}

.video-player-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05080d;
}

.video-player-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.video-player-empty strong {
  color: var(--text);
  font-size: 14px;
}

.agent-shell {
  --agent-font-size: 13px;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(var(--accent-rgb), 0.16), transparent 42%),
    radial-gradient(ellipse at 88% 8%, rgba(var(--gold-rgb), 0.08), transparent 36%),
    linear-gradient(180deg, #0a1018 0%, #070b12 100%);
  color: var(--text);
}

.agent-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(6, 10, 16, 0.55);
}

.agent-topbar-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.agent-topbar-copy em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--mono);
}

.agent-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.agent-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.agent-icon-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.1);
}

.agent-icon-btn.is-muted {
  color: var(--text-faint);
  border-color: rgba(255, 255, 255, 0.08);
}

.agent-icon-btn.is-muted:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.28);
}

.agent-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.agent-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 6px 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(6, 10, 16, 0.35);
  overflow-x: auto;
  scrollbar-width: thin;
}

.agent-tab {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 180px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
}

.agent-tab.is-active {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.24);
  color: var(--text);
}

.agent-tab.is-busy .agent-tab-title {
  opacity: 0.88;
}

.agent-tab-main {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 11px;
}

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

.agent-tab-badge {
  flex: 0 0 auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(var(--gold-rgb), 0.22);
  color: #f6e6b8;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.agent-tab-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-faint);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.agent-tab-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.agent-tab-add {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.agent-tab-add:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.08);
}

.agent-thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-empty {
  margin: auto;
  max-width: 280px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px 28px;
}

.agent-empty-orb {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #dce9f7;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.28), transparent 42%),
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.55), rgba(16, 38, 61, 0.95));
  box-shadow: 0 0 28px rgba(var(--accent-rgb), 0.28);
  margin-bottom: 4px;
}

.agent-empty strong {
  font-size: calc(var(--agent-font-size) + 2px);
  font-weight: 600;
}

.agent-empty p {
  margin: 0;
  font-size: calc(var(--agent-font-size) - 1px);
  line-height: 1.5;
  color: var(--text-dim);
}

.agent-bubble {
  max-width: min(96%, 560px);
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: agent-in 0.22s ease;
}

.agent-bubble.is-user {
  align-self: flex-end;
  max-width: min(92%, 420px);
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.28), rgba(var(--accent-rgb), 0.12));
  border-color: rgba(var(--accent-rgb), 0.28);
  border-bottom-right-radius: 6px;
}

.agent-bubble.is-assistant {
  align-self: flex-start;
  width: min(100%, 560px);
  background: rgba(12, 18, 28, 0.88);
  border-color: rgba(255, 255, 255, 0.06);
  border-bottom-left-radius: 6px;
}

.agent-bubble header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.agent-bubble-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.agent-copy-btn {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-faint);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.agent-copy-btn:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.12);
}

.agent-copy-btn.is-copied {
  color: var(--ok);
  border-color: rgba(var(--accent-rgb), 0.4);
}

.agent-bubble-body {
  font-size: var(--agent-font-size);
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
}

.agent-md {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
}

.agent-md > *:first-child {
  margin-top: 0;
}

.agent-md > *:last-child {
  margin-bottom: 0;
}

.agent-md p {
  margin: 0;
}

.agent-md h1,
.agent-md h2,
.agent-md h3,
.agent-md h4 {
  margin: 0.15em 0 0;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #e8f0fa;
}

.agent-md h1 {
  font-size: 1.28em;
}

.agent-md h2 {
  font-size: 1.14em;
  padding-bottom: 0.2em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.agent-md h3 {
  font-size: 1.05em;
  color: rgba(var(--accent-rgb), 0.95);
}

.agent-md h4 {
  font-size: 1em;
  color: var(--text-dim);
}

.agent-md ul,
.agent-md ol {
  margin: 0;
  padding-left: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 0.28em;
}

.agent-md li {
  margin: 0;
  padding-left: 0.15em;
}

.agent-md li > ul,
.agent-md li > ol {
  margin-top: 0.28em;
}

.agent-md ul {
  list-style: none;
}

.agent-md ul > li {
  position: relative;
}

.agent-md ul > li::before {
  content: '';
  position: absolute;
  left: -1.05em;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.85);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.agent-md ol {
  list-style: none;
  counter-reset: agent-ol;
}

.agent-md ol > li {
  counter-increment: agent-ol;
  position: relative;
  padding-left: 0.2em;
}

.agent-md ol > li::before {
  content: counter(agent-ol);
  position: absolute;
  left: -1.35em;
  top: 0.05em;
  min-width: 1.1em;
  height: 1.1em;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.72em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #081018;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.95), #3a6a8f);
}

.agent-md blockquote {
  margin: 0;
  padding: 0.55em 0.8em;
  border-left: 3px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
}

.agent-md hr {
  width: 100%;
  border: 0;
  height: 1px;
  margin: 0.2em 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--accent-rgb), 0.35),
    transparent
  );
}

.agent-md strong {
  color: #f2f7fc;
  font-weight: 650;
}

.agent-md em {
  color: var(--text-dim);
}

.agent-md a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.35);
}

.agent-md a:hover {
  border-bottom-color: rgba(var(--accent-rgb), 0.8);
}

.agent-md-inline-code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #d7e8ff;
}

.agent-md-code {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.42);
}

.agent-md-code-lang {
  padding: 5px 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono);
}

.agent-md-code pre {
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.9em;
  line-height: 1.5;
  color: #dce9f7;
}

.agent-md-code code {
  font-family: inherit;
  background: none;
  border: 0;
  padding: 0;
}

.agent-md-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.28);
}

.agent-md-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94em;
  min-width: 220px;
}

.agent-md-table-wrap th,
.agent-md-table-wrap td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.agent-md-table-wrap th {
  font-size: 0.82em;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  white-space: nowrap;
}

.agent-md-table-wrap tr:last-child td {
  border-bottom: 0;
}

.agent-md-table-wrap tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

.agent-md-table-wrap tbody tr:hover td {
  background: rgba(var(--accent-rgb), 0.06);
}

.agent-md-checkbox {
  margin: 0 0.45em 0 0;
  vertical-align: middle;
  accent-color: rgb(var(--accent-rgb));
}

.agent-md :is(p, ul, ol, blockquote, .agent-md-code, .agent-md-table-wrap) + :is(h1, h2, h3, h4) {
  margin-top: 0.35em;
}

.agent-status,
.agent-error,
.agent-warning {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: calc(var(--agent-font-size) - 1px);
}

.agent-status {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.16);
}

.agent-error {
  color: #ffb0b8;
  background: rgba(255, 107, 122, 0.1);
  border: 1px solid rgba(255, 107, 122, 0.28);
}

.agent-warning {
  width: 100%;
  margin-bottom: 8px;
  color: var(--gold);
  background: rgba(var(--gold-rgb), 0.08);
  border: 1px solid rgba(var(--gold-rgb), 0.22);
}

.agent-composer {
  position: relative;
  z-index: 6;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(5, 8, 14, 0.72);
  overflow: visible;
}

.agent-composer-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: end;
}

.agent-mic {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.agent-mic:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.1);
}

.agent-mic.is-recording,
.agent-mic.is-transcribing {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.16);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}

.agent-mic:disabled {
  opacity: 0.4;
  cursor: default;
}

.agent-composer-field {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.agent-composer-actions {
  display: flex;
  align-items: end;
  gap: 6px;
}

.agent-queue-panel {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  background: rgba(var(--gold-rgb), 0.06);
}

.agent-queue-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e8d7a8;
}

.agent-queue-panel header em {
  font-style: normal;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(var(--gold-rgb), 0.18);
  display: grid;
  place-items: center;
  font-size: 10px;
}

.agent-queue-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}

.agent-queue-panel li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 5px 6px 5px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 11px;
  color: var(--text);
}

.agent-queue-panel li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-queue-remove {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-faint);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.agent-queue-remove:hover {
  color: #ffd6d6;
  background: rgba(var(--danger-rgb), 0.18);
}

.agent-slash-menu {
  position: absolute;
  left: 52px;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 12;
  max-height: min(280px, 46vh);
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 12, 20, 0.96);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(var(--accent-rgb), 0.08);
  backdrop-filter: blur(18px);
}

.agent-slash-group + .agent-slash-group {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.agent-slash-label {
  padding: 4px 8px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.agent-slash-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.agent-slash-item:hover,
.agent-slash-item.is-active {
  background: rgba(var(--accent-rgb), 0.16);
}

.agent-slash-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
}

.agent-slash-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.agent-slash-copy strong {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  font-weight: 650;
}

.agent-slash-copy code {
  font-size: 12px;
  color: var(--accent);
}

.agent-slash-copy em {
  overflow: hidden;
  color: var(--text);
  font-style: normal;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-slash-copy > span {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-slash-meta {
  flex-shrink: 0;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agent-slash-empty {
  padding: 12px 10px;
  color: var(--text-dim);
  font-size: 12px;
}

.agent-voice-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(5, 8, 14, 0.86);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.agent-voice-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 36px;
}

.agent-voice-bar {
  width: 3px;
  height: calc(6px + var(--level, 0.2) * 30px);
  border-radius: 99px;
  background: var(--accent);
  opacity: calc(0.4 + var(--level, 0.2) * 0.6);
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.28);
}

.agent-voice-overlay em {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.agent-composer textarea {
  width: 100%;
  min-height: 54px;
  max-height: 140px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.34);
  color: var(--text);
  font: inherit;
  font-size: var(--agent-font-size);
  line-height: 1.45;
  outline: none;
}

.agent-composer textarea:focus {
  border-color: rgba(var(--accent-rgb), 0.38);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.agent-composer textarea:disabled {
  opacity: 0.55;
}

.agent-send {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.95), #355879);
  color: #061018;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.25);
}

.agent-send:hover:not(:disabled) {
  filter: brightness(1.08);
}

.agent-send:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

.agent-send.is-stop {
  background: linear-gradient(145deg, rgba(var(--danger-rgb), 0.95), #7a2430);
  color: #fff8f8;
  box-shadow: 0 8px 22px rgba(var(--danger-rgb), 0.28);
}

.agent-send.is-stop:hover {
  filter: brightness(1.08);
}

.agent-send.is-queue {
  background: linear-gradient(145deg, rgba(var(--gold-rgb), 0.92), #8a6b2d);
  color: #1a1408;
  box-shadow: 0 8px 22px rgba(var(--gold-rgb), 0.22);
}

.agent-composer-hint {
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-faint);
}

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

[data-motion='reduce'] .agent-bubble {
  animation: none;
}

/* Never use visibility:hidden / display:none on <webview> — Electron docs
   warn it breaks guest rendering and click/JS hit-testing after unhide.
   pointer-events is enough to keep drag/pan from stealing guest clicks. */
.canvas-wrap.panning webview,
.app-shell.dragging webview,
.canvas-wrap.resizing webview,
body.session-menu-open webview,
body.session-menu-open iframe {
  pointer-events: none !important;
}

.voice-dock {
  position: relative;
  left: auto;
  top: auto;
  z-index: 20;
  -webkit-app-region: no-drag;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  pointer-events: none;
  padding: 0;
}

.voice-orb-cluster {
  pointer-events: auto;
  -webkit-app-region: no-drag;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: visible;
}

.voice-mode-picker {
  position: relative;
  z-index: 8;
}

.voice-mode-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 148px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.voice-mode-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-mode-trigger:hover,
.voice-mode-picker.is-open .voice-mode-trigger {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--stroke));
  background: color-mix(in srgb, var(--panel) 70%, rgba(var(--accent-rgb), 0.16));
}

.voice-mode-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: min(260px, calc(100vw - 48px));
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--panel) 94%, #000 6%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  display: grid;
  gap: 4px;
  z-index: 40;
}

.voice-mode-menu button {
  display: grid;
  gap: 2px;
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.voice-mode-menu button strong {
  font-size: 12px;
  font-weight: 700;
}

.voice-mode-menu button span {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
}

.voice-mode-menu button:hover,
.voice-mode-menu button.is-active {
  background: color-mix(in srgb, rgba(var(--accent-rgb), 0.18) 70%, transparent);
}

.voice-orb {
  --orb-level: 0.2;
  --orb-ring: var(--accent-rgb);
  --orb-size: 52px;
  pointer-events: auto;
  -webkit-app-region: no-drag;
  position: relative;
  width: var(--orb-size);
  height: var(--orb-size);
  border: 0;
  border-radius: 50%;
  padding: 0;
  margin: 0;
  background: transparent;
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  color: var(--orb-glyph, var(--bg-0));
  cursor: pointer;
  overflow: visible;
  filter: drop-shadow(0 8px 18px rgba(var(--orb-ring), 0.35));
  transition: filter 0.2s ease, width 0.22s ease, height 0.22s ease;
}

.voice-orb:focus,
.voice-orb:focus-visible,
.voice-orb:active {
  outline: none;
  box-shadow: none;
}

.voice-orb.is-notes {
  --orb-ring: var(--gold-rgb);
  filter: drop-shadow(0 8px 18px rgba(var(--gold-rgb), 0.32));
}

.voice-orb::before,
.voice-orb::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(var(--orb-ring), 0.55);
  pointer-events: none;
  animation: voice-orb-ring var(--orb-ring-ms, 2.4s) ease-out infinite;
}

.voice-orb::after {
  inset: -10px;
  border-width: 1.5px;
  border-color: rgba(var(--orb-ring), 0.35);
  animation-delay: 1.2s;
}

.voice-orb:hover {
  filter: drop-shadow(0 10px 22px rgba(var(--orb-ring), 0.28));
}

.voice-orb:hover .orb-glyph {
  transform: scale(1.06);
}

.voice-orb:active .orb-glyph,
body.voice-holding .voice-orb .orb-glyph {
  transform: scale(0.94);
}

.voice-orb.is-fn-hold {
  filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.45));
}

.voice-orb.is-fn-hold::before,
.voice-orb.is-fn-hold::after {
  border-color: rgba(var(--accent-rgb), 0.7);
  animation-duration: 0.9s;
}

.voice-orb.is-hot {
  --orb-ring: var(--danger-rgb);
  color: #2a060a;
  filter: drop-shadow(0 0 18px rgba(var(--danger-rgb), 0.45));
}

.voice-orb.is-hot::before,
.voice-orb.is-hot::after {
  border-color: rgba(var(--danger-rgb), 0.7);
  animation-duration: calc(var(--orb-ring-ms, 2.4s) * 0.45);
}

.voice-orb.is-hot::after {
  animation-delay: 0.55s;
}

.voice-orb.is-thinking {
  --orb-ring: var(--gold-rgb);
  color: #241606;
}

.voice-orb.is-thinking::before,
.voice-orb.is-thinking::after {
  --orb-ring: var(--gold-rgb);
  border-color: rgba(var(--gold-rgb), 0.55);
  animation-duration: calc(var(--orb-ring-ms, 2.4s) * 0.7);
}

.voice-orb.is-transcribing {
  --orb-ring: 56, 189, 208;
  color: #062126;
}

.voice-orb.is-transcribing::before,
.voice-orb.is-transcribing::after {
  border-color: rgba(56, 189, 208, 0.7);
  animation-name: voice-orb-ring-in;
  animation-duration: 1.15s;
}

.voice-orb.is-tool {
  --orb-ring: 167, 139, 250;
  color: #160b2e;
}

.voice-orb.is-tool::before,
.voice-orb.is-tool::after {
  border-color: rgba(167, 139, 250, 0.72);
  animation-duration: 0.85s;
}

.voice-orb.is-generating {
  --orb-ring: 232, 121, 249;
  color: #2a0b30;
}

.voice-orb.is-generating::before,
.voice-orb.is-generating::after {
  border-color: rgba(232, 121, 249, 0.75);
  animation-duration: 1.35s;
}

.voice-orb.is-speaking,
.voice-orb.is-idle {
  color: var(--bg-0);
}

.voice-orb.is-wake {
  filter: drop-shadow(0 0 14px rgba(var(--orb-ring), 0.42));
}

html[data-theme='light'] .voice-orb.is-idle,
html[data-theme='light'] .voice-orb.is-speaking,
html[data-theme='light'] .voice-orb.is-transcribing,
html[data-theme='light'] .voice-orb.is-tool,
html[data-theme='light'] .voice-orb.is-generating {
  color: #f8fafc;
}

.voice-orb.is-compact {
  filter: drop-shadow(0 0 8px rgba(var(--orb-ring), 0.32));
}

.voice-orb.is-compact:hover,
.voice-orb.is-compact.is-wake {
  filter: drop-shadow(0 0 10px rgba(var(--orb-ring), 0.4));
}

.voice-orb.is-compact::before {
  inset: -3px;
  border-width: 1.5px;
}

.voice-orb.is-compact::after {
  inset: -6px;
  border-width: 1px;
  animation-delay: 0.9s;
}

.orb-canvas {
  position: absolute;
  inset: 0;
  width: var(--orb-size, 52px);
  height: var(--orb-size, 52px);
  pointer-events: none;
}

.orb-glyph {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: inherit;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
  transition: transform 0.18s ease, width 0.22s ease, height 0.22s ease;
}

.voice-dock.is-compact .orb-glyph {
  width: 18px;
  height: 18px;
}

.orb-glyph svg {
  display: block;
}

.eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 28px;
}

.eq i {
  display: block;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent-deep));
  transform-origin: center;
  opacity: 0.85;
}

.hold-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  position: relative;
  background: radial-gradient(
    circle at 35% 30%,
    rgba(var(--accent-rgb), 0.95),
    rgba(var(--accent-rgb), 0.55) 56%,
    var(--accent-deep)
  );
  color: var(--bg-0);
  box-shadow: 0 0 0 5px rgba(var(--gold-rgb), 0.18), 0 8px 24px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.hold-btn:hover {
  transform: scale(1.04);
}

.hold-btn:active,
.hold-btn.hot {
  transform: scale(0.96);
  box-shadow: 0 0 0 8px rgba(255, 107, 122, 0.14), 0 0 28px rgba(255, 107, 122, 0.35);
}

.hold-btn.hot {
  background: radial-gradient(circle at 35% 30%, #ff9aa4, #ff6b7a 60%, #9a2432);
  color: #2a060a;
}

.hold-ring {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  animation: spin 1.1s linear infinite;
  opacity: 0;
}

.hold-btn.busy .hold-ring {
  opacity: 1;
}

.transcript {
  pointer-events: auto;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(480px, 42vw);
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--chrome-bg);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(18px);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  animation: rise 0.28s ease;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.transcript.is-tooltip {
  position: fixed;
  z-index: 36;
  flex: none;
  width: max-content;
  min-width: 160px;
  max-width: min(320px, 36vw);
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  overflow: auto;
}

.transcript.is-toast {
  position: fixed;
  z-index: 40;
  left: calc(var(--sidebar) + (100vw - var(--sidebar)) / 2);
  top: calc(var(--header) + 48px);
  transform: translateX(-50%);
  flex: none;
  width: min(520px, calc(100vw - var(--sidebar) - 48px));
  max-width: min(520px, calc(100vw - var(--sidebar) - 48px));
  max-height: min(42vh, 360px);
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  overflow: auto;
  pointer-events: auto;
  -webkit-app-region: no-drag;
  animation: voice-toast-in 0.32s ease;
}

.transcript.is-toast.is-fading {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}

@keyframes voice-toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.transcript.is-tooltip::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 16px;
  width: 10px;
  height: 10px;
  background: var(--chrome-bg);
  border-left: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  transform: rotate(45deg);
}

.transcript.is-fading {
  opacity: 0;
  transform: translateY(-6px);
}

.transcript b {
  display: block;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.transcript-block + .transcript-block {
  margin-top: 12px;
}

.mcp-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.mcp-card {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 14px 4px;
  background: var(--panel);
}

.mcp-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.mcp-name {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.mcp-enable {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
}

.mcp-state {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: lowercase;
}

.mcp-state.ready {
  color: var(--gold);
}

.mcp-card-google {
  margin: 16px 0 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 88%, #4285f4 12%), var(--panel));
}

.mcp-google-brand {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.mcp-google-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
}

.mcp-google-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mcp-card-firecrawl {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 86%, #f97316 14%), var(--panel));
}

.mcp-google-mark.is-firecrawl {
  background: #111;
}

.mcp-card-hyperframes {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 86%, var(--accent) 14%), var(--panel));
}

.mcp-google-mark.is-hyperframes {
  background: color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, 0.08));
  color: var(--accent);
}

.mcp-card-github {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 88%, #24292f 12%), var(--panel));
}

.mcp-google-mark.is-github {
  background: #24292f;
  color: #fff;
}

.mcp-card-copilot {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 86%, #7c3aed 14%), var(--panel));
}

.mcp-google-mark.is-copilot {
  background: #111827;
  color: #a78bfa;
}

.mcp-card-discord {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 86%, #5865f2 14%), var(--panel));
}

.mcp-google-mark.is-discord {
  background: #fff;
}

.mcp-card-linear {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 86%, #5e6ad2 14%), var(--panel));
}

.mcp-google-mark.is-linear {
  background: #111827;
}

.mcp-card-skill-seekers {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 86%, #0ea5e9 14%), var(--panel));
}

.mcp-google-mark.is-skill-seekers {
  background: color-mix(in srgb, #0ea5e9 22%, rgba(255, 255, 255, 0.08));
  color: #7dd3fc;
}

.mcp-card-gpm {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 86%, #238636 14%), var(--panel));
}

.mcp-google-mark.is-gpm {
  background: color-mix(in srgb, #238636 28%, rgba(255, 255, 255, 0.08));
  color: #7ee787;
}

.mcp-google-title {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.mcp-perm-list {
  list-style: none;
  margin: 8px 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.mcp-perm-list li {
  display: grid;
  grid-template-columns: minmax(110px, 140px) 1fr;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
}

.mcp-perm-list li strong {
  color: var(--text);
  font-weight: 600;
}

.mcp-google-actions {
  gap: 8px;
  margin: 4px 0 10px;
}

.mcp-google-signin {
  border-color: color-mix(in srgb, #4285f4 45%, var(--stroke));
}

.mcp-google-msg {
  margin-bottom: 10px;
  color: var(--text);
}

.mcp-state.error {
  color: #ff8a96;
}

.mcp-state.connecting {
  color: var(--accent);
}

.voice-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.voice-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.voice-history-head strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.voice-history-head span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-dim);
}

.voice-history-head .nav-item {
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

.voice-history-empty {
  margin: 18px 0 0;
  padding: 18px 14px;
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

.voice-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-history-item {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 8px 10px 9px;
  background: rgba(255, 255, 255, 0.025);
}

.voice-history-item time {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.voice-history-line {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.voice-history-line + .voice-history-line {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.voice-history-line span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-top: 2px;
}

.voice-history-line p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  user-select: text;
  overflow-wrap: anywhere;
}

.voice-history-line.is-user span {
  color: rgb(var(--accent-rgb));
}

.voice-history-line.is-assistant span {
  color: var(--gold);
}

.voice-history-line.is-error span,
.voice-history-line.is-error p {
  color: #ff9aa4;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--overlay-bg);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
}

.folder-picker-overlay {
  z-index: 50;
}

.marketplace-browse-overlay {
  z-index: 45;
}

.skill-details-overlay {
  z-index: 46;
}

.skill-details-modal {
  width: min(920px, 94vw);
  height: min(720px, 90vh);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px 20px;
  border-radius: 22px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.skill-details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.skill-details-kicker {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.skill-details-head h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.skill-details-head p {
  margin: 0;
  max-width: 64ch;
  color: var(--text-dim);
}

.skill-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.skill-details-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.18);
}

.skill-details-meta span {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.skill-details-meta strong {
  font-size: 13px;
  font-weight: 600;
}

.skill-details-files {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  min-height: 0;
  flex: 1;
}

.skill-details-files aside,
.skill-details-files section {
  min-height: 0;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.skill-details-files aside {
  display: flex;
  flex-direction: column;
}

.skill-details-files aside strong {
  padding: 10px 12px 6px;
  font-size: 12px;
}

.skill-details-files ul {
  margin: 0;
  padding: 0 6px 8px;
  overflow: auto;
  list-style: none;
}

.skill-details-files li button {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  text-align: left;
}

.skill-details-files li button.is-active,
.skill-details-files li button:hover {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

.skill-details-files li em {
  font-size: 10px;
  color: var(--text-faint);
}

.skill-details-files section {
  display: flex;
  flex-direction: column;
}

.skill-details-files section header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  font-size: 12px;
  color: var(--text-dim);
}

.skill-details-files pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
}

.marketplace-browse-modal {
  width: min(1100px, 94vw);
  height: min(820px, 90vh);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--stroke-strong);
  background:
    linear-gradient(165deg, rgba(var(--accent-rgb), 0.08), transparent 36%),
    var(--surface-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.marketplace-browse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--stroke);
  flex-shrink: 0;
}

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

.marketplace-browse-brand strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.marketplace-browse-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--stroke));
}

.marketplace-browse-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.marketplace-browse-loading {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--text-dim);
}

.marketplace-browse-body {
  flex: 1;
  min-height: 0;
  background: #0b0f14;
}

.marketplace-browse-webview,
.marketplace-browse-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  border: 0;
}

.marketplace-browse-placeholder {
  background: color-mix(in srgb, var(--panel) 80%, #000 20%);
}

.folder-picker {
  width: min(560px, 92vw);
  height: min(620px, 86vh);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  border: 1px solid var(--stroke-strong);
  background:
    linear-gradient(165deg, rgba(var(--accent-rgb), 0.08), transparent 42%),
    var(--surface-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.folder-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
}

.folder-picker-kicker {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.folder-picker-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.folder-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px 12px;
}

.folder-picker-icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.folder-picker-icon-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.1);
}

.folder-picker-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.folder-picker-path {
  flex: 1;
  min-width: 0;
}

.folder-picker-path input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 11px;
  font-family: var(--mono);
  outline: none;
}

.folder-picker-path input:focus {
  border-color: rgba(var(--accent-rgb), 0.34);
}

.folder-picker-list {
  flex: 1;
  min-height: 0;
  margin: 0 16px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.22);
  overflow: auto;
}

.folder-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.folder-picker-row:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

.folder-picker-create {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
}

.folder-picker-create input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.folder-picker-create input:focus {
  border-color: rgba(var(--accent-rgb), 0.4);
}

.folder-picker-create button {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.folder-picker-create button.primary {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--accent-rgb), 0.35);
  color: var(--text);
}

.folder-picker-create button:disabled {
  opacity: 0.45;
  cursor: default;
}

.folder-picker-create-error {
  padding: 6px 10px 8px;
  color: #fca5a5;
  font-size: 11px;
}

.folder-picker-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  flex: 0 0 auto;
}

.folder-picker-row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.folder-picker-empty {
  height: 100%;
  min-height: 160px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 13px;
}

.folder-picker-empty.is-error {
  color: var(--danger);
  padding: 24px;
  text-align: center;
}

.folder-picker-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
}

.folder-picker-selected {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--mono);
  line-height: 1.4;
  word-break: break-all;
}

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

.folder-picker-actions button {
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.folder-picker-actions button:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
}

.folder-picker-actions .primary {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
}

.folder-picker-actions .primary:disabled {
  opacity: 0.4;
  cursor: default;
}

.settings {
  position: relative;
  width: min(920px, 94vw);
  height: min(680px, 88vh);
  border-radius: 28px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 210px 1fr;
  overflow: hidden;
}

.settings-nav {
  padding: 22px 14px;
  border-right: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}

.settings-nav h3 {
  margin: 0 10px 14px;
  font-size: 18px;
}

.settings-body {
  padding: 26px 28px;
  overflow: auto;
}

.nav-settings {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.nav-settings-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 14px;
  min-height: 420px;
  align-items: stretch;
}

.nav-settings-cats,
.nav-settings-items {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.nav-settings-cats-head,
.nav-settings-items-head {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-settings-cats-head strong {
  font-size: 13px;
}

.nav-settings-cats-head span {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-faint);
}

.nav-settings-cat-list,
.nav-settings-item-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-settings-cat-list > li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  align-items: center;
}

.nav-settings-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.nav-settings-cat:hover {
  background: rgba(255, 255, 255, 0.04);
}

.nav-settings-cat.is-active {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.1);
}

.nav-settings-grip {
  color: var(--text-faint);
  flex-shrink: 0;
}

.nav-settings-cat-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-settings-cat-copy strong {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-settings-cat-copy em,
.nav-settings-item-copy em {
  font-style: normal;
  font-size: 10px;
  color: var(--text-faint);
}

.nav-settings-cat-actions {
  display: inline-flex;
  gap: 2px;
}

.nav-settings-add-cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-settings-add-cat input {
  width: 100%;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
}

.nav-settings-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.nav-settings-add-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.nav-settings-empty {
  margin: auto;
  padding: 28px 18px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.45;
  max-width: 280px;
}

.nav-settings-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.nav-settings-item.is-hidden {
  opacity: 0.62;
}

.nav-settings-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-settings-item-badge {
  flex-shrink: 0;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-faint);
  background: rgba(0, 0, 0, 0.25);
}

.nav-settings-item-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-settings-item-copy strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-settings-item-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.nav-settings-select {
  flex: 1;
  min-width: 120px;
}

.nav-settings-select select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--input-bg);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
}

.themed-select {
  width: 100%;
}

.themed-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  outline: none;
  cursor: pointer;
}

.themed-select.is-compact .themed-select-trigger {
  height: 32px;
  border-radius: 10px;
  padding: 0 8px;
  font-size: 12px;
}

.themed-select-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.themed-select-trigger svg {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.16s ease;
}

.themed-select-trigger.is-open svg {
  transform: rotate(180deg);
}

.themed-select-trigger.is-placeholder {
  color: var(--text-dim);
}

.themed-select-trigger:hover,
.themed-select-trigger.is-open,
.themed-select-trigger:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.themed-select-trigger:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.themed-select-menu {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--stroke-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-1) 88%, var(--panel-strong));
  box-shadow: var(--shadow);
  color: var(--text);
  color-scheme: inherit;
  backdrop-filter: blur(18px);
}

.themed-select-search {
  height: 36px;
  margin: 8px 8px 0;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  outline: none;
  color-scheme: inherit;
}

.themed-select-search:focus {
  border-color: rgba(var(--accent-rgb), 0.5);
}

.themed-select-list {
  overflow: auto;
  padding: 6px;
  min-height: 0;
}

.themed-select-option,
.themed-select-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.themed-select-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.themed-select-empty {
  color: var(--text-dim);
  cursor: default;
}

.themed-select-option.is-active,
.themed-select-option:hover {
  background: color-mix(in srgb, rgba(var(--accent-rgb), 0.18) 70%, transparent);
}

.themed-select-option.is-selected {
  color: var(--accent);
}

.nav-settings .icon-ghost:disabled {
  opacity: 0.28;
  cursor: default;
}

.nav-settings .icon-ghost.danger,
.nav-settings .icon-ghost.is-muted {
  color: var(--text-faint);
}

.nav-settings .icon-ghost.danger:hover {
  color: #ffb0b8;
  border-color: rgba(255, 107, 122, 0.35);
  background: rgba(255, 107, 122, 0.1);
}

.nav-settings-confirm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 14, 0.62);
  z-index: 5;
  padding: 20px;
}

.nav-settings-confirm-card {
  width: min(380px, 100%);
  border-radius: 16px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-settings-confirm-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-dim);
}

.nav-settings-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.nav-settings-confirm-actions .danger-btn,
.nav-item.danger-btn {
  border-color: rgba(255, 107, 122, 0.4);
  background: rgba(255, 107, 122, 0.14);
  color: #ffc2c8;
}

@media (max-width: 820px) {
  .nav-settings-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

.mp-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mp-settings-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.08);
}

.mp-settings-banner strong {
  display: block;
  font-size: 13px;
}

.mp-settings-banner em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 12px;
  color: var(--text-dim);
}

.mp-settings-banner-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mp-settings-banner-actions .nav-item,
.mp-settings-upload-row .nav-item,
.mp-settings-warn .nav-item,
.mp-settings-item-actions .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
}

.updates-settings-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.updates-settings-card {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.updates-settings-card:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.08);
}

.updates-settings-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.updates-settings-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 8px;
}

.updates-settings-badge.kind-feature {
  background: rgba(34, 197, 94, 0.16);
  color: #4ade80;
}

.updates-settings-badge.kind-fix {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}

.updates-settings-badge.kind-opt {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
}

.updates-settings-badge.kind-release {
  background: rgba(var(--gold-rgb), 0.18);
  color: var(--gold);
}

.updates-settings-version {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  color: var(--accent);
}

.updates-settings-date {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
}

.updates-settings-card strong {
  font-size: 14px;
  line-height: 1.35;
}

.updates-settings-card .help {
  margin: 0;
}

.mp-settings-warn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(var(--gold-rgb), 0.28);
  background: rgba(var(--gold-rgb), 0.08);
  color: var(--gold);
  font-size: 13px;
  line-height: 1.4;
}

.mp-settings-ok {
  margin: 0;
  color: var(--ok);
  font-size: 13px;
}

.mp-settings-err {
  margin: 0;
  color: #ffb0b8;
  font-size: 13px;
}

.mp-settings-section {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.16);
  padding: 12px 12px 10px;
}

.mp-settings-section header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mp-settings-section header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.mp-settings-section header span {
  font-size: 11px;
  color: var(--text-faint);
}

.mp-settings-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.45;
}

.mp-settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-settings-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.mp-settings-item-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mp-settings-item-copy strong {
  font-size: 13px;
}

.mp-settings-item-copy em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
}

.mp-settings-id {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-settings-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mp-settings-upload-row {
  margin-bottom: 10px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mp-settings-folder-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.mp-settings-folder-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.mp-settings-folder-copy strong {
  font-size: 12px;
}

.mp-settings-folder-copy code {
  font-size: 11px;
  color: var(--text-dim);
  word-break: break-all;
}

.mp-local-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.mp-local-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.mp-local-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.mp-local-card-top strong {
  display: block;
  font-size: 14px;
}

.mp-local-card-top em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 11px;
  color: var(--text-dim);
}

.mp-local-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mp-local-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 10px;
  color: var(--text-faint);
}

.mp-local-meta span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-local-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.2;
  border: 1px solid transparent;
}

.mp-local-badge.is-listed {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}

.mp-local-badge.is-hidden {
  color: var(--warn, #f5c16c);
  border-color: rgba(var(--gold-rgb), 0.35);
  background: rgba(var(--gold-rgb), 0.1);
}

.mp-local-badge.is-new {
  color: var(--text-dim);
  border-color: var(--stroke);
  background: transparent;
}

.mp-local-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.mp-local-card-actions .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
}

.about-logo {
  display: block;
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin: 0 0 16px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.about-updates {
  margin: 0 0 18px;
}

.about-update-card {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-update-btn {
  align-self: flex-start;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  color: #10141c;
  background: var(--accent);
  cursor: pointer;
}

.about-update-btn:hover {
  filter: brightness(1.06);
}

.about-update-progress {
  position: relative;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
}

.about-update-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.55), rgba(var(--accent-rgb), 0.95));
  transition: width 0.18s ease;
}

.about-update-progress span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.about-update-ok {
  color: var(--ok);
}

.about-update-error {
  color: var(--danger);
}

.about-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 12px;
  color: var(--text-dim);
}

.field input,
.field select,
.field textarea {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--input-bg);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.field select option,
.nav-settings-select select option {
  background: var(--panel-strong);
  color: var(--text);
}

.field textarea {
  height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(var(--accent-rgb), 0.5);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--stroke);
}

.help {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-size: 12px;
  color: var(--text-dim);
}

.chip.on {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.08);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scaleY(0.35);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes voice-orb-ring {
  0% {
    transform: scale(0.82);
    opacity: 0.75;
  }
  70% {
    opacity: 0.28;
  }
  100% {
    transform: scale(1.42);
    opacity: 0;
  }
}

@keyframes voice-orb-ring-in {
  0% {
    transform: scale(1.38);
    opacity: 0.7;
  }
  100% {
    transform: scale(0.78);
    opacity: 0;
  }
}

.orb-activity-pill {
  position: fixed;
  z-index: 45;
  transform: translate(-50%, calc(-100% - 10px));
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(240px, calc(100vw - 16px));
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  background: color-mix(in srgb, var(--panel) 88%, rgba(0, 0, 0, 0.28));
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
  animation: orb-activity-pill-in 0.16s ease-out;
}

.orb-activity-pill::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg);
  background: inherit;
  border-right: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
}

.orb-activity-pill.is-recording {
  color: #ffb4bc;
  border-color: rgba(255, 107, 122, 0.5);
}

.orb-activity-pill.is-transcribing {
  color: #7ee8ef;
  border-color: rgba(56, 189, 208, 0.5);
}

.orb-activity-pill.is-thinking {
  color: #f0d49a;
  border-color: rgba(201, 169, 98, 0.5);
}

.orb-activity-pill.is-tool {
  color: #ddd6fe;
  border-color: rgba(167, 139, 250, 0.55);
}

.orb-activity-pill.is-generating {
  color: #f5c2ff;
  border-color: rgba(232, 121, 249, 0.55);
}

.orb-activity-pill.is-speaking {
  color: rgb(var(--accent-rgb));
  border-color: rgba(var(--accent-rgb), 0.5);
}

@keyframes orb-activity-pill-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-100% - 4px)) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 10px)) scale(1);
  }
}

[data-motion='reduce'] .orb-activity-pill {
  animation: none;
}

.dragging webview,
.resizing webview,
.panning webview {
  pointer-events: none;
}

.spin {
  animation: spin 0.9s linear infinite;
}

[data-motion='reduce'] .eq i,
[data-motion='reduce'] .hold-ring,
[data-motion='reduce'] .ambient-glow,
[data-motion='reduce'] .voice-orb::before,
[data-motion='reduce'] .voice-orb::after {
  animation: none;
  opacity: 0.45;
}

[data-motion='reduce'] .transcript.is-toast {
  animation: none;
}

[data-theme='maroon-gold'] {
  --bg-0: #080506;
  --bg-1: #0f080c;
  --bg-2: #160e14;
  --surface: rgba(22, 12, 18, 0.68);
  --surface-strong: rgba(14, 8, 12, 0.94);
  --stroke: rgba(212, 188, 160, 0.1);
  --stroke-strong: rgba(212, 176, 106, 0.24);
  --text: #f2ebe4;
  --text-dim: #b8a89c;
  --text-faint: #7a6a62;
  --accent: #d4b06a;
  --accent-rgb: 212, 176, 106;
  --accent-2: #e8cc8a;
  --accent-deep: #5c1830;
  --gold: #d4b06a;
  --gold-rgb: 212, 176, 106;
  --glow: rgba(212, 176, 106, 0.2);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.52);
  --panel: rgba(18, 10, 14, 0.62);
  --panel-strong: rgba(14, 8, 12, 0.86);
  --overlay-bg: rgba(6, 2, 4, 0.62);
  --input-bg: rgba(0, 0, 0, 0.32);
  --chrome-bg: rgba(14, 8, 12, 0.82);
  --ambient-a: #4a1428;
  --ambient-b: #1a1018;
  --ambient-vignette: rgba(0, 0, 0, 0.58);
  --ambient-opacity: 0.18;
  --orb-spin: 0.95;
  --orb-breathe: 2.2;
  --orb-ring-ms: 2.8s;
}

[data-theme='obsidian'] {
  --bg-0: #040405;
  --bg-1: #080809;
  --bg-2: #101012;
  --surface: rgba(12, 12, 14, 0.68);
  --surface-strong: rgba(8, 8, 10, 0.94);
  --stroke: rgba(180, 190, 205, 0.08);
  --stroke-strong: rgba(148, 163, 184, 0.18);
  --text: #e8eaef;
  --text-dim: #9ca3af;
  --text-faint: #6b7280;
  --accent: #94a3b8;
  --accent-rgb: 148, 163, 184;
  --accent-2: #cbd5e1;
  --accent-deep: #374151;
  --gold: #cbd5e1;
  --gold-rgb: 203, 213, 225;
  --glow: rgba(148, 163, 184, 0.16);
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.55);
  --panel: rgba(8, 8, 10, 0.65);
  --panel-strong: rgba(6, 6, 8, 0.88);
  --overlay-bg: rgba(2, 2, 4, 0.65);
  --input-bg: rgba(255, 255, 255, 0.04);
  --chrome-bg: rgba(8, 8, 10, 0.84);
  --ambient-a: #181820;
  --ambient-b: #0c0c10;
  --ambient-vignette: rgba(0, 0, 0, 0.62);
  --ambient-opacity: 0.1;
  --orb-spin: 0.85;
  --orb-breathe: 2;
  --orb-ring-ms: 3.2s;
}

[data-theme='blood-ember'] {
  --bg-0: #070304;
  --bg-1: #120608;
  --bg-2: #1c0a0e;
  --surface: rgba(28, 10, 14, 0.7);
  --surface-strong: rgba(16, 6, 8, 0.94);
  --stroke: rgba(255, 140, 110, 0.1);
  --stroke-strong: rgba(255, 77, 61, 0.28);
  --text: #f5e6e2;
  --text-dim: #c49a90;
  --text-faint: #7a524c;
  --accent: #ff4d3d;
  --accent-rgb: 255, 77, 61;
  --accent-2: #ffb347;
  --accent-deep: #6a1218;
  --gold: #ff8a4a;
  --gold-rgb: 255, 138, 74;
  --glow: rgba(255, 77, 61, 0.24);
  --danger: #ff4d3d;
  --danger-rgb: 255, 77, 61;
  --warn: #ffb347;
  --ok: #ff8a4a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.58);
  --panel: rgba(18, 8, 10, 0.66);
  --panel-strong: rgba(12, 4, 6, 0.9);
  --overlay-bg: rgba(6, 1, 2, 0.68);
  --input-bg: rgba(0, 0, 0, 0.36);
  --chrome-bg: rgba(14, 6, 8, 0.86);
  --ambient-a: #5a1018;
  --ambient-b: #1a080c;
  --ambient-vignette: rgba(0, 0, 0, 0.64);
  --ambient-opacity: 0.22;
  --orb-spin: 1.55;
  --orb-breathe: 4.2;
  --orb-ring-ms: 1.7s;
}

[data-theme='toxic-void'] {
  --bg-0: #030605;
  --bg-1: #07110a;
  --bg-2: #0c1a10;
  --surface: rgba(8, 24, 14, 0.68);
  --surface-strong: rgba(4, 14, 8, 0.94);
  --stroke: rgba(120, 255, 140, 0.1);
  --stroke-strong: rgba(57, 255, 20, 0.28);
  --text: #e4f8e8;
  --text-dim: #8fbf98;
  --text-faint: #4f7a58;
  --accent: #39ff14;
  --accent-rgb: 57, 255, 20;
  --accent-2: #c8ff4a;
  --accent-deep: #146028;
  --gold: #9dff5a;
  --gold-rgb: 157, 255, 90;
  --glow: rgba(57, 255, 20, 0.2);
  --danger: #ff5a6a;
  --danger-rgb: 255, 90, 106;
  --warn: #c8ff4a;
  --ok: #39ff14;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.58);
  --panel: rgba(6, 16, 10, 0.66);
  --panel-strong: rgba(4, 12, 8, 0.9);
  --overlay-bg: rgba(1, 6, 3, 0.68);
  --input-bg: rgba(0, 0, 0, 0.34);
  --chrome-bg: rgba(5, 14, 9, 0.86);
  --ambient-a: #123a18;
  --ambient-b: #08140c;
  --ambient-vignette: rgba(0, 0, 0, 0.62);
  --ambient-opacity: 0.2;
  --orb-spin: 1.7;
  --orb-breathe: 3.6;
  --orb-ring-ms: 1.8s;
}

[data-theme='arctic-blade'] {
  --bg-0: #04090f;
  --bg-1: #08131c;
  --bg-2: #0e1c28;
  --surface: rgba(10, 24, 36, 0.68);
  --surface-strong: rgba(6, 16, 24, 0.94);
  --stroke: rgba(140, 220, 255, 0.1);
  --stroke-strong: rgba(94, 231, 255, 0.28);
  --text: #e6f4fa;
  --text-dim: #8fb4c4;
  --text-faint: #557888;
  --accent: #5ee7ff;
  --accent-rgb: 94, 231, 255;
  --accent-2: #b8e8ff;
  --accent-deep: #145a70;
  --gold: #9adfff;
  --gold-rgb: 154, 223, 255;
  --glow: rgba(94, 231, 255, 0.2);
  --danger: #ff6b7a;
  --danger-rgb: 255, 107, 122;
  --warn: #b8e8ff;
  --ok: #5ee7ff;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  --panel: rgba(8, 18, 26, 0.64);
  --panel-strong: rgba(6, 14, 20, 0.9);
  --overlay-bg: rgba(2, 8, 14, 0.66);
  --input-bg: rgba(0, 0, 0, 0.32);
  --chrome-bg: rgba(7, 16, 24, 0.86);
  --ambient-a: #143848;
  --ambient-b: #0a1822;
  --ambient-vignette: rgba(0, 0, 0, 0.58);
  --ambient-opacity: 0.18;
  --orb-spin: 1.35;
  --orb-breathe: 3;
  --orb-ring-ms: 2s;
}

[data-theme='copper-wraith'] {
  --bg-0: #080604;
  --bg-1: #12100c;
  --bg-2: #1a1610;
  --surface: rgba(24, 20, 14, 0.7);
  --surface-strong: rgba(14, 12, 8, 0.94);
  --stroke: rgba(220, 170, 110, 0.1);
  --stroke-strong: rgba(217, 137, 75, 0.28);
  --text: #efe4d6;
  --text-dim: #b8a48c;
  --text-faint: #746454;
  --accent: #d9894b;
  --accent-rgb: 217, 137, 75;
  --accent-2: #e0b060;
  --accent-deep: #5c3818;
  --gold: #e0b060;
  --gold-rgb: 224, 176, 96;
  --glow: rgba(217, 137, 75, 0.22);
  --danger: #e07060;
  --danger-rgb: 224, 112, 96;
  --warn: #e0b060;
  --ok: #d9894b;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.56);
  --panel: rgba(16, 14, 10, 0.66);
  --panel-strong: rgba(12, 10, 8, 0.9);
  --overlay-bg: rgba(6, 4, 2, 0.66);
  --input-bg: rgba(0, 0, 0, 0.34);
  --chrome-bg: rgba(14, 12, 9, 0.86);
  --ambient-a: #3a2814;
  --ambient-b: #16120c;
  --ambient-vignette: rgba(0, 0, 0, 0.6);
  --ambient-opacity: 0.2;
  --orb-spin: 1.05;
  --orb-breathe: 2.4;
  --orb-ring-ms: 2.6s;
}

[data-theme='neon-noir'] {
  --bg-0: #05040a;
  --bg-1: #0c0a14;
  --bg-2: #14101e;
  --surface: rgba(18, 12, 28, 0.7);
  --surface-strong: rgba(10, 8, 18, 0.94);
  --stroke: rgba(255, 80, 180, 0.12);
  --stroke-strong: rgba(255, 45, 149, 0.3);
  --text: #f2eaf8;
  --text-dim: #b49ec4;
  --text-faint: #6e5a80;
  --accent: #ff2d95;
  --accent-rgb: 255, 45, 149;
  --accent-2: #2de2ff;
  --accent-deep: #5a1040;
  --gold: #2de2ff;
  --gold-rgb: 45, 226, 255;
  --glow: rgba(255, 45, 149, 0.24);
  --danger: #ff4d7a;
  --danger-rgb: 255, 77, 122;
  --warn: #ffe066;
  --ok: #3dffb0;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
  --panel: rgba(12, 10, 20, 0.68);
  --panel-strong: rgba(8, 6, 14, 0.92);
  --overlay-bg: rgba(4, 2, 10, 0.7);
  --input-bg: rgba(0, 0, 0, 0.36);
  --chrome-bg: rgba(10, 8, 16, 0.88);
  --ambient-a: #4a1838;
  --ambient-b: #102838;
  --ambient-vignette: rgba(0, 0, 0, 0.64);
  --ambient-opacity: 0.24;
  --orb-spin: 1.85;
  --orb-breathe: 4;
  --orb-ring-ms: 1.55s;
}

[data-theme='light'] {
  --bg-0: #eef1f6;
  --bg-1: #f5f7fa;
  --bg-2: #e3e9f0;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --stroke: rgba(20, 32, 48, 0.09);
  --stroke-strong: rgba(46, 90, 138, 0.18);
  --text: #152030;
  --text-dim: #5c6b7f;
  --text-faint: #8a97a8;
  --accent: #2e5a8a;
  --accent-rgb: 46, 90, 138;
  --accent-2: #8a7344;
  --accent-deep: #1e3d5c;
  --gold: #9a7e4a;
  --gold-rgb: 154, 126, 74;
  --glow: rgba(46, 90, 138, 0.16);
  --danger: #dc2626;
  --danger-rgb: 220, 38, 38;
  --warn: #9a7340;
  --ok: #2e5a8a;
  --shadow: 0 18px 48px rgba(16, 32, 56, 0.1);
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --overlay-bg: rgba(16, 24, 40, 0.26);
  --input-bg: rgba(255, 255, 255, 0.92);
  --chrome-bg: rgba(255, 255, 255, 0.92);
  --ambient-a: #c8d8ec;
  --ambient-b: #dde6f2;
  --ambient-vignette: rgba(180, 192, 210, 0.35);
  --ambient-opacity: 0.42;
  --orb-spin: 0.9;
  --orb-breathe: 2.2;
  --orb-ring-ms: 2.6s;
}

[data-theme='light'] .nav-item:hover {
  background: rgba(20, 32, 48, 0.04);
}

[data-theme='light'] .session-tab,
[data-theme='light'] .circle-btn,
[data-theme='light'] .session-new {
  background: var(--session-tab-bg, rgba(255, 255, 255, 0.72));
}

[data-theme='light'] .canvas-shell {
  background:
    var(--shell-canvas-image, none),
    var(--shell-canvas-bg, linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 250, 252, 0.92)));
  box-shadow: var(--canvas-shell-shadow, 0 16px 40px rgba(16, 32, 56, 0.08));
}

[data-theme='light'] .canvas-wrap {
  background: transparent;
  box-shadow: none;
}

[data-theme='light'] .widget-frame {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 32px rgba(16, 32, 56, 0.08);
}

[data-theme='light'] .browser-pill-close:hover {
  background: rgba(20, 32, 48, 0.12);
}

[data-theme='light'] .hold-btn {
  color: #f5f7fa;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

@media (max-width: 720px) {
  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.theme-card:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  transform: translateY(-1px);
}

.theme-card.active {
  border-color: rgba(var(--accent-rgb), 0.52);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.theme-swatches {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.7fr;
  gap: 4px;
  height: 34px;
}

.theme-swatches span {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-card strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.theme-card small {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-dim);
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.provider-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.provider-card:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  transform: translateY(-1px);
}

.provider-card.active {
  border-color: rgba(var(--accent-rgb), 0.52);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.provider-card-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.provider-card-icon .provider-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.provider-card strong {
  font-size: 13px;
  color: var(--text);
}

.provider-card small {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-dim);
}

.settings-fold {
  margin: 0 0 16px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.settings-fold-summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.settings-fold-summary::-webkit-details-marker {
  display: none;
}

.settings-fold-summary span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settings-fold-summary strong {
  font-size: 14px;
  color: var(--text);
}

.settings-fold-summary small {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
}

.settings-fold-chevron {
  margin-top: 3px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.18s ease;
}

.settings-fold[open] .settings-fold-chevron {
  transform: rotate(180deg);
}

.settings-fold-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--stroke);
}

.agent-cli-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.agent-cli-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--surface);
}

.agent-cli-card.is-installed {
  border-color: rgba(var(--accent-rgb), 0.28);
}

.agent-cli-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.agent-cli-logo {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.agent-cli-meta {
  flex: 1;
  min-width: 0;
}

.agent-cli-meta strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.agent-cli-meta p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.35;
}

.agent-cli-badge {
  flex-shrink: 0;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--text-dim);
  white-space: nowrap;
}

.agent-cli-badge.on {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.12);
}

.agent-cli-hint {
  margin: 10px 0 12px;
}

.agent-cli-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.field-head label {
  margin: 0;
}

.linkish-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.linkish-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

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

.inline-field-row input {
  flex: 1;
}

.provider-actions {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
}

.provider-actions .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-ok {
  color: #7dcea0;
}

.status-bad {
  color: #ff8a96;
}

.notes-settings {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.notes-settings-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notes-settings-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.linkish-btn.inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: baseline;
}

.notes-count-line {
  margin: 0;
}

.notes-empty {
  display: grid;
  gap: 8px;
  place-items: start;
  padding: 22px 18px;
  border-radius: 16px;
  border: 1px dashed var(--stroke);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
}

.notes-empty-error {
  border-style: solid;
  border-color: rgba(255, 138, 150, 0.28);
}

.notes-panel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notes-panel {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 42%),
    var(--surface);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.notes-panel.is-open {
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.08);
}

.notes-panel-summary {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 4px 8px 4px 4px;
}

.notes-panel-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.notes-panel-chevron {
  margin-top: 4px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: transform 0.18s ease;
}

.notes-panel.is-open .notes-panel-chevron {
  transform: rotate(180deg);
}

.notes-panel-heading {
  min-width: 0;
}

.notes-panel-title {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-panel-sub {
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
}

.notes-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.notes-pill-summary {
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.12);
}

.notes-pill-transcript {
  opacity: 0.9;
}

.notes-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 10px 0;
  flex-shrink: 0;
}

.notes-delete-btn {
  color: #ff8a96 !important;
}

.notes-panel-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--stroke);
}

.notes-section {
  padding-top: 12px;
}

.notes-section-follow {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.notes-section-label {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.notes-transcript-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes-view-block {
  display: grid;
  gap: 8px;
}

.notes-view-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.notes-kind-label {
  font-weight: 600;
  color: var(--text);
}

.notes-date-muted {
  opacity: 0.7;
}

.notes-body-pre {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
}

.notes-edit-form {
  display: grid;
  gap: 4px;
}

.notes-editor {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.notes-confirm-backdrop {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 10, 14, 0.72);
  backdrop-filter: blur(6px);
}

.notes-confirm-backdrop.is-fixed {
  position: fixed;
  z-index: 80;
}

.notes-confirm-dialog {
  position: relative;
  width: min(100%, 360px);
  padding: 18px 16px 16px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.notes-confirm-dialog h4 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--text);
}

.notes-confirm-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.notes-confirm-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* --- Vibe Agent activity dropdowns (thinking + tools) --- */
.agent-activity {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0 8px;
}

.agent-turn-details {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.agent-turn-details summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.agent-turn-details summary::-webkit-details-marker {
  display: none;
}

.agent-turn-details summary:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.07);
}

.agent-turn-details[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.agent-chevron {
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.agent-turn-details[open] .agent-chevron {
  transform: rotate(180deg);
}

.agent-spark {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.agent-live-status {
  margin-left: auto;
  font-style: normal;
  font-weight: 500;
  font-size: 10px;
  color: var(--accent);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

.agent-thinking-list {
  margin: 0;
  padding: 6px 12px 8px 26px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--text-faint);
}

.agent-thinking-list li {
  list-style: disc;
}

.agent-tool-list {
  margin: 0;
  padding: 6px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.agent-tool-item {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.agent-tool-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-dim);
}

.agent-tool-item.failed .agent-tool-name {
  color: var(--danger, #f87171);
}

.agent-tool-name code {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 5px;
  padding: 1px 5px;
}

.agent-tool-args {
  margin: 0 0 0 16px;
  padding: 4px 7px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-faint);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 110px;
  overflow: auto;
}

.widgets-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.widgets-settings-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--surface);
}

.widgets-settings-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.widgets-settings-card-top strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.widgets-settings-card-top em {
  flex-shrink: 0;
  font-style: normal;
  font-size: 11px;
  color: var(--text-dim);
}

.widgets-settings-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.widgets-settings-kind {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.widgets-settings-kind.is-builtin {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.widgets-settings-kind.is-saved-page {
  background: rgba(var(--accent-rgb), 0.14);
  color: rgb(var(--accent-rgb));
}

.widgets-settings-kind.is-marketplace {
  background: rgba(127, 178, 255, 0.14);
  color: #9ec4ff;
}

.widgets-settings-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
}

.widgets-settings-locked {
  font-size: 11px;
  color: var(--text-faint);
}