:root{color-scheme:dark;--bg:#091a2c;--panel:#11283f;--panel-alt:#0e2238;--line:#2a435a;--muted:#819db4;--text:#dbe8f3;--cyan:#7bd7e9;--green:#7cd0b8;--yellow:#e8bd69}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input,select{font:inherit}button{cursor:pointer;background:#163149;border:1px solid #304d65;color:var(--text);border-radius:6px;padding:8px 13px;transition:.15s}button:hover{background:#24455e;border-color:#6ea1bc}button:disabled{opacity:.4;cursor:not-allowed}.primary{background:var(--cyan);border-color:var(--cyan);color:#082536;font-weight:700}.primary:hover{background:#a4ebf7}header{min-height:84px;display:flex;align-items:center;justify-content:space-between;padding:0 30px;border-bottom:1px solid var(--line);background:#0b1e31;gap:26px}.brand{display:flex;align-items:center;gap:20px;text-decoration:none;color:#ecf5fa}.brand img{width:140px;height:auto}.brand span{font-size:30px;line-height:1;border-left:1px solid #355066;padding-left:20px;font-weight:700;letter-spacing:2px}nav{display:flex;align-self:stretch;gap:5px}nav button{border:0;border-radius:0;background:transparent;color:var(--muted);padding:20px 18px;position:relative}nav button.active{color:var(--cyan);background:#11283b}nav button.active:after{content:"";height:2px;background:var(--cyan);bottom:0;left:18px;right:18px;position:absolute}.header-end,.actions{display:flex;align-items:center;gap:12px}.preview{font-size:10px;letter-spacing:1px;color:var(--cyan);border:1px solid #365870;border-radius:4px;padding:3px 7px}#clock{font:11px monospace;color:var(--muted)}#control{color:var(--green)}main{min-height:calc(100vh - 148px)}.page-title{padding:30px 32px 18px;display:flex;align-items:center;justify-content:space-between;gap:20px}.eyebrow{font-size:10px;letter-spacing:2px;color:#6fbad1;font-weight:700}h1{font-size:26px;letter-spacing:.5px;font-weight:600;margin:4px 0}h1 span{font:12px monospace;color:#9db8cb;background:#1c364d;padding:4px 10px;border-radius:20px;margin-left:12px}.page-title p{margin:3px 0;color:var(--muted);font-size:12px}#ownerText{font-size:11px;color:var(--muted)}#demoNotice{font-size:11px;color:#69889f;padding:0 32px 18px}.notice{margin:0 32px 14px;padding:10px 14px;background:#463820;color:#e8c883;border:1px solid #80673e;border-radius:5px}.node{background:var(--panel);border-top:1px solid #263f56;display:grid;grid-template-columns:145px minmax(235px,1fr) 32px minmax(275px,1.15fr) minmax(190px,.85fr) 96px;align-items:center;gap:22px;padding:28px 32px;min-height:250px}.node:nth-child(even){background:var(--panel-alt)}.node-name{font-size:17px;font-weight:650;overflow-wrap:anywhere}.node-key{font:10px monospace;color:var(--muted);margin-top:9px}.number{font:11px monospace;color:var(--cyan);margin-bottom:12px}.tag{display:inline-flex;align-items:center;border:1px solid #34536d;color:#92acc0;border-radius:4px;padding:2px 7px;font-size:10px;white-space:nowrap}.section-label{font-size:10px;letter-spacing:1px;color:#708fa8;margin:0 0 10px}.endpoint{padding:12px 13px;background:#0a2033;border:1px solid #2b465e;border-radius:6px;margin-bottom:9px}.endpoint:last-child{margin-bottom:0}.endpoint-head{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px}.status{font-size:10px;color:var(--green)}.status.warn{color:var(--yellow)}.status.off{color:#8b9cac}.status.bad{color:#ee8594}.endpoint small{display:block;font-size:10px;color:var(--muted);margin-top:6px}.endpoint .addr{font:10px monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:8px;color:#8eaabd}.edge-meta{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:var(--muted);margin-top:7px}.flow-arrow{color:#4e839b;font-size:25px;text-align:center}.mini-links{display:flex;gap:8px}.mini-links span{font-size:9px;color:var(--green)}.mini-links .bad{color:#e2858e}.route{color:var(--green)}.route.backup{color:var(--yellow)}.chart-head{display:flex;justify-content:space-between;gap:10px;font-size:10px;color:var(--muted)}.chart-head b{color:var(--text);font-size:13px}.chart{width:100%;height:80px;margin:15px 0 4px}.chart-label{display:flex;justify-content:space-between;color:#6e91aa;font-size:9px}.node-actions{display:flex;flex-direction:column;gap:13px}.state{font-size:12px;letter-spacing:1px;font-weight:750;padding:11px 2px;border-radius:5px}.state.live{background:#9e3348;border-color:#c54d60;color:#ffe7ec}.state.ready{background:#154a3f;border-color:#2a7664;color:#92dec8}.state.wait{background:#55411f;color:#f5d797;border-color:#95733b}.text-actions{display:flex;justify-content:space-between;gap:6px}.text-actions button{border:0;background:none;color:#95afc3;padding:0;font-size:11px}.node-note{color:var(--yellow);font-size:10px;margin-top:6px}.empty{padding:90px 20px;text-align:center;color:var(--muted)}footer{padding:22px 32px;display:flex;justify-content:space-between;border-top:1px solid var(--line);font-size:10px;letter-spacing:.4px;color:#7693a9;background:#0b1e31}dialog{width:min(940px,92vw);max-height:90vh;overflow:auto;border:1px solid #365770;border-radius:12px;background:#10273e;color:var(--text);padding:28px;box-shadow:0 30px 110px #0008}dialog::backdrop{background:#04101dcc;backdrop-filter:blur(4px)}#editor{width:70vw}#controlDialog,#confirmDialog{width:min(580px,92vw)}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}h2{margin:3px 0;font-size:22px;font-weight:600}.close{font-size:28px;padding:0 7px;border:0;background:transparent}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px 24px}label{display:block;color:#a8c0d2;font-size:12px}input,select{display:block;width:100%;padding:10px 12px;background:#0a2034;border:1px solid #35556e;border-radius:5px;color:var(--text);margin:8px 0}input:focus,select:focus{outline:2px solid #70c6de55;border-color:#78cadf}label small,.hint{font-size:11px;color:var(--muted)}.hint{line-height:1.9}.config-path{background:#0b2033;padding:15px;border:1px solid #2a435b;border-radius:6px;margin-top:20px;font-size:12px}.config-path p{margin:8px 0 0;color:var(--muted)}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}.error{color:#ee9ba5;font-size:12px}.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.detail-card{background:#0b2034;padding:18px;border:1px solid #2b465e;border-radius:7px}.detail-card h3{font-size:13px;margin:0 0 12px}.address-row{display:flex;gap:8px;align-items:center}.address-row input{font:11px monospace;min-width:0}.address-row button{font-size:11px;flex-shrink:0}.subheading{font-size:13px;margin:22px 0 12px}.detail-card button{font-size:11px}.logs{background:#091e31;padding:15px;max-height:200px;overflow:auto;font:11px/2 monospace;white-space:pre-wrap}.simulation{margin-top:18px;color:var(--muted);font-size:11px}.simulation summary{cursor:pointer}.simulation .actions{margin-top:12px;flex-wrap:wrap}.simulation button{font-size:11px}.server-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:20px;padding:0 32px 32px}.server-card{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:24px}.server-title{display:flex;align-items:center;justify-content:space-between}.server-title h2{font-size:18px}.server-card p{color:var(--muted);font-size:12px}.server-roles{display:flex;gap:8px;margin:12px 0 20px}.resource{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;border-top:1px solid var(--line);padding-top:16px}.resource span{display:block;font-size:11px;color:var(--muted)}.resource strong{font:22px monospace}.history-list{margin:0 32px 32px;border:1px solid var(--line);border-radius:7px;overflow:hidden}.history-row{display:grid;grid-template-columns:160px 130px 1fr;gap:20px;padding:15px 20px;background:var(--panel);border-bottom:1px solid var(--line);font-size:12px}.history-row time{color:var(--muted);font:11px monospace}#toast{position:fixed;top:20px;left:50%;transform:translateX(-50%);z-index:100;background:#24445a;border:1px solid #6489a1;border-radius:7px;padding:11px 22px;box-shadow:0 6px 30px #0006;font-size:13px}[hidden]{display:none!important}@media(max-width:1200px){header{flex-wrap:wrap;padding:16px 24px;gap:14px}nav{order:3;flex-basis:100%}nav button{padding:10px 18px}.node{grid-template-columns:110px 1fr 24px 1fr 90px;gap:16px}.chart-wrap{grid-column:2/5;display:none}.page-title{flex-wrap:wrap}}@media(max-width:760px){.node{grid-template-columns:1fr 90px;padding:22px 20px}.identity{grid-column:1}.source-col,.edge-col{grid-column:1/-1}.flow-arrow{display:none}.node-actions{grid-column:2;grid-row:1}.page-title{padding:24px 20px}.actions{flex-wrap:wrap}.header-end #clock{display:none}.brand img{width:108px}.brand span{font-size:26px}.server-grid,.detail-grid,.form-grid{grid-template-columns:1fr}#editor{width:92vw}footer{display:block}.history-row{grid-template-columns:1fr;gap:4px}#ownerText{display:none}}

/* NAT-style header toolbar */
header{gap:20px;padding:16px 24px}.header-end{margin-left:auto;justify-content:flex-end;gap:10px;flex-wrap:wrap}.header-end button{white-space:nowrap;font-size:12px}#serverName{font-size:12px;white-space:nowrap}#clock{white-space:nowrap}#control{padding:6px;border:0;background:transparent;font-size:20px;color:var(--green)}#control.read-only{color:#819db4}.settings-wrap{position:relative}#settingsMenu{position:absolute;right:0;top:calc(100% + 8px);min-width:140px;z-index:20;background:#11283f;border:1px solid var(--line);border-radius:6px;padding:6px;box-shadow:0 10px 30px #0005}#settingsMenu button{display:block;width:100%;text-align:left;background:none;border:0}#settingsMenu button:hover{background:#24455e}#serverTabs{display:flex;gap:10px;padding:0 32px 20px}#serverTabs button.active{border-color:var(--cyan);color:var(--cyan)}#previewLogout{width:min(440px,92vw)}@media(max-width:1200px){.header-end{flex:1}}@media(max-width:760px){.header-end{flex-basis:100%;justify-content:flex-start}.header-end #clock{display:inline}#serverTabs{flex-wrap:wrap;padding:0 20px 20px}}

body{min-height:100vh;display:flex;flex-direction:column}header{flex-shrink:0}main{min-height:0;flex:1}.site-footer{display:block;margin-top:auto;text-align:center;padding:22px 16px;color:var(--muted);font-size:11px;line-height:1.9;letter-spacing:.2px;background:#0a1d31;border-top:1px solid #20374d;flex-shrink:0}.site-footer span{display:inline}.site-footer time{margin-right:10px}#servers .server-grid{padding-top:24px}#history .history-list{margin-top:24px}.notice{margin-top:16px}

#serverConfig{padding-top:24px}.server-config-actions{padding:0 32px 32px;text-align:right}.server-config-actions .hint{display:block;margin-bottom:16px}#serverConfig label{margin-top:18px}

.flow-arrow{align-self:stretch;display:flex;align-items:center;padding-top:25px}.flow-arrow svg{display:block;width:100%;height:160px;overflow:visible}.node{grid-template-columns:145px minmax(235px,1fr) 72px minmax(275px,1.15fr) minmax(190px,.85fr) 96px}@media(max-width:1200px){.node{grid-template-columns:110px 1fr 56px 1fr 90px}}@media(max-width:760px){.node{grid-template-columns:1fr 90px}.flow-arrow{display:none}}

.edge-hotspot{cursor:pointer;transition:background .15s,border-color .15s}.edge-hotspot:hover{background:#15364d;border-color:#76bdd4}.edge-hotspot:focus-visible{outline:2px solid var(--cyan);outline-offset:3px}#detail{width:100%;padding:28px 32px 40px;background:var(--bg)}.detail-page-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}#detailTitle{outline:none}#detail .detail-card{padding:24px}#detail .logs{max-height:none;min-height:100px}@media(max-width:760px){#detail{padding:22px 20px}.detail-page-head{align-items:flex-start;flex-direction:column}}

.pull-entry{margin-bottom:20px}.pull-entry>h3{font-size:13px;color:var(--cyan);margin:0 0 10px}.route-controls:empty{display:none}.route-controls{margin:18px 0}.detail-page-head .actions{flex-wrap:wrap}

.address-actions{display:flex;gap:6px;flex-shrink:0}.address-row input{flex:1;width:0}.address-row{flex-wrap:wrap}.address-disabled input{opacity:.5}.address-state{flex-basis:100%;font-size:11px;color:var(--yellow)}@media(max-width:760px){.address-row input{flex-basis:100%;width:100%}.address-actions{margin-bottom:8px}}

.address-disabled [data-toggle-address]{background:#38434e;border-color:#53606d;color:#a5aeb7}.address-disabled [data-toggle-address]:hover{background:#465360;border-color:#788694}.address-disabled input{color:#81909e;opacity:.55}

.input-legend{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:10px;margin:5px 0;color:var(--muted)}.input-legend>span{display:flex;align-items:center;gap:6px}.input-legend b{color:var(--text);white-space:nowrap;font-size:11px}.series-swatch{display:inline-block;width:15px;flex-shrink:0;border-top:2px solid #89cde5}.series-swatch.shanghai{border-top:2px solid #e8bd69}

.server-body{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:20px}.server-description{min-width:0}.server-bandwidth{min-width:0;padding:16px 0}.bandwidth-values{display:grid;grid-template-columns:1fr 1fr;gap:14px}.bandwidth-values span{display:block;font-size:12px;color:var(--muted);margin-bottom:8px}.bandwidth-values strong{font-size:20px;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:600}.bandwidth-values>div:first-child strong{color:var(--cyan)}.bandwidth-values>div:last-child strong{color:var(--green)}.server-bandwidth small{display:block;color:var(--muted);font-size:10px;margin-top:12px}@media(max-width:1200px){.server-body{grid-template-columns:1fr}.server-bandwidth{padding:0 0 18px}}

.pull-entry-title{display:flex;align-items:center;gap:6px;margin:0 0 10px;color:var(--cyan);font-size:13px;font-weight:600}.pull-entry-name{display:inline-block;width:min(320px,80%);margin:0;padding:5px 8px;background:transparent;border:1px solid transparent;color:var(--cyan);font-weight:600}.pull-entry-name:hover{border-color:var(--line)}.pull-entry-name:focus{background:#0a2034;border-color:var(--cyan)}

@media(prefers-reduced-motion:reduce){.flow-particle{display:none}}

.server-flow{grid-column:1/-1;height:180px;margin:-20px 0;pointer-events:none}.server-flow svg{width:100%;height:100%;display:block}@media(max-width:760px){#servers .server-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:18px 12px}#servers .server-card{padding:14px;min-width:0}#servers .server-title{align-items:flex-start;gap:6px}#servers .server-title h2{font-size:14px}#servers .server-roles{flex-wrap:wrap}#servers .tag{white-space:normal}#servers .resource{gap:8px;grid-template-columns:1fr}#servers .bandwidth-values{grid-template-columns:1fr}#servers .bandwidth-values strong{font-size:16px}.server-flow{height:140px;margin:-12px 0}}

.concurrency-controls{flex-basis:100%;display:flex;align-items:center;justify-content:flex-end;gap:10px;order:-1}.concurrency-controls label{display:flex;align-items:center;gap:8px;white-space:nowrap}.concurrency-controls input{flex:none;width:90px;margin:0;padding:5px 8px}.concurrency-controls small{color:var(--muted);font-size:10px}#connections{padding:28px 32px}.connection-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:7px}.connection-table{width:100%;border-collapse:collapse;text-align:left;white-space:nowrap}.connection-table th,.connection-table td{padding:16px 20px;border-bottom:1px solid var(--line)}.connection-table th{background:var(--panel);color:var(--muted);font-weight:500}.connection-table td{font-variant-numeric:tabular-nums}@media(max-width:760px){.concurrency-controls{flex-wrap:wrap;justify-content:flex-start}#connections{padding:22px 20px}}

/* Pull concurrency history on the node detail page. */
.pull-concurrency{margin-top:26px}.pull-concurrency-heading{margin-bottom:12px}.pull-concurrency-heading h3{margin:0;font-size:13px}.pull-concurrency-heading p{margin:4px 0 0;color:var(--muted);font-size:10px}.pull-concurrency-card{min-width:0;padding:20px 22px 16px;border:1px solid var(--glass-edge);border-radius:16px;background:var(--glass-surface);box-shadow:var(--glass-shadow);-webkit-backdrop-filter:blur(8px) saturate(125%);backdrop-filter:blur(8px) saturate(125%)}.pull-chart-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.pull-chart-kicker{display:block;margin-bottom:3px;color:var(--muted);font-size:10px}.pull-chart-head h3{margin:0;font-size:14px}.pull-chart-head>strong{display:flex;align-items:baseline;gap:7px;color:var(--text);font:26px/1 monospace}.pull-chart-head>strong small{color:var(--muted);font:9px/1.2 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.pull-chart-stats{display:flex;gap:18px;margin-top:12px;color:var(--muted);font-size:10px}.pull-chart-stats b{margin-left:4px;color:var(--text);font-weight:600}.pull-chart-plot{position:relative;height:132px;margin-top:10px;padding-left:22px}.pull-chart-plot svg{display:block;width:100%;height:132px;overflow:visible}.pull-chart-grid{fill:none;stroke:#b7d8f022;stroke-width:1;vector-effect:non-scaling-stroke}.pull-chart-max{position:absolute;left:0;top:1px;color:#6e91aa;font:9px monospace}.pull-chart-axis{display:flex;justify-content:space-between;padding-left:22px;color:#6e91aa;font-size:9px}.pull-concurrency-grid{align-items:stretch}@media(max-width:760px){.pull-concurrency-card{padding:18px}.pull-chart-plot{height:116px}.pull-chart-plot svg{height:116px}}

.backend-locked>header,.backend-locked>main,.backend-locked>footer{display:none}#backendGate{min-height:100vh;display:grid;place-items:center;padding:24px;background:var(--bg)}#backendLogin,.backend-welcome{width:min(480px,100%);padding:32px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}#backendLogin h2{text-align:center;margin-bottom:24px}#backendLogin>button{width:100%;margin-top:14px}.backend-welcome p{color:var(--muted)}#backendStatus{margin-bottom:6px;color:var(--cyan);font-size:11px}#passwordDialog{width:min(480px,92vw)}
/* Keep NAT's shared chrome on the login and initialization screens. */
body.backend-locked{min-height:100vh}.backend-locked>header{display:flex;order:0}.backend-locked>main{display:none}.backend-locked>footer{display:block;order:2}.backend-locked #backendGate{order:1;min-height:0;flex:1;width:100%;padding:48px 24px}.backend-locked .header-end>*{display:none}.backend-locked .header-end #clock{display:inline}.backend-locked #backendStatus{display:none}#backendLogin{width:min(430px,100%);padding:38px}#backendLogin h2{font-size:22px;text-align:center}#backendLogin label input{margin:8px 0 20px}#backendGate[hidden]{display:none}

.detail-heading{display:flex;align-items:center;gap:20px;flex-wrap:wrap}.detail-heading h2{margin:0}.detail-heading .route-controls{margin:0}

/* Match the NAT login page's measured stylesheet, scoped to the login screen. */
body.backend-locked{background:#091a2d;color:#dce7f2;font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100vh;min-height:100dvh;display:grid;grid-template-rows:auto 1fr auto;row-gap:24px}
.backend-locked>header{height:76px;min-height:76px;padding:0 32px;gap:20px;border-bottom:1px solid #20374d;background:#0a1d31;grid-row:1}
.backend-locked .brand{gap:9px;color:#cdeefa;font-size:28px}.backend-locked .brand img{display:block;width:144px;height:40px;object-fit:contain}.backend-locked .brand span{font-size:28px;font-weight:700;line-height:1;letter-spacing:.5px;color:#f5f6f6;margin-left:14px;border-left:1px solid #2b425a;padding-left:20px}
.backend-locked .header-end{gap:24px}.backend-locked .header-end #serverName{display:inline;font-size:12px;font-weight:400;color:#dce7f2;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.backend-locked .header-end #clock{display:block;color:#849bb2;font:12px monospace}
.backend-locked #backendGate{grid-row:2;align-self:center;justify-self:center;padding:0;min-height:0;width:100%;background:transparent}
#backendLogin{max-width:430px;width:calc(100% - 32px);margin:0;padding:38px;border:1px solid #2b425a;border-radius:10px;background:#10263e;color:#dce7f2;font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
#backendLogin h2{margin:0 0 26px;font-size:20px;line-height:1.5;font-weight:600;letter-spacing:1px;text-align:center;color:#dce7f2}
#backendLogin label{display:block;font-size:12px;color:#b5c7d7}#backendLogin label input{font:inherit;display:block;width:100%;margin:8px 0 20px;background:#0b2034;border:1px solid #3d5971;border-radius:5px;padding:11px;color:#dce7f2;outline:none}#backendLogin input:focus{border-color:#7bcce7;box-shadow:0 0 0 2px #69c9e81a}
#backendLogin>button{font:inherit;width:100%;margin-top:10px;padding:8px 13px;border:1px solid #78d5ec;border-radius:5px;background:#78d5ec;color:#062235;font-weight:700}#backendLogin>button:hover{background:#78d5ec;border-color:#6b95b4}#backendLogin .error{color:#ff9ba6;font-size:12px}#backendLogin .error:empty{display:none}
.backend-locked>.site-footer{grid-row:3;margin-top:0;background:#0a1d31;border-top:1px solid #20374d;color:#849bb2;padding:22px 16px;font-size:11px;line-height:1.9;letter-spacing:.2px}
@media(max-width:1100px){.backend-locked>header{height:auto;min-height:76px;gap:16px;padding-top:14px;padding-bottom:14px;flex-wrap:wrap}.backend-locked .header-end{gap:12px;flex:1}}
@media(max-width:650px){.backend-locked>header{padding-left:16px;padding-right:16px}.backend-locked .brand img{width:112px;height:auto}.backend-locked .brand span{font-size:22px;margin-left:0;padding-left:10px}.backend-locked .header-end{flex-basis:100%;justify-content:flex-end}.backend-locked .header-end #clock{font-size:10px}}

/* Shared NAT header proportions, including the authenticated toolbar. */
header{height:76px;min-height:76px;padding:0 32px;flex-wrap:nowrap;gap:20px;background:#0a1d31;border-bottom:1px solid #20374d;font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#dce7f2}
header .brand{flex-shrink:0;gap:9px;color:#cdeefa;font-size:28px}header .brand img{display:block;width:144px;height:40px;object-fit:contain}header .brand span{font-size:28px;font-weight:700;line-height:1;letter-spacing:.5px;margin-left:14px;border-left:1px solid #2b425a;padding-left:20px;color:#f5f6f6}
header .header-end{display:flex;flex:0 1 auto;align-items:center;justify-content:flex-end;gap:24px;flex-wrap:wrap;margin-left:auto}header #serverName{font-size:12px;font-weight:400;color:#dce7f2;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header .header-end #clock{display:block;white-space:nowrap;font:12px monospace;color:#849bb2}
header .header-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0}header .header-toolbar button{font:13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#dce7f2;white-space:nowrap;border:1px solid #2b425a;border-radius:5px;padding:8px 13px;background:#132d46}header .header-toolbar button.primary{background:#78d5ec;border-color:#78d5ec;color:#062235;font-weight:700}header .header-toolbar button:hover{filter:brightness(1.12)}header .header-toolbar #control{display:inline;padding:0;border:0;border-radius:0;background:transparent;color:#7cccba;font-size:11px;line-height:1.5}header .header-toolbar #control.read-only{color:#819db4}
header #settingsMenu{min-width:150px;padding:6px;background:#10263e;border:1px solid #34516c;border-radius:6px;box-shadow:0 12px 30px #0006;z-index:30}header #settingsMenu button{display:block;width:100%;text-align:left;padding:10px 14px;border:0;border-radius:4px;background:transparent}header #settingsMenu button:hover,header #settingsMenu button:focus-visible{background:#203e58}
@media(max-width:1100px){header{height:auto;min-height:76px;gap:16px;padding-top:14px;padding-bottom:14px;flex-wrap:wrap}header .header-end{gap:12px;flex:1}header .header-toolbar{justify-content:flex-end}}
@media(max-width:650px){header{padding-left:16px;padding-right:16px}header .brand img{width:112px;height:auto}header .brand span{font-size:22px;margin-left:0;padding-left:10px}header .header-end{flex-basis:100%;justify-content:flex-end}header .header-end #clock{font-size:10px}header .header-toolbar{gap:8px}header .header-toolbar button{font-size:11px;padding:7px 9px}}

.pull-entry-title .pull-entry-select{appearance:none;-webkit-appearance:none;width:16px;height:16px;min-width:16px;padding:0;margin:0 5px 0 0;background-color:#0b2034;border:1px solid #304d65;border-radius:4px;cursor:pointer;flex-shrink:0;transition:.15s;background-position:center;background-repeat:no-repeat;background-size:12px 12px}
.pull-entry-title .pull-entry-select:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8l3 3 7-7' fill='none' stroke='%23dbe8f3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
.pull-entry-title .pull-entry-select:hover:not(:disabled){background-color:#0b2034;border-color:#6ea1bc}
.pull-entry-title .pull-entry-select:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.pull-entry-title .pull-entry-select:disabled{opacity:.4;cursor:not-allowed}

/* Keep navigation selection distinct and reserve the page scrollbar everywhere. */
header .header-toolbar > button[data-page].active{background:#78d5ec;border-color:#78d5ec;color:#062235;font-weight:700}
html{overflow-y:scroll;scrollbar-gutter:stable;scrollbar-color:#526f86 #0a1d31}
html::-webkit-scrollbar{width:12px}
html::-webkit-scrollbar-track{background:#0a1d31}
html::-webkit-scrollbar-thumb{background:#526f86;border:3px solid #0a1d31;border-radius:8px}
html::-webkit-scrollbar-thumb:hover{background:#819db4}
/* Wider node names; input/distribution tracks use 80% of their previous widths. */
@media(min-width:1201px){.node{grid-template-columns:219.24px minmax(188px,calc((100% - 423px)*.266666667)) 72px minmax(220px,calc((100% - 423px)*.306666667)) minmax(190px,1fr) 96px}}
@media(min-width:761px) and (max-width:1200px){.node{grid-template-columns:166.32px 1fr 56px 1fr 90px}}
/* Center the complete server overview between the header and footer. */
main:has(> #servers:not([hidden])){display:flex;flex-direction:column}
#servers:not([hidden]){display:flex;flex:1;align-items:center;justify-content:center;padding:24px 32px}
#servers .server-grid{width:100%;max-width:1800px;margin:0 auto;padding:0}
@media(max-width:760px){#servers:not([hidden]){padding:18px 12px}#servers .server-grid{padding:0}}

#pullServerPairs{padding:0 32px}.pull-server-pair{background:#11283f;border:1px solid #2b465e;border-radius:7px;padding:20px;margin-bottom:20px}.pull-server-pair>button{display:block;margin:16px 0 0 auto}

.input-status{display:flex;flex-direction:row;align-items:baseline;gap:8px;flex-shrink:0}.input-rate{font-size:10px;color:var(--text);white-space:nowrap;font-variant-numeric:tabular-nums}.input-media small+small{margin-top:3px}

.endpoint-head:has(> .input-status){align-items:flex-start}

.edge-audience{display:flex;flex-direction:column;align-items:flex-end;gap:3px}.edge-output{white-space:nowrap;color:var(--text);font-variant-numeric:tabular-nums}

/* Keep each edge card's labels and measurements on three shared rows. */
.edge-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;column-gap:12px;row-gap:7px;min-width:0}
.edge-card>.endpoint-head,.edge-card>.edge-meta,.edge-card .edge-audience{display:contents}
.edge-card>.endpoint-head>span:first-child{grid-column:1;grid-row:1;font-size:12px}
.edge-card>.endpoint-head>.route{grid-column:2;grid-row:1;text-align:right;font-size:12px}
.edge-card .mini-links{display:contents}
.edge-card .mini-links>span{grid-column:1}
.edge-card .mini-links>span:first-child{grid-row:2}
.edge-card .mini-links>span:last-child{grid-row:3}
.edge-card>.edge-meta>span{grid-column:2;grid-row:2;text-align:right}
.edge-card .edge-audience>span:first-child{grid-column:2;grid-row:2;text-align:right;font-size:10px}
.edge-card .edge-output{grid-column:2;grid-row:3;text-align:right;font-size:10px}

.input-media{min-width:0}.input-media small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Matching row tracks preserve alignment whether an input is live or absent. */
.input-card,.edge-card{display:grid;grid-template-rows:minmax(19px,auto) minmax(16px,auto) minmax(16px,auto);row-gap:7px;padding:12px 13px;align-items:center;align-content:start;min-width:0}
.input-card{grid-template-columns:minmax(0,1fr)}
.input-card>.endpoint-head{grid-row:1;min-width:0;line-height:19px;align-items:center;flex-wrap:wrap;gap:2px 8px}
.input-card>.input-media{grid-row:2;min-width:0}
.input-card>.input-media small{margin:0;line-height:16px}
.input-card>.addr{grid-row:3;margin:0;line-height:16px;min-width:0}
.input-card>.endpoint-head>span:first-child{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.edge-card>.endpoint-head>span{line-height:19px;white-space:normal;min-width:0;overflow-wrap:anywhere}
.edge-card .mini-links,.edge-card .edge-audience>span,.edge-card>small,.edge-card>.node-note{line-height:16px;white-space:normal;min-width:0;overflow-wrap:anywhere}
.edge-card .mini-links span{white-space:nowrap;font-size:10px;min-width:0}
/* Keep all edge diagnostics in the top-right cell, with no fourth row. */
.edge-card>.endpoint-head{display:flex;grid-column:1/-1;grid-row:1;align-items:center;gap:8px;min-width:0}
.edge-card>.endpoint-head>span:first-child{flex:0 0 auto;white-space:nowrap}
.edge-card>.endpoint-head>.route{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right;font-size:10px}
#editor .form-grid input,#editor .form-grid select{height:42px;min-height:42px;box-sizing:border-box;font-size:12px;line-height:20px;padding:10px 12px}
#editor .form-grid select{appearance:none;-webkit-appearance:none;padding-right:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23819db4' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center}

.input-ip{font-size:10px;color:var(--muted);white-space:nowrap}.input-card .input-status{min-width:0;flex-shrink:1}.input-ip{overflow:hidden;text-overflow:ellipsis}
.input-card .input-status>.status{white-space:nowrap;flex-shrink:0}

.copy-connection-ip{margin-left:10px;padding:3px 9px;font-size:11px;vertical-align:middle}

/* Codec page gutters and independent node cards. */
#streams{display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:16px;padding:16px 24px}
#streams>.node{min-width:0;background:#10273d;border:1px solid #35516a;border-radius:8px;padding:28px 16px}
#streams .node>div{min-width:0}
/* Flexible tracks account for the new outer gutters at laptop widths. */
@media(min-width:1201px){#streams>.node{grid-template-columns:minmax(140px,219.24px) minmax(0,1fr) 56px minmax(0,1.15fr) minmax(160px,.85fr) 96px;gap:20px}}
@media(min-width:761px) and (max-width:1200px){#streams>.node{grid-template-columns:140px minmax(0,1fr) 40px minmax(0,1.15fr) 90px;gap:14px}}
@media(max-width:760px){#streams>.node{padding:22px 16px}}
@media(max-width:550px){#streams{padding:16px 14px}}

/* Pair input and output cards on shared rows, including expanded diagnostics. */
@media(min-width:761px){
 #streams>.node{grid-template-rows:auto auto;row-gap:10px}
 #streams .source-col,#streams .edge-col{display:contents}
 #streams .source-col>*{grid-column:2}
 #streams .edge-col>*{grid-column:4}
 #streams :is(.source-col,.edge-col)>.endpoint:first-child{grid-row:1}
 #streams :is(.source-col,.edge-col)>.endpoint:last-child{grid-row:2}
 #streams :is(.source-col,.edge-col)>.endpoint{margin:0;align-self:stretch}
 #streams .identity{grid-column:1;grid-row:1/3}
 #streams .flow-arrow{grid-column:3;grid-row:1/3;padding-top:0}
 #streams .chart-wrap{grid-column:5;grid-row:1/3}
 #streams .node-actions{grid-column:6;grid-row:1/3}
}
@media(min-width:761px) and (max-width:1200px){#streams .node-actions{grid-column:5}}

/* Shared Codec navigation: full-height text buttons and a subdued active tab. */
body:not(.backend-locked)>header{height:auto;min-height:76px}
header .header-end{gap:18px}
header .header-toolbar{align-items:stretch;gap:0}
header .header-toolbar>button:not(:where(#control)),header .header-toolbar>.settings-wrap>button{display:flex;align-items:center;justify-content:center;margin:0;min-height:76px;padding:25px 14px;border:0;border-radius:0;background:transparent;color:#dce7f2;font-size:14px;font-weight:500;line-height:1.5}
header .header-toolbar>button:not(:where(#control)):hover,header .header-toolbar>.settings-wrap>button:hover,header .header-toolbar>button[data-page].active,header .header-toolbar #settings[aria-expanded="true"]{background:#142d47;color:#a5e2f1;filter:none;font-weight:500}
header .header-toolbar #control{align-self:center;min-width:28px;min-height:36px;margin-right:4px}
header .header-toolbar button:focus-visible{outline:2px solid #dce7f2;outline-offset:-4px}
header #settingsMenu{top:calc(100% - 4px)}
@media(max-width:1450px){body:not(.backend-locked)>header{flex-wrap:wrap;padding-top:10px;padding-bottom:10px}header .header-end{flex:1;gap:10px 18px}header .header-toolbar>button:not(:where(#control)),header .header-toolbar>.settings-wrap>button{min-height:48px;padding:14px 12px}}
@media(max-width:850px){header .header-end{flex-basis:100%}}
@media(max-width:550px){header .header-toolbar{width:100%;justify-content:flex-end;flex-wrap:wrap}header .header-toolbar>button:not(:where(#control)),header .header-toolbar>.settings-wrap>button{min-height:44px;padding:12px 8px;font-size:13px}}

/* CODEC glass material: shared across chrome, cards, dialogs and pickers. */
:root{--glass-surface:linear-gradient(135deg,#dceeff0d,#152f4826 45%,#b7d8f008);--glass-edge:#e0f2ff52;--glass-shadow:0 12px 36px #0003,inset 0 1px 0 #ffffff40,inset 0 -1px 0 #ffffff14;--glass-menu:linear-gradient(135deg,#ffffff08,#ffffff00)}
body,body.backend-locked{background:radial-gradient(ellipse at 12% 0%,#16344b55,transparent 60%),var(--bg);background-attachment:fixed}
body>header,body.backend-locked>header,body>.site-footer,body.backend-locked>.site-footer{background:var(--glass-surface);border-color:var(--glass-edge);-webkit-backdrop-filter:blur(8px) saturate(125%);backdrop-filter:blur(8px) saturate(125%)}
body>header{position:relative;z-index:10}
body #streams>.node,body :is(.server-card,.detail-card,.pull-server-pair,.history-list,.connection-table-wrap,.backend-welcome),body #backendLogin{background:var(--glass-surface);border-color:var(--glass-edge);border-radius:16px;box-shadow:var(--glass-shadow);-webkit-backdrop-filter:blur(8px) saturate(125%);backdrop-filter:blur(8px) saturate(125%)}
body #detail,body #backendGate{background:transparent}
body :is(.endpoint,.config-path,.logs){background:#06182a33;border-color:#c5e0f333;border-radius:10px;box-shadow:inset 0 1px 0 #ffffff12}
body .edge-hotspot:hover{background:#a2d6f019;border-color:#c5e0f377}
body .history-row{background:transparent;border-color:#d9edff20}
body .history-row:nth-child(even),body .connection-table th{background:#18364b55}
body .connection-table td,body .resource{border-color:#d9edff26}
body dialog{background:var(--glass-surface);border-color:var(--glass-edge);border-radius:22px;box-shadow:0 24px 80px #0007,inset 0 1px 0 #ffffff66,inset 0 -1px 0 #ffffff14;-webkit-backdrop-filter:blur(8px) saturate(125%);backdrop-filter:blur(8px) saturate(125%)}
body dialog::backdrop{background:#03101d14;-webkit-backdrop-filter:none;backdrop-filter:none}
body dialog .dialog-head{border-bottom:1px solid #d9edff20;padding-bottom:16px}
body dialog .dialog-actions{border-top:1px solid #d9edff26;padding-top:16px}
body dialog[open]{animation:hub-glass-enter 420ms cubic-bezier(.22,.75,.25,1)}
body input:not([type=checkbox]):not([type=radio]),body select,body #backendLogin label input{background-color:#06182a55;border-color:#c5e0f34d;border-radius:8px;box-shadow:inset 0 1px 0 #ffffff1f}
body select{appearance:none;-webkit-appearance:none;padding-right:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23819db4' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center}
body button:not(.primary):not(.state){background-color:#a2d6f00c;border-color:#c5e0f34d;box-shadow:inset 0 1px 0 #ffffff12}
body button:not(.primary):not(.state):hover{background-color:#a2d6f023}
body button.primary{background:linear-gradient(135deg,#9ce5eddd,#78d5ecd9);border-color:#b8f2f8aa;box-shadow:inset 0 1px 0 #ffffff60}
body .text-actions button,body .close,body header .header-toolbar>button,body header .header-toolbar>.settings-wrap>button{box-shadow:none;background:transparent}
body header .header-toolbar>button:hover,body header .header-toolbar>button[data-page].active,body header .header-toolbar #settings[aria-expanded=true]{background:#a2d6f01c;color:#a5e2f1}
body header #settingsMenu,body .glass-select-menu,body #backendLogin,body #toast{background:var(--glass-menu);border:1px solid var(--glass-edge);border-radius:12px;box-shadow:0 8px 24px #0002,inset 0 1px 0 #ffffff45;-webkit-backdrop-filter:blur(8px) saturate(125%);backdrop-filter:blur(8px) saturate(125%)}
body #backendLogin{border-radius:22px}
body .glass-select-menu{position:fixed;inset:auto;margin:0;width:max-content;overflow:auto;z-index:1000;overscroll-behavior:contain;padding:6px;color:var(--text);animation:hub-menu-enter 150ms ease-out}
body .glass-select-menu button,body header #settingsMenu button{display:block;width:100%;margin:0;padding:8px 12px;border:0;border-radius:6px;background:transparent;box-shadow:none;color:var(--text);font:13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;text-align:left;white-space:nowrap}
body .glass-select-menu button[aria-selected=true]{background:#6fbce530;color:#e7f7ff}
body .glass-select-menu button:is(:hover,:focus-visible):not(:disabled),body header #settingsMenu button:is(:hover,:focus-visible){background:#a2d6f03d;outline:0}
body .glass-select-menu button:disabled{color:#91a3b17d;cursor:default}
body .notice{background:#80673e33;box-shadow:inset 0 1px 0 #ffffff20;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
@keyframes hub-glass-enter{0%{opacity:0;transform:translateY(18px) scale(.95)}75%{opacity:1;transform:translateY(-2px) scale(1.006)}100%{transform:none}}
@keyframes hub-menu-enter{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){:root{--glass-surface:#152d43f5;--glass-menu:#152d43}}
@media(prefers-reduced-transparency:reduce){:root{--glass-surface:#152d43;--glass-menu:#152d43}body *,body *::backdrop{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}}
@media(prefers-reduced-motion:reduce){body dialog[open],body .glass-select-menu{animation:none}}
body #noticeDialog{width:min(480px,92vw)}
/* Blur chrome on a separate layer so its dropdown can sample the page behind it. */
body>header,body.backend-locked>header{background:transparent;-webkit-backdrop-filter:none;backdrop-filter:none}
body>header::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:var(--glass-surface);-webkit-backdrop-filter:blur(8px) saturate(125%);backdrop-filter:blur(8px) saturate(125%)}
/* Match CODEC toolbar exactly; page controls never inherit action-button colors. */
body header #headerTools>button:not(#control),body header #headerTools>.settings-wrap>button{background:transparent;color:#dce7f2;border:0;border-radius:0;box-shadow:none;filter:none;font-weight:500}
body header #headerTools>button:not(#control):not(:where(#add,#logout)):hover,body header #headerTools>button:not(#control)[data-page].active,body header #headerTools>.settings-wrap>button:hover,body header #headerTools #settings[aria-expanded=true]{background:#142d47;color:#a5e2f1;box-shadow:none;filter:none;font-weight:500}
body header #headerTools #control{background:transparent;box-shadow:none;filter:none}

/* Only selected picker options have a fill; keyboard focus uses an outline. */
body .glass-select-menu button[aria-selected=false],body .glass-select-menu button[aria-selected=false]:is(:hover,:focus-visible){background:transparent;box-shadow:none}
body .glass-select-menu button[aria-selected=false]:hover:not(:disabled){color:#e7f7ff}
body .glass-select-menu button[aria-selected=false]:focus-visible{outline:1px solid #a5e2f1;outline-offset:-2px}

/* Header actions stay neutral in pointer and expanded states. */
body header #headerTools :is(#settings,#add,#logout),body header #headerTools :is(#settings,#add,#logout):is(:hover,:active,:focus,[aria-expanded=true]){background:transparent;color:#dce7f2;box-shadow:none;filter:none;border:0}
body header #headerTools :is(#settings,#add,#logout):focus:not(:focus-visible){outline:none}

/* Settings menu and its password, confirmation and notice dialogs share glass. */
body header #settingsMenu{background:var(--glass-menu);border-color:var(--glass-edge);-webkit-backdrop-filter:blur(8px) saturate(125%);backdrop-filter:blur(8px) saturate(125%)}
body dialog:is(#passwordDialog,#confirmDialog,#noticeDialog){background:var(--glass-surface);border-color:var(--glass-edge);box-shadow:0 24px 80px #0007,inset 0 1px 0 #ffffff66,inset 0 -1px 0 #ffffff14;-webkit-backdrop-filter:blur(8px) saturate(125%);backdrop-filter:blur(8px) saturate(125%)}

/* Destructive configuration confirmation uses a red action. */
body #confirmDialog[data-destructive="1"] #confirmAction{background:#b83145;border-color:#df6071;color:#fff;box-shadow:none}
body #confirmDialog[data-destructive="1"] #confirmAction:hover{background:#cc3c51;border-color:#ef8190}

/* Hover overlays stay visible across the live detail redraw. */
.pull-chart-plot{cursor:crosshair}.pull-chart-guide,.pull-chart-dot,.pull-chart-tooltip{position:absolute;pointer-events:none;z-index:2}.pull-chart-guide{top:0;bottom:0;border-left:1px dashed #b6d6e899}.pull-chart-dot{width:9px;height:9px;border:2px solid #edf8ff;border-radius:50%;background:var(--point-color);transform:translate(-50%,-50%)}.pull-chart-tooltip{z-index:3;white-space:nowrap;padding:6px 10px;border:1px solid #65869d;border-radius:6px;background:#081d30;color:#e4f2fa;box-shadow:0 3px 12px #0005;font:11px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}

/* Freeze shared chrome; only the middle row scrolls, including login screens. */
.pull-chart-stats{justify-content:flex-end;text-align:right}
html{height:100%;overflow:hidden;scrollbar-gutter:auto}
body,body.backend-locked{height:100vh;height:100dvh;min-height:0;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr) auto;row-gap:0}
body>header{grid-row:1;min-width:0}
body>main{grid-row:2;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-color:#526f86 #0a1d31}
body>.site-footer{grid-row:3;margin-top:0;position:relative;z-index:10}
body.backend-locked>#backendGate{grid-row:2;min-width:0;min-height:0;align-self:stretch;overflow:auto;padding:24px;place-items:safe center;overscroll-behavior:contain}
