/* Table-first catalogs, with configuration isolated in an editing drawer. */
body.routing-catalog-layout { min-width: 0; }
.model-routing-page.model-config-target.active,
.model-routing-page.channel-management-target.active { display: block; width: 100%; min-width: 0; padding: 0; }
.model-routing-page .model-routing-page-head { margin: 0 0 20px; min-height: 44px; }
.model-routing-page .model-routing-page-head h3 { font-size: 22px; line-height: 1.35; margin-bottom: 5px; }
.model-routing-page .model-routing-page-head p { font-size: 12px; }
.model-routing-page .model-routing-head-actions { flex-wrap: wrap; }
.model-routing-page .model-routing-switch { border: 0; padding: 0; background: none; }
.model-routing-page .model-config-workspace,
.model-routing-page .channel-management-workspace { display: block; min-width: 0; }
.model-routing-page .routing-surface { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; min-width: 0; }
.model-routing-page .routing-surface-head { display: none; }
.routing-catalog-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, .8fr) 310px 32px; align-items: center; gap: 12px; padding: 0 0 16px; }
.model-routing-page .routing-search { display: flex; margin: 0; min-width: 0; width: 100%; padding: 0 10px; height: 36px; border-radius: 4px; }
.model-routing-page .routing-search input { min-width: 0; width: 100%; height: 34px; padding: 0; font-size: 12px; }
.model-routing-page .routing-search input { border: 0; background: transparent; outline: none; box-shadow: none; }
.model-routing-page .routing-search:focus-within { border-color: #49dfb4; }
.routing-catalog-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.routing-catalog-toolbar select { min-width: 0; width: 100%; height: 36px; padding: 0 8px; font-size: 12px; border-radius: 4px; }
.routing-catalog-sort { display: flex; gap: 8px; align-items: center; }
.model-routing-page .icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px; padding: 6px; border-radius: 4px; }
.model-routing-page .icon-button svg, .catalog-open svg { width: 16px; height: 16px; }
.model-routing-page .model-list-table,
.model-routing-page .channel-catalog-table { max-height: none; min-height: 190px; overflow-x: auto; overflow-y: hidden; border: 1px solid #294048; border-radius: 4px; background: #0b181d; }
.model-routing-page .model-list-body,
.model-routing-page .channel-card-list { display: block; overflow: visible; border: 0; background: none; }
.model-routing-page .model-list-head,
.model-routing-page .model-list-row { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(160px, .8fr) minmax(370px, 2fr) 64px 20px; gap: 14px; align-items: center; min-width: 920px; }
.model-routing-page .channel-catalog-head,
.model-routing-page .channel-card { display: grid; grid-template-columns: minmax(180px, 1.4fr) 80px 70px 70px 70px minmax(110px, 1fr) 64px 20px; gap: 16px; align-items: center; min-width: 940px; }
.model-routing-page .model-list-head,
.model-routing-page .channel-catalog-head { position: sticky; top: 0; z-index: 1; min-height: 42px; padding: 10px 18px; border-bottom: 1px solid #294048; background: #122329; color: #96b1bb; font-size: 12px; font-weight: 500; }
.model-routing-page .model-list-row,
.model-routing-page .channel-card { position: relative; width: 100%; min-height: 68px; margin: 0; padding: 12px 18px; text-align: left; border: 0; border-bottom: 1px solid #203139; border-radius: 0; box-shadow: none; background: transparent; font-weight: 400; color: #d4e4e9; }
.model-routing-page .model-list-row.active,
.model-routing-page .channel-card.active { background: #0f2528; }
.model-routing-page .model-list-row:hover,
.model-routing-page .channel-card:hover { background: #183238; }
.model-routing-page .model-list-row.active::before { display: none; }
.model-routing-page .model-name-cell,
.model-routing-page .channel-card-main { display: grid; gap: 4px; min-width: 0; }
.model-routing-page .model-name-cell strong,
.model-routing-page .model-name-cell small,
.model-routing-page .channel-card-main > strong,
.model-routing-page .channel-card-main > small { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.model-routing-page .model-name-cell strong,
.model-routing-page .channel-card-main > strong { font-size: 13px; line-height: 20px; }
.model-routing-page .model-name-cell small,
.model-routing-page .channel-card-main > small { font-size: 11px; line-height: 17px; color: #8faab6; }
.model-routing-page .status-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; color: #a6bdc5; }
.model-routing-page .status-dot { flex: 0 0 6px; width: 6px; height: 6px; margin: 0; box-shadow: none; }
.catalog-capabilities { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.model-routing-page .catalog-capabilities .capability-chip { min-height: 16px; padding: 0; border: 0; border-radius: 0; color: #a0bac4; background: none; font-size: 11px; }
.catalog-numeric, .catalog-type { font-size: 12px; font-variant-numeric: tabular-nums; }
.model-routing-page .model-list-row { min-height: 58px; padding-top: 9px; padding-bottom: 9px; }
.catalog-route-list { display: grid; min-width: 0; gap: 4px; }
.catalog-route-pair { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; min-width: 0; font-size: 12px; line-height: 1.5; }
.catalog-route-channel, .catalog-route-model { min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.model-routing-page .model-list-head > span:nth-child(3) { color: #e3edf2; font-weight: 600; }
.catalog-route-channel { color: #72efd3; font-weight: 500; }
.catalog-route-model { color: #f0f6fa; }
.catalog-route-arrow { color: #a6c2cf; }
.catalog-route-weight { color: #dbe9f1; font-size: 12px; font-weight: 500; white-space: nowrap; }
.catalog-route-role { color: #b9dcf2; font-size: 11px; white-space: nowrap; }
.catalog-route-status { color: #e1b970; font-size: 11px; white-space: nowrap; }
.catalog-health { display: grid; gap: 4px; min-width: 0; }
.catalog-health small { color: #e1b970; font-size: 11px; }
.catalog-health .status-dot.failed { background: #ff747b; }
.catalog-health .status-dot.warn { background: #e1b970; }
.catalog-refresh:disabled { opacity: .5; cursor: wait; }
.catalog-warning { color: #f0be65; }
.catalog-open { color: #61cfb1; }
.routing-catalog-pager { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 8px 2px; font-size: 12px; color: #9bb4bf; }
.routing-catalog-pager > div { display: flex; align-items: center; gap: 12px; }
.routing-catalog-empty { padding: 52px 14px; text-align: center; color: #9bb4bf; }
.routing-drawer-open { overflow: hidden; }
.routing-editor-backdrop { position: fixed; inset: 0; z-index: 15; background: #0008; }
.model-routing-page .model-editor-surface,
.model-routing-page .channel-detail-surface { position: fixed; inset: 0 0 0 auto; z-index: 16; display: flex; flex-direction: column; gap: 18px; width: min(1040px, 94vw); max-width: 100%; padding: 0 24px 28px; border-left: 1px solid #36515c; overflow-y: auto; overflow-x: hidden; min-height: 0; background: #0c1a20; box-shadow: -16px 0 50px #0005; scrollbar-gutter: stable; }
.routing-drawer-open .toast { z-index: 30; }
.routing-drawer-bar { display: flex; align-items: center; justify-content: space-between; min-height: 58px; position: sticky; top: 0; z-index: 3; background: #0c1a20; border-bottom: 1px solid #294048; color: #9bb4bf; flex-shrink: 0; }
.model-routing-page .routing-editor-title { align-items: center; flex-wrap: wrap; flex-shrink: 0; min-height: 35px; padding-bottom: 12px; border-bottom: 1px solid #294048; }
.model-routing-page .routing-editor-title strong { font-size: 18px; overflow-wrap: anywhere; }
.model-routing-page .routing-editor-title small { flex: 1; text-align: right; }
.model-routing-page .model-editor-tabs,
.model-routing-page .channel-tabs { display: flex; flex-wrap: wrap; flex-shrink: 0; align-items: center; gap: 0 18px; padding: 0; margin: 0; border: 0; border-bottom: 1px solid #294048; border-radius: 0; background: none; }
.model-routing-page .model-editor-tabs button,
.model-routing-page .channel-tabs button { flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 0; font-size: 12px; font-weight: 500; background: none; color: #9bb4bf; }
.model-routing-page .model-editor-tabs button.active,
.model-routing-page .channel-tabs button.active { border-bottom-color: #49dfb4; color: #49dfb4; background: none; }
.model-routing-page .channel-tabs button::after { display: none; }
.model-routing-page .target-config-block,
.model-routing-page .channel-linked-routes,
.model-routing-page .channel-health-events { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.model-routing-page .target-block-head { align-items: center; margin-bottom: 18px; }
.model-routing-page .target-block-head h4 { font-size: 14px; }
.model-routing-page .target-block-head > span { display: none; }
.model-routing-page .target-form-grid,
.model-routing-page .capability-promise-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.model-routing-page .target-form-grid { margin-bottom: 18px; }
.model-routing-page input,
.model-routing-page textarea,
.model-routing-page select { max-width: 100%; border-radius: 4px; }
.model-routing-page input[readonly] { color: #90a9b2; background: #101d22; }
.model-routing-page .target-sticky-actions { position: static; display: flex; gap: 8px; justify-content: flex-end; padding: 14px 0 0; margin-top: 16px; border-top: 1px solid #294048; background: none; }
.routing-draft-status { margin-right: auto; align-self: center; color: #f3c76c; font-size: 12px; }
.model-routing-page .route-inline-form { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px; margin-bottom: 16px; border-radius: 4px; background: #101f25; }
.model-routing-page .route-test-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.model-routing-page .target-route-head,
.model-routing-page .target-route-row { grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) minmax(164px, 1.3fr) minmax(84px, .8fr) 52px 80px; gap: 8px; font-size: 12px; }
.model-routing-page .route-weight-control { display: grid; grid-template-columns: minmax(64px, 1fr) 72px; gap: 8px; align-items: center; }
.model-routing-page .route-weight-control input[type="range"] { width: 100%; min-width: 0; height: 28px; padding: 0; margin: 0; accent-color: #4ae2bd; cursor: pointer; background: transparent; border: 0; }
.model-routing-page .route-weight-control input[type="number"] { width: 72px; min-width: 0; height: 30px; padding: 4px 5px; color: #f0f6fa; font-size: 12px; font-variant-numeric: tabular-nums; }
.model-routing-page .route-weight-control[aria-busy="true"] { opacity: .6; }
.model-routing-page .linked-route-head,
.model-routing-page .linked-route-row { grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) 65px 65px 52px 80px; gap: 8px; font-size: 12px; }
.model-routing-page .target-route-row > span,
.model-routing-page .linked-route-row > span { min-width: 0; overflow-wrap: anywhere; }
.model-routing-page .route-row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.model-routing-page .route-row-actions button { padding: 4px 6px; font-size: 11px; }
.model-routing-page .channel-detail-hero { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 0 0 16px; }
.model-routing-page .channel-detail-hero > div:first-child { flex: 1; min-width: 160px; }
.model-routing-page .channel-detail-hero h3 { font-size: 18px; margin: 0 0 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.model-routing-page .channel-detail-hero p { flex-wrap: wrap; font-size: 12px; overflow-wrap: anywhere; }
.model-routing-page .channel-detail-hero .channel-meta-grid { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.model-routing-page .channel-meta-grid span { padding-left: 12px; }
.routing-mapping-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.routing-mapping-toolbar .routing-search { max-width: 330px; }
.routing-mapping-toolbar button { flex-shrink: 0; }
.routing-health-metadata { margin: 0 0 18px; }
.model-routing-page .channel-health-actions { justify-content: flex-start; margin-bottom: 18px; }
.model-routing-page .channel-health-events { margin-top: 18px; }
.model-routing-page .channel-detail-grid { display: block; }
.model-routing-page .channel-detail-grid:has(> [hidden]):not(:has(> :not([hidden]))) { display: none; }
.model-routing-page .routing-advanced { grid-column: 1 / -1; border-top: 1px solid #294048; padding-top: 14px; }
.routing-advanced summary { cursor: pointer; color: #c4d8df; font-size: 13px; }
.model-routing-page .routing-advanced > div { margin-top: 14px; }
.model-routing-page [hidden] { display: none !important; }
.model-routing-page button:focus-visible { outline: 2px solid #49dfb4; outline-offset: -2px; }
.model-routing-page .face-processing-model-card { display: block; border: 0; border-bottom: 1px solid #294048; border-radius: 0; background: none; padding: 14px 0; }
.model-routing-page .face-processing-model-card-head { cursor: pointer; display: list-item; list-style: disclosure-closed inside; }
.model-routing-page details[open] > .face-processing-model-card-head { list-style-type: disclosure-open; margin-bottom: 14px; }
.model-routing-page .face-processing-model-card-head small { margin-left: 12px; }
.model-routing-page .face-processing-model-list { display: block; max-height: 420px; overflow: auto; }
.model-routing-page .face-processing-model-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.model-routing-page [data-routing-select-search] { margin-bottom: 4px; height: 30px; font-size: 12px; }

@media (max-width: 1100px) {
  .routing-catalog-toolbar { grid-template-columns: minmax(160px, 1fr) minmax(230px, 1fr); }
  .routing-catalog-sort { grid-column: 1 / -1; grid-row: 2; justify-content: flex-end; padding-right: 44px; }
  .catalog-refresh { grid-column: 2; grid-row: 2; justify-self: end; }
  .routing-catalog-sort select { width: 180px; }
}
@media (max-width: 760px) {
  body.routing-catalog-layout .ops-shell { grid-template-columns: 52px minmax(0, 1fr); }
  body.routing-catalog-layout .global-topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  body.routing-catalog-layout .top-status { display: none; }
  body.routing-catalog-layout .product-title strong { font-size: 11px; }
  body.routing-catalog-layout .side-nav { padding: 10px 4px; }
  body.routing-catalog-layout .side-nav .menu-item { justify-content: center; padding: 10px; }
  body.routing-catalog-layout .side-nav .menu-item span,
  body.routing-catalog-layout .menu-group-label { display: none; }
  body.routing-catalog-layout .ops-main { padding: 14px 10px; }
  body.routing-catalog-layout .toast { max-width: calc(100vw - 36px); }
  .model-routing-page .model-routing-page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .model-routing-page .model-routing-head-actions { white-space: normal; }
  .routing-catalog-toolbar { grid-template-columns: minmax(0, 1fr); }
  .routing-catalog-sort { grid-row: 3; }
  .catalog-refresh { grid-column: 1; grid-row: 3; }
  .model-routing-page .model-editor-surface,
  .model-routing-page .channel-detail-surface { width: 100%; padding: 0 14px 22px; }
  .model-routing-page .routing-editor-title small { flex: 1 0 100%; text-align: left; }
  .model-routing-page .channel-detail-hero .channel-meta-grid { width: 100%; }
  .model-routing-page .target-form-grid,
  .model-routing-page .capability-promise-grid,
  .model-routing-page .route-inline-form,
  .model-routing-page .route-test-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-routing-page .target-route-table,
  .model-routing-page #channelMappingsList { overflow-x: auto; }
  .model-routing-page .target-route-head,
  .model-routing-page .target-route-row,
  .model-routing-page .linked-route-head,
  .model-routing-page .linked-route-row { min-width: 680px; }
}
