/* One visual contract, loaded last. Blur is reserved for navigation and dialogs. */
:root,:root[data-theme=dark]{color-scheme:dark;--bg:#0b1220;--text:#f3f6fc;--sub:#a9b8cf;--accent:#83b7ff;--accent-strong:#0067dc;--green:#6fe2b5;--red:#ff9cab;--amber:#efc584;--surface:rgba(27,39,59,.82);--surface2:rgba(38,53,76,.75);--surface3:#23334b;--sidebar:rgba(20,31,49,.82);--outline:rgba(178,202,239,.18);--outline-strong:rgba(186,209,244,.3);--glass:rgba(25,38,59,.78);--input:#17263d;--shadow:0 12px 40px #02091830;--shadow-soft:0 5px 22px #02091820;--sheen:rgba(228,239,255,.13);--focus:#9ec7ff;--radius:24px;font-family:Vazirmatn,-apple-system,BlinkMacSystemFont,sans-serif}
:root[data-theme=light]{color-scheme:light;--bg:#edf2fa;--text:#172943;--sub:#526582;--accent:#075dc7;--accent-strong:#0067dc;--green:#126744;--red:#b32f49;--amber:#805409;--surface:rgba(255,255,255,.83);--surface2:rgba(235,242,251,.9);--surface3:#e6edf7;--sidebar:rgba(246,249,255,.8);--outline:rgba(73,105,150,.19);--outline-strong:rgba(57,91,138,.3);--glass:rgba(249,252,255,.76);--input:#f8faff;--shadow:0 12px 40px #31598712;--shadow-soft:0 5px 22px #3159870c;--sheen:rgba(255,255,255,.95);--focus:#075dc7}
:root[data-theme] body{font-family:Vazirmatn,-apple-system,BlinkMacSystemFont,sans-serif;line-height:1.8;letter-spacing:0;background:radial-gradient(ellipse at 8% 0%,#6b9cfc1c,transparent 46%),radial-gradient(ellipse at 95% 75%,#8ae1d516,transparent 50%),var(--bg);background-size:auto;color:var(--text)}
body::before{display:none}html{scroll-padding-block:110px 100px;scrollbar-gutter:stable}body{overflow-wrap:break-word}button,input,select,textarea,a{touch-action:manipulation}button,a.button,select,input:not([type=checkbox]):not([type=radio]){min-height:44px}button{font-weight:500;line-height:1.5;transition:background-color 140ms ease,border-color 140ms ease,transform 140ms ease}button:disabled{opacity:.55}button:not(:disabled):active{transform:scale(.98)}a{color:var(--accent)}:focus-visible{outline:3px solid var(--focus)!important;outline-offset:3px}button:focus:not(:focus-visible){outline:none}input[type=checkbox],input[type=radio]{accent-color:var(--accent-strong);width:20px;height:20px;flex:0 0 auto}input,select,textarea{font-size:16px!important;max-width:100%}textarea{font-family:inherit;resize:vertical}input::placeholder,textarea::placeholder{color:var(--sub)!important;opacity:.85}
:root[data-theme] .sidebar{background:var(--sidebar);border-color:var(--outline);box-shadow:var(--shadow-soft);backdrop-filter:blur(20px) saturate(145%);-webkit-backdrop-filter:blur(20px) saturate(145%)}
:root[data-theme] .topbar{margin:14px 18px;border:1px solid var(--outline);border-radius:25px;background:var(--glass)!important;padding:14px 20px;box-shadow:inset 0 1px var(--sheen),var(--shadow-soft);backdrop-filter:blur(20px) saturate(145%);-webkit-backdrop-filter:blur(20px) saturate(145%)}
:root[data-theme] .panel,:root[data-theme] .metric,:root[data-theme] .welcome,:root[data-theme] .metric-card{border:1px solid var(--outline);border-radius:var(--radius);background:linear-gradient(145deg,var(--sheen),transparent 45%),var(--surface)!important;box-shadow:inset 0 1px var(--sheen),var(--shadow-soft);backdrop-filter:none;-webkit-backdrop-filter:none;color:var(--text)}
:root[data-theme] .panel h2,:root[data-theme] .panel h3,:root[data-theme] .welcome h2,:root[data-theme] .metric b,:root[data-theme] .metric h2,:root[data-theme] .metric-head,:root[data-theme] .item strong{color:var(--text)}
:root[data-theme] .welcome p,:root[data-theme] .metric small,:root[data-theme] .item small,:root[data-theme] .setting small,:root[data-theme] .resource-metrics small,:root[data-theme] .delivery-stat span{color:var(--sub)}
.welcome{min-height:0;padding:28px!important}.welcome h2{font-size:clamp(24px,3.2vw,34px);line-height:1.5}.welcome p{max-width:65ch}.welcome::after{opacity:.35}.metric:hover,.item:hover{transform:none}.metricgrid{gap:14px}.metric-head span{background:var(--surface2);color:var(--accent);border-color:var(--outline)}
:root[data-theme] button,:root[data-theme] select{background:var(--surface2);border-color:var(--outline-strong);color:var(--text)}
:root[data-theme] button:hover:not(:disabled){background:var(--surface3);border-color:var(--accent)}
:root[data-theme] button.primary,:root[data-theme] .primary{background:linear-gradient(165deg,#006bd6,#0758b8)!important;border:1px solid #1766cd!important;color:white!important;box-shadow:inset 0 1px #ffffff40,0 5px 16px #0067dc24}
:root[data-theme] button.destructive{color:var(--red)!important;background:var(--surface2)!important;border-color:var(--outline-strong)!important}
:root[data-theme] input:not([type=checkbox]):not([type=radio]),:root[data-theme] textarea,:root[data-theme] select{color:var(--text);background:var(--input);border:1px solid var(--outline-strong);border-radius:13px;padding:11px 13px}
:root[data-theme] .sidebar .navbtn{color:var(--sub);background:transparent;border-color:transparent;min-height:46px;font-size:13px;gap:12px}
:root[data-theme] .sidebar .navbtn.active{color:var(--accent);border-color:var(--outline-strong);background:var(--surface2);box-shadow:inset 0 1px var(--sheen)}
.navbtn.active::before{display:none}.nav-icon{stroke-width:1.7}.nav-group-label{margin-block:12px 3px}.sidebar .brand{padding-bottom:18px}.sidebar .sidefoot{margin-top:16px}
:root[data-theme] .topactions .iconbtn,:root[data-theme] .version,:root[data-theme] .topbar-status{background:var(--surface2);color:var(--sub);border-color:var(--outline)}
:root[data-theme] .item,:root[data-theme] .service-card,:root[data-theme] .fleet-node,:root[data-theme] .fleet-candidate,:root[data-theme] .relay-candidate,:root[data-theme] .subscription-state,:root[data-theme] .fleet-result,:root[data-theme] .setting,:root[data-theme] .console-detail-cell,:root[data-theme] .resource-metrics>div,:root[data-theme] .delivery-stat{background:var(--surface2);border-color:var(--outline);color:var(--text);box-shadow:inset 0 1px var(--sheen);border-radius:17px}
.item>div{min-width:0}.item strong{white-space:normal;overflow-wrap:anywhere}.item .tools{flex-wrap:wrap;gap:8px}.item .tools button{min-height:44px;min-width:44px;font-size:12px}.item small,.item p{overflow-wrap:anywhere}.listitems{gap:10px}.listbar h2{margin-block:0 8px}.pager button{min-width:88px}.search{min-width:0;background:var(--input)!important}.search input{width:100%;min-width:0}.filter-tools{background:var(--surface2)!important}.filter-tools label{color:var(--sub)!important;min-height:44px}.filter-tools select{min-height:44px}
:root[data-theme] .quicklinks button,:root[data-theme] .quicklinks a{color:var(--text);background:var(--surface2);border-color:var(--outline);min-height:48px}.quicklinks button span{color:var(--accent)}
:root[data-theme] .quick-menu{background:var(--glass);border-color:var(--outline-strong);backdrop-filter:blur(22px) saturate(145%);-webkit-backdrop-filter:blur(22px) saturate(145%);box-shadow:inset 0 1px var(--sheen),var(--shadow)}
.management-nav{position:relative;gap:10px}.management-nav button{border-radius:14px;min-height:46px}.management-nav [aria-current],.management-nav [aria-pressed=true]{background:var(--surface3);color:var(--accent);outline:2px solid var(--accent);outline-offset:1px}
:root[data-theme] .auth-card,:root[data-theme] dialog{color:var(--text);background:var(--glass);border:1px solid var(--outline-strong);box-shadow:inset 0 1px var(--sheen),var(--shadow);backdrop-filter:blur(24px) saturate(140%);-webkit-backdrop-filter:blur(24px) saturate(140%)}
:root[data-theme] .auth-card h1,:root[data-theme] .auth-card p{color:var(--text)}.web-auth{background:var(--bg)!important}.auth-radar{opacity:.35}.auth-card{margin:16px;padding:30px!important}.auth-emblem img{filter:none}.sonar-dialog{overscroll-behavior:contain;max-height:calc(var(--visual-height,100dvh) - 32px);max-width:calc(100vw - 28px)}.sonar-dialog form{min-width:0}.sonar-dialog textarea{box-sizing:border-box}.dialog-actions{justify-content:flex-end}.dialog-actions button{flex:0 1 auto;min-width:100px}.sonar-dialog::backdrop{background:#07132878;backdrop-filter:blur(5px)}
:root[data-theme] #toast{background:var(--glass);color:var(--text);border-color:var(--outline-strong);box-shadow:var(--shadow);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);pointer-events:none}#toast{max-width:calc(100vw - 32px)}
.view.active{animation:liquid-enter 210ms cubic-bezier(.2,.8,.2,1)}@keyframes liquid-enter{from{opacity:.7;transform:translateY(6px)}to{opacity:1;transform:none}}
.route-loading{display:flex;align-items:center;gap:10px;min-height:72px;color:var(--sub)}.route-loading:before{content:'';width:18px;height:18px;border:2px solid var(--outline-strong);border-top-color:var(--accent);border-radius:50%;animation:liquid-spin .8s linear infinite}@keyframes liquid-spin{to{transform:rotate(360deg)}}
.skip-link{position:fixed;top:12px;inset-inline-start:12px;transform:translateY(-200%);z-index:400;background:var(--surface3);color:var(--text);border:2px solid var(--focus);border-radius:12px;padding:12px}.skip-link:focus{transform:none}.error-state,.empty-state{line-height:1.9;border-color:var(--outline-strong)}
:root[data-theme] .field-help summary{width:32px;height:32px;line-height:30px;background:var(--surface2);color:var(--sub);border-color:var(--outline-strong)}.field-help>p{padding:16px!important;max-height:45dvh;overflow:auto}.field-help[open]{z-index:90}label:has(>.field-help){padding-inline-end:40px}table{font-size:13px}.table-scroll{overscroll-behavior-x:contain}th,td{padding:14px 16px}summary{cursor:pointer;min-height:36px}.web-wizard{background:var(--surface2)!important;max-width:100%;gap:16px}label{line-height:1.7}.web-wizard label,.formline label{color:var(--text)!important}.soft-tag,.note,.info-strip{color:var(--sub)!important;background:var(--surface2)!important;border-color:var(--outline)!important}
@media(min-width:851px){.sidebar{width:260px;flex-basis:260px}.workspace{width:calc(100% - 260px)}main{padding-inline:clamp(20px,3vw,44px)}.topbar{top:12px}.field-help p{max-width:min(320px,65vw)}}
@media(max-width:850px){:root[data-theme] .topbar{top:0;margin:8px 10px;padding:12px 14px;padding-top:max(12px,env(safe-area-inset-top,0px),var(--app-safe-top,0px));border-radius:22px;min-height:76px}.nav-heading{min-width:0;gap:10px}.nav-heading h1{font-size:19px;line-height:1.5}.topbar .eyebrow{font-size:8px;letter-spacing:1px}.topactions{gap:6px}.topactions .iconbtn{width:44px;min-width:44px;height:44px}.topactions .version{display:none}.topbar-status{padding:5px 8px;font-size:10px}.workspace{width:100%;min-width:0}main{padding:18px 14px 26px}.panel{padding:19px}.shell{padding-bottom:calc(100px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)))}.metricgrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric{padding:16px 14px}.metric b{font-size:28px}.metric-head{font-size:12px}.welcome{padding:24px!important}.welcome h2{font-size:25px}.welcome-hint{display:none}.two-col{grid-template-columns:1fr}.resource-head{gap:12px}.resource-head label{width:100%}.resource-head select{width:100%}.resource-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.billing-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.item{gap:14px}.item .tools{width:100%}.item .tools button{flex:1 1 100px}.formline{gap:16px}.formline label{width:100%}.management-heading{gap:16px}.management-nav{gap:10px}.management-nav button{font-size:12px;flex:1 1 125px}.billing-form,.plan-wizard fieldset{grid-template-columns:1fr}.billing-form>button{width:100%}.dialog-actions button{flex:1}:root[data-theme] .bottom-nav{bottom:max(10px,env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px));left:12px;right:12px;min-height:72px;height:auto;padding:7px;border:1px solid var(--outline-strong);border-radius:26px;background:var(--glass);box-shadow:inset 0 1px var(--sheen),var(--shadow);backdrop-filter:blur(22px) saturate(160%);-webkit-backdrop-filter:blur(22px) saturate(160%)}.bottom-nav button{min-height:56px;font-size:11px!important;color:var(--sub)!important;gap:4px;border-radius:18px}.bottom-nav button.active{background:var(--surface2)!important;color:var(--accent)!important}.bottom-nav button span svg{width:22px;height:22px}.bottom-nav button.active span{color:var(--accent)!important}#toast{bottom:calc(100px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)))}body.keyboard-open .bottom-nav{display:none}body.keyboard-open #toast{bottom:16px}.field-help[open]>p{bottom:calc(105px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)))}.history-toolbar select{width:100%}.history-toolbar label{flex:1 1 180px}.auth-card{padding:24px!important}.web-auth{overflow:auto;overscroll-behavior:contain}.field-help summary{min-height:32px}}
@media(max-width:380px){main{padding-inline:10px}.nav-heading h1{font-size:17px}.topbar .eyebrow{display:none}.topbar-status{font-size:9px}.topbar .topactions{gap:4px}.metric-head{font-size:11px}.metric-head span{width:28px;height:28px}.panel{padding:16px}.metric-card strong{font-size:1.15rem}}
@media(hover:hover){button:hover:not(:disabled){transform:translateY(-1px)}.bottom-nav button:hover,.navbtn:hover{transform:none}}
@media(prefers-contrast:more){:root[data-theme]{--outline:#8092ae;--outline-strong:#8092ae;--surface:var(--bg);--glass:var(--bg);--surface2:var(--bg);--sub:var(--text)}.panel,.metric,.topbar,.bottom-nav{box-shadow:none!important}button{text-decoration-thickness:2px}}
@media(prefers-reduced-transparency:reduce){:root[data-theme]{--surface:var(--bg);--glass:var(--bg);--sidebar:var(--bg)}.sidebar,.topbar,.bottom-nav,.quick-menu,dialog{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.view.active{transform:none}.route-loading:before{animation:none;border-color:var(--accent)}button:active,button:hover{transform:none!important}}

[data-ux-denied=true]{display:none!important}.module-status button{margin:12px}.module-status{margin-bottom:16px}button[aria-busy=true]{cursor:progress}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.workspace-access-note{margin:0 0 16px}:root[data-theme] .chart-legend button,:root[data-theme] .service-actions button{min-height:44px}.topbar.is-offline{border-color:var(--amber)}

:root[data-theme] .view button{min-height:44px}.item>div>a{color:var(--text);text-decoration:none}.item>div>a:hover{color:var(--accent);text-decoration:underline;text-underline-offset:4px}.network-notice{margin-block:0 16px;border-color:var(--amber)!important}
/* Secondary copy must remain readable in the bright material, too. */
:root[data-theme] .welcome .eyebrow,:root[data-theme] .topbar .eyebrow,:root[data-theme] .brand small,:root[data-theme] .sidefoot,:root[data-theme] .sidefoot small,:root[data-theme] .navtitle{color:var(--sub)}
:root[data-theme] input::placeholder,:root[data-theme] textarea::placeholder{opacity:1}

@media(max-width:850px){main{padding-left:max(14px,env(safe-area-inset-left,0px));padding-right:max(14px,env(safe-area-inset-right,0px))}:root[data-theme] .bottom-nav{left:max(12px,env(safe-area-inset-left,0px));right:max(12px,env(safe-area-inset-right,0px))}}

/* Product UX, stage 1: overview actions, observed server health and navigation. */
.metric-link{display:flex;flex-direction:column;align-items:stretch;text-align:right;cursor:pointer;gap:8px;font:inherit;width:100%;position:relative}
.metric-link::after{content:'←';position:absolute;left:16px;bottom:14px;color:var(--accent);font-size:20px}
.metric-link small{padding-inline-end:24px}
.metric-link:focus-visible{outline:3px solid var(--focus)!important;outline-offset:4px}
.server-card.item{display:grid;grid-template-columns:minmax(0,1fr);justify-content:stretch;align-items:stretch;gap:14px;padding:18px;border-radius:22px;border:1px solid var(--outline);background:var(--surface);min-width:0}
.server-card>div:first-child{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.server-card>div:first-child>a{min-width:0;overflow-wrap:anywhere}
.server-card>div:first-child>small,.server-card .live-label{grid-column:1/-1}
.server-state{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:5px 10px;background:var(--surface2);font-size:12px;color:var(--sub);white-space:nowrap}
.server-state::before{content:'';width:7px;height:7px;border-radius:50%;background:currentColor}
.server-state[data-state=online]{color:var(--accent)}
.server-state[data-state=offline]{color:var(--red)}
.server-card-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.server-card-metric{min-width:0;background:var(--surface2);padding:10px;border-radius:12px}
.server-card-metric>div:first-child{display:flex;justify-content:space-between;gap:4px;font-size:12px;flex-wrap:wrap}
.server-card-metric meter{display:block;width:100%;height:10px;margin-top:6px}
.server-card-metric[data-fresh=false] meter{filter:grayscale(1);opacity:.6}
.server-meter-empty{height:5px;background:var(--outline);border-radius:6px;margin-top:9px}
.server-card-connection{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;font-size:12px;color:var(--sub);overflow-wrap:anywhere}
.server-card-note{grid-column:1/-1}
.server-card>.tools{justify-content:flex-end;border-top:1px solid var(--outline);padding-top:10px}
#navigation .nav-section{border:0;background:transparent;padding:0;min-width:0}
#navigation .nav-section>summary{list-style:none;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;cursor:pointer;color:var(--sub);font-size:12px;font-weight:650;border-radius:10px}
#navigation .nav-section>summary::-webkit-details-marker{display:none}
#navigation .nav-section>summary::after{content:'⌄';font-size:18px;transform:rotate(90deg)}
#navigation .nav-section[open]>summary::after{transform:none}
#navigation .nav-section-body{display:grid;gap:4px;padding-bottom:8px}
.sidebar .nav-section .nav-label{display:block}
.sidebar .nav-section .navbtn{justify-content:flex-start;font-size:14px;gap:10px}
@media(max-width:380px){.server-card.item{padding:12px}.server-card-metrics{gap:6px}.server-card-metric{padding:8px}.server-card-connection{grid-template-columns:1fr}.server-state{padding:5px 7px}}
.sidebar{overflow-y:auto;overscroll-behavior:contain}

/* Keep monitor fields in explicit tracks; generic flex shrinking overlaps numeric controls. */
#service-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}
#service-form>label{display:grid;gap:8px;min-width:0;width:100%;margin:0}
#service-form .service-address{grid-column:1/-1}
#service-form input,#service-form select{width:100%;min-width:0;min-height:48px;font-size:16px}
#service-form label>span{line-height:1.8;overflow-wrap:break-word}
#service-form>button{align-self:start;justify-self:start;min-height:48px;height:auto;max-width:100%;padding:12px 20px;line-height:1.6}
#service-target{text-align:left}
@media(max-width:620px){#service-form{grid-template-columns:minmax(0,1fr)}#service-form>button{justify-self:stretch}}

.agent-evidence{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.agent-evidence>div{min-width:0;padding:10px;border:1px solid var(--outline);border-radius:12px}
.agent-evidence dt{font-size:12px;color:var(--sub)}.agent-evidence dd{margin:6px 0 0;font-size:13px;line-height:1.9;overflow-wrap:anywhere}
.agent-evidence[data-state=fresh]>div:first-child{border-color:var(--accent)}
.agent-card-actions,.relay-sort-tools{display:flex;flex-wrap:wrap;gap:8px}.agent-card-actions button{min-height:44px}
.relay-dialog{width:min(640px,calc(100vw - 28px))}.relay-dialog form{display:grid;gap:18px}.relay-dialog label{display:grid;gap:10px;min-width:0}
.relay-dialog input{width:100%;min-width:0;min-height:48px;font:inherit;color:var(--text);background:var(--surface2);border:1px solid var(--outline);border-radius:12px;padding:10px}
.relay-dialog input[type=range]{padding:0;accent-color:var(--accent);direction:ltr}.relay-save-status{overflow-wrap:anywhere}
.relay-sort-list{padding:0;margin:0;list-style:none;display:grid;gap:12px}.relay-sort-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--outline);border-radius:14px;padding:12px;background:var(--surface2);cursor:grab}.relay-sort-row strong{min-width:0;overflow-wrap:anywhere}.relay-sort-tools{flex-shrink:0}.relay-sort-tools button{min-height:44px}.relay-pinned{border:1px solid var(--accent);padding:12px;border-radius:12px}
@media(max-width:620px){.relay-sort-row{flex-direction:column;align-items:stretch}.relay-sort-tools button{flex:1}.relay-order-actions button{width:100%;min-height:48px}}
/* Give the pinned central explanation its own track on narrow screens. */
.route-primary{display:grid;grid-template-columns:48px minmax(0,1fr) auto}
@media(max-width:640px){.route-primary{grid-template-columns:48px minmax(0,1fr)}.route-primary .route-status{grid-column:2;margin:0;justify-self:start}}
@media(max-width:620px){.agent-evidence{grid-template-columns:repeat(2,minmax(0,1fr))}.agent-evidence>div:nth-child(3),.agent-evidence>div:nth-child(4),.agent-evidence>div:last-child{grid-column:1/-1}}
.agent-card .relay-candidate-head strong,.agent-card .fleet-node-title strong{color:var(--text)}

#incident-filter{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;width:100%}
#incident-filter label{display:grid;gap:8px;min-width:0;color:var(--text)}#incident-filter input,#incident-filter select{width:100%;min-width:0;min-height:46px;background:var(--surface2);color:var(--text);border:1px solid var(--outline);border-radius:12px;padding:10px;font:inherit}
.server-tabs{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0}.server-tabs button{min-height:46px;flex:1 1 110px}.server-tabs [aria-selected=true]{border-color:var(--accent);color:var(--accent)}
.connection-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.connection-facts>div{padding:12px;background:var(--surface2);border:1px solid var(--outline);border-radius:14px;min-width:0}.connection-facts dt{color:var(--sub)}.connection-facts dd{margin:8px 0 0;line-height:1.9;overflow-wrap:anywhere}
.incident-timeline{padding-inline-start:24px}.incident-timeline li{padding:12px;border-inline-start:2px solid var(--accent);margin:12px 0;overflow-wrap:anywhere}.incident-dialog{width:min(720px,calc(100vw - 28px))}.incident-dialog h3{overflow-wrap:anywhere}#server-recorded-history li{margin-block:12px;overflow-wrap:anywhere}#server-recorded-history>button{display:block;max-width:100%;margin-block:12px;text-align:start;overflow-wrap:anywhere}
@media(max-width:620px){#incident-filter,.connection-facts{grid-template-columns:minmax(0,1fr)}.server-tabs{gap:8px}.server-tabs button{flex:1 1 100px}}

#config-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;width:100%}
#config-filters label{display:grid;gap:8px;min-width:0;color:var(--text)}#config-filters input,#config-filters select{width:100%;min-width:0;min-height:46px;background:var(--surface2);color:var(--text);border:1px solid var(--outline);border-radius:12px;padding:10px;font:inherit}#config-filters>p{grid-column:1/-1;line-height:1.9}
.global-search-dialog{width:min(720px,calc(100vw - 28px))}.global-search-dialog>label{display:grid;gap:12px}.global-search-dialog input{width:100%;min-width:0;min-height:48px;padding:12px;background:var(--surface2);color:var(--text);border:1px solid var(--outline);border-radius:12px;font:inherit}
.global-search-result{display:grid;gap:8px;padding:14px;margin:10px 0;border:1px solid var(--outline);border-radius:14px;background:var(--surface2);color:var(--text);text-decoration:none;min-width:0;overflow-wrap:anywhere}.global-search-result small{color:var(--sub)}.global-search-result:focus-visible{outline:3px solid var(--accent);outline-offset:3px}#global-search-results section{margin-block:24px}.search-target{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:620px){#config-filters{grid-template-columns:minmax(0,1fr)}}
#config-filters input,#config-filters select,.global-search-dialog input{font-size:16px}

.action-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:44px;max-width:100%;white-space:normal!important;overflow-wrap:anywhere;vertical-align:middle}
.action-icon{display:inline-block;width:18px;height:18px;flex:0 0 18px;pointer-events:none}.action-button[data-action-icon-only=true]{padding:10px}
:root[data-theme] .action-button[data-action-variant=destructive]{color:var(--red);border-color:var(--red)}
.action-button[data-action-state=error]::after{content:'ناموفق';font-size:11px}.action-button[data-action-state=success]::after{content:'انجام شد';font-size:11px}
.action-button[data-action-state=busy]::after{content:'';display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-inline-end-color:transparent;border-radius:50%;animation:action-spin .8s linear infinite}
@keyframes action-spin{to{transform:rotate(360deg)}}
:root[data-theme] .action-button[data-action-state=error]{border-color:var(--red)}:root[data-theme] .action-button[data-action-state=success]{border-color:var(--green)}
@media(max-width:620px){.formline{display:grid;grid-template-columns:minmax(0,1fr);align-items:start}.formline>label{min-width:0;max-width:100%}.formline>button{justify-self:stretch;align-self:start}.formline input,.formline select,.formline textarea{width:100%;min-width:0}}
@media(max-width:850px){.sonar-dialog[open],#ssh-terminal-dialog[open]{--modal-top-gap:max(12px,calc(var(--app-safe-top,0px) + 8px));--modal-bottom-gap:max(12px,calc(var(--app-safe-bottom,0px) + 8px));position:fixed;top:calc(var(--visual-top,0px) + var(--modal-top-gap));bottom:auto;margin-block:0;max-height:calc(var(--visual-height,100dvh) - var(--modal-top-gap) - var(--modal-bottom-gap));overflow:auto;overscroll-behavior:contain}}
.context-help{margin-block:0 18px;padding:14px 18px;border:1px solid var(--outline);border-radius:18px;background:var(--surface2);color:var(--text);min-width:0}.context-help>summary{cursor:pointer;min-height:44px;line-height:1.9;color:var(--text);overflow-wrap:anywhere}.context-help p{line-height:1.9;color:var(--sub);overflow-wrap:anywhere}.context-help .context-state-note{color:var(--text);border-inline-start:3px solid var(--amber);padding-inline-start:12px}.context-guide article{border-top:1px solid var(--outline);padding-block:16px}.context-guide p{max-height:none}.context-help .quicklinks>button{min-height:48px}
@media(max-width:620px){.context-help{padding:12px}.context-help .quicklinks>button{width:100%}}

/* Full navigation drawer, shared by the header and mobile dock. */
html:has(body.menu-open) { overflow: hidden; scrollbar-gutter: auto; }

#nav-scrim {
  z-index: 100;
  background: rgb(4 9 19 / 58%);
  opacity: 1;
  transition: opacity 180ms ease-out, display 180ms allow-discrete;
}

.quick-menu {
  --drawer-offset: 100%;
  position: fixed;
  z-index: 101;
  inset-block-start: var(--visual-top, 0px);
  inset-inline-start: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  inline-size: min(430px, calc(100% - 28px));
  block-size: var(--visual-height, 100dvh);
  padding-block-start: max(env(safe-area-inset-top), var(--app-safe-top, 0px));
  padding-block-end: max(env(safe-area-inset-bottom), var(--app-safe-bottom, 0px));
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  border-inline-end: 1px solid var(--outline-strong);
  border-start-end-radius: 24px;
  border-end-end-radius: 24px;
  background: var(--bg);
  color: var(--text);
  translate: 0;
  transition: translate 250ms cubic-bezier(.22,.72,.24,1), display 250ms allow-discrete;
}

.quick-menu:dir(ltr) { --drawer-offset: -100%; }
.quick-menu:dir(rtl) {
  padding-inline: env(safe-area-inset-right) env(safe-area-inset-left);
}
#nav-scrim[hidden] { opacity: 0; pointer-events: none; }
.quick-menu[hidden] { translate: var(--drawer-offset); pointer-events: none; }

@starting-style {
  #nav-scrim:not([hidden]) { opacity: 0; }
  .quick-menu:not([hidden]) { translate: var(--drawer-offset); }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(12px, 4vw, 24px);
  border-bottom: 1px solid var(--outline);
}

.drawer-header h2 { margin: 0; font-size: 1.25rem; }

.drawer-links {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px clamp(12px, 4vw, 24px) 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-group h3 {
  margin: 0 0 8px;
  color: var(--sub);
  font-size: .85rem;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 8px;
}

.quick-menu .drawer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--outline);
  border-radius: 12px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  line-height: 1.5;
  text-align: start;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.drawer-item .nav-icon { flex: 0 0 18px; width: 18px; height: 18px; }
:root[data-theme] .quick-menu .drawer-item:hover,
:root[data-theme] .quick-menu .drawer-item[aria-current="page"] {
  border-color: var(--accent);
  background: var(--surface3);
  color: var(--accent);
}
@media (hover: hover) {
  .quick-menu .drawer-item:hover { transform: translateY(-1px); }
}

.quick-menu .drawer-item:active { transform: scale(.98); }

.sidebar { border-left: 0; border-inline-end: 1px solid var(--outline); }
.sidebar .navbtn { text-align: start; }
#navigation .nav-section>summary { transition: background-color 140ms ease; }
#navigation .nav-section>summary:hover { background: var(--surface2); }

#overview .resource-head { gap: 12px 16px; flex-wrap: wrap; }
#overview .history-toolbar { align-items: end; }
#overview .history-toolbar > *,
#overview .resource-head > * { min-width: 0; max-width: 100%; }

@media (max-width: 850px) {
  #side-navigation { display: none; }
  .topbar .nav-heading { flex: 1; }
  .topbar .nav-heading > div { min-width: 0; }
  .topbar .nav-heading h1 { overflow-wrap: anywhere; }
  .topbar .topactions { flex-shrink: 0; }
}

.topbar { flex-wrap: wrap; gap: 10px 16px; }
.topbar #workspace-selector { min-width: 0; max-width: 100%; font-size: .875rem; }

@media (min-width: 851px) {
  #side-navigation .navbtn .nav-label,
  #side-navigation .brand > div:last-child { display: block; }
  #side-navigation .navbtn { justify-content: flex-start; }
}

@media (max-width: 850px) {
  .topbar #workspace-selector { flex: 0 0 100%; font-size: 16px; }
}

.web-auth:not([hidden]) .auth-card {
  animation: auth-card-in 340ms cubic-bezier(.2,.75,.25,1) both;
}

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.auth-form { text-align: start; }
.auth-form #login-code { text-align: left; }

@media (min-width: 761px) and (max-width: 850px) {
  .bottom-nav {
    display: grid;
    position: fixed;
    z-index: 50;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .bottom-nav button {
    display: grid;
    justify-items: center;
    align-content: center;
    padding: 4px;
    border: 0;
  }
}

body:not([data-authenticated="true"]) #bottom-nav,
body:not([data-authenticated="true"]) .skip-link { visibility: hidden; }

#menu-trigger,
#drawer-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
}

#menu-trigger svg,
#drawer-close svg { width: 20px; height: 20px; }

.topbar .iconbtn,
.bottom-nav button,
.quick-menu button { transition: transform 140ms ease; }

:root[data-theme] .bottom-nav button { background: transparent; }
:root[data-theme] .bottom-nav button:hover { color: var(--accent) !important; }

/* Keep the summary and its controls on the same spacing rhythm. */
#overview {
  --overview-gap: clamp(14px, 2vw, 22px);
}

#overview > .welcome,
#overview > .metricgrid,
#overview > .panel {
  margin-block: 0 var(--overview-gap);
}

#overview > .metricgrid { gap: var(--overview-gap); }

#overview .metric-link {
  text-align: start;
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}

#overview .metric-link b { font-variant-numeric: tabular-nums; }
#overview .metric-link::after { inset-inline-end: 16px; left: auto; }
#overview .resource-head :is(h2, h3, p) { margin-block: 0; }
#overview .resource-head p { margin-block-start: 4px; }

@media (hover: hover) {
  :root[data-theme] #overview .metric-link:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
}

@media (max-width: 480px) {
  #overview .welcome { padding: 18px !important; }
  #overview .metric-link { padding: 12px; }
  #overview .metric-link::after { inset-inline-end: 12px; }
}
