.shell:has(.model-settings-page) {
  background: #fcfbf8;
}
.shell:has(.model-settings-page) .topbar {
  background: #fcfbf8;
  border-bottom-color: #dedbd4;
}
.shell:has(.model-settings-page) #main-content {
  padding: 0 clamp(18px,5vw,27px) calc(30px + env(safe-area-inset-bottom));
}
.model-settings-page .intake-head { padding-bottom: 19px; }
.settings-load {
  display: flex; align-items: baseline; gap: 8px; padding-top: 15px;
  font-size: 13px; line-height: 1.6; color: var(--intake-muted);
}
.settings-retry,.settings-key-link {
  color: var(--intake-accent); font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px;
}
.settings-retry { padding: 5px 2px; background: transparent; }
.settings-form { padding-top: 20px; }
.settings-form .settings-providers { margin-bottom: 22px; }
.settings-providers .intake-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 5.25rem), 1fr));
}
.settings-providers .intake-choices span { min-height: 44px; padding-inline: 5px; }
.settings-field { padding: 18px 0; border-top: 1px solid var(--intake-line); }
.settings-key-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.settings-key-link { min-height: 30px; }
.settings-hint,.settings-result { margin-top: 7px; font-size: 13px; line-height: 1.65; color: var(--intake-muted); }
.settings-result { margin: 0 0 11px; overflow-wrap: anywhere; }
.settings-result[data-state=error] { color: #8d3446; }
.settings-result[data-state=success] { color: #37604c; }
.settings-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.6fr); gap: 10px; }
.settings-test {
  min-height: 48px; background: transparent; color: var(--intake-accent);
  border: 1px solid #b9b3c5; border-radius: 7px; font-size: 15px; font-weight: 570;
}
.settings-test:disabled { opacity: .7; }
.model-settings-action {
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;
  gap:1px;line-height:1.35;
}
.health-caption,.settings-health .health-label {display:inline-flex;align-items:center;gap:5px}
.health-caption {font-size:10.5px;color:#605969}
.health-caption::before,.health-label::before {
  content:"";width:6px;height:6px;flex:none;border-radius:50%;background:var(--health-dot,#8b8590);
}
[data-state="connected"] {--health-dot:#427157}
[data-state="checking"] {--health-dot:#8b732b}
[data-state="failed"],[data-state="local-error"] {--health-dot:#ad5147}
.settings-health {
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  padding:17px 0;border-bottom:1px solid var(--intake-line);
}
.settings-health>div {min-width:0}
.health-scope {margin:0 0 5px;font-size:12px;font-weight:600;line-height:1.5;color:var(--intake-muted)}
.settings-health .health-label {color:var(--intake-ink);font-size:15px;font-weight:650}
.health-provider,.health-time,.health-message {font-size:12px;line-height:1.55;color:var(--intake-muted);overflow-wrap:anywhere}
.health-provider {margin-top:3px}
.health-time {display:block;margin-top:2px;font-variant-numeric:tabular-nums}
.health-message {margin-top:4px}
.settings-health:is([data-state="failed"],[data-state="local-error"]) .health-message {color:#8d3446}
.health-recheck {flex:none;min-height:40px;padding:0 5px;color:var(--intake-accent);background:transparent;font-size:13px}
.health-recheck:disabled {opacity:.65}

.settings-form [hidden] {display:none}
.settings-form .settings-source {margin-bottom:0}
.settings-library {margin:0 0 24px;min-width:0;padding:0;border:0}
.settings-library-head {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 14px;margin-bottom:9px}
.settings-library-head .intake-label {margin:0}
.settings-add-shared {
  min-height:44px;padding:8px 16px;border:1px solid #4c395e;border-radius:9px;
  background:#4c395e;color:#fff;font-size:14px;font-weight:600;
}
.settings-add-shared[aria-expanded=true] {background:transparent;color:var(--intake-accent)}
.settings-add-shared:focus-visible {outline:2px solid var(--intake-accent);outline-offset:3px}
.settings-add-actions .settings-test {background:#4c395e;color:#fff;border-color:#4c395e}
.shell .settings-add-actions .intake-submit {background:transparent;color:var(--intake-accent);border:1px solid #b9b3c5}
.settings-model-list {display:grid;min-width:0;border-top:1px solid var(--intake-line)}
.settings-model-option {
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  width:100%;min-width:0;min-height:52px;padding:8px 2px;text-align:left;
  border-bottom:1px solid var(--intake-line);background:transparent;color:var(--intake-ink);
}
.settings-model-option>span:first-child {min-width:0}
.settings-model-option small,.settings-model-option strong {display:block;overflow-wrap:anywhere}
.settings-model-option small {color:var(--intake-muted);font-size:12px;line-height:1.5}
.settings-model-option strong {font-size:15px;line-height:1.45;font-weight:570}
.settings-model-option .model-option-action {flex:none;color:var(--intake-accent);font-size:13px}
.settings-model-option[aria-current] .model-option-action {color:#3e6751}
.settings-model-option:disabled {opacity:1}
.settings-model-option:focus-visible {outline:2px solid var(--intake-accent);outline-offset:-2px}
.switch-result {margin:7px 0 0}
@media (hover:hover) {.settings-model-option:enabled:hover {background:#f1edf3}}
.settings-source-hint {margin:10px 0 18px; overflow-wrap:anywhere}
.settings-forget {margin-top:14px; min-height:40px; background:transparent; color:var(--intake-muted); text-decoration:underline; text-underline-offset:3px}
