/* The route canvas extends Sylkchat's existing palette; color encodes responsibility. */
.routing-view { overflow:auto; min-height:0; padding:24px 28px 32px; }
.routing-heading { display:flex; justify-content:space-between; align-items:center; gap:18px; }
.routing-heading h1 { margin-bottom:6px; font-size:26px; }
.routing-heading p { margin:0; color:var(--muted); }
.routing-heading-actions { display:flex; align-items:center; gap:12px; }
.routing-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:18px 0 12px; color:var(--muted); font-size:11px; }
.routing-workspace { display:grid; grid-template-columns:minmax(0,1fr) 330px; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:var(--paper); min-height:700px; }
.routing-canvas-shell { min-width:0; display:flex; flex-direction:column; }
.routing-toolbar { min-height:54px; display:flex; justify-content:space-between; gap:10px; align-items:center; padding:8px 12px; border-bottom:1px solid var(--line); }
.routing-display { display:flex; padding:2px; border-radius:7px; background:var(--wash); }
.routing-display [aria-pressed=true] { background:var(--paper); box-shadow:0 1px 3px rgb(0 0 0 / .3); }
#routing-zoom-tools { display:flex; align-items:center; gap:2px; }
#routing-zoom { min-width:48px; text-align:center; font-size:11px; color:var(--muted); }
.routing-viewport { height:700px; overflow:auto; position:relative; background-color:var(--wash); background-image:radial-gradient(var(--line) 1px, transparent 1px); background-size:20px 20px; cursor:grab; overscroll-behavior:contain; }
.routing-viewport.dragging { cursor:grabbing; user-select:none; }
#routing-space { position:relative; }
#routing-canvas { position:absolute; top:0; left:0; transform-origin:0 0; }
#routing-edges { position:absolute; inset:0; pointer-events:none; overflow:visible; }
.routing-wire path { fill:none; stroke:var(--line-strong); stroke-width:1.5; }
.routing-wire circle { fill:var(--line-strong); }
.routing-wire.optional path { stroke-dasharray:5 5; }
.routing-wire.inactive { opacity:.3; }
.routing-wire.selected path { stroke:var(--violet); stroke-width:2.5; }
.routing-wire.selected circle { fill:var(--violet); }
.routing-node.button { position:absolute; width:216px; height:154px; display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:9px; padding:13px 15px; white-space:normal; text-align:left; background:var(--paper); border:1px solid var(--line); border-top:3px solid var(--node-accent); border-radius:10px; box-shadow:0 3px 9px rgb(0 0 0 / .3); cursor:pointer; }
.routing-node.button[aria-pressed=true] { outline:2px solid var(--node-accent); outline-offset:3px; box-shadow:0 6px 16px rgb(0 0 0 / .3); }
.routing-node-cap { display:flex; gap:7px; align-items:center; color:var(--node-accent); font-size:11px; font-weight:500; }
.routing-node-icon { display:inline-flex; justify-content:center; align-items:center; width:23px; height:23px; background:color-mix(in srgb,var(--node-accent) 9%, var(--paper)); border-radius:5px; font-size:17px; }
.routing-node-title { font-size:13px; letter-spacing:-.015em; color:var(--ink); line-height:1.3; }
.routing-model { font-size:10px; overflow-wrap:anywhere; color:var(--muted); font-weight:500; line-height:1.35; }
.routing-node-status { font-size:10px; color:var(--muted); margin-top:auto; font-weight:400; }
.routing-node.inactive, .routing-list-item.inactive { background:var(--wash); border-style:dashed; }
.routing-node.inactive .routing-node-status { color:var(--amber); }
.routing-legend { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:12px 15px; margin-top:auto; border-top:1px solid var(--line); font-size:10px; color:var(--muted); }
.routing-legend span { display:flex; align-items:center; gap:5px; }
.routing-key { width:9px; height:9px; border-radius:3px; background:var(--violet); }
.routing-key.server { background:var(--blue); }
.routing-key.optional { width:16px; height:0; border-top:2px dashed var(--line-strong); background:transparent; }
.routing-inspector { min-width:0; border-left:1px solid var(--line); padding:24px 22px; max-height:800px; overflow:auto; }
.routing-detail-type { font-size:11px; color:var(--muted); }
.routing-inspector h2 { font-size:21px; margin:9px 0 12px; }
.routing-detail-model { font-size:12px; color:var(--violet); overflow-wrap:anywhere; margin-bottom:12px; font-weight:600; }
.routing-description { font-size:12px; margin:17px 0; }
.routing-inspector h3 { font-size:12px; margin:22px 0 8px; }
.routing-destinations { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.routing-destinations .button { white-space:normal; text-align:left; font-size:10px; }
.routing-bindings { margin:0; }
.routing-bindings > div { padding:10px 0; border-bottom:1px solid var(--line); }
.routing-bindings dt { font-size:10px; color:var(--muted); overflow-wrap:anywhere; }
.routing-bindings dd { font-size:12px; font-weight:550; margin:5px 0 0; overflow-wrap:anywhere; }
.routing-prompt-section { margin-top:24px; padding-top:18px; border-top:1px solid var(--line); }
.routing-prompt-section summary { cursor:pointer; font-size:12px; font-weight:600; }
.routing-prompt-section label { margin:15px 0 6px; font-size:11px; }
.routing-prompt-section code { display:block; color:var(--muted); font-size:10px; font-weight:400; }
.routing-prompt-section details details { margin-top:14px; }
.routing-prompt-output { white-space:pre-wrap; overflow-wrap:anywhere; background:var(--wash); padding:12px; font-size:10px; max-height:330px; overflow:auto; }
.routing-list { padding:16px; display:grid; grid-auto-rows:minmax(154px,auto); align-content:start; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; max-height:540px; overflow:auto; }
.routing-list-item.button { display:flex; align-items:stretch; flex-direction:column; gap:8px; padding:15px; white-space:normal; text-align:left; border:1px solid var(--line); background:var(--paper); }
.routing-list-item[aria-pressed=true] { outline:2px solid var(--violet); outline-offset:1px; }
.routing-activity { margin-top:26px; }
.routing-activity h2 { font-size:18px; margin-bottom:6px; }
.routing-activity p { color:var(--muted); font-size:12px; margin-bottom:16px; }
#routing-activity-list { overflow:auto; }
.routing-call-table { width:100%; text-align:left; border-collapse:collapse; font-size:11px; white-space:nowrap; }
.routing-call-table th { font-weight:500; color:var(--muted); background:var(--wash); }
.routing-call-table th, .routing-call-table td { padding:11px 14px; border-bottom:1px solid var(--line); }
.routing-call-table .button { padding:0; min-height:24px; }
.routing-call-model { color:var(--violet); }
body[data-role=viewer] [data-view=routing], body[data-role=operator] [data-view=routing] { display:none!important; }
@media(min-width:1700px) { .routing-viewport { height:820px; } .routing-inspector { max-height:920px; } }
@media(max-width:1000px) { .routing-workspace { grid-template-columns:minmax(0,1fr) 290px; } .routing-inspector { padding:20px 16px; } .routing-view { padding:20px 16px; } }
@media(max-width:720px) {
  .routing-view { padding:18px 12px; }
  .routing-heading { align-items:flex-start; flex-direction:column; gap:12px; }
  .routing-heading h1 { font-size:23px; }
  .routing-workspace { grid-template-columns:minmax(0,1fr); }
  .routing-viewport { height:400px; }
  .routing-inspector { border-left:0; border-top:1px solid var(--line); max-height:none; }
  .routing-list { max-height:335px; grid-template-columns:repeat(2,minmax(0,1fr)); padding:12px; gap:10px; }
  .routing-list-item.button { padding:10px; }
  .routing-node-title { font-size:12px; }
  .routing-model { font-size:10px; }
  .routing-toolbar { padding:8px; gap:2px; }
  .routing-toolbar .button { padding:5px 8px; }
  .routing-legend { gap:8px; }
}

@media(max-width:720px) {
  body:has(#routing-view:not([hidden])) .topbar { display:grid; }
  body:has(#routing-view:not([hidden])) .main-nav { justify-content:flex-start; }
  .routing-list-item > * { flex-shrink:0; }
}

.routing-key.diagnostic { background:var(--amber); }
.routing-register-signals { margin-top:22px; border-top:1px solid var(--line); }
.routing-register-signal { padding:12px; border-left:3px solid var(--amber); background:var(--amber-soft); margin-top:14px; border-radius:0 6px 6px 0; }
.routing-register-signal p { margin:0 0 12px; }
.routing-register-signal dl { margin:0; }
.routing-register-signal dl > div + div { margin-top:11px; }
.routing-register-signal dt { font-size:10px; color:var(--muted); }
.routing-register-signal dd { font-size:12px; margin:3px 0 0; }
.routing-no-signals { padding:14px; font-size:12px; background:var(--wash); margin-top:14px; border-radius:6px; }

.routing-heading-actions { flex-wrap:wrap; }
.routing-key.output { background:var(--success); }
.routing-node[data-kind=output] .routing-model { color:var(--success); font-weight:600; }
.routing-json-output { margin-top:18px; font-size:12px; }
.routing-json-output summary { cursor:pointer; font-weight:600; }
.routing-json-output pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:300px; overflow:auto; padding:12px; background:var(--wash); font-size:10px; }

.routing-edit-bar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:12px 0 18px; font-size:12px; }
.routing-edit-bar > div, .routing-test-actions { display:flex; gap:8px; flex-wrap:wrap; }
.routing-node-editor { padding:0 0 16px; border-bottom:1px solid var(--line); }
.routing-node-editor fieldset { padding:0; border:0; margin:0; min-width:0; }
.routing-edit-field { margin:12px 0; }
.routing-edit-field label, .routing-test-panel label { display:block; margin:12px 0 6px; font-size:12px; }
.routing-edit-check { display:flex; align-items:center; gap:8px; margin:12px 0; font-size:12px; }
.routing-edit-check input { width:16px; }
.routing-test-panel { margin-top:24px; border:1px solid var(--line); padding:20px; border-radius:10px; background:var(--paper); }
.routing-test-panel > summary { cursor:pointer; font-weight:600; font-size:18px; }
.routing-test-panel > p { margin-top:12px; }
.routing-test-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:28px; margin-top:12px; }
.routing-test-grid > * { min-width:0; }
.routing-test-actions { margin-top:14px; }
.routing-test-result h2 { font-size:16px; margin-top:12px; }
.routing-test-result { font-size:12px; overflow-wrap:anywhere; }
.routing-test-result pre { white-space:pre-wrap; overflow-wrap:anywhere; background:var(--wash); padding:12px; max-height:360px; overflow:auto; font-size:11px; }
.routing-test-result blockquote { margin:16px 0; border-left:3px solid var(--violet); padding:12px; background:var(--wash); }
.routing-test-result summary { cursor:pointer; }
@media(max-width:720px) { .routing-test-grid { grid-template-columns:minmax(0,1fr); } .routing-edit-bar .button { white-space:normal; } }

.routing-json-panel { padding:16px; margin-bottom:18px; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
.routing-json-panel > summary { cursor:pointer; font-weight:600; font-size:14px; }
.routing-json-panel > p, .routing-json-actions { margin:12px 0; }
.routing-json-actions { display:flex; flex-wrap:wrap; gap:8px; }
.routing-json-panel label { display:block; font-size:12px; margin-bottom:6px; }
.routing-json-panel textarea { font-family:monospace; font-size:12px; }
#routing-import-diff { overflow:auto; }
.routing-api-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 140px; gap:12px; margin:16px 0; }
.routing-api-form .checkbox-row { grid-column:1 / -1; display:flex; align-items:center; gap:8px; }
.routing-api-form > button { justify-self:start; }
.routing-api-token { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-top:1px solid var(--line); font-size:12px; }
.routing-api-token > span { overflow-wrap:anywhere; min-width:0; }
#routing-api-key { font-family:monospace; font-size:12px; }
#routing-api-base { overflow-wrap:anywhere; }
@media(max-width:720px) { .routing-api-form { grid-template-columns:minmax(0,1fr); } }
