.settings-page {
  position: fixed;
  inset: calc(var(--app-titlebar-height, 0px) + 1px) calc(var(--ai-panel-width, 334px) + var(--ai-resize-width, 1px)) 28px 48px;
  z-index: 80;
  min-width: 0;
  height: calc(100vh - 28px - var(--app-titlebar-height, 0px) - 1px);
  overflow: auto;
  scrollbar-gutter: stable;
  padding: 22px 24px 28px;
  background: var(--app-bg);
}

.settings-page-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto 18px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}

.settings-nav {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 5px;
  padding: 8px;
  background: var(--chrome);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.settings-nav-item {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 0 9px;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
}

.settings-nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-nav-item:hover,
.settings-nav-item.active {
  color: var(--text);
  background: var(--surface);
}

.settings-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.settings-page h1 {
  font-size: 24px;
}

.settings-page h2,
.settings-dialog h2 {
  font-size: 18px;
}

.settings-card {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.settings-section-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.settings-section-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.settings-section-title > div {
  min-width: 0;
}

.settings-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.settings-section-icon svg,
.settings-section-icon .connection-icon-shell,
.settings-section-icon .connection-icon-image {
  width: 20px;
  height: 20px;
}

.settings-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.settings-status {
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.settings-status.success {
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid var(--green);
}

.settings-status.error {
  color: var(--red);
  background: #fee2e2;
  border: 1px solid var(--red);
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.settings-summary-grid.compact {
  grid-template-columns: minmax(0, 1fr);
}

.settings-summary-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.settings-summary-item span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-summary-item strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.settings-summary-item.planned-setting {
  align-content: start;
}

.settings-summary-item.planned-setting small {
  min-width: 0;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.about-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 14px;
  color: var(--text);
  background:
    linear-gradient(135deg, var(--accent-soft), var(--surface) 62%),
    var(--surface-muted);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}

.about-hero div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.about-hero strong {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.about-hero span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.about-hero svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.settings-placeholder-list {
  display: grid;
  gap: 8px;
}

.settings-reset-layout {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  padding: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.settings-reset-layout div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-reset-layout strong {
  color: var(--text);
  font-size: 14px;
}

.settings-reset-layout span {
  color: var(--text-muted);
  font-size: 13px;
}

.settings-placeholder-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 10px 11px;
  color: var(--text);
  text-align: left;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: default;
}

.settings-placeholder-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.settings-placeholder-item strong {
  color: var(--text-faint);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.settings-section {
  display: grid;
  gap: 11px;
}

.diagnostics-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.diagnostics-actions .toolbar-button {
  flex: 0 0 auto;
}

.diagnostics-status {
  margin: 0;
  padding: 9px 10px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.settings-section-heading {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.settings-toggles {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.settings-toggles label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.settings-toggles input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
}

.form-grid.general-settings-grid {
  grid-template-columns: minmax(220px, 420px);
}

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

.settings-data-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.settings-reset-dialog .dialog-actions .secondary-button,
.settings-reset-dialog .dialog-actions .toolbar-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.settings-data-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.form-grid.appearance-font-grid {
  grid-template-columns: minmax(280px, 560px);
}

.color-scheme-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.color-scheme-preview-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.color-scheme-preview-swatches {
  display: flex;
  gap: 6px;
  min-height: 48px;
}

.color-scheme-preview-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  border-radius: 5px;
  border: 1px solid var(--border);
}

.color-scheme-preview-swatch-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  mix-blend-mode: difference;
  color: #ffffff;
  padding: 2px;
}

.form-grid.ai-provider-selector-grid {
  grid-template-columns: minmax(220px, 340px);
}

.form-grid.ssh-default-path-grid {
  grid-template-columns: minmax(0, 1fr);
}

.form-grid.ssh-default-basic-grid {
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 160px) minmax(150px, 190px);
}

.ai-provider-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-grid.three-columns {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 128px;
}

.form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-row {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.checkbox-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.form-error {
  margin: 0;
  color: var(--red);
  font-size: 13px;
  line-height: 1.4;
}

.tree-status {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}


.settings-subsection {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.settings-fieldset {
  margin: 0;
  min-inline-size: 0;
  padding: 14px 10px 10px;
}

.settings-fieldset legend {
  padding: 0 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.settings-collapsible-legend-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.settings-collapsible-legend-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-collapsible-legend-button svg {
  flex: 0 0 auto;
}

.settings-collapsible-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.settings-collapsible-content[hidden] {
  display: none;
}

.settings-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.settings-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.settings-list-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-list-row strong,
.settings-list-row span,
.settings-list-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-list-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.settings-list-row span,
.settings-list-row small {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.settings-list-row-heading {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-list-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.settings-list-actions .secondary-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.settings-list-actions .secondary-button.danger {
  color: var(--red);
  border-color: var(--red);
}

.settings-credential-edit {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.settings-empty-state {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.settings-fieldset.ai-tool-settings {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.settings-fieldset.ai-tool-settings legend {
  padding: 0 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.search-provider-subsection {
  display: grid;
  gap: 8px;
  margin: 4px 0 0 44px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.search-provider-subsection label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

.search-provider-subsection label input,
.search-provider-subsection label select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 13px;
}

.settings-help-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.settings-toggle-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.settings-toggle-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  min-width: 0;
  padding: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.settings-toggle-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.toggle-switch {
  flex: 0 0 auto;
  cursor: pointer;
  outline: none;
  margin-top: 1px;
  margin-left: auto;
  order: 1;
}

.toggle-switch:focus-visible {
  border-radius: 12px;
  box-shadow: 0 0 0 2px var(--accent-ring, var(--accent));
}

.toggle-switch-track {
  display: block;
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 20px;
  background: var(--toggle-off-bg, var(--border));
  transition: background 0.2s ease;
}

.toggle-switch-on .toggle-switch-track {
  background: var(--accent);
}

.toggle-switch-knob {
  display: block;
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.toggle-switch-on .toggle-switch-knob {
  transform: translateX(16px);
}

.settings-toggle-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-toggle-row strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.settings-toggle-row small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.settings-page {
  padding: 24px 26px 34px;
  color: var(--text);
  background: var(--surface);
}

.settings-page-header {
  max-width: 1290px;
  margin: 0 auto 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.settings-page h1 {
  color: var(--text);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.2;
}

.settings-page .panel-label {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.settings-layout {
  grid-template-columns: 240px minmax(0, 1020px);
  gap: 30px;
  max-width: 1290px;
  align-items: start;
}

.settings-nav {
  top: 22px;
  gap: 4px;
  padding: 12px;
  background: var(--surface-muted);
  border: 0;
  border-radius: 14px;
}

.settings-nav-item {
  min-height: 44px;
  padding: 0 14px;
  gap: 12px;
  color: var(--text-muted);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.settings-nav-item svg {
  width: 20px;
  height: 20px;
}

.settings-nav-item:hover {
  color: var(--text);
  background: var(--chrome-strong);
}

.assistant-panel {
  grid-row: 1;
}

.settings-nav-item.active {
  color: #ffffff;
  background: var(--accent);
}

.settings-content {
  gap: 26px;
  align-content: start;
}

.settings-card {
  display: grid;
  gap: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.settings-section {
  gap: 28px;
}

.settings-section-header {
  min-height: 28px;
}

.settings-section-title {
  display: block;
}

.settings-page h2,
.settings-dialog h2,
.settings-section-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.25;
}

.settings-header-actions .toolbar-button,
.settings-page-header .toolbar-button,
.settings-header-actions .toolbar-button,
.settings-header-actions a.toolbar-button {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 650;
}

.settings-subsection {
  display: grid;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.settings-fieldset,
.settings-fieldset.ai-tool-settings {
  display: grid;
  gap: 10px;
  margin: 0;
  min-inline-size: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.settings-fieldset legend,
.settings-fieldset.ai-tool-settings legend,
.settings-section-heading {
  padding: 0;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
}

.settings-fieldset > div:has(> .field-hint:only-child),
.settings-fieldset .settings-collapsible-content > div:has(> .field-hint:only-child),
.settings-fieldset > .settings-section-title:has(.field-hint) {
  display: none;
}

.settings-help-text {
  display: none;
}

.form-grid,
.form-grid.general-settings-grid,
.form-grid.appearance-font-grid,
.form-grid.ai-provider-selector-grid,
.form-grid.ssh-default-path-grid,
.form-grid.ssh-default-basic-grid,
.form-grid.three-columns,
.form-grid.two-columns,
.ai-provider-fields,
.settings-toggle-list,
.settings-list,
.settings-summary-grid,
.settings-summary-grid.compact,
.settings-data-actions,
.settings-reset-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  padding: 12px 18px;
  background: var(--surface-muted);
  border: 0;
  border-radius: 14px;
}

.ai-provider-fields {
  margin-top: 0;
}

.settings-api-key-link {
  align-items: center;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  gap: 3px;
  margin-left: 6px;
  padding: 0;
  text-decoration: underline;
  vertical-align: baseline;
}

.settings-api-key-link:hover {
  opacity: 0.8;
}

.settings-api-key-link:disabled {
  color: var(--text-faint);
  cursor: default;
  opacity: 0.7;
}

.settings-copilot-connection {
  display: grid;
  gap: 10px;
  margin: 0 18px 12px;
}

.settings-copilot-code {
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 13px;
}

.settings-copilot-code small {
  color: var(--text-muted);
}

.settings-copilot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-data-actions {
  grid-template-columns: repeat(auto-fit, minmax(170px, max-content));
  gap: 10px;
  align-items: center;
}

.settings-section label:not(.settings-toggle-row),
.settings-list-row,
.settings-summary-item,
.settings-reset-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  min-width: 0;
  min-height: 54px;
  padding: 11px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.settings-section label:not(.settings-toggle-row):last-child,
.settings-list-row:last-child,
.settings-summary-item:last-child,
.settings-reset-layout {
  border-bottom: 0;
}

.settings-section label:not(.settings-toggle-row) > span,
.settings-list-row strong,
.settings-summary-item span,
.settings-reset-layout strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 520;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: 0;
}

.settings-section label:not(.settings-toggle-row) > span svg {
  display: none;
}

.settings-section label:not(.settings-toggle-row) > input,
.settings-section label:not(.settings-toggle-row) > select,
.settings-section label:not(.settings-toggle-row) > textarea,
.settings-section label:not(.settings-toggle-row) > .input-with-button,
.settings-section label:not(.settings-toggle-row) > datalist {
  grid-column: 2;
}

.settings-section label.ssh-key-path-setting {
  grid-template-columns: minmax(140px, 200px) minmax(360px, 1fr);
}

.settings-section label:not(.settings-toggle-row):has(> .field-hint) > input,
.settings-section label:not(.settings-toggle-row):has(> .field-hint) > select,
.settings-section label:not(.settings-toggle-row):has(> .field-hint) > textarea,
.settings-section label:not(.settings-toggle-row):has(> .field-hint) > .input-with-button,
.settings-section label:not(.settings-toggle-row):has(> small) > input,
.settings-section label:not(.settings-toggle-row):has(> small) > select,
.settings-section label:not(.settings-toggle-row):has(> small) > textarea,
.settings-section label:not(.settings-toggle-row):has(> small) > .input-with-button {
  grid-row: 1 / span 2;
  align-self: center;
}

.settings-section label:not(.settings-toggle-row) > .field-hint,
.settings-section label:not(.settings-toggle-row) > small,
.settings-list-row span,
.settings-list-row small,
.settings-summary-item.planned-setting small,
.settings-reset-layout span {
  grid-column: 1;
  max-width: 640px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 450;
  line-height: 1.35;
  white-space: normal;
}

.settings-list-row > div,
.settings-list-row-heading {
  gap: 4px;
}

.settings-list-row > .settings-credential-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.settings-credential-summary strong,
.settings-credential-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-credential-summary span {
  flex: 0 0 auto;
}

.settings-icon-danger-button {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 0;
  color: var(--red);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.settings-icon-danger-button:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
}

.settings-icon-danger-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.settings-credential-group {
  display: grid;
  gap: 0;
}

.settings-credential-group + .settings-credential-group {
  border-top: 1px solid var(--border);
}

.settings-credential-group h3 {
  margin: 0;
  padding: 12px 0 2px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-list-row > .settings-list-actions,
.settings-list-row > button,
.settings-summary-item strong,
.settings-reset-layout > button {
  grid-column: 2;
  justify-self: end;
}

.settings-summary-item strong {
  max-width: 100%;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-align: right;
}

.settings-placeholder-list,
.settings-placeholder-item {
  background: var(--surface-muted);
}

.settings-section input,
.settings-section select,
.settings-dialog input,
.settings-dialog select {
  height: 36px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 450;
}

.settings-section input:focus,
.settings-section select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-with-button,
.input-with-button.ssh-key-input-actions {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.input-with-button.ssh-key-input-actions {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.input-with-button .toolbar-button,
.settings-data-actions .secondary-button,
.settings-list-actions .secondary-button,
.settings-reset-layout .toolbar-button {
  height: 36px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
}

.settings-toggle-list {
  padding: 0 18px;
}

.settings-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  min-height: 54px;
  padding: 10px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

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

.settings-toggle-row span {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  gap: 4px;
}

.settings-toggle-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 520;
  line-height: 1.3;
}

.settings-toggle-row .built-in-mcp-dangerous-label {
  color: var(--red);
}

.settings-toggle-row small {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 450;
  line-height: 1.35;
}

.toggle-switch {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  margin: 0;
  order: initial;
}

.toggle-switch-track {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--toggle-off-bg, #c7c8cc);
}

.toggle-switch-on .toggle-switch-track {
  background: var(--accent);
}

.toggle-switch-knob {
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
}

.toggle-switch-on .toggle-switch-knob {
  transform: translateX(20px);
}

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

.color-scheme-preview {
  margin-top: -2px;
  padding: 12px 18px;
  background: var(--surface-muted);
  border-radius: 14px;
}

.color-scheme-preview-label {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.color-scheme-preview-swatches {
  min-height: 46px;
}

.settings-status {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 550;
}

.about-hero {
  padding: 18px;
  background: var(--surface-muted);
  border: 0;
  border-radius: 14px;
  box-shadow: none;
}

.about-hero strong {
  font-size: 24px;
  font-weight: 750;
}

.about-hero span {
  font-size: 16px;
  font-weight: 450;
}

.settings-reset-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 14px 18px;
  background: var(--surface-muted);
  border: 0;
  border-radius: 14px;
}

.settings-reset-layout > div {
  display: grid;
  gap: 4px;
}

.import-bookmark-tree {
  display: grid;
  gap: 4px;
  max-height: 260px;
  padding: 10px;
  overflow: auto;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.import-bookmark-node {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.import-bookmark-label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 3px 4px;
  color: var(--text);
  font-size: 12px;
  border-radius: 5px;
}

.import-bookmark-label:hover {
  background: var(--surface);
}

.import-bookmark-label span {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-bookmark-label small {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-bookmark-children {
  display: grid;
  gap: 4px;
  margin-left: 20px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

/* Remote MCP server management (Settings -> AI -> Remote MCP servers) */
.mcp-servers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.mcp-server-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.mcp-server-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mcp-server-row-name {
  font-weight: 650;
  font-size: 13px;
}

.mcp-server-row-url {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcp-server-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.mcp-server-row-error {
  font-size: 12px;
  color: #b91c1c;
  margin-top: 2px;
  word-break: break-word;
}

.mcp-server-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mcp-status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.mcp-status-badge-ok {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.32);
}

.mcp-status-badge-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.32);
}

.mcp-status-badge-neutral {
  background: var(--surface-muted);
  color: var(--muted);
  border-color: var(--border);
}

.mcp-server-tools-count,
.mcp-server-auth-badge {
  font-size: 11px;
  color: var(--muted);
}

.mcp-server-auth-badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

/* Assistant Skills management (Settings -> AI -> Assistant Skills) */
.assistant-skills-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.assistant-skill-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.assistant-skill-row[data-invalid="true"] {
  border-color: rgba(185, 28, 28, 0.35);
}

.assistant-skill-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.assistant-skill-row-name {
  font-weight: 650;
  font-size: 13px;
}

.assistant-skill-row-description,
.assistant-skill-row-path {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-skill-row[data-invalid="true"] .assistant-skill-row-description {
  color: #b91c1c;
  white-space: normal;
}

.assistant-skill-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistant-skill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.settings-mcp-dialog {
  max-width: 560px;
  width: 100%;
}

.settings-mcp-dialog .connection-dialog-header.compact {
  position: relative;
  padding-right: 44px;
}

.mcp-dialog-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.mcp-dialog-close-button:hover,
.mcp-dialog-close-button:focus-visible {
  color: var(--text);
  background: var(--surface-muted);
  outline: none;
}

.mcp-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.mcp-dialog-textarea {
  width: 100%;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  min-height: 180px;
}

.mcp-dialog-headers {
  font-size: 12px;
}

.mcp-dialog-headers ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mcp-dialog-headers code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--surface-muted);
  padding: 1px 4px;
  border-radius: 3px;
}

.built-in-mcp-config-dialog {
  width: min(1280px, calc(100vw - 28px));
  max-width: min(1280px, calc(100vw - 28px));
}

.built-in-mcp-config-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 2px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.built-in-mcp-config-tab {
  min-width: 54px;
  height: 26px;
  padding: 0 10px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.built-in-mcp-config-tab:hover,
.built-in-mcp-config-tab:focus-visible {
  color: var(--text);
  outline: none;
}

.built-in-mcp-config-tab[aria-selected="true"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.built-in-mcp-config-snippet {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  font: 12px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  white-space: pre-wrap;
}

.built-in-mcp-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.built-in-mcp-config-locations {
  display: grid;
  gap: 8px;
  font-size: 11px;
}

.built-in-mcp-config-table-wrap {
  overflow-x: hidden;
  overflow-y: visible;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.built-in-mcp-config-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.built-in-mcp-config-table th,
.built-in-mcp-config-table td {
  padding: 6px 7px;
  color: var(--text);
  text-align: left;
  vertical-align: top;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.built-in-mcp-config-table th:last-child,
.built-in-mcp-config-table td:last-child {
  border-right: 0;
}

.built-in-mcp-config-table tr:last-child th,
.built-in-mcp-config-table tr:last-child td {
  border-bottom: 0;
}

.built-in-mcp-config-table thead th {
  background: var(--surface-muted);
  font-weight: 900;
}

.built-in-mcp-config-table tbody th {
  font-weight: 850;
}

.built-in-mcp-config-table th:nth-child(1),
.built-in-mcp-config-table td:nth-child(1) {
  width: 160px;
}

.built-in-mcp-config-table th:nth-child(2),
.built-in-mcp-config-table td:nth-child(2) {
  width: 82px;
}

.built-in-mcp-config-table td {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.built-in-mcp-config-table code {
  display: block;
  color: var(--text);
  font: 11px/1.42 ui-monospace, "SF Mono", Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.built-in-mcp-config-table td:nth-child(2) {
  white-space: normal;
  text-align: left;
}
