.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: 13px;
  font-weight: 600;
}

.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);
}

/* ─────────────── Theme color-scheme grid (Appearance ▸ Theme) ───────────────
   Each tile renders a generated mini-app preview from the scheme's tokens.
   The mini-app uses scoped --m-* / --t-* variables set inline per card, so it
   never inherits or leaks the live app color scheme. */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 16px;
  padding: 7px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font: inherit;
}
.theme-card .mini-frame {
  position: relative;
  border-radius: 12px;
  padding: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px #dededf, 0 4px 12px -6px rgba(15, 22, 38, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.theme-card:hover .mini-frame {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px #d2d2d4, 0 10px 22px -8px rgba(15, 22, 38, 0.32);
}
.theme-card.selected .mini-frame {
  box-shadow:
    0 0 0 2px #0a84ff,
    0 0 0 5px rgba(10, 132, 255, 0.22),
    0 8px 20px -8px rgba(10, 132, 255, 0.4);
}

.theme-check {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0a84ff;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(10, 132, 255, 0.5), 0 0 0 2px #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.theme-card.selected .theme-check {
  opacity: 1;
  transform: scale(1);
}
.theme-check svg {
  width: 12px;
  height: 12px;
}

.theme-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}
.theme-radio {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  flex: none;
  border: 1.6px solid #c2c2c8;
  position: relative;
}
.theme-card.selected .theme-radio {
  border-color: #0a84ff;
}
.theme-card.selected .theme-radio::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: #0a84ff;
}
.theme-name {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text);
}

/* ── Generated mini-app preview ──
   Terminal palette is theme-independent (a terminal stays dark). */
.mini {
  --t-bg: var(--m-term);
  --t-fg: #c3cdda;
  --t-dim: #6b7a8d;
  --t-green: #46d07e;
  --t-blue: #5aa9ff;
  --t-yellow: #e6c06a;

  aspect-ratio: 16 / 10;
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--m-bg);
  position: relative;
}

.wc-trophy {
  position: absolute;
  right: 7%;
  bottom: 8%;
  width: 18%;
  max-width: 28px;
  min-width: 18px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.32));
  opacity: 0.94;
  pointer-events: none;
}

.mini-tb {
  height: 9.5%;
  min-height: 13px;
  background: var(--m-chrome);
  border-bottom: 1px solid var(--m-hair);
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  flex: none;
}
.mini-tb i { width: 5px; height: 5px; border-radius: 50%; }
.mini-tb i:nth-child(1) { background: #ff5f57; }
.mini-tb i:nth-child(2) { background: #febc2e; }
.mini-tb i:nth-child(3) { background: #28c840; }

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

.mini-rail {
  width: 14%;
  max-width: 22px;
  background: var(--m-nav);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12%;
  padding: 9% 0;
  flex: none;
}
.mini-rail b {
  width: 52%;
  aspect-ratio: 1;
  border-radius: 26%;
  background: color-mix(in srgb, var(--m-navtext) 34%, transparent);
}
.mini-rail b.on { background: var(--m-navaccent); }

.mini-side {
  width: 34%;
  background: var(--m-surface);
  border-right: 1px solid var(--m-border);
  display: flex;
  flex-direction: column;
  gap: 7%;
  padding: 8% 7%;
  min-width: 0;
}
.mini-side .shead {
  height: 11px;
  border-radius: 4px;
  background: var(--m-surfmuted);
  border: 1px solid var(--m-hair);
  flex: none;
}
.mini-side .srows { display: flex; flex-direction: column; gap: 12%; flex: 1; }
.srow {
  display: flex;
  align-items: center;
  gap: 9%;
  height: 9px;
  padding: 0 5%;
  border-radius: 4px;
  flex: none;
}
.srow i { width: 7px; height: 7px; border-radius: 2px; background: var(--m-folder); flex: none; }
.srow b { height: 3px; border-radius: 2px; background: var(--m-textfaint); flex: 1; }
.srow.dim i { background: color-mix(in srgb, var(--m-textfaint) 70%, transparent); }
.srow.sel { background: var(--m-accentsoft); }
.srow.sel i { background: var(--m-accent); }
.srow.sel b { background: var(--m-accent); }

.mini-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mini-tabs {
  height: 14px;
  flex: none;
  background: var(--m-chrome);
  border-bottom: 1px solid var(--m-border);
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 0 4px;
}
.mtab {
  height: 11px;
  border-radius: 4px 4px 0 0;
  padding: 0 5px;
  display: flex;
  align-items: center;
}
.mtab b { width: 16px; height: 3px; border-radius: 2px; background: var(--m-textfaint); }
.mtab.act { background: var(--m-surface); box-shadow: inset 0 1px 0 var(--m-accent); }
.mtab.act b { background: var(--m-text); width: 20px; }
.mtab-add {
  margin-left: auto;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--m-accent);
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
}
.mtab-add::before, .mtab-add::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 1px;
}
.mtab-add::before { width: 5px; height: 1.4px; }
.mtab-add::after { width: 1.4px; height: 5px; }

.mini-term {
  flex: 1;
  background: var(--t-bg);
  padding: 8% 7%;
  display: flex;
  flex-direction: column;
  gap: 11%;
  justify-content: flex-start;
  min-height: 0;
}
.tline { display: flex; align-items: center; gap: 4px; height: 3px; }
.tseg { height: 3px; border-radius: 2px; }
.tcursor { width: 5px; height: 6px; border-radius: 1px; background: var(--m-accent); margin-left: 1px; }

/* Match-OS auto split tile: light bottom layer, dark top-left triangle. */
.mini.auto .mini-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
.mini.auto .mini-layer.top { clip-path: polygon(0 0, 100% 0, 0 100%); }
.mini-auto-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(20, 24, 34, 0.78);
  padding: 3px 7px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

@media (max-width: 900px) {
  .theme-grid { --cols: 3; }
}
@media (max-width: 640px) {
  .theme-grid { --cols: 2; }
}

.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-url-credential-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

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

.settings-url-credential-row > strong,
.settings-url-credential-address {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-url-credential-row > strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 520;
}

.settings-url-credential-address {
  color: var(--text-muted);
  font-size: 13px;
}

.settings-url-credential-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

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

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

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

.settings-url-credential-context strong {
  color: var(--text);
  font-size: 13px;
}

.settings-url-credential-context span {
  color: var(--text-muted);
  font-size: 12px;
}

.settings-url-saved-fields {
  display: grid;
  max-height: 210px;
  overflow-y: auto;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.settings-url-saved-field {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.4fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.settings-url-saved-field:last-child {
  border-bottom: 0;
}

.settings-url-saved-field > code {
  display: flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-family: var(--font-mono, "SF Mono", ui-monospace, Menlo, monospace);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-url-saved-field > code > span {
  flex: none;
  color: var(--text-faint);
  font-size: 10px;
}

.settings-url-saved-field-control {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.settings-url-saved-field-control .kk-inp {
  min-width: 0;
}

.settings-url-field-icon-button {
  display: inline-flex;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.settings-url-field-icon-button:hover:not(:disabled) {
  color: var(--text);
  background: var(--hover);
}

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

.settings-url-field-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.settings-url-saved-field > input[type="checkbox"] {
  justify-self: end;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.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: 22px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.settings-section {
  gap: 22px;
}

.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: 15px;
  font-weight: 700;
  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 {
  margin-block-end: 12px;
  padding: 0;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 680;
  letter-spacing: 0.01em;
  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-copilot-cli-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.settings-copilot-cli-status > small {
  flex-basis: 100%;
}

.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: 46px;
  padding: 9px 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.terminal-color-scheme-setting > .terminal-scheme-picker {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.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;
}

.app-update-summary-grid {
  gap: 0;
}

.app-update-summary-grid .settings-summary-item {
  min-height: 46px;
  padding: 9px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.app-update-summary-grid .settings-summary-item:first-child {
  border-radius: 0;
}

.app-update-summary-grid .settings-summary-item + .settings-summary-item {
  border-top: 0;
}

.app-update-summary-grid .settings-summary-item:last-child {
  border-bottom: 0;
  border-radius: 0;
}

.app-update-check-row {
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 20px;
}

.app-update-summary-grid .app-update-check-row > strong {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.settings-section .settings-toggle-row.app-update-auto-checks,
.app-update-auto-checks span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.settings-section .settings-toggle-row.app-update-auto-checks {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.app-update-auto-checks strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 520;
  line-height: 1.25;
}

.app-update-auto-checks small {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 450;
  line-height: 1.35;
}

.app-update-check-controls {
  grid-column: 3;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.app-update-check-controls .secondary-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.app-update-auto-checks .toggle-switch {
  margin-top: 0;
  margin-left: 0;
}

.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-dialog-error {
  color: var(--red);
}

.settings-dialog-warning {
  color: var(--amber);
}

.settings-security-note {
  border-left: 3px solid var(--amber);
  padding-left: 10px;
  color: var(--text);
}

.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);
}

.terminal-scheme-picker {
  position: relative;
  min-width: 0;
}

.terminal-scheme-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--app-ui-font-family);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.terminal-scheme-picker-trigger:focus-visible {
  border-color: currentColor;
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.terminal-scheme-picker-trigger svg {
  flex: 0 0 auto;
  transition: transform 120ms ease;
}

.terminal-scheme-picker.open .terminal-scheme-picker-trigger svg {
  transform: rotate(180deg);
}

.terminal-scheme-picker-list {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 80;
  display: grid;
  max-height: min(420px, 60vh);
  padding: 4px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.terminal-scheme-picker-option {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--app-ui-font-family);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.terminal-scheme-picker-option:hover,
.terminal-scheme-picker-option:focus-visible {
  filter: brightness(1.14);
  box-shadow: inset 0 0 0 2px currentColor;
  outline: none;
}

.terminal-scheme-picker-option svg {
  flex: 0 0 auto;
}

.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;
}

/* Font picker: refresh button on the left, dropdown in the middle, an optional
   trailing action (e.g. open fonts folder) on the right. */
.input-with-button.font-input-with-button {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.input-with-button.font-input-with-button .toolbar-button .spin {
  animation: settings-font-refresh-spin 0.8s linear infinite;
}

@keyframes settings-font-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.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: 14px;
  align-items: start;
  min-height: 46px;
  padding: 9px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

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

.settings-custom-shell-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  min-height: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

/*
 * Merge consecutive Settings row blocks inside one subsection so related
 * controls read as one grouped card divided by rules instead of separate cards.
 */
.settings-fieldset > :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid, .settings-data-actions, .settings-reset-layout):has(+ :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid, .settings-data-actions, .settings-reset-layout, .settings-merged-block)),
.settings-collapsible-content > :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid, .settings-data-actions, .settings-reset-layout):has(+ :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid, .settings-data-actions, .settings-reset-layout, .settings-merged-block)) {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.settings-fieldset > :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid, .settings-data-actions, .settings-reset-layout) + :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid, .settings-data-actions, .settings-reset-layout, .settings-merged-block),
.settings-collapsible-content > :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid, .settings-data-actions, .settings-reset-layout) + :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid, .settings-data-actions, .settings-reset-layout, .settings-merged-block) {
  margin-top: -10px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.settings-fieldset > :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid):has(+ :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid, .settings-data-actions, .settings-reset-layout, .settings-merged-block)) :is(label:not(.settings-toggle-row):last-child, .settings-toggle-row:last-child, .settings-list-row:last-child, .settings-summary-item:last-child),
.settings-collapsible-content > :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid):has(+ :is(.form-grid, .ai-provider-fields, .settings-toggle-list, .settings-list, .settings-summary-grid, .settings-data-actions, .settings-reset-layout, .settings-merged-block)) :is(label:not(.settings-toggle-row):last-child, .settings-toggle-row:last-child, .settings-list-row:last-child, .settings-summary-item:last-child) {
  border-bottom: 1px solid var(--border);
}

.settings-toggle-list:has(+ .settings-merged-block) {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.settings-toggle-list:has(+ .settings-merged-block) .settings-toggle-row:last-child {
  border-bottom: 1px solid var(--border);
}

.settings-merged-block {
  margin-top: -10px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

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

.settings-toggle-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 530;
  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: 12px;
  font-weight: 450;
  line-height: 1.35;
}

.settings-custom-shell-fields {
  display: grid;
  grid-template-columns: minmax(140px, 0.4fr) minmax(220px, 1fr);
  gap: 12px;
}

.settings-section .settings-custom-shell-fields label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
  min-height: 0;
  padding: 0;
  border: 0;
}

.settings-section .settings-custom-shell-fields label > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 520;
}

.settings-section .settings-custom-shell-fields label > input {
  grid-column: 1;
}

.settings-toggle-actions {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.settings-toggle-actions .secondary-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 36px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

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

.settings-toggle-actions .toggle-switch {
  grid-column: auto;
  grid-row: auto;
}

.activity-rail-order-row {
  align-items: center;
  cursor: grab;
}

.activity-rail-order-row.dragging {
  opacity: 0.55;
}

.activity-rail-order-grip {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.settings-toggle-row .activity-rail-order-main {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.activity-rail-order-icon {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.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;
}

.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-custom-skills-control {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.assistant-custom-skills-main {
  flex: 1;
  min-width: 0;
}

.assistant-custom-skills-title {
  font-weight: 650;
  font-size: 13px;
}

.assistant-custom-skills-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.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%;
}

.mcp-dialog-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.mcp-dialog-close-button:hover,
.mcp-dialog-close-button:focus-visible {
  color: var(--text);
  background: var(--border);
  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;
}

.settings-backdrop {
  position: fixed;
  inset: var(--app-titlebar-height, 0px) 0 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 10px;
  background: rgba(18, 24, 38, 0.34);
  backdrop-filter: blur(1px);
}

.settings-popup.settings-page {
  position: relative;
  inset: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1060px, calc(100vw - 96px));
  height: 80vh;
  max-height: 80vh;
  overflow: hidden;
  padding: 13px 2px 14px 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.settings-popup .settings-page-header {
  position: static;
  z-index: 1;
  max-width: none;
  margin: 0 0 12px;
  padding: 0 220px 10px 0;
  background: var(--surface);
}

.settings-page-actions {
  position: absolute;
  top: 6px;
  right: 48px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 36px;
  max-width: min(420px, calc(100% - 112px));
}

.settings-unsaved-label {
  min-width: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-page-save-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-color: transparent;
  box-shadow: none;
}

.settings-page-save-button svg {
  color: var(--accent);
}

.settings-popup .connection-dialog-close {
  position: absolute;
  top: 6px;
  right: 4px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--text-muted);
  background: var(--surface-muted);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.settings-popup .connection-dialog-close:hover,
.settings-popup .connection-dialog-close:focus-visible {
  color: var(--text);
  background: var(--border);
}

.settings-popup .settings-layout {
  width: 100%;
  grid-template-columns: 198px minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  justify-content: start;
  max-width: none;
  min-height: 0;
  overflow: hidden;
}

.settings-popup .settings-nav {
  position: relative;
  top: auto;
  align-self: start;
  width: 198px;
  gap: 1px;
  overflow: visible;
  padding: 6px;
}

.settings-popup .settings-nav-item {
  min-height: 34px;
  gap: 10px;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 510;
}

/* macOS-style colored icon chip per nav section. */
.settings-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: #fff;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.18);
}

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

.settings-nav-item .module-header__tile--compact {
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.18);
}

.settings-nav-item .module-header__tile--compact svg {
  width: 14px;
  height: 14px;
  color: white;
}

.settings-nav-item.active .settings-nav-icon {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.settings-nav-item.active .module-header__tile--compact {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.activity-rail-order-row .module-header__tile--compact,
.activity-rail-order-row .module-header__tile--compact svg {
  color: white;
}

.settings-popup .settings-content {
  width: 100%;
  align-self: stretch;
  justify-self: start;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.settings-section-panel[hidden] {
  display: none;
}

.settings-unsaved-dialog {
  width: min(420px, calc(100vw - 48px));
}

.settings-unsaved-dialog .connection-dialog-body p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

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

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

.settings-unsaved-dialog .danger-button {
  color: var(--red);
}

.settings-popup .settings-card {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 860px) {
  .settings-backdrop {
    inset: var(--app-titlebar-height, 0px) 0 0;
    padding: 14px;
  }

  .settings-popup.settings-page {
    width: calc(100vw - 76px);
    height: calc(100vh - var(--app-titlebar-height, 0px) - 28px);
    max-height: calc(100vh - var(--app-titlebar-height, 0px) - 28px);
  }

  .settings-popup .settings-page-header {
    padding-right: 176px;
  }

  .settings-page-actions {
    max-width: min(320px, calc(100% - 92px));
  }

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

  .settings-popup .settings-nav {
    position: relative;
    top: auto;
    width: auto;
  }

  .app-update-check-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-update-check-controls {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}
