/* Analytics reports: Admin, Analytics; a label's Analytics; a DJ's page numbers. Dark only, like the store.
   Series colours are the validated data palette for a dark surface (blue, then orange), never the brand accent. */
.an { --s1: #3987e5; --s2: #d95926; --heat0: #1f1f1f; --heat1: #104281; --heat2: #184f95; --heat3: #256abf; --heat4: #3987e5; --heat5: #86b6ef; }

/* filters: one row above everything they change */
.an-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 16px; }
.an-ranges { display: flex; flex-wrap: wrap; gap: 4px; }
.an-ranges a { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--r-btn); background: var(--raised); color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.an-ranges a:hover { background: var(--sel); color: var(--text); }
.an-ranges a.is-on { background: #fff; color: #0b0b0b; }
.an-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.an-custom input[type=date] { height: 32px; padding: 0 10px; border: 0; border-radius: var(--r); background: var(--raised); color: var(--text); font-size: 12.5px; color-scheme: dark; }
.an-to { color: var(--text-3); font-size: 12.5px; }
.an-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; color: var(--text-2); font-size: 13px; }

/* live now */
.an-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 16px; padding: 14px 18px; border-radius: var(--r); background: var(--frame); box-shadow: 0 0 0 1px var(--line); font-size: 13px; color: var(--text-2); }
.an-live b { color: var(--text); font-size: 15px; font-weight: 500; }
.an-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #0ca30c; box-shadow: 0 0 0 4px rgba(12, 163, 12, .18); flex: none; }
.an-live-list { display: flex; flex-wrap: wrap; gap: 6px; }
.an-live-list span { padding: 2px 8px; border-radius: 3px; background: var(--raised); color: var(--text-2); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* stat tiles */
.an-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; margin: 0 0 16px; }
.an-tile { display: grid; gap: 6px; align-content: start; padding: 16px 18px; border-radius: var(--r); background: var(--frame); box-shadow: 0 0 0 1px var(--line); min-width: 0; }
.an-tile-l { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; }
.an-q { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--raised); color: var(--text-3); font: 600 9.5px/1 var(--sans); font-style: normal; }
.an-tile-v { font: 400 28px/1.1 var(--sans); color: var(--text); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-tile-c { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 12px; }
.an-tile-c.is-good { color: #5fd07f; }
.an-tile-c.is-bad { color: var(--danger); }
.an-tile-c .muted { margin-left: 2px; }
.an-tile-c svg.i { width: 13px; height: 13px; }

/* cards */
.an-card { min-width: 0; padding: 18px 18px 14px; border-radius: var(--r); background: var(--frame); box-shadow: 0 0 0 1px var(--line); }
.an-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.an-card h2 { font-size: 16px; font-weight: 500; letter-spacing: 0; }
.an-card-sub { margin: 4px 0 0; color: var(--text-3); font-size: 12.5px; }
.an-empty { margin: 14px 0 6px; color: var(--text-3); font-size: 13px; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; margin: 12px 0 0; }
.an-wide { grid-column: 1 / -1; }

/* rows with a wash behind them, as long as the views */
.an-rows { display: grid; gap: 3px; margin-top: 12px; }
.an-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 70px 70px; align-items: center; gap: 10px; min-height: 32px; padding: 5px 8px; isolation: isolate; font-size: 13px; }
.an-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0); z-index: -1; border-radius: 0 4px 4px 0; background: rgba(57, 135, 229, .16); }
.an-row-head { min-height: 20px; padding-top: 0; padding-bottom: 2px; color: var(--text-3); font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.an-row-head::before { display: none; }
.an-row .num { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.an-row-head .num { color: var(--text-3); }
.an-row-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.an-row-l a { color: var(--text); }
.an-row-l a:hover { text-decoration: underline; text-underline-offset: 3px; }
.an-row-l small { margin-left: 8px; color: var(--text-3); font-size: 11.5px; }

/* the chart */
.an-chart-card { margin-bottom: 0; }
.an-legend { display: flex; gap: 16px; color: var(--text-2); font-size: 12.5px; }
.an-legend span { display: inline-flex; align-items: center; gap: 7px; }
.an-key { width: 16px; height: 2px; border-radius: 2px; }
.an-key.s1 { background: var(--s1); }
.an-key.s2 { background: var(--s2); }
.an-chart { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: 240px 26px; margin-top: 16px; }
.an-yaxis { position: relative; grid-row: 1; }
.an-yaxis span { position: absolute; right: 10px; transform: translateY(-50%); color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.an-plot { position: relative; grid-row: 1; grid-column: 2; min-width: 0; cursor: crosshair; }
.an-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.an-plot .an-gl { stroke: #2a2a2a; stroke-width: 1; vector-effect: non-scaling-stroke; }
.an-area { fill: rgba(57, 135, 229, .10); }
.an-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.an-line.s1 { stroke: var(--s1); }
.an-line.s2 { stroke: var(--s2); }
.an-xaxis { position: relative; grid-row: 2; grid-column: 2; }
.an-xaxis span { position: absolute; top: 8px; transform: translateX(-50%); color: var(--text-3); font-size: 11px; white-space: nowrap; }
.an-xaxis span:first-child { transform: none; }
.an-xaxis span:last-child { transform: translateX(-100%); }
.an-hair { position: absolute; top: 0; bottom: 0; width: 1px; background: #5a5a5a; pointer-events: none; }
.an-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--frame); pointer-events: none; }
.an-dot.s1 { background: var(--s1); }
.an-dot.s2 { background: var(--s2); }
.an-tip { position: absolute; top: 6px; z-index: 5; min-width: 150px; padding: 10px 12px; border-radius: var(--r); background: #f5f5f5; color: #0b0b0b; box-shadow: var(--shadow); font-size: 12.5px; pointer-events: none; }
.an-tip b { display: block; margin-bottom: 6px; font-weight: 500; }
.an-tip div { display: flex; align-items: center; gap: 8px; }
.an-tip div + div { margin-top: 3px; }
.an-tip strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.an-tip i { width: 12px; height: 2px; border-radius: 2px; }
.an-table { margin-top: 10px; font-size: 13px; }
.an-table summary { color: var(--text-3); cursor: pointer; font-size: 12.5px; }
.an-table summary:hover { color: var(--text); }
.an-table table { width: 100%; margin-top: 10px; border-collapse: collapse; }
.an-table th, .an-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.an-table th { color: var(--text-3); font-weight: 500; font-size: 12px; }
.an-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.an-table tbody { display: table-row-group; }

/* busiest times */
.an-heat { display: grid; gap: 3px; margin-top: 14px; overflow-x: auto; }
.an-heat-row { display: grid; grid-template-columns: 40px repeat(24, minmax(14px, 1fr)); gap: 3px; min-width: 520px; }
.an-heat-row > span:first-child { color: var(--text-3); font-size: 11.5px; align-self: center; }
.an-heat-hours span { color: var(--text-3); font-size: 10.5px; white-space: nowrap; }
.an-cell { display: block; height: 22px; border-radius: 3px; background: var(--heat0); }
.an-cell.l1 { background: var(--heat1); }
.an-cell.l2 { background: var(--heat2); }
.an-cell.l3 { background: var(--heat3); }
.an-cell.l4 { background: var(--heat4); }
.an-cell.l5 { background: var(--heat5); }
.an-heat .an-cell:hover { outline: 2px solid #f5f5f5; outline-offset: -1px; }
.an-heat-key { display: flex; align-items: center; gap: 4px; margin-top: 10px; color: var(--text-3); font-size: 11.5px; }
.an-heat-key i { display: block; width: 18px; height: 12px; border-radius: 2px; }
.an-heat-key span:first-child { margin-right: 4px; }
.an-heat-key span:last-child { margin-left: 4px; }
.an-float { position: fixed; z-index: 120; padding: 6px 10px; border-radius: var(--r); background: #f5f5f5; color: #0b0b0b; font-size: 12.5px; font-weight: 500; pointer-events: none; box-shadow: var(--shadow); }

/* visits (admin) */
.an-visits .ip { font-variant-numeric: tabular-nums; }
.a-table.an-visits .clip { max-width: 220px; }
.an-card .a-table-wrap { margin: 10px -18px -14px; }
.an-path { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.an-path li { display: grid; grid-template-columns: 70px minmax(0, 1fr) 70px; gap: 10px; align-items: baseline; font-size: 13px; }
.an-path time, .an-path .num { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.an-path .num { text-align: right; }
.an-note { color: var(--text-3); font-size: 12px; }
.an-note a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 700px) {
  .an-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .an-tile { padding: 14px; }
  .an-tile-c { flex-wrap: wrap; }
  .an-live { flex-wrap: nowrap; align-items: flex-start; }
  .an-live-dot { margin-top: 5px; }
  .an-tile-v { font-size: 24px; }
  .an-xaxis span.is-odd { display: none; }
  .an-chart { grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: 200px 26px; }
  .an-row { grid-template-columns: minmax(0, 1fr) 56px 56px; gap: 6px; }
  .an-filters { align-items: stretch; }
  .an-custom { width: 100%; }
  .an-custom label { flex: 1 1 120px; }
  .an-custom input[type=date] { width: 100%; }
}
