/* ibm-plex-sans-latin-400-normal */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(3160b5c6767eb4c69c78.woff2) format('woff2'), url(65b2eda743bf11103476.woff) format('woff');
}
/* ibm-plex-sans-latin-ext-400-normal */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(11781b13e59d30facc40.woff2) format('woff2'), url(24d83b525f192cb3d1ca.woff) format('woff');
}
/* ibm-plex-sans-latin-500-normal */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(fcd7b8c3d12375eedc97.woff2) format('woff2'), url(4b130dfcfa945eac3e54.woff) format('woff');
}
/* ibm-plex-sans-latin-ext-500-normal */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(d8f3e27fbeccd900a867.woff2) format('woff2'), url(7e8aef37b06800e20ef5.woff) format('woff');
}
/* ibm-plex-sans-latin-600-normal */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(24bc59b4b4ad02d1666d.woff2) format('woff2'), url(d73e2e25bcd162ae992f.woff) format('woff');
}
/* ibm-plex-sans-latin-ext-600-normal */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(57f2c00df3cb0b0cff43.woff2) format('woff2'), url(5051947b55c2e3d31cc2.woff) format('woff');
}
/* jetbrains-mono-latin-400-normal */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(d04352f240062b100fba.woff2) format('woff2'), url(1fef352a4021940e309a.woff) format('woff');
}
/* jetbrains-mono-latin-ext-400-normal */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(e83b764e84e73968db26.woff2) format('woff2'), url(dfdc51c009ca3dea7613.woff) format('woff');
}
:root {
  color-scheme: dark;
  --surface-canvas: #1b1b1b;
  --surface-workspace-content: #1e1e1e;
  --surface-sidebar: #202020;
  --surface-panel: #242424;
  --surface-raised: #292929;
  --surface-overlay: #2e2e2e;
  --text-primary: #dedede;
  --text-secondary: #a3a3a3;
  --text-tertiary: #787878;
  --border-subtle: #363636;
  --border-strong: #4a4a4a;
  --accent-primary: #2784c7;
  --accent-hover: #3492d4;
  --state-success: #58a86d;
  --state-warning: #d0a24f;
  --state-danger: #e2767f;
  --state-info: #65a3d8;
  --focus-ring-color: color-mix(in srgb, var(--accent-primary) 72%, white);
  --shadow-floating: 0 8px 24px rgb(0 0 0 / 22%);
  --shadow-overlay: 0 16px 40px rgb(0 0 0 / 34%);
  --layer-workspace-chrome: 6;
  --layer-workspace-modal: 1000;
  --radius-control: 6px;
  --radius-panel: 10px;
  --radius-floating: 12px;
  --motion-fast: 140ms;
  --motion-standard: 200ms;
  --motion-emphasized: 280ms;
  --motion-exit: 180ms;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --border-faint: #2b2b2b;
  --surface-active: rgb(255 255 255 / 9%);
  --accent-soft-bg: color-mix(in srgb, var(--accent-primary) 16%, transparent);
  --sl-icon-size: 14px;

  --bg: var(--surface-canvas);
  --panel: var(--surface-sidebar);
  --panel-2: var(--surface-raised);
  --panel-3: var(--surface-panel);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --border: var(--border-subtle);
  --accent: var(--accent-primary);
  --hover: rgb(255 255 255 / 6%);
  --soft-shadow: var(--shadow-floating);
  --danger: var(--state-danger);
  --line-num: var(--text-tertiary);
  --chat-message-text: #d4d4d4;
  --chat-link-text: #82b6df;
  --chat-inline-code-background: #303030;
  --chat-inline-code-text: #dddddd;
  --chat-capsule-skill-text: color-mix(in srgb, var(--accent-primary) 62%, var(--text-primary));
  --chat-capsule-skill-bg: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  --chat-capsule-goal-text: color-mix(in srgb, var(--state-success) 68%, var(--text-primary));
  --chat-capsule-goal-bg: color-mix(in srgb, var(--state-success) 13%, transparent);
  --wm-safe-area-top: env(safe-area-inset-top, 0px);
  --wm-safe-area-right: env(safe-area-inset-right, 0px);
  --wm-safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --mobile-floating-control-lane: 60px;
  /* Shared workbench chrome geometry. */
  --workbench-titlebar-height: 36px;
  --workbench-tabbar-height: 34px;
  --workbench-control-height: 28px;
  /* Title bar height; consumed by fixed overlays mounted outside .workspace. */
  --chat-menu-header-height: 32px;
}

.theme-light {
  color-scheme: light;
  --surface-canvas: #f3f3f3;
  --surface-workspace-content: #ffffff;
  --surface-sidebar: #f7f7f7;
  --surface-panel: #fafafa;
  --surface-raised: #f0f0f0;
  --surface-overlay: #ffffff;
  --text-primary: #242424;
  --text-secondary: #6f6f6f;
  --text-tertiary: #8a8a8a;
  --border-subtle: #dedede;
  --border-strong: #c2c2c2;
  --accent-primary: #1478ba;
  --accent-hover: #0d6ca9;
  --state-success: #347d4b;
  --state-warning: #9b6a13;
  --state-danger: #c93c48;
  --state-info: #367fab;
  --focus-ring-color: color-mix(in srgb, var(--accent-primary) 78%, black);
  --shadow-floating: 0 8px 24px rgb(0 0 0 / 12%);
  --shadow-overlay: 0 16px 40px rgb(0 0 0 / 18%);
  --radius-control: 6px;
  --radius-panel: 10px;
  --radius-floating: 12px;
  --motion-fast: 140ms;
  --motion-standard: 200ms;
  --motion-emphasized: 280ms;
  --motion-exit: 180ms;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --border-faint: #e4e4e4;
  --surface-active: rgb(21 31 43 / 10%);
  --accent-soft-bg: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  --sl-icon-size: 14px;

  --bg: var(--surface-canvas);
  --panel: var(--surface-sidebar);
  --panel-2: var(--surface-raised);
  --panel-3: var(--surface-panel);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --border: var(--border-subtle);
  --accent: var(--accent-primary);
  --hover: rgb(21 31 43 / 6%);
  --soft-shadow: var(--shadow-floating);
  --danger: var(--state-danger);
  --line-num: var(--text-tertiary);
  --chat-message-text: #2b2b2b;
  --chat-link-text: #1478ba;
  --chat-inline-code-background: #ececec;
  --chat-inline-code-text: #303030;
}



* {
  box-sizing: border-box;
}

button,
[role='button'],
[role='menuitemradio'],
[role='option'] {
  -webkit-tap-highlight-color: transparent;
}

:where(
  button,
  select,
  [role='button'],
  [role='menuitem'],
  [role='menuitemradio'],
  [role='option'],
  [tabindex]
):focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 2px;
}

html,
body,
#root {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--surface-canvas);
  color: var(--text-primary);
  font-family: 'IBM Plex Sans', 'Noto Sans', sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

/* The frameless exe window has no OS border; paint a 1px edge ring so the app
   boundary stays visible against a matching desktop background. Desktop host
   in light mode only: browsers provide their own chrome and the dark theme
   already separates from the desktop. */
html.wm-desktop-host.theme-light body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.page {
  display: flex;
  flex-direction: column;
}

.connect {
  margin: auto;
  width: min(480px, calc(100vw - 32px));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-floating);
  background: var(--surface-panel);
  box-shadow: var(--shadow-floating);
  padding: 24px;
}

.connect h3 {
  margin: 0 0 14px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.input {
  width: 100%;
  min-height: 36px;
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-canvas);
  color: var(--text-primary);
  padding: 8px 10px;
  font: inherit;
  outline: none;
  transition: border-color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}

.input:hover {
  border-color: var(--border-strong);
}

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

.button {
  margin-top: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--accent-primary);
  color: #fff;
  padding: 8px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  transition: background var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), opacity var(--motion-fast) var(--ease-standard);
}

.button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.button:active:not(:disabled) {
  filter: brightness(0.94);
}

.button:disabled {
  cursor: default;
  opacity: 0.55;
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.button.secondary:hover {
  background: var(--hover);
  border-color: var(--text-secondary);
  opacity: 1;
}

.error {
  color: var(--state-danger);
  margin-top: 10px;
}

@media (max-width: 520px) {
  .connect {
    width: calc(100vw - 24px);
    padding: 18px;
  }
}

@keyframes floatingDockRailPulse {
  0% {
    opacity: 1;
    transform: scaleY(0.96);
    box-shadow: 0 0 0 color-mix(in srgb, var(--accent-primary) 0%, transparent);
  }
  100% {
    opacity: 0.78;
    transform: scaleY(1);
    box-shadow: 0 0 24px color-mix(in srgb, var(--accent-primary) 44%, transparent);
  }
}

.section-title {
  height: 30px;
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  padding: 0 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex: 0 0 auto;
}

.list {
  overflow: auto;
  min-height: 0;
}

.archived-session-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.archived-session-cancel {
  flex: 0 0 auto;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, transparent);
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  padding: 0 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.archived-session-cancel:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.archived-session-row-wrap {
  z-index: 0;
}

.archived-session-row-wrap.selected {
  z-index: 2;
}

.archived-session-restore-popover {
  position: absolute;
  top: 28px;
  right: 4px;
  z-index: 8;
  width: 142px;
}

.archived-session-empty {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.archived-session-error-list {
  margin-bottom: 8px;
}

.app-rename-dialog {
  width: min(460px, calc(100vw - 28px));
}

.app-rename-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  margin-top: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--text-primary);
  background: var(--surface-panel);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.app-rename-input:focus {
  border-color: color-mix(in srgb, #8a63d2 58%, var(--border-subtle));
  box-shadow: 0 0 0 2px color-mix(in srgb, #8a63d2 18%, transparent);
}

.app-html-export-name-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 10px;
}

.app-html-export-name-input {
  margin-top: 0;
  border-radius: 7px 0 0 7px;
}

.app-html-export-name-suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  border-left: 0;
  border-radius: 0 7px 7px 0;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  user-select: none;
}

.label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.caret {
  width: 16px;
  flex: 0 0 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.node-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  object-fit: contain;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.seti-glyph {
  font-family: 'wm-seti', monospace;
  font-size: 15px;
  line-height: 1;
}

.node-icon.sl-icon {
  color: #dcb67a;
}

.block,
.muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.block {
  padding: 10px;
}

.scroll-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior-x: contain;
}

.empty-card {
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface-panel);
  padding: 14px;
  max-width: 560px;
}

.empty-title {
  font-size: 13px;
  font-weight: 700;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.4);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

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

@keyframes wmFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes wmSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Shared hover tooltip (GlobalTooltip in web/src/common/Tooltip). Transient-layer
   material per docs/wiki/frontend-interaction/visual-language.md: smoked surface-overlay,
   6px radius, 11px text, motion tokens with reduced-motion fallback. */
.sl-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 260px;
  padding: 5px 9px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-overlay) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid var(--border-faint);
  box-shadow: var(--shadow-floating);
  color: var(--text-primary);
  font-size: 11px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px) scale(0.98);
  transition:
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.sl-tooltip.visible {
  opacity: 1;
  transform: none;
}

.sl-tooltip[data-placement='bottom']:not(.visible) {
  transform: translateY(-2px) scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  .sl-tooltip {
    transition: none;
    transform: none;
  }
}

@media (prefers-reduced-transparency) {
  .sl-tooltip {
    background: var(--surface-overlay);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}



.page,
.workspace {
  --desktop-window-controls-width: 138px;
  --desktop-top-surface: color-mix(in srgb, var(--surface-sidebar) 62%, var(--surface-panel));
  --chat-session-panel-width: 360px;
  --chat-header-end-padding: 12px;
  --chat-header-trigger-end-padding: 6px;
  --chat-menu-header-gap: 6px;
  --chat-menu-icon-button-size: 30px;
  --chat-menu-icon-button-radius: 6px;
  width: 100%;
  height: 100%;
  background: var(--surface-canvas);
  color: var(--text-primary);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.page.theme-light,
.workspace.theme-light {
  --desktop-top-surface: var(--surface-workspace-content);
}

.workspace {
  display: flex;
  flex-direction: column;
  animation: wmFadeIn var(--motion-standard) var(--ease-out);
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--wm-safe-area-bottom));
  transform: translateX(-50%);
  z-index: 240;
  max-width: min(420px, calc(100vw - 32px));
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 86%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-panel) 94%, var(--surface-canvas));
  color: var(--text-primary);
  box-shadow: 0 12px 28px color-mix(in srgb, #000 22%, transparent);
  font-size: 12px;
  line-height: 1.35;
  -webkit-user-select: text;
  user-select: text;
  animation: app-toast-in var(--motion-standard) var(--ease-out) both;
}

.app-toast.app-toast-exit {
  animation: app-toast-out var(--motion-fast) var(--ease-standard) both;
}

.app-retry-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--wm-safe-area-bottom));
  z-index: 241;
  width: max-content;
  max-width: min(520px, calc(100vw - 32px));
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px 6px 12px;
  transform: translateX(-50%);
  border: 1px solid color-mix(in srgb, var(--danger, #df6674) 45%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-panel) 96%, var(--surface-canvas));
  color: var(--text-primary);
  box-shadow: 0 12px 28px color-mix(in srgb, #000 22%, transparent);
  font-size: 12px;
  line-height: 1.35;
  animation: app-toast-in var(--motion-standard) var(--ease-out) both;
}

/* Keep the retry notice clear of a simultaneous status toast. */
.app-retry-toast:has(~ .app-toast) {
  bottom: calc(72px + var(--wm-safe-area-bottom));
}

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

@keyframes app-toast-out {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-toast,
  .app-retry-toast,
  .app-toast.app-toast-exit {
    animation: none;
  }
}

.app-retry-toast-message {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  -webkit-user-select: text;
  user-select: text;
}

.app-retry-toast button {
  appearance: none;
  flex: 0 0 auto;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.app-retry-toast button:hover,
.app-retry-toast button:focus-visible {
  background: var(--hover);
  color: var(--text-primary);
}

.desktop-window-controls {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 80;
  width: var(--desktop-window-controls-width);
  height: 32px;
  display: inline-flex;
  align-items: stretch;
  justify-content: flex-end;
  color: var(--text-primary);
  background: var(--desktop-top-surface);
  border-left: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.desktop-titlebar-button {
  width: 46px;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--text-primary) 78%, var(--text-secondary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 0;
  transition: background-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}

.desktop-titlebar-button:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.desktop-titlebar-close:hover {
  background: #c42b1c;
  color: #ffffff;
}

.desktop-titlebar-button .sl-icon {
  line-height: 1;
}

.desktop-drag-region {
  cursor: default;
}

.chat-menu-icon-button {
  appearance: none;
  width: var(--chat-menu-icon-button-size);
  height: var(--chat-menu-icon-button-size);
  flex: 0 0 var(--chat-menu-icon-button-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--chat-menu-icon-button-radius);
  padding: 0;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.chat-menu-icon-button:focus-visible,
.chat-menu-icon-button[aria-expanded='true'] {
  background: var(--hover);
  color: var(--text-primary);
  outline: none;
}

@media (hover: hover) {
  .chat-menu-icon-button:hover {
    background: var(--hover);
    color: var(--text-primary);
  }
}

.chat-menu-icon-button .sl-icon {
  width: 14px;
  height: 14px;
}

.desktop-shell {
  --desktop-side-surface: var(--desktop-top-surface);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-canvas);
  position: relative;
}

.desktop-shell > .body {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.desktop-primary-workspace {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.desktop-primary-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.desktop-shell[data-inline-preview-maximized='true'] .desktop-primary-workspace {
  flex: 0 0 auto;
}

.desktop-shell[data-inline-preview-maximized='true'] .workspace-right {
  display: none;
}

.floating-control-stack-layer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 71;
}

.floating-control-drag-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: rgba(0, 0, 0, 0.13);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.floating-control-stack-layer[data-drag-state='dragging'] .floating-control-drag-backdrop {
  opacity: 1;
}

.floating-control-dock-rail {
  position: absolute;
  top: calc(var(--wm-safe-area-top) + 14px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 0;
  width: 3px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  background: color-mix(in srgb, var(--accent-primary) 62%, transparent);
  box-shadow: 0 0 0 color-mix(in srgb, var(--accent-primary) 0%, transparent);
  transform: scaleY(0.92);
  transform-origin: center;
  transition: opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}

.floating-control-dock-rail.left {
  left: 0;
}

.floating-control-dock-rail.right {
  right: 0;
}

.floating-control-stack-layer[data-drag-state='dragging'] .floating-control-dock-rail {
  opacity: 0.36;
  transform: scaleY(1);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.floating-control-stack-layer[data-drag-state='dragging'][data-side='left'] .floating-control-dock-rail.left,
.floating-control-stack-layer[data-drag-state='dragging'][data-side='right'] .floating-control-dock-rail.right {
  opacity: 0.78;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent-primary) 34%, transparent);
}

.floating-control-stack-layer[data-side-pulse='left'] .floating-control-dock-rail.left,
.floating-control-stack-layer[data-side-pulse='right'] .floating-control-dock-rail.right {
  animation: floatingDockRailPulse var(--motion-fast) var(--ease-out);
}

.floating-control-stack {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: scale var(--motion-fast) var(--ease-standard);
}

.floating-control-stack[data-side='right'] {
  right: calc(env(safe-area-inset-right, 0px) + 6px);
  left: auto;
}

.floating-control-stack[data-side='left'] {
  left: calc(env(safe-area-inset-left, 0px) + 6px);
  right: auto;
}

.floating-control-stack[data-drag-state='dragging'] {
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.28));
  will-change: transform;
}

.floating-nav-button {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-panel) 24%, transparent);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  box-shadow: 0 2px 10px rgb(0 0 0 / 8%);
  color: color-mix(in srgb, var(--accent-primary) 88%, var(--text-primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--motion-standard) var(--ease-standard),
    border-color var(--motion-standard) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.floating-nav-button .sl-icon {
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 40%));
}

.floating-nav-button:active {
  transform: scale(0.96);
}

.floating-nav-expanded-anchor {
  position: relative;
  width: 48px;
  height: 48px;
}

.floating-nav-card {
  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 2px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 65%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-overlay) 72%, transparent);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 10%),
    0 1px 2px rgb(0 0 0 / 8%),
    var(--shadow-floating);
  transform-origin: bottom right;
  animation: floating-nav-card-in var(--motion-standard) var(--ease-out);
}

.floating-control-stack[data-side='left'] .floating-nav-card {
  right: auto;
  left: 0;
  transform-origin: bottom left;
}

@keyframes floating-nav-card-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.floating-nav-card-item {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.floating-nav-card-item:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.floating-nav-card-item:active {
  transform: scale(0.96);
}

.floating-nav-card-item[data-active='true'] {
  background: var(--accent-soft-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-primary) 30%, transparent);
  color: color-mix(in srgb, var(--accent-primary) 88%, var(--text-primary));
}

.floating-nav-card-item:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 1px;
}

.floating-nav-unread-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--state-success);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--surface-panel) 78%, transparent),
    0 0 10px color-mix(in srgb, var(--state-success) 34%, transparent);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .topbar-menu-surface,
  .floating-nav-card,
  .floating-nav-button,
  .floating-nav-card-item,
  .floating-control-drag-backdrop,
  .floating-control-dock-rail,
  .floating-control-stack {
    animation: none;
    transition-property: background, background-color, border-color, color, box-shadow, outline-color, opacity;
  }
}

.chat-preview-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 12px;
  height: 12px;
  /* Buttons resolve font-family from the UA control font (Arial on Windows),
     whose digits ink ~0.8px above the em-box center; 1px top padding optically
     centers the count inside the pill. */
  padding: 1px 3px 0;
  border-radius: 999px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 12px;
  text-align: center;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--surface-panel) 78%, transparent);
  pointer-events: none;
}

.breadcrumb-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
}

.breadcrumb-project-name {
  flex: 0 0 auto;
  max-width: none;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 54%, transparent);
  border-radius: 8px;
  padding: 1px 8px;
  background: color-mix(in srgb, var(--accent-primary) 13%, var(--surface-panel));
  white-space: nowrap;
  font-weight: 700;
  color: color-mix(in srgb, var(--accent-primary) 78%, var(--text-primary));
}

.breadcrumb-current {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-sidebar);
}

.workspace-left .sidebar-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-secondary) 46%, transparent) transparent;
}

.sidebar-title-row {
  position: relative;
  flex: 0 0 var(--chat-menu-header-height);
  min-height: var(--chat-menu-header-height);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-sidebar);
  display: flex;
  align-items: center;
  gap: var(--chat-menu-header-gap);
  padding: 0 8px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.sidebar-title-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-setting-row {
  background: transparent;
}

.sidebar-setting-select {
  max-width: 180px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 80%, transparent);
  border-radius: 6px;
  background: var(--surface-panel);
  color: var(--text-primary);
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
  transition: border-color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}

.sidebar-setting-select:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 50%, var(--border-subtle));
}

.sidebar-setting-select:focus {
  border-color: var(--accent-primary);
}

.body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.workspace-left {
  position: relative;
  flex: 0 0 var(--chat-session-panel-width);
  z-index: var(--layer-workspace-chrome);
  width: var(--chat-session-panel-width);
  min-width: 0;
  max-width: none;
  border-right: 1px solid var(--border-subtle);
  border-color: var(--border-subtle);
  background: var(--surface-sidebar);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  animation: wmSlideInLeft var(--motion-standard) var(--ease-out);
  transition:
    flex-basis var(--motion-emphasized) var(--ease-drawer),
    border-right-color var(--motion-standard) var(--ease-standard);
}

.workspace-left-content {
  position: relative;
  flex: 1 1 auto;
  width: var(--chat-session-panel-width);
  min-width: 0;
  max-width: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-left.is-collapsed {
  flex-basis: 0;
  border-right-color: transparent;
}

.workspace-right {
  flex: 1;
  min-width: 420px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior-x: none;
  background: var(--surface-workspace-content);
  animation: wmFadeIn var(--motion-standard) var(--ease-out);
}

.archived-session-header {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 6px 7px;
}

.app-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(8px);
  animation: app-backdrop-in var(--motion-standard) var(--ease-out) both;
}

@keyframes app-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes app-dialog-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes app-backdrop-out {
  to { opacity: 0; }
}

@keyframes app-dialog-out {
  to {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
}

.app-confirm-dialog {
  width: min(420px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-panel) 96%, var(--surface-raised));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  animation: app-dialog-in var(--motion-standard) var(--ease-out) both;
}

.app-session-status-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-panel) 97%, var(--surface-raised));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  animation: app-dialog-in var(--motion-standard) var(--ease-out) both;
}

.app-confirm-backdrop.app-dialog-exiting {
  animation: app-backdrop-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
}

.app-confirm-dialog.app-dialog-exiting,
.app-session-status-dialog.app-dialog-exiting {
  animation: app-dialog-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .app-confirm-backdrop,
  .app-confirm-backdrop.app-dialog-exiting,
  .app-confirm-dialog,
  .app-confirm-dialog.app-dialog-exiting,
  .app-session-status-dialog,
  .app-session-status-dialog.app-dialog-exiting {
    animation: none;
  }
}

.app-session-status-header,
.app-session-status-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.app-session-status-header {
  border-bottom: 1px solid var(--border-subtle);
}

.app-session-status-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.app-session-status-id {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.app-session-status-id code {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

.app-session-status-id-value {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.app-session-status-copy {
  appearance: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.app-session-status-copy:hover {
  color: var(--text-primary);
  background: var(--hover);
}

.app-session-status-copy:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

.app-session-status-close {
  appearance: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: var(--text-secondary);
}

.app-session-status-close:hover {
  background: var(--surface-raised);
}

.app-session-status-body {
  min-height: 0;
  overflow: auto;
  padding: 4px 16px 16px;
}

.app-session-status-section {
  padding: 13px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
}

.app-session-status-section-title {
  margin-bottom: 9px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-session-status-context-value {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.app-session-status-context-value strong {
  color: var(--text-primary);
  font-size: 17px;
}

.app-session-status-muted,
.app-session-status-loading {
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.4;
}

.app-session-status-loading {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-top: 12px;
}

.app-session-status-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
}

@media (width <= 560px) {
  .app-session-status-dialog {
    max-height: calc(100vh - 20px);
  }
}

.app-confirm-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, #2b6cb0 88%, var(--text-primary));
  background: color-mix(in srgb, #2b6cb0 16%, transparent);
}

.app-confirm-icon.danger {
  color: color-mix(in srgb, var(--state-danger) 88%, var(--text-primary));
  background: color-mix(in srgb, var(--state-danger) 14%, transparent);
}

.app-confirm-icon .sl-icon {
  flex: 0 0 auto;
}

.app-confirm-content {
  min-width: 0;
}

.app-confirm-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.app-confirm-name {
  margin-top: 5px;
  max-width: 100%;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-confirm-copy {
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.app-confirm-error {
  margin-top: 9px;
  color: #fca5a5;
  font-size: 12px;
  line-height: 1.4;
}

.app-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.app-confirm-btn {
  min-height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.app-confirm-btn.secondary {
  color: var(--text-secondary);
  background: var(--surface-raised);
}

.app-confirm-btn.secondary.danger {
  color: #fca5a5;
}

.app-confirm-btn.primary {
  color: #fff;
  border-color: color-mix(in srgb, #2b6cb0 68%, transparent);
  background: color-mix(in srgb, #2b6cb0 86%, #111);
}

.app-confirm-btn.primary.danger {
  border-color: color-mix(in srgb, var(--state-danger) 74%, transparent);
  background: color-mix(in srgb, var(--state-danger) 86%, #111);
}

.app-confirm-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.app-confirm-btn:disabled {
  opacity: 0.72;
  cursor: default;
}

/* Sheet dimmed overlays share .sl-sheet-overlay (sessionlist.css). */

.mobile-project-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 71;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(72vh, 560px);
  padding: 4px 10px calc(var(--wm-safe-area-bottom) + 14px);
  border-top-left-radius: var(--radius-floating);
  border-top-right-radius: var(--radius-floating);
  /* Opaque surface: the sheet sits above a dimmed overlay, where a backdrop
     blur would be invisible. */
  background: var(--surface-panel);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
  border-bottom: 0;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.42);
  animation: mobile-sheet-slide-up var(--motion-emphasized) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .mobile-project-sheet { animation: none; }
}

.mobile-project-sheet-grip {
  align-self: center;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-secondary) 55%, transparent);
  margin: 2px auto 4px;
  touch-action: none;
}

.mobile-project-sheet-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
  touch-action: none;
}

.mobile-project-sheet-icon {
  font-size: 17px;
  color: var(--accent-primary);
}

.mobile-project-sheet-title-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.mobile-project-sheet-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.mobile-project-sheet-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.mobile-project-sheet-close {
  appearance: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-project-sheet-close:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.mobile-project-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 4px;
}

.mobile-project-sheet-item {
  min-height: 44px;
  font-size: 14px;
  border-radius: 8px;
  padding: 0 12px;
  overflow: hidden;
}

.mobile-project-sheet-item .sl-icon {
  flex: 0 0 auto;
}

.mobile-project-sheet-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.mobile-project-sheet-back {
  min-height: 40px;
  font-size: 13px;
  margin-bottom: 4px;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text-secondary);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgb(4 9 16 / 0%);
  opacity: 0;
  pointer-events: none;
  z-index: 43;
  backdrop-filter: blur(0);
  transition: background var(--motion-standard) var(--ease-out), backdrop-filter var(--motion-standard) var(--ease-out);
}

.drawer-overlay.show {
  background: rgb(4 9 16 / 48%);
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(2px);
}

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(440px, calc(100vw - var(--mobile-floating-control-lane) - env(safe-area-inset-right, 0px)));
  border-right: 1px solid var(--border-subtle);
  border-color: var(--border-subtle);
  background: var(--surface-sidebar);
  transform: translateX(-100%);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 50;
  box-shadow: var(--shadow-overlay);
  transition: transform var(--motion-emphasized) var(--ease-out);
}

.drawer .sidebar-scroll {
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-secondary) 46%, transparent) transparent;
}

.narrow-shell[data-floating-control-side='left'] .drawer {
  inset: 0 0 0 auto;
  width: min(440px, calc(100vw - var(--mobile-floating-control-lane) - env(safe-area-inset-left, 0px)));
  border-right: none;
  border-left: 1px solid var(--border-subtle);
  transform: translateX(100%);
}

.drawer.show {
  transform: translateX(0);
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.38);
}

.narrow-shell[data-floating-control-side='left'] .drawer.show {
  transform: translateX(0);
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.38);
}

.narrow-shell .body {
  position: relative;
}

.narrow-shell .workspace-right {
  width: 100%;
  min-width: 0;
}

.connect-titlebar {
  height: 32px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  background: var(--desktop-top-surface);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  -webkit-user-select: none;
  user-select: none;
}

/* Brand launch layer. Always the same deep navy as the Android native splash
   (APP_BACKGROUND_COLOR rgb(11,18,32)) so the native/exe overlay cross-fade is
   seamless; the workspace theme only appears once connected. The layer stays
   mounted across every pre-session state (status, token form, manual connect
   retry) so the sweep never stops mid-flow. */
.app-launch-screen {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1220;
}

.app-launch-screen.exiting {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  animation: wm-launch-exit var(--motion-emphasized) var(--ease-out) forwards;
}

@keyframes wm-launch-exit {
  to {
    opacity: 0;
  }
}

.app-launch-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The desktop connect titlebar eats 32px at the top; compensate so the mark
   sits at the true window center, matching the exe overlay, the Android
   splash, and the exit overlay exactly. */
.has-connect-titlebar .app-launch-mark {
  transform: translateY(-16px);
}

.app-launch-logo {
  position: relative;
  display: block;
}

.app-launch-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 164, 250, 0.26), rgba(46, 164, 250, 0) 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Status text and the token form hang from the mark itself, so the whole
   composition follows the logo wherever it is centered. */
.app-launch-content {
  position: absolute;
  top: calc(100% + 26px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.app-launch-status {
  white-space: nowrap;
  color: rgba(235, 240, 250, 0.66);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.app-launch-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(300px, calc(100vw - 64px));
}

.app-launch-input {
  min-height: 36px;
  border: 1px solid rgba(235, 240, 250, 0.22);
  border-radius: var(--radius-control, 8px);
  background: rgba(235, 240, 250, 0.06);
  color: #f3f6fb;
  padding: 8px 12px;
  font: inherit;
  outline: none;
  transition: border-color var(--motion-fast) var(--ease-standard);
}

.app-launch-input::placeholder {
  color: rgba(235, 240, 250, 0.4);
}

.app-launch-input:hover:not(:disabled) {
  border-color: rgba(235, 240, 250, 0.38);
}

.app-launch-input:focus {
  border-color: #2ea4fa;
}

.app-launch-input:disabled {
  opacity: 0.55;
}

.app-launch-button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius-control, 8px);
  background: var(--accent-primary);
  color: #fff;
  padding: 8px 16px;
  font: inherit;
  cursor: pointer;
  transition: filter var(--motion-fast) var(--ease-standard);
}

.app-launch-button:hover:not(:disabled) {
  filter: brightness(1.1);
}

.app-launch-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.app-launch-error {
  max-width: 320px;
  color: #ff9d94;
  font-size: 12px;
  text-align: center;
}

/* Idle loop: a soft highlight band parallel to the white slash sweeps the
   assembled mark left to right, then rests before the next pass. */
.app-launch-shine {
  transform: translateX(-940px);
  animation: wm-launch-shine-sweep 2.1s var(--ease-standard) 250ms infinite;
}

@keyframes wm-launch-shine-sweep {
  0% {
    transform: translateX(-940px);
  }
  55% {
    transform: translateX(940px);
  }
  100% {
    transform: translateX(940px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-launch-shine {
    animation: none;
    transform: translateX(-940px);
  }

  .app-launch-screen.exiting {
    animation-duration: 0ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .drawer-overlay,
  .workspace-left {
    transition-duration: 0ms;
  }
}

.workspace-right > .content:has(> .chat-title-bar) {
  animation: workspacePageEnter var(--motion-standard) var(--ease-out);
}

.topbar-menu-surface {
  border: 1px solid var(--border-faint);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-overlay) 88%, transparent);
  box-shadow: var(--shadow-overlay);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  padding: 4px;
  transform-origin: var(--popover-origin, top center);
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

.app-menu-root {
  position: relative;
  flex: 0 0 auto;
}

.app-toolbar-root {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.app-menu-trigger {
  position: relative;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.app-menu-trigger:focus-visible,
.app-menu-trigger[aria-expanded='true'] {
  background: var(--hover);
  color: var(--text-primary);
  outline: none;
}

@media (hover: hover) {
  .app-menu-trigger:hover {
    background: var(--hover);
    color: var(--text-primary);
  }
}

.app-toolbar-button {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.app-toolbar-button:hover,
.app-toolbar-button:focus-visible {
  background: var(--hover);
  color: var(--text-primary);
  outline: none;
}

.app-toolbar-button:active,
.app-menu-trigger:active {
  transform: translateY(1px);
}

.app-toolbar-button:disabled {
  color: var(--text-tertiary);
  cursor: default;
  opacity: 0.72;
}

.app-toolbar-button.app-toolbar-version {
  width: auto;
  min-width: 46px;
  flex-basis: auto;
  padding: 0 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.app-toolbar-update-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  box-shadow: 0 0 0 2px var(--surface-panel);
}

.app-product-mark {
  width: 20px;
  height: 20px;
  display: block;
}

.app-menu-trigger .app-product-mark {
  width: 19px;
  height: 19px;
}

.chat-menu-product-button {
  color: var(--text-secondary);
}

.chat-menu-product-button .app-product-mark {
  width: 18px;
  height: 18px;
}

.desktop-update-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--state-danger);
  box-shadow: 0 0 0 2px var(--surface-panel);
}

@keyframes workspacePageEnter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-right > .content:has(> .chat-title-bar) {
    animation: none;
  }

  .workspace-left {
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar-menu-surface {
    background: var(--surface-overlay);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

}

/* ---------- mobile bottom sheets ---------- */
/* App dialogs (confirm / rename / goal edit / session status) present as
   bottom sheets on mobile, matching the session-list sheets in
   sessionlist.css. */
@media (max-width: 900px) {
  .app-confirm-backdrop {
    place-items: end center;
    padding: 0;
  }
  .app-confirm-dialog,
  .app-session-status-dialog {
    width: 100%;
    max-width: none;
    max-height: 85vh;
    border-radius: var(--radius-floating) var(--radius-floating) 0 0;
    border-bottom: 0;
    padding-bottom: calc(var(--wm-safe-area-bottom) + 16px);
    animation: sl-sheet-in var(--motion-standard) var(--ease-out);
  }
  .app-confirm-dialog.app-dialog-exiting,
  .app-session-status-dialog.app-dialog-exiting {
    animation: sl-sheet-out var(--motion-exit) var(--ease-out) forwards;
  }
  .app-confirm-dialog {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .app-confirm-dialog,
  .app-confirm-dialog.app-dialog-exiting,
  .app-session-status-dialog,
  .app-session-status-dialog.app-dialog-exiting {
    animation: none;
  }
}



input,
textarea,
[contenteditable='true'],
[contenteditable='true'] *,
.chat-main-message,
.chat-main-message *,
.chat-prompt-user,
.chat-prompt-user *,
.wm-shiki-line-content,
.wm-shiki-line-content * {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

[data-context-menu-target='true'],
[data-context-menu-target='true'] *,
[data-context-menu-action='true'],
[data-context-menu-action='true'] *,
[data-context-menu-surface='true'],
[data-context-menu-surface='true'] * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.mobile-settings-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  min-width: 0;
  min-height: 0;
  background: var(--surface-canvas);
  color: var(--text-primary);
}

.mobile-settings-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-color: var(--border-subtle);
  background: var(--surface-panel);
  color: var(--text-primary);
}

.settings-screen-panel-row {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.mobile-settings-nav {
  flex: 0 0 auto;
  position: relative;
  height: calc(var(--wm-safe-area-top) + 52px);
  min-height: calc(var(--wm-safe-area-top) + 52px);
  display: grid;
  grid-template-columns: auto minmax(0, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: var(--wm-safe-area-top) 12px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
  background: color-mix(in srgb, var(--surface-panel) 90%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mobile-settings-back {
  appearance: none;
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  -webkit-tap-highlight-color: transparent;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.mobile-settings-back:hover {
  background: var(--hover);
}

.mobile-settings-back:active {
  transform: scale(0.97);
}

.mobile-settings-leading {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.mobile-settings-nav-leading {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.mobile-settings-leading .app-toolbar-root {
  gap: 1px;
}

.mobile-settings-title {
  position: relative;
  z-index: 1;
  justify-self: start;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 700;
}

.mobile-settings-actions {
  position: relative;
  z-index: 1;
  justify-self: end;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.mobile-settings-actions .app-toolbar-root {
  gap: 1px;
}

.mobile-settings-actions .app-toolbar-button {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.mobile-settings-actions .app-toolbar-button.app-toolbar-version {
  width: auto;
  min-width: 46px;
  flex-basis: auto;
}

.mobile-settings-leading .app-toolbar-button {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.mobile-settings-leading .app-menu-trigger {
  width: 44px;
  height: 44px;
}

.settings-mobile-toolbar .app-toolbar-update-dot {
  box-shadow: 0 0 0 2px var(--surface-panel);
}

.mobile-settings-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 0 calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: var(--surface-canvas);
}

.mobile-settings-group {
  overflow: visible;
  background: transparent;
}

.mobile-settings-screen .settings-list {
  overflow: visible;
  gap: 18px;
  padding: 0 10px;
}

.mobile-settings-screen .settings-section-rows {
  border-radius: 12px;
}

.mobile-settings-screen .settings-row {
  min-height: 44px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
}

.mobile-settings-screen .settings-row:hover {
  background: var(--hover);
}

.mobile-settings-screen .sidebar-setting-select {
  max-width: min(48vw, 200px);
  height: 30px;
  border-radius: var(--radius-control);
  font-size: 13px;
  padding: 0 10px;
}

.mobile-settings-screen .settings-detail-page {
  padding: 0 8px 8px;
}

.mobile-settings-screen .settings-detail-body {
  padding: 4px 2px 16px;
  gap: 12px;
}

.mobile-settings-screen .settings-detail-row {
  min-height: 44px;
  font-size: 13px;
}

.mobile-settings-screen.desktop-settings-screen {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.desktop-settings-screen .settings-workbench-panel {
  flex: 0 0 var(--chat-session-panel-width);
  width: var(--chat-session-panel-width);
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface-panel);
  box-shadow: 16px 0 32px color-mix(in srgb, #000 16%, transparent);
  pointer-events: auto;
}

.desktop-settings-screen.settings-main-screen {
  position: absolute;
  inset: 0;
}

.desktop-settings-screen.settings-main-screen .settings-workbench-panel {
  width: var(--chat-session-panel-width);
}

.desktop-settings-screen .settings-screen-panel-row {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  pointer-events: none;
}

.desktop-settings-screen .settings-list {
  width: 100%;
  margin: 0;
}

.desktop-settings-screen .mobile-settings-nav {
  height: 52px;
  min-height: 52px;
  padding: 0 12px;
}

.desktop-settings-screen .mobile-settings-title {
  top: auto;
  max-width: min(460px, calc(100% - 176px));
}

.desktop-settings-screen .mobile-settings-scroll {
  padding: 0;
  background: var(--surface-panel);
}

/* Desktop Settings changes its split geometry as a discrete layout state;
   only the detail content is animated below, so flex reflow cannot outrun it. */
.settings-main-screen.has-detail .settings-workbench-panel {
  flex-basis: 100%;
  width: 100%;
}

.settings-main-screen .mobile-settings-scroll {
  display: flex;
  overflow: hidden;
  padding: 0;
}

.settings-main-screen .mobile-settings-group {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.settings-desktop-split {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.settings-desktop-layout {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-panel);
}

.settings-main-screen .settings-desktop-layout {
  min-width: var(--chat-session-panel-width);
}

.settings-desktop-root {
  flex: 0 0 var(--chat-session-panel-width);
  width: var(--chat-session-panel-width);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.settings-desktop-root-content {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 0 16px;
}

.settings-main-screen.has-detail .settings-desktop-root {
  flex-basis: var(--chat-session-panel-width);
  width: var(--chat-session-panel-width);
}

.settings-desktop-detail-pane {
  flex: 1 1 0;
  min-width: 360px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
  background: color-mix(in srgb, var(--surface-canvas) 55%, var(--surface-panel));
}

.settings-desktop-detail-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
}

.settings-desktop-detail-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
}

.settings-desktop-detail-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.settings-desktop-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-detail-page {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.settings-detail-page-body-only {
  padding: 0;
}

.settings-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.settings-detail-row {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 0;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard);
}

.settings-detail-row:hover {
  background: var(--hover);
}

.settings-metadata-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  border: 0;
}

.settings-metadata-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
  display: grid;
  gap: 7px;
  box-shadow: none;
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    background var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.settings-metadata-card:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 22%, var(--border-subtle));
}

.settings-metadata-line {
  font-size: 11px;
  line-height: 1.25;
}

.settings-metadata-line-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.settings-metadata-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.settings-connection-value {
  overflow-wrap: anywhere;
  color: var(--text-secondary);
}

.agent-package-status {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 80%, transparent);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.settings-detail-action-btn {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, var(--border-subtle));
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--surface-panel));
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 0 9px;
}

.settings-detail-action-btn.danger {
  border-color: color-mix(in srgb, var(--state-danger) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-danger) 10%, var(--surface-panel));
}

.settings-detail-action-btn:hover:not(:disabled) {
  background: var(--hover);
}

.settings-detail-action-btn:disabled {
  cursor: default;
  opacity: 0.56;
}

.settings-skills-empty {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.settings-skills-detail-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 7px;
  margin: 12px 14px 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.settings-skills-detail-status .sl-icon {
  color: var(--accent-primary);
  width: 12px;
  height: 12px;
}

.settings-skills-detail-body {
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  gap: 12px;
  overflow: auto;
  padding: 12px 14px 18px;
}

.settings-skills-detail-section {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.settings-skills-detail-section-title {
  color: color-mix(in srgb, var(--text-primary) 78%, var(--accent-primary));
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.settings-skills-detail-meta {
  display: grid;
  min-width: 0;
  gap: 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: 6px;
  overflow: hidden;
}

.settings-skills-detail-meta-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  gap: 8px;
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 58%, transparent);
  padding: 6px 8px;
}

.settings-skills-detail-meta-row:first-child {
  border-top: 0;
}

.settings-skills-detail-meta-row span:first-child {
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 750;
}

.settings-skills-detail-meta-row span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 10.5px;
}

.skill-detail-markdown {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-panel) 88%, black 6%);
  color: var(--text-primary);
  padding: 12px;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.55;
}

.settings-skills-detail-files {
  display: grid;
  min-width: 0;
  gap: 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: 6px;
  overflow: hidden;
}

.settings-skills-detail-file {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 8px;
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 58%, transparent);
  padding: 6px 8px;
  color: var(--text-secondary);
  font-size: 10.5px;
}

.settings-skills-detail-file:first-child {
  border-top: 0;
}

.settings-skills-detail-file span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
}

.settings-skills-detail-file span:last-child {
  color: var(--text-secondary);
  font-size: 10px;
}

.settings-database-dump {
  margin: 0;
  max-height: min(62vh, 520px);
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-raised) 82%, var(--surface-panel));
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 6%, transparent) inset;
  white-space: pre;
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.5;
}

.settings-database-storage-summary {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.settings-database-storage-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.settings-database-storage-metric,
.settings-database-store-list {
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-raised) 84%, transparent);
}

.settings-database-storage-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
}

.settings-database-storage-label,
.settings-database-storage-note {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.25;
}

.settings-database-storage-metric strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.settings-database-store-list {
  overflow: hidden;
}

.settings-database-store-list-header,
.settings-database-store-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 96px;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  font-size: 12px;
}

.settings-database-store-list-header {
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 80%, transparent);
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
}

.settings-database-store-row + .settings-database-store-row {
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
}

.settings-database-store-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 11px;
}

.settings-database-session-files {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.settings-database-session-files-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-database-session-files-path {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font: 10px/1.35 'JetBrains Mono', Consolas, 'Courier New', monospace;
  overflow-wrap: anywhere;
}

.settings-database-session-files-status {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 11px;
}

.settings-database-session-files-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-database-session-files-metrics > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
}

.settings-database-session-files-metrics strong {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.2;
}

.settings-database-session-files-toggle {
  justify-self: start;
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.settings-database-session-files-toggle:hover {
  text-decoration: underline;
}

.settings-database-session-files-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}

.settings-database-session-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
}

.settings-database-session-file-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-database-session-file-main strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-database-session-file-main span {
  overflow: hidden;
  color: var(--text-secondary);
  font: 10px/1.35 'JetBrains Mono', Consolas, 'Courier New', monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-database-session-file-meta {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 3px;
  color: var(--text-secondary);
  font-size: 10px;
  text-align: right;
}

@media (max-width: 720px) {
  .settings-skills-detail-body {
    padding: 10px 10px calc(env(safe-area-inset-bottom, 0px) + 14px);
  }

  .settings-skills-detail-meta-row {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .settings-database-storage-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-database-store-list-header,
  .settings-database-store-row {
    grid-template-columns: minmax(0, 1fr) 52px 78px;
  }

  .settings-database-session-file-row {
    align-items: flex-start;
  }
}

.settings-list {
  display: grid;
  gap: 14px;
  padding: 0 8px 20px;
}

.settings-section {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-transform: none;
}

.settings-section-title::after {
  content: '';
  flex: 1 1 auto;
  display: block;
  height: 1px;
  background: color-mix(in srgb, var(--border-subtle) 55%, transparent);
}

.settings-row {
  position: relative;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 0 8px;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  border-bottom: 0;
  transition: background var(--motion-fast) var(--ease-standard);
}

.settings-row > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.settings-row-icon {
  flex: 0 0 auto;
  width: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  opacity: 0.85;
  transition:
    color var(--motion-fast) var(--ease-standard),
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row:hover .settings-row-icon {
  color: var(--accent-primary);
  opacity: 1;
}

.settings-detail-row:hover .settings-row-chevron {
  color: var(--accent-primary);
}

.settings-danger-row {
  color: var(--state-danger);
  cursor: pointer;
  font-weight: 600;
}

.settings-danger-row .settings-row-icon {
  color: color-mix(in srgb, var(--state-danger) 75%, var(--text-secondary));
}

.settings-danger-row:hover {
  background: color-mix(in srgb, var(--state-danger) 10%, transparent);
  box-shadow: inset 2px 0 0 var(--state-danger);
}

.settings-danger-row:hover .settings-row-icon {
  color: var(--state-danger);
  opacity: 1;
}

.mobile-settings-content-transition {
  min-width: 0;
  min-height: 100%;
}

/* settings workbench tokens */
.settings-workbench-screen {
  background: var(--surface-canvas);
}

.settings-workbench-panel {
  border-color: var(--border-subtle);
  background: var(--surface-panel);
}

.settings-detail-row:active,
.settings-danger-row:active,
.settings-row-nav-btn:active {
  transform: scale(0.985);
}

.settings-danger-row,
.settings-danger-row .settings-row-icon {
  color: var(--state-danger);
}

.settings-workbench-panel .sidebar-setting-select {
  border-color: var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
}

.settings-workbench-panel .sidebar-setting-select:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 58%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.settings-metadata-card,
.settings-database-storage-metric,
.settings-database-store-list {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  background: color-mix(in srgb, var(--surface-raised) 82%, var(--surface-panel));
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 6%, transparent) inset;
}

/* ============================================================
   Unified settings kit — canonical vocabulary for the four
   settings pages. Solid instrument-panel surfaces, hairline
   borders, ghost controls (accent only on active/selected),
   mono data treatment. Lives last so it is authoritative.
   Panel radius is 8px here on purpose (see visual-language),
   without touching the global --radius-panel token.
   ============================================================ */

.set-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, 'Courier New', monospace;
}

.set-num {
  font-variant-numeric: tabular-nums;
}

/* ---- card / surface ---- */
.set-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: none;
}

.set-card--tight {
  gap: 7px;
  padding: 10px;
}

.set-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.set-card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

.set-card-subtitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 11px;
}

.set-card-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

/* ---- buttons: ghost by default, accent only when active/selected ---- */
.set-btn {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.set-btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text-primary);
}

.set-btn:active:not(:disabled) {
  background: var(--surface-active);
  transform: scale(0.97);
}

.set-btn:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 60%, var(--border-subtle));
  box-shadow: 0 0 0 2px var(--focus-ring-color);
}

.set-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.set-btn .sl-icon {
  flex: none;
}

.set-btn--primary {
  border-color: color-mix(in srgb, var(--accent-primary) 60%, transparent);
  background: var(--accent-soft-bg);
  color: color-mix(in srgb, var(--accent-primary) 30%, var(--text-primary));
  font-weight: 600;
}

.set-btn--primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-primary) 22%, transparent);
  color: var(--text-primary);
}

.set-btn--danger {
  border-color: color-mix(in srgb, var(--state-danger) 45%, var(--border-subtle));
  color: color-mix(in srgb, var(--state-danger) 75%, var(--text-secondary));
}

.set-btn--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--state-danger) 12%, transparent);
  color: var(--state-danger);
}

/* active/selected/running — the only states that earn accent */
.set-btn[aria-pressed='true'] {
  background: var(--accent-soft-bg);
  border-color: color-mix(in srgb, var(--accent-primary) 50%, var(--border-subtle));
  color: color-mix(in srgb, var(--accent-primary) 25%, var(--text-primary));
}

.set-btn--icon {
  min-width: 30px;
  padding: 0;
}

.set-btn--lg {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
}

/* ---- status: one dot + label vocabulary across all pages ---- */
.set-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 550;
  line-height: 1;
}

.set-status::before {
  content: '';
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.set-status.is-ok {
  color: var(--state-success);
}

.set-status.is-running {
  color: var(--accent-primary);
}

.set-status.is-running::before {
  animation: set-status-pulse 1.4s ease-in-out infinite;
}

.set-status.is-warn {
  color: var(--state-warning);
}

.set-status.is-error {
  color: var(--state-danger);
}

.set-status.is-idle {
  color: var(--text-tertiary);
}

@keyframes set-status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .set-status.is-running::before {
    animation: none;
  }
}

/* ---- disclosure: chevron + title + count, expandable body ---- */
.set-disclosure {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.set-disclosure-btn {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 28px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}

.set-disclosure-btn:hover {
  background: var(--hover);
}

.set-disclosure-btn .sl-icon {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  transition: transform var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}

.set-disclosure-btn[aria-expanded='true'] .sl-icon {
  transform: rotate(90deg);
  color: var(--text-secondary);
}

.set-disclosure-body {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding-left: 22px;
}

/* ---- labeled form field ---- */
.set-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.set-field-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 550;
}

.set-field-control,
.set-field input,
.set-field select,
.set-card input:not([type='checkbox']),
.set-card select {
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  transition: border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard);
}

.set-field-control:focus,
.set-field input:focus,
.set-field select:focus,
.set-card input:not([type='checkbox']):focus,
.set-card select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 60%, var(--border-subtle));
  box-shadow: 0 0 0 2px var(--focus-ring-color);
}

/* ---- telemetry key/value row ---- */
.set-kv {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 11.5px;
}

.set-kv-key {
  color: var(--text-tertiary);
}

.set-kv-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
}

.set-kv-value.set-mono {
  font-size: 11px;
}

/* ---- error / notice text ---- */
.set-error {
  color: var(--state-danger);
  font-size: 11.5px;
  line-height: 1.3;
}

.set-muted {
  color: var(--text-secondary);
  font-size: 11.5px;
}

/* ---- settings row / section icon sizing (authoritative) ---- */
.settings-section-title .sl-icon,
.settings-section-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: color-mix(in srgb, var(--accent-primary) 70%, var(--text-secondary));
  transition: color var(--motion-fast) var(--ease-standard);
}

.settings-row-icon,
.settings-row > span:first-child > .sl-icon:first-child {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: color var(--motion-fast) var(--ease-standard);
}

.settings-row:hover .settings-row-icon,
.settings-row:hover > span:first-child > .sl-icon:first-child {
  color: var(--accent-primary);
}

.settings-row-chevron {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: transform var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}

@media (hover: hover) and (pointer: fine) {
  .settings-detail-row:hover .settings-row-chevron {
    transform: translateX(2px);
  }
}

.settings-danger-row .settings-row-icon,
.settings-danger-row:hover .settings-row-icon {
  color: var(--state-danger);
}

/* checkboxes / selects aligned to the kit's ghost control language */
.settings-workbench-panel input[type='checkbox'] {
  accent-color: var(--accent-primary);
}

/* ---- settings root rows: toggle switch, notes, log-level nav, compact secrets ---- */
.settings-switch,
.settings-workbench-panel input[type='checkbox'].settings-switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--text-tertiary) 45%, var(--border-subtle));
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-tertiary) 38%, var(--surface-raised));
  box-shadow: inset 0 1px 2px color-mix(in srgb, #000 22%, transparent);
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}

.settings-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px color-mix(in srgb, #000 40%, transparent);
  transition:
    transform var(--motion-fast) var(--ease-standard),
    background var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}

/* state rules mirror the base selector's specificity so they win inside .settings-workbench-panel */
.settings-switch:checked,
.settings-workbench-panel input[type='checkbox'].settings-switch:checked {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  box-shadow: none;
}

.settings-switch:checked::after {
  transform: translateX(16px);
}

.settings-switch:disabled,
.settings-workbench-panel input[type='checkbox'].settings-switch:disabled {
  opacity: 0.55;
  cursor: default;
}

.settings-switch:focus-visible,
.settings-workbench-panel input[type='checkbox'].settings-switch:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 60%, var(--border-subtle));
  box-shadow: 0 0 0 2px var(--focus-ring-color);
}

@media (prefers-reduced-motion: reduce) {
  .settings-switch,
  .settings-switch::after,
  .settings-row,
  .set-btn,
  .settings-row-nav-btn,
  .mobile-settings-back {
    transition: none;
  }
}

.settings-row-note {
  padding: 6px 12px 8px;
  border-bottom: 0;
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.35;
}

.settings-row-note-error {
  color: var(--state-danger);
}

.settings-log-level-controls {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.settings-row-nav-btn {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
}

.settings-row-nav-btn:hover {
  background: var(--hover);
  border-color: color-mix(in srgb, var(--accent-primary) 42%, var(--border-subtle));
  color: var(--accent-primary);
}

.settings-row-nav-btn:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 60%, var(--border-subtle));
  box-shadow: 0 0 0 2px var(--focus-ring-color);
}

.settings-row-nav-btn .sl-icon {
  width: 14px;
  height: 14px;
}

/* compact secret editor rows adopt the settings-row rhythm inside sections */
.settings-section-rows .secret-compact-row {
  min-height: 40px;
  gap: 8px;
  padding: 0 8px;
  border-bottom: 0;
}

.settings-section-rows .secret-compact-status {
  width: 16px;
  color: var(--text-secondary);
}

.settings-section-rows .secret-compact-status.configured {
  color: var(--state-success);
}

.settings-section-rows .secret-compact-label {
  flex: 0 0 auto;
  min-width: 0;
  color: var(--text-primary);
  font-size: 12px;
}

.settings-section-rows .secret-compact-input {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  font-size: 12px;
}

.settings-section-rows .secret-compact-input:focus-visible {
  border-color: color-mix(in srgb, var(--accent-primary) 58%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.settings-section-rows .secret-compact-set {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  color: var(--text-secondary);
  font-size: 11px;
}

.settings-section-rows .secret-compact-set:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text-primary);
}

.settings-section-rows .secret-compact-clear {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-control);
}

.settings-section-rows .secret-compact-clear:hover:not(:disabled) {
  color: var(--state-danger);
  background: color-mix(in srgb, var(--state-danger) 10%, transparent);
}

@media (max-width: 560px) {
  .settings-section-rows .secret-compact-row {
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 8px 12px;
  }

  .settings-section-rows .secret-compact-input {
    flex: 1 1 100%;
    order: 3;
  }
}

/* ---- port relay settings page (built on set-card / set-btn / set-status) ---- */
.port-relay-stack {
  display: grid;
  gap: 10px;
}

.port-relay-section-icon {
  flex: 0 0 auto;
  color: var(--text-secondary);
}

.port-relay-target-display {
  min-width: 0;
  overflow: hidden;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.port-relay-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.port-relay-code-input {
  flex: 1 1 120px;
  min-width: 0;
  text-align: center;
  letter-spacing: 0.5px;
}

.port-relay-target-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.port-relay-target-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 4px 8px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  transition: border-color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}

.port-relay-target-row.selected {
  border-color: color-mix(in srgb, var(--accent-primary) 50%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--surface-raised));
}

.port-relay-target-row input[type='checkbox'] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-primary);
}

.port-relay-target-hub {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: 12px;
}

.port-relay-target-port {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11.5px;
}

.port-relay-target-empty {
  padding: 4px 8px;
}

.port-relay-add-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.port-relay-add-form .set-field-control {
  flex: 1 1 80px;
  min-width: 0;
}

.port-relay-add-port {
  max-width: 90px;
}

.port-relay-add-btn {
  width: 100%;
}

.port-relay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.port-relay-actions .set-btn--primary {
  flex: 1 1 auto;
}

.port-relay-pending-note {
  font-size: 11.5px;
}

/* ---- device sessions settings page (set-card / set-btn / set-status / set-kv) ---- */
.device-sessions-stack {
  display: grid;
  gap: 10px;
}

.device-sessions-head {
  flex-wrap: wrap;
  row-gap: 8px;
}

.device-sessions-overview-icon {
  flex: 0 0 auto;
  color: var(--text-secondary);
}

.device-session-card {
  gap: 10px;
}

.device-session-name {
  max-width: min(280px, 48vw);
}

.device-session-meta {
  gap: 7px 18px;
}

@media (min-width: 640px) {
  .device-session-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.device-sessions-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.device-sessions-empty-icon {
  flex: 0 0 auto;
  color: var(--text-tertiary);
}

.device-sessions-empty-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.device-sessions-empty .set-btn {
  flex: 0 0 auto;
}

.device-sessions-skeleton {
  display: grid;
  gap: 9px;
  min-height: 108px;
  align-content: start;
}

.device-sessions-skeleton-line {
  height: 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border-subtle) 62%, transparent);
}

.device-sessions-skeleton-title {
  width: 34%;
  height: 12px;
  margin-bottom: 2px;
}

.device-sessions-skeleton-short {
  width: 62%;
}

/* ---- settings root sub-groups (voice input / speech) ---- */
.settings-subsection {
  display: block;
  gap: 0;
  min-width: 0;
  border-bottom: 0;
}

.settings-subsection + .settings-subsection {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.settings-subsection-rows .settings-row,
.settings-subsection-rows .secret-compact-row {
  padding-left: 26px;
}

.settings-subsection-rows .secret-compact-row {
  flex-wrap: nowrap;
}

.settings-subsection-rows .secret-compact-input {
  flex: 1 1 auto;
  min-width: 0;
  order: 0;
}

/* ---- database page danger zone ---- */
.database-clear-card {
  border-color: color-mix(in srgb, var(--state-danger) 32%, var(--border-subtle));
}

.database-clear-icon {
  color: var(--state-danger);
}

.database-clear-note {
  line-height: 1.4;
}

/* ---- database page lazy stats: empty placeholder + Show/Export actions ---- */
.settings-database-storage-empty {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-raised) 84%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
}

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

/* ---- release publishing page (unified kit) ---- */
.release-publish-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 20px;
}

.release-publish-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 12px;
}

.release-publish-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-size: 12px;
}

.release-publish-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.release-publish-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.release-publish-job-log {
  max-height: 300px;
  margin: 0;
  overflow: auto;
  padding: 10px;
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface-panel) 90%, #000 10%);
  color: var(--text-secondary);
  font: 11px/1.5 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .release-publish-actions .set-btn {
    flex: 1 1 100%;
  }
}

/* ---- keyboard shortcut command index ---- */
.keyboard-shortcuts-detail {
  display: grid;
  align-content: start;
  gap: 12px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 20px;
}

.keyboard-shortcuts-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.keyboard-shortcuts-summary > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.keyboard-shortcuts-summary strong {
  color: var(--text-primary);
  font-size: 12px;
}

.keyboard-shortcuts-summary span {
  color: var(--text-tertiary);
  font-size: 11px;
}

.keyboard-shortcuts-reset,
.keyboard-shortcuts-reset-confirm button,
.keyboard-shortcut-row-actions button,
.keyboard-shortcut-conflict button {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
}

.keyboard-shortcuts-reset:hover:not(:disabled),
.keyboard-shortcuts-reset-confirm button:hover,
.keyboard-shortcut-row-actions button:hover,
.keyboard-shortcut-conflict button:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 44%, var(--border-subtle));
  background: var(--hover);
  color: var(--text-primary);
}

.keyboard-shortcuts-reset:disabled {
  cursor: default;
  opacity: 0.42;
}

.keyboard-shortcuts-reset-confirm {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 38%, var(--border-subtle));
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--state-warning) 7%, var(--surface-panel));
  color: var(--text-secondary);
  font-size: 11px;
}

.keyboard-shortcuts-reset-confirm span {
  margin-right: auto;
}

.keyboard-shortcuts-groups {
  display: grid;
  gap: 12px;
}

.keyboard-shortcuts-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.keyboard-shortcuts-group h3 {
  margin: 0;
  padding: 0 3px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.keyboard-shortcuts-command-list {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: var(--radius-panel);
  background: color-mix(in srgb, var(--surface-panel) 94%, transparent);
}

.keyboard-shortcut-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 18px;
  min-height: 62px;
  padding: 9px 10px 9px 12px;
  border-bottom: 0;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard);
}

.keyboard-shortcut-command:last-child {
  border-bottom: 0;
}

.keyboard-shortcut-command:hover,
.keyboard-shortcut-command:focus-within {
  background: color-mix(in srgb, var(--hover) 74%, transparent);
}

.keyboard-shortcut-command.is-recording {
  background: color-mix(in srgb, var(--accent-primary) 7%, var(--surface-panel));
}

.keyboard-shortcut-command-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.keyboard-shortcut-command-copy strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyboard-shortcut-command-copy span,
.keyboard-shortcut-command-copy small {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyboard-shortcut-command-copy small {
  color: var(--text-tertiary);
}

.keyboard-shortcut-command-controls {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 142px;
}

.keyboard-shortcut-binding {
  min-width: 64px;
  min-height: 30px;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 92%, transparent);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 5%, transparent) inset;
}

.keyboard-shortcut-binding:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 38%, var(--border-subtle));
  background: var(--hover);
}

.keyboard-shortcut-record-button:focus-visible,
.keyboard-shortcut-recorder:focus-visible,
.keyboard-shortcuts-detail button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.keyboard-shortcut-keycaps {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.keyboard-shortcut-keycaps kbd {
  min-width: 22px;
  padding: 3px 5px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 96%, transparent);
  border-bottom-color: color-mix(in srgb, var(--text-tertiary) 46%, var(--border-subtle));
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface-raised) 94%, var(--surface-panel));
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 7%, transparent) inset;
}

.keyboard-shortcut-plus {
  color: var(--text-tertiary);
  font-size: 9px;
}

.keyboard-shortcut-recorder {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 142px;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid;
  border-color: color-mix(in srgb, var(--accent-primary) 66%, var(--border-subtle));
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--accent-primary) 9%, var(--surface-raised));
  color: var(--text-primary);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
  text-align: left;
  cursor: default;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 10%, transparent);
}

.keyboard-shortcut-recorder::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent-primary);
  animation: keyboard-shortcut-signal 1.25s var(--ease-standard) infinite alternate;
}

.keyboard-shortcut-recorder-label {
  color: var(--accent-primary);
  font-size: 10px;
  font-weight: 700;
}

.keyboard-shortcut-recorder-keys {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--text-secondary);
  font-size: 10px;
}

.keyboard-shortcut-recorder-cancel {
  color: var(--text-tertiary);
  font-size: 9px;
}

.keyboard-shortcut-row-actions {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.keyboard-shortcut-row-actions button {
  min-height: 20px;
  padding: 0 5px;
  border-color: transparent;
  font-size: 9.5px;
}

.keyboard-shortcut-conflict {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: -2px;
  padding-top: 7px;
  border-top: 1px solid color-mix(in srgb, var(--state-warning) 25%, transparent);
  color: var(--state-warning);
  font-size: 10.5px;
}

.keyboard-shortcut-feedback {
  min-height: 30px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface-raised) 86%, transparent);
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 1.35;
}

.keyboard-shortcut-feedback.is-warning {
  border-color: color-mix(in srgb, var(--state-warning) 30%, var(--border-subtle));
  color: var(--state-warning);
}

.keyboard-shortcut-feedback.is-error {
  border-color: color-mix(in srgb, var(--state-danger) 30%, var(--border-subtle));
  color: var(--state-danger);
}

.keyboard-shortcuts-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes keyboard-shortcut-signal {
  from {
    opacity: 0.46;
    transform: scaleY(0.58);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (max-width: 620px) {
  .keyboard-shortcut-command {
    grid-template-columns: minmax(0, 1fr);
  }

  .keyboard-shortcut-command-controls {
    min-width: 0;
    justify-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .keyboard-shortcut-command,
  .keyboard-shortcut-recorder,
  .keyboard-shortcut-recorder kbd {
    animation: none;
    transition: none;
    transform: none;
  }
}

/* ============================================================
   Settings visual refresh — one content track, spacing-led groups,
   and flat root sections. Feature-specific controls retain their
   semantic borders, while navigation rows use whitespace and state.
   ============================================================ */

.settings-section-rows {
  overflow: hidden;
  border: 0;
  border-block: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-row:hover {
  background: color-mix(in srgb, var(--hover) 72%, transparent);
  box-shadow: none;
}

.settings-detail-row:focus-visible,
.settings-subsection-trigger:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--focus-ring-color);
}

.settings-subsection-trigger {
  width: 100%;
  min-height: 40px;
  padding: 0 8px;
  border-radius: 0;
  font-size: 12.5px;
}

.settings-subsection-trigger:hover {
  background: color-mix(in srgb, var(--hover) 72%, transparent);
}

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

.settings-disclosure-status {
  flex: 0 0 auto;
  margin-left: auto;
}

.settings-subsection-trigger .settings-row-chevron {
  flex: 0 0 auto;
  width: 14px;
  color: var(--text-tertiary);
  transition: none;
}

.settings-subsection-rows.set-disclosure-body {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 0 0 4px 24px;
}

.settings-subsection-rows.set-disclosure-body[hidden] {
  display: none;
}

.settings-subsection-rows .settings-row {
  min-height: 40px;
  padding-right: 8px;
  padding-left: 8px;
}

.settings-detail-row,
.settings-row-note {
  border-bottom: 0;
}

@media (max-width: 720px) {
  .mobile-settings-screen .settings-list {
    gap: 14px;
    padding: 0 12px 20px;
  }

  .mobile-settings-screen .settings-section-rows {
    border-radius: 0;
  }

  .mobile-settings-screen .settings-row,
  .mobile-settings-screen .settings-subsection-trigger {
    min-height: 44px;
  }

  .mobile-settings-screen .settings-detail-page {
    padding: 0;
  }

  .mobile-settings-screen .settings-detail-body {
    gap: 12px;
    padding: 12px 12px 20px;
  }
}

@media (max-width: 560px) {
  .settings-subsection-rows .secret-compact-row,
  .settings-section-rows .secret-compact-row {
    row-gap: 6px;
    padding: 8px;
  }
}

/* ============================================================
   Settings detail visual refresh — one track, semantic surfaces,
   aligned headings, and shared controls for every detail route.
   ============================================================ */

.settings-detail-body > * {
  width: min(100%, 760px);
  max-width: 760px;
  margin-inline: auto;
  min-width: 0;
}

.settings-detail-body > .settings-detail-stack {
  width: min(100%, 760px);
}

.settings-detail-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.settings-detail-body .set-section-surface {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: none;
}

.settings-detail-body .set-card.set-section-surface {
  padding: 12px;
}

.settings-detail-body .set-card-head {
  min-height: 24px;
  gap: 8px;
}

.settings-detail-body .set-card-head > .sl-icon,
.settings-detail-body .port-relay-section-icon,
.settings-detail-body .device-sessions-overview-icon,
.settings-detail-body .database-clear-icon,
.settings-detail-body .settings-detail-section-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

/* Section titles own the only decorative rule: it starts after the title. */
.set-section-title {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.set-section-title::after {
  content: '';
  display: block;
  flex: 1 1 auto;
  min-width: 16px;
  height: 1px;
  margin-left: 4px;
  background: color-mix(in srgb, var(--border-subtle) 78%, transparent);
}

h2.set-section-title,
h3.set-section-title {
  margin: 0;
  padding: 0;
}

.set-section-title .set-card-title,
.set-section-title .set-card-subtitle {
  flex: 0 1 auto;
}

.settings-detail-body .set-section-title > .sl-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

.settings-detail-body .set-section-data {
  min-width: 0;
}

.settings-detail-body .set-section-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.settings-detail-body .set-status {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
}

.settings-detail-body .set-section-feedback {
  min-width: 0;
}

.settings-detail-body .set-error.set-section-feedback,
.settings-detail-body .error.set-section-feedback {
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--state-danger) 34%, var(--border-subtle));
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--state-danger) 10%, transparent);
}

.settings-detail-body .set-section-empty {
  color: var(--text-secondary);
}

.settings-detail-body .set-field {
  gap: 6px;
}

.settings-detail-body .set-field-control,
.settings-detail-body .set-field input,
.settings-detail-body .set-field select,
.settings-detail-body .set-card input:not([type='checkbox']),
.settings-detail-body .set-card select {
  height: 32px;
}

.settings-detail-body .set-btn {
  min-height: 30px;
}

.settings-detail-body .set-kv {
  min-height: 22px;
}

.settings-detail-body .settings-metadata-list {
  gap: 12px;
  border: 0;
}

.settings-detail-body .settings-metadata-card.set-section-surface {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: none;
}

.settings-detail-body .settings-metadata-card.set-section-surface:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 24%, var(--border-subtle));
}

.settings-detail-body .agent-package-status.set-status {
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 11px;
  line-height: 1;
}

.settings-detail-body .settings-database-storage-summary {
  gap: 12px;
  margin: 0;
}

.settings-detail-body .settings-database-storage-metrics {
  gap: 8px;
}

.settings-detail-body .settings-database-storage-metric.set-section-surface {
  padding: 10px;
  background: var(--surface-raised);
}

.settings-detail-body .settings-database-store-list.set-section-surface {
  overflow: hidden;
  background: var(--surface-raised);
}

.settings-detail-body .settings-database-dump.set-section-surface {
  border-radius: 8px;
  background: var(--surface-raised);
}

.settings-detail-body > .release-publish-page,
.settings-detail-body > .keyboard-shortcuts-detail {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 0 0 20px;
}

.settings-detail-body > .keyboard-shortcuts-detail {
  gap: 12px;
}

.settings-detail-body .keyboard-shortcuts-summary {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: none;
}

.settings-detail-body .keyboard-shortcuts-group {
  gap: 8px;
}

.settings-detail-body .keyboard-shortcuts-group h3.set-section-title {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
}

.settings-detail-body .keyboard-shortcuts-command-list.set-section-surface {
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  background: var(--surface-panel);
}

.settings-detail-body .keyboard-shortcut-command {
  padding: 10px 12px;
}

.settings-detail-body .debug-log-detail {
  height: auto;
  min-height: 0;
}

.settings-detail-body .debug-log-list.set-section-surface {
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  background: var(--surface-panel);
}

@media (max-width: 720px) {
  .settings-detail-body {
    padding-inline: 12px;
  }

  .settings-detail-body > * {
    width: 100%;
  }

  .settings-detail-body > .settings-detail-stack {
    width: 100%;
  }

  .settings-detail-body .set-card.set-section-surface {
    padding: 11px;
  }
}

@media (max-width: 560px) {
  .settings-detail-body {
    padding-inline: 10px;
  }

  .settings-detail-body .set-card-head {
    gap: 7px;
  }

  .settings-detail-body .set-section-title {
    gap: 7px;
  }

  .settings-detail-body .set-section-title::after {
    min-width: 12px;
  }

  .settings-detail-body .settings-database-storage-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-detail-body .settings-database-store-list-header,
  .settings-detail-body .settings-database-store-row {
    grid-template-columns: minmax(0, 1fr) 52px 78px;
  }
}

.wiki-access-section-icon {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--accent-primary) 72%, var(--text-secondary));
}

.wiki-access-description {
  max-width: 64ch;
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.wiki-access-inline-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.wiki-access-inline-message .sl-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--text-tertiary);
}

.wiki-access-inline-message.set-error .sl-icon {
  color: var(--state-danger);
}

.wiki-access-form,
.wiki-access-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.wiki-access-form fieldset {
  display: grid;
  gap: 12px;
}

.wiki-access-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 88%, transparent);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}

.wiki-access-toggle:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 34%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent-primary) 4%, var(--surface-raised));
}

.wiki-access-toggle-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.wiki-access-toggle-label {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.wiki-access-toggle-note {
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.35;
}

.wiki-access-fields {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.wiki-access-field {
  min-width: 0;
}

.wiki-access-field .set-field-control {
  width: 100%;
}

.set-field-note {
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.4;
}

.wiki-access-public-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 22%, var(--border-subtle));
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--accent-primary) 7%, var(--surface-raised));
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.45;
}

.wiki-access-public-note .sl-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--accent-primary);
}

.wiki-access-form-actions {
  padding-top: 2px;
}

.wiki-access-save-status {
  gap: 5px;
  margin-left: 2px;
}

.wiki-access-save-status .sl-icon {
  flex: 0 0 auto;
}

.wiki-access-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wiki-access-link {
  width: 100%;
  min-width: 0;
}

.wiki-access-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wiki-access-hint {
  margin: 0;
}

@media (max-width: 560px) {
  .wiki-access-toggle {
    align-items: flex-start;
    padding-block: 10px;
  }

  .wiki-access-toggle .settings-switch {
    margin-top: 1px;
  }

  .wiki-access-link-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .wiki-access-actions {
    width: 100%;
  }

  .wiki-access-actions .set-btn {
    flex: 1 1 0;
  }
}

/* Port relay settings-page styling lives with the unified settings kit in
   settings.css. This file keeps only the relay frame / floating target-switch
   surface, which is shared outside the settings surface. */

.port-relay-frame-surface {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  color: var(--text-primary);
}

.port-relay-frame-surface.desktop {
  flex: 1 1 auto;
}

.port-relay-frame-surface.mobile {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  max-width: 100dvw;
  max-height: 100dvh;
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: none;
  touch-action: pan-y;
  z-index: 43;
}

.port-relay-frame {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border: 0;
  background: #ffffff;
}

.port-relay-clear-site-data-frame {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.chat-preview-mobile-overlay .port-relay-frame-surface.mobile {
  position: static;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}



.debug-log-detail {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.debug-log-list {
  min-height: 0;
  display: grid;
  gap: 4px;
}

.debug-log-empty {
  padding: 14px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-raised) 82%, var(--surface-panel));
  font-size: 12px;
}

.debug-log-line {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid color-mix(in srgb, var(--text-secondary) 72%, transparent);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface-raised) 76%, var(--surface-panel));
  color: color-mix(in srgb, var(--text-primary) 90%, var(--text-secondary));
  font-family: var(--code-font-family, Consolas, monospace);
  font-size: 10.5px;
  line-height: 1.35;
  padding: 6px 7px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.debug-log-line.info {
  border-left-color: color-mix(in srgb, var(--accent-primary) 72%, transparent);
}

.debug-log-line.warn {
  border-left-color: var(--state-warning);
}

.debug-log-line.error {
  border-left-color: var(--state-danger);
}

.debug-log-category-label,
.debug-log-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.debug-log-detail-footer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-panel) 96%, transparent);
  padding: 10px 2px 2px;
  display: grid;
  gap: 8px;
}

.debug-log-category-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.debug-log-actions {
  justify-content: flex-start;
}

.debug-log-upload-status {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Debug logs share the Settings detail track instead of adding another card. */
.settings-detail-body > .debug-log-detail {
  gap: 12px;
}

.settings-detail-body > .debug-log-detail .debug-log-empty {
  border-radius: var(--radius-control);
  background: transparent;
}

.settings-detail-body > .debug-log-detail .debug-log-line {
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-left-width: 2px;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-mono);
}

.settings-detail-body > .debug-log-detail .debug-log-detail-footer {
  padding: 10px 0 2px;
  background: transparent;
}

/* Settings detail visual refresh — logs keep one readable data surface and
   leave the section title and action footer on the shared Settings rhythm. */
.settings-detail-body > .debug-log-detail {
  gap: 12px;
  height: auto;
}

.settings-detail-body > .debug-log-detail .debug-log-list.set-section-surface {
  gap: 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  background: var(--surface-panel);
}

.settings-detail-body > .debug-log-detail .debug-log-empty.set-section-empty {
  padding: 8px 0;
  border: 0;
  background: transparent;
}

.settings-detail-body > .debug-log-detail .debug-log-line {
  padding: 7px 0;
}

.settings-detail-body > .debug-log-detail .debug-log-detail-footer.set-section-actions {
  padding: 8px 0 0;
  border-top: 0;
  background: transparent;
}


.workbench-chrome {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  color: var(--text-primary);
  background: var(--surface-workspace-content);
}

.workbench-chrome-toolbar {
  display: grid;
  grid-template-columns: var(--workbench-control-height) minmax(80px, 1fr) auto;
  flex: 0 0 var(--workbench-titlebar-height);
  height: var(--workbench-titlebar-height);
  min-height: var(--workbench-titlebar-height);
  max-height: var(--workbench-titlebar-height);
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 8px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-sidebar);
}

.workbench-chrome-toolbar.no-close {
  grid-template-columns: minmax(80px, 1fr) auto;
}

.workbench-chrome-toolbar.has-leading,
.workbench-chrome-toolbar.no-close.has-leading {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.workbench-chrome-toolbar.no-title {
  grid-template-columns: minmax(0, 1fr) auto;
}

.workbench-chrome-toolbar.no-title.has-leading {
  grid-template-columns: minmax(0, 1fr) auto;
}

.workbench-chrome-leading {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 4px;
}

.workbench-chrome-toolbar.has-leading .workbench-chrome-leading {
  grid-column: 1;
}

.workbench-chrome-toolbar.has-leading .workbench-chrome-title {
  grid-column: 2;
  text-align: center;
}

.workbench-chrome-toolbar.has-leading .workbench-chrome-actions {
  grid-column: 3;
  justify-self: end;
}

.workbench-chrome-toolbar.no-title .workbench-chrome-leading {
  grid-column: 1;
  width: 100%;
}

.workbench-chrome-toolbar.no-title .workbench-chrome-actions {
  grid-column: 2;
  justify-self: end;
  flex: 0 0 auto;
}

.workbench-chrome-title {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-workbench-content-kind-tabs {
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  overflow-x: auto;
  scrollbar-width: none;
}

.preview-workbench-content-kind-tabs::-webkit-scrollbar {
  display: none;
}

.preview-workbench-content-kind {
  min-width: 0;
  height: var(--workbench-control-height);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--radius-control);
  padding: 0 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard);
}

.preview-workbench-content-kind:hover:not(:disabled),
.preview-workbench-content-kind:focus-visible {
  color: var(--text-primary);
  background: var(--hover);
}

.preview-workbench-content-kind:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 1px;
}

.preview-workbench-content-kind.active {
  color: var(--accent-primary);
  background: var(--accent-soft-bg);
}

.preview-workbench-content-kind:disabled {
  opacity: 0.45;
  cursor: default;
}

.preview-workbench-content-kind .sl-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.workbench-chrome-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}

.workbench-chrome-icon-button,
.workbench-chrome-fullscreen-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
}

.workbench-chrome-icon-button {
  width: var(--workbench-control-height);
  height: var(--workbench-control-height);
  border-radius: var(--radius-control);
}

.workbench-chrome-icon-button:hover,
.workbench-chrome-fullscreen-toggle:hover {
  color: var(--text-primary);
  background: var(--hover);
}

.workbench-chrome-icon-button:focus-visible,
.workbench-chrome-fullscreen-toggle:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 1px;
}

.workbench-chrome-tabs {
  display: flex;
  flex: 0 0 var(--workbench-tabbar-height);
  align-items: stretch;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-sidebar);
  scrollbar-width: thin;
}

.workbench-chrome-tabs-row {
  display: flex;
  flex: 0 0 var(--workbench-tabbar-height);
  align-items: stretch;
  min-width: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-sidebar);
}

.workbench-chrome-tabs-row > .workbench-chrome-tabs {
  flex: 1 1 auto;
  min-width: 0;
  border-bottom: 0;
  background: transparent;
}

.workbench-chrome-tabs-accessory {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.workbench-chrome-body {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.workbench-chrome-content-row {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.workbench-chrome-companion-drawer,
.workbench-chrome-companion-main {
  min-width: 0;
  min-height: 0;
}

.workbench-chrome-companion-drawer {
  flex: 0 0 min(360px, calc(100% - 56px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workbench-chrome-companion-main {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workbench-chrome-companion-main > .workbench-chrome-tabs,
.workbench-chrome-companion-main > .workbench-chrome-tabs-row {
  flex: 0 0 var(--workbench-tabbar-height);
}

.workbench-chrome-companion-main > .workbench-chrome-body {
  flex: 1 1 auto;
}

.preview-workbench-drawer-toolbar {
  flex: 0 0 auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-panel);
}

.preview-workbench-drawer-primary-control {
  min-width: 0;
  min-height: 28px;
  flex: 1 1 auto;
}

.preview-workbench-drawer-icon-button {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.preview-workbench-drawer-icon-button:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text-primary);
}

.preview-workbench-drawer-icon-button:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 1px;
}

.preview-workbench-drawer-icon-button.active {
  background: var(--accent-soft-bg);
  color: var(--accent-primary);
}

.preview-workbench-drawer-icon-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.workbench-chrome-fullscreen-toggle {
  position: absolute;
  right: max(14px, var(--wm-safe-area-right));
  bottom: max(14px, var(--wm-safe-area-bottom));
  z-index: 11;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-overlay);
  box-shadow: var(--shadow-floating);
}

.workbench-chrome.mobile[data-mobile-fullscreen='true'] > .workbench-chrome-toolbar,
.workbench-chrome.mobile[data-mobile-fullscreen='true'] > .workbench-chrome-tabs,
.workbench-chrome.mobile[data-mobile-fullscreen='true'] > .workbench-chrome-tabs-row {
  display: none;
}



.desktop-inline-preview-pane {
  --chat-file-peek-width: var(--chat-inline-preview-width, 520px);
  position: relative;
  width: var(--chat-inline-preview-width, 520px);
  min-width: 0;
  max-width: min(1520px, 80vw);
  flex: 0 0 var(--chat-inline-preview-width, 520px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border-left: 1px solid var(--border-subtle);
  background: var(--surface-workspace-content);
  overflow: hidden;
  transition:
    flex-basis var(--motion-emphasized) var(--ease-drawer),
    width var(--motion-emphasized) var(--ease-drawer),
    border-left-color var(--motion-standard) var(--ease-standard);
}

.desktop-shell[data-chat-fixed-preview='true'] .desktop-inline-preview-pane {
  max-width: none;
}

.desktop-inline-preview-pane.is-resizing {
  transition: none;
}

.preview-editor-resize-handle {
  position: absolute;
  top: 0;
  left: -4px;
  bottom: 0;
  z-index: 9;
  width: 8px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
}

.preview-editor-resize-handle::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-primary) 64%, transparent);
  opacity: 0;
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.preview-editor-resize-handle:hover::after,
.preview-editor-resize-handle.resizing::after {
  opacity: 1;
}

.chat-file-peek-surface {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-workspace-content);
  color: var(--text-primary);
}

.desktop-inline-preview-editor {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.desktop-inline-preview-editor.is-maximized {
  width: 100%;
  height: 100%;
}

.desktop-preview-peek {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: visible;
  margin-left: 0;
}

.desktop-shell[data-inline-preview-maximized='true'] .desktop-preview-peek {
  flex: 1 1 0;
}

.desktop-shell[data-inline-preview-maximized='true'] .desktop-inline-preview-pane {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  border-left: 0;
  transition: none;
}

.desktop-shell[data-inline-preview-maximized='true'] .preview-editor-resize-handle {
  display: none;
}

.desktop-preview-peek:has(> .preview-navigation-dock.is-pinned) {
  column-gap: 0;
}

.preview-navigation-dock {
  position: absolute;
  top: 8px;
  right: calc(100% + 8px);
  z-index: var(--layer-workspace-chrome);
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.preview-navigation-dock.is-pinned {
  position: relative;
  inset: auto;
  order: -1;
  flex-direction: row-reverse;
  align-self: stretch;
  height: 100%;
  background: var(--surface-workspace-content);
  pointer-events: auto;
}

.preview-navigation-dock.is-pinned .preview-navigation-dock-rail {
  position: absolute;
  top: 8px;
  right: calc(100% + 8px);
  padding-top: 0;
}

.preview-navigation-dock.is-internal {
  top: calc(var(--workbench-titlebar-height) + 8px);
  left: 12px;
  right: auto;
}

.desktop-inline-preview-editor.is-maximized > .preview-navigation-dock.is-internal {
  top: calc(var(--workbench-titlebar-height) + 8px);
}

.desktop-inline-preview-editor.is-maximized:has(> .preview-workbench-surface .workbench-chrome-tabs-row) > .preview-navigation-dock.is-internal {
  top: calc(var(--workbench-titlebar-height) + var(--workbench-tabbar-height) + 8px);
}

.preview-navigation-dock-rail {
  flex: 0 0 36px;
  width: 36px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.preview-navigation-dock-preview-toggle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  padding: 0;
  background: var(--surface-panel);
  box-shadow: var(--shadow-floating);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out);
}

.preview-navigation-dock-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  min-height: 36px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  box-sizing: border-box;
  padding: 0;
  background: color-mix(in srgb, var(--surface-overlay) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
  box-shadow: var(--shadow-floating);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 9px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition:
    color var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out);
}

.preview-navigation-dock-preview-toggle .sl-icon,
.preview-navigation-dock-button .sl-icon {
  width: 14px;
  height: 14px;
}

.preview-navigation-dock-preview-toggle:hover:not(:disabled),
.preview-navigation-dock-preview-toggle:focus-visible,
.preview-navigation-dock-preview-toggle.active,
.preview-navigation-dock-button:hover:not(:disabled),
.preview-navigation-dock-button:focus-visible,
.preview-navigation-dock-button.active {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent-primary) 46%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 20%, var(--surface-overlay));
}

.preview-navigation-dock-preview-toggle:focus-visible,
.preview-navigation-dock-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 74%, transparent);
  outline-offset: 2px;
}

.preview-navigation-dock-preview-toggle:disabled,
.preview-navigation-dock-button:disabled {
  color: var(--text-tertiary);
  cursor: default;
  opacity: 0.52;
}

.preview-navigation-dock-panel {
  width: min(360px, min(62vw, calc(100vw - 116px)));
  max-height: min(68vh, 640px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
}

.preview-navigation-dock-panel,
.preview-workbench-surface.mobile .preview-workbench-drawer-panel {
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-overlay) 90%, transparent);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  box-shadow: var(--shadow-overlay);
  animation: preview-navigation-dock-in var(--motion-standard) var(--ease-out);
}

.preview-navigation-dock-panel.exiting {
  animation: preview-navigation-dock-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
  user-select: none;
}

.preview-navigation-dock.is-pinned .preview-navigation-dock-panel {
  flex: 0 0 360px;
  width: 360px;
  max-width: 360px;
  height: 100%;
  max-height: none;
  box-sizing: border-box;
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  border-right: 0;
  background: var(--surface-sidebar);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  animation: none;
}

.preview-navigation-dock.is-pinned .preview-navigation-dock-content,
.preview-navigation-dock.is-pinned .preview-navigation-dock-toolbar,
.preview-navigation-dock.is-pinned .preview-workbench-drawer-toolbar,
.preview-navigation-dock.is-pinned .preview-workbench-file-tree-content .tree-children,
.preview-navigation-dock.is-pinned .git-history-panel {
  background: var(--surface-sidebar);
}

.preview-workbench-drawer-icon-button[data-preview-navigation-pin].active {
  background: transparent;
  color: var(--accent-primary);
}

.preview-navigation-dock-toolbar {
  flex: 0 0 var(--workbench-titlebar-height);
  height: var(--workbench-titlebar-height);
  min-height: var(--workbench-titlebar-height);
  max-height: var(--workbench-titlebar-height);
  display: flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  padding: 0 8px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-panel);
}

.preview-navigation-dock .preview-workbench-drawer-toolbar {
  flex: 0 0 var(--workbench-titlebar-height);
  height: var(--workbench-titlebar-height);
  min-height: var(--workbench-titlebar-height);
  max-height: var(--workbench-titlebar-height);
  box-sizing: border-box;
  padding: 0 8px;
}

.preview-navigation-dock-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-navigation-dock-content {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: auto;
  animation: preview-navigation-dock-content-in var(--motion-fast) var(--ease-out) 30ms both;
}

.preview-navigation-dock-content .chat-session-outline {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 8px 16px;
  scrollbar-gutter: stable;
}

.preview-navigation-dock-content .preview-workbench-file-tree-content,
.preview-navigation-dock-content .git-history-panel {
  min-height: 0;
}

@keyframes preview-navigation-dock-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes preview-navigation-dock-out {
  to {
    opacity: 0;
    transform: translateX(8px);
  }
}

@keyframes preview-navigation-dock-content-in {
  from {
    opacity: 0.86;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-navigation-dock-panel,
  .preview-navigation-dock-panel.exiting,
  .preview-navigation-dock-content {
    animation: none;
  }

  .preview-navigation-dock-preview-toggle,
  .preview-navigation-dock-button {
    transition: none;
  }

  .desktop-inline-preview-pane,
  .desktop-preview-peek {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .preview-navigation-dock-preview-toggle,
  .preview-navigation-dock-button,
  .preview-navigation-dock-panel {
    background: var(--surface-overlay);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.preview-workbench-pane.entering {
  animation: preview-workbench-pane-in var(--motion-standard) var(--ease-drawer);
}

.preview-workbench-pane.exiting {
  animation: preview-workbench-pane-out var(--motion-exit) var(--ease-standard) forwards;
  pointer-events: none;
  user-select: none;
}

.desktop-inline-preview-pane.entering {
  animation: none;
}

.desktop-inline-preview-pane.is-collapsed,
.desktop-inline-preview-pane.exiting {
  min-width: 0;
  width: 0;
  flex-basis: 0;
  border-left-color: transparent;
  pointer-events: none;
}

.desktop-inline-preview-pane.entering > .desktop-inline-preview-editor {
  animation: preview-workbench-pane-in var(--motion-standard) var(--ease-drawer);
}

.desktop-inline-preview-pane.exiting > .desktop-inline-preview-editor {
  animation: preview-workbench-pane-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
  user-select: none;
}

.desktop-inline-preview-pane.exiting {
  pointer-events: none;
  user-select: none;
}

.desktop-inline-preview-editor.is-maximized > .preview-workbench-surface > .workbench-chrome-body {
  box-sizing: border-box;
  padding-left: calc(12px + 36px + 8px);
}

@keyframes preview-workbench-pane-in {
  from {
    opacity: 0.94;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes preview-workbench-pane-out {
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}

.chat-file-peek-surface.mobile {
  width: 100%;
  height: 100%;
}

.chat-file-peek-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-secondary) 46%, transparent) transparent;
  background: var(--surface-workspace-content);
}

.preview-workbench-render-cache {
  min-width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.preview-workbench-rendered-tab {
  min-width: 100%;
  flex: 1;
  min-height: 0;
}

.preview-workbench-rendered-tab.active {
  display: flex;
  flex-direction: column;
  animation: preview-workbench-content-in var(--motion-fast) var(--ease-out);
}

@keyframes preview-workbench-content-in {
  from {
    opacity: 0.86;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-file-workbench-tabs {
  min-height: var(--workbench-tabbar-height);
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  scrollbar-width: none;
}

.chat-file-workbench-tabs::-webkit-scrollbar {
  display: none;
}

.chat-file-workbench-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 96px;
  max-width: 190px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  color: var(--text-secondary);
  transition:
    color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}

.chat-file-workbench-tab + .chat-file-workbench-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 14px;
  transform: translateY(-50%);
  background: color-mix(in srgb, var(--border-subtle) 70%, transparent);
}

.chat-file-workbench-tab:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-primary) 5%, transparent);
}

.chat-file-workbench-tab.active {
  color: var(--text-primary);
  background: var(--surface-workspace-content);
  box-shadow: inset 0 2px 0 var(--accent-primary);
}

.chat-file-workbench-tab.active::before,
.chat-file-workbench-tab.active + .chat-file-workbench-tab::before {
  display: none;
}

.chat-file-workbench-tab-open,
.chat-file-workbench-tab-close {
  min-width: 0;
  height: var(--workbench-control-height);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.chat-file-workbench-tab-open {
  padding: 0 8px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.chat-file-workbench-tab-close {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 20px;
  height: 20px;
  margin-right: 3px;
  border-radius: 5px;
  padding: 0;
  opacity: 0.72;
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.chat-file-workbench-tab:hover .chat-file-workbench-tab-close,
.chat-file-workbench-tab.active .chat-file-workbench-tab-close,
.chat-file-workbench-tab-close:focus-visible {
  opacity: 0.75;
}

.chat-file-workbench-tab-close:hover {
  opacity: 1;
  color: var(--state-danger);
  background: var(--hover);
}

.preview-workbench-surface.mobile .chat-file-workbench-tab-close {
  opacity: 0.75;
}

.chat-file-workbench-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.chat-file-workbench-empty .sl-icon {
  width: 24px;
  height: 24px;
  opacity: 0.75;
}

.chat-file-workbench-empty-action {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 6px;
  background: var(--surface-panel);
  color: var(--text-primary);
  padding: 0 10px;
  font-size: 12px;
}

.chat-file-workbench-empty-action:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 46%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-panel));
}

.chat-file-workbench-empty-action .sl-icon {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

.desktop-shell .preview-workbench-surface.desktop > .workbench-chrome-toolbar {
  background: var(--desktop-top-surface);
}

.preview-window-shell .preview-workbench-surface.desktop > .workbench-chrome-toolbar {
  padding-right: calc(var(--desktop-window-controls-width) + 10px);
  background: var(--desktop-top-surface);
}

.preview-workbench-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-workbench-tabs-overflow {
  position: relative;
  display: flex;
  align-items: center;
}

.preview-workbench-tabs-overflow-button {
  width: 26px;
  height: 26px;
  margin: 0 4px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
}

.preview-workbench-tabs-overflow-button:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.preview-workbench-tabs-overflow-button.active {
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.preview-workbench-tabs-overflow-list {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 22;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 32px));
  max-height: min(420px, calc(100dvh - 96px));
  overflow-y: auto;
  display: grid;
  gap: 1px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 7px;
  background: var(--surface-panel);
  box-shadow: 0 14px 34px color-mix(in srgb, #000 32%, transparent);
}

.preview-workbench-tabs-overflow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
  border-radius: 5px;
}

.preview-workbench-tabs-overflow-row.active {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.preview-workbench-tabs-overflow-open {
  min-width: 0;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-primary);
  padding: 0 6px;
  font-size: 12px;
  text-align: left;
}

.preview-workbench-tabs-overflow-open:hover {
  background: var(--hover);
}

.preview-workbench-tabs-overflow-row.active .preview-workbench-tabs-overflow-open {
  color: var(--accent-primary);
}

.preview-workbench-tabs-overflow-close {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  opacity: 0.72;
}

.preview-workbench-tabs-overflow-close:hover {
  opacity: 1;
  color: var(--state-danger);
  background: var(--hover);
}

.preview-workbench-action-menu-item {
  width: 100%;
  min-height: 30px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-primary);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  text-align: left;
}

.preview-workbench-action-menu-item:hover:not(:disabled),
.preview-workbench-action-menu-item:focus-visible {
  background: var(--hover);
}

.preview-workbench-action-menu-item:disabled {
  color: var(--text-secondary);
  cursor: default;
}

.preview-workbench-surface.mobile .preview-workbench-action-menu-item {
  min-height: 44px;
  font-size: 14px;
}

.preview-tab-context-menu-separator {
  height: 1px;
  margin: 4px 6px;
  background: var(--border-subtle);
}

.preview-tab-context-menu {
  position: fixed;
  z-index: 140;
  min-width: 204px;
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  display: grid;
  gap: 1px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 7px;
  background: var(--surface-panel);
  box-shadow: 0 14px 34px color-mix(in srgb, #000 32%, transparent);
  transform-origin: top left;
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

.preview-tab-context-menu.sl-menu-exit {
  /* Keep the portal mounted for the shared motion-exit duration. */
  animation: sl-menu-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .preview-tab-context-menu {
    animation: none;
  }
}

.preview-workbench-search-bar {
  min-height: 34px;
  display: grid;
  grid-template-columns: 16px minmax(80px, 1fr) auto 24px 24px 24px;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  padding: 4px 8px;
  color: var(--text-secondary);
  animation: preview-workbench-search-in var(--motion-fast) var(--ease-out);
}

@keyframes preview-workbench-search-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.preview-workbench-surface.mobile .preview-workbench-search-bar {
  padding-right: calc(max(10px, var(--wm-safe-area-right)) + 42px);
}

.preview-workbench-search-input {
  min-width: 0;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text-primary);
  padding: 0 7px;
  font-size: 12px;
  outline: none;
}

.preview-workbench-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.preview-workbench-search-status {
  min-width: 56px;
  max-width: 168px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-workbench-tab .chat-file-workbench-tab-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.preview-workbench-tab-icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  opacity: 0.86;
}

.preview-workbench-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.preview-workbench-body-tools {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-workbench-surface.mobile .preview-workbench-body-tools {
  right: max(10px, var(--wm-safe-area-right));
}

.preview-workbench-drawer-tool {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 62%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-panel) 68%, transparent);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.preview-workbench-drawer-tool:hover {
  color: var(--accent-primary);
  border-color: color-mix(in srgb, var(--accent-primary) 34%, transparent);
}

.preview-workbench-drawer-tool:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 74%, transparent);
  outline-offset: 2px;
}

.preview-workbench-drawer-tool.active {
  color: var(--accent-primary);
  border-color: color-mix(in srgb, var(--accent-primary) 46%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

.preview-workbench-tree-search-icon {
  font-size: 14px;
}

.preview-workbench-tree-search-input {
  min-width: 0;
  width: 100%;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
}

.preview-workbench-tree-search-input::placeholder {
  color: color-mix(in srgb, var(--text-secondary) 82%, transparent);
}

.preview-workbench-tree-tool-button {
  flex: 0 0 auto;
}

.preview-workbench-drawer-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface-panel);
}

.preview-workbench-drawer-empty {
  flex: 1;
  min-height: 120px;
}

.preview-workbench-surface .preview-workbench-drawer-panel {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 9;
  width: min(360px, calc(100% - 56px));
  border-right: 1px solid var(--border-subtle);
  box-shadow: 18px 0 48px color-mix(in srgb, #000 30%, transparent);
  animation: preview-workbench-drawer-in var(--motion-standard) var(--ease-out);
}

.preview-workbench-surface.drawer-pinned .preview-workbench-body {
  flex-direction: row;
  overflow: hidden;
}

.preview-workbench-surface.drawer-pinned .preview-workbench-drawer-panel {
  position: relative;
  inset: auto;
  z-index: 1;
  flex: 0 0 min(360px, calc(100% - 56px));
  width: min(360px, calc(100% - 56px));
  height: auto;
  border-right: 1px solid var(--border-subtle);
  box-shadow: 18px 0 48px color-mix(in srgb, #000 22%, transparent);
}

.preview-workbench-surface.drawer-pinned .chat-file-peek-scroll {
  flex: 1 1 auto;
  min-width: 0;
}

.preview-workbench-surface.drawer-pinned .preview-workbench-search-hud {
  left: min(370px, calc(100% - 46px));
}

.preview-workbench-surface.companion .workbench-chrome-companion-drawer {
  flex: 0 0 min(360px, calc(100% - 56px));
  border-right: 1px solid var(--border-subtle);
  background: var(--surface-panel);
}

.preview-workbench-surface.companion .preview-workbench-body-tools {
  position: relative;
  top: auto;
  right: auto;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-panel);
}

.preview-workbench-surface.companion .preview-workbench-drawer-panel {
  position: relative;
  inset: auto;
  z-index: 1;
  width: auto;
  height: auto;
  flex: 1 1 auto;
  border-right: 0;
  box-shadow: none;
}

.preview-workbench-drawer-panel.external {
  width: 100%;
  height: 100%;
  pointer-events: auto;
  border-right: 1px solid var(--border-subtle);
  box-shadow: -20px 0 44px color-mix(in srgb, #000 30%, transparent);
  animation: preview-workbench-drawer-in var(--motion-standard) var(--ease-out);
}

.preview-workbench-drawer-panel.exiting {
  animation: preview-workbench-drawer-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .preview-workbench-pane.entering,
  .preview-workbench-pane.exiting,
  .preview-workbench-rendered-tab.active {
    animation: none;
  }

  .desktop-inline-preview-pane.is-collapsed,
  .desktop-inline-preview-pane.exiting {
    width: 0;
    flex-basis: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-workbench-search-bar,
  .preview-workbench-drawer-panel.external {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-workbench-surface .preview-workbench-drawer-panel,
  .preview-workbench-drawer-panel.exiting {
    animation: none;
  }
}

@keyframes preview-workbench-drawer-out {
  to {
    opacity: 0;
    transform: translateX(-10px);
  }
}

@keyframes preview-workbench-drawer-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.preview-workbench-drawer-search {
  color: var(--text-secondary);
}

.preview-workbench-drawer-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: preview-workbench-drawer-content-in var(--motion-fast) var(--ease-out);
}

.preview-workbench-drawer-content.preview-navigation-dock-content {
  overflow: auto;
  animation: preview-navigation-dock-content-in var(--motion-fast) var(--ease-out) 30ms both;
}

@keyframes preview-workbench-drawer-content-in {
  from {
    opacity: 0.86;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .preview-workbench-drawer-content {
    animation: none;
  }
}

.preview-workbench-file-tree-content {
  height: 100%;
  min-width: 0;
  overflow: auto;
}

.preview-workbench-file-tree-content .list {
  padding: 6px 0;
}

.preview-workbench-file-tree-content .tree-children {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  opacity: 1;
  transform: translateY(0);
  transition:
    grid-template-rows var(--motion-standard) var(--ease-drawer),
    opacity var(--motion-exit) var(--ease-standard),
    transform var(--motion-exit) var(--ease-standard);
}

.preview-workbench-file-tree-content .tree-children > div {
  min-height: 0;
  overflow: hidden;
}

.preview-workbench-file-tree-content .tree-children.entering {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
}

.preview-workbench-file-tree-content .tree-children.exiting {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
}

.preview-workbench-file-tree-content .item.dir,
.preview-workbench-file-tree-content .item.file {
  min-height: 26px;
  font-size: 12px;
}

.preview-workbench-file-tree-content .item.dir .label {
  font-weight: 550;
}

.preview-workbench-file-tree-content .item.selected {
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  box-shadow: inset 2px 0 0 var(--accent-primary);
}

.preview-workbench-file-search-children {
  border-left: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
}

.preview-workbench-file-search-tree {
  padding: 6px 0;
}

.preview-workbench-file-search-node {
  width: 100%;
  min-width: 0;
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  padding-top: 3px;
  padding-right: 8px;
  padding-bottom: 3px;
  padding-left: 10px;
  text-align: left;
  font-size: 12px;
}

.preview-workbench-file-search-node.file {
  cursor: pointer;
}

.preview-workbench-file-search-node.dir {
  cursor: pointer;
}

.preview-workbench-file-search-node.dir:hover,
.preview-workbench-file-search-node.file:hover {
  background: var(--hover);
}

.preview-workbench-file-search-node.file.selected {
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  box-shadow: inset 2px 0 0 var(--accent-primary);
}

.preview-workbench-file-search-node .label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-workbench-file-search-empty {
  padding: 18px 10px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

.preview-workbench-surface.mobile .preview-workbench-drawer-panel {
  position: absolute;
  top: 52px;
  right: max(10px, var(--wm-safe-area-right));
  bottom: auto;
  left: auto;
  z-index: 9;
  width: min(360px, calc(100% - 20px));
  max-height: min(68vh, 640px);
}

.preview-workbench-surface.mobile .preview-workbench-drawer-panel.exiting {
  animation: preview-navigation-dock-out var(--motion-exit) var(--ease-out) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .preview-workbench-surface.mobile .preview-workbench-drawer-panel {
    animation: none;
  }
}

.quick-file-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  align-items: start;
  justify-items: center;
  background: rgba(0, 0, 0, 0.24);
  padding: max(72px, calc(var(--wm-safe-area-top) + 48px)) 16px 16px;
}

.quick-file-search-panel {
  width: min(620px, 100%);
  max-height: min(560px, calc(100dvh - 112px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
}

.quick-file-search-input-row {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 12px;
  color: var(--text-secondary);
}

.quick-file-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  padding: 0;
  font-size: 13px;
  outline: none;
}

/* The panel border already communicates focus; suppress the global input
   focus ring (base.css) that otherwise draws a box inside the row. */
.quick-file-search-input:focus-visible {
  outline: none;
}

.quick-file-search-project {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 40%;
  overflow: hidden;
  padding: 2px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-file-search-results {
  min-height: 42px;
  overflow: auto;
  padding: 6px;
}

.quick-file-search-results.refreshing .quick-file-search-option {
  opacity: 0.55;
}

.quick-file-search-option {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  padding: 5px 7px;
  text-align: left;
}

.quick-file-search-option:hover,
.quick-file-search-option.selected {
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
}

.quick-file-search-name,
.quick-file-search-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-file-search-name {
  flex: 0 1 auto;
  font-family: var(--mono-font);
  font-size: 12px;
}

.quick-file-search-path {
  flex: 1 1 auto;
  color: var(--text-secondary);
  font-family: var(--mono-font);
  font-size: 11px;
  text-align: right;
}

.quick-file-search-match {
  color: var(--accent-primary);
  font-weight: 600;
}

/* Reuse the mention-menu skeleton visuals but match the 34px flex option
   rows so the swap to real results does not shift the panel geometry. */
.quick-file-search-skeleton .chat-file-mention-skeleton-row {
  min-height: 34px;
  display: flex;
  gap: 8px;
  padding: 5px 7px;
}

.quick-file-search-skeleton .chat-file-mention-skeleton-path {
  width: 42%;
  margin-left: auto;
}

.quick-file-search-empty {
  padding: 18px 10px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

.quick-file-search-empty-hint {
  display: block;
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.preview-selection-context-menu {
  position: fixed;
  z-index: 120;
  min-width: 108px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, transparent);
  border-radius: 7px;
  background: var(--surface-panel);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  padding: 4px;
  transform-origin: top left;
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

.preview-selection-context-menu.sl-menu-exit {
  /* Keep the portal mounted for the shared motion-exit duration. */
  animation: sl-menu-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .preview-selection-context-menu {
    animation: none;
  }
}

.preview-selection-context-menu button {
  width: 100%;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-primary);
  padding: 0 8px;
  text-align: left;
}

.preview-selection-context-menu button:hover {
  background: var(--hover);
}

.chat-file-peek-scroll .code-wrap.nowrap {
  width: max-content;
  min-width: 100%;
}

.chat-file-peek-scroll .diff-wrap.nowrap {
  width: max-content;
  min-width: 100%;
}

.chat-file-peek-error {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  color: var(--state-danger);
  font-size: 13px;
  text-align: center;
}

.chat-file-peek-image-wrap {
  min-height: 100%;
}

.chat-attachment-original-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.chat-attachment-original-image {
  width: auto;
  height: auto;
  max-width: min(100%, 1600px);
  max-height: min(78vh, 1200px);
  object-fit: contain;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-raised);
}

.chat-attachment-preview-placeholder {
  min-height: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-content: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-secondary);
}

.chat-attachment-preview-placeholder .sl-icon {
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--accent-primary) 72%, var(--text-primary));
}

.chat-attachment-preview-placeholder-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.chat-attachment-preview-placeholder-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-preview-placeholder-meta,
.chat-attachment-preview-placeholder-status {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.chat-prompt-diff-preview {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
  background: var(--surface-workspace-content);
}

.chat-prompt-diff-overview {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.chat-prompt-diff-overview .sl-icon {
  color: color-mix(in srgb, var(--accent-primary) 82%, var(--text-primary));
}

.chat-prompt-diff-file {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-panel) 82%, var(--surface-panel));
  overflow: hidden;
}

.chat-prompt-diff-file-header {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  display: grid;
  grid-template-columns: 16px 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-prompt-diff-file-header:hover {
  background: var(--hover);
}

.chat-prompt-diff-file.active > .chat-prompt-diff-file-header {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  box-shadow: inset 2px 0 0 var(--accent-primary);
}

.chat-prompt-diff-file.active > .chat-prompt-diff-file-header:hover {
  background: color-mix(in srgb, var(--accent-primary) 18%, var(--hover));
}

.chat-prompt-diff-file-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-prompt-diff-file-name,
.chat-prompt-diff-file-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-prompt-diff-file-name {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--text-primary);
}

.chat-prompt-diff-file-path {
  font-family: var(--mono-font);
  font-size: 10px;
  color: var(--text-secondary);
}

.chat-prompt-diff-file-counts {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 58px;
  font-family: var(--mono-font);
  font-size: 11px;
  white-space: nowrap;
}

.chat-prompt-diff-file-counts .additions {
  color: var(--state-success);
}

.chat-prompt-diff-file-counts .deletions {
  color: var(--state-danger);
}

.chat-prompt-diff-file-body {
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  background: var(--surface-workspace-content);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  opacity: 1;
  transform: translateY(0);
  transition:
    grid-template-rows var(--motion-standard) var(--ease-drawer),
    opacity var(--motion-exit) var(--ease-standard),
    transform var(--motion-exit) var(--ease-standard);
}

.chat-prompt-diff-file-body > .chat-prompt-diff-file-body-inner {
  min-width: 100%;
  width: max-content;
  min-height: 0;
}

.chat-prompt-diff-file-body.entering {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.chat-prompt-diff-file-body.exiting {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .chat-prompt-diff-file-body,
  .chat-prompt-diff-file-body.entering,
  .preview-workbench-file-tree-content .tree-children {
    transition: none;
    transform: none;
  }
}

.chat-prompt-diff-file-body .code-wrap {
  min-width: 100%;
}

.chat-preview-mobile-overlay .chat-file-peek-surface.mobile {
  flex: 1 1 auto;
  min-height: 0;
}

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

.seti-icon svg path,
.seti-icon svg rect,
.seti-icon svg polygon,
.seti-icon svg circle {
  fill: currentColor;
}

.file-image-preview-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.file-image-preview {
  width: auto;
  height: auto;
  max-width: min(100%, 1600px);
  max-height: min(78vh, 1200px);
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(127, 127, 127, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(127, 127, 127, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(127, 127, 127, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(127, 127, 127, 0.08) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

@media (max-width: 900px) {
  .file-image-preview-wrap {
    padding: 10px;
  }

  .file-image-preview {
    max-height: 68vh;
  }
}


.chat-file-mention-empty {
  min-height: 32px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.chat-file-mention-option {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.chat-file-mention-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 3px;
  padding: 0 4px 0 0;
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.chat-file-mention-option:hover,
.chat-file-mention-option.active {
  background: var(--hover);
}

.chat-file-mention-option-main {
  min-width: 0;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  display: grid;
  grid-template-columns: 16px minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 0 6px 0 10px;
  text-align: left;
  cursor: pointer;
}

.chat-file-mention-option-main .sl-icon {
  color: var(--text-secondary);
  width: 13px;
  height: 13px;
}

.chat-file-mention-preview-button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: color-mix(in srgb, var(--text-secondary) 78%, var(--text-primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.chat-file-mention-option:hover .chat-file-mention-preview-button,
.chat-file-mention-option.active .chat-file-mention-preview-button,
.chat-file-mention-preview-button:focus-visible {
  opacity: 1;
}

/* No hover on touch: keep the preview affordance visible at all times. */
@media (hover: none) {
  .chat-file-mention-preview-button {
    opacity: 1;
  }
}

.chat-file-mention-preview-button:hover,
.chat-file-mention-preview-button:focus-visible {
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  color: color-mix(in srgb, var(--accent-primary) 86%, var(--text-primary));
}

.chat-file-mention-preview-button .sl-icon {
  width: 14px;
  height: 14px;
}

.chat-file-mention-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: color-mix(in srgb, var(--text-secondary) 74%, var(--text-primary));
}

.chat-file-mention-name {
  max-width: min(42vw, 260px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

/* Stale-while-revalidate: keep the current list visible (dimmed) while a
   search is in flight instead of flashing a "Searching..." placeholder. */
.chat-file-mention-menu.refreshing .chat-file-mention-option-row {
  opacity: 0.55;
}

/* Structural skeleton shown only before the first results arrive; rows match
   the 30px option rows so the swap does not shift the menu geometry. */
.chat-file-mention-skeleton {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-file-mention-skeleton-row {
  display: grid;
  grid-template-columns: 16px minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 30px;
  padding: 0 6px 0 10px;
  animation: chat-file-mention-skeleton-pulse 1.6s var(--ease-standard) infinite;
}

.chat-file-mention-skeleton-icon,
.chat-file-mention-skeleton-name,
.chat-file-mention-skeleton-path {
  display: block;
  border-radius: 4px;
  background: var(--hover);
}

.chat-file-mention-skeleton-icon {
  width: 14px;
  height: 14px;
}

.chat-file-mention-skeleton-name {
  width: 88px;
  height: 12px;
}

.chat-file-mention-skeleton-row:nth-child(2n) .chat-file-mention-skeleton-name {
  width: 64px;
}

.chat-file-mention-skeleton-path {
  width: 58%;
  height: 11px;
}

@keyframes chat-file-mention-skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-file-mention-skeleton-row {
    animation: none;
  }
}

/* Preview search HUD sits above the scroll surface without displacing code. */
.preview-workbench-search-hud {
  position: absolute;
  top: 8px;
  right: 10px;
  left: 10px;
  z-index: 12;
  pointer-events: none;
}

.preview-workbench-search-hud .preview-workbench-search-bar {
  pointer-events: auto;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 36%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-panel) 96%, var(--surface-workspace-content));
  box-shadow: 0 10px 26px color-mix(in srgb, #000 24%, transparent);
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard);
}

.preview-workbench-body:has(.preview-workbench-search-hud) .chat-file-peek-scroll {
  padding-top: 54px;
}

.preview-workbench-search-hud:focus-within .preview-workbench-search-bar {
  border-color: color-mix(in srgb, var(--accent-primary) 72%, var(--border-subtle));
  box-shadow:
    0 10px 26px color-mix(in srgb, #000 24%, transparent),
    0 0 0 2px color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

.preview-workbench-search-status.no-results {
  color: var(--state-warning);
}

.preview-search-match {
  background: color-mix(in srgb, #ffd166 28%, transparent);
}

.preview-workbench-surface .chat-file-peek-scroll [data-line-number].preview-search-match {
  background: color-mix(in srgb, #ffd166 24%, transparent);
}

.preview-search-match-active {
  background: color-mix(in srgb, #ffd166 76%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, #ffd166 54%, transparent);
}

.preview-workbench-surface .chat-file-peek-scroll [data-line-number].preview-search-match-active {
  background: color-mix(in srgb, #ffd166 70%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, #ffd166 54%, transparent);
}

.preview-workbench-surface.mobile .preview-workbench-search-hud {
  right: max(52px, calc(10px + var(--wm-safe-area-right)));
}

@media (prefers-reduced-motion: reduce) {
  .preview-workbench-search-hud .preview-workbench-search-bar,
  .preview-workbench-search-input {
    transition: none;
  }
}

.git-history-panel {
  height: 100%;
  min-width: 0;
  overflow: auto;
  background: var(--surface-panel);
  color: var(--text-primary);
  font-size: 12px;
}

.git-history-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
}

.git-branch-picker {
  position: relative;
  min-width: 0;
  flex: 1;
}

.git-toolbar-button {
  height: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
}

.git-branch-trigger:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text-primary);
}

.git-toolbar-button:disabled {
  opacity: 0.45;
}

.git-toolbar-button.icon-only {
  padding: 0;
}

.git-branch-trigger {
  width: 100%;
  justify-content: flex-start;
  padding: 0 7px;
  color: var(--text-primary);
}

.git-branch-trigger > span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-branch-menu {
  position: absolute;
  top: 32px;
  left: 0;
  z-index: 6;
  width: min(290px, calc(100vw - 84px));
  max-height: 300px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface-overlay);
  box-shadow: 0 14px 34px color-mix(in srgb, #000 34%, transparent);
}

.git-branch-option {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 4px;
  padding: 0 7px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.git-branch-option:hover {
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
}

.git-branch-check {
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
}

.git-branch-check.selected {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: var(--surface-canvas);
}

.git-branch-option-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-ref-kind,
.git-count {
  color: var(--text-secondary);
  font-size: 10px;
}

.git-offline-pill,
.git-head-pill {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.2;
}

.git-head-pill {
  border-color: color-mix(in srgb, var(--accent-primary) 38%, var(--border-subtle));
  color: var(--accent-primary);
}

.git-history-section {
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 0 10px;
}

.git-section-heading,
.git-worktree-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 7px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.git-worktree-group + .git-worktree-group {
  margin-top: 7px;
}

.git-worktree-group-label {
  padding-bottom: 3px;
  letter-spacing: 0.04em;
}

.git-file-row {
  width: 100%;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 3px 10px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.git-file-row .node-icon {
  flex: 0 0 auto;
}

.git-file-row:hover {
  background: var(--hover);
}

.git-file-path {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.git-file-name {
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-file-parent {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.75;
}

.git-file-stats,
.git-commit-file-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.git-file-stats {
  flex: 0 0 auto;
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
}

.git-worktree-group-label .git-count,
.git-section-heading .git-count {
  min-width: 16px;
  border-radius: 999px;
  padding: 1px 5px;
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  text-align: center;
}

.git-file-stats .additions,
.git-commit-file-summary .additions {
  color: var(--state-success);
}

.git-file-stats .deletions,
.git-commit-file-summary .deletions {
  color: var(--state-danger);
}

.git-history-state,
.git-history-empty {
  padding: 12px 10px;
  color: var(--text-secondary);
  text-align: center;
}

.git-inline-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 8px 7px;
  border-left: 2px solid var(--state-danger);
  padding: 6px 8px;
  background: color-mix(in srgb, var(--state-danger) 8%, transparent);
  color: var(--state-danger);
}

.git-inline-error button {
  border: 0;
  background: transparent;
  color: currentColor;
  font-weight: 600;
}

.git-timeline {
  position: relative;
  padding-left: 28px;
}

.git-timeline::before {
  content: '';
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 13px;
  width: 1px;
  background: var(--border-subtle);
}

.git-commit {
  position: relative;
  min-width: 0;
}

.git-commit-node {
  position: absolute;
  top: 13px;
  left: -18px;
  z-index: 1;
  width: 6px;
  height: 6px;
  border: 1px solid var(--text-secondary);
  border-radius: 50%;
  background: var(--surface-panel);
}

.git-commit.expanded .git-commit-node {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}

.git-commit-head {
  min-width: 0;
}

.git-commit-head:hover {
  background: var(--hover);
}

.git-commit-copy {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  opacity: 0.7;
  padding: 0;
}

.git-commit-copy:hover {
  opacity: 1;
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.git-commit-trigger {
  width: 100%;
  min-width: 0;
  display: block;
  border: 0;
  padding: 7px 10px 0 2px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.git-commit-title {
  display: block;
  overflow: hidden;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.git-commit-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 10px 7px 2px;
  color: var(--text-secondary);
  font-size: 10px;
}

.git-short-sha {
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
}

.git-commit-details {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  padding: 3px 10px 10px 2px;
  color: var(--text-secondary);
  opacity: 1;
  transform: translateY(0);
  transition:
    grid-template-rows var(--motion-standard) var(--ease-drawer),
    padding var(--motion-standard) var(--ease-drawer),
    opacity var(--motion-exit) var(--ease-standard),
    transform var(--motion-exit) var(--ease-standard);
}

.git-commit-details-inner {
  min-height: 0;
  overflow: hidden;
}

.git-commit-details.entering {
  grid-template-rows: 0fr;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
}

.git-commit-details.exiting {
  grid-template-rows: 0fr;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .git-commit-details {
    transition: none;
    transform: none;
  }
}

.git-commit-file-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}
.git-commit-files {
  margin-top: 5px;
  border-top: 1px solid var(--border-subtle);
}

.git-commit-files .git-file-row {
  padding-right: 0;
  padding-left: 0;
}

.git-load-more {
  width: calc(100% - 20px);
  min-height: 30px;
  margin: 8px 10px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
}

.git-load-more:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent-primary) 42%, var(--border-subtle));
  color: var(--accent-primary);
}

@media (max-width: 720px) {
  .git-file-row,
  .git-branch-option,
  .git-commit-trigger {
    min-height: 36px;
  }
}

.sidebar-title-row .chat-hub-summary {
  margin-left: 0;
  position: static;
}

.sidebar-title-row .chat-hub-summary-button {
  max-width: min(154px, 48vw);
}

.sidebar-title-row .chat-hub-popover {
  left: 12px;
  right: auto;
  width: min(340px, calc(100vw - 24px));
  min-width: 0;
  max-width: calc(100vw - 24px);
}

.chat-session-header.mobile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  position: relative;
  z-index: 20;
  flex: 0 0 calc(var(--wm-safe-area-top) + var(--chat-menu-header-height));
  height: calc(var(--wm-safe-area-top) + var(--chat-menu-header-height));
  min-height: calc(var(--wm-safe-area-top) + var(--chat-menu-header-height));
  max-height: calc(var(--wm-safe-area-top) + var(--chat-menu-header-height));
  padding: var(--wm-safe-area-top) 8px 0;
}

.chat-session-header.mobile .chat-session-header-toolbar {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  width: 100%;
  z-index: 1;
}

.chat-title-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-left: 0;
  --chat-session-toolbar-reserve: 100px;
  background: var(--desktop-top-surface);
}

.chat-title-bar.search-open > .chat-title-actions {
  display: none;
}

.narrow-shell .chat-title-bar {
  flex: 0 0 calc(var(--wm-safe-area-top) + var(--chat-menu-header-height));
  height: calc(var(--wm-safe-area-top) + var(--chat-menu-header-height));
  min-height: calc(var(--wm-safe-area-top) + var(--chat-menu-header-height));
  max-height: calc(var(--wm-safe-area-top) + var(--chat-menu-header-height));
  gap: 0px;
  padding: var(--wm-safe-area-top) 8px 0;
}

.narrow-shell .chat-title-bar .chat-title-project-button {
  padding-left: 2px;
}

@media (max-width: 900px) {
  .chat-title-context .chat-breadcrumb-title {
    width: 100%;
    margin: 0;
  }
}

.chat-title-bar > .chat-session-header {
  flex: 0 0 var(--chat-session-panel-width);
  width: var(--chat-session-panel-width);
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-bottom: 0;
  background: transparent;
  padding: 0 var(--chat-header-end-padding) 0 0;
  gap: 8px;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: none;
}

.chat-title-context {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.desktop-shell > .chat-title-bar > .chat-title-context {
  padding-right: var(--chat-session-toolbar-reserve);
}

.desktop-shell > .chat-title-bar.search-open > .chat-title-context {
  padding-right: 0;
}

.chat-title-context .breadcrumb-title {
  min-width: 0;
}

.chat-title-context .chat-breadcrumb-title {
  flex: 0 1 auto;
  width: min(
    var(--chat-view-column-width, 800px),
    max(0px, calc(100% - var(--chat-title-content-offset, 0px)))
  );
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: var(--chat-title-content-offset, 0px);
}

.chat-title-search-context {
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-title-search-context > .chat-title-search-bar {
  flex: 0 1 auto;
  min-width: 0;
  width: min(var(--chat-view-column-width, 800px), max(0px, calc(100% - var(--chat-title-content-offset, 0px))));
  height: 28px;
  min-height: 28px;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: var(--chat-title-content-offset, 0px);
  padding: 2px 4px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 36%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-panel) 96%, var(--surface-canvas));
  box-shadow: 0 6px 16px color-mix(in srgb, #000 18%, transparent);
}

.chat-breadcrumb-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.chat-search-toggle,
.chat-session-toolbar-button,
.chat-terminal-toggle,
.chat-wiki-toggle,
.chat-preview-detach-toggle,
.chat-drawer-toggle {
  appearance: none;
  position: relative;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.chat-search-toggle:hover,
.chat-session-toolbar-button:hover:not(:disabled),
.chat-terminal-toggle:hover,
.chat-wiki-toggle:hover,
.chat-preview-detach-toggle:hover:not(:disabled),
.chat-drawer-toggle:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text-primary);
}

.chat-search-toggle.active,
.chat-session-toolbar-button.active,
.chat-terminal-toggle.active,
.chat-preview-detach-toggle.active,
.chat-drawer-toggle.active {
  background: var(--accent-soft-bg);
  color: var(--accent-primary);
}

.chat-search-toggle.active:hover,
.chat-session-toolbar-button.active:hover:not(:disabled),
.chat-terminal-toggle.active:hover,
.chat-preview-detach-toggle.active:hover:not(:disabled),
.chat-drawer-toggle.active:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-primary) 24%, transparent);
  color: var(--accent-primary);
}

.chat-drawer-toggle:disabled {
  opacity: 0.52;
  cursor: default;
}

.chat-session-toolbar-button:disabled {
  opacity: 0.42;
  cursor: default;
}

.chat-session-toolbar-button:disabled:hover {
  background: transparent;
  color: var(--text-tertiary);
}

.chat-wiki-link {
  text-decoration: none;
}

.chat-title-project-button {
  appearance: none;
  min-width: 0;
  max-width: max-content;
  height: 26px;
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 6px;
  padding: 0 6px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: inherit;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
}

.chat-title-bar > .chat-session-header .chat-title-project-button {
  flex: 1 1 0;
  max-width: none;
  padding-right: var(--chat-header-trigger-end-padding);
}

.chat-title-project-button:hover,
.chat-title-project-button.open {
  background: var(--hover);
  color: var(--text-primary);
}

.chat-title-project-button .breadcrumb-project-name {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title-bar > .chat-session-header .chat-title-project-button .breadcrumb-project-name {
  text-align: right;
}

.chat-title-project-button .sl-icon {
  flex: 0 0 auto;
  color: var(--text-tertiary);
}

.chat-title-session-text {
  min-width: 0;
  flex: 1 1 0;
  color: var(--text-primary);
  font-weight: 500;
  cursor: default;
}

.chat-title-session-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-title-session-button:hover,
.chat-title-session-button.open {
  color: var(--text-primary);
}

.chat-title-project-menu {
  position: fixed;
  left: 12px;
  top: calc(var(--wm-safe-area-top) + var(--chat-menu-header-height));
  z-index: 86;
  width: min(360px, calc(100vw - 24px));
  max-height: min(380px, calc(100vh - 72px));
  overflow-y: auto;
}

.chat-title-project-menu-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  border-radius: 6px;
  padding: 4px 6px 4px 8px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
}

.chat-title-project-menu-item:hover,
.chat-title-project-menu-item.selected {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.chat-title-project-menu-select {
  min-width: 0;
  min-height: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-title-project-menu-create {
  appearance: none;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-title-project-menu-create .sl-icon {
  width: 14px;
  height: 14px;
}

.chat-title-project-menu-create:hover {
  background: color-mix(in srgb, var(--accent-primary) 16%, transparent);
  color: var(--accent-primary);
}

.chat-title-project-menu-name {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title-project-menu-path {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title-outline-menu {
  position: fixed;
  left: 12px;
  top: calc(var(--wm-safe-area-top) + var(--chat-menu-header-height));
  z-index: 86;
  width: min(360px, calc(100vw - 24px));
  max-height: min(70vh, calc(100vh - 96px));
  overflow-y: auto;
  padding: 8px;
}

.chat-title-outline-menu .chat-session-outline {
  min-width: 0;
}

.chat-session-outline {
  min-width: 0;
  min-height: 0;
  color: var(--text-primary);
}

.chat-session-outline-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-session-outline-item {
  min-width: 0;
}

.chat-session-outline-item[data-chat-outline-kind='prompt'] {
  margin-top: 6px;
}

.chat-session-outline-item[data-chat-outline-kind='prompt']:first-child {
  margin-top: 0;
}

.chat-session-outline-button {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 5px 8px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.chat-session-outline-label {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chat-session-outline-item[data-chat-outline-kind='prompt'] .chat-session-outline-button {
  color: var(--text-primary);
  font-weight: 600;
}

.chat-session-outline-item[data-chat-outline-kind='prompt'] .chat-session-outline-label {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-session-outline-item[data-chat-outline-level='2'] .chat-session-outline-button {
  padding-left: 20px;
}

.chat-session-outline-item[data-chat-outline-level='3'] .chat-session-outline-button {
  padding-left: 32px;
}

.chat-session-outline-item[data-chat-outline-level='4'] .chat-session-outline-button,
.chat-session-outline-item[data-chat-outline-level='5'] .chat-session-outline-button,
.chat-session-outline-item[data-chat-outline-level='6'] .chat-session-outline-button {
  padding-left: 44px;
}

.chat-session-outline-button:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.chat-session-outline-button[aria-current='true'] {
  background: var(--accent-soft-bg);
  color: var(--text-primary);
  font-weight: 600;
}

.chat-session-outline-button:active {
  transform: scale(0.985);
}

.chat-session-outline-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 72%, transparent);
  outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
  .chat-session-outline-button {
    transition: none;
  }

  .chat-session-outline-button:active {
    transform: none;
  }
}

.chat-session-outline-empty {
  padding: 18px 12px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.chat-title-actions {
  flex: 0 0 auto;
  min-width: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.chat-session-toolbar-actions {
  flex: 0 0 auto;
  min-width: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  position: absolute;
  inset-block: 0;
  right: var(--chat-session-toolbar-right, 8px);
  z-index: 2;
}

.narrow-shell .chat-session-toolbar-actions {
  position: static;
  inset-block: auto;
  right: auto;
}

.chat-session-toolbar-share {
  display: inline-flex;
  flex: 0 0 28px;
  min-width: 28px;
}

.chat-session-toolbar-share .chat-share-trigger {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.chat-preview-toolbar {
  flex: 0 0 auto;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-panel) 92%, var(--surface-panel));
}

.chat-preview-icon-button {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.chat-preview-icon-button:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.chat-preview-icon-button.active {
  color: var(--accent-primary);
}

.chat-preview-icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-preview-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-secondary);
}

.chat-preview-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  padding-top: var(--wm-safe-area-top);
  background: var(--surface-workspace-content);
  color: var(--text-primary);
}

.chat-preview-mobile-overlay[hidden] {
  display: none;
}

.item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 10px;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color var(--motion-fast) var(--ease-standard);
}

.item:hover {
  background: var(--hover);
}

.item.selected {
  background: color-mix(in srgb, var(--surface-panel) 52%, var(--surface-sidebar));
}

.session-list-nav {
  overflow: auto;
  scrollbar-gutter: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-secondary) 46%, transparent) transparent;
}

.session-list-nav-desktop {
  padding-bottom: 16px;
}

.chat-header-archive-control {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.chat-header-archive-control.compact {
  justify-content: flex-end;
}

.session-archive-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 95;
  width: min(260px, calc(100vw - 16px));
  transform-origin: top right;
}

.session-archive-progress {
  margin: 0 4px 8px;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 78%, transparent);
  color: var(--text-secondary);
  display: grid;
  gap: 5px;
  font-size: 11px;
  line-height: 1.3;
}

.session-archive-progress-top {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.session-archive-progress-label {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--text-secondary) 78%, transparent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.session-archive-progress-dismiss {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
  border-radius: 5px;
  background: transparent;
  color: color-mix(in srgb, var(--text-secondary) 72%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.session-archive-progress-dismiss:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text-primary);
}

.session-archive-progress-dismiss:disabled {
  cursor: default;
  opacity: 0.42;
}

.session-archive-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: color-mix(in srgb, var(--text-primary) 82%, transparent);
  font-weight: 600;
}

.session-archive-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border-subtle) 72%, transparent);
}

.session-archive-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb, #65c27a 72%, var(--accent-primary));
}

.session-archive-progress-current,
.session-archive-summary {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.session-search-empty {
  margin: 4px 0 0 21px;
}

.session-state-marker.archived {
  color: color-mix(in srgb, #75a7df 74%, var(--text-primary));
  font-size: 11px;
}





.project-session-menu-btn.restore {
  color: color-mix(in srgb, #65c27a 78%, var(--text-primary));
}



















.wide-project-hub-0 { --hub-accent: #00a6a6; }
.wide-project-hub-1 { --hub-accent: #2f9e44; }
.wide-project-hub-2 { --hub-accent: #bc6c25; }
.wide-project-hub-3 { --hub-accent: #4f86c6; }
.wide-project-hub-4 { --hub-accent: #c879ff; }
.wide-project-hub-5 { --hub-accent: #d9480f; }
.wide-project-hub-6 { --hub-accent: #038c7f; }
.wide-project-hub-7 { --hub-accent: #7b6cb8; }

.recent-sessions-section {
  margin: 0 0 8px;
}

.chat-session-operation {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 2px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.chat-session-operation-icon {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-size: 15px;
}

.chat-session-operation.completed .chat-session-operation-icon {
  color: var(--state-success);
}

.chat-session-operation.fork.completed .chat-session-operation-icon {
  color: var(--text-tertiary);
}

.chat-session-operation.failed .chat-session-operation-icon,
.chat-session-operation.failed .chat-session-operation-detail {
  color: var(--state-danger);
}

.chat-session-operation-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.chat-session-operation-detail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-tertiary);
}




.recent-project-session-group {
  margin: 2px 0;
}


.recent-project-session-group:first-child .recent-project-divider {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}



.recent-project-divider-hub {
  flex: 0 1 auto;
}



.recent-project-session-list {
  position: relative;
}






.chat-hidden-project-list {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed color-mix(in srgb, var(--border-subtle) 82%, transparent);
}

.chat-hidden-project-row {
  margin-bottom: 4px;
  opacity: 0.82;
}

.chat-hidden-project-row .wide-project-row {
  border: 1px dashed color-mix(in srgb, var(--border-subtle) 90%, transparent);
  background: color-mix(in srgb, var(--surface-panel) 72%, transparent);
}

.chat-hidden-project-row .wide-project-row:hover {
  background: color-mix(in srgb, var(--hover) 58%, transparent);
}

.chat-hidden-project-toggle {
  cursor: default;
  color: color-mix(in srgb, var(--text-secondary) 86%, var(--text-primary));
}

.chat-hidden-project-toggle:active {
  transform: none;
}

.chat-hidden-project-folder-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px dashed color-mix(in srgb, var(--text-secondary) 72%, transparent);
  border-radius: 4px;
  pointer-events: none;
}

.chat-hidden-project-folder {
  color: color-mix(in srgb, var(--text-secondary) 84%, transparent) !important;
  text-shadow: none !important;
  opacity: 0.72;
}

.chat-hidden-project-row .wide-project-hub-tag {
  color: color-mix(in srgb, var(--text-secondary) 78%, var(--text-primary));
}

.chat-hidden-project-restore-btn {
  opacity: 0.72;
}

.chat-hidden-project-row .wide-project-row:hover .chat-hidden-project-restore-btn {
  opacity: 1;
}














.session-state-marker {
  min-width: 9px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--text-primary) 38%, transparent);
  flex: 0 0 auto;
}

.session-state-marker.running {
  color: #68a8e8;
  font-size: 11px;
}

.session-state-marker.running .session-state-dot {
  background: #68a8e8;
  animation: session-state-breathe 2s ease-in-out infinite;
}

@keyframes session-state-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .session-state-marker.running .session-state-dot {
    animation: none;
  }
}

.session-state-leading {
  position: absolute;
  left: -6px;
  top: 50%;
  width: 9px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--text-primary) 38%, transparent);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}

.session-state-leading.running {
  left: -10px;
  width: 18px;
  color: #68a8e8;
}

.session-state-leading.permission-pending {
  left: -10px;
  width: 18px;
  color: var(--accent-primary);
  font-size: 13px;
}

.session-permission-count {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 12px;
  height: 12px;
  padding: 0 2px;
  border-radius: 999px;
  color: var(--surface-panel);
  background: var(--accent-primary);
  font-size: 8px;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
}

.session-state-leading.completed-unviewed .session-state-dot {
  background: var(--state-success);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--state-success) 18%, transparent);
}

.session-state-leading.failed-unviewed .session-state-dot {
  background: var(--state-danger);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--state-danger) 18%, transparent);
}

.session-state-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: transparent;
}

.session-state-marker.completed-unviewed .session-state-dot {
  background: var(--state-success);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--state-success) 18%, transparent);
}

.session-state-marker.failed-unviewed .session-state-dot {
  background: var(--state-danger);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--state-danger) 18%, transparent);
}

.draft-session-row-wrap.has-dismiss .draft-session-row {
  padding-right: 27px;
}

.draft-session-row.creating,
.draft-session-row.sendingFirstPrompt {
  color: color-mix(in srgb, var(--text-primary) 82%, transparent);
}

.draft-session-row.failed {
  color: color-mix(in srgb, var(--state-danger) 74%, var(--text-primary));
}

.session-state-marker.draft {
  font-size: 11px;
}

.session-state-marker.draft.creating,
.session-state-marker.draft.sendingFirstPrompt {
  color: #68a8e8;
}

.session-state-marker.draft.failed {
  color: var(--state-danger);
}

.draft-session-dismiss {
  appearance: none;
  position: absolute;
  right: 4px;
  top: 50%;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: color-mix(in srgb, var(--text-primary) 54%, transparent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.draft-session-dismiss:hover {
  background: color-mix(in srgb, var(--state-danger) 13%, var(--hover));
  color: var(--state-danger);
}



















.wide-session-agent-0 { --agent-accent: #5aa9e6; }
.wide-session-agent-1 { --agent-accent: #69db7c; }
.wide-session-agent-2 { --agent-accent: #f7b267; }
.wide-session-agent-3 { --agent-accent: #94d82d; }
.wide-session-agent-4 { --agent-accent: #ec7ab0; }
.wide-session-agent-5 { --agent-accent: #ff8787; }
.wide-session-agent-6 { --agent-accent: #ced4da; }
.wide-session-agent-7 { --agent-accent: #4c6ef5; }
.wide-session-agent-8 { --agent-accent: #22d3ee; }
.wide-session-agent-9 { --agent-accent: #845ef7; }





















.session-list-nav-mobile {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
}

@keyframes mobile-sheet-slide-up {
  from { transform: translateY(102%); }
  to { transform: translateY(0); }
}

.project-session-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 8px 6px 23px;
  padding: 6px 8px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--state-danger) 9%, transparent);
  color: color-mix(in srgb, var(--text-primary) 74%, var(--state-danger));
  font-size: 11px;
}

.project-session-error button {
  border: none;
  border-radius: 5px;
  background: color-mix(in srgb, var(--state-danger) 16%, transparent);
  color: var(--text-primary);
  padding: 3px 7px;
  font: inherit;
  cursor: pointer;
}


.chat-hub-summary {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

.chat-hub-summary-button {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-tertiary);
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
}

.chat-hub-summary-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hub-summary-copy {
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.chat-hub-summary-project-label {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: color-mix(in srgb, var(--text-secondary) 86%, var(--text-primary));
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.chat-hub-summary-button:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.chat-hub-summary-button .sl-icon {
  flex: 0 0 auto;
}

.chat-hub-popover-stack {
  --chat-hub-popover-viewport-offset: 96px;
  --chat-hub-stack-shift: 0px;
  position: fixed;
  left: 12px;
  top: 48px;
  z-index: 86;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transform: translateX(var(--chat-hub-stack-shift));
  transition: transform var(--motion-standard) var(--ease-out);
}

.chat-hub-popover {
  width: var(--chat-hub-menu-width, min(340px, calc(100vw - 24px)));
  min-width: 0;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - var(--chat-hub-popover-viewport-offset));
  max-height: calc(100dvh - var(--chat-hub-popover-viewport-offset));
  overflow: auto;
  letter-spacing: 0;
  text-transform: none;
}

.chat-hub-skill-companion.desktop {
  width: clamp(380px, 40vw, 520px);
  max-height: calc(100vh - var(--chat-hub-popover-viewport-offset));
  max-height: calc(100dvh - var(--chat-hub-popover-viewport-offset));
  overflow: hidden;
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-floating);
  background: color-mix(in srgb, var(--surface-overlay) 88%, transparent);
  box-shadow: var(--shadow-overlay);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  transform-origin: top left;
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

@keyframes chat-hub-companion-out {
  to {
    opacity: 0;
    transform: translateX(6px) scale(0.98);
  }
}

.chat-hub-skill-companion.desktop.sl-menu-exit {
  animation: chat-hub-companion-out var(--motion-exit) var(--ease-out) forwards;
}

/* Project Skills keeps the existing Hub menu as its anchor while giving the
   project controls enough room to read side by side. The board itself owns
   horizontal scrolling; each project column owns its vertical scroll so the
   project chrome stays available while moving through a long skill list. */
@media (min-width: 901px) {
  .chat-hub-project-skills-surface.desktop {
    position: relative;
    flex: 0 0 max(380px, calc(100vw - 380px));
    width: max(380px, calc(100vw - 380px));
    height: calc(100vh - var(--chat-hub-popover-top, 48px) - 16px);
    height: calc(100dvh - var(--chat-hub-popover-top, 48px) - 16px);
    max-height: calc(100dvh - var(--chat-hub-popover-top, 48px) - 16px);
    overflow: hidden;
    /* Long-lived management panel: fully solid floating-panel material, not
       the transient smoked-overlay track. */
    border: 1px solid color-mix(in srgb, var(--border-subtle) 80%, transparent);
    border-radius: 8px;
    background: var(--surface-panel);
    box-shadow: var(--shadow-floating), inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent);
    transform-origin: top left;
    animation: sl-menu-in var(--motion-fast) var(--ease-out);
  }

  /* Single mode narrows the surface to the skill companion width and lets its
     height follow content, capped by the same viewport offset as the popover. */
  .chat-hub-project-skills-surface.desktop[data-project-skills-view='single'] {
    display: flex;
    flex-direction: column;
    flex: 0 0 clamp(380px, 40vw, 520px);
    width: clamp(380px, 40vw, 520px);
    height: auto;
    max-height: calc(100vh - var(--chat-hub-popover-viewport-offset));
    max-height: calc(100dvh - var(--chat-hub-popover-viewport-offset));
  }

  .chat-hub-project-skills-surface.desktop[data-project-skills-view='single'] .chat-hub-project-skills-companion {
    flex: 1 1 auto;
    height: auto;
  }

  .chat-hub-project-skills-companion {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-primary);
  }

  .chat-hub-project-skills-companion-header {
    flex: 0 0 auto;
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
    background: transparent;
  }

  .chat-hub-project-skills-companion-heading {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: baseline;
    gap: 7px;
  }

  .chat-hub-project-skills-companion-heading strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-hub-project-skills-companion-heading span {
    flex: 0 0 auto;
    color: var(--text-tertiary);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .chat-hub-project-skills-mode {
    flex: 0 0 auto;
    display: inline-flex;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
    border-radius: 6px;
  }

  .chat-hub-project-skills-mode button {
    appearance: none;
    min-height: 26px;
    border: 0;
    padding: 2px 8px;
    background: transparent;
    color: var(--text-tertiary);
    font: inherit;
    font-size: 10px;
    font-weight: 650;
    cursor: pointer;
  }

  .chat-hub-project-skills-mode button + button {
    border-left: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
  }

  .chat-hub-project-skills-mode button:hover,
  .chat-hub-project-skills-mode button:focus-visible,
  .chat-hub-project-skills-mode button.selected {
    background: color-mix(in srgb, var(--accent-primary) 14%, var(--surface-panel));
    color: var(--text-primary);
  }

  .chat-hub-project-skills-mode button.selected {
    color: var(--accent-primary);
  }

  .chat-hub-project-skills-companion-close {
    appearance: none;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    padding: 0;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
  }

  .chat-hub-project-skills-companion-close:hover,
  .chat-hub-project-skills-companion-close:focus-visible {
    background: var(--hover);
    color: var(--text-primary);
  }

  .chat-hub-project-skills-single {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 10px 12px;
    scrollbar-width: thin;
  }

  .chat-hub-project-skills-single > .chat-hub-project-skill-select {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 -2px 5px;
    padding: 0 2px 5px;
    background: var(--surface-panel);
  }

  .chat-hub-project-skills-board {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: grid;
    grid-template-rows: repeat(var(--chat-hub-project-skills-row-count), minmax(0, 1fr));
    grid-template-columns: repeat(var(--chat-hub-project-skills-column-count), clamp(280px, 25vw, 340px));
    grid-auto-flow: row;
    align-items: stretch;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .chat-hub-project-skills-column {
    position: relative;
    flex: 0 0 clamp(280px, 25vw, 340px);
    min-width: 280px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Hierarchy comes from typography and hairline dividers, not nested cards. */
  .chat-hub-project-skills-board > .chat-hub-project-skills-column:not([data-row-start='true']) {
    border-left: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
  }

  .chat-hub-project-skills-column-header {
    position: sticky;
    top: 0;
    z-index: 3;
    flex: 0 0 38px;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 9px;
    border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
    background: var(--surface-panel);
  }

  .chat-hub-project-skills-column-name {
    min-width: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-hub-project-skills-column-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: var(--hub-accent, var(--accent-primary));
  }

  .chat-hub-project-skills-column-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0 8px 10px;
    scrollbar-width: thin;
  }

  .chat-hub-project-skills-column-body .chat-hub-skill-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -2px;
    padding-inline: 2px;
    background: var(--surface-panel);
  }

  .chat-hub-project-skills-overlay {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    overflow: hidden;
    border-radius: inherit;
    background: var(--surface-overlay);
    box-shadow: var(--shadow-overlay);
    animation: sl-menu-in var(--motion-fast) var(--ease-out);
  }

  .chat-hub-project-skills-overlay > .chat-hub-skill-companion-content {
    width: 100%;
    height: 100%;
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-hub-project-skills-surface.desktop,
  .chat-hub-project-skills-overlay {
    animation: none;
  }
}

.chat-hub-tree + .chat-hub-tree {
  margin-top: 10px;
}

.chat-hub-tree {
  position: relative;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--hub-accent) 18%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 60%, transparent);
  --hub-accent: var(--accent-primary);
}

.chat-hub-tree.color-open {
  z-index: 3;
}

.chat-hub-row {
  position: relative;
  height: 40px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto 52px 16px;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 7px;
  font-size: 12px;
}

.chat-hub-empty {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 2px 4px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: default;
}

.chat-hub-row:hover {
  background: color-mix(in srgb, var(--hover) 60%, transparent);
}

.chat-hub-tree.expanded > .chat-hub-row {
  background: color-mix(in srgb, var(--hover) 28%, transparent);
}

.chat-hub-tree.expanded > .chat-hub-row:hover {
  background: color-mix(in srgb, var(--hover) 60%, transparent);
}

.chat-hub-color-button,
.chat-hub-expand-button,
.chat-hub-color-swatch,
.chat-hub-project-row {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-hub-color-button {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: 5px;
}

.chat-hub-color-button:hover,
.chat-hub-color-button[aria-expanded="true"],
.chat-hub-expand-button:hover,
.chat-hub-expand-button:focus-visible,
.chat-hub-project-row:hover {
  background: color-mix(in srgb, var(--hover) 86%, transparent);
  color: var(--text-primary);
}

.chat-hub-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--hub-accent);
  border: 1px solid color-mix(in srgb, var(--hub-accent) 68%, rgba(255, 255, 255, 0.28));
}

.chat-hub-expand-button {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  padding: 0;
  font: inherit;
}

.chat-hub-expand-chevron {
  position: relative;
  z-index: 1;
  justify-self: end;
  color: var(--text-tertiary);
  font-size: 14px;
  pointer-events: none;
  transition: transform var(--motion-fast) var(--ease-out);
}

.chat-hub-tree.expanded .chat-hub-expand-chevron {
  transform: rotate(90deg);
}

.chat-hub-row-name {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 650;
  pointer-events: none;
}

.chat-hub-color-palette {
  --chat-hub-color-chip-width: 36px;
  --chat-hub-color-chip-height: 20px;
  --chat-hub-color-chip-radius: 6px;
  position: absolute;
  top: 30px;
  right: 0;
  z-index: 10;
  width: min(248px, calc(100% - 4px));
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chat-hub-color-palette.topbar-menu-surface {
  --popover-origin: top right;
}

.chat-hub-color-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.chat-hub-color-swatch {
  --swatch-color: var(--accent-primary);
  position: relative;
  width: var(--chat-hub-color-chip-width);
  height: var(--chat-hub-color-chip-height);
  justify-self: center;
  border: 1px solid color-mix(in srgb, var(--swatch-color) 46%, var(--border-subtle));
  border-radius: var(--chat-hub-color-chip-radius);
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.13);
}

.chat-hub-color-custom {
  --hub-accent: var(--accent-primary);
  --hub-custom-hue: #ff0000;
  --hub-custom-s: 100%;
  --hub-custom-v: 0%;
  --hub-custom-h: 0%;
  display: grid;
  gap: 7px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 46%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chat-hub-color-custom-header {
  min-height: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--chat-hub-color-chip-width);
  align-items: center;
  gap: 8px;
}

.chat-hub-color-custom-label {
  min-width: 0;
  align-self: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: color-mix(in srgb, var(--text-primary) 86%, var(--text-secondary));
  font-size: 11px;
  font-weight: 700;
}

.chat-hub-color-custom-preview {
  width: var(--chat-hub-color-chip-width);
  height: var(--chat-hub-color-chip-height);
  justify-self: end;
  border: 1px solid color-mix(in srgb, var(--hub-accent) 54%, rgba(255, 255, 255, 0.22));
  border-radius: var(--chat-hub-color-chip-radius);
  background: var(--hub-accent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 1px 4px rgba(0, 0, 0, 0.18);
}

.chat-hub-color-sv {
  position: relative;
  aspect-ratio: 2 / 1;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, transparent);
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  background:
    linear-gradient(to top, #000000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #ffffff, rgba(255, 255, 255, 0)),
    var(--hub-custom-hue);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.chat-hub-color-sv-thumb {
  position: absolute;
  left: clamp(6px, var(--hub-custom-s), calc(100% - 6px));
  top: clamp(6px, var(--hub-custom-v), calc(100% - 6px));
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.46);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.chat-hub-color-hue {
  position: relative;
  height: 14px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
  background: linear-gradient(to right,
    #ff0000 0%,
    #ffff00 17%,
    #00ff00 33%,
    #00ffff 50%,
    #0000ff 67%,
    #ff00ff 83%,
    #ff0000 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.chat-hub-color-hue-thumb {
  position: absolute;
  left: clamp(6px, var(--hub-custom-h), calc(100% - 6px));
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: var(--hub-accent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.46);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.chat-hub-color-swatch.selected {
  border-color: color-mix(in srgb, var(--swatch-color) 64%, var(--text-primary));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    0 0 0 2px color-mix(in srgb, var(--surface-panel) 80%, transparent);
}

.chat-hub-color-swatch.selected::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 6px;
  width: 7px;
  height: 4px;
  border-left: 1.5px solid rgba(255, 255, 255, 0.86);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.86);
  transform: rotate(-45deg);
}

.chat-hub-color-default-badge {
  position: absolute;
  left: 3px;
  bottom: 2px;
  min-width: 10px;
  height: 9px;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.34);
  color: rgba(255, 255, 255, 0.88);
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.chat-hub-project-list {
  margin: 1px 0 3px;
  padding: 2px 0;
}

.chat-hub-project-row {
  width: 100%;
  height: 32px;
  box-sizing: border-box;
  justify-content: flex-start;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 6px;
  padding: 0 5px;
  border-radius: 5px;
  text-align: left;
  font-size: 11px;
}

.chat-hub-project-check {
  width: 14px;
  height: 14px;
  border: 1.5px solid color-mix(in srgb, var(--border-strong) 70%, transparent);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 10px;
  background: transparent;
  transition: border-color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}

.chat-hub-project-row:not(.hidden) .chat-hub-project-check {
  border-color: color-mix(in srgb, var(--text-secondary) 70%, transparent);
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  color: var(--text-primary);
}

.chat-hub-project-row:hover .chat-hub-project-check {
  border-color: var(--text-secondary);
}

.chat-hub-project-row.hidden .chat-hub-project-check {
  color: transparent;
}

.chat-hub-project-row.hidden .chat-hub-project-name {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--text-secondary) 50%, transparent);
}

.chat-hub-project-name,
.chat-hub-project-empty {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hub-project-empty {
  padding: 3px 5px;
  color: var(--text-secondary);
  font-size: 11px;
}

.chat-hub-sections {
  position: relative;
  margin: 2px 0 0;
  padding: 0;
}

.chat-hub-protocol-mismatch {
  padding: 6px 30px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
}

/* Keep expandable Hub regions mounted through their exit so height, opacity,
   and position share one interruptible transition. */
.chat-hub-sections-transition,
.chat-hub-section-body-transition,
.chat-hub-detail-transition {
  display: grid;
  grid-template-rows: 0fr;
  min-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-3px);
  visibility: hidden;
  transition:
    grid-template-rows var(--motion-standard) var(--ease-out),
    opacity var(--motion-standard) var(--ease-out),
    transform var(--motion-standard) var(--ease-out),
    visibility 0s linear var(--motion-standard);
}

.chat-hub-sections-transition.expanded,
.chat-hub-section-body-transition.expanded,
.chat-hub-detail-transition.expanded {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  visibility: visible;
  transition:
    grid-template-rows var(--motion-standard) var(--ease-out),
    opacity var(--motion-standard) var(--ease-out),
    transform var(--motion-standard) var(--ease-out),
    visibility 0s linear 0s;
}

.chat-hub-sections-transition.exiting,
.chat-hub-section-body-transition.exiting,
.chat-hub-detail-transition.exiting {
  transition:
    grid-template-rows var(--motion-exit) var(--ease-out),
    opacity var(--motion-exit) var(--ease-out),
    transform var(--motion-exit) var(--ease-out),
    visibility 0s linear var(--motion-exit);
}

.chat-hub-sections-transition.entering,
.chat-hub-section-body-transition.entering,
.chat-hub-detail-transition.entering {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  visibility: visible;
}

.chat-hub-sections-transition > .chat-hub-sections,
.chat-hub-section-body-transition > .chat-hub-section-body,
.chat-hub-detail-transition > .chat-hub-detail {
  min-height: 0;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .chat-hub-sections-transition,
  .chat-hub-section-body-transition,
  .chat-hub-detail-transition,
  .chat-hub-sections-transition.expanded,
  .chat-hub-section-body-transition.expanded,
  .chat-hub-detail-transition.expanded,
  .chat-hub-sections-transition.exiting,
  .chat-hub-section-body-transition.exiting,
  .chat-hub-detail-transition.exiting,
  .chat-hub-sections-transition.entering,
  .chat-hub-section-body-transition.entering,
  .chat-hub-detail-transition.entering,
  .chat-hub-expand-chevron,
  .chat-hub-section-chevron,
  .chat-hub-project-skill-trigger > .sl-icon,
  .chat-hub-popover-stack {
    animation: none;
    transition: none;
    transform: none;
  }
}

.chat-hub-section + .chat-hub-section {
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 30%, transparent);
}

.chat-hub-section-header {
  appearance: none;
  border: none;
  background: transparent;
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}

.chat-hub-section-header:hover,
.chat-hub-section-header:focus-visible {
  background: color-mix(in srgb, var(--hover) 86%, transparent);
  color: var(--text-primary);
}

.chat-hub-section-icon {
  flex: 0 0 auto;
  color: var(--text-tertiary);
}

.chat-hub-section-label {
  color: var(--text-primary);
  font-weight: 600;
}

.chat-hub-section-summary {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  color: var(--text-tertiary);
  font-size: 10px;
}

.chat-hub-settings-state {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.chat-hub-settings-state-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 999px;
  background: var(--text-tertiary);
}

.chat-hub-settings-state.on .chat-hub-settings-state-dot {
  background: var(--state-success);
}

.chat-hub-section-chevron {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  transition: transform var(--motion-fast) var(--ease-out);
}

.chat-hub-section-header.expanded .chat-hub-section-chevron {
  transform: rotate(90deg);
}

.chat-hub-section-body {
  margin: 0 0 4px 2px;
  padding: 2px 0 4px;
}

.chat-hub-section-body .chat-hub-project-list {
  margin-left: 0;
}

.chat-hub-settings {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-hub-flicker-row {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.chat-hub-flicker-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.chat-hub-flicker-modes {
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
  border-radius: 6px;
  overflow: hidden;
}

.chat-hub-flicker-modes button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  cursor: pointer;
}

.chat-hub-flicker-modes button + button {
  border-left: 1px solid color-mix(in srgb, var(--border-subtle) 45%, transparent);
}

.chat-hub-flicker-modes button:hover:not(:disabled):not(.selected) {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--hover) 70%, transparent);
}

.chat-hub-flicker-modes button.selected {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--hover) 90%, transparent);
}

.chat-hub-flicker-modes button:disabled {
  cursor: default;
}

.chat-hub-flicker-modes button:disabled:not(.selected) {
  opacity: 0.5;
}

.chat-hub-settings-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-primary);
}

.chat-hub-settings-row-icon {
  color: var(--text-tertiary);
}

.chat-hub-settings-keys {
  display: flex;
  flex-direction: column;
  margin-top: 2px;
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 30%, transparent);
  padding-top: 3px;
}

.secret-compact-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 1px 2px;
}

.secret-compact-status {
  flex: 0 0 auto;
  width: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

.secret-compact-status.configured {
  color: var(--state-success);
}

.secret-compact-label {
  flex: 0 0 auto;
  min-width: 52px;
  font-size: 11px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secret-compact-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 22px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 65%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface-canvas) 55%, transparent);
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
}

.secret-compact-input:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 65%, transparent);
}

.secret-compact-input::placeholder {
  color: var(--text-tertiary);
}

.secret-compact-set {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  border-radius: 5px;
  padding: 2px 8px;
  cursor: pointer;
}

.secret-compact-set:hover:not(:disabled) {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--hover) 80%, transparent);
}

.secret-compact-set:disabled {
  opacity: 0.45;
  cursor: default;
}

.secret-compact-clear {
  appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.secret-compact-clear:hover:not(:disabled) {
  color: var(--danger, #df6674);
  background: color-mix(in srgb, var(--hover) 80%, transparent);
}

.secret-compact-clear:disabled {
  opacity: 0.45;
  cursor: default;
}

.chat-hub-settings-hint {
  padding: 4px 2px 0;
  font-size: 10px;
  color: var(--text-tertiary);
}

.chat-hub-settings-hint.error {
  color: var(--danger, #df6674);
}

.chat-hub-line {
  height: 40px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 14px minmax(44px, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  font-size: 11px;
}

.chat-hub-line + .chat-hub-line,
.chat-hub-section + .chat-hub-line,
.chat-hub-line + .chat-hub-section,
.chat-hub-line + .chat-hub-detail-transition,
.chat-hub-detail-transition + .chat-hub-line,
.chat-hub-line + .chat-hub-detail,
.chat-hub-detail + .chat-hub-line {
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 30%, transparent);
}

.chat-hub-line-icon {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--text-tertiary);
}

.chat-hub-line-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-weight: 600;
}

.chat-hub-line-actions {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  height: 40px;
}

.chat-hub-action {
  appearance: none;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.chat-hub-line-actions > .chat-hub-action + .chat-hub-action {
  border-left: 1px solid color-mix(in srgb, var(--border-subtle) 50%, transparent);
}

.chat-hub-action.expanded {
  background: color-mix(in srgb, var(--hover) 66%, transparent);
}

.chat-hub-disclosure-action {
  position: relative;
}

.chat-hub-update-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--surface-panel);
  pointer-events: none;
  animation: chat-hub-dot-in var(--motion-fast) var(--ease-out);
}

@keyframes chat-hub-dot-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-hub-update-dot {
    animation: none;
  }
}

.chat-hub-action:hover:not(:disabled),
.chat-hub-action:focus-visible {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--hover) 70%, transparent);
}

.chat-hub-action:disabled {
  opacity: 0.5;
  cursor: default;
}

.chat-hub-action-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Shared hover/focus easing for every ghost control in the hub menu so state
   changes never snap. */
.chat-hub-row,
.chat-hub-color-button,
.chat-hub-section-header,
.chat-hub-action,
.chat-hub-icon-btn,
.chat-hub-detail-action,
.chat-hub-project-row,
.chat-hub-project-skill-trigger,
.chat-hub-project-skill-option,
.chat-hub-flicker-modes button,
.chat-hub-skill-source-actions button,
.chat-hub-skill-row-actions button,
button.chat-hub-skill-name {
  transition: background-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}

@media (prefers-reduced-motion: reduce) {
  .chat-hub-row,
  .chat-hub-color-button,
  .chat-hub-section-header,
  .chat-hub-action,
  .chat-hub-icon-btn,
  .chat-hub-detail-action,
  .chat-hub-project-row,
  .chat-hub-project-skill-trigger,
  .chat-hub-project-skill-option,
  .chat-hub-flicker-modes button,
  .chat-hub-skill-source-actions button,
  .chat-hub-skill-row-actions button,
  button.chat-hub-skill-name {
    transition-property: background, background-color, border-color, color, box-shadow, outline-color, opacity;
  }
}

.chat-hub-action-info {
  flex: 0 0 auto;
  min-width: 18px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.chat-hub-version-readout {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.chat-hub-row-name-group {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.chat-hub-gateway-capsule {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 64%, transparent);
  color: var(--text-tertiary);
  font: inherit;
  line-height: 1;
  white-space: nowrap;
  pointer-events: auto;
}

button.chat-hub-gateway-capsule {
  appearance: none;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}

button.chat-hub-gateway-capsule:hover:not(:disabled),
button.chat-hub-gateway-capsule:focus-visible {
  background: color-mix(in srgb, var(--hover) 70%, transparent);
  border-color: color-mix(in srgb, var(--border-subtle) 90%, transparent);
}

button.chat-hub-gateway-capsule:disabled {
  cursor: default;
}

.chat-hub-gateway-capsule-label {
  color: var(--text-secondary);
  font-weight: 650;
}

.chat-hub-gateway-capsule .chat-hub-update-dot {
  top: -3px;
  right: -3px;
}

@media (prefers-reduced-motion: reduce) {
  button.chat-hub-gateway-capsule {
    transition: none;
  }
}

.chat-hub-version-action .chat-hub-action-label {
  font-variant-numeric: tabular-nums;
}

.chat-hub-row-actions {
  position: relative;
  z-index: 1;
  justify-self: end;
  width: 52px;
  display: grid;
  grid-template-columns: repeat(2, 24px);
  gap: 2px;
}

.chat-hub-row-actions .chat-hub-version-action {
  position: relative;
  height: 28px;
  padding: 2px 4px;
  border-color: transparent;
  background: transparent;
}

.chat-hub-row-actions .chat-hub-version-action:disabled .sl-icon {
  opacity: 0.45;
}

.chat-hub-detail {
  margin: 0 2px 5px;
  padding: 2px 6px 5px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 42%, transparent);
}

.chat-hub-detail-toolbar {
  height: 36px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.chat-hub-detail-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
}

.chat-hub-detail-action {
  appearance: none;
  min-height: 24px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.chat-hub-detail-action:hover:not(:disabled),
.chat-hub-detail-action:focus-visible {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--hover) 80%, transparent);
}

.chat-hub-detail-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.chat-hub-detail-empty {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 2px;
  color: var(--text-tertiary);
  font-size: 10px;
}

.chat-hub-detail-error {
  padding: 8px 10px;
  color: var(--danger, #df6674);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.chat-hub-mcp-toolbar-actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.chat-hub-mcp-toolbar-actions .chat-hub-detail-action {
  min-height: 22px;
  padding-inline: 5px;
  font-size: 9px;
}

.chat-hub-mcp-import-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.chat-hub-mcp-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  align-items: center;
  gap: 6px;
  padding: 3px 2px 3px 4px;
  border-radius: 5px;
}

.chat-hub-mcp-row:hover {
  background: color-mix(in srgb, var(--hover) 48%, transparent);
}

.chat-hub-mcp-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-hub-mcp-name,
.chat-hub-mcp-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hub-mcp-name {
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
}

.chat-hub-mcp-meta {
  color: var(--text-tertiary);
  font-size: 9px;
}

.chat-hub-mcp-status {
  font-size: 9px;
  white-space: nowrap;
}

.chat-hub-mcp-status.state-connected {
  color: var(--state-success);
}

.chat-hub-mcp-status.state-starting,
.chat-hub-mcp-status.state-not_started {
  color: var(--text-secondary);
}

.chat-hub-mcp-status.state-failed {
  color: var(--danger, #df6674);
}

.chat-hub-mcp-status.state-disabled {
  color: var(--text-tertiary);
}

.chat-hub-mcp-actions {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.chat-hub-mcp-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 5px 2px 7px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 35%, transparent);
}

.chat-hub-mcp-import-preview {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 2px 0 6px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 28%, var(--border-subtle));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent-primary) 6%, transparent);
}

.chat-hub-mcp-import-preview-title {
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 600;
}

.chat-hub-mcp-import-preview-summary {
  color: var(--text-secondary);
  font-size: 9px;
}

.chat-hub-mcp-import-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.chat-hub-mcp-import-preview-chip {
  padding: 2px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-raised) 76%, transparent);
  color: var(--text-secondary);
  font-size: 9px;
}

.chat-hub-mcp-form label,
.chat-hub-mcp-values-toolbar {
  color: var(--text-secondary);
  font-size: 9px;
}

.chat-hub-mcp-form label > span {
  display: block;
  margin-bottom: 3px;
}

.chat-hub-mcp-form small {
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 400;
}

.chat-hub-mcp-form input:not([type='checkbox']),
.chat-hub-mcp-form select,
.chat-hub-mcp-form textarea,
.chat-hub-skill-add-repository-input-row input {
  width: 100%;
  box-sizing: border-box;
  min-height: 25px;
  padding: 4px 6px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 80%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface-panel) 70%, transparent);
  color: var(--text-primary);
  font: inherit;
  font-size: 10px;
}

.chat-hub-mcp-form textarea {
  resize: vertical;
}

.chat-hub-mcp-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 6px;
}

.chat-hub-mcp-values {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-hub-mcp-values-toolbar {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-hub-mcp-value-row {
  display: grid;
  grid-template-columns: minmax(70px, .8fr) minmax(80px, 1.2fr) max-content 24px;
  align-items: center;
  gap: 4px;
}

.chat-hub-mcp-secret-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.chat-hub-mcp-secret-toggle input {
  margin: 0;
}

.chat-hub-mcp-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.chat-hub-detail-action.accent {
  color: var(--accent-primary);
}

@media (max-width: 620px) {
  .chat-hub-mcp-toolbar-actions {
    gap: 0;
  }

  .chat-hub-mcp-toolbar-actions .chat-hub-detail-action {
    max-width: 25px;
    overflow: hidden;
    white-space: nowrap;
  }

  .chat-hub-mcp-form-grid {
    grid-template-columns: 1fr;
  }

  .chat-hub-mcp-value-row {
    grid-template-columns: minmax(70px, 1fr) minmax(80px, 1fr) max-content 24px;
  }
}

.chat-hub-npm-row,
.chat-hub-scan-row,
.chat-hub-skill-row {
  height: 32px;
  box-sizing: border-box;
  display: grid;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  border-radius: 5px;
}

.chat-hub-npm-row {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.chat-hub-skill-row {
  grid-template-columns: minmax(0, 1fr) 52px;
  min-height: 32px;
  height: auto;
}

.chat-hub-scan-row {
  grid-template-columns: minmax(0, 1fr) max-content 24px;
}

.chat-hub-npm-row:hover,
.chat-hub-skill-row:hover,
.chat-hub-scan-row:hover {
  background: color-mix(in srgb, var(--hover) 48%, transparent);
}

.chat-hub-scan-name,
.chat-hub-skill-name {
  min-width: 0;
  font-size: 11px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hub-skill-name-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

button.chat-hub-skill-name {
  appearance: none;
  display: block;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 2px 3px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

button.chat-hub-skill-name:hover:not(:disabled),
button.chat-hub-skill-name:focus-visible {
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--hover) 64%, transparent);
}

button.chat-hub-skill-name:disabled {
  cursor: default;
}

/* Name and version read as one left-side unit; actions hug the right edge
   so uninstall always lands in the same trailing column. */
.chat-hub-npm-name-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Agent marks are transparent layers; the small badge never gets a capsule or
   filled backing, so composite profiles remain lightweight in both themes. */
.agent-icon {
  position: relative;
  display: inline-flex;
  width: var(--agent-icon-size, 16px);
  height: var(--agent-icon-size, 16px);
  flex: none;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.agent-icon-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.agent-icon-image.monochrome {
  filter: brightness(0) invert(1);
}
.theme-light .agent-icon-image.monochrome {
  filter: none;
}
.agent-icon-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  z-index: 1;
  display: inline-flex;
  width: var(--agent-icon-badge-size, 9px);
  height: var(--agent-icon-badge-size, 9px);
  align-items: center;
  justify-content: center;
  background: transparent;
  filter: drop-shadow(0 0 1px var(--surface-sidebar));
}

/* Package names reuse the session-list agent mark: the wide-session-agent-N
   variant classes (above) supply each agent's --agent-accent color. */
.chat-hub-npm-agent-tag {
  width: 18px;
  height: 18px;
  flex: none;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  line-height: 0;
  color: var(--text-primary);
}
.chat-hub-npm-agent-tag:empty {
  display: none;
}

.chat-hub-npm-package-name {
  min-width: 0;
  max-width: 220px;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 24%, var(--border-subtle));
  border-radius: 999px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--surface-panel));
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
}

.theme-light .chat-hub-npm-agent-tag {
  color: var(--text-primary);
}

.chat-hub-npm-versions {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.chat-hub-npm-version-copy {
  font-variant-numeric: tabular-nums;
}

.chat-hub-npm-version-new {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 6px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 24%, var(--border-subtle));
  border-radius: 999px;
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 9%, var(--surface-panel));
  font-weight: 600;
}

.chat-hub-npm-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

/* The update action borrows the accent color so outdated rows read as
   actionable without a label; install and uninstall stay quiet. */
.chat-hub-icon-btn.accent {
  color: var(--accent-primary);
}

.chat-hub-icon-btn.accent:hover:not(:disabled),
.chat-hub-icon-btn.accent:focus-visible {
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.chat-hub-action-slot {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-hub-skill-scope {
  min-width: 0;
}

.chat-hub-skill-toolbar {
  height: 36px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.chat-hub-skill-toolbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

/* The Show all toggle keeps the shared hover fill as its pressed state. */
.chat-hub-skill-toolbar .chat-hub-detail-action[aria-pressed='true'] {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--hover) 80%, transparent);
}

.chat-hub-skill-source-actions button,
.chat-hub-skill-row-actions button {
  appearance: none;
  min-width: 24px;
  height: 24px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 5px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.chat-hub-skill-source-actions button:hover:not(:disabled),
.chat-hub-skill-row-actions button:hover:not(:disabled),
.chat-hub-skill-source-actions button:focus-visible,
.chat-hub-skill-row-actions button:focus-visible {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--hover) 80%, transparent);
}

.chat-hub-skill-source-actions button:disabled,
.chat-hub-skill-row-actions button:disabled {
  opacity: 0.42;
  cursor: default;
}

.chat-hub-skill-source-actions button.is-danger,
.chat-hub-skill-row-actions button.is-danger {
  color: var(--state-danger);
}

.chat-hub-skill-row-actions button.is-danger:hover:not(:disabled),
.chat-hub-skill-row-actions button.is-danger:focus-visible {
  color: var(--state-danger);
  background: color-mix(in srgb, var(--state-danger) 10%, transparent);
}

.chat-hub-skill-status {
  flex: 0 0 auto;
  max-width: 106px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  color: var(--text-tertiary);
}

.chat-hub-skill-status.is-danger {
  color: var(--state-danger);
}

.chat-hub-skill-status.is-warning {
  color: var(--state-warning);
}

.chat-hub-skill-status.is-neutral {
  color: var(--text-tertiary);
}

.chat-hub-skill-row-actions {
  display: grid;
  grid-template-columns: repeat(2, 24px);
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.chat-hub-skill-action-slot {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-hub-skill-row.is-uninstalled .chat-hub-skill-name {
  color: var(--text-secondary);
}

.chat-hub-skill-row.is-removed {
  background: color-mix(in srgb, var(--state-danger) 7%, transparent);
}

.chat-hub-skill-row.is-conflict {
  background: color-mix(in srgb, var(--text-tertiary) 7%, transparent);
}

.chat-hub-skill-sources {
  display: grid;
  gap: 7px;
}

.chat-hub-skill-add-repository {
  border: 1px dashed color-mix(in srgb, var(--border-subtle) 75%, transparent);
  border-radius: 7px;
  overflow: hidden;
}

.chat-hub-skill-add-repository.is-expanded {
  border-style: solid;
  border-color: color-mix(in srgb, var(--border-subtle) 68%, transparent);
  background: color-mix(in srgb, var(--surface-panel) 75%, transparent);
}

.chat-hub-skill-add-repository-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.chat-hub-skill-add-repository-trigger:hover:not(:disabled),
.chat-hub-skill-add-repository-trigger:focus-visible {
  background: color-mix(in srgb, var(--surface-hover) 65%, transparent);
  color: var(--text-primary);
}

.chat-hub-skill-add-repository-form {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.chat-hub-skill-add-repository-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-hub-skill-add-repository-input-row input {
  min-width: 0;
  flex: 1;
}

.chat-hub-skill-add-repository-hint {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 10px;
}

.chat-hub-skill-source {
  min-width: 0;
  overflow: hidden;
}

.chat-hub-skill-source-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px 7px;
  min-height: 34px;
  padding: 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 50%, transparent);
}

.chat-hub-skill-source-identity {
  min-width: 0;
  flex: 1 1 150px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-hub-skill-source-identity strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 10px;
  font-weight: 600;
}

.chat-hub-skill-source-state {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-hub-skill-source-state.is-stale,
.chat-hub-skill-source-state.is-pending_removal {
  color: var(--state-warning);
}

.chat-hub-skill-source-actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1px;
}

.chat-hub-skill-source-disclosure {
  min-width: 0;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  height: 24px;
  border: 0;
  border-radius: 5px;
  padding: 0 4px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-hub-skill-source-disclosure:hover,
.chat-hub-skill-source-disclosure:focus-visible {
  background: color-mix(in srgb, var(--hover) 80%, transparent);
}

.chat-hub-skill-source-disclosure .sl-icon {
  flex: 0 0 14px;
  color: var(--text-tertiary);
}

.chat-hub-skill-source-disclosure strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 11px;
  font-weight: 650;
}

.chat-hub-skill-source-status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.chat-hub-skill-source-status-dot.is-ready {
  background: var(--state-success);
}

.chat-hub-skill-source-status-dot.is-needs-refresh,
.chat-hub-skill-source-status-dot.is-stale,
.chat-hub-skill-source-status-dot.is-pending-removal,
.chat-hub-skill-source-status-dot.is-update-available {
  background: var(--state-warning);
}

.chat-hub-skill-source-status-dot.is-error {
  background: var(--state-danger);
}

.chat-hub-skill-source-count {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chat-hub-skill-source-update {
  flex: 0 0 auto;
  color: var(--accent-primary);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.chat-hub-skill-source-error {
  padding: 5px 7px;
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 7%, transparent);
  font-size: 9px;
}

.chat-hub-skill-source-empty {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  color: var(--text-tertiary);
  font-size: 9px;
}

/* The skill list stays mounted so collapse can animate: grid-template-rows
   0fr → 1fr, with visibility keeping collapsed content unfocusable. */
.chat-hub-skill-list-collapsible {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows var(--motion-standard) var(--ease-out),
    visibility 0s linear var(--motion-standard);
}

.chat-hub-skill-list-collapsible[data-expanded='true'] {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows var(--motion-standard) var(--ease-out);
}

.chat-hub-skill-list-collapsible > .chat-hub-skill-list {
  overflow: hidden;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  .chat-hub-skill-list-collapsible {
    transition: none;
  }
}

.chat-hub-skill-source .chat-hub-skill-list {
  padding: 2px 4px;
}

.chat-hub-skill-operation-results {
  margin: 0 0 7px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 68%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-panel) 75%, transparent);
}

.chat-hub-skill-operation-results.is-partial,
.chat-hub-skill-operation-results.is-failed {
  border-color: color-mix(in srgb, var(--state-danger) 34%, var(--border-subtle));
}

.chat-hub-skill-operation-results > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  color: var(--text-secondary);
  font-size: 9px;
}

.chat-hub-skill-operation-results > header span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--text-tertiary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hub-skill-operation-dismiss {
  appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  padding: 0;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.chat-hub-skill-operation-dismiss:hover,
.chat-hub-skill-operation-dismiss:focus-visible {
  background: color-mix(in srgb, var(--hover) 80%, transparent);
  color: var(--text-primary);
}

.chat-hub-skill-operation-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  padding: 0 7px;
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 45%, transparent);
  color: var(--text-tertiary);
  font-size: 9px;
}

.chat-hub-skill-operation-result > span:first-child {
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hub-skill-operation-result strong {
  color: var(--text-secondary);
  font-weight: 650;
}

.chat-hub-skill-operation-result[data-result-status='failed'] strong {
  color: var(--state-danger);
}

.chat-hub-skill-state {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px;
  color: var(--text-tertiary);
  font-size: 10px;
}

.chat-hub-skill-state.is-error {
  color: var(--state-danger);
}

.chat-hub-skill-state.is-empty {
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 6px;
}

.chat-hub-skill-empty-cta {
  appearance: none;
  min-height: 24px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.chat-hub-skill-empty-cta:hover:not(:disabled),
.chat-hub-skill-empty-cta:focus-visible {
  background: color-mix(in srgb, var(--hover) 80%, transparent);
}

.chat-hub-skill-state button {
  margin-left: auto;
}

.chat-hub-skill-state button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.chat-hub-project-skill-select {
  position: relative;
  margin: 2px 0 4px;
}

.chat-hub-project-skill-trigger {
  appearance: none;
  width: 100%;
  height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 64%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-panel) 58%, transparent);
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.chat-hub-project-skill-trigger:hover,
.chat-hub-project-skill-trigger:focus-visible,
.chat-hub-project-skill-trigger[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent-primary) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--hover) 70%, transparent);
}

.chat-hub-project-skill-trigger > .sl-icon {
  color: var(--text-tertiary);
  transition: transform var(--motion-fast) var(--ease-out);
}

.chat-hub-project-skill-trigger[aria-expanded="true"] > .sl-icon {
  transform: rotate(180deg);
}

.chat-hub-project-skill-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 6;
  max-height: 192px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 8px;
  background: var(--surface-overlay);
  box-shadow: var(--shadow-floating);
}

.chat-hub-project-skill-option {
  appearance: none;
  width: 100%;
  height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.chat-hub-project-skill-option.selected {
  background: var(--accent-soft-bg);
  color: var(--accent-primary);
}

.chat-hub-project-skill-option:hover,
.chat-hub-project-skill-option:focus-visible {
  background: color-mix(in srgb, var(--hover) 78%, transparent);
  color: var(--text-primary);
}

.chat-hub-project-skill-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hub-project-skill-count {
  color: currentColor;
  font-variant-numeric: tabular-nums;
  opacity: 0.72;
}

.chat-hub-scan-status {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--text-tertiary);
}

.chat-hub-scan-status.status-indexed {
  color: var(--state-success);
}

.chat-hub-scan-status.status-error,
.chat-hub-scan-status.status-failed {
  color: var(--danger, #df6674);
}

.chat-hub-icon-btn {
  appearance: none;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-hub-icon-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--hover) 80%, transparent);
}

.chat-hub-icon-btn.danger:hover:not(:disabled),
.chat-hub-icon-btn.danger:focus-visible {
  color: var(--danger, #df6674);
  background: color-mix(in srgb, var(--danger, #df6674) 10%, transparent);
}

.chat-hub-icon-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.chat-hub-ops-error {
  padding: 4px 2px 0;
  font-size: 10px;
  color: var(--danger, #df6674);
}

.chat-hub-footer {
  min-height: 44px;
  margin: 8px 4px 0;
  padding: 6px 6px max(6px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-hub-footer-version {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 600;
}

.chat-hub-footer-version-value {
  color: var(--accent-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chat-hub-footer-update-all {
  appearance: none;
  min-height: 30px;
  border: 1px solid var(--accent-primary);
  background: var(--accent-primary);
  color: var(--button-primary-text, #fff);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.chat-hub-footer-update-all:hover:not(:disabled) {
  color: var(--button-primary-text, #fff);
  background: color-mix(in srgb, var(--accent-primary) 88%, var(--text-primary));
}

.chat-hub-footer-update-all:disabled {
  border-color: color-mix(in srgb, var(--border-subtle) 60%, transparent);
  background: var(--surface-panel);
  color: var(--text-secondary);
  opacity: 1;
  cursor: default;
}

.chat-hub-color-palette.inline {
  position: static;
  width: 100%;
  max-width: none;
  box-shadow: none;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 45%, transparent);
  margin: 2px 0 4px;
}

.chat-hub-skill-companion-content {
  max-height: inherit;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-hub-skill-companion-header {
  flex: 0 0 auto;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
}

.chat-hub-skill-companion-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-hub-skill-companion-title {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hub-skill-companion-scope {
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hub-skill-companion-close {
  appearance: none;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.chat-hub-skill-companion-close:hover,
.chat-hub-skill-companion-close:focus-visible {
  color: var(--text-primary);
  background: var(--hover);
}

.chat-hub-skill-companion-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.chat-hub-skill-companion-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px;
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
}

.chat-hub-skill-companion-footer .set-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chat-hub-page {
  position: fixed;
  inset: 0;
  z-index: 86;
  display: flex;
  flex-direction: column;
  background: var(--surface-panel);
  animation: mobile-sheet-slide-up var(--motion-emphasized) var(--ease-out);
}

@keyframes mobile-sheet-slide-down {
  from { transform: translateY(0); }
  to { transform: translateY(102%); }
}

/* Exit mirrors entry: the page slides back down instead of fading. */
.chat-hub-page.sl-menu-exit {
  animation: mobile-sheet-slide-down var(--motion-exit) var(--ease-out) forwards;
}

/* Bottom sheets share the slide-down exit; the generic sl-menu-out
   fade+scale does not match their slide-up entry. */
.mobile-project-sheet.sl-menu-exit {
  animation: mobile-sheet-slide-down var(--motion-exit) var(--ease-out) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .chat-hub-page,
  .chat-hub-page.sl-menu-exit,
  .mobile-project-sheet,
  .mobile-project-sheet.sl-menu-exit {
    animation: none;
  }
}

.chat-hub-page-header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
}

.chat-hub-page-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-hub-page-back {
  appearance: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.chat-hub-page-back:hover,
.chat-hub-page-back:focus-visible {
  background: var(--hover);
  color: var(--text-primary);
}

.chat-hub-page-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 16px);
}

.chat-hub-page-body.skill-child {
  display: flex;
  padding: 0;
}

.chat-hub-page-body.skill-child .chat-hub-skill-companion-content {
  flex: 1;
  width: 100%;
}

.chat-hub-page .chat-hub-tree {
  padding: 4px;
}

@media (max-width: 899px) {
  .chat-hub-page-body.skill-child .chat-hub-skill-companion-content {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .chat-hub-detail-action {
    min-height: 32px;
  }

  .chat-hub-flicker-row {
    min-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-hub-skill-companion.desktop {
    animation: none;
  }
}

.chat-main {
  --chat-scrollbar-gutter-width: 8px;
  --chat-edge-surface-width: var(--chat-session-panel-width);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  position: relative;
}

.chat-session-sidebar-toggle-floating {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: calc(var(--layer-workspace-chrome) + 1);
  width: 36px;
  height: 36px;
  min-height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  padding: 0;
  background: var(--surface-panel);
  box-shadow: var(--shadow-floating);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out);
}

.chat-session-sidebar-toggle-floating:hover,
.chat-session-sidebar-toggle-floating:focus-visible,
.chat-session-sidebar-toggle-floating.active {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent-primary) 46%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 20%, var(--surface-overlay));
}

.chat-session-sidebar-toggle-floating:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 74%, transparent);
  outline-offset: 2px;
}

.chat-session-sidebar-toggle-floating .sl-icon {
  width: 14px;
  height: 14px;
}

.chat-main > .chat-block,
.chat-main > .chat-search-bar {
  position: relative;
  z-index: 1;
}

.chat-block {
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  padding: 20px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-virtuoso-list {
  flex: 0 0 auto;
  width: 100%;
}

.chat-virtuoso-row {
  box-sizing: border-box;
  width: 100%;
}

.chat-view-width-fixed-800 .chat-view-content {
  width: min(var(--chat-view-column-width, 800px), 100%);
  margin-left: auto;
  margin-right: auto;
}

.chat-view-width-fixed-800 .chat-composer-content {
  width: min(var(--chat-view-column-width, 800px), 100%);
  margin-left: auto;
  margin-right: auto;
}

.chat-view-width-fixed-800 .chat-composer {
  /* Mirror the chat-block content box exactly: 18px padding plus the 8px
     classic scrollbar that .chat-block always shows (overflow-y: scroll +
     scrollbar-gutter: stable). Both columns then resolve
     min(var(--chat-view-column-width, 800px), 100%) centering and the
     edge-surface clamps against identical reference widths, so their
     left/right edges cannot drift apart when the preview squeezes the
     chat column. */
  padding-left: 18px;
  padding-right: calc(18px + var(--chat-scrollbar-gutter-width, 8px));
}

.chat-virtuoso-footer {
  flex: 0 0 auto;
  width: 100%;
}

.chat-prompt-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 14px;
}

.chat-turn-search-highlight {
  border-radius: 8px;
  outline: 1px solid color-mix(in srgb, var(--accent-primary) 38%, var(--border-subtle));
  outline-offset: 2px;
  transition: outline-color var(--motion-fast) var(--ease-standard);
}

.chat-prompt-group + .chat-prompt-group {
}

.chat-prompt-user {
  display: inline-block;
  align-self: flex-start;
  max-width: min(920px, calc(100% - 28px));
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 26%, var(--border-subtle));
  border-radius: var(--radius-panel);
  background: color-mix(in srgb, var(--accent-primary) 12%, var(--surface-workspace-content));
  font-size: 13px;
  color: color-mix(in srgb, var(--text-primary) 78%, var(--accent-primary));
  box-shadow: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-prompt-user-row {
  display: inline-flex;
  align-self: flex-start;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px 8px;
  width: 100%;
  max-width: min(920px, 100%);
}

.chat-prompt-status {
  flex: 0 0 auto;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.chat-prompt-status-responding {
  width: auto;
  min-width: 18px;
}

.chat-prompt-status-confirming {
  color: color-mix(in srgb, var(--text-secondary) 88%, var(--accent-primary));
}

.chat-prompt-status-queued {
  width: auto;
  height: 18px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  color: color-mix(in srgb, var(--accent-primary) 82%, var(--text-primary));
  font-size: 11px;
  line-height: 16px;
  padding: 0 7px;
}

.chat-prompt-status-queued.steering,
.chat-prompt-status-queued.cancelling {
  border-color: color-mix(in srgb, var(--state-warning) 44%, transparent);
  background: color-mix(in srgb, var(--state-warning) 10%, transparent);
  color: color-mix(in srgb, var(--state-warning) 84%, var(--text-primary));
}

.chat-prompt-status-queued.failed {
  border-color: color-mix(in srgb, var(--state-danger) 48%, transparent);
  background: color-mix(in srgb, var(--state-danger) 10%, transparent);
  color: color-mix(in srgb, var(--state-danger) 88%, var(--text-primary));
}

.chat-prompt-status-dots {
  display: inline-flex;
  gap: 1px;
  font-size: 12px;
  line-height: 1;
  color: color-mix(in srgb, var(--text-primary) 76%, var(--accent-primary));
  contain: paint;
}

.chat-prompt-status-dots span {
  display: inline-block;
  will-change: opacity;
  animation: chat-prompt-dots-wave 1.2s infinite ease-in-out;
}

.chat-prompt-status-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-prompt-status-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chat-prompt-dots-wave {
  0%,
  80%,
  100% {
    opacity: 0.28;
  }
  40% {
    opacity: 1;
  }
}

.chat-prompt-delivery-line {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  margin-top: -2px;
  font-size: 11px;
  color: var(--text-secondary);
}

.chat-prompt-delivery-line button {
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 86%, transparent);
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0 7px;
}

.chat-prompt-delivery-line button:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 34%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
}

.chat-prompt-queue-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-prompt-queue-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface-panel);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.chat-prompt-queue-action:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 44%, var(--border-subtle));
  color: var(--text-primary);
}

.chat-prompt-queue-action.danger:hover {
  border-color: color-mix(in srgb, var(--state-danger) 50%, var(--border-subtle));
  color: var(--state-danger);
}

.chat-prompt-queue-action:disabled {
  cursor: default;
  opacity: 0.46;
}

.chat-prompt-queue-action:disabled:hover {
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.chat-prompt-queue-action:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 58%, transparent);
  outline-offset: 2px;
}

.chat-queue-compact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--text-secondary);
  font-size: 12px;
}

.chat-queue-compact-row.failed {
  color: color-mix(in srgb, var(--state-danger) 82%, var(--text-primary));
}

.chat-queue-compact-row .chat-prompt-queue-actions {
  margin-left: auto;
}

.chat-prompt-steered-label {
  flex: 0 0 auto;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  border: 1px solid color-mix(in srgb, var(--state-success) 46%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--state-success) 12%, transparent);
  color: color-mix(in srgb, var(--state-success) 88%, var(--text-primary));
  font-size: 11px;
  line-height: 16px;
  padding: 0 7px;
}

.chat-tool-group {
  margin: 0;
  color: var(--text-secondary);
}

.chat-tool-group-header {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.chat-tool-group-chevron {
  color: var(--text-tertiary);
  opacity: 0.72;
  transition: transform var(--motion-fast) var(--ease-standard);
}

.chat-tool-group-open .chat-tool-group-chevron {
  transform: rotate(90deg);
}

.chat-tool-group-summary-icon {
  color: inherit;
  opacity: 0.82;
}

.chat-tool-group-count {
  flex: 0 0 auto;
  font-size: 12px;
}

.chat-tool-group-separator,
.chat-tool-group-kind {
  color: var(--text-tertiary);
}

.chat-tool-group-latest,
.chat-tool-group-row-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-tool-group-latest {
  flex: 1;
  font-size: 12px;
}

.chat-tool-group-list {
  margin: 4px 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-tool-group-row {
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 11px;
}

.chat-tool-group-row-title {
  flex: 0 1 auto;
}

.chat-tool-group-kind {
  flex: 0 0 auto;
  font-size: 10px;
}

.chat-tool-group-status.completed {
  color: var(--state-success);
}

.chat-tool-group-status.failed {
  color: var(--state-danger);
}

.chat-work-group {
  margin: 0;
  color: var(--text-secondary);
}

.chat-work-group-header {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  outline: none;
  position: relative;
  text-align: left;
  user-select: none;
}

.chat-work-group-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: color-mix(in srgb, var(--border-subtle) 36%, transparent);
  pointer-events: none;
}

.chat-work-group-header:hover,
.chat-work-group-header:focus-visible {
  background: transparent;
  color: var(--text-primary);
}

.chat-work-group-header:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--border-strong) 56%, transparent);
  outline-offset: -1px;
}

.chat-work-group-open .chat-work-group-header {
  background: transparent;
  color: var(--text-primary);
}

.chat-work-group-chevron {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  opacity: 0.64;
  transition: transform var(--motion-fast) var(--ease-standard);
}

.chat-work-group-header:hover .chat-work-group-chevron,
.chat-work-group-header:focus-visible .chat-work-group-chevron,
.chat-work-group-open .chat-work-group-chevron {
  opacity: 0.9;
}

.chat-work-group-open .chat-work-group-chevron {
  transform: rotate(90deg);
}

.chat-work-group-label {
  min-width: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-work-group-content {
  margin-top: 10px;
}

/* Expanded children render their own chat-view-content wrappers; keep them flush
   with the transcript column instead of re-applying the fixed-column layout. */
.chat-view-width-fixed-800 .chat-work-group .chat-view-content {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.chat-work-group-child {
  padding-bottom: 10px;
}

.chat-work-group-child.compact {
  padding-bottom: 4px;
}

.chat-work-group-child:last-child {
  padding-bottom: 0;
}

.chat-thought-block {
  margin: 0;
  color: var(--text-secondary);
}

.chat-thought-header {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.chat-thought-header .sl-icon {
  opacity: 0.88;
}

.chat-thought-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform var(--motion-fast) var(--ease-standard);
}

.chat-thought-header .chat-thought-chevron {
  opacity: 0.72;
}

.chat-thought-open .chat-thought-chevron {
  transform: rotate(90deg);
}

.chat-thought-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-thought-block.streaming .chat-thought-icon,
.chat-tool-group-running .chat-tool-group-summary-icon {
  animation: chatActivityPulse 1.4s ease-in-out infinite;
}

.chat-activity-dots {
  display: inline-flex;
  width: 1.15em;
  margin-left: 1px;
  justify-content: space-between;
}

.chat-activity-dots > span {
  animation: chatActivityDot 1.4s ease-in-out infinite;
}

.chat-activity-dots > span:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-activity-dots > span:nth-child(3) {
  animation-delay: 0.4s;
}

.chat-thought-content {
  margin: 4px 0 0 28px;
  padding: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.chat-thought-content p {
  margin: 0 0 6px 0;
}

.chat-thought-content p:last-child {
  margin-bottom: 0;
}

@keyframes chatActivityPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes chatActivityDot {
  0%, 20%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-work-group-chevron,
  .chat-thought-block.streaming .chat-thought-icon,
  .chat-tool-group-running .chat-tool-group-summary-icon,
  .chat-activity-dots > span {
    transition: none;
    animation: none;
  }
}

.chat-plan-surface {
  color: var(--text-primary);
  font-family: inherit;
  letter-spacing: 0;
}



.chat-goal-surface {
  color: var(--text-primary);
  font-family: inherit;
  letter-spacing: 0;
}

.chat-goal-details {
  min-width: 0;
  padding: 10px;
}

.chat-goal-objective {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 560;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chat-goal-objective > .sl-icon {
  margin-top: 1px;
  color: var(--accent-primary);
}

.chat-goal-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.chat-goal-stat,
.chat-goal-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.chat-goal-stat-label {
  color: color-mix(in srgb, var(--text-secondary) 78%, transparent);
}

.chat-goal-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
}

.chat-goal-status.active .chat-goal-status-dot {
  background: var(--state-success);
}

.chat-goal-status.attention .chat-goal-status-dot {
  background: var(--state-warning);
}

.chat-goal-status.complete .chat-goal-status-dot {
  background: var(--accent-primary);
}

.chat-goal-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.chat-goal-action:hover {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--text-primary);
}

.chat-goal-action.destructive:hover {
  background: color-mix(in srgb, var(--state-danger) 12%, transparent);
  color: var(--state-danger);
}

.chat-goal-action:focus-visible,
.chat-goal-compact-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 58%, transparent);
  outline-offset: 1px;
}

.chat-goal-surface.mobile {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  margin: 0 14px 6px;
  overflow: hidden;
  border: 1px solid var(--border-faint);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-overlay) 88%, transparent);
  box-shadow: var(--shadow-floating);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

.chat-goal-mobile-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.chat-goal-compact-trigger {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  display: grid;
  grid-template-columns: 16px auto minmax(0, 1fr) 14px;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.chat-goal-compact-objective {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.chat-goal-mobile-primary,
.chat-goal-mobile-secondary {
  display: flex;
  align-items: center;
}

.chat-goal-mobile-primary {
  flex: none;
  padding-right: 4px;
}

.chat-goal-surface.mobile.expanded .chat-goal-mobile-row {
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
}

.chat-goal-surface.mobile .chat-goal-details {
  padding: 9px 10px 6px;
}

.chat-goal-mobile-secondary {
  justify-content: flex-end;
  gap: 2px;
  padding: 0 6px 6px;
}

.app-goal-edit-dialog {
  width: min(520px, calc(100vw - 28px));
}

.app-goal-edit-field {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}

.app-goal-edit-objective,
.app-goal-edit-budget {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--text-primary);
  background: var(--surface-panel);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.app-goal-edit-objective {
  min-height: 112px;
  resize: vertical;
  line-height: 1.45;
}

.app-goal-edit-budget {
  height: 34px;
}

.app-goal-edit-objective:focus,
.app-goal-edit-budget:focus {
  border-color: color-mix(in srgb, var(--accent-primary) 58%, var(--border-subtle));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.chat-session-panel {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-session-panel-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-session-panel-header {
  flex: none;
  min-height: 36px;
}

.chat-edge-surface-header {
  display: grid;
  grid-template-columns: 22px auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 0 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
}

.collapsed .chat-edge-surface-header {
  border-bottom-color: transparent;
}

/* align the session panel title with the project-name text column below (39px) */
.chat-session-panel-header .chat-edge-surface-header {
  padding-left: 11px;
}

.chat-edge-surface-toggle,
.chat-edge-surface-toggle-spacer {
  width: 22px;
  height: 22px;
}

.chat-edge-surface-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}

.chat-edge-surface-toggle:hover {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--text-primary);
}

.chat-edge-surface-toggle:active {
  transform: translateY(1px);
}

.chat-edge-surface-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 58%, transparent);
  outline-offset: 1px;
}

.chat-edge-surface-title {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.chat-edge-surface-summary {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--text-primary) 72%, var(--text-secondary));
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-edge-surface-leading-actions,
.chat-edge-surface-actions,
.chat-edge-surface-toolbar {
  display: flex;
  align-items: center;
  min-width: 0;
}

.chat-edge-surface-actions {
  gap: 2px;
}

.chat-edge-surface-toolbar {
  grid-column: 3 / -1;
}

.chat-session-panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.chat-session-panel-sidebar {
  flex: 1;
  min-height: 0;
  display: flex;
  border-right: 1px solid var(--border-subtle);
  background: var(--desktop-top-surface);
}

.chat-session-panel-sidebar .chat-edge-surface-glass {
  border: 0;
  box-shadow: none;
  background: var(--desktop-top-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.chat-session-global-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.chat-session-global-bar-leading-actions {
  grid-column: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding-left: 0;
}

.chat-session-global-bar-recent {
  flex: 0 0 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
}

.chat-session-global-bar-summary {
  grid-column: 2;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 3px;
}

.chat-session-panel-sidebar .chat-session-global-bar-summary {
  padding-right: 0;
}

.chat-header-icon-button {
  appearance: none;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}

.chat-header-icon-button:hover {
  border-color: color-mix(in srgb, var(--border-subtle) 80%, transparent);
  background: var(--hover);
  color: var(--text-primary);
}

.chat-header-icon-button:disabled {
  cursor: default;
  opacity: 0.4;
}

.chat-header-icon-button:disabled:hover {
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.chat-edge-surface-header .chat-function-action {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.chat-session-global-bar .chat-header-archive-control .chat-header-icon-button[aria-expanded='true'] {
  background: var(--hover);
  color: var(--text-primary);
}

.chat-plan-progress {
  font-size: 11px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  white-space: nowrap;
}

@keyframes chat-plan-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-plan-surface-list,
  .chat-plan-step.in-progress .chat-plan-step-marker {
    animation: none;
  }
}

.chat-plan-surface-list {
  list-style: none;
  margin: 0;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: sl-list-in var(--motion-standard) var(--ease-out);
}

.chat-plan-surface-list-transition {
  display: grid;
  grid-template-rows: 0fr;
  min-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  transition:
    grid-template-rows var(--motion-standard) var(--ease-out),
    opacity var(--motion-standard) var(--ease-out),
    visibility 0s linear var(--motion-standard);
}

.chat-plan-surface-list-transition.expanded {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition:
    grid-template-rows var(--motion-standard) var(--ease-out),
    opacity var(--motion-standard) var(--ease-out),
    visibility 0s linear 0s;
}

.chat-plan-surface-list-transition.exiting {
  transition:
    grid-template-rows var(--motion-exit) var(--ease-out),
    opacity var(--motion-exit) var(--ease-out),
    visibility 0s linear var(--motion-exit);
}

.chat-plan-surface-list-transition.entering {
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: visible;
}

.chat-plan-surface-list-transition > .chat-plan-surface-list {
  min-height: 0;
  overflow-y: auto;
}

@media (prefers-reduced-motion: reduce) {
  .chat-plan-surface-list-transition,
  .chat-plan-surface-list-transition.expanded,
  .chat-plan-surface-list-transition.exiting,
  .chat-plan-surface-list-transition.entering {
    transition: none;
  }
}

.chat-plan-step {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: flex-start;
  gap: 8px;
  min-height: 21px;
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--text-primary) 82%, var(--text-secondary));
  font-size: 12px;
  line-height: 1.4;
}

.chat-plan-step-marker {
  width: 16px;
  height: 18px;
  color: var(--text-secondary);
}

.chat-plan-step.in-progress .chat-plan-step-marker,
.chat-plan-compact-marker.in-progress {
  color: var(--state-warning);
}

.chat-plan-step.in-progress .chat-plan-step-marker {
  animation: chat-plan-pulse 1.6s var(--ease-standard) infinite;
}

.chat-plan-step.completed .chat-plan-step-marker,
.chat-plan-compact-marker.completed {
  color: var(--state-success);
}

.chat-plan-step.completed .chat-plan-step-content {
  color: color-mix(in srgb, var(--state-success) 74%, var(--text-primary));
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.chat-plan-step.pending .chat-plan-step-content {
  color: color-mix(in srgb, var(--text-primary) 62%, var(--text-secondary));
}

.chat-plan-step-content {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chat-plan-surface.mobile {
  flex: 0 0 auto;
  margin: 0 14px 6px;
  position: relative;
  z-index: 2;
}

.chat-plan-compact-trigger {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--border-faint);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-overlay) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  color: var(--text-primary);
  display: grid;
  grid-template-columns: 18px auto minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-floating);
}

.chat-plan-compact-trigger:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--surface-overlay) 96%, transparent);
}

.chat-plan-compact-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 58%, transparent);
  outline-offset: 2px;
}

.chat-plan-compact-marker {
  color: var(--text-secondary);
}

.chat-plan-compact-chevron {
  color: var(--text-secondary);
}

.chat-plan-current {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: color-mix(in srgb, var(--text-primary) 84%, var(--text-secondary));
}

.chat-plan-surface.mobile.expanded {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, var(--accent-primary));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-panel) 94%, var(--surface-workspace-content));
  box-shadow: 0 10px 24px color-mix(in srgb, #000 22%, transparent);
}

.chat-plan-surface.mobile.expanded .chat-plan-compact-trigger {
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-plan-surface.mobile .chat-plan-surface-list {
  max-height: 176px;
  overflow-y: auto;
  padding: 7px 10px 9px;
  scrollbar-width: thin;
}

.chat-plan-surface.mobile .chat-plan-surface-list-transition > .chat-plan-surface-list {
  animation: none;
}
.chat-main-message {
  max-width: 100%;
  font-family: 'Segoe UI Variable Text', 'Segoe UI', 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', 'Noto Sans', sans-serif;
  line-height: 1.6;
  font-size: 14px;
  font-weight: 400;
  color: var(--chat-message-text, var(--text-primary));
  letter-spacing: 0.01em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-main-message > :first-child {
  margin-top: 0;
}

.chat-main-message > :last-child {
  margin-bottom: 0;
}

.chat-main-message p,
.chat-main-message ul,
.chat-main-message ol,
.chat-main-message blockquote,
.chat-main-message table {
  margin: 0 0 10px 0;
}

.chat-main-message blockquote {
  padding: 8px 14px;
  border-left: 3px solid color-mix(in srgb, var(--text-tertiary) 55%, transparent);
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--surface-panel) 76%, transparent);
  color: color-mix(in srgb, var(--chat-message-text, var(--text-primary)) 86%, var(--text-secondary));
}

.chat-main-message blockquote > :first-child {
  margin-top: 0;
}

.chat-main-message blockquote > :last-child {
  margin-bottom: 0;
}

.chat-main-message ul,
.chat-main-message ol {
  padding-left: 1.5em;
}

.chat-main-message li {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.chat-main-message li + li {
  margin-top: 6px;
}

.chat-main-message strong {
  font-weight: 600;
}

.chat-main-message h1,
.chat-main-message h2,
.chat-main-message h3,
.chat-main-message h4,
.chat-main-message h5,
.chat-main-message h6 {
  margin: 16px 0 10px 0;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0;
}

.chat-main-message h1 {
  font-size: 1.5em;
}

.chat-main-message h2 {
  font-size: 1.35em;
}

.chat-main-message h3 {
  font-size: 1.2em;
}

.chat-main-message h4 {
  font-size: 1.1em;
}

.chat-main-message h5,
.chat-main-message h6 {
  font-size: 1em;
}

.chat-main-message a,
.chat-main-message a:visited {
  color: var(--chat-link-text);
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--motion-fast) var(--ease-standard);
}

.chat-main-message .chat-file-link {
  font-weight: 500;
}

/* A file name written as `code` inside a file link keeps the mono face
   but drops the inline-code chip so the link reads as one unit. */
.chat-main-message .chat-file-link code:not(.wm-shiki-code) {
  padding: 0;
  border-radius: 0;
  background: none;
  color: inherit;
}

.chat-main-message .chat-file-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  margin-right: 0.3em;
  font-size: 13px;
  line-height: 1;
  vertical-align: -0.125em;
}

.chat-main-message .chat-file-link-icon::before {
  display: block;
  width: 13px;
  height: 13px;
  line-height: 13px;
  text-align: center;
}

.chat-main-message .chat-file-link-line {
  margin-left: 2px;
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 0.92em;
  opacity: 0.86;
}

.chat-reply-target {
  outline: 1px solid color-mix(in srgb, var(--accent-primary) 30%, var(--border-subtle));
  outline-offset: 3px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent-primary) 5%, transparent);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    outline-color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard);
}

.chat-reply-target:hover {
  outline-color: color-mix(in srgb, var(--accent-primary) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent-primary) 11%, transparent);
}

.chat-reply-target:focus-visible {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 58%, transparent);
  outline-offset: 3px;
}

.chat-reply-target[aria-disabled='true'] {
  outline-color: color-mix(in srgb, var(--border-subtle) 72%, transparent);
  background: transparent;
  cursor: default;
}

.chat-reply-label {
  color: var(--accent-primary);
}

li.chat-reply-target::marker {
  color: var(--accent-primary);
}
.chat-main-message a:hover,
.chat-main-message a:focus-visible {
  color: color-mix(in srgb, var(--chat-link-text) 82%, var(--text-primary));
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.chat-main-message .chat-relay-code-link {
  text-decoration: none;
}

.chat-main-message a.chat-relay-code-link:hover,
.chat-main-message a.chat-relay-code-link:focus-visible {
  text-decoration: none;
}

.chat-main-message .chat-relay-code-link code {
  color: color-mix(in srgb, var(--accent-primary) 88%, var(--text-primary));
  cursor: pointer;
}

.chat-main-message .chat-relay-code-link:hover code {
  text-decoration: underline;
}

.chat-main-message table {
  border-collapse: collapse;
  width: 100%;
}

.chat-main-message th,
.chat-main-message td {
  border: 1px solid var(--border-subtle);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.chat-image-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chat-inline-image {
  max-width: min(280px, 100%);
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  object-fit: cover;
}

.chat-prompt-attachment-strip {
  display: flex;
  flex-wrap: wrap;
  align-self: flex-start;
  gap: 8px;
  max-width: min(920px, 100%);
  margin-top: 2px;
}

.chat-prompt-attachment-chip {
  display: inline-grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  max-width: min(340px, 100%);
  min-height: 40px;
  padding: 3px 9px 3px 3px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, var(--accent-primary));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-panel) 90%, var(--accent-primary));
  color: color-mix(in srgb, var(--text-primary) 82%, var(--text-secondary));
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.chat-prompt-attachment-chip:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--surface-panel) 82%, var(--accent-primary));
}

.chat-prompt-attachment-icon {
  width: 32px;
  height: 32px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: color-mix(in srgb, var(--accent-primary) 74%, var(--text-primary));
}

.chat-prompt-attachment-thumb {
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface-raised) 80%, transparent);
  object-fit: cover;
}

.chat-prompt-attachment-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.chat-prompt-attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
  color: color-mix(in srgb, var(--text-primary) 86%, var(--accent-primary));
}

.chat-prompt-attachment-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-secondary);
}

.chat-prompt-artifacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: -2px;
}

.chat-prompt-artifact {
  max-width: min(680px, 100%);
}

.chat-prompt-artifact-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  border: none;
  padding: 0;
  background: transparent;
  color: color-mix(in srgb, var(--text-primary) 86%, var(--text-secondary));
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.chat-prompt-artifact-summary:hover {
  color: var(--text-primary);
}

.chat-prompt-artifact-summary:disabled {
  cursor: default;
  opacity: 0.64;
}

.chat-prompt-artifact-summary .sl-icon {
  color: color-mix(in srgb, var(--accent-primary) 82%, var(--text-primary));
}

.chat-prompt-artifact-files {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  margin-top: 3px;
  padding-left: 21px;
}

.chat-prompt-artifact-files-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 4px 0 0 21px;
  border: 0;
  padding: 4px 6px 4px 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.chat-prompt-artifact-files-toggle:hover,
.chat-prompt-artifact-files-toggle:focus-visible {
  color: var(--text-primary);
}

.chat-prompt-artifact-files-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-primary) 58%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

.chat-prompt-artifact-files-toggle .sl-icon {
  color: var(--text-tertiary);
}

.chat-prompt-artifact-file {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 23px;
  gap: 8px;
  border: none;
  border-radius: 5px;
  padding: 0 6px 0 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-prompt-artifact-file:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.chat-prompt-artifact-file-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-family: var(--mono-font);
  font-size: 11px;
  line-height: 1;
  color: color-mix(in srgb, var(--text-primary) 82%, var(--text-secondary));
}

.chat-prompt-artifact-file-status.status-a {
  color: var(--state-success);
}

.chat-prompt-artifact-file-status.status-d {
  color: var(--state-danger);
}

.chat-prompt-artifact-file-status.status-r,
.chat-prompt-artifact-file-status.status-c {
  color: var(--state-warning);
}

.chat-prompt-artifact-file-path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono-font);
  font-size: 11px;
}

.chat-prompt-artifact-file-counts {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 52px;
  font-family: var(--mono-font);
  font-size: 11px;
  white-space: nowrap;
}

.chat-prompt-artifact-file-counts .additions {
  color: var(--state-success);
}

.chat-prompt-artifact-file-counts .deletions {
  color: var(--state-danger);
}

.chat-prompt-artifact-error {
  margin-top: 4px;
  padding-left: 21px;
  color: var(--state-danger);
  font-size: 11px;
}

.chat-prompt-separator {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
  gap: 8px;
}

.chat-prompt-separator hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  flex: 1;
  margin: 0;
}

.chat-prompt-separator-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.chat-prompt-stop-reason {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
}

.chat-prompt-stop-reason.cancelled,
.chat-prompt-stop-reason.interrupted {
  color: color-mix(in srgb, var(--text-secondary) 84%, var(--text-primary));
}

.chat-prompt-stop-reason.failed {
  border-color: color-mix(in srgb, var(--state-danger) 58%, var(--border-subtle));
  color: var(--state-danger);
}

.chat-prompt-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.chat-prompt-action-button {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-prompt-action-button:hover {
  color: var(--text-primary);
  background: var(--hover);
}

.chat-prompt-action-button:disabled {
  opacity: 0.42;
  cursor: default;
}

.chat-prompt-action-button:disabled:hover {
  color: var(--text-secondary);
  background: transparent;
}

.chat-share-trigger[aria-expanded='true'] {
  color: var(--text-primary);
  background: var(--hover);
}

.chat-share-menu {
  width: min(260px, calc(100vw - 16px));
}

.chat-share-menu-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-share-menu-work-details {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  margin-bottom: 3px;
  padding: 6px 11px;
  border: 0;
  border-bottom: 1px solid var(--border-faint);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.chat-share-menu-work-details-check {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--surface-canvas);
}

.chat-share-menu-work-details[aria-checked='true'] .chat-share-menu-work-details-check {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}

.chat-share-menu-work-details-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
  line-height: 1.25;
}

.chat-share-menu-work-details-copy > :last-child {
  color: var(--text-tertiary);
  font-size: 10px;
}

.chat-share-menu-work-details:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: -2px;
}

.chat-share-menu-group {
  padding: 4px 3px 5px 8px;
  border-left: 2px solid color-mix(in srgb, var(--accent-primary) 45%, transparent);
}

.chat-share-menu-group + .chat-share-menu-group {
  margin-top: 1px;
  padding-top: 7px;
  border-top: 1px solid var(--border-faint);
  border-left-color: color-mix(in srgb, var(--text-tertiary) 45%, transparent);
}

.chat-share-menu-group-label {
  padding: 1px 6px 4px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.chat-share-menu-group-actions {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-share-menu-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.chat-share-menu-action .sl-icon {
  color: var(--text-tertiary);
}

.chat-share-menu-action:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: -1px;
}

.chat-share-menu-action:disabled {
  opacity: .42;
  cursor: default;
}

@media (hover: hover) {
  .chat-share-menu-work-details:hover {
    color: var(--text-primary);
    background: var(--hover);
  }

  .chat-share-menu-action:hover:not(:disabled) {
    background: var(--hover);
    color: var(--text-primary);
  }

  .chat-share-menu-action:hover:not(:disabled) .sl-icon {
    color: var(--text-primary);
  }
}

.chat-prompt-result-line {
  flex-basis: 100%;
  margin-left: auto;
  font-size: 11px;
  color: var(--text-secondary);
}

.chat-prompt-result-line.failed {
  color: var(--state-danger);
}

.chat-scroll-nav {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-scroll-nav-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 65%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-overlay) 72%, transparent);
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent),
    var(--shadow-floating);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    background var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
  animation: chat-scroll-nav-in var(--motion-standard) var(--ease-out);
}

.chat-scroll-nav-button:hover {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--surface-overlay) 86%, transparent);
  transform: translateY(-1px);
}

.chat-scroll-nav-button:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 2px;
}

@keyframes chat-scroll-nav-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-scroll-nav-button {
    animation: none;
    transition: none;
  }
}

.chat-composer {
  --chat-config-popover-layer: 44;
  position: relative;
  z-index: 1;
  padding: 0 14px 4px;
  background: transparent;
}

.chat-composer.permission-open {
  z-index: 31;
}

.chat-composer.menu-open {
  z-index: 32;
}

.chat-slash-menu,
.chat-file-mention-menu {
  transform-origin: bottom center;
}

.chat-core-config-menu,
.chat-config-value-menu {
  transform-origin: bottom right;
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .chat-core-config-menu,
  .chat-config-value-menu,
  .chat-attachment-action-tray {
    animation: none;
  }
}

@media (min-width: 901px) {
  .chat-composer {
    padding-bottom: 8px;
  }
}

.chat-composer-content {
  position: relative;
  width: 100%;
}

.chat-composer-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 80%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-panel) 88%, var(--surface-raised));
  box-shadow:
    var(--shadow-floating),
    inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent);
  padding: 8px 8px 4px;
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    background var(--motion-fast) var(--ease-standard);
}

.chat-composer:focus-within .chat-composer-frame {
  border-color: color-mix(in srgb, var(--accent-primary) 36%, var(--border-subtle));
  box-shadow:
    var(--shadow-floating),
    inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent-primary) 6%, transparent);
}

.chat-composer.menu-open .chat-composer-frame {
  border-color: color-mix(in srgb, var(--accent-primary) 32%, var(--border-subtle));
}

.chat-composer-frame.drag-over {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 7%, var(--surface-panel));
}

.chat-composer-drop-hint {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--surface-panel) 88%);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .chat-composer-drop-hint {
    animation: none;
  }
}

.chat-composer-input-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 32px;
  min-width: 0;
}

.chat-composer-input-shell {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  --chat-composer-input-pad-block: 5px;
  --chat-composer-input-pad-inline: 8px;
}

.chat-composer-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 32px;
  max-height: 180px;
  overflow-x: hidden;
  overflow-y: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  padding: var(--chat-composer-input-pad-block) var(--chat-composer-input-pad-inline) 2px;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-secondary) 46%, transparent) transparent;
  scrollbar-gutter: stable;
}

.chat-rich-composer {
  position: relative;
  z-index: 1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-rich-composer p {
  margin: 0;
}

.chat-rich-composer-placeholder {
  position: absolute;
  inset: var(--chat-composer-input-pad-block) var(--chat-composer-input-pad-inline) auto;
  z-index: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}

.chat-composer-capsule,
.chat-prompt-inline-capsule {
  display: inline-flex;
  align-items: center;
  max-width: min(260px, 100%);
  gap: 2px;
  margin: 0 1px;
  padding: 1px 7px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, var(--accent-primary));
  border-radius: 999px;
  vertical-align: -0.05em;
  font-size: 0.85em;
  line-height: 1.25;
  white-space: nowrap;
  transition: box-shadow var(--motion-fast) var(--ease-standard);
}

.chat-composer-capsule.skill,
.chat-prompt-inline-capsule.skill {
  border-color: color-mix(in srgb, var(--accent-primary) 30%, transparent);
  color: var(--chat-capsule-skill-text);
  background: var(--chat-capsule-skill-bg);
}

.chat-composer-capsule.goal,
.chat-prompt-inline-capsule.goal {
  border-color: color-mix(in srgb, var(--state-success) 34%, transparent);
  color: var(--chat-capsule-goal-text);
  background: var(--chat-capsule-goal-bg);
}

.chat-composer-capsule.file,
.chat-prompt-inline-capsule.file {
  max-width: 100%;
  white-space: normal;
  border-color: var(--border-subtle);
  border-radius: 7px;
  color: color-mix(in srgb, var(--text-primary) 84%, var(--text-secondary));
  background: color-mix(in srgb, var(--surface-panel) 82%, var(--accent-primary));
}

.chat-composer-capsule.selected {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 58%, transparent);
}

.chat-composer-capsule-label,
.chat-prompt-inline-capsule-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-composer-capsule.file .chat-composer-capsule-label,
.chat-prompt-inline-capsule.file .chat-prompt-inline-capsule-label {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.chat-composer-capsule-icon,
.chat-prompt-inline-capsule-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  opacity: 0.72;
}

.chat-composer-input:focus {
  outline: none;
}

.chat-composer-input::-webkit-scrollbar {
  width: 4px;
}

.chat-composer-input::-webkit-scrollbar-track {
  background: transparent;
}

.chat-composer-input::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-secondary) 42%, transparent);
}

.chat-slash-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  max-height: min(56dvh, 420px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  z-index: 36;
}

.chat-file-mention-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  max-height: min(56dvh, 420px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  z-index: 36;
}

/* Scrollable list area; the key-hints footer stays pinned below it instead
   of scrolling away with the options. */
.chat-slash-menu-body,
.chat-file-mention-menu-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-menu-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
  padding: 5px 10px 3px;
  border-top: 1px solid var(--border-faint);
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.4;
  user-select: none;
}

.chat-menu-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.chat-menu-hint kbd {
  font-family: inherit;
  font-size: 10px;
  line-height: 1.2;
  padding: 1px 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--text-secondary);
}

.chat-slash-diagnostic {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  padding: 5px 8px 3px;
  border-top: 1px solid color-mix(in srgb, var(--warning, #d8a13b) 25%, transparent);
  color: var(--warning, #d8a13b);
  font-size: 10px;
  line-height: 1.35;
}

.chat-slash-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-slash-section + .chat-slash-section {
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px solid var(--border-faint);
}

.chat-slash-section-header {
  padding: 4px 10px 2px;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  user-select: none;
}

.chat-slash-item {
  border: 0;
  border-radius: 8px;
  min-height: 30px;
  padding: 4px 10px;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.chat-slash-item:hover,
.chat-slash-item.active {
  background: var(--hover);
}

.chat-slash-item.disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.chat-slash-item.disabled:hover,
.chat-slash-item.disabled.active {
  background: transparent;
}

.chat-slash-icon {
  width: 16px;
  flex: 0 0 16px;
  color: var(--text-tertiary);
  text-align: center;
}

.chat-slash-item.command .chat-slash-icon {
  color: color-mix(in srgb, var(--accent-primary) 76%, var(--text-secondary));
}

.chat-slash-name {
  min-width: 0;
  flex: 0 0 auto;
  max-width: 50%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-slash-description {
  min-width: 0;
  flex: 1 1 0;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-slash-switch {
  width: 26px;
  height: 15px;
  padding: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-secondary) 28%, transparent);
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  transition: background var(--motion-fast) var(--ease-standard);
}

.chat-slash-switch.checked {
  background: color-mix(in srgb, #e7b84b 82%, var(--surface-panel));
}

.chat-slash-switch-knob {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--surface-panel);
  box-shadow: 0 1px 3px color-mix(in srgb, #000 32%, transparent);
  transform: translateX(0);
  transition: transform var(--motion-fast) var(--ease-standard);
}

.chat-slash-switch.checked .chat-slash-switch-knob {
  transform: translateX(11px);
}

.chat-composer-action-column {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
}

.chat-send-button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 58%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-primary) 17%, var(--surface-panel));
  color: color-mix(in srgb, var(--accent-primary) 88%, var(--text-primary));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition:
    transform var(--motion-fast) var(--ease-standard),
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.chat-send-button:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 82%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 24%, var(--surface-panel));
  color: var(--text-primary);
}

.chat-send-button:active:not(:disabled) {
  transform: scale(0.97);
}

.chat-send-button:disabled {
  cursor: default;
  opacity: 0.55;
  box-shadow: none;
}

.chat-send-button:disabled:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 58%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent-primary) 17%, var(--surface-panel));
  color: color-mix(in srgb, var(--accent-primary) 88%, var(--text-primary));
}

.voice-input-button {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--state-success) 56%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--state-success) 13%, var(--surface-panel));
  color: color-mix(in srgb, var(--state-success) 82%, var(--text-primary));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  overflow: visible;
  box-shadow: none;
  transition: border-color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}

.voice-input-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--state-info) 72%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-success) 19%, var(--surface-panel));
  color: var(--text-primary);
}

.voice-input-button.send-with-voice {
  border-color: color-mix(in srgb, var(--accent-primary) 72%, var(--border-subtle));
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--accent-primary) 24%, var(--surface-panel)) 0%,
      color-mix(in srgb, var(--state-info) 10%, var(--surface-panel)) 100%
    );
  color: color-mix(in srgb, var(--accent-primary) 82%, var(--text-primary));
}

.voice-input-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--surface-panel);
  border-radius: 999px;
  background: var(--state-info);
  color: #f7fffc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px color-mix(in srgb, var(--state-info) 20%, transparent);
  pointer-events: none;
}

.voice-input-button.recording {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--state-info) 82%, var(--border-subtle));
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--state-info) 30%, var(--surface-panel)) 0%,
      color-mix(in srgb, var(--state-info) 14%, var(--surface-panel)) 100%
    );
}

.voice-input-button.locked-recording,
.voice-input-button.hold-recording {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--state-info) 14%, transparent);
}

.voice-input-button.locked-recording::after,
.voice-input-button.hold-recording::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 1px solid color-mix(in srgb, var(--state-info) 48%, transparent);
  border-radius: 14px;
  animation: voiceButtonPulse 1100ms ease-out infinite;
  pointer-events: none;
}

.voice-input-button.hold-recording {
  border-color: color-mix(in srgb, var(--accent-primary) 84%, var(--border-subtle));
}

.voice-input-button.cancel-intent {
  border-color: color-mix(in srgb, var(--state-danger) 82%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-danger) 14%, var(--surface-panel));
  color: var(--state-danger);
}

.voice-input-button:disabled {
  cursor: default;
  opacity: 0.55;
  box-shadow: none;
}

.voice-recording-bar {
  position: relative;
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--state-info) 32%, var(--border-subtle));
  border-radius: 8px;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--state-info) 16%, var(--surface-panel)) 0%,
      color-mix(in srgb, var(--surface-raised) 92%, transparent) 100%
    );
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  overflow: hidden;
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .voice-recording-bar {
    animation: none;
  }
}

.voice-recording-bar.cancel-intent {
  border-color: color-mix(in srgb, var(--state-danger) 55%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-danger) 12%, var(--surface-panel));
}

.voice-recording-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--state-info);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--state-info) 16%, transparent);
}

.voice-recording-bar.cancel-intent .voice-recording-dot {
  background: var(--state-danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--state-danger) 18%, transparent);
}

.voice-recording-wave {
  height: 16px;
  width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.voice-recording-wave span {
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.82;
  transform: scaleY(var(--voice-bar-scale, 0.7));
  animation: voiceBarPulse 920ms ease-in-out infinite;
  transform-origin: center;
}

.voice-recording-wave span:nth-child(2) {
  animation-delay: 90ms;
}

.voice-recording-wave span:nth-child(3) {
  animation-delay: 180ms;
}

.voice-recording-wave span:nth-child(4) {
  animation-delay: 270ms;
}

.voice-recording-wave span:nth-child(5) {
  animation-delay: 360ms;
}

.voice-recording-text {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-recording-time {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1;
}

@keyframes voiceBarPulse {
  0%,
  100% {
    transform: scaleY(calc(var(--voice-bar-scale, 0.7) * 0.68));
    opacity: 0.62;
  }
  50% {
    transform: scaleY(calc(var(--voice-bar-scale, 0.7) * 1.08));
    opacity: 1;
  }
}

@keyframes voiceButtonPulse {
  0% {
    transform: scale(0.92);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-recording-wave span {
    animation: none;
  }

  .voice-input-button.locked-recording::after,
  .voice-input-button.hold-recording::after {
    animation: none;
  }
}

.chat-composer-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  min-width: 0;
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .chat-composer-toolbar {
    animation: none;
  }
}

.chat-composer-toolbar-actions {
  min-width: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 1 1 auto;
}

.chat-composer-tools {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 24px;
  flex: 0 0 auto;
}

.chat-tool-button {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: color-mix(in srgb, var(--text-secondary) 86%, var(--text-primary));
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  transition:
    background var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.chat-composer-stop-slot {
  display: flex;
  align-items: center;
  min-width: 0;
}

.chat-stop-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.chat-stop-pill:hover:not(:disabled),
.chat-stop-pill.armed {
  border-color: color-mix(in srgb, var(--state-danger) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-danger) 9%, var(--surface-raised));
}

.chat-stop-pill:active:not(:disabled) {
  transform: scale(0.96);
}

.chat-stop-pill:disabled {
  cursor: default;
}

.chat-stop-pill.cancelling {
  opacity: 0.72;
}

.chat-stop-pill-stage {
  position: relative;
  width: 30px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-stop-bike {
  transition:
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.chat-stop-bike-wheel-anim,
.chat-stop-bike-crank {
  transform-box: fill-box;
  transform-origin: center;
}

.chat-stop-bike-wheel-anim {
  animation: chat-stop-bike-spin 0.9s linear infinite;
}

.chat-stop-bike-crank {
  animation: chat-stop-bike-spin 0.8s linear infinite;
}

/* Speed lines trailing the bike; they streak backward and stretch as they
   fade, staggered so the flow never syncs up. */
.chat-stop-bike-wind {
  opacity: 0.85;
  transition: opacity var(--motion-fast) var(--ease-standard);
}

.chat-stop-bike-wind path {
  transform-box: fill-box;
  animation: chat-stop-bike-wind 0.9s linear infinite;
}

.chat-stop-bike-wind path:nth-child(2) {
  animation-duration: 1.05s;
  animation-delay: -0.35s;
}

/* Braking: the wheels freeze mid-turn and the wind dies immediately. */
.chat-stop-pill.cancelling .chat-stop-bike-wheel-anim,
.chat-stop-pill.cancelling .chat-stop-bike-crank {
  animation-play-state: paused;
}

.chat-stop-pill.cancelling .chat-stop-bike-wind {
  opacity: 0;
}

.chat-stop-pill.cancelling .chat-stop-bike-wind path {
  animation: none;
}

.chat-stop-pill-stop-glyph {
  position: absolute;
  color: var(--state-danger);
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.chat-stop-pill.armed .chat-stop-bike {
  opacity: 0;
  transform: scale(0.8);
}

.chat-stop-pill.armed .chat-stop-pill-stop-glyph {
  opacity: 1;
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .chat-stop-pill:hover:not(:disabled) .chat-stop-bike {
    opacity: 0;
    transform: scale(0.8);
  }

  .chat-stop-pill:hover:not(:disabled) .chat-stop-pill-stop-glyph {
    opacity: 1;
    transform: none;
  }
}

.chat-stop-pill-a11y-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes chat-stop-bike-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes chat-stop-bike-wind {
  0% {
    opacity: 0;
    transform: translateX(1.5px) scaleX(0.7);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-4.5px) scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-stop-bike-wheel-anim,
  .chat-stop-bike-crank,
  .chat-stop-bike-wind path {
    animation: none;
  }

  .chat-stop-bike-wind {
    opacity: 0;
  }
}

.chat-attachment-action-tray {
  position: absolute;
  left: 28px;
  bottom: calc(100% + 6px);
  z-index: 38;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 46px);
  min-height: 34px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 26%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-overlay) 98%, var(--surface-panel));
  box-shadow: var(--shadow-overlay);
  backdrop-filter: blur(16px) saturate(1.06);
  -webkit-backdrop-filter: blur(16px) saturate(1.06);
  transform-origin: bottom left;
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

.chat-attachment-action-button {
  min-width: 62px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-raised) 86%, transparent);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
}

.chat-attachment-action-button:hover {
  background: var(--hover);
}

.chat-attachment-action-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.chat-attachment-action-button .sl-icon {
  color: color-mix(in srgb, var(--accent-primary) 72%, var(--text-primary));
}

.chat-attachment-action-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.chat-tool-button:hover,
.chat-tool-button:focus-visible {
  background: var(--hover);
  color: var(--text-primary);
  box-shadow: none;
  outline: none;
}

.chat-tool-button:active:not(:disabled) {
  transform: scale(0.95);
}

.chat-tool-button:disabled {
  cursor: default;
  opacity: 0.42;
  box-shadow: none;
}

.chat-tool-button:disabled:hover {
  background: transparent;
  color: color-mix(in srgb, var(--text-secondary) 86%, var(--text-primary));
}


.chat-attachment-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
  max-width: 100%;
}

.chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-panel);
  padding: 4px 6px 4px 4px;
  min-width: 160px;
  max-width: 260px;
  height: 44px;
  box-sizing: border-box;
  position: relative;
  animation: chat-attachment-in var(--motion-standard) var(--ease-out);
}

@keyframes chat-attachment-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.chat-attachment-preview.removing {
  opacity: 0;
  transform: translateY(2px);
  transition:
    opacity var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .chat-attachment-preview {
    animation: none;
  }

  .chat-attachment-preview.removing {
    transition: none;
  }
}

.chat-attachment-preview.uploading,
.chat-attachment-preview.queued {
  border-color: color-mix(in srgb, var(--accent-primary) 42%, var(--border-subtle));
}

.chat-attachment-preview.failed {
  border-color: color-mix(in srgb, var(--state-danger) 58%, var(--border-subtle));
}

.chat-attachment-thumb {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  object-fit: cover;
}

.chat-attachment-thumb.file {
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--accent-primary) 70%, var(--text-primary));
  background: color-mix(in srgb, var(--accent-primary) 9%, var(--surface-raised));
}

.chat-attachment-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-attachment-name {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-attachment-status {
  color: color-mix(in srgb, var(--text-secondary) 86%, var(--text-primary));
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-attachment-preview.failed .chat-attachment-status {
  color: var(--state-danger);
}

.chat-attachment-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.chat-attachment-progress {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--border-subtle) 70%, transparent);
}

.chat-attachment-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent-primary) 75%, var(--state-info));
}

.chat-attachment-remove,
.chat-attachment-retry {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.chat-attachment-retry:hover {
  color: color-mix(in srgb, var(--accent-primary) 75%, var(--text-primary));
  border-color: color-mix(in srgb, var(--accent-primary) 55%, var(--border-subtle));
}

.chat-attachment-remove:hover {
  color: var(--state-danger);
  border-color: color-mix(in srgb, var(--state-danger) 55%, var(--border-subtle));
}

.chat-config-options-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.chat-config-options-shell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.chat-config-options-shell.compact {
  gap: 4px;
}

.chat-core-config {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
}

.chat-core-config-trigger {
  height: 24px;
  min-width: 0;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 52%, transparent);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.chat-core-config-model,
.chat-core-config-effort,
.chat-core-config-fast-label {
  min-width: 0;
  white-space: nowrap;
}

.chat-core-config-separator {
  margin: 0 3px;
  color: var(--text-secondary);
}

.chat-core-config-fast {
  margin-left: 0;
  color: #e7b84b;
  font-size: 13px;
  line-height: 1;
  filter: drop-shadow(0 0 4px color-mix(in srgb, #e7b84b 42%, transparent));
}

.chat-core-config-trigger:hover,
.chat-core-config-trigger[aria-expanded='true'] {
  border-color: color-mix(in srgb, var(--border-subtle) 72%, transparent);
  background: color-mix(in srgb, var(--hover) 88%, var(--surface-raised));
}

.chat-core-config-trigger:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.18);
}

.chat-config-options-shell.compact .chat-core-config {
  flex: 0 1 auto;
  min-width: 0;
}

.chat-config-options-shell.compact .chat-core-config-model {
  max-width: min(140px, 38vw);
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-config-options {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  overflow: visible;
}

.chat-context-usage-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.chat-context-usage-a11y-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-context-usage {
  --chat-context-used: 0%;
  --chat-context-ring-width: 1.5px;
  --chat-context-used-color: color-mix(in srgb, var(--text-primary) 72%, #ffffff);
  --chat-context-rest-color: color-mix(in srgb, var(--text-secondary) 48%, transparent);
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  aspect-ratio: 1 / 1;
  flex: 0 0 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    conic-gradient(
      var(--chat-context-used-color) var(--chat-context-used),
      var(--chat-context-rest-color) 0
    );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--chat-context-ring-width)),
    #000 calc(100% - var(--chat-context-ring-width) + 0.35px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--chat-context-ring-width)),
    #000 calc(100% - var(--chat-context-ring-width) + 0.35px)
  );
  box-shadow: none;
  cursor: pointer;
  appearance: none;
}

.chat-context-usage:hover,
.chat-context-usage:focus-visible,
.chat-context-usage-anchor.open .chat-context-usage {
  outline: 3px solid color-mix(in srgb, var(--text-primary) 9%, transparent);
  outline-offset: 1px;
}

.chat-context-usage-popover {
  position: fixed;
  right: var(--chat-context-usage-popover-right, 24px);
  bottom: var(--chat-context-usage-popover-bottom, 96px);
  z-index: var(--chat-config-popover-layer);
  width: max-content;
  min-width: 154px;
  max-width: min(220px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 86%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-overlay) 98%, var(--surface-panel));
  box-shadow: var(--shadow-overlay);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.98);
  transform-origin: right bottom;
  transition:
    opacity var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
  backdrop-filter: blur(16px) saturate(1.06);
  -webkit-backdrop-filter: blur(16px) saturate(1.06);
}

.chat-context-usage:focus-visible + .chat-context-usage-popover,
.chat-context-usage-anchor.open .chat-context-usage-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Hover is a desktop-only show channel; on touch it sticks after taps and
   would ghost the tooltip back on after unrelated popups close. */
@media (hover: hover) {
  .chat-context-usage-anchor:hover .chat-context-usage-popover {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
}

.chat-context-usage-popover-kicker {
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.2;
}

.chat-context-usage-popover-value {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.chat-config-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

.chat-config-overflow-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.chat-config-overflow-values {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chat-config-item-label {
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1.1;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.chat-config-pill {
  max-width: 148px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 52%, transparent);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

.chat-config-pill:hover,
.chat-config-pill[aria-expanded='true'] {
  border-color: color-mix(in srgb, var(--border-subtle) 72%, transparent);
  background: color-mix(in srgb, var(--hover) 88%, var(--surface-raised));
}

.chat-config-pill:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.18);
}

.chat-config-pill:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.chat-config-pill-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-core-config-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: var(--chat-config-popover-layer);
  width: max-content;
  max-width: calc(100vw - 24px);
  height: min(44vh, 380px);
  min-height: 180px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, var(--accent-primary));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-overlay) 98%, var(--surface-panel));
  box-shadow: var(--shadow-overlay);
  backdrop-filter: blur(16px) saturate(1.06);
  -webkit-backdrop-filter: blur(16px) saturate(1.06);
  display: flex;
  flex-direction: column;
}

.chat-core-config-columns {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
}

.chat-core-config-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: max-content;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-core-config-column + .chat-core-config-column {
  border-left: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
}

.chat-core-config-heading {
  padding: 10px 11px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.chat-core-config-values {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
}

.chat-core-config-option {
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  display: grid;
  grid-template-columns: max-content 12px;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.chat-core-config-option:hover,
.chat-core-config-option.selected {
  background: var(--hover);
}

.chat-core-config-option:disabled {
  opacity: 0.68;
  cursor: wait;
}

.chat-core-config-option-label {
  min-width: 0;
  white-space: nowrap;
}

.chat-core-config-option .sl-icon {
  margin-top: 1px;
  color: var(--accent-primary);
}

.chat-core-config-check {
  visibility: hidden;
}

.chat-core-config-check.visible {
  visibility: visible;
}

.chat-core-config-empty {
  display: block;
  padding: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.chat-core-config-footer {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
  padding: 6px;
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
}

.chat-core-config-more-button {
  min-height: 28px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.chat-core-config-more-button:hover,
.chat-core-config-more-button:focus-visible {
  background: var(--hover);
  color: var(--text-primary);
  outline: none;
}

.chat-core-config-more {
  display: flex;
  flex-direction: column;
  width: max-content;
  max-width: 100%;
  min-height: 0;
  overflow-y: auto;
}

.chat-core-config-more-heading {
  padding: 10px 11px 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.chat-core-config-more-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

@media (max-width: 520px) {
  .chat-core-config-menu {
    max-width: calc(100vw - 16px);
    height: min(52vh, 420px);
    min-height: 160px;
  }

  .chat-core-config-heading {
    padding-inline: 8px;
  }

  .chat-core-config-values {
    padding: 4px;
  }

  .chat-core-config-option {
    padding-inline: 6px;
  }
}

.chat-config-value-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: var(--chat-config-popover-layer);
  width: max-content;
  min-width: 100%;
  max-width: min(320px, calc(100vw - 24px));
  max-height: min(42vh, 360px);
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, var(--accent-primary));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-overlay) 98%, var(--surface-panel));
  box-shadow: var(--shadow-overlay);
  backdrop-filter: blur(16px) saturate(1.06);
  -webkit-backdrop-filter: blur(16px) saturate(1.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px;
}

.chat-config-options .chat-config-item:first-child:not(:only-child) .chat-config-value-menu {
  left: 0;
  right: auto;
}

.chat-config-options .chat-config-item:only-child .chat-config-value-menu {
  left: auto;
  right: 0;
}

.chat-config-value-option {
  min-height: 28px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.chat-config-value-menu .chat-config-value-option {
  width: 100%;
  height: auto;
  align-items: flex-start;
  padding: 6px 8px;
  line-height: 1.25;
}

.chat-config-value-label {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  text-align: left;
}

.chat-config-value-option:hover,
.chat-config-value-option.selected {
  background: var(--hover);
}

.chat-config-value-option:disabled {
  opacity: 0.68;
  cursor: not-allowed;
}

.chat-config-value-option .sl-icon {
  color: var(--accent-primary);
  flex: 0 0 auto;
  margin-top: 1px;
}

.chat-empty-hint {
  padding: 8px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
}

.chat-empty-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-style: normal;
}

@media (prefers-reduced-motion: reduce) {
  .chat-prompt-status-dots span {
    animation: none;
  }
}

@keyframes thinkPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes dotBlink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.workspace-left .sidebar-scroll::-webkit-scrollbar,
.drawer .sidebar-scroll::-webkit-scrollbar,
.session-list-nav::-webkit-scrollbar,
.chat-file-peek-scroll::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

.workspace-left .sidebar-scroll::-webkit-scrollbar-button,
.drawer .sidebar-scroll::-webkit-scrollbar-button,
.session-list-nav::-webkit-scrollbar-button,
.chat-file-peek-scroll::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.workspace-left .sidebar-scroll::-webkit-scrollbar-thumb,
.drawer .sidebar-scroll::-webkit-scrollbar-thumb,
.session-list-nav::-webkit-scrollbar-thumb,
.chat-file-peek-scroll::-webkit-scrollbar-thumb {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid transparent;
  border-radius: 999px 0 0 999px;
  background: color-mix(in srgb, var(--text-secondary) 48%, transparent);
  background-clip: padding-box;
}

.workspace-left .sidebar-scroll::-webkit-scrollbar-track,
.drawer .sidebar-scroll::-webkit-scrollbar-track,
.session-list-nav::-webkit-scrollbar-track,
.chat-file-peek-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* workspace-ui-targeted-evolution: session sidebar */









.chat-hub-popover,
.chat-title-project-menu,
.project-session-action-menu,
.session-archive-menu,
.mobile-project-sheet {
  border-color: var(--border-subtle);
  border-radius: var(--radius-floating);
  background: var(--surface-overlay);
  box-shadow: var(--shadow-overlay);
}

/* workspace-ui-temporary-layers */
.chat-plan-surface.mobile.expanded,
.chat-config-value-menu,
.chat-core-config-menu,
.chat-context-usage-popover,
.chat-slash-menu,
.chat-file-mention-menu,
.session-archive-menu,
.project-session-action-menu,
.wide-project-action-popover,
.mobile-project-sheet {
  --workspace-temporary-layer-background: color-mix(in srgb, var(--surface-overlay) 82%, transparent);
  --workspace-temporary-layer-filter: blur(12px) saturate(1.08);
  background: var(--workspace-temporary-layer-background);
  border-color: color-mix(in srgb, var(--border-subtle) 84%, transparent);
  box-shadow:
    var(--shadow-overlay),
    inset 0 1px 0 color-mix(in srgb, var(--text-primary) 8%, transparent);
  backdrop-filter: var(--workspace-temporary-layer-filter);
  -webkit-backdrop-filter: var(--workspace-temporary-layer-filter);
}

@media (min-width: 900px) {
  .chat-plan-surface.mobile.expanded,
  .chat-config-value-menu,
  .chat-core-config-menu,
  .chat-context-usage-popover,
  .chat-slash-menu,
  .chat-file-mention-menu,
  .session-archive-menu,
  .project-session-action-menu,
  .wide-project-action-popover,
  .mobile-project-sheet {
    --workspace-temporary-layer-background: color-mix(in srgb, var(--surface-overlay) 58%, transparent);
  }
}

.chat-title-outline-menu,
.chat-top-level-menu {
  transform-origin: top left;
}

.chat-top-level-menu {
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

.chat-top-level-menu.sl-menu-exit {
  animation: sl-menu-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
}

.chat-edge-surface-glass {
  position: absolute;
  z-index: 0;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: inherit;
  background: var(--workspace-temporary-layer-background);
  box-shadow:
    var(--shadow-overlay),
    inset 0 1px 0 color-mix(in srgb, var(--text-primary) 8%, transparent);
  backdrop-filter: var(--workspace-temporary-layer-filter);
  -webkit-backdrop-filter: var(--workspace-temporary-layer-filter);
  pointer-events: none;
}

.chat-edge-surface-content {
  position: relative;
  z-index: 1;
  min-width: 0;
}

@media (prefers-reduced-transparency: reduce) {
  .chat-plan-surface.mobile.expanded,
  .chat-plan-compact-trigger,
  .chat-goal-surface.mobile,
  .chat-edge-surface-glass,
  .chat-config-value-menu,
  .chat-context-usage-popover,
  .chat-slash-menu,
  .chat-file-mention-menu,
  .session-archive-menu,
  .project-session-action-menu,
  .wide-project-action-popover,
  .mobile-project-sheet {
    background: var(--surface-overlay);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

}

@media (max-width: 900px) {
  .mobile-project-sheet {
    max-width: 100%;
    padding-bottom: max(12px, var(--wm-safe-area-bottom));
  }
}

/* workspace-ui-targeted-evolution: chat reading */
.chat-view-content {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 900px) {
  .chat-block {
    padding: 14px 12px 0;
  }

  .chat-main-message {
    font-family: 'Segoe UI', 'Microsoft YaHei', 'Microsoft YaHei UI', 'PingFang SC', 'Noto Sans CJK SC', 'Noto Sans', sans-serif;
    font-size: 14px;
    letter-spacing: 0;
  }

  .chat-main-message h2 {
    font-size: 1.3em;
  }

  .chat-main-message h3 {
    font-size: 1.15em;
  }

  .chat-main-message h4,
  .chat-main-message h5,
  .chat-main-message h6 {
    font-size: 1em;
  }
}

.chat-turn-entry {
  animation: chatTurnEnter var(--motion-emphasized) var(--ease-out) both;
}

.chat-permission-history-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 28px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.chat-permission-history-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.chat-permission-history-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent-primary);
}

.chat-permission-history-icon-answer {
  color: var(--text-secondary);
}

.chat-permission-history-question {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-primary);
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chat-permission-history-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-permission-dialog {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 40;
  width: min(520px, 100%);
  max-height: min(60vh, 680px);
  overflow: auto;
  transform: translateX(-50%);
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 32%, var(--border-subtle));
  border-radius: var(--radius-floating);
  background: var(--surface-panel);
  box-shadow: 0 18px 56px rgb(0 0 0 / 28%);
}

.chat-permission-dialog-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
}

.chat-permission-dialog-title {
  margin: 10px 0 0;
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1.3;
}

.chat-permission-dialog-details {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.chat-permission-options {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.chat-permission-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-workspace-content) 74%, transparent);
  text-align: left;
}

.chat-permission-option:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent-primary) 55%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--surface-workspace-content));
}

.chat-permission-option:disabled {
  cursor: wait;
  opacity: .64;
}

.chat-permission-option-name {
  line-height: 1.4;
}

.chat-permission-dialog-error {
  margin-top: 12px;
  color: var(--status-error, #e05252);
  font-size: 12px;
}

@media (max-width: 900px) {
  .chat-permission-dialog {
    width: 100%;
    max-height: min(55vh, 680px);
    padding: 18px;
  }
}

@keyframes chatTurnEnter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-turn-entry,
  .chat-hub-popover,
  .project-session-action-menu,
  .session-archive-menu,
  .chat-title-project-menu,
  .chat-top-level-menu,
  .chat-top-level-menu.sl-menu-exit,
  .chat-title-outline-menu,
  .mobile-project-sheet {
    animation: none;
  }
}

@media (max-width: 900px) {
  .chat-composer {
    padding-right: 12px;
    padding-bottom: max(4px, var(--wm-safe-area-bottom));
    padding-left: 12px;
    background: var(--surface-canvas);
  }

  .chat-composer-content,
  .chat-composer-frame {
    max-width: calc(100vw - 24px);
  }

  .chat-slash-menu,
  .chat-file-mention-menu,
  .chat-config-value-menu {
    max-width: calc(100vw - 24px);
    max-height: min(56dvh, 420px);
  }

  .chat-config-value-menu {
    overflow: auto;
    overscroll-behavior: contain;
  }
}

.chat-empty-hint,
.empty-card {
  color: var(--text-secondary);
  text-align: center;
}

.project-session-error,
.session-search-error {
  border: 1px solid color-mix(in srgb, var(--state-danger) 28%, var(--border-subtle));
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--state-danger) 7%, var(--surface-panel));
  color: var(--state-danger);
  padding: 8px 10px;
}

.project-session-error button,
.session-search-error button {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.session-archive-progress[role='status'] {
  border-color: var(--border-subtle);
  background: var(--surface-overlay);
  box-shadow: var(--shadow-floating);
}

.chat-sync-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(620px, 100%);
  margin: 0 auto 10px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 34%, var(--border-subtle));
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--state-warning) 8%, var(--surface-panel));
  color: var(--text-secondary);
  padding: 9px 10px;
  font-size: 12px;
  line-height: 18px;
}

.chat-sync-status button {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--state-warning) 44%, var(--border-subtle));
  border-radius: var(--radius-control);
  background: var(--surface-panel);
  color: var(--text-primary);
  padding: 4px 9px;
  font-size: inherit;
  line-height: 16px;
}

.chat-sync-status button:hover,
.chat-sync-status button:focus-visible {
  border-color: var(--state-warning);
  color: var(--state-warning);
}

@media (max-width: 600px) {
  .chat-sync-status {
    align-items: flex-start;
    flex-direction: column;
  }
}

.chat-loading-state {
  display: grid;
  gap: 10px;
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 12px 0;
}

.chat-loading-progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 18px;
}

.chat-loading-progress-track {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-raised);
}

.chat-loading-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease-out;
}

.chat-loading-progress-track.indeterminate > span {
  width: 35%;
  animation: chatLoadingProgress 1.2s ease-in-out infinite;
}

.chat-loading-line {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-raised);
  animation: feedbackStatePulse 1.4s ease-in-out infinite;
}

.chat-loading-line:nth-child(2) {
  width: 86%;
}

.chat-loading-line:nth-child(3) {
  width: 62%;
}

@media (prefers-reduced-motion: reduce) {
  .chat-loading-line,
  .chat-loading-progress-track.indeterminate > span {
    animation: none;
  }
}

@keyframes chatLoadingProgress {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(300%);
  }
}


.chat-search-bar {
  display: flex;
  gap: 6px;
  min-height: 34px;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  padding: 4px 8px;
  color: var(--text-secondary);
}

.chat-search-bar > .sl-icon {
  flex: 0 0 auto;
}

.chat-search-input-wrap {
  position: relative;
  flex: 1 1 180px;
  min-width: 0;
}

.chat-search-input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 5px;
  background: var(--surface-raised);
  color: var(--text-primary);
  padding: 0 7px;
  font-size: 12px;
  outline: none;
}

.chat-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.chat-search-status {
  flex: 0 1 168px;
  min-width: 0;
  max-width: 168px;
  min-height: 24px;
  display: flex;
  align-items: center;
  padding: 0 2px;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-search-submit-hint {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 12px);
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
  white-space: nowrap;
}

.chat-search-submit-hint .sl-icon {
  flex: 0 0 auto;
  color: var(--text-secondary);
}

.workspace-search-scope-picker {
  flex: 0 1 auto;
  position: relative;
  min-width: 0;
  max-width: min(150px, 28vw);
}

.workspace-search-scope-trigger {
  min-width: 0;
  max-width: min(150px, 28vw);
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 0 7px;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: 0 5px 5px 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  text-align: left;
  cursor: pointer;
}

.workspace-search-scope-trigger:hover,
.workspace-search-scope-trigger:focus-visible,
.workspace-search-scope-trigger[aria-expanded='true'] {
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  color: var(--text-primary);
  outline: none;
}

.workspace-search-scope-trigger .sl-icon {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
}

.workspace-search-scope-label,
.workspace-search-scope-project {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-search-scope-label {
  flex: 0 1 auto;
}

.workspace-search-scope-project {
  flex: 1 1 auto;
  color: var(--text-tertiary);
}

.workspace-search-scope-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  box-sizing: border-box;
  width: min(216px, calc(100vw - 16px));
  max-height: min(280px, calc(100vh - 32px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.workspace-search-scope-option {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.workspace-search-scope-option:hover,
.workspace-search-scope-option:focus-visible,
.workspace-search-scope-option.selected {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  outline: none;
}

.workspace-search-scope-option:disabled {
  color: var(--text-tertiary);
  cursor: not-allowed;
  opacity: 0.56;
}

.workspace-search-scope-option-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--accent-primary);
}

.workspace-search-scope-option-check .sl-icon {
  width: 14px;
  height: 14px;
}

.chat-search-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.chat-search-icon-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  color: var(--text-primary);
}

.chat-search-icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-search-match {
  background: color-mix(in srgb, #ffd166 30%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}


.chat-view-width-fixed-800 .chat-search-bar {
  width: min(var(--chat-view-column-width, 800px), 100%);
  margin: 4px auto 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 8px;
}

.chat-session-panel-sidebar .chat-edge-surface-header {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 11px;
  /* The panel's 1px end border is outside the header's content box. */
  padding-right: calc(var(--chat-header-end-padding) - 1px);
}

.chat-session-panel-sidebar .chat-edge-surface-toolbar {
  grid-column: 1 / -1;
  grid-row: 1;
  z-index: 1;
}

.chat-session-panel-sidebar .chat-session-global-bar-leading-actions {
  width: 100%;
  justify-content: flex-start;
  margin-left: 0;
}

.chat-session-panel-sidebar .chat-session-global-bar-summary .chat-hub-summary-button {
  max-width: min(154px, 48vw);
  padding-right: var(--chat-header-trigger-end-padding);
}

.chat-session-recent-toggle {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}

.chat-session-recent-toggle:hover {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--text-primary);
}

.chat-session-recent-toggle.active {
  background: var(--accent-soft-bg);
  color: var(--accent-primary);
}

.chat-session-recent-toggle.active:hover {
  background: color-mix(in srgb, var(--accent-primary) 24%, transparent);
  color: var(--accent-primary);
}

.chat-session-panel-sidebar .chat-edge-surface-toggle-spacer {
  display: none;
}

.chat-session-panel-sidebar .chat-edge-surface-title {
  display: none;
}

.chat-session-panel-sidebar .session-archive-menu {
  right: auto;
  left: 0;
}

.chat-main[data-session-sidebar-toggle-visible='true'] .session-widget-dock {
  top: 52px;
}

@media (prefers-reduced-motion: reduce) {
  .chat-session-sidebar-toggle-floating {
    transition: none;
  }
}


.session-archive-menu-title {
  padding: 6px 8px 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

.session-archive-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}

@media (hover: hover) {
  .session-archive-menu-item:hover {
    background: var(--hover);
    color: var(--text-primary);
  }
}

.session-archive-menu-item:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 1px;
}

.session-archive-menu-item-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: color-mix(in srgb, var(--accent-primary) 78%, var(--text-primary));
  transition: background var(--motion-fast) var(--ease-standard);
}

.session-archive-menu-item:hover .session-archive-menu-item-icon {
  background: color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.session-archive-menu-item-text {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.session-archive-menu-item-label {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-archive-menu-item-description {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-archive-menu-separator {
  height: 1px;
  margin: 4px 6px;
  background: var(--border-faint);
}
.chat-file-link-context-menu {
  position: fixed;
  z-index: 140;
  min-width: 208px;
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-overlay);
  box-shadow: var(--shadow-overlay);
  transform-origin: top left;
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}

.chat-file-link-context-menu.sl-menu-exit {
  animation: sl-menu-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .chat-file-link-context-menu {
    animation: none;
  }
}

.chat-file-link-context-menu button {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  text-align: left;
}

.chat-file-link-context-menu button .sl-icon {
  flex: 0 0 auto;
  color: var(--text-secondary);
}

.chat-file-link-context-menu button:hover {
  background: var(--hover);
}

.chat-file-link-context-menu button:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: -2px;
}



/* Search HUD: keep the control above the reading surface while content scrolls. */
.chat-main[data-chat-search-open='true'] .chat-search-hud {
  position: absolute;
  top: 8px;
  right: 8px;
  left: 8px;
  z-index: 40;
  width: auto;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 36%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-panel) 96%, var(--surface-canvas));
  box-shadow: 0 10px 26px color-mix(in srgb, #000 24%, transparent);
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard);
}

.chat-main[data-chat-search-open='true'] .chat-block {
  padding-top: calc(20px + 46px);
}

.chat-main.chat-view-width-fixed-800[data-chat-search-open='true'] .chat-search-hud {
  right: auto;
  left: 50%;
  width: min(var(--chat-view-column-width, 800px), calc(100% - 16px));
  transform: translateX(-50%);
}

.chat-search-hud:focus-within {
  border-color: color-mix(in srgb, var(--accent-primary) 72%, var(--border-subtle));
  box-shadow:
    0 10px 26px color-mix(in srgb, #000 24%, transparent),
    0 0 0 2px color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

.chat-search-status.no-results {
  background: transparent;
  color: var(--state-warning);
}

::highlight(chat-search-match) {
  background: color-mix(in srgb, #ffd166 30%, transparent);
  color: inherit;
}

::highlight(chat-search-match-active) {
  background: color-mix(in srgb, #ffd166 82%, var(--surface-raised));
  color: #231d0b;
}

.chat-search-match-active {
  background: color-mix(in srgb, #ffd166 82%, var(--surface-raised));
  color: #231d0b;
  box-shadow: 0 0 0 1px color-mix(in srgb, #ffd166 58%, transparent);
}

.chat-turn-search-highlight-active {
  outline-color: color-mix(in srgb, var(--accent-primary) 82%, var(--border-subtle));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

@media (max-width: 900px) {
  .chat-main[data-chat-search-open='true'] .chat-block {
    padding-top: calc(14px + 46px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-search-hud,
  .chat-search-input,
  .chat-turn-search-highlight {
    transition: none;
  }
}

/* Session list visual system — refined dark tool style.
   Applies to both desktop and mobile navs; density is driven by
   [data-session-list-density] (compact on mobile, user setting on PC). */

/* ---------- density tokens ---------- */
.session-list-nav,
.chat-session-sidebar-panel {
  --sl-row-py: 5px;
  --sl-row-font: 12.5px;
  --sl-section-gap: 12px;
}
[data-session-list-density="compact"] {
  --sl-row-py: 3px;
  --sl-section-gap: 9px;
}

.session-list-nav {
  padding-top: 8px;
  padding-right: 7px;
  padding-left: 7px;
}

/* ---------- project section (level 1: strong) ---------- */
.wide-project-section {
  margin-top: var(--sl-section-gap);
}
.wide-project-section:first-child {
  margin-top: 0;
}
.wide-project-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
}
.wide-project-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border: 0;
  background: none;
  border-radius: var(--radius-control);
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}
.wide-project-toggle:hover {
  background: var(--hover);
}
.wide-project-toggle:active {
  transform: scale(0.985);
}
.wide-project-folder-icon {
  color: var(--hub-accent, var(--text-tertiary));
  flex: none;
}
.wide-project-folder-wrap {
  position: relative;
  display: inline-flex;
  flex: none;
}
.wide-project-pin-badge {
  position: absolute;
  right: -4px;
  bottom: -3px;
  color: var(--accent-primary);
}
.wide-project-title-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.wide-project-name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wide-project-hub-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--hub-accent, var(--text-tertiary));
  opacity: 0.85;
  flex: none;
}
.wide-project-hub-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hub-accent, var(--text-tertiary));
}
.wide-project-hub-label {
  text-transform: uppercase;
}

/* ---------- project row actions: "+" always visible, rest hover-reveal ---------- */
.wide-project-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.wide-project-action-btn {
  appearance: none;
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  border-radius: var(--radius-control);
  color: var(--text-tertiary);
  cursor: pointer;
  transition:
    color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    opacity var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}
.wide-project-action-btn:hover {
  color: var(--text-primary);
  background: var(--hover);
}
.wide-project-action-btn.wide-project-pin-btn.active {
  color: var(--accent-primary);
  opacity: 1;
}
/* persistent affordance: always-visible actions read as clickable on hover */
.sl-action-primary,
.recent-sessions-collapse-btn,
.recent-project-divider-create {
  color: var(--text-secondary);
}
.sl-action-secondary {
  opacity: 0;
}
.wide-project-row:hover .sl-action-secondary,
.wide-project-row:focus-within .sl-action-secondary {
  opacity: 1;
}
@media (hover: none) {
  .wide-project-row .sl-action-secondary {
    display: none;
  }
  /* touch devices: the active project keeps all three actions visible */
  .wide-project-section.active .wide-project-row .sl-action-secondary {
    display: grid;
    opacity: 1;
  }
}

/* ---------- session rows (level 2: quiet, indented) ---------- */
.wide-project-session-list {
  display: grid;
  grid-template-rows: 1fr;
  margin-top: 2px;
  padding-left: 11px;
  opacity: 1;
  visibility: visible;
  transition:
    grid-template-rows var(--motion-standard) var(--ease-out),
    margin-top var(--motion-standard) var(--ease-out),
    opacity var(--motion-standard) var(--ease-out),
    visibility 0s linear 0s;
}
.wide-project-session-list-inner {
  min-height: 0;
  overflow: hidden;
}
.wide-project-session-list.is-collapsed {
  grid-template-rows: 0fr;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    grid-template-rows var(--motion-standard) var(--ease-out),
    margin-top var(--motion-standard) var(--ease-out),
    opacity var(--motion-standard) var(--ease-out),
    visibility 0s linear var(--motion-standard);
}
.project-session-row-wrap {
  position: relative;
  display: flex;
  align-items: center;
  /* gutter reserved for the leading state dot; row bg starts after it */
  padding-left: 14px;
}
.wide-session-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--sl-row-py) 8px var(--sl-row-py) 6px;
  border: 0;
  background: none;
  border-radius: var(--radius-control);
  font-size: var(--sl-row-font);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}
.wide-session-row:hover {
  background: var(--hover);
  color: var(--text-primary);
}
.wide-session-row:active {
  transform: scale(0.98);
}
.wide-session-row.selected {
  background: var(--accent-soft-bg);
  color: var(--text-primary);
}
.wide-session-row.keyboard-active {
  box-shadow: inset 2px 0 0 var(--accent-primary);
  background: color-mix(in srgb, var(--accent-soft-bg) 68%, var(--hover));
  color: var(--text-primary);
}
.wide-session-row.pinned {
  padding-right: 1px;
}
.wide-session-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wide-session-fork-marker {
  flex: none;
  margin-right: 5px;
  color: var(--text-tertiary);
}
.wide-session-title.forked {
  display: flex;
  align-items: center;
}
.wide-session-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wide-session-row.selected .wide-session-title {
  font-weight: 500;
}
.wide-session-time {
  flex: none;
  text-align: right;
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wide-session-agent-tag + .wide-session-time {
  margin-left: -3px;
}
.wide-session-time.compact-age {
  flex: 0 0 22.5px;
  min-width: 0;
}

.wide-session-tree-toggle {
  flex: none;
  width: 14px;
  height: 22px;
  display: grid;
  place-items: center;
  /* fully inside the 14px state gutter: zero net layout cost, so session
     titles stay aligned whether or not the row has subagents */
  margin-left: -14px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}
.wide-session-tree-toggle:hover {
  color: var(--text-primary);
  background: var(--hover);
}

.subagent-session-row-wrap {
  padding-left: 27px;
}
.subagent-session-group {
  position: relative;
}
/* Single faint hairline on the gutter (chevron) axis, dropping from the
   parent row's bottom edge to the last child's midline. */
.subagent-session-group::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: calc(var(--sl-row-py) + 7px);
  border-left: 1px solid color-mix(in srgb, var(--text-tertiary) 16%, transparent);
  pointer-events: none;
}
.subagent-session-row {
  gap: 7px;
  padding-left: 5px;
  /* one notch quieter than root rows: smaller and dimmer */
  font-size: 12px;
  color: var(--text-tertiary);
}
.subagent-session-row:hover {
  color: var(--text-secondary);
}
.subagent-session-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subagent-session-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  color: var(--text-tertiary);
  font-size: 10px;
  white-space: nowrap;
}
.subagent-session-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}
.subagent-session-status[data-subagent-status="running"] {
  color: var(--accent-primary);
}
.subagent-session-status[data-subagent-status="waiting_approval"] {
  color: var(--warning, #d29922);
}
/* Terminal states render as a bare dot; park it on the pin icon's centre
   axis (24px pin slot + 6.5px margin-right puts the centre 18.5px from the
   wrap's right edge) so it lines up with the pin column. */
.subagent-session-status[data-subagent-status="completed"],
.subagent-session-status[data-subagent-status="failed"],
.subagent-session-status[data-subagent-status="interrupted"] {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}
/* Keep long titles from running under the parked dot. */
.subagent-session-row:has(> .subagent-session-status[data-subagent-status="completed"]),
.subagent-session-row:has(> .subagent-session-status[data-subagent-status="failed"]),
.subagent-session-row:has(> .subagent-session-status[data-subagent-status="interrupted"]) {
  padding-right: 24px;
}
.subagent-session-status[data-subagent-status="completed"] {
  color: var(--success, #3fb950);
}
.subagent-session-status[data-subagent-status="failed"],
.subagent-session-status[data-subagent-status="interrupted"] {
  color: var(--danger, #f85149);
}

/* leading state dot sits in the reserved gutter, never overlapping the row bg */
.project-session-row-wrap .session-state-leading {
  left: 3px;
}
.project-session-row-wrap .session-state-leading.permission-pending {
  left: 0;
}
/* 12px spinner centered in the 14px gutter (center at 7px) so it stays clear
   of the row's selected background. */
.project-session-row-wrap .session-state-leading.running {
  left: -2px;
}
/* A root state takes priority over the tree chevron: keep both in the same
   gutter slot, but paint the state above the chevron. The state marker is
   pointer-transparent, so the toggle's hit target remains available. */
.project-session-row-wrap:has(.wide-session-tree-toggle) .session-state-leading {
  z-index: 2;
}
.wide-session-pin-btn {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  border-radius: var(--radius-control);
  color: var(--accent-primary);
  cursor: pointer;
  margin-right: 4px;
}
.wide-session-pin-btn:hover {
  background: var(--hover);
}
.wide-session-pin-indicator {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin-right: 4px;
  color: var(--accent-primary);
  pointer-events: none;
}
.wide-session-row.pinned + .wide-session-pin-btn,
.wide-session-row.pinned + .wide-session-pin-indicator {
  /* 8px row padding + 22.5px time slot - 24px pin slot = 6.5px. */
  margin-right: 6.5px;
}
.wide-session-pin-indicator .sl-icon {
  width: 14px;
  height: 14px;
}
.wide-project-action-btn:active:not(:disabled),
.recent-project-divider-jump:active,
.recent-project-divider-create:active {
  transform: scale(0.97);
}

/* ---------- agent mark ---------- */
.wide-session-agent-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  max-width: none;
  overflow: hidden;
  line-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
}
.theme-light .wide-session-agent-tag {
  color: var(--text-primary);
}

/* ---------- recent block ---------- */
.recent-project-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  /* no left padding: align group headers with the project rows below the list */
  padding: 3px 8px 3px 0;
  color: var(--text-tertiary);
}
.recent-project-divider-icon {
  flex: none;
}
.recent-project-divider-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-project-divider-jump,
.recent-project-divider-create {
  appearance: none;
  width: 20px;
  height: 20px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  border-radius: var(--radius-control);
  color: var(--text-tertiary);
  cursor: pointer;
}
.recent-project-divider-create {
  margin-left: auto;
}
.recent-project-divider-jump:hover,
.recent-project-divider-create:hover {
  color: var(--text-primary);
  background: var(--hover);
}

/* ---------- menu enter/exit ---------- */
/* Popovers anchored above their trigger carry translateY(-100%) in
   --sl-popover-shift; the keyframes must keep that shift or the menu would
   detach from its anchor while animating. */
@keyframes sl-menu-in {
  from { opacity: 0; transform: var(--sl-popover-shift, translateY(0)) translateY(-2px) scale(0.98); }
  to { opacity: 1; transform: var(--sl-popover-shift, translateY(0)); }
}
@keyframes sl-menu-out {
  to { opacity: 0; transform: var(--sl-popover-shift, translateY(0)) translateY(-2px) scale(0.98); }
}
.project-session-action-menu,
.wide-project-action-popover,
.session-archive-menu {
  animation: sl-menu-in var(--motion-standard) var(--ease-out);
}
.sl-menu-exit {
  animation: sl-menu-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
}

/* ---------- list enter ---------- */
@keyframes sl-list-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .project-session-action-menu,
  .wide-project-action-popover,
  .sl-menu-exit,
  .wide-project-session-list {
    animation: none;
  }
}

/* ---------- menus (context / action popover) ---------- */
/* Overlay stacking for session-list surfaces:
   70 sheet dim overlay < 71 mobile bottom sheets < 86 hub popover/page <
   90 desktop popovers (these) < 95 archive menu (may open above a popover). */
.project-session-action-menu,
.wide-project-action-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  overflow-y: auto;
  overscroll-behavior: contain;
  max-width: calc(100vw - 16px);
  transform-origin: var(--sl-popover-origin, top center);
  /* Static counterpart of the keyframe shift: keeps an above-anchored menu in
     place once the enter animation ends. */
  transform: var(--sl-popover-shift, translateY(0));
}
.sl-session-list-popover {
  background: color-mix(in srgb, var(--surface-overlay) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-overlay);
  padding: 4px;
}
.project-session-action-menu {
  min-width: 148px;
}
.wide-project-action-popover {
  width: min(260px, calc(100vw - 16px));
}
.project-session-menu-btn {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  background: none;
  border-radius: var(--radius-control);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}
.project-session-menu-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.project-session-menu-btn .sl-icon {
  color: var(--text-secondary);
}
/* The destructive entry announces itself before hover. */
.project-session-menu-btn.delete .sl-icon {
  color: color-mix(in srgb, var(--state-danger) 78%, var(--text-secondary));
}
/* Hover styles only where hover exists: on touch they would stick after tap. */
@media (hover: hover) {
  .project-session-menu-btn:hover:not(:disabled) {
    background: var(--hover);
    color: var(--text-primary);
  }
  .project-session-menu-btn:hover:not(:disabled) .sl-icon {
    color: var(--text-primary);
  }
  .project-session-menu-btn.delete:hover:not(:disabled) {
    color: var(--state-danger);
  }
  .project-session-menu-btn.delete:hover:not(:disabled) .sl-icon {
    color: var(--state-danger);
  }
}
.project-session-menu-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-session-menu-separator {
  height: 1px;
  margin: 2px 6px;
  background: var(--border-faint);
}
@media (prefers-reduced-transparency: reduce) {
  .sl-session-list-popover {
    background: var(--surface-overlay);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ---------- action popover header / items ---------- */
.wide-project-action-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 8px;
  color: var(--text-tertiary);
}
.wide-project-action-title-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.wide-project-action-title-main {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.wide-project-action-title-sub {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-tertiary);
}
.session-menu-header-icon {
  color: var(--text-tertiary);
}
.session-menu-header {
  padding-bottom: 6px;
}
.session-menu-eyebrow {
  padding: 4px 8px 2px;
  font-size: 10.5px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-menu-close {
  display: none;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.session-menu-close:hover,
.session-menu-close:focus-visible {
  background: var(--hover);
  color: var(--text-primary);
}
.session-menu-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 2px;
}
.wide-project-action-menu-item,
.wide-project-action-back {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  background: none;
  border-radius: var(--radius-control);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}
@media (hover: hover) {
  .wide-project-action-menu-item:hover,
  .wide-project-action-back:hover {
    background: var(--hover);
    color: var(--text-primary);
  }
}
.wide-project-action-empty {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

/* ---------- agent choice pills ---------- */
.agent-choice-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 8px 8px;
  outline: none;
}
.agent-choice-group-label {
  padding: 0 2px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.agent-choice-group-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 6px;
}
.agent-choice-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--agent-accent, var(--border-strong)) 38%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--agent-accent, #666) 16%, transparent),
    color-mix(in srgb, var(--agent-accent, #666) 8%, transparent)
  );
  color: color-mix(in srgb, var(--agent-accent, var(--text-secondary)) 88%, white);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}
@media (prefers-reduced-motion: no-preference) {
  .agent-choice-pill {
    animation: agent-choice-pill-in var(--motion-standard) var(--ease-out) backwards;
    animation-delay: var(--agent-choice-delay, 0ms);
  }
}
@keyframes agent-choice-pill-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.95);
  }
}
@media (hover: hover) {
  .agent-choice-pill:hover {
    border-color: color-mix(in srgb, var(--agent-accent, var(--accent-primary)) 60%, transparent);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--agent-accent, #666) 22%, transparent);
    transform: translateY(-1px);
  }
}
.agent-choice-pill.active {
  border-color: color-mix(in srgb, var(--agent-accent, var(--accent-primary)) 72%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--agent-accent, #666) 28%, transparent),
    color-mix(in srgb, var(--agent-accent, #666) 18%, transparent)
  );
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--agent-accent, #666) 14%, transparent);
}
.agent-choice-pill:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}
.agent-choice-pill:active {
  transform: scale(0.95);
}
.theme-light .agent-choice-pill {
  color: color-mix(in srgb, var(--agent-accent, #666) 80%, black);
}
.project-session-menu-btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* ---------- misc ---------- */
.wide-project-empty {
  padding: 4px 8px 4px 31px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}
.project-session-menu-btn {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.session-older-toggle {
  margin-left: 14px;
  font-style: normal;
  color: var(--text-tertiary);
}
.sl-icon {
  display: block;
  flex: none;
}
.sl-icon-spin {
  animation: sl-icon-rotate 0.9s linear infinite;
}
@keyframes sl-icon-rotate {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .wide-session-row,
  .wide-project-toggle,
  .wide-project-action-btn,
  .recent-project-divider-jump,
  .recent-project-divider-create,
  .project-session-menu-btn,
  .sl-action-secondary {
    transition: none;
  }
  .sl-icon-spin {
    animation-duration: 1.8s;
  }
}

/* affordance hover feedback (kept last so it wins over per-button hover rules) */
.sl-action-primary:hover,
.recent-sessions-collapse-btn:hover,
.recent-project-divider-jump:hover,
.recent-project-divider-create:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

/* ---------- recent block separator ---------- */
.wide-project-section.recent-sessions-section {
  padding: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.wide-project-section.recent-sessions-section:not(.collapsed) + .wide-project-section {
  margin-top: calc(var(--sl-section-gap) + 2px);
}
.wide-project-section.recent-sessions-section.collapsed {
  padding: 0;
  border-bottom: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.recent-sessions-section .wide-project-name {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.recent-sessions-section .recent-sessions-icon {
  color: var(--text-tertiary);
}
/* compact: tighten the gap between the project title row and its sessions */
[data-session-list-density="compact"] .wide-project-toggle {
  padding: 3px 6px;
}
[data-session-list-density="compact"] .wide-project-session-list {
  margin-top: 1px;
}

/* ---------- mobile bottom sheets ---------- */
/* Mobile session-list popups share one presentation: a bottom sheet with a
   dimmed overlay, matching .mobile-project-sheet. Desktop keeps popovers. */
.sl-sheet-overlay {
  display: none;
}
@keyframes sl-sheet-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes sl-sheet-out {
  to { opacity: 0; transform: translateY(16px); }
}
@keyframes sl-sheet-out-drag {
  from { opacity: 1; transform: translateY(var(--sl-sheet-drag-offset, 0px)); }
  to { opacity: 0; transform: translateY(100%); }
}
@keyframes sl-sheet-overlay-out {
  to { opacity: 0; }
}
.sl-sheet-overlay.sl-menu-exit {
  animation: sl-sheet-overlay-out var(--motion-exit) var(--ease-out) forwards;
}
@media (max-width: 900px) {
  .sl-sheet-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, 0.42);
    animation: sl-sheet-overlay-in var(--motion-standard) var(--ease-out);
  }
  @keyframes sl-sheet-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  .project-session-action-menu.sl-sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 71;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(72vh, 560px);
    padding: 4px 10px calc(var(--wm-safe-area-bottom) + 14px);
    border-radius: var(--radius-floating) var(--radius-floating) 0 0;
    border-bottom: 0;
    /* Sheets sit above a dimmed overlay, so the popover's blur is invisible
       there; use an opaque surface and a shadow that points up. */
    background: var(--surface-panel);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.42);
    animation: sl-sheet-in var(--motion-emphasized) var(--ease-out);
  }
  .project-session-action-menu.sl-sheet .session-menu-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 4px 4px 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
  }
  /* Drag-to-dismiss: the sheet springs back unless released past the
     threshold; while dragging it tracks the finger exactly. */
  .project-session-action-menu.sl-sheet {
    transition: transform var(--sl-sheet-release-duration, 220ms) var(--ease-drawer);
  }
  .project-session-action-menu.sl-sheet.dragging {
    transition: none;
  }
  .project-session-action-menu.sl-sheet .mobile-project-sheet-grip,
  .project-session-action-menu.sl-sheet .session-menu-header {
    touch-action: none;
  }
  .project-session-action-menu.sl-sheet .session-menu-header-icon {
    width: 17px;
    height: 17px;
    color: var(--accent-primary);
  }
  .project-session-action-menu.sl-sheet .wide-project-action-title-main {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
  }
  .project-session-action-menu.sl-sheet .wide-project-action-title-sub {
    color: var(--text-secondary);
    font-size: 11.5px;
    line-height: 1.2;
  }
  .project-session-action-menu.sl-sheet .session-menu-close {
    display: inline-flex;
  }
  .project-session-action-menu.sl-sheet .session-menu-body {
    padding: 4px 0;
  }
  .project-session-action-menu.sl-sheet.sl-menu-exit {
    animation: sl-sheet-out var(--motion-exit) var(--ease-out) forwards;
  }
  .project-session-action-menu.sl-sheet.sl-menu-exit.from-drag {
    /* Drag dismiss: continue from the gesture offset to fully off-screen
       instead of replaying the 16px tap-close exit. */
    animation-name: sl-sheet-out-drag;
  }
  .mobile-project-sheet {
    transition: transform var(--sl-sheet-release-duration, 220ms) var(--ease-drawer);
  }
  .mobile-project-sheet.dragging {
    transition: none;
  }
  .mobile-project-sheet.sl-menu-exit.from-drag {
    animation: sl-sheet-out-drag var(--motion-exit) var(--ease-out) forwards;
  }
  .project-session-action-menu.sl-sheet .project-session-menu-btn {
    min-height: 44px;
    font-size: 14px;
    padding: 6px 12px;
  }
  .project-session-action-menu.sl-sheet.chat-share-menu .chat-share-menu-body {
    padding: 4px 0;
  }
  .project-session-action-menu.sl-sheet.chat-share-menu .chat-share-menu-group {
    padding: 7px 4px 9px 10px;
  }
  .project-session-action-menu.sl-sheet.chat-share-menu .chat-share-menu-group-label {
    padding: 1px 8px 5px;
    font-size: 10.5px;
  }
  .project-session-action-menu.sl-sheet.chat-share-menu .chat-share-menu-action {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 14px;
  }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .sl-sheet-overlay,
  .sl-sheet-overlay.sl-menu-exit,
  .project-session-action-menu.sl-sheet,
  .project-session-action-menu.sl-sheet.sl-menu-exit,
  .mobile-project-sheet,
  .mobile-project-sheet.sl-menu-exit {
    animation: none;
    transition: none;
  }
}

/* Archive menu joins the same bottom-sheet presentation on mobile. The
   panel-scoped selectors keep pace with the anchoring overrides in chat.css. */
.session-archive-menu-grip {
  display: none;
}
@media (max-width: 900px) {
  .session-archive-menu,
  .chat-session-panel-sidebar .session-archive-menu {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 71;
    width: auto;
    max-width: none;
    max-height: min(72vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 10px calc(var(--wm-safe-area-bottom) + 14px);
    border-radius: var(--radius-floating) var(--radius-floating) 0 0;
    border-bottom: 0;
    background: var(--surface-panel);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.42);
    transform-origin: bottom center;
    animation: sl-sheet-in var(--motion-emphasized) var(--ease-out);
    transition: transform var(--sl-sheet-release-duration, 220ms) var(--ease-drawer);
  }
  .session-archive-menu-grip {
    display: block;
    margin: 2px auto 4px;
  }
  .session-archive-menu .session-archive-menu-item {
    min-height: 44px;
  }
  .session-archive-menu.sl-menu-exit {
    animation: sl-sheet-out var(--motion-exit) var(--ease-out) forwards;
  }
  .session-archive-menu.dragging {
    transition: none;
  }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .session-archive-menu {
    animation: none;
  }
}

.chat-function-action {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-function-action:hover { background: var(--hover); color: var(--text-primary); }
.chat-function-action:disabled { opacity: .52; cursor: default; }

.monitor-toolbar {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.monitor-actions {
  display: inline-flex;
  margin-left: auto;
  align-items: center;
  gap: 2px;
}

.monitor-body {
  overflow: auto;
}

.usage-account-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.usage-account-trigger:hover {
  background: var(--hover);
}
.usage-account-trigger:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: -2px;
}
.usage-quota-rail { display: block; height: 3px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--text-secondary) 18%, transparent); }
.usage-quota-rail > span {
  display: block;
  height: 100%;
  background: var(--accent-primary);
}
.usage-limit-line.tone-warning strong {
  color: var(--state-warning);
}
.usage-limit-line.tone-warning .usage-quota-rail > span {
  background: var(--state-warning);
}
.usage-limit-line.tone-warning .usage-limit-label {
  color: var(--state-warning);
}
.usage-limit-line.tone-danger strong {
  color: var(--state-danger);
}
.usage-limit-line.tone-danger .usage-quota-rail > span {
  background: var(--state-danger);
}
.usage-limit-line.tone-danger .usage-limit-label {
  color: var(--state-danger);
}

.usage-detail-list { padding: 7px; display: grid; gap: 6px; }
.usage-detail-provider { display: grid; gap: 5px; }
.usage-account-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; margin-bottom: 4px; }
.usage-account-card {
  padding: 7px 2px 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.usage-account-card + .usage-account-card {
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
}
.usage-account-title { display: inline-flex; min-width: 0; align-items: baseline; gap: 4px; overflow: hidden; color: var(--text-primary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.usage-account-title strong { color: var(--text-primary); font-size: 11px; font-weight: 650; }
.usage-account-hubs { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.usage-account-hub {
  padding: 1px 5px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 74%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  line-height: 14px;
}
.usage-limit-line { display: grid; grid-template-columns: 30px minmax(38px, 1fr) 34px minmax(76px, auto); align-items: center; gap: 7px; min-height: 25px; color: var(--text-tertiary); font-size: 10px; }
.usage-limit-label {
  font-size: 10px;
}
.usage-limit-line strong { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: 11px; font-variant-numeric: tabular-nums; }
.usage-limit-reset { overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.usage-limit-line.balance { grid-template-columns: 30px 1fr auto; }
.usage-reset-credits {
  display: grid;
  margin: 7px 0 2px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-raised) 38%, transparent);
}
.usage-reset-credits-heading,
.usage-reset-credit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
}
.usage-reset-credits-heading {
  background: color-mix(in srgb, var(--surface-raised) 56%, transparent);
  color: var(--text-secondary);
  font-size: 10px;
}
.usage-reset-credits-label { font-weight: 600; }
.usage-reset-credits-count {
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.usage-reset-credit-row {
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 52%, transparent);
}
.usage-reset-credit-label { color: var(--text-tertiary); font-size: 10px; }
.usage-reset-credit-row time {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.usage-account-message, .usage-detail-empty, .usage-feature-empty { padding: 9px; color: var(--text-secondary); font-size: 11px; }
@keyframes usage-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes usage-dialog-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes usage-overlay-out {
  to { opacity: 0; }
}

@keyframes usage-dialog-out {
  to {
    opacity: 0;
    transform: translateY(4px) scale(0.97);
  }
}

.usage-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  padding: 0;
  background: var(--surface-workspace-content);
  animation: usage-overlay-in var(--motion-standard) var(--ease-out) both;
}

.usage-mobile-tabs {
  display: grid;
  width: min(180px, 42vw);
  min-width: 108px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  flex: 0 1 180px;
  gap: 3px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 9px;
  background: transparent;
}

.usage-mobile-tabs button {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 620;
  cursor: pointer;
}

.usage-mobile-tabs button[aria-selected='true'] {
  background: var(--accent-soft-bg);
  color: var(--accent-primary);
  box-shadow: none;
}

.usage-history-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  padding:
    calc(16px + env(safe-area-inset-top))
    calc(16px + env(safe-area-inset-right))
    calc(16px + env(safe-area-inset-bottom))
    calc(16px + env(safe-area-inset-left));
  background: rgb(8 10 15 / 68%);
  animation: usage-overlay-in var(--motion-standard) var(--ease-out) both;
}

.usage-history-dialog {
  display: flex;
  width: min(720px, 100%);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 360px;
  margin: auto;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-floating);
  background: var(--surface-overlay);
  box-shadow: var(--shadow-overlay);
  color: var(--text-primary);
  animation: usage-dialog-in var(--motion-standard) var(--ease-out) both;
}

.usage-mobile-overlay.usage-overlay-exit,
.usage-history-overlay.usage-overlay-exit {
  animation: usage-overlay-out var(--motion-fast) var(--ease-out) forwards;
}

.usage-history-dialog.usage-dialog-exit {
  animation: usage-dialog-out var(--motion-fast) var(--ease-out) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .usage-mobile-overlay,
  .usage-history-overlay,
  .usage-history-dialog,
  .usage-mobile-overlay.usage-overlay-exit,
  .usage-history-overlay.usage-overlay-exit,
  .usage-history-dialog.usage-dialog-exit {
    animation: none;
  }
}

.usage-history-header {
  display: flex;
  min-height: 68px;
  padding: 10px 12px 10px 18px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.usage-history-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.usage-history-title-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  color: var(--accent-primary);
}

.usage-history-heading {
  min-width: 0;
}

.usage-history-heading h2 {
  display: flex;
  margin: 0;
  min-width: 0;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 680;
  text-wrap: balance;
}

.usage-history-heading h2 > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-history-window {
  padding: 2px 7px;
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1.3;
}

.usage-history-heading p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  text-wrap: pretty;
  white-space: nowrap;
}

.usage-history-close {
  display: inline-flex;
  width: 32px;
  height: 32px;
  padding: 0;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.usage-history-close:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.usage-history-close:focus-visible,
.usage-history-empty button:focus-visible,
.usage-history-error button:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 2px;
}

.usage-history-body {
  min-height: 0;
  padding: 18px 20px 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

.usage-history-summary {
  margin: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-history-summary strong,
.usage-history-summary time {
  color: var(--text-primary);
}

.usage-history-summary strong {
  font-size: 15px;
  font-weight: 650;
}

.usage-history-note {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  text-wrap: pretty;
}

.usage-history-chart,
.usage-history-chart-loading {
  width: 100%;
  height: 300px;
  margin-top: 14px;
}

.usage-history-chart-loading {
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
}

.usage-history-loading,
.usage-history-empty,
.usage-history-error {
  display: grid;
  min-height: 280px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.usage-history-loading-copy {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.usage-history-loading-copy span,
.usage-history-empty p,
.usage-history-error p {
  max-width: 420px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  text-wrap: pretty;
}

.usage-history-skeleton {
  display: grid;
  width: min(420px, 72vw);
  margin-top: 22px;
  gap: 10px;
}

.usage-history-skeleton span {
  height: 10px;
  border-radius: var(--radius-control);
  background: var(--surface-raised);
}

.usage-history-skeleton span:nth-child(2) {
  width: 82%;
}

.usage-history-skeleton span:nth-child(3) {
  width: 64%;
}

.usage-history-empty,
.usage-history-error {
  gap: 8px;
}

.usage-history-empty button,
.usage-history-error button {
  min-height: 32px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}

.usage-history-error strong {
  color: var(--state-danger);
}

@media (max-width: 620px) {
  .usage-history-overlay {
    padding:
      calc(8px + env(safe-area-inset-top))
      calc(8px + env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom))
      calc(8px + env(safe-area-inset-left));
  }

  .usage-history-dialog {
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .usage-history-body {
    padding: 14px 14px 16px;
  }

  .usage-history-chart,
  .usage-history-chart-loading {
    height: 260px;
  }
}

.deepseek-usage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.deepseek-usage-months { display: inline-flex; align-items: center; gap: 6px; }
.deepseek-usage-month-label {
  min-width: 64px;
  color: var(--text-secondary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.deepseek-usage-toolbar-side { display: inline-flex; align-items: center; gap: 6px; }
.deepseek-usage-updated {
  color: var(--text-tertiary);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.deepseek-usage-icon-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.deepseek-usage-icon-button:hover:not(:disabled) { background: var(--hover); color: var(--text-primary); }
.deepseek-usage-icon-button:disabled { cursor: default; opacity: 0.4; }
.deepseek-usage-icon-button:focus-visible,
.deepseek-usage-login input:focus-visible,
.deepseek-usage-login button:focus-visible,
.deepseek-usage-banner-action:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 2px;
}
.deepseek-usage-summary {
  display: grid;
  margin-bottom: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.deepseek-usage-summary > span {
  display: flex;
  min-width: 0;
  padding: 8px 10px;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
}
.deepseek-usage-summary strong {
  overflow: hidden;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deepseek-usage-summary em {
  color: var(--text-tertiary);
  font-size: 10px;
  font-style: normal;
}
.deepseek-usage-banner {
  display: flex;
  margin-bottom: 12px;
  padding: 9px 12px;
  flex-direction: column;
  gap: 4px;
  border: 1px solid;
  border-radius: var(--radius-control);
  font-size: 11px;
}
.deepseek-usage-banner.tone-warning {
  border-color: color-mix(in srgb, var(--state-warning) 45%, transparent);
  background: color-mix(in srgb, var(--state-warning) 8%, transparent);
  color: var(--state-warning);
}
.deepseek-usage-banner.tone-danger {
  border-color: color-mix(in srgb, var(--state-danger) 45%, transparent);
  background: color-mix(in srgb, var(--state-danger) 8%, transparent);
  color: var(--state-danger);
}
.deepseek-usage-banner p { margin: 0; color: var(--text-secondary); }
.deepseek-usage-banner-action {
  min-height: 26px;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}
.deepseek-usage-banner-action:hover { background: var(--hover); }
.deepseek-usage-login {
  display: grid;
  max-width: 420px;
  margin: 0 auto;
  padding: 16px;
  gap: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
}
.deepseek-usage-login > strong { font-size: 13px; }
.deepseek-usage-login > p { margin: 0; color: var(--text-secondary); font-size: 11px; }
.deepseek-usage-login a { color: var(--accent-primary); }
.deepseek-usage-login label { display: grid; color: var(--text-secondary); font-size: 11px; gap: 4px; }
.deepseek-usage-login input {
  box-sizing: border-box;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: inherit;
}
.deepseek-usage-login button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}
.deepseek-usage-login button:hover:not(:disabled) { background: var(--hover); }
.deepseek-usage-login button:disabled { cursor: default; opacity: 0.5; }
.deepseek-usage-login .deepseek-usage-primary-action {
  border-color: var(--accent-primary);
  background: var(--accent-soft-bg);
  color: var(--accent-primary);
}
.deepseek-usage-login-error { margin: 0; color: var(--state-danger); font-size: 11px; }
@media (max-width: 620px) {
  .deepseek-usage-summary { grid-template-columns: 1fr; }
}

/* Shared edge dock host: narrow attachment rail + expanding module layers. */

.edge-surface-dock {
  pointer-events: none;
}

.edge-surface-dock > * {
  pointer-events: auto;
}

/* Session widget dock: narrow attachment rail + expanding module layers. */

.session-widget-dock {
  --workspace-temporary-layer-background: color-mix(in srgb, var(--surface-overlay) 82%, transparent);
  --workspace-temporary-layer-filter: blur(12px) saturate(1.08);
  position: absolute;
  top: 8px;
  left: 0;
  z-index: var(--layer-workspace-chrome);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-left: 8px;
  pointer-events: none;
}

.session-widget-dock > * {
  pointer-events: auto;
}

.session-widget-dock-handle {
  display: none;
}

.session-widget-dock-rail {
  width: 36px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--motion-standard) var(--ease-out);
}

.widget-dock-slot {
  position: relative;
  width: 36px;
}

.widget-dock-item {
  width: 36px;
  margin: 0;
  padding: 8px 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  background: var(--workspace-temporary-layer-background);
  backdrop-filter: var(--workspace-temporary-layer-filter);
  -webkit-backdrop-filter: var(--workspace-temporary-layer-filter);
  box-shadow: var(--shadow-floating);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out);
}

.widget-dock-item:hover,
.widget-dock-item.open {
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.widget-dock-plan-ring {
  width: 16px;
  height: 16px;
}

.widget-dock-plan-ring-track {
  fill: none;
  stroke: color-mix(in srgb, var(--text-secondary) 25%, transparent);
  stroke-width: 2;
}

.widget-dock-plan-ring-fill {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 2;
  stroke-linecap: round;
}

.widget-dock-plan.tone-complete .widget-dock-plan-ring-fill {
  stroke: var(--state-success);
}

.widget-dock-plan.tone-pending .widget-dock-plan-ring-fill {
  stroke: var(--text-secondary);
}

.widget-dock-plan.tone-complete .widget-dock-plan-count {
  color: var(--state-success);
}

.widget-dock-plan-count,
.widget-dock-goal-percent,
.widget-dock-monitor-value,
.widget-dock-iq-value {
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.widget-dock-goal-ring {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text-secondary);
  box-sizing: border-box;
}

.widget-dock-goal.tone-active .widget-dock-goal-ring {
  border-color: var(--state-success);
}

.widget-dock-goal.tone-attention .widget-dock-goal-ring {
  border-color: var(--state-warning);
}

.widget-dock-goal.tone-complete .widget-dock-goal-ring {
  border-color: var(--accent-primary);
}

.widget-dock-monitor {
  gap: 6px;
}

.widget-dock-monitor-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.widget-dock-monitor-row .agent-icon {
  opacity: 0.8;
}

.widget-dock-monitor-row.tone-warning {
  color: var(--state-warning);
}

.widget-dock-monitor-row.tone-danger {
  color: var(--state-danger);
}

.widget-dock-monitor-row.placeholder {
  color: var(--text-secondary);
}

.widget-dock-iq {
  gap: 6px;
}

.widget-dock-iq-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.widget-dock-iq-row .model-efficiency-orb {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  opacity: 0.8;
}

.widget-dock-iq-value {
  color: var(--text-secondary);
  font-size: 10px;
}

.widget-dock-iq-value-insufficient {
  color: var(--text-tertiary);
}

.widget-dock-iq-row.placeholder .widget-dock-iq-value {
  color: var(--text-tertiary);
}

.widget-dock-layer {
  position: absolute;
  width: min(var(--chat-edge-surface-width, 360px), 90vw);
  max-height: min(48vh, 420px);
  border-radius: 8px;
  color: var(--text-primary);
  animation: widgetDockIn var(--motion-fast) var(--ease-out);
}

.widget-dock-layer:not(.widget-dock-layer-fullscreen):has(.monitor-body.iq) {
  width: min(460px, 92vw);
  max-height: min(82vh, 720px);
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 28px rgb(0 0 0 / 12%);
}

.widget-dock-layer:not(.widget-dock-layer-fullscreen):has(.monitor-body.limits) {
  max-height: min(calc(100dvh - 16px), 720px);
}

.widget-dock-layer-fullscreen {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: none;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface-workspace-content);
  box-shadow: none;
}

.widget-dock-layer-fullscreen > .chat-edge-surface-glass {
  display: none;
}

.widget-dock-layer-fullscreen > .chat-edge-surface-content {
  display: flex;
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.widget-dock-layer-fullscreen .widget-dock-layer-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  flex: 0 0 auto;
  height: calc(var(--wm-safe-area-top) + 50px);
  min-height: calc(var(--wm-safe-area-top) + 50px);
  box-sizing: border-box;
  padding: var(--wm-safe-area-top) 10px 0 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
}

.widget-dock-layer-fullscreen .widget-dock-layer-title {
  grid-column: 1;
  grid-row: 1;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
}

.widget-dock-layer-header-extra { min-width: 0; }

.widget-dock-layer-fullscreen .widget-dock-layer-header-extra {
  display: flex;
  min-width: 108px;
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

.widget-dock-layer-fullscreen .widget-dock-layer-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  flex: 0 0 auto;
  margin-left: 0;
}

.widget-dock-layer-fullscreen .monitor-body {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: var(--wm-safe-area-bottom);
}

.widget-dock-layer-fullscreen.usage-dialog-exit {
  animation: usage-dialog-out var(--motion-fast) var(--ease-out) forwards;
}

.widget-dock-slot > .widget-dock-layer {
  top: 0;
  left: 44px;
}

.widget-dock-layer-content {
  max-height: inherit;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 10px;
}

.widget-dock-layer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.widget-dock-layer-title {
  font-size: 12px;
  font-weight: 650;
}

.widget-dock-layer-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.widget-dock-layer-actions .monitor-actions {
  margin-left: 0;
}

@media (hover: hover) and (pointer: fine) {
  .session-widget-dock[data-chat-overlap='true']:not(:has(.widget-dock-layer))
    .session-widget-dock-rail {
    transform: translateX(calc(-100% - 2px));
  }

  .session-widget-dock[data-chat-overlap='true']:not(:has(.widget-dock-layer)):hover
    .session-widget-dock-rail,
  .session-widget-dock[data-chat-overlap='true']:not(:has(.widget-dock-layer)):focus-within
    .session-widget-dock-rail {
    transform: none;
  }

  .session-widget-dock[data-chat-overlap='true']:not(:has(.widget-dock-layer))
    .session-widget-dock-handle {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 2;
    display: block;
    width: 4px;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
    border-left: 0;
    border-radius: 0 4px 4px 0;
    background: color-mix(in srgb, var(--surface-panel) 92%, transparent);
    box-shadow: var(--shadow-floating);
    opacity: 0.9;
    pointer-events: auto;
    transition: opacity var(--motion-fast) var(--ease-standard);
  }

  .session-widget-dock[data-chat-overlap='true']:not(:has(.widget-dock-layer)):hover
    .session-widget-dock-handle,
  .session-widget-dock[data-chat-overlap='true']:not(:has(.widget-dock-layer)):focus-within
    .session-widget-dock-handle {
    opacity: 0;
  }
}

.widget-dock-layer-progress {
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.widget-dock-layer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.widget-dock-goal-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.widget-dock-goal-objective {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.plan-steps-list.compact .chat-plan-step-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-steps-list.detail .chat-plan-step-content {
  white-space: normal;
}

.plan-steps-list.detail .chat-plan-step.in-progress .chat-plan-step-content {
  color: var(--text-primary);
}

@keyframes widgetDockIn {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .widget-dock-layer {
    animation: none;
  }

  .widget-dock-layer-fullscreen.usage-dialog-exit {
    animation: none;
  }

  .widget-dock-item {
    transition: none;
  }

  .session-widget-dock-rail {
    transition: none;
  }

  .session-widget-dock[data-chat-overlap='true']:not(:has(.widget-dock-layer))
    .session-widget-dock-rail {
    transform: none;
  }

  .session-widget-dock-handle {
    display: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .widget-dock-item,
  .widget-dock-layer .chat-edge-surface-glass {
    background: var(--surface-overlay);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.model-efficiency-simple-list {
  display: grid;
  container-type: inline-size;
  gap: 6px;
  padding: 2px 4px 6px;
}

.model-efficiency-brand-title {
  margin: 0 0 1px;
  padding: 0 4px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
}

.model-efficiency-brand-group + .model-efficiency-brand-group {
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
}

.model-efficiency-orb {
  display: block;
  object-fit: contain;
  border-radius: 50%;
}

.model-efficiency-orb-astra.model-efficiency-orb-placeholder {
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 62%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent-primary) 16%, var(--surface-raised));
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.model-efficiency-family-row {
  display: grid;
  grid-template-columns: clamp(72px, 20%, 88px) minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  padding: 2px 4px;
  border-radius: 4px;
}

@media (hover: hover) {
  .model-efficiency-family-row:hover {
    background: var(--hover);
  }
}

.model-efficiency-family-heading {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 0;
}

.model-efficiency-family-name {
  min-width: 0;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.model-efficiency-family-recommendations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.model-efficiency-recommendation {
  display: grid;
  grid-template-areas:
    'score effort'
    'score meta';
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 4px;
  min-height: 28px;
  min-width: 0;
  line-height: 1.3;
}

.model-efficiency-effort {
  grid-area: effort;
  min-width: 0;
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.model-efficiency-score {
  grid-area: score;
  align-self: center;
  padding-left: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 19px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-overflow: clip;
  white-space: nowrap;
}

.model-efficiency-recommendation:first-child .model-efficiency-score:not(.model-efficiency-score-insufficient) {
  color: color-mix(in srgb, var(--accent-primary) 72%, var(--text-primary));
}

.model-efficiency-score-insufficient {
  color: var(--text-tertiary);
}

.model-efficiency-meta {
  grid-area: meta;
  display: flex;
  min-width: 0;
  overflow: hidden;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  color: var(--text-tertiary);
}

.model-efficiency-meta span {
  min-width: 0;
  color: inherit;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.model-efficiency-meta .model-efficiency-meta-separator {
  color: var(--text-tertiary);
}

@container (max-width: 360px) {
  .model-efficiency-recommendation {
    grid-template-areas: 'score' 'effort' 'meta';
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
  }
  .model-efficiency-recommendation .model-efficiency-score {
    text-align: left;
  }
}

.model-efficiency-state {
  display: grid;
  min-height: 116px;
  padding: 14px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
}

.model-efficiency-state.error { color: var(--state-danger); }
.model-efficiency-state button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 80%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
  color: var(--text-primary);
  cursor: pointer;
}

.model-efficiency-inline-error {
  margin: 6px 8px 0;
  padding: 5px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--state-danger) 10%, transparent);
  color: var(--state-danger);
  font-size: 10px;
}

.model-efficiency-skeleton {
  display: grid;
  gap: 8px;
  padding: 8px 9px 9px;
}

.model-efficiency-skeleton-row {
  display: grid;
  grid-template-columns: clamp(72px, 20%, 88px) repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.model-efficiency-skeleton-family-label {
  display: block;
  height: 14px;
  margin-top: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text-secondary) 12%, transparent);
}

.model-efficiency-skeleton-rail {
  display: block;
  height: 43px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text-secondary) 14%, transparent);
  animation: model-efficiency-skeleton-breathe 1.6s var(--ease-standard) infinite;
}

@keyframes model-efficiency-skeleton-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  .model-efficiency-skeleton-rail {
    animation: none;
  }
}



.markdown-preview [data-source-line-target='true'] {
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  outline: 1px solid color-mix(in srgb, var(--accent-primary) 38%, transparent);
  outline-offset: 3px;
  border-radius: 4px;
}

.code-wrap [data-line-number].wm-line-target {
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
}

.markdown-preview {
  padding: 12px 14px 18px;
  line-height: 1.6;
  color: var(--text-primary);
  -webkit-user-select: text;
  user-select: text;
}

.markdown-preview > :first-child {
  margin-top: 0;
}

.markdown-preview > :last-child {
  margin-bottom: 0;
}

.markdown-preview p,
.markdown-preview ul,
.markdown-preview ol,
.markdown-preview blockquote,
.markdown-preview table {
  margin: 0 0 12px 0;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
  margin: 16px 0 10px 0;
  line-height: 1.3;
}

.markdown-preview code {
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 0.92em;
}

.markdown-preview .wm-shiki-code {
  white-space: normal;
}

.markdown-preview .code-wrap {
  margin: 10px 0 12px;
}

.markdown-preview table {
  border-collapse: collapse;
  width: 100%;
  min-width: 0;
}

.markdown-preview th,
.markdown-preview td {
  border: 1px solid var(--border-subtle);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.markdown-preview .katex-display {
  margin: 8px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.markdown-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.html-preview {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.html-preview-frame {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.preview-workbench-rendered-tab > .html-preview {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

.wiki-preview {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.wiki-preview-frame {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.preview-workbench-rendered-tab > .wiki-preview {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

.chat-share-capture-host {
  position: fixed;
  top: 0;
  left: -10000px;
  width: max-content;
  max-width: none;
  pointer-events: none;
  z-index: -1;
}

.chat-share-capture-surface {
  max-width: none;
}

.markdown-html-export-host {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 800px;
  max-width: none;
  pointer-events: none;
  z-index: -1;
}

.markdown-html-export-surface {
  box-sizing: border-box;
  width: 100%;
  padding: 0;
}

.mermaid-block {
  position: relative;
  margin: 10px 0 12px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-panel);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.mermaid-block.is-dragging {
  cursor: grabbing;
}

.mermaid-block:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.mermaid-expand-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-panel) 88%, transparent);
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0.82;
}

.mermaid-expand-button:hover {
  background: var(--surface-panel);
  color: var(--text-primary);
  opacity: 1;
}

.mermaid-expand-button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  opacity: 1;
}

.mermaid-viewport {
  min-width: 100%;
  min-height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.mermaid-modal-viewport {
  min-width: 100%;
  min-height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.mermaid-viewport svg,
.mermaid-modal-viewport svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.mermaid-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--layer-workspace-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: color-mix(in srgb, #000 64%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mermaid-modal-dialog {
  display: flex;
  flex-direction: column;
  width: min(1440px, 100%);
  height: min(900px, 100%);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  color: var(--text-primary);
}

.mermaid-modal-dialog:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.mermaid-modal-toolbar {
  display: flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.mermaid-modal-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mermaid-modal-close-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.mermaid-modal-close-button:hover {
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  color: var(--text-primary);
}

.mermaid-modal-close-button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.mermaid-modal-canvas {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  background: var(--surface-workspace-content);
  overscroll-behavior: contain;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.mermaid-modal-canvas.is-dragging {
  cursor: grabbing;
}

.mermaid-modal-canvas:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

@media (max-width: 700px) {
  .mermaid-modal-overlay {
    padding: 8px;
  }

  .mermaid-modal-dialog {
    border-radius: 8px;
  }

  .mermaid-modal-canvas {
    padding: 12px;
  }
}

.mermaid-error {
  margin: 10px 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(244, 135, 113, 0.35);
  background: rgba(244, 135, 113, 0.1);
  color: var(--state-danger);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 12px;
}

.chat-main-message code:not(.wm-shiki-code) {
  font-family: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.45;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--chat-inline-code-background);
  color: var(--chat-inline-code-text);
  letter-spacing: 0;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  white-space: break-spaces;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-main-message .wm-shiki-code {
  white-space: normal;
}

.chat-main-message .code-wrap {
  margin: 6px 0 8px;
}

.chat-main-message .katex-display {
  margin: 8px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.code-wrap {
  display: block;
  width: 100%;
  min-width: 100%;
  padding: 0;
}

/* Framed code block: one continuous card — header and body share the frame
   surface (the pre background is transparent under the auto code theme). */
.code-frame {
  display: block;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-panel);
  overflow: hidden;
}

.code-frame-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 0 14px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 24px;
  -webkit-user-select: none;
  user-select: none;
}

.code-frame-language {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-frame-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.code-frame-copy:hover {
  background: rgba(127, 127, 127, 0.16);
  color: var(--text-primary);
}

.code-frame-copy:focus-visible {
  outline: 1px solid var(--accent-primary);
  outline-offset: -1px;
}

.code-frame-body {
  padding: 6px 14px 12px;
}

.code-frame .code-wrap {
  margin: 0;
}

.markdown-preview .code-frame {
  margin: 10px 0 12px;
}

.chat-main-message .code-frame {
  margin: 6px 0 8px;
}

.diff-inline .wm-shiki-pre,
.diff-inline .wm-shiki-code {
  min-width: 100%;
}

.diff-inline .wm-shiki-diff-gutter {
  display: grid;
  grid-template-columns: 3.2em 3.2em;
  column-gap: 0.2em;
  align-items: center;
  padding: 0 0.45em 0 0.25em;
  border-right: 1px solid rgba(127, 127, 127, 0.22);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  color: var(--text-secondary);
  background: transparent;
}

.diff-inline .wm-shiki-diff-gutter .wm-shiki-line-number {
  min-width: 0;
  padding: 0;
  text-align: right;
  opacity: 0.75;
  color: var(--text-secondary);
}

.diff-inline .wm-shiki-diff-marker {
  display: none;
}

.diff-inline .wm-shiki-diff-marker-added {
  color: #2ea043;
}

.diff-inline .wm-shiki-diff-marker-removed {
  color: var(--state-danger);
}

.diff-inline .wm-shiki-diff-marker-context {
  color: transparent;
}

.diff-inline .wm-shiki-diff-line[data-line-kind='added'] {
  background: rgba(46, 160, 67, 0.16);
}

.diff-inline .wm-shiki-diff-line[data-line-kind='removed'] {
  background: rgba(248, 81, 73, 0.16);
}

.diff-inline .wm-shiki-diff-line[data-line-kind='empty'] {
  background: rgba(127, 127, 127, 0.06);
}
.theme-light .diff-inline .wm-shiki-diff-line[data-line-kind='added'] {
  background: rgba(46, 160, 67, 0.1);
}

.theme-light .diff-inline .wm-shiki-diff-line[data-line-kind='removed'] {
  background: rgba(207, 34, 46, 0.1);
}

.theme-light .diff-inline .wm-shiki-diff-line[data-line-kind='empty'] {
  background: rgba(127, 127, 127, 0.04);
}

.diff-inline .wm-shiki-diff-line[data-separator='hunk'],
.diff-inline .wm-shiki-diff-line[data-separator='file'] {
  position: relative;
  border-top: 1px dashed rgba(127, 127, 127, 0.45);
  border-bottom: 1px dashed rgba(127, 127, 127, 0.45);
  background: linear-gradient(
    90deg,
    rgba(127, 127, 127, 0.1),
    rgba(127, 127, 127, 0.04)
  );
}

.diff-inline .wm-shiki-diff-line[data-separator='hunk'] .wm-shiki-line-content,
.diff-inline .wm-shiki-diff-line[data-separator='file'] .wm-shiki-line-content {
  color: var(--text-secondary);
  font-style: italic;
  letter-spacing: 0.03em;
}

.diff-inline .wm-shiki-diff-line[data-separator='hunk'] .wm-shiki-diff-gutter,
.diff-inline .wm-shiki-diff-line[data-separator='file'] .wm-shiki-diff-gutter {
  opacity: 0.45;
}

.diff-inline .wm-shiki-diff-line[data-separator='file'] {
  border-top-width: 2px;
  border-bottom-width: 2px;
}

@media (max-width: 900px) {
  .chat-config-options {
    width: auto;
    gap: 3px;
  }

  .chat-config-item {
    flex: 0 1 auto;
    min-width: 0;
  }

  .chat-config-pill {
    max-width: 112px;
    padding: 0 5px;
  }

  .diff-inline .wm-shiki-diff-gutter {
    grid-template-columns: 2.8em 2.8em;
    column-gap: 0.15em;
    padding: 0 0.35em 0 0.2em;
  }
}

.content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.block-title {
  height: 32px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
}

.block-title.with-tools {
  justify-content: space-between;
  gap: 10px;
}

.desktop-shell .workspace-right .block-title {
  background: var(--desktop-top-surface);
}

.desktop-shell[data-desktop-window-controls='true'] .workspace-right .block-title {
  padding-right: calc(var(--desktop-window-controls-width) + 10px);
}

.desktop-shell > .chat-title-bar {
  padding-right: 10px;
}

.desktop-shell[data-desktop-window-controls='true'] > .chat-title-bar {
  padding-right: calc(var(--desktop-window-controls-width) + 10px);
}

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

/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */

/**
 *  Default styles for xterm.js
 */

.xterm {
    cursor: text;
    position: relative;
    user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
}

.xterm.focus,
.xterm:focus {
    outline: none;
}

.xterm .xterm-helpers {
    position: absolute;
    top: 0;
    /**
     * The z-index of the helpers must be higher than the canvases in order for
     * IMEs to appear on top.
     */
    z-index: 5;
}

.xterm .xterm-helper-textarea {
    padding: 0;
    border: 0;
    margin: 0;
    /* Move textarea out of the screen to the far left, so that the cursor is not visible */
    position: absolute;
    opacity: 0;
    left: -9999em;
    top: 0;
    width: 0;
    height: 0;
    z-index: -5;
    /** Prevent wrapping so the IME appears against the textarea at the correct position */
    white-space: nowrap;
    overflow: hidden;
    resize: none;
}

.xterm .composition-view {
    /* TODO: Composition position got messed up somewhere */
    background: #000;
    color: #FFF;
    display: none;
    position: absolute;
    white-space: nowrap;
    z-index: 1;
}

.xterm .composition-view.active {
    display: block;
}

.xterm .xterm-viewport {
    /* On OS X this is required in order for the scroll bar to appear fully opaque */
    background-color: #000;
    overflow-y: scroll;
    cursor: default;
    position: absolute;
    right: 0;
    left: 0;
    top: 0;
    bottom: 0;
}

.xterm .xterm-screen {
    position: relative;
}

.xterm .xterm-screen canvas {
    position: absolute;
    left: 0;
    top: 0;
}

.xterm-char-measure-element {
    display: inline-block;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: -9999em;
    line-height: normal;
}

.xterm.enable-mouse-events {
    /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
    cursor: default;
}

.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
    cursor: pointer;
}

.xterm.column-select.focus {
    /* Column selection mode */
    cursor: crosshair;
}

.xterm .xterm-accessibility:not(.debug),
.xterm .xterm-message {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
    color: transparent;
    pointer-events: none;
}

.xterm .xterm-accessibility-tree:not(.debug) *::selection {
  color: transparent;
}

.xterm .xterm-accessibility-tree {
  font-family: monospace;
  user-select: text;
  white-space: pre;
}

.xterm .xterm-accessibility-tree > div {
  transform-origin: left;
  width: fit-content;
}

.xterm .live-region {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.xterm-dim {
    /* Dim should not apply to background, so the opacity of the foreground color is applied
     * explicitly in the generated class and reset to 1 here */
    opacity: 1 !important;
}

.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }

.xterm-overline {
    text-decoration: overline;
}

.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }

.xterm-strikethrough {
    text-decoration: line-through;
}

.xterm-screen .xterm-decoration-container .xterm-decoration {
	z-index: 6;
	position: absolute;
}

.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
	z-index: 7;
}

.xterm-decoration-overview-ruler {
    z-index: 8;
    position: absolute;
    top: 0;
    right: 0;
    pointer-events: none;
}

.xterm-decoration-top {
    z-index: 2;
    position: relative;
}



/* Derived from vs/base/browser/ui/scrollbar/media/scrollbar.css */

/* xterm.js customization: Override xterm's cursor style */
.xterm .xterm-scrollable-element > .scrollbar {
    cursor: default;
}

/* Arrows */
.xterm .xterm-scrollable-element > .scrollbar > .scra {
	cursor: pointer;
	font-size: 11px !important;
}

.xterm .xterm-scrollable-element > .visible {
	opacity: 1;

	/* Background rule added for IE9 - to allow clicks on dom node */
	background:rgba(0,0,0,0);

	transition: opacity 100ms linear;
	/* In front of peek view */
	z-index: 11;
}
.xterm .xterm-scrollable-element > .invisible {
	opacity: 0;
	pointer-events: none;
}
.xterm .xterm-scrollable-element > .invisible.fade {
	transition: opacity 800ms linear;
}

/* Scrollable Content Inset Shadow */
.xterm .xterm-scrollable-element > .shadow {
	position: absolute;
	display: none;
}
.xterm .xterm-scrollable-element > .shadow.top {
	display: block;
	top: 0;
	left: 3px;
	height: 3px;
	width: 100%;
	box-shadow: var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset;
}
.xterm .xterm-scrollable-element > .shadow.left {
	display: block;
	top: 3px;
	left: 0;
	height: 100%;
	width: 3px;
	box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
}
.xterm .xterm-scrollable-element > .shadow.top-left-corner {
	display: block;
	top: 0;
	left: 0;
	height: 3px;
	width: 3px;
}
.xterm .xterm-scrollable-element > .shadow.top.left {
	box-shadow: var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset;
}

.terminal-splitter {
  position: relative;
  flex: 0 0 5px;
  height: 5px;
  cursor: row-resize;
  background: var(--border-subtle);
  touch-action: none;
}

.terminal-splitter:hover,
.terminal-splitter:active {
  background: var(--accent-primary);
}

.terminal-desktop-panel {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 160px;
  max-height: 70%;
  overflow: hidden;
  background: var(--surface-workspace-content);
}

.terminal-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  min-width: 0;
  min-height: 0;
  padding-top: var(--wm-safe-area-top);
  background: var(--surface-workspace-content);
}

.terminal-workbench {
  flex: 1 1 auto;
}

.terminal-mobile-overlay[hidden] {
  display: none;
}

.terminal-workbench.mobile > .workbench-chrome-fullscreen-toggle {
  bottom: calc(71px + var(--wm-safe-area-bottom));
}

.terminal-tabs {
  gap: 1px;
}

.terminal-tab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  flex: 0 0 auto;
  min-width: 104px;
  max-width: 190px;
  height: 34px;
  border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  background: transparent;
}

.terminal-tab.active {
  color: var(--text-primary);
  background: var(--surface-workspace-content);
  box-shadow: inset 0 2px var(--accent-primary);
}

.terminal-tab-open,
.terminal-tab-close {
  height: 33px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.terminal-tab-open {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding-left: 8px;
  text-align: left;
}

.terminal-status {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.terminal-status.running { background: var(--state-success); }
.terminal-status.exited { background: var(--text-tertiary); }
.terminal-status.error { background: var(--state-danger); }
.terminal-status.unavailable { background: var(--state-danger); }

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

.terminal-tab-close {
  display: grid;
  place-items: center;
  opacity: 0.7;
}

.terminal-tab-close:hover {
  color: var(--state-danger);
  background: var(--hover);
  opacity: 1;
}

.terminal-toolbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-secondary);
  background: var(--surface-raised);
  cursor: pointer;
  font-size: 11px;
}

.terminal-toolbar-action:hover,
.terminal-toolbar-action:focus-visible {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--hover);
}

.terminal-more {
  position: relative;
  display: flex;
}

.terminal-actions-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 22;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-panel);
  box-shadow: var(--shadow-floating);
}

.terminal-actions-menu button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  color: var(--text-primary);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.terminal-actions-menu button:hover,
.terminal-actions-menu button:focus-visible {
  background: var(--hover);
}

.terminal-content,
.terminal-xterm-surface,
.terminal-xterm-host {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.terminal-content { position: relative; padding: 6px 0 0 6px; overflow: hidden; }
.terminal-xterm-surface {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
}
/* TerminalView sets --wm-terminal-bg to the active theme background so the
   sub-cell remainder below the rendered rows blends with the cells instead of
   exposing the viewport's hardcoded black, which otherwise shows as a black bar
   that grows while resizing. */
.terminal-xterm-host {
  width: 100%;
  height: 100%;
  background-color: var(--wm-terminal-bg);
  touch-action: none;
  overscroll-behavior: contain;
}
/* Override xterm's viewport black; equal specificity but lands later because
   terminal.css @imports the xterm stylesheet, so this wins. */
.terminal-xterm-host .xterm-viewport {
  background-color: var(--wm-terminal-bg);
}
.terminal-xterm-host .xterm { height: 100%; }
.terminal-copy-context-menu {
  position: fixed;
  z-index: 120;
  min-width: 112px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-overlay);
  box-shadow: var(--shadow-overlay);
  transform-origin: top left;
  animation: sl-menu-in var(--motion-fast) var(--ease-out);
}
.terminal-copy-context-menu.sl-menu-exit {
  /* Keep the portal mounted for the shared motion-exit duration. */
  animation: sl-menu-out var(--motion-exit) var(--ease-out) forwards;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .terminal-copy-context-menu {
    animation: none;
  }
}
.terminal-copy-context-menu button {
  appearance: none;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  color: var(--text-primary);
  background: transparent;
  cursor: pointer;
}
.terminal-copy-context-menu button:hover,
.terminal-copy-context-menu button:focus-visible {
  background: var(--hover);
  outline: none;
}
.terminal-empty { padding: 24px; color: var(--text-tertiary); }

.terminal-keybar {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 6px 6px calc(6px + var(--wm-safe-area-bottom));
  overflow-x: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-sidebar);
}

.terminal-keybar button {
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  color: var(--text-primary);
  background: var(--surface-raised);
}

.terminal-keybar button[aria-pressed='true'] {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 30%, var(--surface-raised));
}

@media (max-width: 720px) {
  .terminal-tab {
    min-width: 112px;
  }

  .terminal-toolbar-action {
    height: 28px;
    padding: 0 6px;
  }
}

.share-manager {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 20px 28px;
  color: var(--text-primary);
}

.share-manager-intro,
.share-manager-section-heading,
.share-manager-record,
.share-manager-record-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-manager-intro,
.share-manager-section-heading,
.share-manager-record {
  justify-content: space-between;
}

.share-manager h2,
.share-manager h3,
.share-manager p {
  margin: 0;
}

.share-manager h2 { font-size: 20px; }
.share-manager h3 { font-size: 14px; }
.share-manager-intro p,
.share-manager-muted,
.share-manager-origin,
.share-manager-record-main span { color: var(--text-secondary); font-size: 12px; }
.share-manager-status {
  padding: 4px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 11px;
}
.share-manager-status.enabled { color: var(--accent-primary); border-color: color-mix(in srgb, var(--accent-primary) 45%, var(--border-subtle)); }
.share-manager-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-panel) 94%, var(--surface-canvas));
}
.share-manager-subtle-button,
.share-manager-load-more,
.share-manager-back-button {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 11px;
  background: var(--surface-raised);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
}
.share-manager-records { display: flex; flex-direction: column; gap: 8px; }
.share-manager-record { align-items: flex-start; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent); }
.share-manager-record-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.share-manager-record-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-manager-record-actions { flex: 0 0 auto; gap: 6px; }
.share-link-icon-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  text-decoration: none;
}
.share-link-icon-action:active:not(:disabled) {
  transform: scale(.96);
}
.share-manager-record-actions .share-link-icon-action {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text-primary);
  cursor: pointer;
}
.share-manager-record-actions .share-manager-danger-button {
  color: var(--state-danger);
}
.share-manager-record-actions .share-link-icon-action:disabled {
  opacity: .45;
  cursor: default;
}
.share-manager-warning { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid color-mix(in srgb, var(--state-warning) 50%, var(--border-subtle)); border-radius: 8px; color: var(--text-secondary); font-size: 12px; }
.share-manager-warning ul { margin: 0; padding-left: 20px; }
.share-manager-error { padding: 9px 11px; border-radius: 8px; background: color-mix(in srgb, var(--state-danger) 14%, transparent); color: var(--state-danger); font-size: 12px; }
.share-manager-notice { padding: 9px 11px; border-radius: 8px; background: color-mix(in srgb, var(--accent-primary) 12%, transparent); color: var(--text-primary); font-size: 12px; overflow-wrap: anywhere; }
.share-manager-back-button { align-self: flex-start; }

.share-create-dialog {
  width: min(520px, calc(100vw - 28px));
}

.share-create-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.share-create-server {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
  color: var(--text-secondary);
  font-size: 11px;
}

.share-create-server > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.share-create-server-url,
.share-create-success > span {
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.share-create-fields {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 12px;
}

.share-create-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.share-create-name-input {
  margin-top: 0;
}

.share-create-field select {
  height: 34px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 0 9px;
  background: var(--surface-panel);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
}

.share-create-success {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 42%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  font-size: 12px;
}

.share-create-success > span {
  font-size: 11px;
  line-height: 1.45;
}

.share-create-dialog .share-manager-notice {
  margin-top: 9px;
}

/* ============================================================
   Settings detail visual refresh — Public shares uses the same
   track, section title, semantic surface, and control grammar.
   ============================================================ */
.settings-detail-body > .share-manager {
  gap: 12px;
  padding: 0 0 20px;
}

.settings-detail-body > .share-manager .share-manager-intro.set-section-surface {
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: none;
}

.settings-detail-body > .share-manager .share-manager-intro > div {
  flex: 1 1 auto;
  min-width: 0;
}

.settings-detail-body > .share-manager h2.set-section-title {
  gap: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
}

.settings-detail-body > .share-manager .share-manager-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0;
  border: 0;
  color: var(--text-secondary);
  font-weight: 600;
}

.settings-detail-body > .share-manager .share-manager-status.enabled,
.settings-detail-body > .share-manager .share-manager-status.is-ok {
  color: var(--state-success);
}

.settings-detail-body > .share-manager .share-manager-list.set-section-surface {
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: none;
}

.settings-detail-body > .share-manager .share-manager-section-heading {
  gap: 8px;
}

.settings-detail-body > .share-manager h3.set-section-title {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
}

.settings-detail-body > .share-manager .share-manager-subtle-button,
.settings-detail-body > .share-manager .share-manager-load-more,
.settings-detail-body > .share-manager .share-manager-back-button {
  min-height: 30px;
  border-radius: var(--radius-control);
  padding: 0 10px;
  background: transparent;
  color: var(--text-secondary);
}

.settings-detail-body > .share-manager .share-manager-subtle-button:hover,
.settings-detail-body > .share-manager .share-manager-load-more:hover,
.settings-detail-body > .share-manager .share-manager-back-button:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.settings-detail-body > .share-manager .share-manager-record {
  gap: 12px;
  padding: 10px 0;
}

.settings-detail-body > .share-manager .share-manager-error {
  border: 1px solid color-mix(in srgb, var(--state-danger) 30%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-danger) 12%, transparent);
  color: var(--state-danger);
}

.settings-detail-body > .share-manager .share-link-icon-action.set-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: var(--radius-control);
}

.settings-detail-body > .share-manager .share-manager-danger-button {
  color: var(--state-danger);
}

@media (max-width: 720px) {
  .share-manager { padding: 14px 12px 28px; }
  .share-manager-record { flex-direction: column; }
  .share-manager-record-actions { align-self: flex-end; }
}



