:root {
  --bg: #f6f2ff;
  --surface: #ffffff;
  --ink: #211238;
  --muted: #665779;
  --line: rgba(67, 39, 112, 0.18);
  --purple: #ee78e9;
  --purple-hover: #f39af0;
  --purple-soft: rgba(238, 120, 233, 0.14);
  --gray-strong: #100a26;
  --gray-panel: #21104e;
  --gray-muted: #cfc2e4;
  --ok: #7d4db3;
  --ok-bg: rgba(208, 165, 244, 0.18);
  --warn: #f6a3f4;
  --bad: #b24d8e;
  --sidebar: 244px;
  --radius: 18px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--purple); text-decoration: none; }
button, input, select { font: inherit; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100%;
}
.menu-toggle, .sidebar-scrim { display: none; }

.sidebar {
  background: var(--gray-strong);
  border-right: 1px solid rgba(255,255,255,0.08);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  color: #fff;
  text-decoration: none;
}
.brand img { width: 22px; height: 22px; }
.brand strong { display: block; font-size: 14px; letter-spacing: -0.02em; }
.brand span { display: block; color: var(--gray-muted); font-size: 11px; font-weight: 500; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255,255,255,0.84);
  cursor: pointer;
}
.nav button:hover { background: rgba(255,255,255,0.07); }
.nav button.active { background: var(--purple); color: #fff; font-weight: 600; }

.tenant {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  padding: 14px;
  background: var(--gray-panel);
  color: #fff;
}
.tenant .name { font-weight: 600; }
.tenant .meta { color: var(--gray-muted); font-size: 12px; margin: 2px 0 8px; }
.tenant .key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--gray-muted);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 980px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
}

.main { padding: 30px clamp(24px, 3vw, 48px) 48px; min-width: 0; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.top-right { display: flex; align-items: center; gap: 12px; }
.live {
  display: flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.sub { color: var(--muted); font-size: 14px; margin-top: 7px; line-height: 1.45; }
.main section > .top > div:first-child { position: relative; padding-left: 18px; }
.main section > .top > div:first-child::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: var(--purple);
}
.main section > .top h1 {
  font-family: Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(34px, 3vw, 42px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}
.main section > .top .sub { color: var(--muted); font-size: 15px; font-weight: 500; }

.seg {
  display: flex;
  background: #21104e;
  padding: 3px;
  border-radius: 980px;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 980px;
  cursor: pointer;
  color: var(--muted);
}
.seg button.active { background: var(--purple); color: #160a25; font-weight: 600; }
.live {
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 980px;
}

.metric-section + .metric-section { margin-top: 24px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 2px 10px; }
.section-heading span {
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.kpis, .kpis-2 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.20);
}
.card .label { color: var(--muted); font-size: 12px; }
.card .value {
  font-size: 26px;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin-top: 6px;
  color: var(--ink);
}
.card .hint { color: var(--muted); font-size: 11px; margin-top: 4px; }
.muted { color: var(--muted); }
#view-preflight .tile { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
#view-preflight table { width: 100%; }
.card .value.ok { color: var(--ok); }

#tg-entry {
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border-color: rgba(125, 77, 179, 0.48);
  background: linear-gradient(105deg, rgba(208, 165, 244, 0.20), var(--surface) 46%);
}
#tg-entry h2 { margin: 0 0 4px; font-size: 18px; }
#tg-entry .note { margin: 0; }
#tg-entry .btn { flex: none; background: #6f3d9f; }

.charts {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 14px;
  margin: 26px 0 0;
}
.chart-box { padding: 20px; container-type: inline-size; }
.chart-box h2, .table-box h2, .panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}
.chart-plot { position: relative; }
canvas { width: 100%; height: 200px; display: block; cursor: crosshair; }
.series-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 132px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10,6,29,.96);
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
  white-space: pre-line;
}

.mix { display: grid; grid-template-columns: 154px minmax(0, 1fr); align-items: center; gap: 22px; margin-top: 4px; }
.donut {
  width: 154px; height: 154px; border-radius: 50%;
  background: conic-gradient(#4f287e 0 48%, #ee78e9 48% 72%, #b86deb 72% 88%, #d9c8ed 88% 100%);
  position: relative;
  flex: 0 0 154px;
}
.donut::after {
  content: attr(data-center);
  position: absolute; inset: 22px;
  background: var(--surface); border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px; text-align: center;
  color: var(--ink);
}
.legend { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); }
.mix .legend { width: 100%; }
.mix .legend li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.mix .legend li:last-child { border-bottom: 0; }
.mix .legend li span:first-child { display: flex; align-items: center; min-width: 0; color: var(--ink); font-weight: 600; }
.mix .legend li span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }

.table-box { margin-top: 10px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
tr.selected td { background: rgba(238, 120, 233, 0.10); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.tag {
  display: inline-block;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
}
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.bad { background: rgba(239, 176, 210, 0.14); color: var(--bad); }
.tag.warn { background: rgba(242, 168, 245, 0.14); color: var(--warn); }
.tag.mute { background: var(--bg); color: var(--muted); }

.note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.gate, .empty {
  max-width: 460px;
  margin: 12vh auto;
  border-radius: 22px;
  padding: 28px;
}
.gate {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.gate {
  background: #100a26;
  border-color: rgba(218, 166, 255, 0.42);
  color: #f8f2ff;
}
.empty { background: var(--surface); border: 1px solid var(--line); }
.gate-logo { height: 38px; width: auto; display: block; margin-bottom: 18px; }
.gate h1 { font-size: 24px; }
.gate p { color: #c2b5d8; }
.empty p { color: var(--muted); }
.gate input {
  width: 100%;
  margin: 14px 0;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}
.gate input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(238,120,233,0.22);
}
.btn {
  appearance: none;
  border: 0;
  background: var(--purple);
  color: #fff;
  border-radius: 980px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 500;
}
.btn.ghost {
  background: transparent;
  color: var(--purple);
  border: 1px solid rgba(238,120,233,0.38);
}
.demo-link {
  appearance: none;
  display: inline-flex;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--purple);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.demo-link:hover { color: var(--purple-hover); text-decoration: underline; }
.gate .btn.ghost { color: var(--purple); border-color: rgba(238,120,233,0.38); }
.gate .note { color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

.split {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
}
.turns-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.turns-summary article {
  min-width: 0;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 5px 16px rgba(37, 35, 42, 0.035);
}
.turns-summary span, .turns-summary small { display: block; color: var(--muted); }
.turns-summary span { font-size: 12px; font-weight: 600; }
.turns-summary strong { display: block; margin: 5px 0 2px; color: var(--ink); font-size: 21px; letter-spacing: -0.035em; }
.turns-summary small { font-size: 11px; }
.turns-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.turns-toolbar label, .turns-filter { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 600; }
.turns-toolbar input { height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 0 11px; outline: none; }
.turns-toolbar input { width: min(320px, 52vw); }
.turns-toolbar input:focus, .filter-trigger:focus-visible { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(238,120,233,0.15); }
.filter-menu { position: relative; }
.filter-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 154px; height: 38px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color 160ms ease, background 160ms ease;
}
.filter-trigger:hover, .filter-trigger[aria-expanded="true"] { border-color: rgba(238,120,233,.48); background: rgba(238,120,233,.08); }
.filter-trigger svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform 160ms ease; }
.filter-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.filter-options {
  position: absolute; z-index: 4; top: calc(100% + 7px); right: 0; width: 190px; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  box-shadow: 0 14px 30px rgba(0,0,0,.35);
}
.filter-options button {
  display: flex; width: 100%; align-items: center; padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); text-align: left; font: inherit; font-size: 13px; cursor: pointer;
}
.filter-options button:hover, .filter-options button:focus-visible { background: var(--purple-soft); outline: 0; }
.filter-options button[aria-checked="true"] { color: var(--purple-hover); font-weight: 700; }
.filter-options button[aria-checked="true"]::after { content: "✓"; margin-left: auto; font-size: 14px; }
.turns-table { table-layout: fixed; }
.turns-table th:nth-child(1) { width: 12%; }
.turns-table th:nth-child(2) { width: 15%; }
.turns-table th:nth-child(3) { width: 27%; }
.turns-table th:nth-child(4) { width: 22%; }
.turns-table th:nth-child(5) { width: 10%; }
.turns-table th:nth-child(6) { width: 14%; }
.turns-table td { padding-top: 13px; padding-bottom: 13px; }
.turns-table tr[data-i] { cursor: pointer; transition: background 160ms ease; }
.turns-table tr[data-i]:hover td { background: rgba(125,77,179,.06); }
.turns-table tr.selected td { background: rgba(125,77,179,.08); }
.turns-table tr.selected td:first-child { box-shadow: inset 2px 0 0 #7d4db3; }
.turns-table td:nth-child(2), .turns-table td:nth-child(5), .turns-table td:nth-child(6) { white-space: nowrap; }
.turns-table td:nth-child(3) { overflow-wrap: anywhere; }
#view-turns .tag.ok { color: #6f3d9f; background: rgba(125,77,179,.12); }
#view-turns .tag.warn { color: #80609d; background: rgba(208,165,244,.22); }
.tag.busy, #view-turns .tag.busy { color: #8a5300; background: rgba(245,166,35,.18); } /* amber: SANDBOX_BUSY */
#view-turns .inspector-group h3 { color: #6f3d9f; }
#view-turns .filter-trigger:hover, #view-turns .filter-trigger[aria-expanded="true"] { border-color: rgba(125,77,179,.48); background: rgba(125,77,179,.08); }
#view-turns .filter-trigger:focus-visible { border-color: #7d4db3; box-shadow: 0 0 0 3px rgba(125,77,179,.15); }
#view-turns .filter-options button[aria-checked="true"] { color: #6f3d9f; background: rgba(208,165,244,.22); }
.inspector { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow: auto; }
.inspector-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.inspector-heading h2 { margin: 0; }
.inspector-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.inspector-group + .inspector-group { margin-top: 17px; }
.inspector-group h3 { margin: 0 0 5px; color: var(--purple); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.inspector .row-kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.inspector .row-kv span { color: var(--muted); }

@media (max-width: 680px) {
  #view-traceguard .tg-card { padding-top: 40px; }
  #view-traceguard .tg-tier { top: 12px; right: 12px; }
  .turns-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .turns-summary article { padding: 13px; }
  .turns-toolbar { align-items: stretch; flex-direction: column; }
  .turns-toolbar label, .turns-filter { width: 100%; }
  .turns-toolbar input { width: 100%; }
  .filter-trigger { width: 100%; }
  .turns-table th:nth-child(2), .turns-table td:nth-child(2), .turns-table th:nth-child(5), .turns-table td:nth-child(5) { display: none; }
  .turns-table th:nth-child(1) { width: 19%; }
  .turns-table th:nth-child(3) { width: 34%; }
  .turns-table th:nth-child(4) { width: 29%; }
  .turns-table th:nth-child(6) { width: 18%; }
}

.hidden { display: none !important; }

@media (max-width: 1100px) {
  .kpis, .kpis-2 { grid-template-columns: repeat(3, 1fr); }
  .charts, .split { grid-template-columns: 1fr; }
  .inspector { position: static; max-height: none; }
}
@media (max-width: 800px) {
  .app { display: block; }
  .main { padding: 24px 18px 32px; }
  .top { align-items: flex-start; flex-direction: column; gap: 14px; }
  .top-right { width: 100%; justify-content: space-between; }
  .menu-toggle {
    display: inline-flex;
    position: fixed;
    z-index: 11;
    top: 16px;
    right: 16px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--purple);
    cursor: pointer;
  }
  .menu-toggle:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
  .menu-icon, .menu-icon::before, .menu-icon::after {
    position: absolute;
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .22s ease, opacity .18s ease, background .18s ease;
  }
  .menu-icon::before, .menu-icon::after { content: ""; left: 0; top: 0; }
  .menu-icon::after { opacity: 0; }
  .menu-toggle:hover .menu-icon::before,
  .menu-toggle:focus-visible .menu-icon::before,
  .menu-toggle[aria-expanded="true"] .menu-icon::before { transform: rotate(45deg); }
  .menu-toggle:hover .menu-icon::after,
  .menu-toggle:focus-visible .menu-icon::after,
  .menu-toggle[aria-expanded="true"] .menu-icon::after { opacity: 1; transform: rotate(-45deg); }
  .sidebar {
    display: flex;
    position: fixed;
    z-index: 12;
    inset: 0 auto 0 0;
    width: min(280px, calc(100vw - 48px));
    transform: translateX(-102%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, visibility 0s linear .22s;
    box-shadow: 18px 0 36px rgba(0,0,0,.38);
  }
  .sidebar.open { transform: translateX(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .sidebar-scrim {
    position: fixed;
    z-index: 10;
    inset: 0;
    border: 0;
    background: rgba(10,6,29,.72);
  }
  .sidebar-scrim.visible { display: block; }
  .gate, .empty { margin: 7vh 14px; padding: 24px 22px; }
  html { scrollbar-width: none; }
  body::-webkit-scrollbar { display: none; }
}

.nav button { display: flex; align-items: center; gap: 8px; }
.nav button svg { width: 16px; height: 16px; flex: 0 0 16px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.live { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.card .delta { font-size: 11px; margin-top: 6px; font-weight: 700; letter-spacing: .01em; }
.card .delta.up { color: #6f3d9f; }
.card .delta.down { color: #a63f7f; }
.card .delta.flat { color: var(--muted); }
.keyrow { display: flex; align-items: center; gap: 8px; }
.iconbtn {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 2px 7px; font-size: 11px; color: var(--muted); cursor: pointer;
}
.iconbtn:hover { color: var(--ink); }
.statusbar {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
}

.health-card { max-width: 860px; }
.health-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.health-head h2 { margin: 0; font-size: 16px; }
.health-head .note { margin: 4px 0 0; }
.health-status {
  display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 9px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap;
}
.health-status.health-ok { color: #287553; border-color: rgba(40,117,83,.35); background: rgba(40,117,83,.08); }
.health-status.health-bad { color: #a63f7f; border-color: rgba(166,63,127,.35); background: rgba(166,63,127,.08); }
.health-card .mono { min-height: 70px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.chart-box h2 { display: flex; align-items: baseline; justify-content: space-between; }
.chart-box h2 .hint { font-size: 11px; color: var(--muted); font-weight: 500; }
.legend li span:last-child { font-variant-numeric: tabular-nums; color: var(--ink); }

.brand-mark {
  width: 28px; height: 28px;
  background: transparent; display: grid; place-items: center; flex: 0 0 28px;
}
.brand-mark img { width: 28px; height: 26px; }
.nav button { display: flex; align-items: center; gap: 10px; }
.nav button svg { width: 16px; height: 16px; flex: 0 0 16px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.live { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.tenant-head { display: flex; gap: 10px; align-items: flex-start; }
.cube {
  width: 28px; height: 28px; border-radius: 8px; background: #21104e;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1d1f' stroke-width='1.7'><path d='M12 3 20 7.5v9L12 21 4 16.5v-9L12 3z'/><path d='M12 21V12M20 7.5 12 12 4 7.5'/></svg>");
  background-size: 16px; background-repeat: no-repeat; background-position: center;
}
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.copy { appearance: none; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.card .delta { font-size: 11px; margin-top: 6px; color: #6f3d9f; }
.card .delta.up { color: #6f3d9f; }
.card .delta.down { color: #a63f7f; }
.card .delta.flat { color: var(--muted); }
.card .hint { display: none; }
#view-traceguard .card .hint { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 6px; }
.tg-card { position: relative; }
.tg-tier {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(255,255,255,.72);
}
.tier-none, .tier-notice { color: #76628d; }
.tier-low { color: #6f3d9f; }
.tier-medium { color: #9b4d91; }
.tier-high { color: #a63f7f; }
#view-traceguard #tg-upgrade { margin-top: 18px; }
#view-traceguard #tg-upgrade .btn { margin-top: 4px; }
.chart-head { display: flex; align-items: center; gap: 8px; }
.chart-head h2 { margin: 0; }
.info {
  width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line);
  color: var(--muted); font-size: 10px; font-weight: 700; display: grid; place-items: center; cursor: help;
}
.chart-sub { color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; font-size: 12px; font-weight: 500; margin: 4px 0 10px; }
.chart-legend { display: flex; gap: 16px; color: var(--muted); font-size: 12px; margin-top: 8px; }
.swatch { display: inline-block; width: 10px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.swatch.used { background: #4f287e; }
.swatch.av { background: #ee78e9; }
.donut {
  width: 154px; height: 154px; border-radius: 50%;
  position: relative; flex: 0 0 148px;
  display: grid; place-items: center;
}
.donut::after { content: none; }
.donut span { position: relative; z-index: 1; font-size: 18px; font-weight: 650; letter-spacing: -0.03em; }
.donut small { position: absolute; top: 58%; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 11px; }
.donut::before {
  content: ""; position: absolute; inset: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 50%; box-shadow: inset 0 1px 2px rgba(0,0,0,.12);
}
@media (max-width: 560px) {
  .mix { grid-template-columns: 1fr; justify-items: center; }
  .mix .legend { max-width: 360px; }
}
@container (max-width: 430px) {
  .mix { grid-template-columns: 1fr; justify-items: center; gap: 14px; }
  .mix .legend { max-width: 100%; }
  .mix .legend li { padding: 8px 0; }
}
.legend li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 5px 0; }
.legend .pct { color: var(--muted); min-width: 3.2em; text-align: right; }
.foot {
  margin-top: 18px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
@media (max-width: 800px) {
  .top-right { gap: 8px; }
  .live { flex: 0 0 auto; white-space: nowrap; padding: 6px 9px; }
  .seg button { padding: 6px 9px; }
}
@media (max-width: 680px) {
  #view-limits .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #view-limits .card { min-width: 0; }
  #view-overview .kpis, #view-overview .kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #view-overview .card { min-width: 0; }
  #view-overview { min-width: 0; overflow-x: hidden; }
  .hash-table { table-layout: fixed; }
  .hash-table th:last-child, .hash-table td:last-child { display: none; }
  .hash-table th:first-child { width: 48%; }
  .hash-table td:first-child { overflow-wrap: anywhere; word-break: break-word; }
}
