:root {
  color-scheme: light;
  --bg: #f5f6fa; --card: #fff; --border: #e6e8ef; --text: #202334; --muted: #73788b;
  --accent: #6351bd; --purple: #6351bd; --green: #21886b; --red: #ba4242; --orange: #a56a19;
  --tabs-dur: 250ms; --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tabs-text-muted: #73788b; --tabs-text-active: #4f3eaa; --tabs-bar-bg: #eaeaf2; --tabs-pill-bg: #ffffff;
  --acc-expand: 250ms; --acc-collapse: 250ms; --acc-chevron: 250ms;
  --acc-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--text); background: var(--bg); display: flex; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .45; cursor: not-allowed; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
#sidebar { width: 316px; flex-shrink: 0; background: #fcfcfe; border-right: 1px solid var(--border); padding: 24px 19px; height: 100vh; overflow-y: auto; position: sticky; top: 0; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #ece8fa; color: var(--purple); font-size: 20px; font-weight: 800; }
h2 { font-size: 16px; margin: 0 0 4px; letter-spacing: -.2px; }
.eyebrow { font-size: 10px; letter-spacing: 1px; font-weight: 650; color: var(--muted); }
.muted, #sidebar-updated { color: var(--muted); font-size: 11px; line-height: 1.7; }
#sidebar-updated { margin: 10px 0 14px; }
.search-field { display: flex; align-items: center; gap: 7px; background: white; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--muted); }
.search-field input { min-width: 0; width: 100%; background: transparent; border: 0; outline: none; font-size: 12px; color: var(--text); }
.search-field:focus-within { outline: 2px solid #c9c0ef; outline-offset: 1px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 5px; }
.filter-row label { font-size: 10px; color: var(--muted); min-width: 0; }
.filter-row input, .filter-row select { width: 100%; min-width: 0; margin-top: 4px; }
input[type='month'], select { border: 1px solid var(--border); border-radius: 6px; background: white; color: var(--text); padding: 6px; font-size: 11px; height: 32px; }
.text-button { background: none; color: var(--accent); border: 0; padding: 4px 0; font-size: 11px; }
#result-count { float: right; padding-top: 4px; }
.artist { margin: 0 0 12px; }
.artist-title { border: 0; background: none; padding: 7px 0; display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: 12px; font-weight: 700; color: var(--text); text-align: left; }
.t-acc-chevron svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.single { font-size: 11px; font-weight: 650; line-height: 1.7; margin: 12px 0 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.date { font-size: 11px; margin: 10px 0 5px; color: var(--muted); }
.date.today { color: var(--accent); font-weight: 700; }
.variant { font-size: 10px; color: var(--muted); margin: 6px 0 4px; }
.tz-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tz { padding: 5px 8px; border-radius: 5px; background: transparent; border: 1px solid var(--border); color: #9498a6; font-size: 11px; }
.tz.has-data { border-color: #d4cdea; color: var(--accent); background: #f3f0fc; }
.tz.selected { background: var(--accent); color: white; border-color: var(--accent); }
.tz.live { border-color: var(--green); }
.tz .tiny { margin-left: 3px; font-size: 9px; opacity: .75; }
.live-title { font-size: 11px; font-weight: 650; color: var(--green); margin: 8px 0; }
#storage-panel { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 14px; }
#storage-panel summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.storage-stat { display: flex; justify-content: space-between; margin: 5px 0; font-variant-numeric: tabular-nums; }
#main { flex: 1; min-width: 0; padding: 28px 36px; max-width: 1700px; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 26px; }
.actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.button { border: 1px solid var(--border); border-radius: 7px; padding: 7px 11px; color: var(--text); font-size: 11px; background: var(--card); }
.button:hover { border-color: #c8c1df; }
.heading-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h1 { font-size: clamp(19px, 2.1vw, 27px); letter-spacing: -.6px; margin: 0; font-weight: 730; line-height: 1.45; }
#meta { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 8px; max-width: 1050px; }
.badge { display: inline-flex; align-items: center; white-space: nowrap; font-size: 10px; border-radius: 5px; color: var(--accent); background: #ede9fa; padding: 4px 7px; font-weight: 600; }
.badge.live { color: var(--green); background: #e5f4ee; }
.badge.archive { background: #eef0f5; color: #646d88; }
#health { color: var(--muted); font-size: 11px; margin: 10px 0; }
#freshness { padding: 10px 13px; border-left: 3px solid #bab0e2; border-radius: 0 6px 6px 0; background: #f0edf8; color: #6a6189; font-size: 11px; line-height: 1.8; margin: 15px 0 22px; }
.warning { background: #fff5e2 !important; border-color: #dfb976 !important; color: #88601f !important; }
.error { background: #fff0ee !important; border-color: #d28b85 !important; color: var(--red) !important; }
#tabs { margin: 0 0 22px; }
.view-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 12px; margin-bottom: 16px; }
.view-toolbar .search-field { width: 230px; }
.inline-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 12px; margin-bottom: 20px; }
.stat { min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 17px 18px; }
.stat .label { font-size: 11px; color: var(--muted); line-height: 1.6; }
.stat .value { font-size: 26px; color: var(--purple); font-weight: 650; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -.8px; }
.report-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.report-times { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 11px; margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 10px; }
.member { background: white; border: 1px solid var(--border); border-radius: 9px; padding: 15px; text-align: left; color: var(--text); }
.member:hover { border-color: #bbb0df; }
.member .name { font-size: 14px; font-weight: 600; margin: 10px 0; }
.member .count { font-size: 26px; color: var(--purple); font-weight: 650; font-variant-numeric: tabular-nums; }
.member.busy { background: #fff9f3; }
.member .top { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.delta { font-size: 11px; color: var(--orange); margin-left: 8px; }
.panel { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 22px; margin-top: 18px; }
.panel h3 { font-size: 14px; margin: 0 0 14px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 15px; }
.panel-heading h3 { margin: 0; }
.panel .subheading { margin-top: 25px; }
.chart-wrap { height: 290px; position: relative; }
.chart-wrap.overview { height: 410px; }
.close { float: right; border: 0; background: none; font-size: 22px; color: var(--muted); }
.empty { padding: 55px 18px; text-align: center; color: var(--muted); border: 1px dashed #d8d8e5; border-radius: 12px; background: #fafafe; }
.empty h3 { font-size: 16px; color: var(--text); font-weight: 550; }
.empty p { font-size: 12px; line-height: 1.8; }
.empty-icon { font-size: 35px; color: #b3a8db; }
#gen-filter { font-size: 11px; margin-bottom: 12px; color: var(--muted); }
#gen-filter label { margin-right: 14px; display: inline-block; padding: 5px 0; }
input[type='checkbox'] { accent-color: var(--accent); }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; max-height: 65vh; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th,td { padding: 12px 13px; border-bottom: 1px solid #f0f0f5; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th:first-child,td:first-child { text-align: left; position: sticky; left: 0; background: white; }
th { font-weight: 550; color: var(--muted); position: sticky; top: 0; background: #fafafe; z-index: 1; font-size: 10px; }
th:first-child { background: #fafafe; z-index: 2; }
tbody tr:hover td { background: #faf9ff; }
.member-link { border: 0; background: transparent; color: var(--text); padding: 0; font: inherit; text-align: left; }
.member-link:hover { color: var(--accent); text-decoration: underline; }
.note { font-size: 11px; line-height: 1.9; color: var(--muted); margin: 14px 0; }
footer { font-size: 10px; letter-spacing: .3px; color: #9ca0af; margin: 28px 0 0; }
.mobile-only { display: none; }

/* The bar is just a flex container with padding for the pill
   to sit inside. Tabs sit on z-index: 1, the pill on z-index: 0,
   so labels read above the pill background. */
.t-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 48px;
  background: var(--tabs-bar-bg);
}
.t-tab {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  height: 30px;
  padding: 4px 12px;
  color: var(--tabs-text-muted);
  cursor: pointer;
  border-radius: 48px;
  z-index: 1;
  transition: color var(--tabs-dur) var(--tabs-ease);
}
.t-tab:not([aria-selected="true"]):hover,
.t-tab[aria-selected="true"] {
  color: var(--tabs-text-active);
}

/* The pill: width + transform are written inline by JS so
   the transition tweens between the previous and next
   measured positions. */
.t-tabs-pill {
  position: absolute;
  top: 3px;
  left: 0;
  height: 30px;
  width: 0;
  background: var(--tabs-pill-bg);
  border-radius: 48px;
  transform: translateX(0);
  transition:
    transform var(--tabs-dur) var(--tabs-ease),
    width     var(--tabs-dur) var(--tabs-ease);
  will-change: transform, width;
  z-index: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .t-tabs-pill, .t-tab { transition: none !important; }
}

/* grid-template-rows 0fr → 1fr gives a clean height animation
   with no JS measurement; the inner element clips overflow. */
.t-acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel {
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--acc-expand) var(--acc-ease);
}
.t-acc-panel-inner {
  overflow: hidden;
  opacity: 0;
  filter: blur(2px);
  transition:
    opacity var(--acc-collapse) var(--acc-ease),
    filter var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel-inner {
  opacity: 1;
  filter: blur(0);
  transition:
    opacity var(--acc-expand) var(--acc-ease),
    filter var(--acc-expand) var(--acc-ease);
}
/* Flip the chevron vertically to turn the "v" into a "^".
   scaleY(-1) about the centre passes through a flat line at
   the midpoint (same look as a `d:` path morph) but animates
   in every browser, unlike CSS `d:` morphing (Chromium only).
   The chevron path is symmetric about the 16x16 viewBox
   centre, so the flip lands exactly on the "^"; non-scaling
   -stroke keeps the stroke width constant through the flip. */
.t-acc-chevron {
  display: inline-flex;
  transform: scaleY(1);
  transform-origin: center;
  transition: transform var(--acc-chevron) var(--acc-ease);
}
.t-acc-chevron path { vector-effect: non-scaling-stroke; }
.t-acc[data-open="true"] .t-acc-chevron {
  transform: scaleY(-1);
}

@media (prefers-reduced-motion: reduce) {
  .t-acc-panel, .t-acc-panel-inner, .t-acc-chevron {
    transition: none !important;
  }
}

#tabs .t-tab { font-size: 12px; }
@media (max-width: 900px) {
  #sidebar { width: 280px; padding: 20px 14px; }
  #main { padding: 24px 22px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 24px; }
}
@media (max-width: 700px) {
  body { display: block; }
  #sidebar { position: static; width: 100%; height: auto; max-height: 65vh; border-right: 0; border-bottom: 1px solid var(--border); display: none; }
  #sidebar[data-open='true'] { display: block; }
  .brand { margin-bottom: 15px; }
  #main { padding: 20px 16px; }
  .topline { margin-bottom: 22px; }
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none; }
  h1 { font-size: 20px; }
  .heading-line { gap: 7px; }
  .stats-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .stat .value { font-size: 22px; }
  .view-toolbar { gap: 8px; }
  .view-toolbar .search-field { width: 100%; }
  #tabs { max-width: 100%; }
  #tabs .t-tab { padding-left: 10px; padding-right: 10px; font-size: 11px; }
  .panel { padding: 15px; }
  .chart-wrap, .chart-wrap.overview { height: 300px; }
  th,td { padding: 11px 10px; }
  .table-wrap { max-height: 58vh; }
}
