:root {
  --bg: #0c0e12;
  --bg-elev: #12151b;
  --panel: #161a22;
  --panel-2: #1b212b;
  --ink: #edf1f7;
  --muted: #8b97a8;
  --line: #262d39;
  --line-2: #323b4a;
  --accent: #7dd3c0;
  --accent-2: #5b8def;
  --accent-soft: rgba(125, 211, 192, 0.12);
  --warn: #e0a45c;
  --warn-soft: rgba(224, 164, 92, 0.12);
  --danger: #ef7b84;
  --danger-soft: rgba(239, 123, 132, 0.12);
  --font: "Figtree", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(900px 480px at 15% -10%, rgba(91, 141, 239, 0.16), transparent 55%),
    radial-gradient(800px 420px at 90% 0%, rgba(125, 211, 192, 0.1), transparent 50%),
    var(--bg);
}

button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.app { min-height: 100vh; }

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 14, 18, 0.82);
  backdrop-filter: blur(14px);
}

.topnav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent) 0%, transparent 55%),
    linear-gradient(315deg, var(--accent-2) 0%, #1a2230 70%);
  border: 1px solid rgba(237, 241, 247, 0.12);
}

.logo-text {
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.05rem;
}

.tabs-nav {
  display: inline-flex;
  justify-self: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(22, 26, 34, 0.9);
}

.tabs-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
}

.tabs-nav-item:hover { color: var(--ink); }
.tabs-nav-item.active {
  color: var(--bg);
  background: var(--ink);
  font-weight: 650;
}

.tabs-nav-item .count {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(12, 14, 18, 0.12);
}

.tabs-nav-item.active .count {
  background: rgba(12, 14, 18, 0.14);
}

.topnav-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667085;
}

.status.ok .status-dot { background: var(--accent); }
.status.bad .status-dot { background: var(--danger); }
.status.ok { color: var(--accent); }
.status.bad { color: var(--danger); }

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.35rem 1.25rem 2.2rem;
}

.page-head {
  margin-bottom: 1.1rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.4vw, 2.2rem);
  letter-spacing: -0.05em;
  font-weight: 700;
}

.view { animation: enter 220ms ease; }

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.btn {
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.48rem 0.9rem;
  cursor: pointer;
  font-weight: 550;
  font-size: 0.88rem;
}

.btn:hover {
  border-color: rgba(125, 211, 192, 0.45);
  background: var(--panel-2);
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.ghost {
  background: transparent;
}

.muted { color: var(--muted); margin: 0; }
.tiny { font-size: 0.78rem; }
.mono { font-family: var(--mono); font-size: 0.8rem; }

/* Bento dashboard */
.bento {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 0.85rem;
}

.bento .span-2 { grid-column: 1 / -1; }

.tile {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 40%), var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}

.tile-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0;
}

.tile-h h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.tile-h span {
  color: var(--muted);
  font-size: 0.78rem;
}

.tile-b { padding: 0.85rem 1rem 1rem; }

.metric-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.metric {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.metric:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 192, 0.4);
}

.metric .k {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.metric .v {
  margin-top: 0.35rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.metric .h {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.metric.accent .v { color: var(--accent); }
.metric.warn .v { color: var(--warn); }
.metric.danger .v { color: var(--danger); }
.metric.info .v { color: var(--accent-2); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.bar-list { display: grid; gap: 0.6rem; }

.bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 34px;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.84rem;
}

.bar-row .key {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  border-radius: 99px;
  background: #222833;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), rgba(125, 211, 192, 0.35));
  transition: width 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar-fill.alt {
  background: linear-gradient(90deg, var(--accent-2), rgba(91, 141, 239, 0.35));
}

.activity {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0.28rem;
  align-items: end;
  min-height: 128px;
}

.activity-col {
  display: grid;
  gap: 0.28rem;
  justify-items: center;
  align-items: end;
}

.activity-col .stem {
  width: 100%;
  max-width: 14px;
  min-height: 4px;
  border-radius: 8px 8px 4px 4px;
  background: rgba(91, 141, 239, 0.85);
}

.activity-col .day {
  font-size: 0.62rem;
  color: var(--muted);
}

/* Logs toolbar */
.toolbar {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(110px, 0.7fr));
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.toolbar.toolbar-wide {
  grid-template-columns: 1.5fr repeat(6, minmax(100px, 0.75fr));
}

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.action-bar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.check-col {
  width: 42px;
}

.check-col input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.toolbar input,
.toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 0.58rem 0.85rem;
  outline: none;
}

.toolbar input:focus,
.toolbar select:focus {
  border-color: rgba(125, 211, 192, 0.5);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 250px);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

table.data th,
table.data td {
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

table.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1a202a;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}

table.data th .sort { color: var(--accent); }
table.data tbody tr { cursor: pointer; transition: background 120ms ease; }
table.data tbody tr:hover { background: rgba(125, 211, 192, 0.05); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}

.tag.cis {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: rgba(224, 164, 92, 0.28);
}

.tag.ok {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(125, 211, 192, 0.28);
}

.chip {
  display: inline-block;
  min-width: 1.7rem;
  text-align: center;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--muted);
}

.chip.on {
  color: var(--accent);
  border-color: rgba(125, 211, 192, 0.3);
  background: var(--accent-soft);
  font-weight: 650;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  background: rgba(12, 14, 18, 0.35);
}

/* Detail: top summary band + content */
.detail-band {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1rem 1.05rem;
}

.summary-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.summary-id {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  word-break: break-all;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
}

.summary-item .l {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-item .r {
  margin-top: 0.15rem;
  font-size: 0.9rem;
  word-break: break-word;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.score {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
  padding: 0.75rem 0.7rem;
  text-align: center;
}

.score .n {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.score .t {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.segment {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  width: fit-content;
  max-width: 100%;
}

.seg {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  cursor: pointer;
  font-size: 0.84rem;
}

.seg.active {
  background: var(--ink);
  color: var(--bg);
  font-weight: 650;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
}

.meta-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 0.75rem 0.8rem;
}

.meta-card .label {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.meta-card .value {
  font-family: var(--mono);
  font-size: 0.8rem;
  word-break: break-word;
}

.cookies-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.cookies-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.cookies-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  padding: 0.65rem 0.75rem;
}

.cookies-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cookies-stat b {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.cookies-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 420px;
}

.cookies-domains {
  border-right: 1px solid var(--line);
  background: rgba(12, 14, 18, 0.35);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cookies-domains-h {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cookies-domains-list {
  overflow: auto;
  max-height: calc(100vh - 420px);
  min-height: 280px;
  padding: 0.35rem;
  display: grid;
  gap: 0.25rem;
  align-content: start;
}

.domain-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
}

.domain-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.domain-item b {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.domain-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.domain-item.active {
  background: var(--accent-soft);
  border-color: rgba(125, 211, 192, 0.28);
}

.domain-item.active b {
  color: var(--accent);
}

.cookies-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cookies-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.cookies-toolbar input {
  flex: 1 1 auto;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  outline: none;
}

.cookies-toolbar input:focus {
  border-color: rgba(125, 211, 192, 0.5);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cookies-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 420px);
  min-height: 280px;
}

.cookies-table td,
.cookies-table th {
  white-space: nowrap;
}

.cookies-table .value-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flag {
  display: inline-flex;
  align-items: center;
  margin-right: 0.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 0.68rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.flag.ok {
  color: var(--accent);
  border-color: rgba(125, 211, 192, 0.3);
  background: var(--accent-soft);
}

.flag.warn {
  color: var(--warn);
  border-color: rgba(224, 164, 92, 0.3);
  background: var(--warn-soft);
}

@media (max-width: 980px) {
  .cookies-layout {
    grid-template-columns: 1fr;
  }
  .cookies-domains {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .cookies-domains-list,
  .cookies-table-wrap {
    max-height: 260px;
    min-height: 180px;
  }
  .cookies-stats {
    grid-template-columns: 1fr 1fr;
  }
}

.human-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.human-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.human-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  padding: 0.65rem 0.75rem;
}

.human-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.human-stat b {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.human-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.human-toolbar input {
  flex: 1 1 auto;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  outline: none;
}

.human-toolbar input:focus {
  border-color: rgba(125, 211, 192, 0.5);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.human-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 420px);
  min-height: 240px;
}

.human-table-wrap.short {
  max-height: 320px;
  min-height: 160px;
}

.human-table td,
.human-table th {
  white-space: nowrap;
}

.stack-cell {
  display: grid;
  gap: 0.15rem;
  min-width: 180px;
  white-space: normal;
}

.human-link {
  color: var(--accent-2);
  text-decoration: none;
}

.human-link:hover {
  text-decoration: underline;
}

.human-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
}

.human-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elev);
  overflow: hidden;
  min-width: 0;
}

.human-block-h {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.info-pairs {
  display: grid;
}

.info-pair {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
}

.info-pair:last-child {
  border-bottom: 0;
}

.info-pair .l {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.info-pair .r {
  word-break: break-word;
}

.info-pair .wrap {
  white-space: normal;
  word-break: break-word;
}

.empty-human {
  padding: 1rem 0.4rem;
  color: var(--muted);
}

.empty-human strong {
  display: block;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.empty-human p {
  margin: 0;
  font-size: 0.86rem;
}

@media (max-width: 980px) {
  .human-stats {
    grid-template-columns: 1fr 1fr;
  }
  .human-split {
    grid-template-columns: 1fr;
  }
  .info-pair {
    grid-template-columns: 1fr;
  }
}

.content-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
}

.content-panel .ph {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  font-size: 0.88rem;
}

.content-panel .ph b { color: var(--accent); font-weight: 650; }

.json-view {
  padding: 0.9rem;
  overflow: auto;
  max-height: calc(100vh - 360px);
}

.table-inner {
  overflow: auto;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

table.data-table th,
table.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
  max-width: 240px;
  word-break: break-word;
  white-space: normal;
}

table.data-table th {
  position: sticky;
  top: 0;
  background: #1a202a;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tree {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.tree ul {
  list-style: none;
  margin: 0.1rem 0 0.1rem 0.7rem;
  padding-left: 0.55rem;
  border-left: 1px solid var(--line);
}

.tree-item summary { cursor: pointer; color: var(--muted); }
.tree-item summary .key,
.tree-leaf .key { color: #9ec1ff; }
.tree-leaf { padding: 0.08rem 0; }
.tree-leaf .value { color: #f0b48a; }
.tree-leaf .value.null { color: var(--muted); }
.tree-leaf .value.bool { color: var(--accent); }
.tree-leaf .value.number { color: #b7e08a; }

.pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #c9d3df;
}

.empty, .error {
  padding: 1rem 1.1rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
}

.error {
  color: var(--danger);
  border-color: rgba(239, 123, 132, 0.35);
  background: var(--danger-soft);
}

.tag.live {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(125, 211, 192, 0.35);
}

.presence-band {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(125, 211, 192, 0.08), transparent 42%),
    var(--panel);
}

.presence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.presence-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.presence-card:hover {
  border-color: rgba(125, 211, 192, 0.45);
  transform: translateY(-1px);
}

.presence-card.live {
  border-color: rgba(125, 211, 192, 0.4);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 192, 0.08);
}

.presence-card .k {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.presence-card .v {
  margin-top: 0.25rem;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.presence-card .h {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.games-kpi {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.games-subnav {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 0.9rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(22, 26, 34, 0.9);
}

.games-stack .human-panel {
  margin-top: 0;
}

.token-cell {
  max-width: 220px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1.1rem 1.15rem 1.15rem;
  display: grid;
  gap: 0.9rem;
}

.settings-card-h {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.settings-card-h h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.settings-card-h p {
  margin: 0;
  font-size: 0.88rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field > span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  padding: 0.7rem 0.8rem;
  outline: none;
}

.field input:focus {
  border-color: rgba(125, 211, 192, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.switch input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.settings-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.settings-footer {
  margin-top: 1rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.settings-status {
  margin-top: 0.35rem;
  min-height: 1.2em;
  font-size: 0.88rem;
  color: var(--muted);
}

.settings-status.ok { color: var(--accent); }
.settings-status.bad { color: var(--danger); }

@media (max-width: 980px) {
  .topnav-inner {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .tabs-nav { justify-self: start; }
  .bento,
  .split,
  .detail-band,
  .metric-stack,
  .toolbar,
  .settings-layout,
  .presence-grid,
  .games-kpi {
    grid-template-columns: 1fr;
  }
}
