.data-table--models .data-row {
  grid-template-columns: minmax(230px, 1.25fr) minmax(140px, 0.7fr) minmax(170px, 0.8fr) 82px;
}

.data-table--byok .data-row {
  grid-template-columns: minmax(150px, 0.7fr) minmax(120px, 0.45fr) minmax(300px, 1.2fr);
}

.data-table--providers .data-row {
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.2fr) minmax(80px, 0.4fr) 92px;
}

.data-table--routes .data-row {
  grid-template-columns: minmax(230px, 1.1fr) minmax(150px, 0.7fr) minmax(260px, 1.1fr) 82px 92px;
}

.data-table--billing .data-row {
  grid-template-columns: minmax(220px, 1.2fr) minmax(96px, 0.5fr) minmax(90px, 0.45fr) minmax(90px, 0.45fr);
}

.data-table--models .data-row,
.data-table--routes .data-row,
.data-table--providers .data-row,
.data-table--billing .data-row {
  min-height: 64px;
}

.data-table--models .data-row:not(.data-row--head),
.data-table--routes .data-row:not(.data-row--head),
.data-table--providers .data-row:not(.data-row--head),
.data-table--billing .data-row:not(.data-row--head) {
  background: rgba(255, 255, 255, 0.82);
}

.data-table--models .data-row:not(.data-row--head):hover,
.data-table--routes .data-row:not(.data-row--head):hover,
.data-table--providers .data-row:not(.data-row--head):hover,
.data-table--billing .data-row:not(.data-row--head):hover {
  background: rgba(255, 240, 231, 0.74);
}

.model-cell {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.model-cell strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.model-cell code,
.data-table--routes code {
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-cell {
  color: #344253;
  font-size: 14px;
  font-weight: 520;
}

.route-chip {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 560;
  min-height: 28px;
  padding: 5px 9px;
  white-space: nowrap;
}

.route-chip--cloud {
  background: var(--accent-soft);
  border-color: rgba(239, 47, 40, 0.22);
  color: var(--accent);
}

.route-chip--ready {
  background: #edf8f1;
  border-color: #a7d8b8;
  color: #166534;
}

.route-chip--missing {
  background: #fff6ed;
  border-color: #f1c9a4;
  color: #9a4f12;
}

.routing-stack {
  --routing-accent: var(--accent);
  --routing-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  font-family: var(--routing-font);
  gap: 16px;
}

.routing-stack .page-label,
.routing-stack code,
.routing-stack .toggle {
  font-family: var(--font-ui);
}

.routing-stack .surface-header h2 {
  font-family: var(--routing-font);
  font-size: 20px;
  font-weight: 680;
  letter-spacing: 0;
}

.routing-stack .surface-header .muted-text {
  font-family: var(--routing-font);
  line-height: 1.35;
}

.routing-stack .surface {
  margin-bottom: 0;
}

.content-grid--routing {
  align-items: start;
}

.routing-summary {
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.billing-overview {
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.billing-overview div {
  border-right: 1px solid var(--border);
  padding: 16px 18px;
}

.billing-overview div:last-child {
  border-right: 0;
}

.billing-overview span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.billing-overview strong {
  color: var(--ink);
  display: block;
  font-size: 24px;
  font-weight: 680;
  margin-top: 4px;
}

.routing-summary div {
  border-right: 1px solid var(--border);
  padding: 16px 18px;
}

.routing-summary div:last-child {
  border-right: 0;
}

.routing-summary strong {
  display: block;
  font-size: 27px;
  font-weight: 680;
  letter-spacing: 0;
}

.routing-summary span,
.provider-card header span,
.provider-card header small,
.empty-row {
  color: var(--muted);
  font-size: 13px;
}

.provider-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  padding: 18px;
}

.agent-setup-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  padding: 18px;
}

.provider-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.agent-setup-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.agent-setup-card,
.provider-card {
  background: rgba(255, 255, 255, 0.62);
}

.provider-card header {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.agent-setup-card header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.provider-card header strong,
.provider-card header span {
  display: block;
}

.agent-setup-card p {
  color: #344253;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
}

.provider-card header span {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.provider-card header > div,
.agent-setup-card header > strong {
  min-width: 0;
}

.agent-setup-card .button {
  flex: 0 0 auto;
}

.provider-card .field,
.provider-card .stack-form,
.provider-card .form-actions {
  min-width: 0;
}

.provider-card .field input,
.provider-card .button,
.routing-stack aside .field input,
.routing-stack aside .field select,
.routing-stack aside .button {
  max-width: 100%;
  width: 100%;
}

.provider-card .form-actions--between {
  align-items: start;
  flex-wrap: wrap;
  gap: 10px;
}

.provider-card .form-actions--between .button {
  width: auto;
}

.provider-card .form-actions--between .muted-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stack-form--compact {
  padding: 0;
}

.form-actions--between {
  justify-content: space-between;
}

.status-pill {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  padding: 5px 8px;
  white-space: nowrap;
}

.status-pill--on {
  background: var(--success-bg);
  border-color: rgba(22, 138, 66, 0.22);
  color: var(--success);
}

.button--full {
  width: 100%;
}

.empty-row {
  padding: 18px;
}

.form-note {
  color: var(--muted);
  font-size: 13px;
  margin: -4px 18px 18px;
}

.inline-form--key {
  flex: 1 1 auto;
}

.inline-form--key input[type="password"] {
  min-width: 180px;
}

.toggle-form {
  display: inline-flex;
}

.toggle {
  background: var(--border-strong);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 560;
  min-height: 30px;
  min-width: 58px;
  padding: 6px 12px;
  text-align: center;
}

.toggle--on {
  background: #16a34a;
}

@media (max-width: 1120px) {
  .data-table--byok .data-row,
  .data-table--providers .data-row,
  .data-table--billing .data-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .provider-grid,
  .agent-setup-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .data-table--models .data-row,
  .data-table--routes .data-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .routing-summary {
    grid-template-columns: 1fr;
  }

  .billing-overview {
    grid-template-columns: 1fr;
  }

  .routing-summary div,
  .billing-overview div {
    border-bottom: 1px solid var(--border);
    border-right: 0;
  }

  .routing-summary div:last-child,
  .billing-overview div:last-child {
    border-bottom: 0;
  }
}
