/* Three cool, low-saturation porcelain palettes, each with light and dark tokens. */
html[data-palette=celadon]{--p-bg:#F3F5F4;--p-card:#FCFDFD;--p-accent:#739A89;--p-warn:#C8947E}
html[data-theme=dark][data-palette=celadon]{--p-bg:#181B1A;--p-card:#202423;--p-accent:#7FA695;--p-warn:#CFA08C}
html[data-palette=mist-blue]{--p-bg:#F2F5F7;--p-card:#FCFDFE;--p-accent:#6E8FA8;--p-warn:#C69582}
html[data-theme=dark][data-palette=mist-blue]{--p-bg:#171A1D;--p-card:#1F2327;--p-accent:#7C9DB6;--p-warn:#CFA08E}
html[data-palette=washi]{--p-bg:#F5F5F4;--p-card:#FFFFFF;--p-accent:#7E8B87;--p-warn:#C39382}
html[data-theme=dark][data-palette=washi]{--p-bg:#191919;--p-card:#212121;--p-accent:#8D9A96;--p-warn:#CC9E8D}
html[data-palette]{--p-sub:color-mix(in srgb,var(--p-bg) 50%,var(--p-card));--p-border:rgba(50,57,55,.08);--p-text:#323937;--p-subtext:#7C8683;--p-helper:#A3ACA9;--p-soft:color-mix(in srgb,var(--p-bg) 82%,var(--p-accent) 18%);--p-soft-text:color-mix(in srgb,var(--p-text) 50%,var(--p-accent) 50%);--p-secondary:#C8947E}
html[data-theme=dark][data-palette]{--p-border:rgba(235,240,238,.08);--p-text:#E2E7E5;--p-subtext:#8E9895;--p-helper:#8E9895;--p-soft:color-mix(in srgb,var(--p-card) 80%,var(--p-accent) 20%);--p-soft-text:var(--p-text);--p-secondary:var(--p-warn)}
html[data-palette] body,html[data-palette] #view{background:var(--p-bg)!important;color:var(--p-text)}
html[data-palette] body #view{--bg:var(--p-bg);--text:var(--p-text);--ink:var(--p-text);--sub:var(--p-subtext);--line:var(--p-border);--surface:var(--p-card);--plain-bg:var(--p-card);--glass-bg:var(--p-card);--glass-bg-hover:var(--p-soft);--glass-brd:var(--p-border);--glass-shd:0 2px 10px rgba(50,57,55,.03);--glass-fil:none;--accent:var(--p-accent);--danger:var(--p-warn);--border-strong:color-mix(in srgb,var(--p-accent) 30%,transparent);--soft:var(--p-soft);--hover:var(--p-soft);font-family:Inter,-apple-system,BlinkMacSystemFont,'PingFang SC','Hiragino Sans GB',sans-serif}
html[data-palette] .topbar{background:color-mix(in srgb,var(--p-bg) 90%,transparent);border-bottom:1px solid var(--p-border);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
html[data-palette] main#view{padding-top:24px}
html[data-palette] .stat,html[data-palette] .node,html[data-palette] .node.in:hover,html[data-palette] .chart-block{background:var(--p-card);border:1px solid var(--p-border);border-radius:14px;box-shadow:0 2px 10px rgba(50,57,55,.03);backdrop-filter:none}
html[data-palette] .region-chip{background:var(--p-soft);color:var(--p-subtext);border:1px solid transparent}
html[data-palette] .region-chip.on{background:var(--p-accent);color:#fff;border-color:transparent;font-weight:700}
html[data-palette] .node .badge{background:var(--p-soft);border:0;color:var(--p-soft-text)}
html[data-palette] .node .pill{background:color-mix(in srgb,var(--p-accent) 12%,transparent);border:0;color:var(--p-soft-text)}
html[data-palette] .node .pill:not(.off) .dot{background:var(--p-accent)}
html[data-palette] .node-titleline .nm,html[data-palette] .stat .big{font-family:Inter,-apple-system,BlinkMacSystemFont,'PingFang SC','Hiragino Sans GB',sans-serif;color:var(--p-text)}
html[data-palette] .node-titleline .os{font-family:Inter,-apple-system,BlinkMacSystemFont,'PingFang SC','Hiragino Sans GB',sans-serif;color:var(--p-helper)}
html[data-palette] .meter .lab .mk .ic{display:none}
html[data-palette] .meter .track{height:4px;border-radius:999px;background:color-mix(in srgb,var(--p-accent) 14%,transparent)}
html[data-palette] .meter .fill{border-radius:999px;background:var(--p-accent)}
html[data-palette] .meter .lab{font:400 13px/1.4 Inter,-apple-system,BlinkMacSystemFont,'PingFang SC','Hiragino Sans GB',sans-serif;color:var(--p-subtext);letter-spacing:0;margin-bottom:9px}
html[data-palette] .meter .lab .mk{gap:0}
html[data-palette] .meter .lab .p{font-size:14px;color:var(--p-text)}
html[data-palette] .meter .val{font-size:12px;color:var(--p-helper)}
html[data-palette] .netbox{border-top-color:var(--p-border)}
html[data-palette] .netbox .row,html[data-palette] .netbox .row.cum,html[data-palette] .stat .pair{color:var(--p-text)}
html[data-palette] .net-down,html[data-palette] .netbox .nr svg,html[data-palette] .netbox .ar svg{color:var(--p-accent)}
html[data-palette] .net-up,html[data-palette] .netbox .nt svg,html[data-palette] .netbox .at svg{color:var(--p-secondary)}
html[data-palette] .pingbox .pg{border:0;background:var(--p-soft);color:var(--p-subtext)}
html[data-palette] .pingbox .pg b{color:var(--p-text)}
html[data-palette] .pingbox .pg i,html[data-palette] .pingbox .pg.bad b{color:var(--p-warn)}
html[data-palette] .probe-strip{gap:2px;padding-block:3px}
html[data-palette] .probe-cell{width:3px;min-width:3px;max-width:3px;height:7px;border-radius:1.5px}
html[data-palette] .probe-cell.latency.low,html[data-palette] .probe-cell.loss.low{background:var(--p-accent)}
html[data-palette] .probe-cell.latency.medium,html[data-palette] .probe-cell.latency.high,html[data-palette] .probe-cell.loss.medium,html[data-palette] .probe-cell.loss.high,html[data-palette] .probe-cell.timeout{background:var(--p-warn)}
html[data-palette] .probe-cell.missing{background:var(--p-soft)}
html[data-palette] .probe-head-cell .metric-key{display:none}
html[data-palette] .probe-value,html[data-palette] .probe-summary{font-variant-numeric:tabular-nums;color:var(--p-subtext)}
html[data-palette] .probe-summary{color:var(--p-text)}
html[data-palette] #nodeList .d-row,html[data-palette] #nodeList .secret-details{background:var(--p-card);border-color:var(--p-border)}
html[data-palette] #nodeList .nm{color:var(--p-text)}
html[data-palette] .admin-node-id,html[data-palette] #nodeList .cmdwrap,html[data-palette] #nodeList .ssh-cmdwrap{background:var(--p-soft);border-color:var(--p-border)}
html[data-palette] .admin-region,html[data-palette] .admin-ip{color:var(--p-subtext)}
html[data-palette] .kuro-intro{background:var(--p-bg);color:var(--p-text)}
.api-token-create,.api-token-row{display:flex;align-items:center;gap:12px;margin:12px 0}.api-token-create input,.api-token-row span{min-width:0;flex:1}.api-token-row span{overflow-wrap:anywhere}.api-token-row button{flex-shrink:0}.api-token-once{margin:14px 0;padding:14px;border:1px solid var(--line);border-radius:8px}.api-token-once code{display:block;overflow-wrap:anywhere;margin:10px 0;font-size:12px}.api-token-once button+button{margin-left:8px}
/* Detail labels and chart headings need breathing room from their borders. */
html[data-palette] .view-detail .detail-region{padding:4px 10px;line-height:1.6}
html[data-palette] .view-detail .chart-block{padding:20px 20px 18px}
html[data-palette] .view-detail .chart-block .cap{display:flex;align-items:center;gap:8px;margin-bottom:14px;line-height:1.6}
html[data-palette] .view-detail .chart-block .cap svg{flex-shrink:0}
html[data-palette] .view-detail .range{padding:7px 14px;line-height:1.5}
html[data-palette] .view-detail .detail-field .k{margin-bottom:8px}
@media(max-width:640px){html[data-palette] .view-detail .chart-block{padding:18px 14px 16px}}
/* Palette dots are intentionally tiny and independent of the day/night toggle. */
.palette-switch{display:flex;align-items:center;gap:3px;margin:0 4px}.palette-switch button{width:18px;height:24px;padding:0;border:0;background:none;color:var(--p-accent,var(--sub));font-size:14px;line-height:1;opacity:.42;cursor:pointer}.palette-switch button[aria-pressed=true]{opacity:1;transform:scale(1.18)}.palette-switch button[data-palette=celadon]{color:#739A89}.palette-switch button[data-palette=mist-blue]{color:#6E8FA8}.palette-switch button[data-palette=washi]{color:#7E8B87}
@media(max-width:520px){.palette-switch{gap:0;margin:0 1px}.palette-switch button{width:16px;font-size:12px}}

html[data-palette] .node{opacity:1;transform:none;transition:none}
html[data-palette] .node-egress{font-size:12px;color:var(--p-subtext);margin-top:12px}
/* Reference card: stacked identity, two-column resources, one quality strip per carrier. */
html[data-palette]{--accent-primary:var(--p-accent);--accent-warn:var(--p-warn);--text-secondary:var(--p-subtext)}
html[data-palette] .node{padding:18px;border-radius:18px}
html[data-palette] .node-titleline{display:flex;flex-direction:column;align-items:flex-start;gap:5px;margin:0 0 12px;min-width:0}
html[data-palette] .node-titleline .nm{font-size:20px;font-weight:600;letter-spacing:0;max-width:100%}
html[data-palette] .node-titleline .os{font-size:13px;font-weight:400;letter-spacing:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-palette] .expiryline:has(.exp:empty){display:none}
html[data-palette] .expiryline{font-size:11px;color:var(--p-subtext);margin-bottom:12px}
html[data-palette] .node .node-meta{justify-content:space-between;margin-bottom:12px}
html[data-palette] .node .badge{padding:5px 8px;font-size:12px;letter-spacing:0;background:color-mix(in srgb,var(--p-card) 94%,var(--p-accent) 6%)}
html[data-palette] .node .badge .node-tag{color:inherit;transform:none}
html[data-palette] .node .pill{font-size:12px;padding:5px 9px;letter-spacing:0}
html[data-palette] .meters{gap:18px}
html[data-palette] .meter .val{letter-spacing:0;white-space:nowrap;font-variant-numeric:tabular-nums}
html[data-palette] .meter .lab .p{font-weight:600}
html[data-palette] .netbox{margin-top:18px;padding-top:14px;position:relative}
html[data-palette] .netbox:after{content:'';position:absolute;left:50%;top:14px;bottom:0;border-left:1px solid var(--p-border)}
html[data-palette] .card-ping-chart{margin-top:18px;padding-top:12px;border-top:1px solid var(--p-border)}
html[data-palette] .card-chart-item{display:grid;grid-template-columns:56px minmax(0,1fr) max-content max-content;gap:6px;align-items:center;overflow:visible;min-height:16px}
html[data-palette] .card-chart-item + .card-chart-item{margin-top:7px}
html[data-palette] .card-chart-head,html[data-palette] .probe-head-cell{display:contents}
html[data-palette] .card-chart-cap{grid-column:1;grid-row:1;font-size:12px;letter-spacing:0;white-space:nowrap}
html[data-palette] .probe-pair{grid-column:2;grid-row:1;display:block;min-width:0}
html[data-palette] .probe-strip{padding:0;height:15px;gap:2px;align-items:center;justify-content:flex-start}
html[data-palette] .probe-cell{flex:1 1 3px;min-width:1px;max-width:3px;height:7px;width:3px;border-radius:1.5px}
html[data-palette] .latency-summary{grid-column:3;grid-row:1;text-align:right}
html[data-palette] .loss-summary{grid-column:4;grid-row:1}
html[data-palette] .probe-value{font-size:12px;font-weight:400;white-space:nowrap;color:var(--text-secondary);font-variant-numeric:tabular-nums}
html[data-palette] .loss-summary{text-align:right}
@media(max-width:360px){html[data-palette] .card-chart-item{gap:4px;grid-template-columns:52px minmax(0,1fr) max-content max-content}html[data-palette] .probe-strip{gap:1px}html[data-palette] .probe-cell{min-width:0}}
html[data-palette] .loss-summary:before{content:'· ';color:var(--p-helper)}
html[data-palette] .loss-summary:after{content:' 丢包'}
html[data-palette] .probe-warning .latency-summary,html[data-palette] .loss-summary.loss-warning{color:var(--accent-warn);font-weight:600}
html[data-palette] .metric-key{display:none}
.palette-control{display:flex;align-items:center;gap:12px;margin-bottom:18px}.palette-label{font-size:12px;color:var(--sub)}
.palette-switch button{width:auto;height:32px;padding:4px 8px;font-size:13px}.palette-switch button:after{content:attr(title);margin-left:5px;font-size:12px}.palette-switch{flex-wrap:wrap}
html[data-palette] .node .badge.rg{justify-content:center;padding-inline:8px}
html[data-palette] .node .badge .node-tag{display:inline-flex;align-items:center;justify-content:center;margin:0;line-height:1.4}
html[data-palette] .node-subline{display:flex;align-items:baseline;justify-content:space-between;gap:10px;width:100%;min-width:0}
html[data-palette] .node-subline .os{min-width:0;flex:1}
html[data-palette] .node-subline .exp{flex:none;font-size:11px;white-space:nowrap;color:var(--p-subtext)}
html[data-palette] .node-subline .exp:empty{display:none}
html[data-palette] .card-chart-cap{overflow:visible!important;text-overflow:clip!important;text-align:center!important}
html[data-palette] .probe-cell.probe-selected,html[data-palette] .probe-cell:focus-visible{transform:scaleY(1.85);outline:2px solid var(--p-text);outline-offset:-1px;box-shadow:0 0 0 1px var(--p-card);border-radius:1px;z-index:2}
html[data-palette] .region-filter{mask-image:none}
@font-face{font-family:'Kuro Sans';src:url('fonts/noto-sans-sc-medium.woff2') format('woff2');font-weight:500;font-style:normal;font-display:swap}
html[data-palette] .node-titleline .nm{font-family:'Kuro Sans',sans-serif;font-weight:500}
.tag-token[draggable]{cursor:grab}.tag-grip{display:inline-flex;padding:4px 6px;touch-action:none;cursor:grab}.tag-token.sort-over{outline:2px solid var(--accent)}
.operator-results{white-space:pre-wrap;overflow-wrap:anywhere}.operator-node{margin-top:12px;min-width:0}.operator-node code{overflow-wrap:anywhere}#operatorKeysInput{font:11px/1.6 monospace;overflow-wrap:anywhere}
