/* The admin panel (admin.html, admin.js): site.css's colours and type, laid out as a dashboard.
   Until it's shown (an admin's tab), the page is the site's own not-found page, styled by pages.css. */
body.admin-on::after { display: none; }
body.admin-on { background: #0b0a09; }

/* ---- The bar along the top: the name, the sections, the range and the rest */
.ad-top {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 24px;
  padding: 12px var(--gutter); background: rgba(11, 10, 9, .82);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.ad-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; font-size: 15px; }
.ad-brand img { border-radius: 7px; }
.ad-env { padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: rgba(95, 211, 141, .12); color: var(--good); }
.ad-env.staging { background: rgba(243, 178, 94, .14); color: var(--amber); }

.ad-tabs { display: flex; gap: 2px; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.ad-tabs::-webkit-scrollbar { display: none; }
.ad-tabs button {
  position: relative; flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink-3); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: color .2s, background .2s;
}
.ad-tabs button:hover { color: var(--ink); background: rgba(244, 237, 226, .04); }
.ad-tabs button[aria-selected="true"] { color: var(--ink); background: rgba(244, 237, 226, .07); }

.ad-tools { display: flex; align-items: center; gap: 6px; }
.ad-range { display: flex; padding: 3px; border-radius: 10px; background: rgba(244, 237, 226, .04); box-shadow: inset 0 0 0 1px var(--line); }
.ad-range button {
  height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent;
  color: var(--ink-3); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: color .2s, background .2s;
}
.ad-range button:hover { color: var(--ink); }
.ad-range button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.ad-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-3); cursor: pointer; }
.ad-icon:hover { color: var(--ink); background: rgba(244, 237, 226, .06); }
.ad-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ad-link { padding: 0 8px; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.ad-link:hover { color: var(--ink); }

/* ---- The page */
.ad-main { max-width: 1280px; margin: 0 auto; padding: 26px var(--gutter) 64px; }
.ad-error { min-height: 1.5em; margin: 0 0 14px; color: var(--warn); font-size: 14px; }
.ad-error:empty { display: none; }

.ad-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.ad-card, .ad-box {
  position: relative; min-width: 0; border-radius: 18px;
  background: linear-gradient(180deg, rgba(244, 237, 226, .035), rgba(244, 237, 226, .015)), #12100e;
  box-shadow: inset 0 0 0 1px rgba(244, 237, 226, .07), 0 1px 0 rgba(0, 0, 0, .4);
}
.ad-card { display: flex; flex-direction: column; padding: 16px 18px 14px; overflow: hidden; }
.ad-card .k { color: var(--ink-3); font-size: 13px; font-weight: 500; }
.ad-card .v { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 28px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ad-card .s { margin-top: 5px; color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }
.ad-spark { display: block; width: 100%; height: 30px; margin-top: auto; padding-top: 10px; box-sizing: content-box; }
.ad-spark polyline { fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .85; }

.ad-delta { padding: 2px 7px; border-radius: 99px; font-size: 12px; font-weight: 600; letter-spacing: 0; background: rgba(244, 237, 226, .08); color: var(--ink-2); }
.ad-delta.good { background: rgba(95, 211, 141, .13); color: var(--good); }
.ad-delta.bad { background: rgba(255, 69, 58, .13); color: #ff7a72; }

.ad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ad-box { padding: 18px 20px 16px; }
.ad-wide { grid-column: 1 / -1; }
.ad-box h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.ad-sub { margin-top: 3px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.ad-box > h2 + :not(.ad-sub), .ad-box > .ad-sub + * { margin-top: 14px; }
.ad-empty { color: var(--ink-3); font-size: 14px; padding: 4px 0; }
.ad-note { margin-top: 10px; color: var(--ink-3); font-size: 13px; line-height: 1.55; }
.ad-note a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 3px; }
.ad-warn { color: var(--warn); }
.ad-ok { color: var(--good); }
.ad-muted { color: var(--ink-3); }

.ad-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ad-table th { color: var(--ink-3); font-weight: 500; font-size: 12px; text-align: left; padding: 0 12px 8px 0; white-space: nowrap; }
.ad-table td { padding: 9px 12px 9px 0; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.ad-table tr:hover td { background: rgba(244, 237, 226, .02); }
.ad-table .num { text-align: right; padding-right: 0; white-space: nowrap; }
.ad-table th.num + th.num, .ad-table td.num + td.num { padding-left: 14px; }
.ad-table code, .ad-box code { font: 500 12.5px/1.4 ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink-2); }

.ad-chart svg { display: block; width: 100%; height: 140px; }
.ad-chart .bar { fill: var(--amber); }
.ad-chart .bar2 { fill: rgba(244, 237, 226, .7); }
.ad-chart .grid { stroke: rgba(244, 237, 226, .06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ad-chart g:hover .bar { fill: #f7c27e; }
.ad-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--ink-3); font-size: 12px; }
.ad-legend { display: flex; gap: 16px; margin-top: 4px; color: var(--ink-3); font-size: 12px; }
.ad-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 3px; background: var(--amber); vertical-align: -1px; }
.ad-legend i.two { background: rgba(244, 237, 226, .7); }
.ad-most { margin-left: auto; }

.ad-shares { display: grid; gap: 10px; }
.ad-share { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 12px; font-size: 14px; }
.ad-share .name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-share .track { height: 7px; border-radius: 99px; background: rgba(244, 237, 226, .06); overflow: hidden; }
.ad-share .track i { display: block; height: 100%; border-radius: inherit; background: var(--amber); min-width: 2px; }
.ad-share .num { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.ad-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.ad-pair > div { padding: 12px 14px; border-radius: 12px; background: rgba(244, 237, 226, .03); box-shadow: inset 0 0 0 1px var(--line); }
.ad-pair .k { color: var(--ink-3); font-size: 12.5px; }
.ad-pair .v { margin-top: 4px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.ad-foot { margin-top: 20px; color: var(--ink-4); font-size: 12px; }

@media (max-width: 980px) {
  .ad-top { grid-template-columns: 1fr auto; }
  .ad-tabs { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .ad-grid { grid-template-columns: 1fr; }
  .ad-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-card .v { font-size: 23px; }
  .ad-tools .ad-link[href] { display: none; }
}
