/* V7 presentation layer. Keep the canvas, data, and delegated actions intact. */
:root {
  --surface: #111316;
  --surface-2: #1a1d22;
  --line: #262a31;
  --line-2: #373d46;
  --ink: #eef0f3;
  --ink-2: #b6bcc6;
  --ink-3: #8c96a5;
  --red-text: #ff8c96;
  --amber-text: #eac17a;
  --blue-text: #9fbbdf;
  --card: #111419;
  --card-hover: #171b21;
  --card-border: #30353e;
  --card-radius: 12px;
  --risk-high: #f07885;
  --risk-mid: #cba35f;
  --risk-low: #7898be;
}

/* Quiet chrome gives the risk canvas the highest visual priority. */
#top { padding-inline: 24px; background: #090b0e; border-color: #20242a; }
.brand { gap: 16px; min-width: 0; }
.brand h1 { font-size: 15px; font-weight: 500; letter-spacing: -.025em; }
.logo { height: 30px; }
.top-right { gap: 8px; flex: none; }
.ico-btn { width: 34px; height: 34px; border-radius: 8px; }
.avatar { border-color: var(--line); border-radius: 50%; }
.hist-btn, .rf-btn, .ver-btn, .view-sw { height: 32px; border-radius: 8px; background: #101318; }
.hist-btn { margin-left: 2px; }
.hist-btn b { background: #22272f; color: var(--ink-2); }
.view-sw { margin-right: 0; padding: 3px; border-color: var(--line); }
.view-sw button { height: 24px; border-radius: 5px; font-size: 12px; }
.view-sw button.on { background: #2a3039; box-shadow: 0 1px 3px #0005; }
.date-pill { padding-inline: 8px; margin-right: 0; font-size: 12px; color: var(--ink-3); }
.rf-btn b { color: var(--ink-2); }
.bell-dot { min-width: 14px; height: 14px; line-height: 14px; font-size: var(--fs-11, 11px); top: 1px; right: 0; }

/* Risk drives size in every column; each column keeps its own form. */

/* Users: circle pack. The group circle simply encloses its members. */
.ug-cluster { position: absolute; inset: 0; border-radius: 50%; }
.ug-cluster-head {
  position: absolute; left: -56px; right: -56px; bottom: calc(100% + 6px);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.ug-head { display: flex; align-items: center; justify-content: center; gap: 6px; height: 20px; white-space: nowrap; }
.ug-group-icon { display: flex; flex: none; color: var(--ink-3); }
.ug-name { color: var(--ink); font-size: var(--fs-12, 12px); font-weight: 500; letter-spacing: -.01em; }
.u-bubble.more {
  display: grid; place-items: center; pointer-events: auto; cursor: pointer; color: var(--ink-2); font-size: var(--fs-11, 11px); font-weight: 500;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09);
}
.u-bubble.more:hover { color: var(--ink); background: rgba(255, 255, 255, .11); filter: none; }
.u-bubble .ub-name { margin-top: 2px; }

/* Browsers and apps: treemap cards. Tile area follows risk. */
.n.f-bubble-group.c-clients {
  border-radius: calc(16px * var(--ubg-scale, 1));
  background: linear-gradient(180deg, #13171E 0%, #0A0D12 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(255, 255, 255, .07), 0 16px 32px rgba(0, 0, 0, .65);
}
.n.f-bubble-group.c-clients.b-mid { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(242, 181, 68, .24), 0 16px 32px rgba(0, 0, 0, .65); }
.n.f-bubble-group.c-clients.b-high { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(255, 92, 105, .3), 0 16px 32px rgba(0, 0, 0, .65), 0 8px 30px rgba(255, 92, 105, .08); }
.n.f-bubble-group.c-clients:hover { background: linear-gradient(180deg, #181D26 0%, #0D1117 100%); }
.n.f-bubble-group.c-clients.sel { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 4px rgba(61, 139, 255, .18), 0 16px 32px rgba(0, 0, 0, .65); }
.mt-top { position: absolute; left: 9px; right: 11px; top: 8px; height: 32px; display: flex; align-items: center; gap: 8px; }
.mt-badge {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; color: var(--ink-2);
  background: linear-gradient(180deg, #252C38 0%, #141922 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 0 0 1px rgba(255, 255, 255, .06), 0 4px 10px rgba(0, 0, 0, .5);
}
.mt-badge img { display: block; width: 21px; height: 21px; object-fit: contain; }
.mt-id { display: flex; flex-direction: column; align-items: flex-start; flex: 1; min-width: 0; }
.mt-name { max-width: 100%; overflow: hidden; color: var(--ink); font-size: var(--fs-12, 12px); font-weight: 500; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.mt-sub, .more-link { color: var(--ink-3); font-size: var(--fs-11, 11px); font-weight: 400; line-height: 1.3; }
.more-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.mt-total { flex: none; color: var(--blue-text); font-size: var(--fs-16, 16px); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mt-total.b-mid { color: var(--amber-text); }
.mt-total.b-high { color: var(--red-text); }
.mt-body { position: absolute; left: 8px; top: 48px; }
.mt-tile {
  position: absolute; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2px; padding: 7px 9px; overflow: hidden;
  border-radius: 10px; text-align: left; color: var(--ink);
  background: linear-gradient(160deg, rgba(125, 176, 255, .15), rgba(125, 176, 255, .06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 0 0 1px rgba(125, 176, 255, .16);
  transition: filter .15s, box-shadow .15s;
}
.mt-tile.b-mid {
  background: linear-gradient(160deg, rgba(242, 181, 68, .18), rgba(242, 181, 68, .07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 0 0 1px rgba(242, 181, 68, .2);
}
.mt-tile.b-high {
  background: linear-gradient(160deg, rgba(255, 92, 105, .28), rgba(255, 92, 105, .11));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(255, 92, 105, .3);
}
.mt-tile:hover { filter: brightness(1.25); }
.mt-tile.sel { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 2px rgba(61, 139, 255, .3); }
.mt-tile.slim { flex-direction: row; align-items: center; justify-content: flex-start; gap: 6px; padding: 0 9px; }
.mt-tile i { position: absolute; right: 7px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.mt-score { color: var(--blue-text); font-weight: 600; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mt-tile.b-mid .mt-score { color: var(--amber-text); }
.mt-tile.b-high .mt-score { color: #FFC4C9; }
.mt-label { min-width: 0; max-width: 100%; overflow: hidden; color: rgba(237, 241, 248, .8); font-weight: 500; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }

/* Web services: capsules on a spine. Length and height follow risk. */
.n.f-bubble-group.c-services, .n.f-bubble-group.c-services.b-high, .n.f-bubble-group.c-services:hover, .n.f-bubble-group.c-services.sel {
  border-radius: 0; background: none; box-shadow: none;
}
.cap-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; }
.cap-spine { position: absolute; left: 0; top: 4px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--blue-line); transition: width .15s; }
.b-mid .cap-spine { background: var(--amber); }
.b-high .cap-spine { background: var(--red); }
.n.c-services:hover .cap-spine { width: 3px; }
.n.c-services.sel .cap-spine { background: var(--blue); width: 3px; }
.cap-head { display: flex; align-items: center; gap: 6px; height: 22px; margin: 0 0 4px 10px; color: var(--ink-3); white-space: nowrap; }
.cap-title { color: var(--ink); font-size: var(--fs-12, 12px); font-weight: 500; letter-spacing: -.01em; }
.cap-row {
  position: relative; display: flex; align-items: center; gap: 6px; flex: none; margin: 0 0 4px 10px; padding: 0 11px 0 4px; border-radius: 999px; color: var(--ink);
  background: linear-gradient(90deg, rgba(125, 176, 255, .2), rgba(125, 176, 255, .07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 0 0 1px rgba(125, 176, 255, .2), 0 5px 12px rgba(0, 0, 0, .45);
  transition: filter .15s, box-shadow .15s;
}
.cap-row.b-mid {
  background: linear-gradient(90deg, rgba(242, 181, 68, .24), rgba(242, 181, 68, .08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 0 0 1px rgba(242, 181, 68, .26), 0 5px 12px rgba(0, 0, 0, .45);
}
.cap-row.b-high {
  background: linear-gradient(90deg, rgba(255, 92, 105, .36), rgba(255, 92, 105, .12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 0 1px rgba(255, 92, 105, .4), 0 5px 14px rgba(0, 0, 0, .5);
}
.cap-row:hover { filter: brightness(1.22); }
.cap-row.sel { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 3px rgba(61, 139, 255, .28); }
.cap-ico { display: grid; place-items: center; flex: none; border-radius: 50%; color: var(--ink-2); background: #0D1117; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.cap-ico img { display: block; width: 68%; height: 68%; object-fit: contain; }
.cap-name { flex: 1; min-width: 0; overflow: hidden; font-weight: 500; letter-spacing: -.005em; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.cap-row i { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.cap-row b { flex: none; color: var(--blue-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.cap-row.b-mid b { color: var(--amber-text); }
.cap-row.b-high b { color: #FFC4C9; }
.cap-card .more-link { height: 16px; margin-left: 12px; }
.u-bubble:focus-visible, .mt-tile:focus-visible, .cap-row:focus-visible, .more-link:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 1px; }

/* Alerts read as a plain line above their group. */
.f-bubble-group .ubg-head { left: 2px; right: -40px; bottom: calc(100% + 4px); transform: none; align-items: flex-start; }
.f-bubble-group .ubg-pill { min-width: 0; max-width: 100%; }
.f-bubble-group .ubg-pill .rk { max-width: 100%; height: 18px; padding: 0; color: #bfc5ce; font-size: 11px; font-weight: 400; }
.f-bubble-group .ubg-pill .rk.fresh { height: 18px; padding: 0 8px 0 6px; color: #FFC2C7; }
.f-bubble-group .ubg-pill .rk svg { width: 12px; height: 12px; }
.ug-cluster-head .ubg-pill { display: flex; justify-content: center; }

/* The gateway remains the visual anchor, without a large decorative halo. */
.n.hub .ic, .n.hub.b-high .ic, .n.hub.b-mid .ic, .n.hub.b-low .ic,
.n.hub:hover .ic {
  background: #131a23;
  box-shadow: inset 0 0 0 1px #394552, 0 8px 24px #0005;
}
.n.hub .ic::before { inset: -7px; border-color: #35415280; }
.n.hub .ic > .ubg-ring { opacity: .75; }
.n.hub .lbl { top: calc(100% + 13px); }
.n.hub.sel .ic { box-shadow: inset 0 0 0 1px var(--blue), 0 0 0 4px #3d8bff24; }

/* Supporting controls, inspector, and focus view use the same material. */
.zoom-pill, .zoom-fit, #ask { background: #111419; border-color: #30353e; box-shadow: 0 4px 20px #0005; }
.zoom-pill { border-radius: 10px; }
.zoom-fit { border-radius: 10px; }
#ask { border-radius: 12px; padding: 6px; }
#ask:focus-within { border-color: #5886bd; box-shadow: 0 0 0 3px #4c8cdd14; }
.ask-spark { border-radius: 8px; background: #1b2a3d; color: #9fc5f4; }
.ask-field { background: none; border-radius: 8px; }
.ask-go { border-radius: 7px; background: #202e40; color: #aad0ff; }
#ask-input { font-size: var(--fs-12, 12px); }
#ask-input::placeholder { color: #929ead; }
#panel { background: #111419; border-color: #323841; border-radius: 14px; box-shadow: -8px 12px 36px #0006; }
.p-tab, .seg, .btn, .row, .ag-card { border-radius: 8px; }
#bell-pop, #hist-pop, .rf-menu, .ver-menu, #ask-list { border-radius: 10px; background: #15191f; border-color: #353b45; box-shadow: 0 10px 28px #0006; }
.j-disc, .j-hub { background: #141920; box-shadow: inset 0 0 0 1px #343b47, 0 6px 18px #0004; }
.j-card { border-radius: 9px; background: #141920; border-color: #343b47; box-shadow: none; }
.j-card:hover { background: #1c232c; }
.j-disc > .ubg-ring { opacity: .6; }
@media (max-width: 1350px) {
  .date-pill { display: none; }
  .brand { gap: 12px; }
}
@media (max-width: 1000px) {
  #top { padding-inline: 14px; }
  .brand h1 { font-size: 13px; }
  .hist-btn { width: 34px; justify-content: center; padding: 0; }
  .hist-btn > span, .hist-btn > b { display: none; }
  .top-right { gap: 5px; }
  #ask { min-width: 0; left: auto; right: 16px; transform: none; width: calc(100vw - 260px); }
}
@media (max-width: 700px) {
  #top { height: 104px; align-items: flex-start; padding: 12px; }
  .brand { height: 30px; }
  .brand h1 { font-size: 13px; }
  .brand .logo { height: 26px; }
  .brand .hist-btn { margin-left: 0; }
  .top-right { position: absolute; left: 12px; right: 12px; bottom: 9px; justify-content: space-between; gap: 4px; }
  .top-right .avatar { display: none; }
  #stage, #journey { top: 104px; }
  #panel { top: 112px; right: 8px; bottom: 78px; width: min(346px, calc(100vw - 16px)); }
  #ask { left: 12px; right: 12px; bottom: 12px; width: auto; }
  #zoom { left: 12px; bottom: 76px; gap: 6px; }
  .zoom-pill, .zoom-fit { height: 36px; }
  .zoom-fit { width: 36px; }
  .zoom-pill button { height: 30px; width: 30px; }
  #z-val { width: 42px; font-size: 12px; }
  #iso-chip { left: auto; right: 12px; bottom: 76px; height: 36px; }
  #bell-pop, #hist-pop { top: 110px; right: 8px; max-width: calc(100vw - 16px); }
  .rf-menu { max-width: calc(100vw - 24px); }
  #ask-input { font-size: 12px; }
  #ask-input::placeholder { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .n.f-bubble-group, .u-bubble, .mt-tile, .cap-row { transition: none; }
}
