/* Model connections use the full settings content pane. */
.settings-content:has(.models-settings) { padding: 32px 36px 40px; }
.models-settings { color: var(--text-primary); }
.models-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.models-page-head .settings-section-title { margin: 0; font-size: 18px; }
.models-page-head > button, .models-back { display: inline-flex; align-items: center; gap: 6px; }
.models-layout, .models-rail, .models-detail { min-width: 0; }
.models-overview-intro, .models-empty { color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.models-overview-intro { margin: 0 0 24px; max-width: 56ch; }
.models-channel-list { list-style: none; margin: 0; padding: 0; }
.models-channel-list > li { border-bottom: 1px solid var(--border); }
.models-channel {
  display: grid;
  grid-template-columns: 10px 28px minmax(100px, 1fr) auto 16px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 80px;
  padding: 16px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.models-channel:hover, .models-provider-card:hover { background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
.models-channel-copy, .models-provider-copy { min-width: 0; }
.models-channel-name { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 550; }
.models-channel-meta, .models-card-meta, .models-channel-status { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.models-channel-status { max-width: 170px; text-align: right; }
.models-channel-name, .models-channel-meta, .models-priority-row strong { overflow-wrap: anywhere; }
.models-drag { color: var(--text-secondary); letter-spacing: -2px; cursor: grab; }
.models-letter { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: color-mix(in srgb, var(--text-primary) 6%, transparent); font-size: 12px; }
.models-restore { margin-top: 20px; color: var(--text-secondary); }
.models-detail-nav { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 24px; }
.models-back { margin-left: -8px; }
.models-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.models-detail-head > :first-child { width: 32px; height: 32px; flex-shrink: 0; }
.models-detail-head > div { min-width: 0; flex: 1 1 auto; }
.models-detail-head h3, .models-add-head h3 { margin: 0; font-size: 17px; font-weight: 550; }
.models-detail-head p { margin: 6px 0 0; color: var(--text-secondary); font-size: 13px; }
.models-detail-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: auto;
  max-width: min(100%, 360px);
}
.models-network-hint { margin: 0 0 20px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.models-detail-actions, .models-priority-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.models-detail-actions { margin-bottom: 24px; }
.models-detail-actions:empty,
.models-detail-actions:not(:has(*)) { display: none; }
.models-autoswitch { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.models-detail h4 { margin: 24px 0 12px; font-size: 13px; font-weight: 550; }
.models-priority { list-style: none; margin: 0; padding: 0; }
.models-priority-row { display: grid; gap: 12px; padding: 16px 0; border-bottom: 0; }
.models-priority-actions { font-size: 12px; }
.models-pill { display: inline-block; margin-left: 8px; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); font-size: 11px; }
.models-setup-empty { padding: 12px 0; border-top: 1px solid var(--border); }
.models-setup-empty .models-empty { margin: 0 0 16px; }
.models-add-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.models-add-dialog { width: 100%; }
.models-add-search { width: 100%; min-height: 40px; margin: 8px 0 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); color: var(--text-primary); }
.models-add-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; }
.models-add-tabs [aria-pressed="true"] { background: var(--surface-2); font-weight: 550; }
.models-add-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.models-provider-card { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px; border: 0; border-bottom: 1px solid var(--border); border-radius: 6px; background: transparent; color: inherit; text-align: left; }
.models-provider-status { max-width: 140px; text-align: right; overflow-wrap: anywhere; }
.models-provider-card > :first-child { width: 24px; height: 24px; }
.models-provider-copy { display: grid; gap: 3px; overflow-wrap: anywhere; line-height: 1.4; }
.models-provider-copy strong { font-size: 14px; font-weight: 550; }
.models-provider-card.is-disabled { opacity: .6; cursor: not-allowed; }
.models-embedded > .settings-section-title, .models-embedded > .owner-model-intro { display: none; }
.models-embedded .owner-model-form { margin: 0; min-width: 0; }
.models-embedded .owner-model-form .setting-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 16px 18px 14px;
  overflow: visible;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.models-embedded .owner-model-field { display: grid; gap: 7px; min-width: 0; background: transparent; }
.models-embedded .owner-model-field input { min-width: 0; max-width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); }
.models-embedded .owner-model-field small { overflow-wrap: anywhere; }
.owner-model-session-option { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.owner-model-session-option input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--text-primary); }
.owner-model-session-hint { display: block; color: var(--text-secondary); font-size: 11px; line-height: 1.6; }
.models-embedded .owner-model-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  padding: 14px 0 0;
  background: var(--surface-1);
  border-top: 1px solid var(--border);
}
.knowledge-context-list { min-height: min(280px, 35vh); }
@media (max-width: 700px) {
  .settings-content:has(.models-settings) { padding: 24px 20px 32px; }
  .models-channel { grid-template-columns: 8px 24px minmax(0, 1fr) 16px; gap: 8px; }
  .models-channel-status { grid-column: 3; grid-row: 2; text-align: left; max-width: none; }
  .models-channel > :last-child { grid-column: 4; grid-row: 1 / 3; }
  .models-channel { padding: 12px 4px; }
}
@media (max-width: 480px) {
  .models-add-grid { grid-template-columns: minmax(0, 1fr); }
  .models-page-head { gap: 8px; }
}

.models-embedded .subscription-intro { margin: 0 0 20px; color: var(--text-secondary); font-size: 13px; }
.models-embedded .subscription-other { margin-top: 12px; }
.models-embedded .subscription-other > summary,
.models-embedded .subscription-unsupported > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  list-style: none;
  padding: 12px 0;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}
.models-embedded .subscription-other > summary::-webkit-details-marker,
.models-embedded .subscription-unsupported > summary::-webkit-details-marker { display: none; }
.models-embedded .subscription-other > summary::marker,
.models-embedded .subscription-unsupported > summary::marker { content: none; }
.models-embedded .subscription-other > summary > .icon,
.models-embedded .subscription-unsupported > summary > .icon {
  flex: 0 0 auto;
  color: var(--text-secondary);
}
.models-embedded .subscription-other > div { padding-top: 8px; }
