/* Privy Atlas — design system: Privy brand (DM Sans, brand #E5002B), same tokens
   as the Privy report template. Semantic colours (ok/wait/fail/info) are never
   the brand red: red-for-down must not be confused with red-for-Privy. */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("dmsans.woff2") format("woff2");
}

:root {
  --brand: #E5002B; --brand-ink: #B00020; --brand-soft: #FDE8EC;
  --ink: #1A1116; --muted: #736A6F; --faint: #9A9298;
  --paper: #FFFFFF; --surface: #FBF8F9; --raise: #FFFFFF; --sunk: #F4EFF1;
  --line: #ECE6E9; --line-2: #E3DCDF; --line-3: #CFC6CB;
  --ok: #12915A; --ok-soft: #E4F4EC;
  --wait: #D9891F; --wait-soft: #FBF0DC;
  --fail: #D2374F; --fail-soft: #FBE6EA;
  --info: #0075D9; --info-soft: #E3F0FC;
  /* kind categories on the map (not semantic, not brand) */
  --k-app: #0075D9; --k-data: #6C4FD8; --k-ext: #8A8287;
  --shadow: 0 1px 2px rgba(26,17,22,.04), 0 8px 24px -12px rgba(26,17,22,.12);
  --shadow-lg: 0 2px 4px rgba(26,17,22,.05), 0 24px 48px -20px rgba(178,0,32,.18);
  --radius: 14px; --radius-sm: 9px;
  --top: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #FF425F; --brand-ink: #FF6079; --brand-soft: #34161C;
    --ink: #F4EDEF; --muted: #A9A0A6; --faint: #7C7278;
    --paper: #161114; --surface: #1E181B; --raise: #221B1F; --sunk: #1A1417;
    --line: #312A2E; --line-2: #3C343A; --line-3: #50474D;
    --ok: #3BC98A; --ok-soft: #12271F; --wait: #F0AC4B; --wait-soft: #2B2114;
    --fail: #FF5E77; --fail-soft: #2E1519; --info: #4AA6FF; --info-soft: #132233;
    --k-app: #4AA6FF; --k-data: #A28BFF; --k-ext: #8F868C;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.45), 0 28px 60px -24px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #FF425F; --brand-ink: #FF6079; --brand-soft: #34161C;
  --ink: #F4EDEF; --muted: #A9A0A6; --faint: #7C7278;
  --paper: #161114; --surface: #1E181B; --raise: #221B1F; --sunk: #1A1417;
  --line: #312A2E; --line-2: #3C343A; --line-3: #50474D;
  --ok: #3BC98A; --ok-soft: #12271F; --wait: #F0AC4B; --wait-soft: #2B2114;
  --fail: #FF5E77; --fail-soft: #2E1519; --info: #4AA6FF; --info-soft: #132233;
  --k-app: #4AA6FF; --k-data: #A28BFF; --k-ext: #8F868C;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.45), 0 28px 60px -24px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font: 400 14px/1.5 "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -.005em; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, .mono { font-family: "SF Mono", ui-monospace, "Fira Code", Menlo, monospace; font-size: .92em; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); font-size: 11px; }
h1, h2, h3 { letter-spacing: -.02em; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.icon svg { width: 100%; height: 100%; display: block; }

/* ------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top);
  display: flex; align-items: center; gap: 18px; padding: 0 18px;
  background: var(--raise); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 22px; width: auto; display: block; }
.brand .sep { width: 1px; height: 20px; background: var(--line-2); }
.brand .product { font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; height: 100%; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; align-items: center; gap: 7px; padding: 0 11px; height: 100%;
  color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--ink); border-bottom-color: var(--brand); }
.nav .count { background: var(--wait-soft); color: var(--wait); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 6px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.search-btn {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; min-width: 200px;
  border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--faint); cursor: pointer;
}
.search-btn span.grow { text-align: left; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 12px;
  border: 0; cursor: pointer;
}
.menu {
  position: absolute; right: 12px; top: calc(var(--top) - 4px); z-index: 60; min-width: 260px;
  background: var(--raise); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.menu .head { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .head b { display: block; }
.menu button, .menu a.item {
  display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  background: none; border: 0; text-align: left; cursor: pointer; color: var(--ink);
}
.menu button:hover, .menu a.item:hover { background: var(--surface); text-decoration: none; }

.banner {
  display: flex; align-items: center; gap: 10px; padding: 8px 18px; font-size: 13px;
  background: var(--wait-soft); color: var(--ink); border-bottom: 1px solid var(--line);
}
.banner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wait); flex: none; animation: pulse 1.6s ease-in-out infinite; }
.banner.down .dot { background: var(--fail); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .banner .dot { animation: none; } }

/* ------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: 9px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--raise); color: var(--ink); font-weight: 600; font-size: 13.5px;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface); border-color: var(--line-3); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { color: var(--fail); }
.btn.danger:hover { background: var(--fail-soft); border-color: var(--fail); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 8px; }
.icon-btn { width: 34px; padding: 0; }
.btn.sm.icon-btn { width: 28px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; background: var(--surface); }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--raise); color: var(--ink); box-shadow: var(--shadow); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
.field .err { font-size: 12px; color: var(--fail); }
input[type=text], input[type=email], input[type=search], input[type=url], input[type=number],
input[type=datetime-local], input:not([type]), select, textarea {
  height: 36px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--raise); width: 100%; min-width: 0;
}
textarea { height: auto; min-height: 76px; padding: 8px 11px; resize: vertical; line-height: 1.45; }
select { appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.invalid input, .invalid select, .invalid textarea { border-color: var(--fail); }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { margin: 3px 0 0; accent-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice label {
  border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
}
.choice label b { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.choice label small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* ------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--sunk); color: var(--muted); white-space: nowrap; border: 1px solid transparent;
}
.badge .icon { width: 13px; height: 13px; vertical-align: 0; }
.badge.app { color: var(--k-app); background: color-mix(in srgb, var(--k-app) 11%, transparent); }
.badge.data { color: var(--k-data); background: color-mix(in srgb, var(--k-data) 12%, transparent); }
.badge.external { color: var(--muted); }
.badge.public { color: var(--brand-ink); background: var(--brand-soft); }
.badge.partner { color: var(--wait); background: var(--wait-soft); }
.badge.internal { color: var(--muted); background: var(--sunk); }
.badge.down { color: var(--fail); background: var(--fail-soft); }
.badge.degraded { color: var(--wait); background: var(--wait-soft); }
.badge.ok, .badge.verified { color: var(--ok); background: var(--ok-soft); }
.badge.unverified { color: var(--faint); background: transparent; border: 1px dashed var(--line-3); }
.badge.tier1 { color: var(--fail); background: transparent; border-color: color-mix(in srgb, var(--fail) 45%, transparent); }
.badge.scheduled { color: var(--info); background: var(--info-soft); }
.badge.ongoing { color: var(--wait); background: var(--wait-soft); }
.badge.done, .badge.cancelled { color: var(--faint); }

/* ------------------------------------------------------------- page */
.page { max-width: 1240px; margin: 0 auto; padding: 26px 22px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 72ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--raise); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 16px; font-weight: 700; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--info-soft); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); font-size: 13.5px; margin-bottom: 18px; }
.callout.warn { background: var(--wait-soft); border-color: color-mix(in srgb, var(--wait) 30%, transparent); }
.callout .icon { margin-top: 2px; color: var(--info); }
.callout.warn .icon { color: var(--wait); }
.callout .grow b { display: block; margin-bottom: 1px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi .big { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.kpi .note { font-size: 12px; color: var(--muted); }
.kpi.down .big { color: var(--fail); }
.kpi.degraded .big { color: var(--wait); }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table, .table th, .table td { color: var(--ink); }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--surface); }
.table .name { font-weight: 600; }
.table .sub { font-size: 12px; color: var(--muted); }
.table-wrap { overflow: auto; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 300px; }
.toolbar select { width: auto; min-width: 140px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

dl.props { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; font-size: 13.5px; }
dl.props dt { color: var(--muted); font-weight: 500; }
dl.props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.chain a { color: var(--ink); font-weight: 500; }
.chain .arrow { color: var(--faint); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.list .item .grow a { font-weight: 600; color: var(--ink); }
.mini-tag { font-size: 11.5px; color: var(--muted); }

.audit { display: flex; flex-direction: column; }
.audit .entry { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.audit .entry:last-child { border-bottom: 0; }
.audit time { color: var(--muted); font-size: 12.5px; }
.audit .what b { font-weight: 600; }
.audit details { margin-top: 4px; }
.audit summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.diff { font-size: 12px; margin-top: 6px; display: grid; grid-template-columns: 130px 1fr 1fr; gap: 3px 10px; }
.diff .k { color: var(--muted); }
.diff .old { color: var(--fail); text-decoration: line-through; overflow-wrap: anywhere; }
.diff .new { color: var(--ok); overflow-wrap: anywhere; }

/* ------------------------------------------------------------- map */
.map-layout { display: grid; grid-template-columns: 284px minmax(0, 1fr); height: calc(100vh - var(--top) - var(--banner, 0px)); }
.map-layout.with-drawer { grid-template-columns: 284px minmax(0, 1fr) 360px; }
.map-layout.no-side { grid-template-columns: 0 minmax(0, 1fr); }
.map-layout.no-side.with-drawer { grid-template-columns: 0 minmax(0, 1fr) 360px; }
.sidebar { border-right: 1px solid var(--line); background: var(--raise); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.no-side .sidebar { display: none; }
.sidebar h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip-toggle {
  border: 1px solid var(--line-2); background: var(--raise); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 5px;
}
.chip-toggle.on { border-color: var(--ink); color: var(--ink); background: var(--sunk); }
.chip-toggle .sw { width: 8px; height: 8px; border-radius: 3px; }
.legend { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.legend .l { display: flex; align-items: center; gap: 8px; }
.legend svg { flex: none; }

.canvas { position: relative; overflow: hidden; background:
  radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 22px 22px, var(--surface); touch-action: none; }
.canvas svg.graph { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; -webkit-user-select: none; }
.canvas svg.graph.panning { cursor: grabbing; }
.canvas-tools { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.canvas-tools .btn { box-shadow: var(--shadow); }
.canvas-left { position: absolute; left: 14px; top: 14px; z-index: 5; display: flex; gap: 6px; }
.canvas-stats { position: absolute; left: 14px; bottom: 12px; font-size: 12px; color: var(--faint); z-index: 5; }
.sim-bar {
  position: absolute; left: 50%; transform: translateX(-50%); top: 14px; z-index: 6; max-width: calc(100% - 140px);
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; border-radius: 12px;
  background: var(--raise); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13px;
}
.sim-bar .label { font-weight: 700; }
.sim-bar .stat { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.sim-bar .stat i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.drawer { border-left: 1px solid var(--line); background: var(--raise); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.drawer .close { margin-left: auto; }
.drawer h2 { font-size: 19px; font-weight: 700; line-height: 1.2; }
.drawer .section h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* graph primitives (SVG) */
.g-lane rect { fill: var(--raise); stroke: var(--line); }
.g-lane.alt rect { fill: var(--sunk); }
.g-lane text { fill: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.g-lane text.sub { font-weight: 500; letter-spacing: 0; text-transform: none; fill: var(--faint); }
.g-edge { fill: none; stroke: var(--line-3); stroke-width: 1.4; transition: opacity .15s; }
.g-edge.soft { stroke-dasharray: 5 4; }
.g-edge.unverified { opacity: .55; }
.g-edge.hi { stroke: var(--ink); stroke-width: 2; opacity: 1; }
.g-edge.down { stroke: var(--fail); stroke-width: 2; opacity: 1; }
.g-edge.degraded { stroke: var(--wait); stroke-width: 1.8; opacity: 1; }
.g-edge.dim { opacity: .08; }
.g-arrow { fill: var(--line-3); }
.g-arrow-hi { fill: var(--ink); }
.g-arrow-down { fill: var(--fail); }
.g-arrow-degraded { fill: var(--wait); }
.g-node { cursor: pointer; transition: opacity .15s; }
.g-node .box { fill: var(--raise); stroke: var(--line-2); stroke-width: 1; }
.g-node .stripe { fill: var(--k-app); }
.g-node.data .stripe { fill: var(--k-data); }
.g-node.external .stripe { fill: var(--k-ext); }
.g-node .title { fill: var(--ink); font-size: 13px; font-weight: 600; }
.g-node .meta { fill: var(--muted); font-size: 11px; }
.g-node .glyph { color: var(--muted); }
.g-node .tag { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; }
.g-node .tag-bg.t1 { fill: var(--fail-soft); } .g-node .tag.t1 { fill: var(--fail); }
.g-node .tag-bg.public { fill: var(--brand-soft); } .g-node .tag.public { fill: var(--brand-ink); }
.g-node .tag-bg.partner { fill: var(--wait-soft); } .g-node .tag.partner { fill: var(--wait); }
.g-node:hover .box, .g-node.hi .box { stroke: var(--ink); }
.g-node.sel .box { stroke: var(--brand); stroke-width: 2.5; }
.g-node.dim { opacity: .18; }
.g-node.match .box { stroke: var(--info); stroke-width: 2.5; }
.g-node.down .box { fill: var(--fail-soft); stroke: var(--fail); stroke-width: 1.8; }
.g-node.degraded .box { fill: var(--wait-soft); stroke: var(--wait); stroke-width: 1.8; }
.g-node.root .box { stroke-width: 3.5; }
.g-node .live { fill: var(--wait); }
.g-node .live.down { fill: var(--fail); }
.g-node.agg .box { stroke-width: 1.5; }
.g-node.agg .count { fill: var(--muted); font-size: 11px; font-weight: 600; }

/* ------------------------------------------------------------- modal */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(26,17,22,.42); display: grid; place-items: start center; padding: 6vh 16px; overflow-y: auto; }
.modal { width: min(680px, 100%); background: var(--raise); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal.wide { width: min(860px, 100%); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.modal header h2 { font-size: 18px; font-weight: 700; }
.modal .body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 16px 16px; }
.modal footer .left { margin-right: auto; }
.form-error { color: var(--fail); font-size: 13px; background: var(--fail-soft); padding: 8px 12px; border-radius: 9px; }
.placements { display: flex; flex-direction: column; gap: 8px; }
.placements .prow { display: grid; grid-template-columns: 1fr 90px 1fr 34px; gap: 8px; align-items: center; }

/* picker / combobox */
.picker { position: relative; }
.picker .control { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-height: 36px; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--raise); cursor: text; }
.picker .control:focus-within { border-color: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.picker .control input { border: 0; height: 26px; padding: 0 4px; flex: 1; min-width: 120px; box-shadow: none; background: transparent; }
.picker .control input:focus { box-shadow: none; }
.picker .pill { display: inline-flex; align-items: center; gap: 4px; background: var(--sunk); border-radius: 7px; padding: 2px 4px 2px 8px; font-size: 12.5px; font-weight: 600; }
.picker .pill button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 3px; font-size: 14px; line-height: 1; }
.picker .drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 90; max-height: 300px; overflow-y: auto; background: var(--raise); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 4px; }
.picker .opt { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.picker .opt.on { background: var(--surface); }
.picker .opt .sub { margin-left: auto; font-size: 12px; color: var(--faint); white-space: nowrap; }
.picker .grp { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 8px 9px 4px; }
.picker .none { padding: 10px; color: var(--muted); font-size: 13px; }

.palette { position: fixed; inset: 0; z-index: 85; background: rgba(26,17,22,.35); display: grid; place-items: start center; padding-top: 12vh; }
.palette .box { width: min(620px, calc(100% - 32px)); }
.palette .picker .control { min-height: 48px; font-size: 15px; box-shadow: var(--shadow-lg); }
.palette .picker .drop { max-height: 55vh; }

/* toast */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px; }
.toast.error { background: var(--fail); color: #fff; }

/* login / plain pages */
body.plain { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 24px; }
.login-hero { min-height: calc(100vh - var(--top)); display: grid; place-items: center; padding: 24px; }
.login-hero .card { width: min(520px, 100%); text-align: left; padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.login-hero .band {
  margin: -30px -30px 6px; padding: 26px 30px; border-radius: var(--radius) var(--radius) 0 0; color: #fff;
  background: radial-gradient(120% 160% at 12% -20%, rgba(255,120,124,.55) 0%, rgba(255,120,124,0) 55%), linear-gradient(135deg, #E5002B 0%, #C10024 62%, #96001B 100%);
}
.login-hero .band img { height: 26px; filter: brightness(0) invert(1); display: block; margin-bottom: 18px; }
.login-hero .band h1 { font-size: 26px; line-height: 1.15; }
.login-hero .band p { margin: 6px 0 0; color: rgba(255,255,255,.8); }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------- accounts / users */
.avatar.static { cursor: default; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.ghost { background: transparent; color: var(--faint); border: 1px dashed var(--line-3); }
.avatar.pending { box-shadow: 0 0 0 2px var(--raise), 0 0 0 4px var(--wait); }
.item.member { gap: 10px; }
.whoami { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.whoami .avatar { width: 40px; height: 40px; font-size: 14px; }
.whoami .pid { display: flex; align-items: center; gap: 6px; }
.whoami .pid .eyebrow { margin: 0; }
.whoami .pid code { font-size: 15px; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.btn.danger-text { color: var(--fail); }
.btn.danger-text:hover { background: var(--fail-soft); }
.pending-card { margin-bottom: 18px; border-color: color-mix(in srgb, var(--wait) 35%, var(--line)); }
.pending-card .item { gap: 12px; flex-wrap: wrap; }
.table.users td { vertical-align: middle; }
.table.users .note-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
@media (max-width: 860px) { .whoami { flex-wrap: wrap; } }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .search-btn { min-width: 0; }
  .search-btn .grow, .search-btn kbd { display: none; }
}
@media (max-width: 860px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand .sep, .brand .product { display: none; }
  .nav a .icon { display: none; }
  .map-layout, .map-layout.with-drawer { grid-template-columns: minmax(0, 1fr); }
  .map-layout .sidebar { position: absolute; z-index: 20; top: var(--top); left: 0; bottom: 0; width: min(300px, 86vw); box-shadow: var(--shadow-lg); }
  .map-layout .drawer { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; max-height: 62vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg); }
  .grid2, .grid3, .choice { grid-template-columns: 1fr; }
  .placements .prow { grid-template-columns: 1fr 70px 34px; }
  .placements .prow .note { grid-column: 1 / -1; grid-row: 2; }
  dl.props { grid-template-columns: 110px 1fr; }
  .audit .entry { grid-template-columns: 1fr; gap: 2px; }
  .page { padding: 18px 14px 60px; }
  .sim-bar { flex-wrap: wrap; max-width: calc(100% - 28px); top: auto; bottom: 14px; }
}
.canvas-stats { background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 2px 8px; border-radius: 6px; }
.sim-bar > * { white-space: nowrap; }
.sim-bar { width: max-content; }
@media (max-width: 860px) { .sim-bar { width: auto; } .sim-bar > * { white-space: normal; } }
.table td.nowrap, .table th { white-space: nowrap; }
/* A display:none sidebar leaves the grid, so the canvas must own column 1. */
.map-layout.no-side { grid-template-columns: minmax(0, 1fr); }
.map-layout.no-side.with-drawer { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 860px) {
  .map-layout, .map-layout.with-drawer, .map-layout.no-side, .map-layout.no-side.with-drawer { grid-template-columns: minmax(0, 1fr); }
}

/* ---- runtime on graph nodes: stripe + dot = health, glyph colour = category ---- */
.g-node .stripe { fill: var(--line-3); }
.g-node .glyph { color: var(--k-app); }
.g-node.data .glyph { color: var(--k-data); }
.g-node.external .glyph { color: var(--k-ext); }
.g-node .rt-sep { stroke: var(--line); }
.g-node .hdot { fill: var(--line-3); }
.g-node .rt { fill: var(--muted); font-size: 10.5px; font-weight: 500; }
.g-node.no-rt .rt-sep, .g-node.no-rt .hdot { visibility: hidden; }
.g-node.h-ok .stripe, .g-node.h-ok .hdot { fill: var(--ok); }
.g-node.h-warn .stripe, .g-node.h-warn .hdot { fill: var(--wait); }
.g-node.h-warn .rt { fill: var(--wait); }
.g-node.h-down .stripe, .g-node.h-down .hdot { fill: var(--fail); }
.g-node.h-down .rt { fill: var(--fail); font-weight: 700; }
.g-edge.off { display: none; }
.g-edge { opacity: .75; }
.g-edge.unverified { opacity: .4; }
.g-edge.hi, .g-edge.down, .g-edge.degraded { opacity: 1; }

/* ---- map stage: toolbar + graph | board ---- */
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage > .canvas { flex: 1 1 auto; min-height: 0; }
.stage-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 48px; padding: 7px 12px;
  border-bottom: 1px solid var(--line); background: var(--raise); }
.stage-bar .seg button { display: inline-flex; align-items: center; gap: 6px; }
.stage-bar .seg .icon { width: 14px; height: 14px; }
.hchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--raise); border-radius: 999px;
  padding: 3px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: default; }
.hchip i { width: 8px; height: 8px; border-radius: 50%; }
.hchip.ok i { background: var(--ok); } .hchip.warn i { background: var(--wait); } .hchip.down i { background: var(--fail); }
.hchip.warn, .hchip.down { cursor: pointer; }
.hchip.on { border-color: var(--ink); background: var(--sunk); }
.hd { width: 8px; height: 8px; border-radius: 50%; background: var(--line-3); display: inline-block; flex: none; }
.hd.ok { background: var(--ok); } .hd.warn { background: var(--wait); } .hd.down { background: var(--fail); }
.hpill { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.hpill.ok { background: var(--ok-soft); color: var(--ok); }
.hpill.warn { background: var(--wait-soft); color: var(--wait); }
.hpill.down { background: var(--fail-soft); color: var(--fail); }

/* ---- status board ---- */
.board { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px 48px; }
.board .sim-bar { position: sticky; top: 0; left: auto; transform: none; margin: 0 auto 14px; }
.board-lane { margin-bottom: 24px; }
.board-lane > header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 2px 10px; }
.board-lane > header h3 { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.board-lane > header .faint { font-size: 12px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; align-items: start; }
.bcard { background: var(--raise); border: 1px solid var(--line); border-top: 3px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.bcard.h-ok { border-top-color: var(--ok); } .bcard.h-warn { border-top-color: var(--wait); } .bcard.h-down { border-top-color: var(--fail); }
.bcard-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 2px; }
.bcard-head b { font-size: 14px; }
.bcard-loc { display: flex; align-items: center; gap: 6px; padding: 0 12px 8px; font-size: 11.5px; color: var(--faint); }
.bcard-loc .icon { width: 12px; height: 12px; }
.brows { display: flex; flex-direction: column; }
.brow { display: grid; grid-template-columns: 8px 16px minmax(0, 1fr) 36px 46px 60px; align-items: center; gap: 8px; width: 100%;
  padding: 6px 12px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; font-size: 13px; color: var(--ink); }
.brow:hover { background: var(--surface); }
.brow.sel { background: var(--brand-soft); }
.brow.sim-down { background: var(--fail-soft); }
.brow.sim-degraded { background: var(--wait-soft); }
.brow.dim { opacity: .32; }
.brow .num { text-align: right; font-size: 12px; color: var(--muted); }
.brow .span3 { grid-column: span 3; text-align: right; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .bname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.brow .bname em { font-style: normal; font-size: 9.5px; font-weight: 800; color: var(--fail); margin-left: 6px; }
.brow .bname .live { width: 13px; height: 13px; margin-left: 5px; color: var(--wait); }
.brow .bname .live.down { color: var(--fail); }
.kicon { width: 15px; height: 15px; color: var(--k-app); }
.kicon.data { color: var(--k-data); } .kicon.external { color: var(--k-ext); }
.drawer .brows { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.drawer .brows .brow:first-child { border-top: 0; }

/* ---- runtime panel (drawer + detail) ---- */
.rt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.rt-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; display: flex; flex-direction: column; }
.rt-grid span { font-size: 11px; color: var(--muted); font-weight: 600; }
.rt-grid b { font-size: 16px; line-height: 1.3; }
.rt-grid small { font-size: 11px; color: var(--faint); }
.bar { height: 6px; border-radius: 99px; background: var(--sunk); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.bar i.hot { background: var(--wait); }
.crow { display: grid; grid-template-columns: 8px minmax(0, 1fr) 52px 62px; gap: 8px; align-items: center; font-size: 12.5px; padding: 5px 0; border-top: 1px dashed var(--line); }
.crow .cname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 11.5px; }
.crow .cname em { font-style: normal; font-family: "DM Sans", sans-serif; font-size: 10px; color: var(--muted); margin-left: 6px; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; }
.crow .num { text-align: right; color: var(--muted); }
.legend-box summary { cursor: pointer; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.legend-box .legend { margin-top: 10px; }
@media (min-width: 1200px) { .detail-grid .rt-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 860px) {
  .stage-bar { gap: 8px; }
  .board { padding: 12px 10px 40px; }
  .board-grid { grid-template-columns: minmax(0, 1fr); }
}
.placements .prow { display: grid; grid-template-columns: 1.3fr 76px 1.3fr 34px; grid-template-areas: "c r s x" "cpu mem n n"; gap: 8px 10px;
  padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); align-items: end; }
.prow .pf { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.prow .pf > span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.prow .c { grid-area: c; } .prow .r { grid-area: r; } .prow .s { grid-area: s; } .prow .x { grid-area: x; }
.prow .cpu { grid-area: cpu; } .prow .mem { grid-area: mem; } .prow .n { grid-area: n; }
@media (max-width: 860px) {
  .placements .prow { grid-template-columns: 1fr 1fr; grid-template-areas: "c c" "r x" "s s" "cpu mem" "n n"; }
}
.crt { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; margin-bottom: 10px; }
.brow.bhead { cursor: default; padding-top: 4px; padding-bottom: 3px; background: none; }
.brow.bhead .num { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.brow.bhead:hover { background: none; }

/* ---- Datadog in the health panel ---- */
.rt-sub { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hpill.big { font-size: 12.5px; padding: 2px 10px; }
.apm { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.apm-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 54px 58px; gap: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--ink); border-top: 1px solid var(--line); align-items: center; }
.apm-row:first-child { border-top: 0; }
.apm-row > span:not(.svc) { text-align: right; font-variant-numeric: tabular-nums; }
.apm-row.head { background: var(--surface); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
a.apm-row:hover { background: var(--surface); text-decoration: none; }
.apm-row .svc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 11.5px; }
.apm-row .svc .icon { width: 11px; height: 11px; color: var(--faint); }
.apm-row .hot, .brow .hot, .table .hot { color: var(--fail); font-weight: 700; }
.mon { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 5px 2px; color: var(--ink); }
.mon:hover { text-decoration: none; background: var(--surface); }
.mini-tag .icon { width: 11px; height: 11px; }
.brow { grid-template-columns: 8px 16px minmax(0, 1fr) 34px 44px 56px 52px; }
.brow .span4 { grid-column: span 4; text-align: right; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--faint); display: inline-flex; align-items: center; gap: 5px; }
.src::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-3); }
.src.ok { color: var(--ink); } .src.ok::before { background: var(--ok); }
.src.warn { color: var(--wait); } .src.warn::before { background: var(--wait); }
.src.off { text-decoration: line-through; opacity: .7; }
.ddhost { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.hbar { display: grid; grid-template-columns: 56px 1fr 44px; gap: 8px; align-items: center; font-size: 12px; margin-top: 4px; }
.hbar .bar { margin: 0; }
.hbar b { text-align: right; font-size: 12px; }
.hbar span { color: var(--muted); }

/* ---- recorded resources (static) ---- */
.g-node .stripe { fill: var(--k-app); }
.g-node.data .stripe { fill: var(--k-data); }
.g-node.external .stripe { fill: var(--k-ext); }
.g-node .hdot, .g-node .rt-sep { visibility: hidden; }
.g-node .rt { fill: var(--muted); }
.res-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.res-row { display: flex; gap: 10px; padding: 9px 11px; border-top: 1px solid var(--line); align-items: flex-start; }
.res-row:first-child { border-top: 0; }
.res-nums { display: grid; grid-template-columns: repeat(3, auto); gap: 10px; flex: none; text-align: right; }
.res-nums span { display: flex; flex-direction: column; }
.res-nums small { font-size: 10.5px; color: var(--faint); font-weight: 600; }
.res-nums b { font-size: 13px; }
a.ref { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
a.ref code { font-size: 11.5px; }
a.ref .icon { width: 13px; height: 13px; color: var(--muted); }
.brow { grid-template-columns: 8px 16px minmax(0, 1fr) 40px 56px 60px; }
.hd.kc.app { background: var(--k-app); } .hd.kc.data { background: var(--k-data); } .hd.kc.external { background: var(--k-ext); }

/* ----------------------------------------------------------- impact intro */
.impact-intro h2 { font-size: 17px; margin: 0 0 6px; }
.impact-intro p { margin: 0 0 10px; font-size: 14px; }
.impact-intro .bullets { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.pick-chip { cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; }
.pick-chip:hover { border-color: var(--line-3); filter: brightness(.97); }
