.routing-editor { --routing-border: #e2e8f0; position: relative; min-width: 0; color: #334155; }
.routing-editor [data-routing-announcement] { top: 0; left: 0; }
.routing-editor-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.routing-editor-toolbar strong { color: #0f172a; font-size: 13px; }
.routing-editor-toolbar p { max-width: 510px; margin: 7px 0 0; color: #64748b; font-size: 12px; line-height: 1.6; }
.routing-editor-tools { display: flex; flex-wrap: wrap; flex-shrink: 0; gap: 7px; }
.routing-editor-tools button { min-height: 32px; padding: 6px 10px; border: 1px solid var(--routing-border); border-radius: 7px; background: #fff; color: #475569; font-size: 11px; cursor: pointer; }
.routing-editor-tools button[aria-pressed="true"] { border-color: #7dd3fc; background: #f0f9ff; color: #0369a1; }
.routing-editor-tools button:disabled { opacity: .45; cursor: default; }
.routing-editor-overview { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0 4px; font-size: 10px; color: #64748b; }
.routing-editor-overview b { color: #0f172a; font-size: 12px; }
.routing-change-state { margin-left: auto; color: #64748b; }
.routing-change-state.dirty { color: #b45309; }
.routing-change-state.dirty::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #f59e0b; }
.routing-tier-stack { position: relative; }
.routing-drop-zone { display: grid; place-items: center; height: 30px; margin: 0 2px; border: 1px dashed transparent; border-radius: 7px; color: #64748b; font-size: 10px; transition: background .15s, border-color .15s; }
.routing-drop-zone::before { content: '↓'; color: #94a3b8; font-size: 15px; }
.routing-drop-zone:first-child::before, .routing-drop-zone:last-child::before { content: ''; }
.routing-drop-zone span { display: none; }
.routing-dragging .routing-drop-zone { border-color: #cbd5e1; background: #f8fafc; }
.routing-dragging .routing-drop-zone::before { display: none; }
.routing-dragging .routing-drop-zone span { display: inline; }
.routing-tier { overflow: hidden; border: 1px solid var(--routing-border); border-radius: 12px; background: #f8fafc; transition: border-color .15s, box-shadow .15s; }
.routing-tier-heading { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f1f5f9; }
.routing-tier:first-of-type .routing-tier-heading { background: #eff8ff; }
.routing-tier-heading > div { display: grid; gap: 3px; min-width: 0; }
.routing-tier-heading strong { color: #0f172a; font-size: 12px; }
.routing-tier-heading small { color: #64748b; font-size: 10px; }
.routing-tier-index { display: grid; flex: 0 0 26px; place-items: center; height: 26px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #475569; font-size: 11px; font-weight: 700; }
.routing-tier-priority { margin-left: auto; color: #64748b; font: 10px 'Roboto Mono', monospace; }
.routing-grip, .routing-arrow { display: grid; flex: 0 0 26px; place-items: center; width: 26px; height: 30px; padding: 3px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #94a3b8; cursor: pointer; }
.routing-grip { cursor: grab; touch-action: none; user-select: none; }
.routing-grip svg { width: 13px; height: 17px; pointer-events: none; }
.routing-grip:hover, .routing-arrow:hover { border-color: #cbd5e1; background: #fff; color: #0369a1; }
.routing-arrow:disabled { opacity: .3; cursor: default; }
.routing-tier-share { display: flex; height: 5px; background: #e2e8f0; }
.routing-tier-share > span { display: block; min-width: 0; background: var(--route-color); transition: width .1s; }
.routing-tier-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,275px),1fr)); gap: 12px; padding: 14px; }
.routing-card { min-width: 0; padding: 12px; border: 1px solid var(--routing-border); border-top: 3px solid var(--route-color); border-radius: 9px; background: #fff; box-shadow: 0 1px 2px #0f172a05; }
.routing-card.inactive { border-top-color: #cbd5e1; background: #fcfcfd; }
.routing-card-heading { display: flex; gap: 7px; align-items: center; }
.routing-card-name { display: grid; gap: 4px; min-width: 0; flex: 1; }
.routing-card-name strong, .routing-card-name code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.routing-card-name strong { color: #1e293b; font-size: 12px; }
.routing-card-name code { color: #64748b; font: 9px 'Roboto Mono',monospace; }
dialog .routing-card-enabled, .routing-card-enabled { display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 5px; color: #64748b; font-size: 10px; font-weight: 400; }
dialog .routing-card-enabled input, .routing-card-enabled input { width: 14px; height: 14px; min-height: 14px; margin: 0; padding: 0; accent-color: #0284c7; }
.routing-card-unavailable { margin: 9px 0 0; color: #b45309; font-size: 10px; }
.routing-weight-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; color: #64748b; font-size: 10px; }
.routing-weight-heading strong { color: var(--route-color); font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.routing-card.inactive .routing-weight-heading strong { color: #94a3b8; }
dialog input.routing-weight-slider, input.routing-weight-slider { display: block; width: 100%; height: 25px; min-height: 25px; margin: 7px 0 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; accent-color: var(--route-color); cursor: ew-resize; }
.routing-weight-scale { display: flex; justify-content: space-between; color: #94a3b8; font-size: 9px; }
.routing-card-tier { margin-top: 13px; }
dialog .routing-card-tier label, .routing-card-tier label { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; color: #64748b; font-size: 10px; font-weight: 400; }
dialog .routing-card-tier select, .routing-card-tier select { width: auto; max-width: 65%; min-width: 0; min-height: 29px; padding: 4px 8px; border: 1px solid #e2e8f0; border-radius: 5px; background-color: #f8fafc; color: #475569; font-size: 10px; }
.routing-exact-values { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 11px; padding-top: 11px; border-top: 1px dashed #e2e8f0; }
.routing-exact-values[hidden] { display: none; }
.routing-manage-button { width: 100%; margin-top: 12px; padding: 8px 0 0; border: 0; border-top: 1px solid #e2e8f0; background: transparent; color: #0369a1; text-align: left; font-size: 11px; cursor: pointer; }
dialog .routing-exact-values label, .routing-exact-values label { display: grid; gap: 4px; color: #64748b; font-size: 10px; font-weight: 400; }
dialog .routing-exact-values input, .routing-exact-values input { width: 100%; min-width: 0; min-height: 30px; padding: 5px 7px; font-size: 11px; }
.routing-share-note { margin: 12px 0 0; color: #64748b; font-size: 10px; line-height: 1.6; }
.routing-editor-empty { padding: 20px; color: #64748b; text-align: center; font-size: 12px; }
.routing-drop-zone.routing-drop-active { border-color: #0284c7; background: #e0f2fe; color: #0369a1; }
.routing-tier.routing-drop-active { border-color: #0284c7; box-shadow: 0 0 0 3px #0284c71a; }
.routing-drag-ghost { position: fixed; z-index: 2147483647; max-width: 260px; overflow: hidden; padding: 11px 17px; border: 1px solid #7dd3fc; border-radius: 8px; background: #fff; color: #0369a1; box-shadow: 0 8px 24px #0f172a26; pointer-events: none; font: 600 12px system-ui,sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.routing-editor :is(button,input,select):focus-visible { outline: 2px solid #0284c7; outline-offset: 3px; }
.model-auto-routing-list.routing-editor { overflow: visible; border: 0; border-radius: 0; }
.supplier-routing-panel { margin: 14px 0 24px; padding: 18px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
#provider-dialog :is(#save-provider-button,#save-supplier-routing,#provider-error,#supplier-routing-error)[hidden] { display: none; }
.supplier-routing-panel[hidden] { display: none; }
.supplier-channel-details > summary { padding: 8px 0 14px; color: #64748b; font-size: 12px; cursor: pointer; }
@media (max-width: 650px) {
  .routing-editor-toolbar { flex-direction: column; gap: 10px; }
  .routing-editor-tools { width: 100%; }
  .routing-editor-tools button { flex: 1; }
  .routing-tier-heading { gap: 7px; padding: 10px; }
  .routing-tier-heading small { max-width: 170px; line-height: 1.5; }
  .routing-tier-cards { padding: 10px; gap: 10px; }
  .routing-tier-priority { display: none; }
  .routing-tier-heading > .routing-grip { flex-basis: 22px; }
  .routing-tier-index { flex-basis: 22px; height: 22px; }
  .routing-change-state { width: 100%; margin-left: 0; }
  .supplier-routing-panel { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .routing-tier, .routing-drop-zone, .routing-tier-share > span { transition: none; }
}
