.badge { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; margin-left: 4px; }
.tabs { display: flex; gap: 2px; margin: 0 auto; background: var(--soft); border-radius: 9px; padding: 3px; }
.tabs button { border: 0; background: none; border-radius: 7px; padding: 6px 14px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
body[data-admin="login"] .tabs, body[data-admin="loading"] .tabs { visibility: hidden; }

.admin { padding-bottom: 60px; }
.pane { display: none; }
body[data-admin="ready"] .pane.on { display: block; }
.login { display: none; max-width: 360px; margin: 12vh auto 0; gap: 14px; }
body[data-admin="login"] .login { display: grid; }
.login h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.015em; }
.login label, .settings label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login input, .input, .settings textarea { height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; outline: 0; color: var(--text); }
.login input:focus, .input:focus, .settings textarea:focus { border-color: var(--muted); }

h2 { font-size: 15px; font-weight: 600; margin: 28px 0 10px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.card.scroll { overflow-x: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tile b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }

.meter { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--soft); gap: 2px; }
.meter i { display: block; height: 100%; min-width: 2px; }
.meter .m-cache { background: var(--accent); }
.meter .m-other { background: var(--muted); opacity: .55; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 16px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.t { max-width: 360px; }
td.t b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.t small { color: var(--muted); }
td a { color: inherit; }
.pill { font-size: 11.5px; font-weight: 600; border-radius: 5px; padding: 2px 7px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.output { color: var(--accent-text); }
.del { border: 0; background: none; color: var(--muted); cursor: pointer; width: 30px; height: 30px; border-radius: 7px; }
.del:hover { color: var(--bad); background: var(--soft); }
.soon { color: var(--accent-text); }

.bar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.bar-row .seg { flex: none; }
.bar-row .input { width: 240px; height: 36px; }
.grow { flex: 1; }
.btn-soft.danger:hover { color: var(--bad); border-color: var(--bad); }

/* column chart: one series, so one hue and no legend */
.chart { display: flex; align-items: flex-end; gap: 2px; height: 180px; border-bottom: 1px solid var(--line); position: relative; }
.chart .col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.chart .col i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.chart .col:hover i { filter: brightness(1.12); }
.chart .col.zero i { background: var(--line); }
.axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.chart .max { position: absolute; top: -2px; left: 0; font-size: 11.5px; color: var(--muted); }
.empty { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.cols .card { margin: 0; }
.cols + .card { margin-top: 16px; }
.hbars { display: grid; gap: 8px; }
.hb { display: grid; grid-template-columns: 80px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.hb span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb .tr2 { height: 10px; background: var(--soft); border-radius: 0 4px 4px 0; }
.hb .tr2 i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.hb .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 20px; max-width: 900px; }
.settings h3 { grid-column: 1 / -1; margin: 8px 0 0; }
.settings .block, .settings .hint, .settings .switch, .settings .save { grid-column: 1 / -1; }
.settings .sel select { height: 38px; font-size: 14px; }
.settings .sel::after { top: 13px; }
.settings textarea { height: auto; padding: 10px 12px; font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, monospace; resize: vertical; }
.switch { display: flex !important; align-items: center; gap: 10px; color: var(--text) !important; font-size: 14px !important; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.save { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }

.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12.5px; padding: 6px 9px; border-radius: 7px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.tip b { font-weight: 600; }

@media (max-width: 880px) {
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; }
  .tabs button { flex: 1; }
  .bar-row .input { width: 100%; }
}
