.container {
  display: flex;
  flex: 1;
  height: 100%;
  background: var(--sidebar-bg);
  position: relative;
}

/* macOS-only: fills the 38px overlay-title-bar gap so the user can drag the
   window from the area above the sidebar back-link. On Windows/Linux the
   native title bar already handles dragging, and rendering this overlay
   would sit on top of (and steal clicks from) the back-link button. */
.dragRegion {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  z-index: 1;
}

[data-platform="mac"] .dragRegion {
  display: block;
}

/* ── Settings sidebar ── */

.sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[data-platform="mac"] .sidebar {
  background: color-mix(in srgb, var(--sidebar-bg) 88%, transparent);
}

/* Non-scrolling header — lives outside the scrollable nav so macOS
   elastic-bounce scroll never moves it. On macOS the top padding
   clears the 38px overlay title bar zone. */
.sidebarHeader {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 0 10px;
  border-bottom: 1px solid var(--divider);
}

[data-platform="mac"] .sidebarHeader {
  padding-top: 42px;
}

.sidebarTitle {
  margin: 0;
  padding: 6px 16px 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* Scrollable nav list below the fixed header. The JS hook on
   BoundedScrollPane handles WebKit's elastic gesture; this CSS rule
   catches the trackpad-flick edge before the wheel listener fires. */
.sidebarNav {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: none;
  padding: 8px 0 16px;
}

.backLink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 2px;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  align-self: flex-start;
}

.backLink:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

.groupLabel {
  padding: 16px 16px 4px;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.navItem {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
}

.navItem:hover {
  color: var(--text-primary);
  background: var(--hover-bg);
}

.navItemActive {
  composes: navItem;
  color: var(--text-primary);
  background: var(--selected-bg);
}

.repoIcon {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.repoName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Content area ── */

.contentArea {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: none;
  padding: 32px 48px;
  background: var(--app-bg);
}

:where([data-platform="mac"]) .container {
  background: transparent;
}

:where([data-platform="mac"]) .content,
:where([data-platform="mac"]) .attributionBar {
  background: color-mix(in srgb, var(--app-bg) 92%, transparent);
}

.attributionBar {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  background: var(--app-bg);
  border-top: 1px solid var(--divider);
  user-select: none;
}

.sectionTitle {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 32px;
}

.sectionDescription {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.55;
  margin: -20px 0 24px;
  max-width: 640px;
}

.sectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 32px;
}

.sectionHeader .sectionTitle {
  margin: 0;
}

/* Storage section header: title + description block on the left,
   cleanup-all action button aligned to the right. Title and
   description keep their default margins so the rest of the page
   matches the existing visual rhythm; the button shrinks to its
   content width. */
.storageHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.storageHeaderText {
  min-width: 0;
  flex: 1;
}

.storageHeaderActions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.storageEmptyHint {
  font-size: 12px;
  color: var(--text-dim);
  padding: 12px 0;
  font-style: italic;
}

/* Unified repo card. Each card shows one repo (or one "unknown repo"
   slug) with all its workspaces + orphans rolled together so the page
   doesn't duplicate the same repo across multiple sections. */
.storageRepoCard {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
}

.storageUnknownCard {
  composes: storageRepoCard;
  background: color-mix(in srgb, var(--status-stopped) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--status-stopped) 35%, transparent);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}

.storageCardHeader {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.storageCardChevron {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.storageCardChevron:disabled {
  cursor: default;
  opacity: 0.35;
}

.storageCardChevronSpacer {
  display: inline-block;
  width: 14px;
  height: 14px;
}

.storageCardMain {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.storageCardTitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex-wrap: wrap;
}

.storageUnknownIcon {
  color: var(--status-stopped);
  flex-shrink: 0;
}

.storageCardName {
  /* let the rest of the title shrink before the name does */
  flex-shrink: 0;
}

.storageCardSlugBadge {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: var(--selected-bg);
  border-radius: 3px;
  padding: 1px 5px;
}

.storageCardTotal {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  border: 1px solid var(--divider);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: auto;
}

.storageCardMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  align-items: center;
}

.storageMetaPill {
  font-variant-numeric: tabular-nums;
  background: transparent;
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 1px 8px;
  color: var(--text-dim);
}

.storageMetaPillOrphaned {
  composes: storageMetaPill;
  border-color: color-mix(in srgb, var(--status-stopped) 50%, transparent);
  color: var(--status-stopped);
}

.storageCardActions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.storageCardBreakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 0 30px;
  padding: 8px 10px;
  background: var(--selected-bg);
  border-radius: 4px;
}

/* Workspace row inside a card's breakdown — name | status | size. */
.storageWorkspaceRow {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  padding: 2px 0;
}

.storageWorkspaceName {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storageWorkspaceSize {
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  min-width: 60px;
  text-align: right;
}

/* Orphan row inside a card's breakdown — path | status | size | trash. */
.storageOrphanRow {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  padding: 2px 0;
}

.storageOrphanPath {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storageOrphanDeleteBtn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
}

.storageOrphanDeleteBtn:hover:not(:disabled) {
  color: var(--status-stopped);
  background: var(--hover-bg);
}

.storageOrphanDeleteBtn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Status pills shared across workspace + orphan rows. */
.storageStatusPillActive {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border: 1px solid var(--divider);
  border-radius: 9px;
  padding: 0 6px;
}

.storageStatusPillArchived {
  composes: storageStatusPillActive;
}

.storageStatusPillOrphaned {
  composes: storageStatusPillActive;
  color: var(--status-stopped);
  border-color: color-mix(in srgb, var(--status-stopped) 50%, transparent);
}

/* Orphan-purge confirm: floats below the card list, scoped to the
   selected path. */
.storageOrphanConfirmOverlay {
  position: sticky;
  bottom: 0;
  margin-top: 16px;
  padding: 12px 0;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--app-bg) 16px
  );
}

.storageOrphanConfirmCard {
  border: 1px solid var(--status-stopped);
  border-radius: 6px;
  padding: 12px;
  background: var(--bg-primary);
}

.storageOrphanConfirmText {
  font-size: 12px;
  color: var(--text-primary);
  margin: 0 0 8px;
  word-break: break-all;
  white-space: pre-wrap;
}

.storageOrphanConfirmError {
  font-size: 11px;
  color: var(--status-stopped);
  margin: 0 0 8px;
  word-break: break-word;
  /* `handleBulkOrphanPurge` joins per-failure lines with "\n" and the
     "failures / skipped" sections with "\n\n". Without pre-wrap those
     literal newlines collapse to single spaces and the user sees one
     unbroken run of "path: error path: error" instead of a per-failure
     list. Matches the sibling .storageOrphanConfirmText rule. */
  white-space: pre-wrap;
}

.storageOrphanConfirmActions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.storageOrphanConfirmDelete {
  color: var(--status-stopped);
  border-color: var(--status-stopped);
}

.storageOrphanConfirmList {
  margin: 4px 0 8px;
  padding-left: 18px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  max-height: 160px;
  overflow-y: auto;
  list-style: disc;
}

.storageOrphanConfirmList li {
  word-break: break-all;
  margin-bottom: 2px;
}

.storageOrphanConfirmProgress {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 8px;
  font-variant-numeric: tabular-nums;
}

/* "Delete N orphans" button variants — uses the destructive accent
   so it reads as different from the (safe) archived cleanup button
   sitting next to it. */
.storageCardOrphanBtn {
  color: var(--status-stopped);
  border-color: color-mix(in srgb, var(--status-stopped) 45%, transparent);
}

.storageCardOrphanBtn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--status-stopped) 8%, transparent);
}

.storageDeleteAllOrphansBtn {
  color: var(--status-stopped);
  border-color: color-mix(in srgb, var(--status-stopped) 45%, transparent);
}

.storageDeleteAllOrphansBtn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--status-stopped) 8%, transparent);
}

.storageError {
  font-size: 12px;
  color: var(--status-stopped);
  margin: 8px 0;
}

.subsectionTitle {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 32px 0 8px;
}


/* ── Setting rows ── */

.settingRow {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding: 20px 0;
  border-bottom: 1px solid var(--divider);
}

.settingInfo {
  flex: 1;
  min-width: 0;
}

.settingLabel {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.settingDescription {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 4px;
}

.settingControl {
  flex-shrink: 0;
}

/* ── Controls ── */

.input {
  background-color: var(--chat-input-bg);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-3);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  min-width: 200px;
}

.input:focus {
  border-color: var(--text-dim);
}

.select {
  composes: input;
  cursor: pointer;
  padding-right: 26px;
}

/* ── Workspace app picker ── */

.appPicker {
  position: relative;
  min-width: 240px;
}

.appPickerButton {
  composes: input;
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  text-align: left;
}

.appPickerButton:disabled {
  opacity: 0.5;
  cursor: default;
}

.appPickerLabel {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appPickerMenu {
  position: absolute;
  top: calc(100% + var(--space-1));
  right: 0;
  z-index: 50;
  width: 100%;
  min-width: 260px;
  max-height: 320px;
  overflow-y: auto;
  padding: var(--space-1);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  background: var(--sidebar-bg);
  box-shadow: var(--shadow-md);
}

.appPickerOption {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  gap: var(--space-2);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-2);
  color: var(--text-primary);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.appPickerOption:hover {
  background: var(--hover-bg);
}

.appPickerOptionSelected {
  composes: appPickerOption;
  background: var(--selected-bg);
}

.appPickerOptionSelected:hover {
  background: var(--selected-bg);
}

.appPickerOptionText {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.appPickerOptionLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.appPickerOptionHint,
.appPickerEmpty {
  color: var(--text-dim);
  font-size: 12px;
}

.appPickerAutoIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-md);
  color: var(--tool-bash);
  background: var(--terminal-tab-bg);
}

.appPickerEmpty {
  padding: var(--space-2);
}

/* ── Font picker (custom dropdown with font previews) ── */

.fontPicker {
  position: relative;
  min-width: 200px;
}

.fontPickerButton {
  composes: input;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
}

.fontPickerButton::after {
  content: "▾";
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.fontPickerDropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border: 1px solid var(--divider);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  padding: 4px;
}

.fontPickerOption {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--text-primary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.fontPickerOption:hover {
  background: var(--hover-bg);
}

.fontPickerOptionSelected {
  composes: fontPickerOption;
  background: var(--accent-bg);
  color: var(--accent-primary);
}

.fontPickerOptionSelected:hover {
  background: var(--accent-bg-strong);
}

.fontPickerSearch {
  position: sticky;
  top: 0;
  z-index: 1;
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-bottom: 1px solid var(--divider);
  border-radius: 0;
  background: var(--sidebar-bg);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.fontPickerSearch::placeholder {
  color: var(--text-dim);
}

.fontPickerGroupLabel {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  user-select: none;
}

.fontPickerGroupLabel:not(:first-child) {
  margin-top: 4px;
  border-top: 1px solid var(--divider);
  padding-top: 8px;
}

.fontPickerNoResults {
  padding: 12px 10px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

.numberInput {
  composes: input;
  width: 80px;
  min-width: 80px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  background: var(--divider);
  padding: 0;
}

.toggle[data-checked="true"] {
  background: var(--accent-primary);
}

.toggleKnob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sidebar-bg);
  transition: transform 0.2s;
}

.toggle[data-checked="true"] .toggleKnob {
  transform: translateX(20px);
}

.inlineControl {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* SearchableSelect renders as `width: 100%` on its wrapper, which would
 * collapse to nothing inside a flex-shrink:0 settingControl. Give it a
 * stable inline width close to what the old native <select> sized to so
 * the search popover has room to render its filtered list without the
 * Thinking-on/off select jumping next to it. */
.defaultModelPickerWrapper {
  width: 260px;
  position: relative;
}

.iconBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Small gap between an inline icon and the label text. JSX children
   * have no whitespace between them by default, so without this the
   * icon's SVG sits flush against the first letter of the label.
   * Buttons that have no icon get a no-op gap (nothing to space). */
  gap: 6px;
  background: var(--selected-bg);
  border: 1px solid var(--divider);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.2;
  min-height: 34px;
  white-space: nowrap;
}

.iconBtn:hover {
  background: var(--hover-bg);
}

.iconBtn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── Hotkey badge (Keyboard settings) ──
 * Composes iconBtn so the visual height/padding/border-radius matches the
 * adjacent Rebind/Reset/Disable buttons exactly. Overrides cursor (it's not
 * clickable) and font-family (mono for the keystroke glyphs). */

.hotkeyBadge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 0;
  font-family: var(--font-mono);
  cursor: default;
  min-width: 80px;
  min-height: 34px;
  white-space: nowrap;
}

.hotkeyBadge:hover {
  background: transparent;
}

.keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--divider);
  border-radius: 5px;
  background: var(--selected-bg);
  box-shadow: inset 0 -1px 0 var(--hover-bg);
  font-size: 12px;
  line-height: 1;
}

.keyboardSearch {
  composes: input;
  width: 100%;
  margin: 0 0 8px;
}

.keyboardEmpty {
  padding: 24px 0;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

.keyboardGroup {
  padding: 20px 0;
  border-bottom: 1px solid var(--divider);
}

.keyboardGroup .settingRow {
  padding: 16px 0;
}

.keyboardGroup .settingRow:last-child {
  border-bottom: none;
}

.keyboardGroupLabel {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

/* ── Textarea fields (setup script, instructions) ── */

.textarea {
  composes: input;
  width: 100%;
  min-width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  resize: vertical;
  min-height: 80px;
}

/* ── Repo settings specifics ── */

.fieldGroup {
  padding: 20px 0;
  border-bottom: 1px solid var(--divider);
}

.fieldLabel {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.fieldHint {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 4px;
}

.pluginToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 24px;
  flex-wrap: wrap;
}

.pluginTabs {
  display: flex;
  gap: 8px;
}

.pluginTab {
  composes: iconBtn;
}

.pluginTabActive {
  composes: pluginTab;
  background: var(--accent-bg);
  color: var(--accent-primary);
}

.pluginPanel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.pluginSummaryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.pluginStatCard {
  border: 1px solid var(--divider);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  background: var(--sidebar-bg);
  min-height: 110px;
}

.pluginStatValue {
  color: var(--text-primary);
  font-size: 28px;
  line-height: 1;
  font-weight: 600;
}

.pluginStatLabel {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  margin-top: 10px;
}

.pluginStatDetail {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 6px;
}

.pluginInlineNote {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 22%, var(--divider));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-bg) 44%, transparent);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.pluginFormRow {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.pluginList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pluginCard {
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: color-mix(in srgb, var(--sidebar-bg) 78%, transparent);
  overflow: hidden;
  flex-shrink: 0;
}

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

.pluginCardHeader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  align-items: flex-start;
}

.pluginCardBody {
  min-width: 0;
}

.pluginCardTitle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--text-primary);
  font-weight: 500;
}

.packNameLink {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.packNameLink:hover {
  text-decoration: underline;
  color: var(--accent-primary);
}

.pluginBadge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--selected-bg);
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pluginMeta {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 6px;
  word-break: break-all;
}

.pluginLinkRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pluginLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 22%, var(--divider));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-bg) 36%, transparent);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  max-width: min(100%, 420px);
  min-width: 0;
  text-align: left;
}

.pluginLink:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 46%, var(--divider));
  background: color-mix(in srgb, var(--accent-bg) 54%, transparent);
}

.pluginLinkLabel {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.pluginLinkDetail {
  color: var(--text-primary);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.pluginActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  flex-shrink: 0;
}

@media (max-width: 960px) {
  .pluginCardHeader {
    grid-template-columns: 1fr;
  }

  .pluginActions {
    justify-content: flex-start;
  }
}

.pluginConfigPanel {
  border-top: 1px solid var(--divider);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pluginConfigSection {
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 14px;
  background: color-mix(in srgb, var(--app-bg) 75%, transparent);
}

.pluginConfigHeader {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.pluginConfigFields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.pluginField {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.pluginNotice {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--selected-bg);
  color: var(--text-primary);
}

.pluginSuccess {
  composes: pluginNotice;
  background: color-mix(in srgb, var(--status-running) 14%, transparent);
}

.pluginError {
  composes: pluginNotice;
  background: color-mix(in srgb, var(--status-stopped) 14%, transparent);
}

.fieldHint {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 4px;
}

.overrideNotice {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 8px;
}

.readOnlyPre {
  background: var(--chat-input-bg);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-dim);
  margin: 0 0 var(--space-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.overriddenLabel {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.dangerZone {
  padding: 20px 0;
}

.dangerLabel {
  color: var(--status-stopped);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.btnDanger {
  background: var(--selected-bg);
  border: 1px solid var(--status-stopped);
  color: var(--status-stopped);
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.btnDanger:hover {
  background: var(--accent-error-hover);
}

.error {
  color: var(--accent-error);
  font-size: 12px;
  margin-top: 4px;
}

/* Tolerant-loader warnings for the Models panel: non-fatal, advisory.
   Uses the accent palette (not error red) because the user's data is
   safe — entries are preserved as opaque passthrough and will reactivate
   on a build that knows them. */
.backendWarningBanner {
  border: 1px solid var(--accent-bg-strong);
  border-radius: var(--radius-md);
  background: var(--accent-bg);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  margin: 8px 0 16px;
}

.backendWarningTitle {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent-primary);
}

.backendWarningList {
  margin: 0;
  padding-left: 18px;
  color: var(--text-dim);
}

.backendWarningList li {
  word-break: break-word;
  margin-bottom: 2px;
}

.backendWarningHint {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 12px;
}

/* ── Repo header (icon + editable name) ── */

.repoHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.repoIconButton {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--selected-bg);
  border: 1px solid var(--divider);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.repoIconButton:hover {
  border-color: var(--text-dim);
  color: var(--text-primary);
}

.repoNameInput {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  outline: none;
  padding: 0 0 2px;
  flex: 1;
  min-width: 0;
}

.repoNameInput:hover {
  border-bottom-color: var(--divider);
}

.repoNameInput:focus {
  border-bottom-color: var(--text-dim);
}

.iconPopover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  width: 280px;
  background: var(--sidebar-bg);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

/* ── Radio buttons ── */

.radioLabel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  width: fit-content;
}

.radioLabel input[type="radio"] {
  accent-color: var(--accent-primary);
}

/* ── Usage bars ── */

.usageSection {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.usagePlanBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--accent-bg);
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.usageCard {
  padding: 16px 0;
  border-bottom: 1px solid var(--divider);
}

.usageCardHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.usageCardTitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.usageCardValue {
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.usageBarTrack {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-sm);
  background: var(--hover-bg);
  overflow: hidden;
}

.usageBarFill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-normal);
  min-width: 2px;
}

.usageReset {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

.usageFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
}

.usageRefreshBtn {
  composes: iconBtn;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.usageRefreshBtnPrimary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--on-accent);
}

.usageRefreshBtnPrimary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
}

.usageActions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.usageErrorMessage {
  max-width: 420px;
  line-height: 1.5;
}

.usageTimestamp {
  font-size: 12px;
  color: var(--text-dim);
}

.usageEmptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 200px;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
}

.usageExtraHeader {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-top: 8px;
}

.authPanel {
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  background: var(--sidebar-bg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
}

.authPanelHeader {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  color: var(--text-primary);
}

.authPanelHeader svg {
  color: var(--accent-primary);
  margin-top: 2px;
}

.authPanelTitle {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

.authPanelDescription {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 4px;
}

.authPanelStatus {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
}

.authCodeForm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.authCodeInput {
  composes: input;
  min-width: 220px;
}

.authPanelError {
  border: 1px solid var(--accent-error-border);
  border-radius: var(--radius-md);
  background: var(--accent-error-bg);
  color: var(--accent-error);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  word-break: break-word;
}

.authPanelSuccess {
  color: var(--status-running);
  font-size: 13px;
}

.authInlineStatus,
.authInlineSuccess,
.authInlineError {
  font-size: 12px;
  line-height: 1.5;
  margin-top: 6px;
}

.authInlineStatus {
  color: var(--text-dim);
}

.authInlineSuccess {
  color: var(--status-running);
}

.authInlineError {
  color: var(--status-stopped);
}

.authFocusRow {
  border-radius: var(--radius-md);
  background: rgba(var(--accent-primary-rgb), 0.08);
  box-shadow: inset 3px 0 0 var(--accent-primary);
  padding-left: 12px;
  padding-right: 12px;
  margin-left: -12px;
  margin-right: -12px;
}

.authNotes {
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 16px;
  max-width: 640px;
}

.usageManageLink {
  font-size: 13px;
  color: var(--accent-primary);
  text-decoration: none;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.usageManageLink:hover {
  text-decoration: underline;
}

/* ── MCP server list ── */

.mcpList {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mcpRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
}

.mcpRow:hover {
  background: var(--hover-bg);
}

.mcpInfo {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mcpName {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.mcpBadge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--selected-bg);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.mcpRemoveBtn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.mcpRemoveBtn:hover {
  background: var(--accent-error-hover);
  color: var(--accent-error);
}

.mcpStatusDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mcpError {
  font-size: 11px;
  color: var(--status-stopped);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.mcpActions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.mcpReconnectBtn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--sidebar-border);
  background: none;
  color: var(--text-primary);
  cursor: pointer;
}

.mcpReconnectBtn:hover {
  background: var(--accent-bg);
}

.mcpNameDisabled {
  color: var(--text-dim);
}

/* ── Env-provider error card ── */

.envDetailsBtn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--sidebar-border);
  background: none;
  color: var(--text-primary);
  cursor: pointer;
}

.envDetailsBtn:hover {
  background: var(--accent-bg);
}

.envErrorCard {
  margin: 4px 8px 8px 22px;
  padding: 10px 12px;
  border-left: 2px solid var(--accent-error);
  background: var(--accent-error-hover);
  border-radius: 0 4px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.envErrorSummary {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

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

.envErrorCmdRow {
  display: flex;
  align-items: center;
  gap: 6px;
}

.envErrorCmd {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  padding: 5px 8px;
  background: var(--selected-bg);
  border-radius: 3px;
  color: var(--text-primary);
  overflow-x: auto;
  white-space: nowrap;
}

.envErrorCopyBtn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--sidebar-border);
  background: none;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.envErrorCopyBtn:hover {
  background: var(--accent-bg);
}

.pluginSettingsForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.pluginSettingRow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pluginSettingLabel {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.textInput {
  margin-top: 4px;
  width: 100%;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 3px;
  border: 1px solid var(--sidebar-border);
  background: var(--input-bg, var(--selected-bg));
  color: var(--text-primary);
  font-family: inherit;
}

.textInput:focus {
  outline: none;
  border-color: var(--accent-color, var(--text-primary));
}

/* Numeric plugin settings (e.g. timeout_seconds): wrap the number
 * input + unit suffix on a single inline row instead of stretching
 * the input to the full form width like text inputs. The input itself
 * uses `.numberInput` (composes from `.input`) so it shares the
 * standard form-control styling. */
.pluginSettingNumberWrap {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pluginSettingNumberRow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.pluginSettingUnit {
  font-size: 12px;
  color: var(--text-dim);
}

/* Inline per-repo settings drawer rendered below an EnvPanel row
 * when the user clicks "Settings". Indented to read as a child of
 * the row's status line so it's visually clear which provider it
 * configures. */
.envSettingsDrawer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px 12px 32px;
  margin: 4px 0 8px;
  border-left: 2px solid var(--divider);
  background: var(--input-bg, var(--selected-bg));
}

.envSettingsField {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* Bordered marker (left edge) for fields that diverge from the global
 * default — keeps the input contrast intact while still being scannable. */
.envSettingsFieldOverridden {
  border-left: 2px solid var(--accent-primary);
  padding-left: 8px;
  margin-left: -10px;
}

.envSettingsClearBtn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--sidebar-border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  align-self: center;
  flex-shrink: 0;
  font-weight: 500;
}

.envSettingsClearBtn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Per-repo env-provider overrides — list of cards under the Env
 * panel in Repo Settings. Visually distinct from the global Plugins
 * form so users can tell at a glance which scope they're editing. */
.repoEnvProviderList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.repoEnvProviderCard {
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 12px;
  background: var(--input-bg, var(--selected-bg));
}

.repoEnvProviderHeader {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.repoEnvProviderName {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.repoEnvProviderInternal {
  font-size: 11px;
  color: var(--text-dim);
  font-family:
    ui-monospace,
    "SF Mono",
    Menlo,
    monospace;
}

.repoEnvProviderField {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* Bordered marker on the LEFT edge to call out values that diverge
 * from the global default. Subtler than swapping background colors —
 * preserves contrast for the input itself while still being scannable. */
.repoEnvProviderFieldOverridden {
  border-left: 2px solid var(--accent-primary);
  padding-left: 8px;
  margin-left: -10px;
}

.repoEnvProviderClearBtn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--sidebar-border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  align-self: center;
  flex-shrink: 0;
  font-weight: 500;
}

.repoEnvProviderClearBtn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.envErrorRunBtn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--accent-color, var(--text-primary));
  background: var(--accent-bg);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  font-weight: 500;
}

.envErrorRunBtn:hover:not(:disabled) {
  background: var(--hover-bg);
}

.envErrorRunBtn:disabled {
  opacity: 0.5;
  cursor: progress;
}

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

.envErrorDetails summary {
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.envErrorDetails summary:hover {
  color: var(--text-primary);
}

.envErrorPre {
  margin: 6px 0;
  padding: 8px 10px;
  background: var(--selected-bg);
  border-radius: 3px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
}

/* Wraps the inline raw-error <pre> + Copy button for non-trust
   errors in EnvPanel. The Copy affordance was lost when we removed
   the inline ErrorCard during the trust-modal refactor — Copilot
   flagged the workflow regression on the trust-modal PR. Right-align
   the copy button at the bottom of the pre so it doesn't push the
   error text. */
.envErrorDisclosure {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.envErrorDisclosure .envErrorPre {
  width: 100%;
  margin: 6px 0 0 0;
}

/* Group label for MCP source sections */
.mcpGroupLabel {
  padding: 8px 8px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.mcpGroupLabel:not(:first-child) {
  margin-top: 8px;
  border-top: 1px solid var(--divider);
  padding-top: 12px;
}

/* iOS-style toggle switch (matching AttachMenu) */
.mcpToggle {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--text-faint);
  transition: background 0.2s ease;
}

.mcpToggleOn {
  background: var(--accent-primary);
}

.mcpToggle:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.mcpToggleKnob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal);
}

.mcpToggleOn .mcpToggleKnob {
  transform: translateX(16px);
}

/* ── Sound pack browser list (scrollable) ── */

.packBrowserList {
  composes: pluginList;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

/* ── Volume slider ── */

.volumeSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 6px;
  border-radius: 3px;
  background: var(--divider);
  outline: none;
  cursor: pointer;
}

.volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
}

.volumeValue {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--text-dim);
  min-width: 36px;
  text-align: right;
}

/* ── Placeholder ── */

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ── Layout helpers ── */

.iconPickerAnchor {
  position: relative;
}

.iconPlaceholder {
  font-size: var(--fs-lg);
  opacity: 0.4;
}

.overriddenInput {
  opacity: 0.5;
}

.autoRunLabel {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  cursor: pointer;
}

.fieldHintSpaced {
  margin-bottom: var(--space-2);
}

.fieldHintSpacedWide {
  margin-bottom: var(--space-3);
}

.buttonRow {
  margin-top: var(--space-2);
  display: flex;
  gap: var(--space-2);
}

.backendForm {
  margin-top: var(--space-3);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  max-width: 760px;
}

.backendField {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.backendFieldLabel {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
}

.backendField .input,
.backendField .select {
  width: 100%;
  min-width: 0;
}

.backendField .input[readonly] {
  color: var(--text-muted);
  cursor: default;
}

.backendError {
  margin-top: var(--space-2);
  max-width: 760px;
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--accent-error);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-error-hover);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.modelChipList {
  min-height: 34px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1) 0;
}

.modelChip {
  max-width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  color: var(--text-primary);
  background: var(--selected-bg);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

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

.piDiscoveredList {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-1) 0;
  width: 100%;
  max-width: 640px;
}

.piDiscoveredSummary {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 0 6px;
}

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

.piDiscoveredHeader {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 12px;
  text-align: left;
  width: 100%;
  transition: background var(--transition-fast);
}

.piDiscoveredHeader:hover {
  background: var(--hover-bg);
}

.piDiscoveredChevron {
  color: var(--text-dim);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.piDiscoveredChevronOpen {
  transform: rotate(90deg);
}

.piDiscoveredGroupLabel {
  flex: 1;
  font-weight: 500;
}

.piDiscoveredGroupCount {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--hover-bg);
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}

.piDiscoveredChips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: 4px 8px 8px 24px;
}

.backendActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
  max-width: 420px;
}

.usageHeaderPadded {
  padding-top: var(--space-2);
}

.usageMetaDim {
  opacity: 0.7;
  font-weight: 400;
}

.usageDimColor {
  color: var(--text-dim);
}

.selectWide {
  min-width: 130px;
}

.selectDim {
  opacity: 0.5;
}

.gitWarning {
  color: var(--status-stopped);
  margin-top: var(--space-1);
}

.customPrefixInput {
  margin-left: var(--space-6);
  margin-top: var(--space-1);
  max-width: 260px;
}

/* ── Mode-specific block (animated height) ── */

.modeBlock {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 180ms ease;
}

.modeBlockCollapsed {
  grid-template-rows: 0fr;
}

.modeBlockInner {
  overflow: hidden;
}

/* ── Empty-state card (Mode B: sound packs, none installed) ── */

.emptyStateCard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
  margin: 8px 0;
  border-radius: var(--radius-lg);
  background: var(--purple-bg);
  border: 1px solid var(--purple-border);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.emptyStateCard:hover {
  background: var(--purple-bg-hover);
  border-color: var(--purple-border-hover);
}

.emptyStateTitle {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.emptyStateSubtitle {
  color: var(--text-dim);
  font-size: 13px;
}

.emptyStateCta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--purple-btn-bg);
  color: var(--purple-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.15s ease;
}

.emptyStateCta:hover {
  background: var(--purple-btn-bg-hover);
}

/* ── Browse more link (Mode C: text link next to pack dropdown) ── */

.browseMoreLink {
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  transition: color 0.12s ease;
  white-space: nowrap;
}

.browseMoreLink:hover {
  color: var(--text-muted);
}

/* ── De-emphasized event rows (Mode B: no pack installed) ── */

.eventRowDisabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ── Claude flags section ── */

.flagSection {
  margin-top: 18px;
}

.flagSectionHeading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flagSectionCount {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--selected-bg);
  border-radius: 999px;
  padding: 1px 8px;
  letter-spacing: 0;
  text-transform: none;
}

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

.flagBrowseList {
  display: flex;
  flex-direction: column;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
  border: 1px solid var(--divider);
  border-radius: 8px;
}

.flagEmptyState {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  padding: 12px 4px;
}

.flagRow {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 4px 8px;
  border-bottom: 1px solid var(--divider);
  min-height: 36px;
}

.flagRow:last-child {
  border-bottom: none;
}

.flagBrowseList .flagRow {
  border-bottom: 1px solid var(--divider);
}

.flagBrowseList .flagRow:last-child {
  border-bottom: none;
}

.flagCheckbox {
  margin: 0;
}

.flagNameCell {
  display: flex;
  align-items: center;
  gap: 6px;
  /* Allow the grid track to shrink past the name's intrinsic content width
   * so a long flag name (e.g. --exclude-dynamic-system-prompt-sections)
   * can't push the value/action columns out of the row at narrow widths. */
  min-width: 0;
}

.flagName {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flagShort {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 12px;
}

.flagDescription {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.flagDangerBadge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--accent-error-hover);
  color: var(--accent-error);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flagOverriddenBadge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--accent-bg);
  color: var(--accent-primary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flagValueCell {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 180px;
}

.flagInput {
  composes: input;
  font-family: var(--font-mono);
  font-size: 12px;
  width: 100%;
  min-width: 0;
  padding: 4px 8px;
  height: 26px;
}

.flagValueReadonly {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.flagActionCell {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}

.flagIconBtn {
  composes: iconBtn;
  height: 24px;
  min-height: 0;
  padding: 0 8px;
  font-size: 14px;
  line-height: 1;
  min-width: 24px;
}

.flagPromoteBtn {
  composes: iconBtn;
  height: 24px;
  min-height: 0;
  font-size: 11px;
  padding: 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flagErrorBanner {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--accent-error-border);
  border-radius: 8px;
  background: var(--accent-error-bg);
  color: var(--text-primary);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.flagErrorMessage {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
}
