/* Схема инфраструктуры — тёмный дашборд.
   Одна страница: шапка, сводка, живое полотно со связями, строка тревог и
   выдвижная панель с подробностями. Без внешних шрифтов и картинок. */

:root {
  --bg: #070a11;
  --bg-2: #0a0f19;
  --panel: #101827;
  --panel-2: #131d30;
  --line: rgba(255, 255, 255, .08);
  --line-soft: rgba(255, 255, 255, .05);
  --text: #e9effb;
  --muted: #8b98af;
  --dim: #5f6c83;
  --ok: #35d39a;
  --warn: #f7b955;
  --down: #ff6b81;
  --info: #6f9cff;
  --accent: #5b8cff;
  --radius: 16px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 10% -5%, rgba(91, 140, 255, .16), transparent 70%),
    radial-gradient(800px 500px at 95% 0%, rgba(56, 211, 159, .10), transparent 70%),
    radial-gradient(700px 400px at 50% 110%, rgba(177, 140, 255, .08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto;
  height: 100vh;
  min-height: 0;
}

/* --- шапка ---------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(8px);
  background: rgba(7, 10, 17, .72);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-text h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .2px;
}
.brand-text p {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.live {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 24, 39, .8);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(53, 211, 154, .6);
  animation: pulse 2.4s infinite;
}
.live.is-stale .live-dot { background: var(--warn); animation: none; }
.live.is-error .live-dot { background: var(--down); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(53, 211, 154, .55); }
  70% { box-shadow: 0 0 0 7px rgba(53, 211, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 211, 154, 0); }
}
.live-sep { width: 1px; height: 12px; background: var(--line); }
.live-count { font-variant-numeric: tabular-nums; color: var(--text); }

.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(19, 29, 48, .7);
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.tool:hover { background: rgba(30, 44, 70, .9); border-color: rgba(255, 255, 255, .16); }
.tool svg { width: 13px; height: 13px; }
.tool.icon { width: 30px; padding: 0; justify-content: center; font-size: 15px; }
.tool.toggle { color: var(--muted); }
.tool.toggle[aria-pressed="true"] {
  color: #cfe0ff;
  border-color: rgba(91, 140, 255, .5);
  background: rgba(91, 140, 255, .14);
}
.seg { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; }
.seg .tool { border: 0; background: transparent; height: 24px; }
.seg .tool.icon { width: 26px; }

/* --- сводка --------------------------------------------------------------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 22px 10px;
}
.kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(19, 29, 48, .85), rgba(13, 20, 34, .85));
  min-width: 0;
}
.kpi-icon {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(91, 140, 255, .12);
  color: #9dbbff;
}
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--dim); }
.kpi-value { font-size: 18px; font-weight: 620; letter-spacing: -.2px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.kpi-sub { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.down .kpi-value { color: var(--down); }
.kpi.warn .kpi-value { color: var(--warn); }
.kpi.warn .kpi-icon { background: rgba(247, 185, 85, .14); color: var(--warn); }
.kpi.down .kpi-icon { background: rgba(255, 107, 129, .14); color: var(--down); }
.kpi.ok .kpi-icon { background: rgba(53, 211, 154, .12); color: var(--ok); }

/* --- полотно -------------------------------------------------------------- */

.canvas-wrap {
  position: relative;
  overflow: hidden;
  padding: 6px 22px 4px;
  min-height: 0;
  scrollbar-width: thin;
}
.canvas-wrap.is-scroll { overflow: auto; }
.canvas-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.canvas-wrap::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 8px; }

.stage {
  position: relative;
  transform-origin: 0 0;
  width: 1480px;
  height: 800px;
  margin: 0 auto;
}

.edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nodes { position: absolute; inset: 0; }
.edge-labels { position: absolute; inset: 0; pointer-events: none; }

/* --- карточка сервера ----------------------------------------------------- */

.node {
  position: absolute;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 26, 43, .96), rgba(11, 17, 29, .96));
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s, opacity .18s, transform .18s;
  cursor: default;
}
.node::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--node-accent, var(--accent)), transparent);
  opacity: .75;
}
.node:hover { border-color: rgba(255, 255, 255, .16); box-shadow: 0 22px 48px -26px rgba(0, 0, 0, .95); }
.node.is-offline { border-color: rgba(255, 107, 129, .38); }
.node.is-offline::before { background: linear-gradient(90deg, transparent, var(--down), transparent); }
.node.is-active {
  border-color: var(--node-accent, var(--accent));
  box-shadow: 0 0 0 1px var(--node-accent, var(--accent)), 0 26px 60px -30px rgba(0, 0, 0, 1);
}
.node.is-dim { opacity: .38; }
.node.is-dim:hover { opacity: .8; }

.node-head { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px 7px; }
.node-title { min-width: 0; flex: 1; }
.node-top { display: flex; align-items: center; gap: 8px; }
.node-name { margin: 0; font-size: 14.5px; font-weight: 640; letter-spacing: .1px; }
.node-tag {
  font-size: 9.5px;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--node-accent, var(--accent));
  background: color-mix(in srgb, var(--node-accent, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--node-accent, var(--accent)) 28%, transparent);
  white-space: nowrap;
}
.node-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.node-sub code {
  font-family: var(--mono);
  font-size: 10px;
  color: #b6c4dc;
  background: rgba(255, 255, 255, .05);
  padding: 1px 5px;
  border-radius: 4px;
}
.node-sub .sep { color: var(--dim); }
.geo {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-soft);
  color: #c6d4ea;
  font-size: 10px;
  white-space: nowrap;
}

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(53, 211, 154, .55); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(247, 185, 85, .5); }
.dot.down { background: var(--down); box-shadow: 0 0 8px rgba(255, 107, 129, .55); }
.dot.off { background: var(--dim); }

/* нагрузка */

.gauges {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 2px 14px 6px;
}
.ring { position: relative; width: 54px; height: 54px; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring .track { stroke: rgba(255, 255, 255, .08); }
.ring .value { stroke: var(--ring-color, var(--ok)); transition: stroke-dashoffset .6s ease, stroke .3s; }
.ring-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}
.ring-cap {
  position: absolute;
  left: 0; right: 0; bottom: -11px;
  text-align: center;
  font-size: 8.5px;
  letter-spacing: .7px;
  color: var(--dim);
  text-transform: uppercase;
}
.metric { min-width: 0; }
.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
}
.metric-top b { color: var(--text); font-weight: 600; font-size: 11px; font-variant-numeric: tabular-nums; }
.bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--bar-color, var(--ok)); transition: width .5s ease; }
.metric-net {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--dim);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.metric-net b { color: var(--muted); font-weight: 600; }

.spark { height: 28px; margin: 0 14px 6px; position: relative; }
.spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.spark .area { fill: url(#sparkFill); }
.spark .line { fill: none; stroke: var(--node-accent, var(--accent)); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.spark .cap {
  position: absolute;
  top: 0; right: 0;
  font-size: 9px;
  color: var(--dim);
  background: rgba(11, 17, 29, .8);
  padding: 0 3px;
  border-radius: 4px;
}

/* продукты */

.products {
  list-style: none;
  margin: 0;
  padding: 0 8px 4px;
  overflow: auto;
  flex: 1;
  /* при дробном масштабе контент может не влезать на 1–3 px: прокрутка
     остаётся, но полоса не рисуется */
  scrollbar-width: none;
}
.products::-webkit-scrollbar { width: 0; height: 0; }

.product {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.product:hover { background: rgba(255, 255, 255, .045); }
.product.is-active { background: rgba(91, 140, 255, .12); }
.p-name {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.p-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-ver {
  font-family: var(--mono);
  font-size: 9px;
  color: #a8bce0;
  background: rgba(255, 255, 255, .06);
  border-radius: 4px;
  padding: 0 4px;
  flex: none;
}
.p-channel {
  font-size: 8.5px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  white-space: nowrap;
  flex: none;
}
.p-channel.is-warm { color: var(--warn); border-color: rgba(247, 185, 85, .35); background: rgba(247, 185, 85, .08); }
.p-channel.is-hot { color: var(--down); border-color: rgba(255, 107, 129, .4); background: rgba(255, 107, 129, .1); }
.p-online.is-zero {
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  border-color: var(--line);
}
.p-online {
  font-size: 8.5px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--ok);
  background: rgba(53, 211, 154, .12);
  border: 1px solid rgba(53, 211, 154, .3);
  white-space: nowrap;
  flex: none;
}
.p-desc {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-load { text-align: right; min-width: 78px; }
.p-load-num {
  font-size: 9.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.p-load .bar { margin-top: 4px; height: 3px; }

.infra { padding: 3px 14px 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-soft);
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.chip b { color: #c6d4ea; font-weight: 600; }
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, .2); }
.chip.warn { color: var(--warn); border-color: rgba(247, 185, 85, .35); }

.node-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 14px 7px;
  border-top: 1px solid var(--line-soft);
  font-size: 10px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.node-foot b { color: var(--muted); font-weight: 600; }
.node-foot .bad { color: var(--warn); }

/* деплои (только на a1rcraft) */

.deploys { padding: 5px 14px 6px; border-top: 1px dashed var(--line-soft); }
.deploys h4 {
  margin: 0 0 4px;
  font-size: 9px;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
}
.deploy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  padding: 1px 0;
}
.deploy .dapp { color: #c9d7ee; font-weight: 600; }
.deploy .ver { color: #93a8c9; font-family: var(--mono); font-size: 9px; }
.deploy .arrow { color: var(--dim); }
.deploy .when { margin-left: auto; font-variant-numeric: tabular-nums; }

/* --- линии связей --------------------------------------------------------- */

.edge {
  fill: none;
  stroke: rgba(139, 152, 175, .55);
  stroke-width: 1.5;
  stroke-linecap: round;
  transition: stroke .2s, opacity .2s, stroke-width .2s;
}
.edge.deploy { stroke: rgba(111, 156, 255, .75); }
.edge.mirror { stroke: rgba(53, 211, 154, .7); }
.edge.vpn { stroke: rgba(56, 211, 159, .8); }
.edge.client { stroke: rgba(177, 140, 255, .7); }
.edge.sync { stroke: rgba(247, 185, 85, .62); }
.edge.flow { stroke-dasharray: 6 7; animation: flow 1.4s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -26; } }
.edge.is-hot { stroke-width: 2.4; opacity: 1; }
.edge.is-off { opacity: .18; }

.edge-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(8, 12, 20, .92);
  border: 1px solid var(--line);
  color: #b9c8e0;
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .2s, border-color .2s;
}
.edge-label .k { color: var(--dim); margin-right: 4px; }
.edge-label.is-off { opacity: .15; }
.edge-label.is-hidden { opacity: 0; }

/* --- строка тревог -------------------------------------------------------- */

.statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 22px;
  border-top: 1px solid var(--line-soft);
  background: rgba(7, 10, 17, .85);
  min-height: 48px;
}
.alerts { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.alerts::-webkit-scrollbar { display: none; }
.alert {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(19, 29, 48, .7);
  font-size: 10.5px;
  color: #c3d1e6;
  white-space: nowrap;
  cursor: pointer;
}
.alert:hover { border-color: rgba(255, 255, 255, .2); }
.alert .host { color: var(--dim); font-family: var(--mono); font-size: 9.5px; }
.alert.warn { border-color: rgba(247, 185, 85, .3); }
.alert.down { border-color: rgba(255, 107, 129, .35); }
.alert.info { opacity: .7; }
.alert .ic { font-size: 10px; }
.alert.warn .ic { color: var(--warn); }
.alert.down .ic { color: var(--down); }
.alert.info .ic { color: var(--info); }
.alerts .empty { font-size: 11px; color: var(--ok); display: flex; align-items: center; gap: 7px; }
.statusbar .legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  white-space: nowrap;
}
.statusbar .legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--muted);
}
.statusbar .legend .dot { width: 7px; height: 7px; }
.source { font-size: 10px; color: var(--dim); white-space: nowrap; }
.source code { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }

/* --- панель подробностей -------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, .34);
  backdrop-filter: blur(2px);
  z-index: 40;
  opacity: 0;
  transition: opacity .2s;
}
.scrim.is-open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 94vw);
  background: linear-gradient(180deg, #0d1523, #080d16);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .9);
  transform: translateX(102%);
  transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer-kicker {
  font-size: 9.5px;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--dim);
}
.drawer-head h2 { margin: 3px 0 0; font-size: 17px; font-weight: 650; letter-spacing: -.2px; }
.drawer-close {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(19, 29, 48, .7);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.drawer-close:hover { color: var(--text); border-color: rgba(255, 255, 255, .2); }
.drawer-body { padding: 14px 18px 26px; overflow: auto; }
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 8px; }

.dsec { margin-bottom: 18px; }
.dsec h4 {
  margin: 0 0 8px;
  font-size: 9.5px;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
}
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dstat {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(19, 29, 48, .45);
}
.dstat .l { font-size: 9.5px; color: var(--dim); letter-spacing: .4px; text-transform: uppercase; }
.dstat .v { font-size: 14px; font-weight: 620; font-variant-numeric: tabular-nums; margin-top: 2px; }
.dstat .s { font-size: 10px; color: var(--muted); margin-top: 1px; }

table.dt { width: 100%; border-collapse: collapse; font-size: 11px; }
table.dt th {
  text-align: left;
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--dim);
  padding: 4px 6px;
  border-bottom: 1px solid var(--line-soft);
}
table.dt td { padding: 5px 6px; border-bottom: 1px solid rgba(255, 255, 255, .03); }
table.dt td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.dt tr:hover td { background: rgba(255, 255, 255, .03); }
table.dt .u { font-family: var(--mono); font-size: 10px; color: #cbd8ec; }
table.dt .dim { color: var(--dim); }
.port {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(91, 140, 255, .14);
  color: #a9c3ff;
  margin-left: 3px;
}

.drow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
  font-size: 11.5px;
}
.drow .grow { flex: 1; min-width: 0; }
.drow .sub { font-size: 10px; color: var(--muted); }
.drow .val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 10.5px; }
.drow a { color: #9dbbff; text-decoration: none; }
.drow a:hover { text-decoration: underline; }

.pill {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.ok { color: var(--ok); border-color: rgba(53, 211, 154, .35); }
.pill.warn { color: var(--warn); border-color: rgba(247, 185, 85, .4); }
.pill.down { color: var(--down); border-color: rgba(255, 107, 129, .4); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(19, 29, 48, .98);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 11.5px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 60;
}
.toast.is-open { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- компактный режим и мелочи ------------------------------------------- */

.stage.is-table .node {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  margin: 0 0 12px;
}
.stage.is-table .products { overflow: visible; }
.stage.is-table .edges, .stage.is-table .edge-labels { display: none; }
.stage.is-table { width: auto !important; height: auto !important; }
.stage.is-table .node { max-width: 620px; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-text p { display: none; }
}
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .tools { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .tool span { display: none; }
  .tool#btnRefresh { padding: 0 9px; }
  .kpis { padding: 10px 14px 8px; }
  .canvas-wrap { padding: 4px 14px; }
  .statusbar { padding: 8px 14px; }
  .source { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
