/* Compact routing summary; details remain available without crowding the overview. */
.smart-routing { container-type: inline-size; padding: 20px 24px 0; margin-bottom: 22px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; color: var(--t1); }
.smart-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.smart-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.smart-title-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: var(--bg); border: 1px solid var(--divider); color: var(--primary-800); }
.smart-routing svg { width: 16px; height: 16px; flex-shrink: 0; }
.smart-title-icon svg { width: 23px; height: 23px; }
.smart-heading h3 { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.4; letter-spacing: -.02em; }
.smart-heading p { margin: 3px 0 0; color: var(--t2); font-size: 12px; line-height: 1.5; }
.smart-copy { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 12px; background: var(--card); color: var(--t2); border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.smart-copy code { color: var(--primary-800); font: 12px ui-monospace, Consolas, monospace; white-space: nowrap; }
.smart-copy:hover { background: var(--bg); border-color: var(--primary-800); }
.smart-recommendation { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 1fr); align-items: center; gap: 24px; margin: 18px 0 16px; padding: 18px; background: var(--bg); border: 1px solid var(--divider); border-radius: 12px; }
.smart-model { min-width: 0; }
.smart-model-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; color: var(--t2); line-height: 1.5; }
.smart-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--primary-800); }
.smart-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.smart-provider-count { font-size: 12px; }
.smart-route-path { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--t2); font-size: 12px; }
.smart-route-path svg { color: var(--primary-800); }
.smart-model > strong { display: block; margin-top: 5px; font-size: 19px; font-weight: 650; line-height: 1.4; letter-spacing: -.025em; overflow-wrap: anywhere; text-wrap: balance; }
.smart-quality { display: inline-block; margin-top: 9px; padding: 2px 7px; border: 1px solid var(--border); border-radius: 5px; font-size: 11px; line-height: 1.5; color: var(--t2); background: var(--card); }
.smart-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 12px; min-width: 0; padding-left: 20px; border-left: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.smart-stat { min-width: 0; }
.smart-stat-label { display: flex; align-items: center; gap: 5px; color: var(--t2); font-size: 11px; line-height: 1.5; white-space: nowrap; }
.smart-stat-label svg { width: 14px; height: 14px; }
.smart-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px; margin-top: 9px; }
.smart-value strong { color: var(--t1); font-size: 25px; font-weight: 600; line-height: 1.2; letter-spacing: -.04em; }
.smart-value > span { color: var(--t2); font-size: 11px; }
.smart-stat:not(:last-child) .smart-value { display: grid; gap: 3px; }
.smart-value.is-empty strong { color: var(--t2); font-size: 16px; line-height: 1.8; letter-spacing: 0; }
.smart-stat-hint { display: block; color: var(--t2); font-size: 11px; line-height: 1.6; margin-top: 5px; }
.smart-stat-hint > span { display: inline-block; margin-right: 5px; white-space: nowrap; }
.smart-stat progress { display: block; width: 100%; height: 4px; margin-top: 8px; border: 0; border-radius: 9px; overflow: hidden; accent-color: var(--primary-800); background: var(--border); }
.smart-stat progress::-webkit-progress-bar { background: var(--border); border-radius: 9px; }
.smart-stat progress::-webkit-progress-value { background: var(--primary-800); border-radius: 9px; }
.smart-stat progress::-moz-progress-bar { background: var(--primary-800); border-radius: 9px; }
.smart-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.smart-strategy, .smart-run-actions { display: flex; align-items: center; gap: 8px; }
.smart-strategy { flex-wrap: wrap; }
.smart-strategy label { font-size: 12px; color: var(--t2); margin-right: 2px; }
.smart-routing select, .smart-routing input:not([type=checkbox]) { font: inherit; font-size: 13px; color: var(--t1); background: var(--card); border: 1px solid var(--border); border-radius: 8px; min-height: 44px; padding: 8px 10px; max-width: 100%; min-width: 0; }
.smart-actions .btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 44px; font-size: 12px; padding-inline: 12px; white-space: nowrap; }
.smart-actions .smart-save { border-color: transparent; color: var(--primary-800); }
.smart-actions .smart-test { background: var(--primary-800); border-color: var(--primary-800); color: var(--card); }
.smart-actions .smart-test:hover:not(:disabled) { filter: brightness(.93); }
.smart-note { color: var(--t2); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.smart-routing #smartConsumption { margin: 5px 0 12px; text-align: right; font-size: 11px; line-height: 1.6; }
.smart-disclosures { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 0 20px; border-top: 1px solid var(--divider); }
.smart-advanced, .smart-details { min-width: 0; }
.smart-advanced[open], .smart-details[open] { grid-column: 1 / -1; }
.smart-advanced > summary, .smart-details > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 12px 0; list-style: none; color: var(--t2); font-size: 12px; line-height: 1.6; cursor: pointer; }
.smart-advanced > summary::-webkit-details-marker, .smart-details > summary::-webkit-details-marker { display: none; }
.smart-advanced > summary::after, .smart-details > summary::after { content: ''; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 3px; }
.smart-advanced[open] > summary::after, .smart-details[open] > summary::after { transform: rotate(225deg) translate(-1px, -1px); }
.smart-detail-count { padding: 1px 6px; border-radius: 4px; background: var(--bg); color: var(--t2); font-size: 11px; }
.smart-details-body { display: grid; gap: 8px; padding: 4px 0 16px; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.smart-details-body p { margin: 0; }
.smart-details-body p > span { display: inline-block; min-width: 76px; color: var(--t2); }
.smart-advanced-body { display: grid; gap: 16px; padding: 4px 0 20px; }
.smart-routing fieldset { border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; min-width: 0; }
.smart-routing legend { padding-inline: 5px; font-size: 13px; overflow-wrap: anywhere; }
.smart-checks, .smart-limits { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.smart-checks label, .smart-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; overflow-wrap: anywhere; }
.smart-routing input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary-800); }
.smart-limits > label:not(.smart-check), .smart-quality-fields label { display: grid; gap: 8px; font-size: 13px; }
.smart-limits input[type=number] { width: 160px; }
.smart-quality-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.smart-quality-fields { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 12px; }
.smart-quality-fields input { width: 100%; }
.smart-warnings, .smart-error { color: var(--t1); background: var(--bg); padding: 12px 18px; border-left: 3px solid var(--primary-800); border-radius: 4px; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.smart-warnings { margin: 0; padding-left: 32px; }
.smart-error { margin: 0 0 16px; }
.smart-feedback { margin: 0 0 16px; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.smart-feedback:empty { display: none; }
.smart-provider-mode { display: flex; padding: 3px; margin-top: 18px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); align-self: flex-start; }
.smart-provider-mode button { min-height: 44px; padding: 8px 14px; color: var(--t2); background: transparent; border: 0; border-radius: 6px; font: inherit; font-size: 12px; cursor: pointer; }
.smart-provider-mode button[aria-pressed=true] { color: var(--primary-800); background: var(--card); font-weight: 600; }
.smart-routing button:disabled, .smart-provider-mode button:disabled { opacity: .5; cursor: not-allowed; }
.smart-routing button:active:not(:disabled), .smart-provider-mode button:active:not(:disabled) { opacity: .7; }
.smart-routing :focus-visible, .smart-provider-mode :focus-visible { outline: 2px solid var(--primary-800); outline-offset: 3px; }
.smart-provider-mode + .proxy-model { margin-top: 16px; }
@container (max-width: 520px) {
  .smart-recommendation { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; }
  .smart-metrics { border-left: 0; border-top: 1px solid var(--border); padding: 14px 0 0; }
  .smart-model > strong { font-size: 18px; }
  .smart-route-path { margin-top: 8px; }
}
@container (max-width: 390px) {
  .smart-actions { gap: 10px; }
  .smart-strategy { width: 100%; }
  .smart-strategy select { flex: 1; }
  .smart-run-actions { width: 100%; }
  .smart-run-actions .btn { flex: 1; }
  .smart-routing #smartConsumption { text-align: center; }
  .smart-copy { gap: 6px; padding-inline: 8px; }
  .smart-title { gap: 8px; }
  .smart-title-icon { width: 34px; height: 34px; border-radius: 9px; }
  .smart-heading { gap: 8px; }
  .smart-heading h3 { font-size: 16px; }
  .smart-heading p { font-size: 11px; }
  .smart-metrics { gap: 10px; }
  .smart-stat-label svg { display: none; }
  .smart-value strong { font-size: 23px; }
  .smart-value.is-empty strong { font-size: 15px; }
  .smart-quality-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) { .smart-routing { padding: 16px 16px 0; } }
@media (prefers-reduced-motion: reduce) { .smart-routing *, .smart-provider-mode * { transition: none !important; } }
