/* Shared desktop chrome and docked details. Dimensions use CSS pixels / AppKit points. */
html[data-kalamos-desktop-app="true"] .app-shell {
  --desktop-traffic-lights-end: var(--native-controls-end, 68px);
  --desktop-toggle-top: calc(var(--native-control-center-y, 20px) - 11px);
}
html[data-kalamos-desktop-app="true"] .main-header { height: 40px; min-height: 40px; padding-block: 4px; }
html[data-kalamos-desktop-app="true"] .sidebar-header { height: 84px; min-height: 84px; }
html[data-kalamos-desktop-app="true"] .sidebar-wordmark { top: 49px; left: 16px; width: 88px; height: 18px; }
.app-shell[data-runtime-mode="local-review"] .sidebar-header { height: 84px; min-height: 84px; }
.app-shell[data-runtime-mode="local-review"] .sidebar-wordmark { top: 49px; }
.product-mode-switch {
  position: absolute; top: 7px; right: 12px; width: 88px; height: 24px;
  margin: 0; padding: 2px; gap: 0; border-radius: 7px;
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
  -webkit-app-region: no-drag;
}
html[data-kalamos-desktop-app="true"] .product-mode-switch { top: 46px; }
.app-shell[data-runtime-mode="local-review"] .product-mode-switch { top: 46px; }
.product-mode-switch button { position: relative; z-index: 1; height: 20px; min-height: 20px; padding: 0 5px; border-radius: 5px; font-size: 11px; }
.product-mode-switch button[aria-pressed="true"] { background: transparent; box-shadow: none; }
.product-mode-thumb { position: absolute; inset: 2px auto 2px 2px; width: calc((100% - 4px) / 2); border-radius: 5px; background: var(--surface-1); box-shadow: 0 1px 3px rgb(0 0 0 / 8%); transform: translateX(0); transition: transform 180ms cubic-bezier(.2,.8,.2,1); will-change: transform; }
.product-mode-switch[data-mode="content"] .product-mode-thumb { transform: translateX(100%); }
.sidebar-projects { margin: 8px 0 12px; }
.sidebar-section-label { display: block; padding: 4px 12px; color: var(--text-secondary); font-size: 12px; }
.sidebar-groups { animation: mode-navigation-in 180ms ease-out; }
@keyframes mode-navigation-in { from {opacity: .6; transform: translateY(3px);} to {opacity: 1; transform: none;} }
.home-panel-toggle { position: absolute; z-index: 5; top: 4px; right: 12px; }
.main-shell .home-composer-group { width: min(var(--composer-width), calc(100% - 48px)); }
.main-shell .composer, .main-shell .prompt-chips { width: 100%; max-width: var(--composer-width); }
.menu--attachment { width: 244px; min-height: 0; padding: 5px; }
.menu--attachment .menu-item { min-height: 34px; padding: 6px 9px; gap: 10px; border-radius: 6px; }
.attachment-profile-options {
  position: fixed;
  z-index: var(--z-popover);
  width: max-content;
  min-width: 168px;
  max-width: min(260px, calc(100vw - 16px));
  max-height: min(280px, calc(100vh - 16px));
  overflow: auto;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  box-shadow: var(--shadow-menu);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform-origin: top left;
}
.attachment-profile-options[hidden] { display: none !important; }
.attachment-profile-options[data-side="left"] { transform-origin: top right; }
.attachment-profile-options .menu-item { min-height: 32px; padding: 6px 9px; border-radius: 6px; }
.attachment-profile-options .menu-empty { margin: 0; padding: 8px 10px; color: var(--text-faint); font-size: 12px; }
.menu-empty { padding: 8px 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.menu--compact-models {
  width: max-content;
  min-width: 200px;
  background: var(--surface-1);
  padding: 5px;
  border-radius: 10px;
  overflow: visible;
  /* A flyout below this menu is viewport-positioned. backdrop-filter and the
     default menu transform would establish a fixed-position containing block
     and offset/crop the child, so keep this compact parent unblurred and use a
     fade-only entrance. The flyout retains the overlay surface treatment. */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  animation: model-menu-in 120ms var(--ease-dialog);
}
@keyframes model-menu-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.menu--compact-models .menu-item--model { min-height: 36px; padding: 7px 10px; border-radius: 6px; }
.menu-model-group { padding: 0; }
.menu-model-group + .menu-model-group { border: 0; margin: 0; padding: 0; }
.menu-model-provider {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.menu-model-channel-trigger {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
  gap: 8px;
  text-align: left;
}
.menu-model-provider .provider-logo {
  --provider-logo-column: 16px;
  --provider-logo-size: 16px;
  --provider-logo-wordmark-width: 16px;
  --provider-logo-wordmark-height: 8px;
}
.menu-model-channel-trigger .menu-label { flex: 1 1 auto; min-width: 0; }
.menu-model-channel-trigger .menu-model-provider-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-model-channel-trigger .menu-model-provider-count { margin-left: auto; color: var(--text-faint); font-size: 11px; font-weight: 400; white-space: nowrap; }
.menu-model-channel-trigger > .icon { flex: 0 0 auto; margin-left: auto; }
.menu-model-channel-trigger[aria-expanded="true"] { background: var(--surface-hover); }
.menu--compact-models .menu-model-footer .menu-item .menu-label { flex: 1 1 auto; }
.menu-model-submenu {
  position: fixed;
  z-index: var(--z-popover);
  min-width: 140px;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  box-shadow: var(--shadow-menu);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform-origin: top left;
  animation: model-menu-in 160ms var(--ease-dialog);
}
.menu-model-submenu[hidden] { display: none !important; }
.menu-model-submenu .menu-item--model { min-height: 32px; padding: 5px 10px; border-radius: 6px; }
.menu-model-submenu[data-side="left"] { transform-origin: top right; }
.menu--compact-models .menu-label strong, .menu--effort .menu-label strong { font-size: 14px; font-weight: 500; line-height: 20px; }
.menu--compact-models .menu-label small, .menu--effort .menu-label small { font-size: 12px; line-height: 17px; color: var(--text-secondary); }
.menu--compact-models .menu-label small:empty { display: none; }
.menu--compact-models .menu-model-footer .menu-item { min-height: 32px; padding: 6px 10px; }
.menu--effort { width: 156px; border-radius: 10px; padding: 5px; }
.menu--effort .menu-item { padding: 7px 10px; border-radius: 6px; }
.menu-shortcut { font-size: 12px; }
.models-settings { max-width: 780px; margin-inline: auto; }
.settings-content:has(.models-settings) { padding: 24px 28px 32px; }
.models-page-head { margin-bottom: 16px; }
.models-overview-intro { margin-bottom: 16px; }
.models-channel { min-height: 64px; padding: 12px 6px; gap: 10px; }
.models-channel-name { margin-bottom: 3px; font-weight: 500; }
.models-channel-meta, .models-channel-status { font-size: 12px; }
.models-detail-nav { margin-bottom: 16px; }
.models-detail-head { margin-bottom: 20px; }
.models-detail-actions { gap: 8px; margin-bottom: 16px; }
.models-provider-card { min-height: 58px; padding: 10px 8px; }
.models-add-tabs { margin-bottom: 12px; }
.models-embedded .owner-model-form .setting-card { gap: 16px; padding: 16px 18px 14px; overflow: visible; }
.models-embedded .owner-model-field input { min-height: 36px; }
.models-embedded .owner-model-field select { min-height: 36px; width: 100%; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-1); color: var(--text-primary); font: inherit; }
.models-embedded .owner-model-field--preset small, .models-embedded .owner-model-preset-note { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.models-embedded .owner-model-preset-note { margin: -4px 0 0; }

/* One surface, with a separator rather than a floating card on another card. */
.app-shell .inspector-panel, .workbench-panel {
  position: absolute; inset: 0 0 0 auto; width: var(--detail-panel-width, 380px);
  max-width: calc(100vw - 48px); height: 100%; max-height: none;
  display: flex; flex-direction: column; min-height: 0;
  border: 0; border-left: 1px solid var(--border); border-radius: 0;
  background: var(--surface-1); box-shadow: none; transform: none;
  z-index: 35; animation: detail-enter 180ms cubic-bezier(.2,.8,.2,1);
}
.app-shell .inspector-panel > .pane-header, .workbench-panel > .pane-header {
  flex: 0 0 48px; height: 48px; padding: 8px 16px; border-bottom: 1px solid var(--border); gap: 8px;
}
.app-shell .inspector-panel > .pane-header .pane-header-title, .workbench-panel .pane-header-title { flex: 1; font-size: 13px; font-weight: 500; }
.app-shell .inspector-panel > .pane-header > .icon { display: none; }
.app-shell .inspector-panel .inspector-content { flex: 1; min-height: 0; overflow: auto; padding: 20px; }
.app-shell .inspector-panel h2 { font-size: 19px; line-height: 1.5; margin: 8px 0 12px; font-weight: 550; }
.app-shell .inspector-panel .inspector-summary { margin: 16px 0; font-size: 13px; line-height: 1.75; }
.app-shell .inspector-panel .inspiration-inspector-media { margin: 0 0 16px; height: 148px; max-height: 148px; border-radius: 7px; overflow: hidden; }
.app-shell .inspector-panel .inspiration-inspector-media .inspiration-media { height: 148px; max-height: 148px; aspect-ratio: auto; border-radius: 0; }
.app-shell .inspector-panel .inspiration-inspector-media img { object-fit: contain; width: 100%; height: 148px; }
.app-shell .inspector-panel .inspector-section, .app-shell .inspector-panel .context-group { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.app-shell .inspector-panel .inspector-section h3, .app-shell .inspector-panel .context-group h3 { margin: 0 0 10px; color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.app-shell .inspector-panel .inspector-section > [data-action="mark-inspiration"] { float: right; margin-top: -6px; font-size: 12px; }
.app-shell .inspector-panel .context-list { font-size: 12px; }
.app-shell .inspector-panel .context-list dd { overflow-wrap: anywhere; }
.app-shell .inspector-panel .inspector-actions { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.app-shell .inspector-panel .inspector-actions > .button { flex: 1; min-width: 120px; height: 34px; font-size: 12px; }
.detail-resize-handle { position: absolute; top: 0; bottom: 0; left: -4px; width: 8px; z-index: 4; cursor: col-resize; touch-action: none; }
.detail-resize-handle::after { content: ""; position: absolute; inset: 0 3px; border-radius: 2px; background: transparent; transition: background-color 120ms ease; }
.detail-resize-handle:hover::after, .detail-resize-handle:focus-visible::after { background: var(--text-secondary); }
.detail-resize-handle:focus { outline: none; box-shadow: none; }
.detail-resize-handle:focus-visible::after { background: var(--text-secondary); }
.workbench-panel-tabs { display: flex; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.workbench-panel-tabs button { position: relative; border: 0; background: transparent; padding: 12px 2px; color: var(--text-secondary); font: inherit; font-size: 12px; cursor: pointer; }
.workbench-panel-tabs [aria-selected="true"] { color: var(--text-primary); }
.workbench-panel-tabs [aria-selected="true"]::after { content:""; height: 2px; background: var(--text-primary); position: absolute; bottom: -1px; left: 2px; right: 2px; border-radius: 2px; }
.workbench-panel-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.panel-empty { color: var(--text-secondary); font-size: 12px; line-height: 1.7; margin: 12px 4px; }
.panel-empty[hidden], .panel-file-row[hidden] { display: none; }
.panel-file-row { width: 100%; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 6px; padding: 8px; min-height: 34px; background: transparent; color: var(--text-primary); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.panel-file-row > span:not(.icon) { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.panel-file-row > .icon { flex-shrink: 0; color: var(--text-secondary); }
.panel-file-row:hover { background: var(--surface-2); }
.panel-file-row:focus-visible, .workbench-panel-tabs button:focus-visible { outline: 2px solid var(--text-secondary); outline-offset: 1px; }
.panel-attachment-list { display: grid; gap: 2px; }
.panel-file-row:disabled { cursor: default; opacity: .62; }
.panel-attachment-image { display: grid; place-items: center; min-height: 120px; padding: 12px; background: var(--surface-2); border-radius: 8px; }
.panel-attachment-image img { display: block; max-width: 100%; max-height: 420px; object-fit: contain; border-radius: 4px; }
.panel-folder-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 8px; }
.panel-folder-header > span { display: flex; align-items: center; gap: 8px; font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
.panel-file-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; margin: 4px 0 10px; }
.panel-file-search input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text-primary); font: inherit; font-size: 12px; }
.panel-file-search:focus-within { outline: 1px solid var(--text-secondary); }
.panel-path { overflow-wrap: anywhere; margin: 4px; color: var(--text-secondary); font-size: 11px; }
.panel-change-folder { margin-top: 16px; font-size: 12px; }
.panel-preview-heading { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.panel-preview-heading > span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.panel-preview-markdown { font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.panel-preview-markdown pre { white-space: pre-wrap; }
.panel-section { margin-bottom: 24px; }
.panel-section h3 { margin: 0 4px 8px; color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.panel-section h4 { font-size: 14px; margin: 12px 4px; }
.panel-section dl { font-size: 12px; line-height: 1.75; }
.panel-section dt { color: var(--text-secondary); margin-top: 12px; }
.panel-section dd { margin: 4px 0 0; }
.panel-source-row { display: flex; gap: 8px; font-size: 13px; padding: 8px 4px; }
.app-shell:has(.inspector-layer) .main-shell { margin-right: 0; }
.app-shell .main-shell { transition: left 180ms cubic-bezier(.2,.8,.2,1), right 180ms cubic-bezier(.2,.8,.2,1); }
.app-shell[data-detail-resizing="true"] .main-shell { transition: none; }
.conversation-profile-guide > span { margin-left: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.models-page-head, .models-detail-nav, .models-add-head { padding-right: 34px; min-height: 32px; }
.models-add-head { justify-content: flex-start; gap: 10px; }
.models-channel-list { position: relative; }
.models-channel-list > [data-model-channel-row] { position: relative; display: flex; align-items: center; border-radius: 7px; transition: background-color 120ms, box-shadow 120ms; }
.models-order-handle { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 34px; padding: 0; box-sizing: border-box; border: 0; border-radius: 5px; background: transparent; color: var(--text-faint); cursor: grab; touch-action: none; }
.models-order-handle .icon { width: 12px; height: 16px; flex: none; }
.models-order-handle:hover, .models-order-handle:focus-visible { color: var(--text-primary); background: var(--surface-2); }
.models-channel { grid-template-columns: 26px minmax(0, 1fr) auto 16px; gap: 10px; flex: 1; min-width: 0; }
.models-order-feedback { display: flex; align-items: center; gap: 10px; min-height: 30px; margin: 8px 0; color: var(--text-secondary); font-size: 11px; }
.models-order-feedback > [role="status"] { margin-left: auto; }
.models-order-feedback .button { padding: 3px 6px; min-height: 24px; font-size: 11px; }
.models-model-id { display: block; margin-top: 7px; overflow-wrap: anywhere; color: var(--text-secondary); font-size: 12px; }
.models-model-availability { display: inline-block; margin-top: 7px; color: var(--text-secondary); font-size: 11px; }
.app-shell:has(> .desktop-toolbar) .profile-summary-panel { background: transparent; padding: 24px 20px; }
.app-shell:has(> .desktop-toolbar) .profile-editor-column { padding: 24px 28px; }
.app-shell:has(> .desktop-toolbar) .profile-form-card { max-width: 840px; margin-inline: auto; }
.profile-empty-state { max-width: 450px; margin: auto; padding: 36px; text-align: center; }
.profile-empty-state p { line-height: 1.7; color: var(--text-secondary); }
.app-shell[data-detail-resizing="true"] { user-select: none; cursor: col-resize; }
.workbench-panel-scrim { display: none; }
@media (min-width: 1100px) {
  .app-shell[data-detail-open="true"] .main-shell { right: var(--detail-panel-width); }
  .inspector-scrim { display: none; }
}
@media (max-width: 1099px) {
  .workbench-panel-scrim { display: block; position: absolute; inset: 0; z-index: 34; border: 0; background: rgb(0 0 0 / 12%); cursor: default; }
  .workbench-panel { box-shadow: -12px 0 28px rgb(0 0 0 / 6%); }
  .app-shell .main-shell { right: 0; }
}
@keyframes detail-enter { from { opacity: .5; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.app-shell .inspector-layer[data-closing="true"] .inspector-panel { animation: detail-exit 180ms ease both; }
@keyframes detail-exit { to { opacity: 0; transform: translateX(16px); } }

.agent-activity-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 180ms cubic-bezier(.2,.8,.2,1); }
.agent-activity[data-expanded="true"] .agent-activity-body { grid-template-rows: 1fr; }
.agent-activity-body-inner { min-height: 0; overflow: hidden; }
.agent-activity-caret, .agent-tool-query .icon { transition: transform 180ms ease; }
@media (prefers-reduced-motion: reduce) {
  .product-mode-thumb, .sidebar-groups, .app-shell .main-shell, .app-shell .inspector-panel, .workbench-panel, .agent-activity-body, .agent-activity-caret, .agent-tool-query .icon { transition: none; animation: none; }
}

/* A single window toolbar. Page controls are mounted here, above all panels. */
.app-shell:has(> .desktop-toolbar) { --desktop-toolbar-height: 40px; }
.desktop-toolbar { position: absolute; inset: 0 0 auto; height: 40px; z-index: calc(var(--z-sidebar) + 1); overflow: visible; background: transparent; pointer-events: none; border: 0; }
.desktop-toolbar-content { position: absolute; left: max(220px, var(--sidebar-layout-width)); right: 44px; top: 0; height: 40px; display: flex; min-width: 0; align-items: center; pointer-events: auto; background: var(--page); }
.desktop-toolbar-content > .main-header, .desktop-toolbar-content > .page-toolbar-shell, .desktop-toolbar-content > .pane-header { position: relative; inset: auto; flex: 1; width: 100%; min-width: 0; height: 40px !important; min-height: 40px !important; max-height: 40px; padding: 4px 14px !important; margin: 0; gap: 12px; border: 0; border-radius: 0; box-shadow: none; background: transparent; overflow: visible; }
.desktop-toolbar-content > .pane-header { display: flex; align-items: center; }
.desktop-toolbar-content:has(> .pane-header) > .pane-header:first-child { flex: 0 1 42%; }
.desktop-toolbar-content .main-header-title { position: static; transform: none; max-width: min(65%, calc(100% - 120px)); min-width: 0; flex: 0 1 auto; overflow: hidden; text-align: left; margin-right: auto; color: var(--text-primary); }
.desktop-toolbar-content .main-header-actions { flex: 0 0 auto; min-width: 0; }
.desktop-toolbar-content .main-header-actions:empty, .desktop-toolbar-content .space-badge { display: none; }
.desktop-toolbar-content .copylibrary-search { height: 28px; min-height: 28px; width: clamp(100px, 20vw, 240px); }
.desktop-toolbar-content .button--compact, .desktop-toolbar-content .profile-switcher-trigger { min-height: 28px; height: 28px; font-size: 12px; }
.desktop-toolbar-content .profile-action-group { gap: 6px; }
.desktop-toolbar > :is(button, .find-bar) { pointer-events: auto; }
.desktop-toolbar #desktop-right-toggle { position: absolute; right: 12px; top: var(--desktop-toggle-top, 9px); width: 22px; height: 22px; }
.app-shell:has(> .desktop-toolbar) .main-shell { top: 40px; }
.app-shell:has(> .desktop-toolbar) .sidebar-resize-rail { top: var(--desktop-toolbar-height, 40px); z-index: calc(var(--z-sidebar) + 1); }
.app-shell:has(> .desktop-toolbar) .sidebar { background-image: none; }
.app-shell:has(> .desktop-toolbar) #sidebar-search-trigger { position: fixed; left: calc(var(--desktop-toggle-left, 80px) + 32px); right: auto; top: var(--desktop-toggle-top, 9px); width: 22px; height: 22px; visibility: visible; opacity: 1; pointer-events: auto; transform: none; }
.app-shell:has(> .desktop-toolbar) .sidebar-header-actions { pointer-events: auto; }
.app-shell:has(> .desktop-toolbar) .inspector-panel, .app-shell:has(> .desktop-toolbar) .workbench-panel { top: 40px; height: calc(100% - 40px); background: var(--page); }
.app-shell:has(> .desktop-toolbar) .inspector-scrim, .app-shell:has(> .desktop-toolbar) .workbench-panel-scrim { top: 40px; }
.app-shell:has(> .desktop-toolbar) .workbench-panel > .pane-header { display: none; }
.app-shell:has(> .desktop-toolbar) .workbench-panel-tabs { flex: 0 0 38px; gap: 18px; }
.app-shell:has(> .desktop-toolbar) .workbench-panel-tabs button { padding-block: 8px; }
/* Keep thread ink out of the shared titlebar band and the composer dock across proportions. */
.app-shell:has(> .desktop-toolbar) {
  --thread-toolbar-scroll-clearance: 64px;
  --thread-toolbar-mask: 22px;
  --thread-composer-scroll-clearance: 220px;
}
.app-shell:has(> .desktop-toolbar) .thread-scroll-shell {
  isolation: isolate;
}
.app-shell:has(> .desktop-toolbar) .thread-scroll-shell::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: var(--thread-toolbar-mask);
  pointer-events: none;
  background: linear-gradient(to bottom, var(--page) 0 14px, transparent);
}
.app-shell:has(> .desktop-toolbar) .thread-viewport {
  padding-top: var(--thread-toolbar-scroll-clearance);
  padding-bottom: var(--thread-composer-scroll-clearance);
  scroll-padding-top: var(--thread-toolbar-mask);
  scroll-padding-bottom: calc(var(--thread-composer-scroll-clearance) - 56px);
}
.app-shell:has(> .desktop-toolbar) .cloud-history-control {
  margin-top: 0;
}
.app-shell:has(> .desktop-toolbar) :is(.content-screen, .copylibrary-screen, .profile-screen, .knowledge-screen, .inspiration-library, .resource-screen, .analysis-screen, .access-screen) { padding: 0; gap: 0; }
.app-shell:has(> .desktop-toolbar) :is(.copylibrary-workbench-frame, .copylibrary-workbench-grid, .library-workbench-shell, .content-pane-grid > .pane, .resource-plaza-workbench, .analysis-workbench) { gap: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--page); }
.app-shell:has(> .desktop-toolbar) :is(.copylibrary-document-list, .profile-summary-column, .knowledge-document-list) { border-right: 1px solid var(--border); }
.app-shell:has(> .desktop-toolbar) .content-pane-grid { --content-input-min: 300px; --content-resizer-width: 5px; --content-output-min: 0px; }
.app-shell:has(> .desktop-toolbar) .content-pane-resizer { width: 5px; min-width: 5px; }
.app-shell:has(> .desktop-toolbar) .content-input-pane > .pane-content { height: auto !important; }
.sidebar-pinned, .sidebar-projects { margin: 12px 0; padding-inline: 8px; }
.sidebar-section-heading { display: flex; min-height: 28px; align-items: center; gap: 10px; padding: 0 10px; color: var(--text-secondary); font-size: 12px; line-height: 20px; font-weight: 500; }
.sidebar-section-heading > span:not(.icon) { flex: 1; }
.sidebar-section-heading > .icon-button { width: 24px; height: 24px; }
.sidebar-section-heading > .icon { display: inline-flex; align-items: center; width: 18px; height: 18px; flex: 0 0 18px; }
.sidebar-section-heading > .icon svg { width: 18px; height: 18px; }
.conversation-more:active { transform: none; }
.conversation-title-button, .conversation-title-input { max-width: 100%; min-width: 0; height: 28px; padding: 3px 7px; border: 0; border-radius: 5px; background: transparent; color: inherit; font: inherit; line-height: 22px; text-align: left; }
.conversation-title-button { cursor: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-title-button:hover { background: var(--surface-hover); }
.conversation-title-input { width: auto; outline: none; background: transparent; }
.panel-section.conversation-profile-guide { color: var(--text-secondary); font-size: 12px; line-height: 1.7; }
.sidebar-section-empty { margin: 5px 12px 8px; color: var(--text-faint); font-size: 11px; line-height: 1.6; }
.sidebar-groups { animation: none; }
.sidebar-projects .sidebar-item[aria-current="true"] { background: var(--surface-2); }
.sidebar-project-group { min-width: 0; }
.sidebar-project-group__header { position: relative; display: flex; align-items: center; min-width: 0; }
.sidebar-project-group__header > .sidebar-item { flex: 1; width: 0; min-width: 0; }
.sidebar-project-group__children { min-width: 0; margin: 0 0 5px; padding: 0; list-style: none; }
.sidebar-project-group__children[hidden] { display: none; }
.sidebar-project-group__children .sidebar-item { font-size: 12px; }
.message-timestamp { margin-left: 8px; padding: 6px 4px; border-radius: 5px; font-size: 11px; line-height: 1; white-space: nowrap; color: var(--text-faint); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 160ms; }
.message:hover .message-timestamp, .message:focus-within .message-timestamp { opacity: 1; }
.message-timestamp:hover, .message-timestamp:focus-visible { background: var(--surface-hover); color: var(--text-secondary); }
@media (hover: none) { .message-timestamp { opacity: 1; } }
.message-actions:has(.message-timestamp) { flex-wrap: wrap; row-gap: 6px; }
.pasted-text-restore { padding: 3px 5px; border: 0; border-radius: 4px; color: var(--text-secondary); background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.pasted-text-restore:hover { background: var(--surface-hover); }
.workbench-panel-body:has(.panel-file-workspace) { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.workbench-panel-body:has(.panel-file-workspace) > .panel-folder-header { margin: 0; padding: 10px 14px; flex-shrink: 0; }
.panel-file-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 36%); min-height: 0; flex: 1; }
.panel-file-preview { min-width: 0; overflow: auto; }
.panel-file-tree { min-width: 0; overflow: auto; padding: 6px; border-left: 1px solid var(--border); }
.panel-file-tree .panel-file-search { margin: 0 0 8px; padding: 5px 7px; gap: 4px; }
.panel-file-tree .panel-file-search input { width: 0; min-width: 0; font-size: 11px; }
.panel-tree-row { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 28px; padding: 4px 5px 4px calc(5px + var(--tree-depth) * 12px); border: 0; border-radius: 5px; background: transparent; color: var(--text-primary); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.panel-tree-row > .icon { flex: 0 0 12px; }
.panel-tree-row > span:not(.icon) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.panel-tree-row:hover, .panel-tree-row[aria-current="true"] { background: var(--surface-hover); }
.panel-preview-empty { display: grid; justify-items: center; align-content: center; height: 100%; min-height: 180px; gap: 8px; color: var(--text-secondary); font-size: 12px; }
.panel-file-preview .panel-preview-heading { display: flex; align-items: center; padding: 7px 12px; gap: 6px; border-bottom: 1px solid var(--border); }
.panel-file-preview .panel-preview-heading > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.panel-file-preview .panel-preview-markdown { padding: 12px 16px; font-size: 13px; }
.panel-file-preview pre { overflow: auto; font-size: 12px; }
.conversation-project-bar { position: absolute; inset: 0 0 auto; height: 30px; padding: 0 20px; display: flex; align-items: center; gap: 7px; z-index: 4; background: var(--page); border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text-secondary); }
.conversation-project-bar button { border: 0; padding: 0; background: transparent; font: inherit; color: var(--text-primary); max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.conversation-project-bar > span:not(.icon) { margin-left: auto; font-size: 10px; }
.main-viewport:has(> .conversation-project-bar) .thread-viewport { padding-top: 56px; }
.app-shell[data-panel-continuation="true"] :is(.workbench-panel,.inspector-panel) { animation: none; }
.app-shell[data-detail-resizing="true"] .main-shell { transition: none; }
@media (max-width: 1099px) {
  .desktop-toolbar-content { left: 160px; }
  .desktop-toolbar-content .copylibrary-toolbar-actions { flex: 0 1 auto; }
  .desktop-toolbar-content .copylibrary-search { width: 120px; }
  .desktop-toolbar-content .profile-action-group .button { padding-inline: 7px; }
  .app-shell:has(> .desktop-toolbar) .content-pane-grid { --content-input-min: 270px; }
}

.app-shell:has(> .desktop-toolbar) .content-input-pane { border-right: 1px solid var(--border); }
@container content-workbench (max-width: 839px) {
  .app-shell:has(> .desktop-toolbar) .content-input-pane { border-right: 0; }
}
.desktop-toolbar-content[data-workbench-split="false"] > .pane-header[hidden] { display: none; }
.desktop-toolbar-content[data-workbench-split="false"] > .pane-header:not([hidden]) { flex: 1 1 auto; }
.conversation-profile-guide > span:not(.icon) { margin-left: 0; }

/* Keep imported media in uniform cover cards without scaling reading text down. */
.app-shell[data-packaged-desktop="true"] .inspiration-library[data-card-size] { --inspiration-card-copy-height: 200px; --inspiration-card-footer-height: 34px; }
.app-shell[data-packaged-desktop="true"] .inspiration-grid:not([data-view="list"]) .inspiration-card-copy { grid-template-rows: 14px 40px 36px 22px 18px 24px; row-gap: 4px; padding: 10px 12px; }
.app-shell[data-packaged-desktop="true"] .inspiration-card.card-variant-p01 .inspiration-card-title { font-size: 14px; line-height: 20px; }
.app-shell[data-packaged-desktop="true"] .inspiration-card.card-variant-p01 .inspiration-card-summary { font-size: 12px; line-height: 18px; }
.app-shell[data-packaged-desktop="true"] .inspiration-card.card-variant-p01 :is(.inspiration-card-topline,.inspiration-author-name,.inspiration-stat,.inspiration-stat b,.inspiration-card-footer,.tag) { font-size: 11px; line-height: 16px; }

.sidebar-project-row { position: relative; }
.sidebar-project-row .sidebar-item { padding-right: 34px; }
.sidebar-project-remove { position: absolute; right: 5px; top: calc(50% - 12px); z-index: 1; width: 24px; height: 24px; opacity: 0; transition: opacity 120ms; }
.sidebar-project-row:hover .sidebar-project-remove, .sidebar-project-row:focus-within .sidebar-project-remove { opacity: 1; }
.desktop-toolbar { --copylibrary-hover-surface: color-mix(in srgb, var(--text-primary) 3.5%, transparent); --copylibrary-smart-view-active-surface: color-mix(in srgb, var(--text-primary) 14%, var(--page)); }
@media (hover: none) { .sidebar-project-remove { opacity: 1; } }

/* Connection rail and model details share one stable settings surface. */
.settings-content:has(.models-settings) { padding: 0; overflow: hidden; }
.models-settings { width: 100%; max-width: none; height: 100%; margin: 0; }
.models-layout { display: grid; grid-template-columns: 198px minmax(0, 1fr); height: 100%; }
.models-rail { overflow-y: auto; padding: 24px 10px 20px; background: color-mix(in srgb, var(--text-primary) 2%, var(--page)); }
.models-main { min-width: 0; overflow-y: auto; padding: 26px 24px 28px; }
.models-main > .models-back { display: none; }
.models-page-head { min-height: 28px; margin: 0 4px 24px 10px; padding: 0; gap: 8px; }
.models-page-head .settings-section-title { font-size: 15px; font-weight: 550; }
.models-page-head .icon-button { width: 26px; height: 26px; }
.models-rail-label { margin: 0 12px 8px; font-size: 11px; color: var(--text-secondary); }
.models-channel-list > [data-model-channel-row] { margin: 3px 0; border: 0; border-radius: 7px; }
.models-channel-list > [data-model-channel-row]:has(.is-selected) { background: var(--surface-selected); }
.models-channel { min-height: 40px; grid-template-columns: 22px minmax(0, 1fr) 5px; padding: 5px 8px 5px 2px; gap: 8px; border-radius: 7px; }
.models-channel:hover { background: transparent; }
.models-channel-list > [data-model-channel-row]:hover { background: var(--surface-hover); }
.models-channel-name { margin-bottom: 2px; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.models-channel-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.models-channel-status { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); }
.models-channel-status[data-ready="true"] { background: var(--text-secondary); }
.models-order-handle { flex-basis: 28px; width: 28px; min-width: 28px; height: auto; align-self: stretch; min-height: 32px; cursor: grab; touch-action: none; opacity: .55; }
.models-order-handle:active { cursor: grabbing; }
.models-channel-list > li:hover .models-order-handle, .models-order-handle:focus-visible { opacity: 1; }
.models-order-feedback { padding: 0 5px; display: flex; flex-wrap: wrap; gap: 4px; font-size: 10px; }
.models-order-feedback > [role="status"] { margin-left: 0; }
.models-restore { margin-top: 8px; font-size: 11px; }
.models-detail-head { margin: 2px 0 14px; }
.models-detail-head h3 { font-size: 18px; font-weight: 550; }
.models-detail-head p { font-size: 12px; line-height: 1.5; margin-top: 5px; }
.models-detail-head-actions { gap: 10px; max-width: min(100%, 420px); }
.models-detail-actions { gap: 8px; align-items: center; }
.models-detail-actions .button { min-height: 29px; padding-inline: 9px; font-size: 11px; }
.models-autoswitch { flex: 0 1 auto; flex-basis: auto; font-size: 12px; line-height: 1.4; margin: 0; white-space: nowrap; }
.models-detail-head-actions > [data-action="models-disable-channel"],
.models-detail-actions > [data-action="models-disable-channel"] { margin-left: 0; order: unset; }
.models-test-result { padding: 10px 12px; margin: 0 0 16px; background: var(--surface-hover); border: 0; border-radius: 8px; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.models-priority { padding: 4px; background: color-mix(in srgb, var(--text-primary) 3%, var(--page)); border-radius: 10px; }
.models-priority-row { display: block; padding: 0; border: 0; }
.models-model-details { border-radius: 7px; }
.models-model-details[open] { background: var(--surface-1); }
.models-model-details > summary { display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer; list-style: none; border-radius: 7px; }
.models-model-details > summary::-webkit-details-marker { display: none; }
.models-model-details > summary:hover { background: var(--surface-hover); }
.models-model-details > summary > .icon { flex: 0 0 12px; width: 12px; height: 12px; color: var(--text-secondary); transition: transform 140ms; }
.models-model-details[open] > summary > .icon { transform: rotate(180deg); }
.models-model-copy { min-width: 0; flex: 1; }
.models-priority-row strong { display: block; font-size: 12px; font-weight: 500; line-height: 1.45; }
.models-model-id { margin-top: 4px; font-size: 10px; line-height: 1.45; }
.models-model-badges { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 120px; }
.models-capability { padding: 2px 4px; border-radius: 4px; color: var(--text-secondary); font-size: 9px; line-height: 14px; background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.models-pill { margin-left: 0; padding: 2px 5px; font-size: 9px; line-height: 14px; }
.models-model-options { padding: 0 12px 14px; }
.models-model-evidence { margin: 6px 0; font-size: 11px; line-height: 1.7; color: var(--text-secondary); }
.models-priority-actions { gap: 4px 8px; margin-top: 12px; font-size: 11px; }
.models-priority-actions > label { display: flex; align-items: center; gap: 4px; }
.models-priority-actions .button { font-size: 11px; min-height: 28px; padding: 3px 7px; }
.models-detail .models-embedded { margin-top: 24px; }
.models-embedded .setting-card { border: 0; box-shadow: none; background: transparent; }
.models-embedded .owner-model-form .setting-card { padding: 16px 18px 14px; overflow: visible; }
.models-embedded [data-owner-model-card] .setting-row { padding: 10px 0; }
.models-embedded .owner-model-actions { position: sticky; bottom: 0; border: 0; background: var(--surface-1); padding: 14px 0 0; }
.models-embedded .owner-model-field input { min-width: 0; max-width: 100%; min-height: 36px; font-size: 12px; background: transparent; }
.models-embedded .owner-model-field small { font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.models-add-head { padding-right: 28px; }
.models-add-head h3 { font-size: 16px; }
.models-add-tabs { flex-wrap: nowrap; gap: 3px; overflow-x: auto; margin-bottom: 14px; }
.models-add-tabs .button { font-size: 11px; padding-inline: 8px; white-space: nowrap; }
.models-add-search { min-height: 34px; padding: 8px 10px; font-size: 12px; background: transparent; }
.models-add-grid { gap: 4px; }
.models-provider-card { min-height: 62px; border: 0; background: color-mix(in srgb, var(--text-primary) 2%, var(--page)); }
.models-provider-copy strong { font-size: 12px; }
.models-provider-status, .models-card-meta { font-size: 10px; }
.models-empty-sources { display: grid; gap: 6px; }
.models-empty-sources .button { font-size: 11px; }
@media (max-width: 900px) {
  .models-layout { grid-template-columns: minmax(0, 1fr); }
  .models-settings[data-models-page="overview"] .models-main { display: none; }
  .models-settings:not([data-models-page="overview"]) .models-rail { display: none; }
  .models-main > .models-back { display: inline-flex; margin-bottom: 20px; }
  .models-channel { grid-template-columns: 24px minmax(0, 1fr) 5px; }
  .models-channel-status { grid-column: auto; grid-row: auto; }
  .models-model-badges { max-width: 98px; }
}
@media (prefers-reduced-motion: reduce) { .models-model-details > summary > .icon { transition: none; } }
@media (max-width: 900px) { .models-page-head { padding-right: 36px; } }
.models-priority { position: relative; }
.models-priority-row { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px; align-items: start; border-radius: 7px; }
.models-model-order-handle { position: static; width: 24px; min-width: 24px; height: 28px; min-height: 28px; margin-top: 18px; align-self: start; justify-self: center; }
.models-priority-row > .models-model-details { min-width: 0; }
.models-priority-row:hover > .models-model-order-handle, .models-model-order-handle:focus-visible { opacity: 1; }
.models-model-details > summary { box-sizing: border-box; height: 64px; min-height: 64px; padding: 9px 8px; }
.models-model-copy > strong, .models-model-copy > .models-model-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Settings reorder previews never change row height or move focused DOM nodes. */
[data-settings-reordering] { user-select: none; cursor: grabbing; }
.models-channel-list[data-settings-reordering] > [data-model-channel-row].is-settings-dragged,
[data-settings-reordering] > .is-settings-dragged {
  position: relative;
  z-index: 3;
  background: var(--surface-1);
  border-radius: 7px;
  box-shadow: 0 5px 14px #00000018;
}
.models-channel-list[data-settings-reordering] > li:not(.is-settings-dragged):hover { background: transparent; }
[data-settings-reordering] .models-order-handle,
[data-settings-reordering] .sidebar-pin-drag-handle { cursor: grabbing; }
[data-settings-reordering] > .sidebar-pin-row,
[data-settings-reordering] > [data-model-channel-row],
[data-settings-reordering] > [data-model-catalog-row] { will-change: transform; }
[data-settings-reordering] > :not(.is-settings-dragged) .models-order-handle { opacity: .55; }
[data-settings-reordering] > .is-settings-dragged .models-order-handle,
[data-settings-reordering] > .is-settings-dragged .sidebar-pin-drag-handle {
  opacity: 1;
  color: var(--text-primary);
  background: var(--surface-2);
}
.models-model-options { padding-left: 8px; }
.owner-key-control { position: relative; display: flex; align-items: center; min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); }
.owner-key-control input { flex: 1; width: 0; min-width: 0; border: 0; background: transparent; padding: 9px 42px 9px 12px; color: var(--text-primary); }
.owner-key-control button { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.owner-key-control button:hover { background: var(--surface-hover); }
.owner-key-control button:focus-visible { outline: 2px solid var(--text-secondary); outline-offset: 2px; }
.owner-key-control--saved { max-width: 440px; margin-top: 12px; }
.owner-key-control:focus-within { border-color: var(--text-secondary); }
.owner-key-control input:focus, .owner-key-control input:focus-visible { outline: none; box-shadow: none; border: 0; }
.owner-key-control > button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin: 0; width: 28px; height: 28px; padding: 0; box-shadow: none; }
.models-effort-settings { min-width: 0; margin: 16px 0; padding: 0; border: 0; }
.models-effort-settings legend { margin-bottom: 8px; padding: 0; font-size: 12px; color: var(--text-secondary); }
.models-effort-options { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 8px; background: var(--surface-2); }
.models-effort-options > button { min-height: 28px; padding: 4px 12px; border-radius: 5px; font-size: 12px; }
.models-effort-options > button[aria-pressed="true"] { background: var(--surface-1); box-shadow: 0 1px 3px #00000012; color: var(--text-primary); }
.models-model-options .models-priority-actions { gap: 8px; align-items: center; }
.models-model-options .models-priority-actions > label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  white-space: nowrap;
}
.models-model-options .models-priority-actions .switch {
  flex: 0 0 36px;
  width: 36px;
  height: 20px;
  min-height: 20px;
  padding: 2px;
}
.models-model-options .models-priority-actions button:not(.switch) { min-height: 28px; padding: 4px 8px; font-size: 12px; }
.sidebar-project-more { position: relative; flex: 0 0 24px; }
.sidebar-project-more > summary { width: 24px; height: 28px; padding: 0; border: 0; list-style: none; background: transparent; cursor: pointer; opacity: 0; }
.sidebar-project-more > summary::-webkit-details-marker { display: none; }
.sidebar-project-row:hover .sidebar-project-more > summary, .sidebar-project-row:focus-within .sidebar-project-more > summary, .sidebar-project-more[open] > summary { opacity: 1; }
.sidebar-project-options { position: absolute; top: 100%; right: 0; z-index: var(--z-popover); }
.sidebar-action-menu { width: 192px; padding: 5px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); box-shadow: var(--shadow-menu); backdrop-filter: none; -webkit-backdrop-filter: none; }
.sidebar-action-menu .menu-item { min-height: 32px; padding: 6px 9px; gap: 10px; border: 0; border-radius: 5px; white-space: nowrap; font-size: 13px; line-height: 20px; }
.sidebar-action-divider { height: 1px; margin: 5px 7px; background: var(--border); }
.sidebar-project-group__open { padding-right: 4px !important; }
.sidebar-project-group__open:is(:hover,:active,[aria-expanded]) { background: transparent; }
.sidebar-project-group__open > .icon, .sidebar-project-group__open > .icon svg { width: 15px; height: 15px; min-width: 15px; min-height: 15px; }
.sidebar-project-new { flex: 0 0 24px; width: 24px; height: 28px; padding: 0; opacity: 0; }
.sidebar-project-row:hover .sidebar-project-new, .sidebar-project-row:focus-within .sidebar-project-new { opacity: 1; }
.sidebar-project-more > summary, .sidebar-project-new { color: var(--text-faint); transition: color 120ms ease, opacity 120ms ease; }
.sidebar-project-more > summary:is(:hover,:active), .sidebar-project-new:is(:hover,:active) { background: transparent; color: var(--text-primary); }
.sidebar-projects .sidebar-section-heading { padding: 0; gap: 0; }
.sidebar-projects .sidebar-section-toggle { display: inline-flex; flex: 1; min-width: 0; align-items: center; gap: 5px; padding: 0 10px; }
.sidebar-projects .sidebar-section-toggle:is(:hover,:active) { background: transparent; color: var(--text-faint); }
.sidebar-projects .sidebar-section-toggle > .icon,
.sidebar-pinned .sidebar-section-toggle > .icon,
.sidebar-history .sidebar-section-toggle > .icon {
  transform-origin: 50% 50%;
}
.sidebar-projects .sidebar-section-toggle[aria-expanded="false"] > .icon { transform: rotate(-90deg); }
.sidebar-pinned .sidebar-section-toggle:is(:hover,:active), .sidebar-history .sidebar-section-toggle:is(:hover,:active) { background: transparent; color: var(--text-faint); }
.sidebar-projects .sidebar-section-heading > [data-action="project-add"] { flex: 0 0 24px; margin-right: 10px; }
.sidebar-projects [data-action="project-add"] .icon, .sidebar-projects [data-action="project-add"] .icon svg { width: 15px; height: 15px; min-width: 15px; min-height: 15px; }
.sidebar-project-list[hidden] { display: none; }
@media (hover: none) { .sidebar-project-new { opacity: 1; } }
@media (hover: none) { .sidebar-project-more > summary { opacity: 1; } }
.sidebar-history .sidebar-item--history:hover, .sidebar-item--history:hover { background: transparent; color: var(--text-muted); }
.sidebar-item--history:hover .icon { color: color-mix(in srgb, currentColor 76%, var(--text-faint)); }
.sidebar-history .sidebar-item--history[aria-current="page"], .sidebar-item--history[aria-current="page"] { background: var(--surface-hover); color: var(--text-primary); font-weight: 430; }
.sidebar-item--history[aria-current="page"] .icon { color: var(--text-primary); }
.tool-permission-options > button { grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; align-items: center; }
.tool-permission-options > button > .icon { grid-row: 1 / 3; }
.tool-permission-options > button > small { grid-column: 2; }
.tool-permission-menu[data-selected-mode="workspace"] > summary, .tool-permission-options [data-permission-mode="workspace"] > .icon { color: #427d75; }
.tool-permission-options [data-permission-mode="full"] > .icon { color: #bc561b; }
.tool-permission-options [data-permission-mode="ask"] > .icon { color: var(--text-primary); }
.menu--effort { background: var(--surface-1); backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-key-status]:empty { display: none; }
.tool-permission-menu { position: relative; font-size: 11px; color: var(--text-secondary); }
.tool-permission-menu > summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; box-sizing: border-box; border-radius: 6px; line-height: 1; }
.tool-permission-menu > summary .icon { display: block; width: 16px; min-width: 16px; height: 16px; min-height: 16px; }
.tool-permission-menu[data-selected-mode="full"] > summary { color: #bc561b; }
html[data-theme="dark"] .tool-permission-menu[data-selected-mode="full"] > summary { color: #eda16b; }
.tool-permission-menu > summary::-webkit-details-marker { display: none; }
.tool-permission-menu > summary:hover { background: var(--surface-hover); }
.tool-permission-options { position: absolute; bottom: calc(100% + 10px); left: 0; width: min(320px, calc(100vw - 70px)); padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); box-shadow: 0 8px 24px #00000018; z-index: 30; }
.tool-permission-options > p { margin: 6px 8px 10px; font-size: 11px; line-height: 1.5; }
.tool-permission-options > button { width: 100%; display: grid; gap: 4px; padding: 10px; border: 0; background: transparent; border-radius: 8px; text-align: left; color: var(--text-primary); cursor: pointer; }
.tool-permission-options > button:hover, .tool-permission-options > button[aria-checked="true"] { background: var(--surface-hover); }
.tool-permission-options small { font-size: 11px; line-height: 1.6; color: var(--text-secondary); }
.tool-permission-options [data-permission-mode="full"] strong { color: var(--text-primary); }
.tool-permission-options [data-permission-status]:empty { display: none; }
.skills-dialog { width: min(520px, calc(100vw - 48px)); max-height: min(620px, calc(100vh - 64px)); padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-1); color: var(--text-primary); box-shadow: 0 20px 60px #00000020; }
.skills-dialog::backdrop { background: #00000020; }
.skills-dialog header, .skills-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.skills-dialog h2 { margin: 0 0 16px; font-size: 18px; }
.skills-dialog input { width: 100%; margin: 8px 0 16px; }
.skills-list { max-height: 300px; overflow: auto; }
.skill-choice { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 8px; text-align: left; background: transparent; border: 0; border-radius: 8px; color: var(--text-primary); cursor: pointer; }
.skill-choice:hover, .skill-choice[aria-selected="true"] { background: var(--surface-hover); }
.skill-choice > span { flex: 1; display: grid; gap: 5px; }
.skill-choice small { font-size: 12px; line-height: 1.6; color: var(--text-secondary); }
.skills-dialog footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.skills-dialog footer > span { font-size: 11px; line-height: 1.6; color: var(--text-secondary); }
.skills-dialog footer > button { flex: 0 0 auto; }
.skills-popover { position: fixed; z-index: var(--z-modal); width: 280px; max-width: calc(100vw - 16px); padding: 6px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); box-shadow: var(--shadow-menu); overflow: auto; color: var(--text-primary); }
.skills-popover[data-source="slash"] { width: min(280px, calc(100vw - 16px)); }
.skills-popover[data-source="slash"] .skills-list { margin: 0; }
.skills-popover[data-source="slash"] .skill-choice { width: 100%; }
.skills-popover header { display: none; }
.skills-popover input { width: 100%; box-sizing: border-box; height: 30px; margin: 0 0 4px; padding: 5px 8px; border: 0; border-radius: 5px; background: var(--surface-2); font: inherit; font-size: 12px; }
.skills-popover .skill-choice { align-items: center; padding: 7px 8px; min-height: 32px; gap: 8px; font-size: 13px; }
.skills-popover .skill-choice > .icon { flex: 0 0 16px; }
.skills-popover .skill-choice > span:not(.icon) { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skills-popover footer { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.skills-popover footer > span { display: none; }
.skills-popover footer button { width: 100%; text-align: left; justify-content: flex-start; border: 0; min-height: 32px; font-size: 13px; }
.skills-popover [data-skill-status]:empty { display: none; }
.skills-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.skills-settings-heading h2 { margin: 0; }
.skills-settings-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; min-height: 36px; border-bottom: 1px solid var(--border); }
.skills-settings-actions { display: flex; align-items: center; gap: 8px; }
#profile-menu { animation: none; }
.desktop-update-panel-status:empty { display: none; }
.desktop-update-panel-heading h2 .desktop-update-version { font-weight: 400; font-size: 11px; }
.owner-model-session-option { flex-direction: row-reverse; justify-content: space-between; }
.skills-settings-row strong { font-size: 14px; font-weight: 500; }
.skills-settings-row p { font-size: 12px; color: var(--text-secondary); margin: 5px 0 0; line-height: 1.5; }
.sidebar-account-row { display: flex; align-items: center; min-width: 0; }
.sidebar-account-row > .profile-button { flex: 0 1 auto; width: auto; min-width: 0; margin-right: auto; }
.sidebar-account-row .profile-button { height: 34px; gap: 7px; padding: 5px 8px; }
.sidebar-account-row .profile-avatar { width: 22px; height: 22px; font-size: 10px; }
.sidebar-account-row .profile-label { flex: 0 1 auto; width: auto; }
.sidebar-account-row .profile-name { font-size: 12px; }
.sidebar-account-row .profile-caret { margin-left: -3px; }
.sidebar-account-row .profile-caret > .icon { width: 10px; height: 10px; min-width: 10px; min-height: 10px; flex-basis: 10px; }
.main-header-title:has(.conversation-title-disclosure) { display: flex; flex-wrap: nowrap; align-items: center; gap: 0; min-width: 0; margin-left: -7px; padding-left: 7px; }
.conversation-title-disclosure { flex: 0 0 24px; width: 24px; height: 28px; padding: 0; margin-left: 2px; border: 0; background: transparent; color: var(--text-secondary); }
.conversation-title-disclosure > .icon { width: 11px; height: 11px; min-width: 11px; min-height: 11px; }

/* Quiet, fixed-width toolbar controls: hover never shifts the neighbouring item. */
.conversation-more { width: 24px; height: 24px; top: calc(50% - 12px); right: 6px; padding: 0; color: var(--text-secondary); }
.conversation-more > .icon { width: 13px; height: 13px; }
/* Retain the established split control: label hover, revealed arrow hover,
   and a dropdown that escapes the 40px titlebar. */
.desktop-toolbar .copylibrary-smart-view-switcher { background: transparent !important; border-radius: 6px; }
.desktop-toolbar .copylibrary-smart-view-switcher:is(:hover, :focus-within, .is-expanded) { background: var(--surface-hover) !important; }
.desktop-toolbar .copylibrary-smart-view-switcher > .copylibrary-smart-view { min-height: 28px; height: 28px; padding: 0 6px; gap: 6px; border-radius: 6px; font-size: 12px; font-weight: 500; background: transparent; }
.desktop-toolbar .copylibrary-smart-view-switcher > .copylibrary-smart-view:is(:hover, :focus-visible) { background: var(--copylibrary-smart-view-active-surface); }
.desktop-toolbar .copylibrary-smart-view-switcher > .copylibrary-smart-view > .icon { width: 14px; height: 14px; min-width: 14px; min-height: 14px; flex-basis: 14px; font-size: 14px; }
.desktop-toolbar .copylibrary-smart-view-disclosure-slot { width: 0; height: 28px; transition: width 150ms ease-out; }
.desktop-toolbar .copylibrary-smart-view-switcher:is(:hover, :focus-within, .is-expanded) > .copylibrary-smart-view-disclosure-slot { width: 28px; }
.desktop-toolbar .copylibrary-smart-view-disclosure { width: 28px; height: 28px; opacity: 0; pointer-events: none; background: transparent; border-radius: 6px; }
.desktop-toolbar .copylibrary-smart-view-switcher:is(:hover, :focus-within, .is-expanded) .copylibrary-smart-view-disclosure { opacity: 1; pointer-events: auto; }
.desktop-toolbar .copylibrary-smart-view-disclosure .icon { width: 11px; height: 11px; }
.desktop-toolbar .copylibrary-smart-view-disclosure:is(:hover, :focus-visible),
.desktop-toolbar .copylibrary-smart-view-switcher.is-expanded .copylibrary-smart-view-disclosure { color: var(--text-primary); background: var(--copylibrary-smart-view-active-surface); }
.desktop-toolbar .copylibrary-smart-view-panel { top: calc(100% + 6px); left: 0; transform: translateY(-4px); border-radius: 9px; }
.desktop-toolbar .copylibrary-smart-view-switcher.is-expanded .copylibrary-smart-view-panel { transform: translateY(0); }
.desktop-toolbar .copylibrary-smart-view-panel > .copylibrary-smart-view { min-height: 30px; font-weight: 400; border-radius: 5px; }
.desktop-inline-search { position: relative; flex: 0 0 28px; width: 28px; height: 28px; z-index: 3; }
.desktop-search-field { position: absolute; inset: 0 0 0 auto; display: flex; align-items: center; width: 28px; overflow: hidden; border: 1px solid transparent; border-radius: 7px; box-sizing: border-box; background: transparent; transition: width 220ms cubic-bezier(.2,.8,.2,1), background-color 180ms, border-color 180ms; }
.desktop-search-field input { position: absolute; left: 10px; right: 32px; width: calc(100% - 42px); min-width: 0; height: 24px; margin: 0; padding: 0; border: 0; outline: 0; font: inherit; font-size: 12px; color: var(--text-primary); background: transparent; opacity: 0; visibility: hidden; transition: opacity 140ms; }
.desktop-inline-search.is-expanded .desktop-search-field { width: clamp(180px, 25vw, 300px); background: var(--page); border-color: var(--border-strong); box-shadow: 0 1px 3px #00000006; }
.desktop-inline-search.is-expanded input { opacity: 1; visibility: visible; }
.desktop-search-toggle { position: absolute; right: 0; top: 0; width: 28px; height: 28px; padding: 0; }
.desktop-search-toggle .icon { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .desktop-search-field, .desktop-search-field input { transition: none; } }
html[data-reduce-motion="true"] .desktop-search-field, html[data-reduce-motion="true"] .desktop-search-field input { transition: none; }

/* Shared titlebar rhythm; reserve a trailing slot only when its control exists. */
.desktop-toolbar-content { right: 40px; }
.desktop-toolbar:not(:has(#desktop-right-toggle)) .desktop-toolbar-content { right: 0; }
.desktop-toolbar-content > :is(.main-header, .page-toolbar-shell, .pane-header) { padding-inline: 14px 8px !important; gap: 8px; }
.desktop-toolbar :is(.copylibrary-toolbar-actions, .main-header-actions, .knowledge-toolbar-actions) { gap: 6px; }
.desktop-toolbar #desktop-right-toggle { right: 10px; }
.desktop-toolbar :is(button, input):focus:not(:focus-visible) { outline: none; }
.desktop-toolbar :is(button, input):focus-visible { outline: 1px solid var(--text-secondary); outline-offset: 2px; }
.desktop-toolbar .conversation-title-input { box-sizing: border-box; min-width: 32px; max-width: 100%; height: 28px; margin-left: 0; line-height: 20px; border: 1px solid var(--border-strong); background: var(--surface-1); outline: none; box-shadow: none; }
.desktop-toolbar .conversation-title-input:focus-visible { outline: none; }
.desktop-toolbar .conversation-title-disclosure:focus { outline: none; box-shadow: none; }
.desktop-toolbar .conversation-title-disclosure:focus-visible { background: var(--surface-hover); }
.desktop-toolbar .main-header-title:has(.conversation-title-input) .conversation-title-disclosure { display: none; }
/* Reserve left inset on the title shell so hover/input chrome stays inside overflow clipping. */
.desktop-toolbar .main-header-title:has(.conversation-title-input),
.desktop-toolbar .main-header-title.is-editing { flex: 0 1 auto; min-width: 0; margin-left: -8px; padding-left: 8px; }
.desktop-search-field { pointer-events: none; }
.desktop-inline-search.is-expanded .desktop-search-field { pointer-events: auto; }
.desktop-inline-search.has-query:not(.is-expanded) .desktop-search-toggle::after { content: ''; position: absolute; right: 3px; top: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--text-secondary); }
.app-shell:has(> .desktop-toolbar) .knowledge-document-row { border-radius: 6px; }
.app-shell:has(> .desktop-toolbar) .knowledge-document-row.is-selected { background: color-mix(in srgb, var(--text-primary) 7%, var(--page)); }
.app-shell:has(> .desktop-toolbar) .knowledge-document-row.is-selected .knowledge-file-icon { color: var(--text-primary); }
.app-shell:has(> .desktop-toolbar) .knowledge-detail-header { padding-inline: 20px 14px; }

.desktop-toolbar-content:has(> .pane-header) > .pane-header:first-child { flex: 0 0 var(--toolbar-input-width, 42%); box-sizing: border-box; }
.desktop-toolbar-content:has(> .pane-header) > .pane-header:last-child { width: auto; }
.knowledge-row-type { font-size: 9px; font-weight: 500; color: var(--text-secondary); padding: 1px 4px; border-radius: 3px; background: var(--surface-hover); }

/* Keep the desktop focus cue neutral, including legacy settings fields. */
html[data-kalamos-desktop-app="true"] { --focus: 0 0 0 2px var(--page), 0 0 0 3px var(--text-secondary); }
html[data-kalamos-desktop-app="true"] :is(textarea, .settings-input):focus { outline: none; border-color: var(--text-secondary); box-shadow: none; }
html[data-kalamos-desktop-app="true"] .desktop-toolbar :is(button, input):focus { box-shadow: none; }

/* Composite searches own one border; their children never draw clipped rings. */
html[data-kalamos-desktop-app="true"] :is(.desktop-search-field, .panel-file-search, .knowledge-context-search, .knowledge-search, .copylibrary-search, .search-control, .search-input-row, .find-bar) :is(input, textarea, button),
html[data-kalamos-desktop-app="true"] .desktop-inline-search.is-expanded .desktop-search-toggle {
  outline: none !important;
  box-shadow: none !important;
}
html[data-kalamos-desktop-app="true"] input[type="search"] { -webkit-appearance: none; appearance: none; }
html[data-kalamos-desktop-app="true"] :is(.panel-file-search, .knowledge-context-search, .knowledge-search, .copylibrary-search, .search-control):focus-within { outline: none; box-shadow: none; border-color: var(--border-strong); }
html[data-kalamos-desktop-app="true"] :is(.models-add-search, .menu-model-search-input):focus { outline: none; box-shadow: none; }
html[data-kalamos-desktop-app="true"] :is(.models-add-search, .menu-model-search-input) { border: 1px solid var(--border); }
html[data-kalamos-desktop-app="true"] :is(.models-add-search, .menu-model-search-input):focus { border-color: var(--border-strong); }
html[data-kalamos-desktop-app="true"] input[type="search"]:focus { outline: none; box-shadow: none; }

/* Owner review: one quiet separator and consistent control alignment. */
.desktop-toolbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--border); pointer-events: none;
}
/* Both responsive trigger nodes share the same painted size and colour. */
.app-shell:has(> .desktop-toolbar) :is(#sidebar-toggle, #compact-sidebar-trigger) {
  width: 22px; min-width: 22px; height: 22px; min-height: 22px; padding: 0;
  color: var(--text-faint); background: transparent;
}
.app-shell:has(> .desktop-toolbar) :is(#sidebar-toggle, #compact-sidebar-trigger) :is(.icon, svg) {
  width: 15px; min-width: 15px; height: 15px; min-height: 15px; font-size: 15px;
}
.app-shell:has(> .desktop-toolbar) :is(#sidebar-toggle, #compact-sidebar-trigger):is(:hover, :focus-visible) { color: var(--text-primary); background: var(--surface-hover); }
.app-shell:has(> .desktop-toolbar) #sidebar-toggle { position: fixed; left: var(--desktop-toggle-left, 80px); top: var(--desktop-toggle-top, 9px); right: auto; }
/* Compact overlay swaps trigger nodes, but only one painted control may occupy the titlebar slot. */
.app-shell:has(> .desktop-toolbar) #sidebar-toggle[aria-hidden="true"],
.app-shell:has(> .desktop-toolbar) #compact-sidebar-trigger[aria-hidden="true"] { visibility: hidden; pointer-events: none; }
.app-shell:has(> .desktop-toolbar) #compact-sidebar-trigger:not([aria-hidden="true"]) {
  position: fixed; left: var(--desktop-toggle-left, 80px); top: var(--desktop-toggle-top, 9px);
  width: var(--desktop-toggle-size, 22px); height: var(--desktop-toggle-size, 22px); z-index: var(--z-sidebar-trigger);
}
.app-shell:has(> .desktop-toolbar) .main-header:has(.conversation-title-disclosure) .main-header-actions #page-more-trigger { display: none; }
.app-shell:has(> .desktop-toolbar) .product-mode-switch {
  display: flex; position: fixed; top: var(--desktop-toggle-top, 9px);
  left: calc(var(--desktop-toggle-left, 80px) + 28px); right: auto;
  height: 22px; z-index: var(--z-sidebar-trigger); pointer-events: auto;
}
.app-shell:has(> .desktop-toolbar) .product-mode-switch button { height: 18px; min-height: 18px; }
.app-shell:has(> .desktop-toolbar) .sidebar-wordmark {
  visibility: visible; transform: none; transition: opacity 140ms ease; transition-delay: 0s;
}
.app-shell:has(> .desktop-toolbar)[data-sidebar-rail="true"] .sidebar-wordmark { opacity: 0; }
.app-shell:has(> .desktop-toolbar)[data-sidebar-rail="false"] .sidebar-wordmark { opacity: 1; }
.sidebar-projects [data-action="project-add"] { color: var(--text-faint); transition: color 120ms ease, background 120ms ease; }
.sidebar-projects [data-action="project-add"]:is(:hover,:focus-visible) { color: var(--text-primary); }
.models-rail { border-right: 1px solid var(--border); background: transparent; }
.models-main { padding: 24px; }
.models-detail-head { margin: 0 0 24px; align-items: center; flex-wrap: wrap; padding-inline-end: 40px; }
.models-detail-head h3 { font-size: 16px; line-height: 24px; font-weight: 500; }
.models-detail-head p { margin-top: 2px; }
.models-channel-meta:empty { display: none; }
.models-detail-actions { padding: 12px 0; border-block: 1px solid var(--border); margin-bottom: 24px; gap: 12px; }
.models-detail-actions:empty,
.models-detail-actions:not(:has(*)) { display: none; }
.models-autoswitch { flex: 0 1 auto; margin: 0; }
.models-autoswitch input { margin: 0; accent-color: var(--text-secondary); }
.models-priority { padding: 0; background: transparent; border-radius: 0; }
.models-priority-row { border-bottom: 0; }
.models-model-details > summary { padding: 12px 0 12px 4px; }
.models-model-badges { gap: 6px; }
.models-capability { background: transparent; padding: 0; color: var(--text-secondary); }
.models-model-id { color: var(--text-faint); }
.workbench-panel-tabs { border-bottom: 1px solid var(--border); }
.app-shell:has(> .desktop-toolbar) .workbench-panel-tabs { gap: 20px; padding-inline: 16px; }
.panel-folder-empty { padding: 32px 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.panel-folder-empty > .icon { color: var(--text-faint); width: 24px; height: 24px; }
.panel-folder-empty h3 { margin: 0; font-size: 13px; font-weight: 500; }
.panel-folder-empty p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
.panel-folder-empty .button { margin-top: 4px; gap: 8px; }
.panel-folder-header { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.panel-preview-heading { position: sticky; top: 0; background: var(--page); border-bottom: 1px solid var(--border); padding-block: 8px; z-index: 1; }
@media (max-width: 1099px) {
  .desktop-toolbar::after { left: 0; }
}
/* sidebarOpen describes only the compact overlay (SidebarController/isCompact),
   not an expanded desktop sidebar. Keep the wordmark on that same breakpoint. */
@media (max-width: 1023px) {
  .app-shell:has(> .desktop-toolbar)[data-sidebar-open="false"] .sidebar-wordmark { opacity: 0; }
  .app-shell:has(> .desktop-toolbar)[data-sidebar-open="true"] .sidebar-wordmark { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell:has(> .desktop-toolbar) .sidebar-wordmark { transition: none; }
}
html[data-reduce-motion="true"] .app-shell:has(> .desktop-toolbar) .sidebar-wordmark { transition: none; }
.models-order-feedback[hidden] { display: none; }

/* Second owner review: clear selection and full-height work surfaces. */
.product-mode-thumb { background: color-mix(in srgb, var(--text-primary) 16%, var(--page)); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }
.product-mode-switch button[aria-pressed="true"] { color: var(--text-primary); font-weight: 600; }
.product-mode-switch button[aria-pressed="false"] { color: var(--text-secondary); }
.app-shell:has(> .desktop-toolbar) .analysis-screen { grid-template-rows: minmax(0, 1fr); }
.app-shell:has(> .desktop-toolbar) .analysis-workbench { height: 100%; }
.app-shell:has(> .desktop-toolbar) .content-pane-resizer { position: relative; }
.app-shell:has(> .desktop-toolbar) .content-pane-resizer::before { content: ""; position: absolute; inset: 0 auto 0 2px; width: 1px; height: auto; transform: none; border-radius: 0; opacity: 1; background: var(--border); }
.knowledge-list-panel { display: flex; overflow: hidden; }
.knowledge-pagination { display: flex; flex: 0 0 42px; align-items: center; gap: 4px; padding: 0 10px 0 16px; border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 12px; }
.knowledge-pagination > span { flex: 1; }
.knowledge-pagination .icon-button { width: 26px; height: 26px; }
.desktop-toolbar .find-bar { position: absolute; top: 6px; right: 40px; z-index: calc(var(--z-sticky) + 2); height: 28px; width: min(360px, calc(100vw - 200px)); padding: 2px 4px 2px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--page); box-shadow: none; backdrop-filter: none; overflow: hidden; white-space: nowrap; pointer-events: auto; transform-origin: right center; animation: conversation-find-open 160ms ease-out; }
.desktop-toolbar .find-bar input { font-size: 12px; }
.desktop-toolbar .find-bar .icon-button { width: 22px; height: 22px; flex-shrink: 0; }
/* Find replaces header search/more while open. */
.desktop-toolbar:has(.find-bar) [data-action="open-find"],
.desktop-toolbar:has(.find-bar) #page-more-trigger { visibility: hidden; pointer-events: none; }
@keyframes conversation-find-open { from { clip-path: inset(0 0 0 100%); opacity: .5; } to { clip-path: inset(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .desktop-toolbar .find-bar { animation: none; } }
html[data-reduce-motion="true"] .desktop-toolbar .find-bar { animation: none; }

/* Shared review refinements: preserve native hit targets and keyboard focus. */
.settings-backdrop { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.models-model-description { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; color: var(--text-secondary); }
.profile-conversation-actions { display: flex; flex-direction: column; gap: 6px; margin: 18px 0; align-items: stretch; -webkit-app-region: no-drag; }
.profile-conversation-actions .button { justify-content: flex-start; white-space: normal; }
.app-shell { --desktop-mode-width: 88px; --desktop-mode-end: calc(var(--desktop-toggle-left, 80px) + 28px + var(--desktop-mode-width)); }
html[lang="en-US"] .app-shell { --desktop-mode-width: 96px; }
.app-shell .product-mode-switch { width: var(--desktop-mode-width); }
.sidebar-conversation-row .sidebar-item { padding-right: 32px; }

.agent-activity-peek { color: var(--text-secondary); font-size: 12px; line-height: 1.6; max-height: 3.2em; overflow: hidden; white-space: pre-wrap; -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent); pointer-events: none; }
.agent-activity[data-expanded="true"] .agent-activity-peek { display: none; }
.agent-reasoning-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-secondary); padding: 4px 0 8px; font-size: 12px; line-height: 1.65; }

/* Owner follow-up: shared native/select and disclosure controls. */
html:not([data-theme="dark"]) .product-mode-thumb { background: var(--surface-1); }
.shared-disclosure > summary { display: flex; align-items: center; gap: 7px; list-style: none; cursor: pointer; }
.shared-disclosure > summary::-webkit-details-marker { display: none; }
.shared-disclosure > summary::marker { content: none; }
.shared-disclosure > summary > .icon { flex: 0 0 auto; transition: transform 120ms ease; }
.shared-disclosure[open] > summary > .icon { transform: rotate(90deg); }
.technical-diagnostics-disclosure > summary { min-height: 28px; width: fit-content; color: var(--text-secondary); }
.technical-diagnostics-disclosure > summary > .icon { transition: transform 200ms cubic-bezier(.22,.75,.25,1) 50ms; }
.technical-diagnostics-disclosure > summary:hover { color: var(--text-primary); }
.technical-diagnostics-disclosure > summary:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 3px; border-radius: 4px; }
.copylibrary-storage-error { padding: 32px; color: var(--text-secondary); }
.copylibrary-storage-error strong { color: var(--text-primary); }
.desktop-runtime-actions .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
@media (prefers-reduced-motion: reduce) { .shared-disclosure > summary > .icon { transition: none; } }
html[data-reduce-motion="true"] .shared-disclosure > summary > .icon { transition: none; }

/* Owner review: content-sized profile selector. */
#content-profile-trigger { width: auto; max-width: 65%; min-width: 0; }
#content-profile-trigger > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#content-profile-menu { width: max-content; min-width: 160px; max-width: min(320px, calc(100vw - 24px)); }
#content-profile-menu .menu-label { overflow-wrap: anywhere; }
.desktop-toolbar-content {
  left: max(calc(var(--desktop-mode-end) + 13px), var(--sidebar-layout-width));
  transition: left 280ms cubic-bezier(.22,.75,.25,1) 24ms;
}
.desktop-toolbar-content > :is(.main-header, .page-toolbar-shell, .pane-header) { padding-inline: 12px 4px !important; }
/* Continue the workbench split in the titlebar, with breathing room above/below. */
.desktop-toolbar-content:has(> .pane-header + .pane-header) > .pane-header:first-child { padding-right: 7px !important; }
.desktop-toolbar-content[data-workbench-split="true"] > .pane-header + .pane-header::before {
  content: ""; position: absolute; left: 2px; top: 13px; width: 1px; height: 14px;
  background: var(--border); pointer-events: none;
}
/* Keep the visible title aligned with plain module headings, retaining its hover/focus box. */
.desktop-toolbar .conversation-title-button,
.desktop-toolbar .conversation-title-disclosure,
.desktop-toolbar .conversation-title-input {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  -webkit-app-region: no-drag;
}
.desktop-toolbar .conversation-title-button { margin-left: 0; }
.app-shell[data-sidebar-resizing="true"] .desktop-toolbar-content { transition: none; }
html[data-reduce-motion="true"] .desktop-toolbar-content { transition: none; }
@media (prefers-reduced-motion: reduce) { .desktop-toolbar-content { transition: none; } }

.desktop-toolbar :is(.copylibrary-toolbar-actions, .main-header-actions, .knowledge-toolbar-actions) .icon-button { width: 28px; height: 28px; min-width: 28px; margin-inline: 0; }
.desktop-toolbar #desktop-right-toggle { width: 28px; height: 28px; top: 6px; right: 4px; }
.desktop-toolbar-content { right: 34px; }
.desktop-toolbar-content::before {
  content: none; position: fixed; left: var(--desktop-divider-left); top: 13px; width: 1px; height: 14px;
  background: var(--border-strong); opacity: .65; pointer-events: none;
  transition: opacity 180ms ease 24ms;
}
.desktop-toolbar-content[data-divider-visible="true"]::before { content: ""; }
html[data-reduce-motion="true"] .desktop-toolbar-content::before { transition: none; }
@media (prefers-reduced-motion: reduce) { .desktop-toolbar-content::before { transition: none; } }
.desktop-toolbar .copylibrary-filter-control { width: 28px; height: 28px; }

/* Keep the metric and its text icon on the same compact center line. */
.desktop-toolbar .output-metric { display: inline-flex; align-items: center; height: 28px; font-size: 12px; line-height: 16px; }
.desktop-toolbar .output-save-status:empty { display: none; }
.desktop-toolbar .pane-header > .icon-button { width: 28px; height: 28px; min-width: 28px; }
/* Layout already resizes the conversation; do not replay a panel entrance on remount. */
.app-shell .workbench-panel { animation: detail-enter 180ms cubic-bezier(.2,.8,.2,1); }

.sidebar-history-heading { padding-right: 0; margin-bottom: 2px; }
.sidebar-conversation-row > .sidebar-item > .icon { width: 10px; height: 10px; min-width: 10px; min-height: 10px; font-size: 10px; flex: 0 0 10px; }
.sidebar-conversation-row > .sidebar-item > .icon svg { width: 10px; height: 10px; }
#recents-collapse-trigger { width: 100%; }
/* Optical correction for the UI font's glyph baseline (not the flex box). */
.composer-model .model-name, .composer-model .model-effort, .desktop-toolbar .output-metric { position: relative; top: 1px; }
@media (prefers-reduced-motion: reduce) { .app-shell .workbench-panel { animation: none; } }
html[data-reduce-motion="true"] .workbench-panel { animation: none; }
.menu.menu--attachment { background: var(--surface-1); backdrop-filter: none; -webkit-backdrop-filter: none; }
.menu.menu--effort { background: var(--surface-1); backdrop-filter: none; -webkit-backdrop-filter: none; }
.skills-popover footer .button { border: 0; box-shadow: none; background: transparent; }
.skills-popover footer .button:hover { background: var(--surface-hover); }

.owner-select { position: relative; display: block; min-width: 0; }
.owner-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-1); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.owner-select-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-select-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; display: grid; gap: 2px; max-height: 220px; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-1); box-shadow: 0 8px 24px rgb(0 0 0 / 12%); }
.owner-select-menu[hidden] { display: none; }
.owner-select-menu button { border: 0; border-radius: 5px; padding: 8px; background: transparent; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.owner-select-menu button:hover, .owner-select-menu button:focus-visible, .owner-select-menu button[aria-selected="true"] { background: var(--surface-hover); }
.owner-model-session-option .switch,
.models-autoswitch .switch,
.models-priority-actions .switch {
  flex: 0 0 36px;
  width: 36px;
  height: 20px;
  min-height: 20px;
  padding: 2px;
}
.models-priority-actions > label { display: inline-flex; align-items: center; gap: 8px; }

/* Compact model settings: one calm row per model, with detail controls only
   after the row is opened. Provider cards and connection rows keep their
   semantics and hit targets while removing the large empty bands visible in
   the settings screenshots. */
.models-channel-list > [data-model-channel-row]:has(.is-selected) { background: transparent; }
.models-channel-list > [data-model-channel-row] { margin: 1px 0; }
.models-channel { min-height: 34px; padding: 3px 6px 3px 2px; gap: 7px; }
.models-channel-copy { display: grid; align-content: center; min-height: 28px; }
.models-channel-name { margin-bottom: 0; line-height: 16px; }
.models-channel-meta { line-height: 14px; }
.models-channel > .models-channel-copy { display: grid; place-items: center start; }
.models-letter { width: 22px; height: 22px; }
.models-priority { display: grid; gap: 2px; }
.models-priority-row { grid-template-columns: 24px minmax(0, 1fr); gap: 4px; }
.models-model-order-handle { width: 24px; min-width: 24px; height: 28px; min-height: 28px; margin-top: 6px; }
.models-model-details > summary { height: 40px; min-height: 40px; padding: 6px 8px; }
.models-model-copy > strong { line-height: 20px; }
.models-model-description { display: none; }
.models-model-badges { max-width: 160px; }
.models-model-details { border-bottom: 0; }
.models-model-options { padding: 2px 8px 12px; }
.models-provider-card { min-height: 44px; padding: 6px 8px; gap: 9px; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); background: transparent; }
.models-provider-card:hover, .models-provider-card:focus-visible { background: var(--surface-hover); }
.models-provider-card > :first-child { display: grid; place-items: center; width: 22px; height: 22px; }
.models-provider-card > .provider-logo { width: 22px; height: 22px; min-width: 22px; min-height: 22px; }
.models-provider-copy { align-content: center; gap: 0; min-height: 28px; line-height: 16px; }
.models-provider-copy strong { line-height: 18px; }
.models-provider-status { line-height: 16px; }
.models-add-tabs [aria-pressed="true"] { background: transparent; font-weight: 500; }
.models-add-tabs .button:hover, .models-add-tabs .button:focus-visible { background: var(--surface-hover); }

/* Section affordances stay out of the way until the pointer or keyboard
   reaches the section. Touch layouts keep them visible because there is no
   hover state to discover them. */
.sidebar :is(.sidebar-history-heading, .sidebar-section-heading) .sidebar-section-toggle > .icon {
  opacity: 0;
  transition: transform 260ms cubic-bezier(.22, 1, .36, 1) 60ms, opacity 120ms ease;
}
.sidebar-section-heading > [data-action="project-add"] { opacity: 0; transition: opacity 120ms ease, color 120ms ease; }
.sidebar :is(.sidebar-history-heading, .sidebar-section-heading):hover .sidebar-section-toggle > .icon {
  opacity: 1;
  transition-delay: 60ms, 160ms;
}
.sidebar-section-heading:hover > [data-action="project-add"] { opacity: 1; transition-delay: 160ms, 0s; }
.sidebar :is(.sidebar-history-heading, .sidebar-section-heading):has(:focus-visible) .sidebar-section-toggle > .icon,
.sidebar-section-heading:has(:focus-visible) > [data-action="project-add"] { opacity: 1; transition-delay: 0s; }
@media (hover: none) {
  .sidebar :is(.sidebar-history-heading, .sidebar-section-heading) .sidebar-section-toggle > .icon,
  .sidebar-section-heading > [data-action="project-add"] { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar :is(.sidebar-history-heading, .sidebar-section-heading) .sidebar-section-toggle > .icon,
  .sidebar-section-heading > [data-action="project-add"] { transition: none; }
}

/* Update control dimensions live in screens/desktop-update.css. */

.content-mode-slot { display: none; }
.app-shell:has(> .desktop-toolbar) .content-workbench:has(.content-mode-slot:not(:empty)) { flex-direction: column; }
@container content-workbench (max-width: 839px) {
  .app-shell:has(> .desktop-toolbar) .content-mode-slot:not(:empty) {
    display: block; flex: 0 0 auto; margin-top: 48px;
  }
  .app-shell:has(> .desktop-toolbar) .content-mode-slot:not(:empty) + .content-pane-grid {
    flex: 1 1 auto; height: auto; padding-top: 0;
  }
}

/* Owner maintenance 2026-09-30: only small project/history actions.
   Preserve existing 24px hit widths and list geometry; scale the glyph itself. */
.sidebar :is(.sidebar-project-more > summary, .sidebar-project-new, [data-action="project-add"], .conversation-more) {
  position: relative;
  border-radius: 5px;
  color: var(--text-secondary);
  opacity: .65;
  transition: color 120ms ease, background-color 120ms ease, opacity 120ms ease;
}
.sidebar .sidebar-conversation-row > .conversation-more { position: absolute; }
.sidebar :is(.sidebar-project-more > summary, .sidebar-project-new, [data-action="project-add"]) > .icon {
  width: 14px; height: 14px; min-width: 14px; min-height: 14px; font-size: 14px;
}
.sidebar :is(.sidebar-project-more > summary, .sidebar-project-new, [data-action="project-add"]) > .icon svg {
  width: 14px; height: 14px; min-width: 14px; min-height: 14px;
}
/* History's glyph was already 13px; do not enlarge it or shrink its target. */
.sidebar .conversation-more > .icon { font-size: 13px; }
.sidebar :is(.sidebar-project-more > summary, .sidebar-project-new, [data-action="project-add"], .conversation-more):not(:disabled):is(:hover, :focus-visible) {
  background: var(--surface-hover); color: var(--text-primary); opacity: 1;
  transform: none;
}
.sidebar :is(.sidebar-project-more > summary, .sidebar-project-new, [data-action="project-add"], .conversation-more):focus-visible {
  outline: 1px solid var(--text-secondary); outline-offset: 1px;
}
.sidebar .sidebar-project-more[open] > summary,
.sidebar .conversation-more[aria-expanded="true"] { background: var(--surface-hover); color: var(--text-primary); opacity: 1; }
.sidebar :is(.sidebar-project-new, [data-action="project-add"], .conversation-more):disabled {
  opacity: .35; background: transparent; color: var(--text-faint); transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .sidebar :is(.sidebar-project-more > summary, .sidebar-project-new, [data-action="project-add"], .conversation-more) { transition: none; }
}

/* Benchmark accounts have no media slot; keep list styles scoped to their own layout. */
.inspiration-grid .benchmark-card { display: block; height: auto; min-height: 0; }
.inspiration-grid .benchmark-card .inspiration-card-open { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; padding: 16px; }
.inspiration-grid .benchmark-card .inspiration-type-tile { display: flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; }
.inspiration-grid .benchmark-card .inspiration-card-copy { display: flex; flex-direction: column; flex: 1; gap: 6px; min-width: 0; padding: 0; }
.inspiration-grid .benchmark-card .inspiration-card-title { font-size: 15px; line-height: 22px; }
.inspiration-grid .benchmark-card .inspiration-card-summary { font-size: 13px; line-height: 1.5; }
.inspiration-grid .benchmark-card :is(.inspiration-card-topline,.inspiration-card-footer) { font-size: 11px; line-height: 1.5; }
.panel-file-preview .panel-preview-markdown h1 { font-size: 20px; line-height: 1.35; }
.panel-file-preview .panel-preview-markdown h2 { font-size: 18px; line-height: 1.35; }
.panel-file-preview .panel-preview-markdown h3 { font-size: 16px; line-height: 1.35; }

@media (prefers-reduced-motion: reduce) { .desktop-toolbar .copylibrary-smart-view-disclosure-slot { transition: none; } }
html[data-reduce-motion="true"] .desktop-toolbar .copylibrary-smart-view-disclosure-slot { transition: none; }

/* Settings density: scoped to settings, preserving navigation and composer controls. */
.models-channel, .models-channel-copy { text-align: left; }
.models-page-head .models-add-button { min-height: 28px; padding: 4px 7px; gap: 4px; font-size: 12px; }
.models-routing-preference { margin: 20px 0; padding-top: 16px; border-top: 1px solid var(--border); }
.models-routing-preference .models-autoswitch { justify-content: space-between; flex-direction: row-reverse; font-size: 12px; }
.models-routing-preference .setting-description { margin: 8px 0 0; line-height: 1.6; }
.models-embedded .owner-model-empty { gap: 12px; }
.models-embedded .owner-model-empty .button { justify-self: start; }
.skills-settings-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); }
.skills-settings-search:focus-within { outline: 2px solid var(--text-secondary); outline-offset: 2px; }
.skills-settings-search .settings-input { width: 100%; min-width: 0; min-height: 36px; padding: 6px 0; border: 0; background: transparent; outline: none; }
.skills-settings-copy { flex: 1; min-width: 0; }
.skills-settings-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.skills-settings-name strong { overflow-wrap: anywhere; }
.skills-settings-origin { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.skills-settings-row > .icon { flex: 0 0 16px; color: var(--text-secondary); }
.skills-settings-row p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-pin-group-label { margin: 8px 0 0; padding: 10px 14px 4px; color: var(--text-muted); font-size: 11px; font-weight: 500; }
.sidebar-pin-group-label:first-child { margin-top: 0; }
.settings-account-profile .settings-account-card { margin-top: 0; gap: 12px; }
.settings-account-profile [data-account-storage-mode] { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.settings-account-profile .account-profile-form { grid-template-columns: minmax(0, 1fr) minmax(150px, 220px); gap: 8px 20px; align-items: center; }
.settings-account-profile .account-profile-names { width: 100%; min-width: 0; }
.settings-account-profile .account-profile-photo { flex-wrap: nowrap; }
.settings-account-profile .account-profile-photo .account-avatar-upload, .settings-account-profile .account-profile-photo .settings-account-avatar { flex-basis: 44px; width: 44px; height: 44px; font-size: 18px; }
.settings-account-profile .account-profile-save-hint { grid-column: 2; margin: 0; font-size: 11px; }
.settings-account-profile [data-profile-status], .settings-account-profile .account-profile-actions { grid-column: 1 / -1; margin: 0; }
@media (max-width: 800px) {
  .settings-account-profile .account-profile-form { grid-template-columns: minmax(0, 1fr); }
  .settings-account-profile .account-profile-save-hint { grid-column: 1; }
  .settings-account-profile .account-profile-names { max-width: 320px; }
}

.settings-content:has(.settings-account-profile) .setting-group { margin-bottom: 24px; }
.settings-account-profile .settings-account-card { max-width: none; }

@media (max-width: 704px) {
  .settings-dialog { grid-template-rows: 54px minmax(0, 1fr); }
  .settings-nav { margin-right: 40px; padding-right: 10px; }
  .settings-content { min-height: 0; }
}
