/* ArkEagle watchdog look. TOKENS + COMPONENTS copied from docs/plans/eu-006-watchdog-phone-app/mockup/watchdog-look.html (B8); the product additions are at the bottom. */
/* ===================================================================== TOKENS ===
   Same names and values as arkcrm/frontend/src/index.css (space-separated RGB triplets).
   Follows the phone's light/dark setting; ?theme=light|dark forces one (mock-up only). */
:root{
  --surface:255 255 255; --surface-canvas:237 240 245; --surface-muted:249 250 251; --surface-subtle:243 244 246; --surface-strong:229 231 235; --surface-raised:255 255 255;
  --foreground:17 24 39; --foreground-secondary:55 65 81; --foreground-body:75 85 99; --foreground-muted:92 100 114; --foreground-faint:138 148 162;
  --separator:229 231 235; --border-strong:209 213 219; --border-control:209 213 219;
  --link:37 99 235; --segment-track:229 231 235; --segment-thumb:255 255 255;
  --primary-500:59 130 246; --primary-600:37 99 235; --on-primary:255 255 255;
  --success-fill:220 252 231; --success-text:22 101 52; --success-solid:22 163 74;
  --warning-fill:254 243 199; --warning-text:146 64 14; --warning-solid:217 119 6;
  --danger-fill:254 226 226; --danger-text:153 27 27; --danger-solid:220 38 38;
  --info-fill:219 234 254; --info-text:30 64 175; --info-solid:37 99 235;
  --neutral-fill:243 244 246; --neutral-text:55 65 81; --neutral-solid:92 100 114;
  --shadow-sm:0 1px 2px 0 rgb(0 0 0 / .05); --shadow-xl:0 20px 25px -5px rgb(0 0 0 / .1),0 8px 10px -6px rgb(0 0 0 / .1);
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
:root[data-theme="dark"]{
  --surface:17 24 39; --surface-canvas:3 7 18; --surface-muted:3 7 18; --surface-subtle:31 41 55; --surface-strong:94 102 116; --surface-raised:17 24 39;
  --foreground:249 250 251; --foreground-secondary:229 231 235; --foreground-body:209 213 219; --foreground-muted:156 163 175; --foreground-faint:139 147 161;
  --separator:38 48 65; --border-strong:156 163 175; --border-control:107 114 128;
  --link:96 165 250; --segment-track:31 41 55; --segment-thumb:75 85 99;
  --success-fill:20 50 47; --success-text:134 239 172; --success-solid:34 197 94;
  --warning-fill:51 44 35; --warning-text:252 211 77; --warning-solid:245 158 11;
  --danger-fill:50 31 43; --danger-text:252 165 165; --danger-solid:239 68 68;
  --info-fill:23 40 70; --info-text:147 197 253; --info-solid:59 130 246;
  --neutral-fill:31 41 55; --neutral-text:229 231 235; --neutral-solid:156 163 175;
  --shadow-sm:0 0 0 0 transparent; --shadow-xl:0 20px 25px -5px rgb(0 0 0 / .5);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --surface:17 24 39; --surface-canvas:3 7 18; --surface-muted:3 7 18; --surface-subtle:31 41 55; --surface-strong:94 102 116; --surface-raised:17 24 39;
    --foreground:249 250 251; --foreground-secondary:229 231 235; --foreground-body:209 213 219; --foreground-muted:156 163 175; --foreground-faint:139 147 161;
    --separator:38 48 65; --border-strong:156 163 175; --border-control:107 114 128;
    --link:96 165 250; --segment-track:31 41 55; --segment-thumb:75 85 99;
    --success-fill:20 50 47; --success-text:134 239 172; --success-solid:34 197 94;
    --warning-fill:51 44 35; --warning-text:252 211 77; --warning-solid:245 158 11;
    --danger-fill:50 31 43; --danger-text:252 165 165; --danger-solid:239 68 68;
    --info-fill:23 40 70; --info-text:147 197 253; --info-solid:59 130 246;
    --neutral-fill:31 41 55; --neutral-text:229 231 235; --neutral-solid:156 163 175;
    --shadow-sm:0 0 0 0 transparent; --shadow-xl:0 20px 25px -5px rgb(0 0 0 / .5);
  }
}

/* ================================================================= COMPONENTS === */
*{box-sizing:border-box}
html{font-family:'Inter',system-ui,sans-serif;-webkit-text-size-adjust:100%}
body{margin:0;background:rgb(var(--surface-canvas));color:rgb(var(--foreground));font-size:15px;line-height:20px;font-optical-sizing:auto;-webkit-font-smoothing:antialiased}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;touch-action:manipulation}
h1,h2,h3,p,ul,dl,dd{margin:0;padding:0}
ul{list-style:none}
.ic{flex:none;display:block}
.mono{font-family:var(--mono)}
.hidden{display:none!important}
:focus-visible{outline:2px solid rgb(var(--primary-500));outline-offset:2px}

/* tone helpers: set the three tone colours once, components read them */
.tone-success{--tf:var(--success-fill);--tt:var(--success-text);--ts:var(--success-solid)}
.tone-warning{--tf:var(--warning-fill);--tt:var(--warning-text);--ts:var(--warning-solid)}
.tone-danger{--tf:var(--danger-fill);--tt:var(--danger-text);--ts:var(--danger-solid)}
.tone-info{--tf:var(--info-fill);--tt:var(--info-text);--ts:var(--info-solid)}
.tone-neutral{--tf:var(--neutral-fill);--tt:var(--neutral-text);--ts:var(--neutral-solid)}

/* ---- top bar: phone = two rows (brand + Alerts, then segmented tabs); PC = one row ---- */
.topbar{position:sticky;top:0;z-index:20;background:rgb(var(--surface) / .85);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-bottom:1px solid rgb(var(--separator))}
.topbar-in{display:grid;grid-template-columns:1fr auto;grid-template-areas:"brand alerts" "tabs tabs";align-items:center;gap:6px 12px;max-width:1440px;margin:0 auto;padding:8px 16px}
.brand{grid-area:brand;display:flex;align-items:center;gap:8px;min-width:0}
.brand h1{font-size:17px;line-height:22px;font-weight:600;letter-spacing:-.01em}
.light{width:10px;height:10px;border-radius:50%;flex:none;background:rgb(var(--ts));box-shadow:0 0 0 3px rgb(var(--tf))}
.light.tone-neutral{background:rgb(var(--foreground-faint))}
.alerts-btn{position:relative}
.topbar-r{grid-area:alerts;justify-self:end;display:flex;align-items:center;gap:8px}
.theme-btn{padding:0 10px}
.theme-lbl{display:none}
.alerts-btn .on-dot{position:absolute;top:8px;left:26px;width:8px;height:8px;border-radius:50%;background:rgb(var(--success-solid));box-shadow:0 0 0 2px rgb(var(--info-fill))}
.seg{grid-area:tabs;display:flex;gap:2px;padding:3px;border-radius:12px;background:rgb(var(--segment-track))}
.seg>button,.seg>label{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 12px;border:0;border-radius:10px;background:transparent;color:rgb(var(--foreground-muted));font-size:15px;line-height:20px;font-weight:600;white-space:nowrap}
.seg>button[aria-selected="true"],.seg>label:has(input:checked){background:rgb(var(--segment-thumb));color:rgb(var(--foreground));box-shadow:var(--shadow-sm)}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg.sm{grid-area:auto;display:inline-flex}
.seg.sm>button,.seg.sm>label{flex:none;padding:0 14px}

/* ---- buttons: one filled per area; tinted is the usual second action ---- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 16px;border:0;border-radius:12px;font-size:15px;line-height:20px;font-weight:600;white-space:nowrap;background:rgb(var(--surface-subtle));color:rgb(var(--foreground))}
.btn:active{opacity:.8}
.btn-primary{background:rgb(var(--primary-600));color:rgb(var(--on-primary))}
.btn-tint{background:rgb(var(--info-fill));color:rgb(var(--info-text))}
.btn-gray{background:rgb(var(--surface-subtle));color:rgb(var(--foreground))}
.btn-plain{background:transparent;color:rgb(var(--link));padding:0 8px}
.btn-plain.danger{color:rgb(var(--danger-text))}
.btn[disabled]{background:rgb(var(--surface-subtle));color:rgb(var(--foreground-faint));cursor:default}
.btn-plain[disabled]{background:transparent}
.btn.btn-working,.btn.btn-working[disabled]{background:rgb(var(--surface-subtle));color:rgb(var(--foreground-muted))}
.btn-block{width:100%;min-height:50px}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;border-radius:50%;background:rgb(var(--surface-subtle));color:rgb(var(--foreground-secondary))}
.spin{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation:none}}

/* ---- page frame ---- */
.page{max-width:1440px;margin:0 auto;padding:16px 16px 32px}
.stack{display:flex;flex-direction:column;gap:12px}
.card{background:rgb(var(--surface));border-radius:16px;box-shadow:var(--shadow-sm)}
.card-pad{padding:16px}
.stack>.sh{margin-bottom:-6px}
.sh{font-size:13px;line-height:18px;font-weight:600;color:rgb(var(--foreground-muted));margin:20px 4px 8px}
.foot{font-size:13px;line-height:18px;color:rgb(var(--foreground-muted))}
.muted{color:rgb(var(--foreground-muted))}
.tnum{font-variant-numeric:tabular-nums}

/* ---- badges, pills ---- */
.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 10px;border-radius:999px;font-size:12px;line-height:16px;font-weight:500;letter-spacing:.01em;white-space:nowrap;background:rgb(var(--tf));color:rgb(var(--tt))}
.badge .ic{color:rgb(var(--ts))}
.badge b{font-weight:600;font-variant-numeric:tabular-nums}
.badge.sq{border-radius:8px}
.live{display:inline-flex;align-items:center;gap:6px;margin-left:auto;font-size:12px;line-height:16px;font-weight:500;color:rgb(var(--foreground-muted))}
.pdot{width:8px;height:8px;border-radius:50%;background:rgb(var(--success-solid))}
.toolbar{display:flex;flex-direction:column;gap:12px}
.pills{display:flex;align-items:center;gap:6px}

/* ---- Test session: a toggle on the phone, one inline row on PC ---- */
.session-toggle{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:0 16px;border:0;background:transparent;text-align:left;font-size:15px;font-weight:600}
.session-toggle .st{margin-left:auto;font-size:13px;font-weight:400;color:rgb(var(--foreground-muted))}
.session-toggle .ic{color:rgb(var(--foreground-muted));transition:transform .2s ease-out}
.session.open .session-toggle .ic{transform:rotate(180deg)}
.session-body{display:none;flex-direction:column;gap:12px;padding:4px 16px 16px;border-top:1px solid rgb(var(--separator));padding-top:12px}
.session.open .session-body{display:flex}
.session-row{display:flex;gap:8px}
.session-row>.btn{flex:1}
.session-body .seg.sm{display:flex}.session-body .seg.sm>label{flex:1}

/* ---- fields ---- */
.field,.select select{width:100%;height:44px;padding:0 12px;border:1px solid rgb(var(--border-control));border-radius:12px;background:rgb(var(--surface));color:rgb(var(--foreground));font-size:16px;line-height:24px;appearance:none;-webkit-appearance:none}
.field::placeholder{color:rgb(var(--foreground-muted))}
.field.has-icon{padding-left:38px}
.select{position:relative;min-width:0}
.select select{padding-right:34px;text-overflow:ellipsis}
.select .ic{position:absolute;right:10px;top:12px;color:rgb(var(--foreground-muted));pointer-events:none}
.search{position:relative;flex:1;min-width:0}
.search .ic{position:absolute;left:12px;top:12px;color:rgb(var(--foreground-muted));pointer-events:none}
.lbl{display:block;font-size:14px;line-height:20px;font-weight:500;margin:0 0 6px}
.filters{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.filters .r2{grid-column:1/-1;display:flex;align-items:center;gap:8px}
.datefield{display:flex;align-items:center;justify-content:space-between;height:44px;padding:0 12px;border:1px solid rgb(var(--border-control));border-radius:12px;background:rgb(var(--surface));font-size:16px}
.datefield .ic{color:rgb(var(--foreground-muted))}
.datefield.empty{color:rgb(var(--foreground-muted))}
.toggle{position:relative;flex:none;width:51px;height:31px;border-radius:999px;background:rgb(var(--success-solid));border:0}
.toggle::after{content:"";position:absolute;top:2px;right:2px;width:27px;height:27px;border-radius:50%;background:rgb(var(--on-primary));box-shadow:0 1px 3px rgb(0 0 0 / .3)}
.toggle.off{background:rgb(var(--border-control))}
.toggle.off::after{right:auto;left:2px}

/* ---- notice (one pattern for every banner) ---- */
.notice{display:flex;gap:12px;padding:14px 16px;border-radius:16px;background:rgb(var(--tf));color:rgb(var(--tt));font-size:15px;line-height:20px}
.notice>.ic{color:rgb(var(--ts));margin-top:0}
.notice b{font-weight:600}
.notice .sub{display:block;margin-top:2px;font-size:13px;line-height:18px}
.notice p+p{margin-top:6px}

/* ---- issue list rows: one grouped card, hairlines inset to the text ---- */
.issues{overflow:hidden}
.issue{position:relative;display:flex;gap:12px;padding:10px 16px;min-height:60px;cursor:pointer}
.issue+.issue::before{content:"";position:absolute;top:0;left:38px;right:0;height:1px;background:rgb(var(--separator))}
.issue.sel{background:rgb(var(--info-fill));box-shadow:inset 3px 0 0 rgb(var(--primary-600))}
.issue.sel+.issue::before,.issue.sel::before{display:none}
.issue:active{background:rgb(var(--surface-subtle))}
.sdot{flex:none;width:10px;height:10px;margin-top:5px;border-radius:50%;background:rgb(var(--ts))}
.im{min-width:0;flex:1}
.l1{display:flex;align-items:baseline;gap:8px}
.l1 .t{flex:1;min-width:0;font-size:15px;line-height:20px;font-weight:600;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.l1 .cnt{flex:none;font-size:12px;line-height:16px;font-weight:500;color:rgb(var(--foreground-muted));font-variant-numeric:tabular-nums}
.l2{margin-top:1px;font-size:12px;line-height:18px;color:rgb(var(--foreground-muted));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.l3{display:flex;align-items:center;gap:6px;margin-top:2px;font-size:13px;line-height:18px;color:rgb(var(--foreground-muted));min-width:0}
.l3 .sv{font-weight:600;color:rgb(var(--tt))}
.l3 .tn{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.empty{display:flex;flex-direction:column;align-items:center;gap:12px;padding:32px 24px;text-align:center;color:rgb(var(--foreground-muted));font-size:15px;line-height:20px}
.tile28{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:12px;background:rgb(var(--tf));color:rgb(var(--ts));flex:none}
.skel{height:14px;border-radius:7px;background:rgb(var(--surface-subtle))}

/* ---- detail ---- */
.back{display:inline-flex;align-items:center;gap:2px;min-height:44px;margin:-8px 0 0 -8px;padding:0 12px 0 4px;border:0;background:transparent;color:rgb(var(--link));font-size:16px;font-weight:500}
.dh .badges{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.dh h2{font-size:22px;line-height:28px;font-weight:700;letter-spacing:-.015em;overflow-wrap:anywhere}
.dh .sub{margin-top:4px;font-size:15px;line-height:20px;color:rgb(var(--foreground-muted))}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.group{overflow:hidden}
.kv{position:relative;display:flex;justify-content:space-between;gap:16px;padding:10px 16px;min-height:44px;font-size:14px;line-height:20px}
.kv+.kv::before{content:"";position:absolute;top:0;left:16px;right:0;height:1px;background:rgb(var(--separator))}
.kv dt{flex:none;color:rgb(var(--foreground-muted))}
.kv dd{min-width:0;text-align:right;font-weight:500;overflow-wrap:anywhere}
.kv dd.mono{font-size:12.5px;line-height:20px;font-weight:400}
pre{margin:0;padding:12px 16px;font-family:var(--mono);font-size:12px;line-height:18px;white-space:pre-wrap;overflow-wrap:anywhere;color:rgb(var(--foreground-secondary))}
pre .ptr{color:rgb(var(--link));font-weight:600}

/* ---- Gatekeeper ---- */
.gk-card{padding:14px 16px;cursor:pointer}
.gk-card:active{background:rgb(var(--surface-subtle))}
.gk-h{display:flex;align-items:center;gap:8px}
.gk-h .nm{flex:1;min-width:0;font-size:17px;line-height:22px;font-weight:600;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gk-sub{margin-top:2px;font-size:14px;line-height:20px;color:rgb(var(--foreground-muted))}
.gk-sub b{font-weight:600;color:rgb(var(--tt))}
.gk-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid rgb(var(--separator))}
.gk-counts dt{font-size:12px;line-height:16px;font-weight:500;color:rgb(var(--foreground-muted))}
.gk-counts dd{margin-top:2px;font-size:16px;line-height:20px;font-weight:600;font-variant-numeric:tabular-nums}
.gk-counts dd small{display:block;font-size:12px;line-height:16px;font-weight:400;color:rgb(var(--foreground-muted))}
.gk-dates{margin-top:10px;font-size:13px;line-height:18px;color:rgb(var(--foreground-muted))}
.tbl{width:100%;border-collapse:collapse;table-layout:fixed;font-size:14px;line-height:20px}
.tbl th{padding:10px 12px;text-align:left;font-size:12px;line-height:16px;font-weight:500;color:rgb(var(--foreground-muted));border-bottom:1px solid rgb(var(--separator));white-space:nowrap}
.tbl td{padding:10px 12px;border-bottom:1px solid rgb(var(--separator));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tbl tr:last-child td{border-bottom:0}
.tbl .num{text-align:right;font-variant-numeric:tabular-nums}
.tbl tbody tr{cursor:pointer}
.tbl tbody tr:hover{background:rgb(var(--surface-muted))}
.tbl tbody tr.sel{background:rgb(var(--info-fill))}
.tbl td.nm{font-weight:600}
.tbl .tone-text{color:rgb(var(--tt));font-weight:500}

/* ---- Server ---- */
.srv-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0 12px}
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tile{position:relative;overflow:hidden;padding:12px 14px 10px 16px;display:flex;flex-direction:column}
.tile::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:rgb(var(--ts))}
.tile .h{display:flex;justify-content:space-between;align-items:center;gap:6px;min-height:20px;font-size:12px;line-height:16px;font-weight:500;color:rgb(var(--foreground-muted))}
.tile .v{margin-top:2px;font-size:17px;line-height:24px;font-weight:600;letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.tile .s{margin-top:2px;font-size:13px;line-height:18px;color:rgb(var(--foreground-muted))}
.tile svg.sp{display:block;width:100%;height:32px;margin-top:auto;flex:none}
.tile .s{margin-bottom:8px}
.tile.grey .v{color:rgb(var(--foreground-muted))}
.range{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:16px}
.ct th:first-child,.ct td:first-child{width:50%}
.ct .cn b{font-weight:600}
.ct .cn span{margin-left:6px;color:rgb(var(--foreground-muted));font-size:12px}
.ct.dim{color:rgb(var(--foreground-muted))}
.msg{padding:24px 16px;text-align:center;color:rgb(var(--foreground-muted));font-size:15px;line-height:22px}

/* ---- Alerts: bottom sheet on the phone, popover on PC ---- */
body.modal-open{height:100vh;overflow:hidden}
body.modal-open #app{height:100vh;overflow:hidden}
.scrim{position:fixed;inset:0;z-index:30;background:rgb(0 0 0 / .4)}
.panel{position:fixed;z-index:40;background:rgb(var(--surface-raised));box-shadow:var(--shadow-xl);left:0;right:0;bottom:0;border-radius:24px 24px 0 0;padding:8px 16px calc(16px + env(safe-area-inset-bottom))}
.grabber{width:36px;height:5px;margin:0 auto 4px;border-radius:3px;background:rgb(var(--surface-strong))}
.panel-h{display:flex;align-items:center;justify-content:space-between;min-height:44px}
.panel-h h2{font-size:22px;line-height:28px;font-weight:700;letter-spacing:-.015em}
.al-state{display:flex;align-items:center;gap:12px;margin:8px 0 16px}
.al-state p{font-size:16px;line-height:22px;font-weight:600}
.al-btns{display:flex;flex-direction:column;gap:8px}
.al-note{display:flex;gap:8px;align-items:center;margin-bottom:12px;padding:12px 14px;border-radius:12px;background:rgb(var(--tf));color:rgb(var(--tt));font-size:14px;line-height:20px;font-weight:500}
.al-note .ic{color:rgb(var(--ts))}

/* ---- token gate: full screen, shown before anything else ---- */
.gate{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px 16px calc(24px + env(safe-area-inset-bottom))}
.gate-box{width:100%;max-width:360px;padding:24px 20px}
.gate-brand{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.gate-brand img{width:44px;height:44px;border-radius:10px;flex:none}
.gate-brand h1{font-size:28px;line-height:34px;font-weight:700;letter-spacing:-.02em}
.gate-box p.lead{font-size:15px;line-height:20px;color:rgb(var(--foreground-muted));margin-bottom:20px}
.gate-box .err{min-height:18px;margin-top:6px;font-size:13px;line-height:18px;color:rgb(var(--danger-text))}

/* ---- PC and tablet (601 px and up) ---- */
@media (min-width:601px){
  body{font-size:14px;line-height:20px}
  .card{border:1px solid rgb(var(--separator))}
  .topbar-in{grid-template-columns:1fr auto 1fr;grid-template-areas:"brand tabs alerts";gap:12px 16px;padding:8px 24px}
  .seg>button,.seg>label{min-height:32px;padding:0 22px;font-size:14px}
  .btn{min-height:36px;padding:0 14px;font-size:14px}
  .btn-block{min-height:44px}
  .icon-btn{width:32px;height:32px}
  .field,.select select{height:36px;font-size:14px;line-height:20px}
  .select .ic{top:8px}.search .ic{top:8px}
  .alerts-btn .on-dot{top:5px;left:25px}
  .page{padding:16px 24px 32px}
  .l1 .t{font-size:14px}
  .session{display:flex;align-items:center}
  .session-toggle{width:auto;pointer-events:none;padding-right:8px;white-space:nowrap}
  .session-toggle .ic{display:none}
  .session-toggle .st{margin-left:0;padding-right:4px}
  .session-body{display:flex;flex:1;flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px 12px;border-top:0;padding:8px 16px 8px 0}
  .session-body .field{width:220px}
  .session-row{gap:8px}.session-row>.btn{flex:none}
  .session-body .seg{margin-left:auto}.session-body .seg.sm{display:inline-flex}.session-body .seg.sm>label{flex:none}
  .back{display:none}
  .actions{display:flex;flex-wrap:wrap}
  .al-btns{flex-direction:row}
  .tiles{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
  .tile .v{font-size:22px;line-height:28px}
  .tbl.gkt .hide-md{display:table-cell}
  .panel{left:auto;right:24px;bottom:auto;top:56px;width:360px;border-radius:16px;border:1px solid rgb(var(--separator));padding:12px 16px 16px}
  .grabber{display:none}
  .panel-h h2{font-size:17px;line-height:22px;font-weight:600;letter-spacing:-.01em}
  .scrim{background:transparent}
  .panel .btn-block{min-height:40px}
  body.fit{height:100vh;display:flex;flex-direction:column;overflow:hidden}
  body.fit .page{flex:1;min-height:0;display:flex;flex-direction:column}
  .panels{flex:1;min-height:0;display:grid;grid-template-columns:var(--split-x,42%) 12px minmax(0,1fr);margin-top:12px}
  .pcol{min-width:0;min-height:0;display:flex;flex-direction:column;gap:8px}
  .pcol.scroll{overflow-y:auto;padding-right:2px}
  .grab{position:relative;cursor:col-resize}
  .grab::after{content:"";position:absolute;left:5px;top:0;bottom:0;width:2px;border-radius:1px;background:rgb(var(--separator))}
  .pcol>.issues{overflow-y:auto;min-height:0}
  .hint{display:flex;align-items:center;justify-content:center;flex:1;color:rgb(var(--foreground-muted));text-align:center;padding:32px;font-size:14px}
}
@media (min-width:601px) and (max-width:900px){ .tiles{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (min-width:1280px){
  .topbar-in{padding:8px 32px}
  .page{padding:16px 32px 32px}
  .panel{right:32px}
}
@media (max-width:600px){ .pc-only{display:none!important} }
@media (min-width:601px){ .phone-only{display:none!important} }


/* ===================================================================== PRODUCT ADDITIONS === */
body{min-height:100vh}
.brand img{width:28px;height:28px;border-radius:7px;flex:none}
.brand h1{white-space:nowrap}
#env:empty{display:none}
.alerts-btn.hidden{display:none!important}
.seg>label:has(input:disabled){opacity:.45;cursor:default}
.seg>label{cursor:pointer}
.light.tone-warning,.light.tone-danger,.light.tone-success,.light.tone-neutral{transition:background .2s}
.live.on .pdot{background:rgb(var(--success-solid))}
.live .pdot{background:rgb(var(--foreground-faint))}
.live.on .pdot{background:rgb(var(--success-solid))}
.live{min-width:0;white-space:nowrap}
.pills{flex-wrap:nowrap;min-width:0}
.pills .badge{flex:none}
.toolbar{margin-bottom:12px}
.panels{display:flex;flex-direction:column;gap:12px}
.pcol{display:flex;flex-direction:column;gap:12px;min-width:0}
.grab{display:none}
#detail,#gk-detail{display:none}
.detail-open .listcol,.detail-open .toolbar,.detail-open .gk-top{display:none!important}
.detail-open #detail,.detail-open #gk-detail{display:flex}
.hint{padding:32px 24px;text-align:center;color:rgb(var(--foreground-muted));font-size:15px}
.badge.sev-sq{border-radius:8px}
.issue .l3{flex-wrap:nowrap}
.issue .l3 .badge{flex:none}
.empty p{max-width:520px}
.page>.stack,.gk-top{min-width:0}
.gk-top{display:flex;flex-direction:column;gap:12px;margin-bottom:12px}
.gk-top .r2{display:flex;gap:8px;align-items:center}
.gk-list{display:flex;flex-direction:column;gap:10px}
.gk-card{cursor:pointer}
.gk-card.sel{box-shadow:inset 3px 0 0 rgb(var(--primary-600))}
.tbl-wrap{overflow:hidden}
.gk-table-card{overflow:hidden}
.field[type=date]{display:block;min-width:0;text-align:left}
.sw-row{display:flex;align-items:center;justify-content:space-between;min-height:44px;cursor:pointer;font-size:15px;font-weight:500}
.sw-row input{position:absolute;opacity:0;pointer-events:none}
.sw-row .toggle{background:rgb(var(--border-control))}
.sw-row .toggle::after{right:auto;left:2px}
.sw-row input:checked+.toggle{background:rgb(var(--success-solid))}
.sw-row input:checked+.toggle::after{left:auto;right:2px}
.sw-row input:focus-visible+.toggle{outline:2px solid rgb(var(--primary-500));outline-offset:2px}
.btn.armed{background:rgb(var(--danger-solid));color:#fff}
.btn-block{width:100%}
.gk-form-msg{min-height:18px}
.msg code,.empty code{font-family:var(--mono);font-size:13px}
.tile .h .badge{flex:none}
.tile .v,.tile .s{min-width:0;overflow-wrap:anywhere}
.range .seg.sm{display:inline-flex}
.gate{position:fixed;inset:0;z-index:50;background:rgb(var(--surface-canvas));overflow-y:auto}
.gate-brand{justify-content:center;flex-direction:column;gap:8px;margin-bottom:12px}
.gate-brand img{width:200px;max-width:100%;height:auto;border-radius:16px}
.gate-box{max-width:360px}
.gate-box .card{box-shadow:none}
.srv-asof{min-width:0;overflow-wrap:anywhere}
pre{max-width:100%;overflow-x:auto}
dd.mono{min-width:0}
@media (max-width:600px){
  .page{padding-left:16px;padding-right:16px}
  #watchdog-view.detail-open .panels,#gatekeeper-view.detail-open .panels{margin-top:0}
  .tbl-wrap,.pc-only{display:none!important}
}
@media (min-width:601px){
  .phone-only,.gk-list{display:none!important}
  .toolbar{margin-bottom:0}
  .panels{display:grid;margin-top:12px}
  #gk-detail{display:none}
  #gatekeeper-view .panels{grid-template-columns:minmax(0,1fr)}
  #gatekeeper-view.has-sel .panels{grid-template-columns:var(--split-x,66%) 12px minmax(0,1fr)}
  #gatekeeper-view.has-sel #gk-detail{display:flex}
  #gatekeeper-view.has-sel .grab{display:block}
  #watchdog-view .grab{display:block}
  #detail{display:flex}
  .gk-top{margin-bottom:0;gap:8px}
  .gk-top .r2 .search{flex:1}
  .detail-open .listcol,.detail-open .toolbar,.detail-open .gk-top{display:flex!important}
  .tbl-wrap{display:block}
}
.grab.dragging::after,.grab:hover::after{background:rgb(var(--primary-500))}
body.dragging{cursor:col-resize;user-select:none}
.srv-status:empty{display:none}
.l1 .t{overflow-wrap:anywhere}
.tbl th{overflow:hidden;text-overflow:ellipsis}
body:has(#token-gate:not(.hidden)) > header, body:has(#token-gate:not(.hidden)) > main{display:none!important}

/* ---- EU-007: Gatekeeper list pages, sorts and scrolls; theme switch ---- */
:root[data-theme="light"]{color-scheme:light}
:root[data-theme="dark"]{color-scheme:dark}
.gk-sel{flex:none}
.gk-sel select{width:auto;min-width:150px}
.gk-top .r2{flex-wrap:wrap}
.th-sort{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.th-sort:hover,.tbl th[aria-sort=ascending] .th-sort,.tbl th[aria-sort=descending] .th-sort{color:rgb(var(--foreground))}
.th-sort:focus-visible{outline:2px solid rgb(var(--primary-500));outline-offset:2px;border-radius:4px}
.th-sort .ic{flex:none}
.th-sort .sort-up{transform:rotate(180deg)}
.gk-pager{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0 0}
.gk-pager .btn[disabled]{opacity:.45;cursor:default}
@media (max-width:600px){
  .gk-top .r2 .search{flex:1 1 100%}
  .gk-sel{flex:1 1 0;min-width:0}
  .gk-sel select{width:100%;min-width:0}
  .gk-top .r2 .btn{flex:none}
  .gk-refresh-lbl{display:none}
  .gk-sel select{font-size:15px}
  .gk-pager{padding-bottom:8px}
}
@media (min-width:601px){
  .gk-top .r2{flex-wrap:nowrap}
  .theme-lbl{display:inline}
  #gatekeeper-view .listcol{overflow:hidden}
  #gk-table-wrap{flex:1 1 auto;min-height:0;overflow:auto}
  .tbl.gkt thead th{position:sticky;top:0;z-index:1;background:rgb(var(--surface));box-shadow:inset 0 -1px 0 rgb(var(--separator))}
}
.tbl.gkt col.hide-md{display:table-column}
/* with the detail pane open the list is narrower: drop the two least-needed columns, as on a tablet */
@media (min-width:601px){ #gatekeeper-view.has-sel .tbl.gkt .hide-md,#gatekeeper-view.has-sel .tbl.gkt col.hide-md{display:none} }
@media (min-width:601px) and (max-width:1023px){
  .tbl.gkt .hide-md,.tbl.gkt col.hide-md{display:none}
  .tbl.gkt col:nth-child(1){width:17%!important}.tbl.gkt col:nth-child(2){width:14%!important}.tbl.gkt col:nth-child(3){width:13%!important}.tbl.gkt col:nth-child(4){width:12%!important}
  .tbl.gkt col:nth-child(5){width:8%!important}.tbl.gkt col:nth-child(7){width:7%!important}.tbl.gkt col:nth-child(8){width:15%!important}.tbl.gkt col:nth-child(10){width:14%!important}
}
/* tablet: brand and buttons on the top row, tabs below (the three-across header no longer fits) */
@media (min-width:601px) and (max-width:900px){
  .topbar-in{grid-template-columns:1fr auto;grid-template-areas:"brand alerts" "tabs tabs"}
}

/* ---- Remove a business (EU-008) ---- */
.rm-card .btn{align-self:flex-start}
.rm-msg{color:rgb(var(--danger-text))}
.btn.btn-tint.danger{color:rgb(var(--danger-text))}
.btn.danger-solid{background:rgb(var(--danger-solid));color:#fff}
.btn.danger-solid:disabled{opacity:.4}
#rm-dialog .scrim{z-index:50;background:rgb(0 0 0 / .4)}
.rm-box{position:fixed;z-index:60;left:50%;top:50%;transform:translate(-50%,-50%);width:min(440px,calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;background:rgb(var(--surface-raised));box-shadow:var(--shadow-xl)}
.rm-box h2{font-size:20px;line-height:26px;font-weight:700;letter-spacing:-.01em}
.toast{position:fixed;z-index:70;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));transform:translateX(-50%);max-width:calc(100vw - 32px);padding:12px 16px;border-radius:12px;background:rgb(var(--foreground));color:rgb(var(--surface));font-size:14px;line-height:20px;font-weight:500;box-shadow:var(--shadow-xl);opacity:0;pointer-events:none;transition:opacity .2s}
.toast.show{opacity:1}
