:root { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #252b30; background: #fff; font-size: 13px; line-height: 1.5; letter-spacing: 0; --line: #e2e7ea; --muted: #7b858d; --blue: #2475bc; --green: #2e8a69; --red: #c46355; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { display: inline-flex; align-items: center; justify-content: center; }
button:disabled { cursor: default; opacity: .35; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.app-header { min-height: 60px; display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 15px 28px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #242c32; font-size: 14px; }
.brand > span { color: var(--muted); font-weight: 400; }
.snapshot { color: var(--muted); font-size: 11px; }
#site-switcher { flex: 0 0 auto; }
.control-band { background: #f8fafb; border-bottom: 1px solid var(--line); }
.controls { max-width: 1480px; margin: auto; padding: 17px 28px; display: flex; align-items: end; gap: 26px; }
label > span { display: block; color: #7a848b; font-size: 9px; font-weight: 600; margin-bottom: 7px; }
select { height: 34px; background: #fff; border: 1px solid #d7dee3; border-radius: 4px; padding: 0 28px 0 10px; max-width: 100%; font-size: 12px; }
.chart-control { width: 305px; max-width: 32%; }
.chart-control select { width: 100%; }
.date-controls { display: flex; gap: 8px; }
#year { width: 90px; } #month { width: 119px; } #day { width: 70px; }
.search-control { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 180px; width: 280px; border-bottom: 1px solid #cbd5dc; padding: 0 0 7px; height: 34px; }
.search-control img { opacity: .45; }
.search-control input { background: transparent; border: 0; min-width: 0; width: 100%; font-size: 12px; padding: 0; outline-offset: 5px; }
main { max-width: 1480px; margin: auto; padding: 25px 28px 45px; min-height: calc(100vh - 200px); }
.week-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 19px; }
.week-heading > div { min-width: 0; }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 10px; font-weight: 500; }
.title-line { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
h1 { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
#source { font-size: 10px; display: inline-flex; align-items: center; gap: 2px; }
.week-meta { font-size: 11px; color: var(--muted); margin: 6px 0 0; }
.week-nav { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.week-nav button, .pagination button, #retry { width: 32px; height: 32px; background: #fff; border: 1px solid #d7dfe4; border-radius: 4px; padding: 0; }
.week-nav button:not(:disabled):hover, .pagination button:hover { background: #f1f5f7; }
.graph-section { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0 8px; }
.graph-heading { display: flex; justify-content: space-between; align-items: start; gap: 15px; min-height: 58px; }
.graph-heading > div:first-child { min-width: 0; }
h2 { font-size: 13px; font-weight: 600; line-height: 1.4; margin: 0 0 7px; overflow-wrap: anywhere; }
.legend { display: flex; flex-wrap: wrap; gap: 7px 16px; min-height: 21px; }
.legend-item { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; color: #697780; min-width: 0; }
.legend-item > span { max-width: 330px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.legend-line { display: inline-block; width: 15px; height: 2px; background: var(--blue); flex: 0 0 15px; }
.color-1 { background: var(--green); } .color-2 { background: var(--red); }
.legend-item button { border: 0; background: transparent; width: 17px; height: 17px; padding: 0; opacity: .4; }
.range-control { display: flex; flex: 0 0 auto; border: 1px solid #dce3e8; border-radius: 4px; }
.range-control button { font-size: 10px; padding: 6px 10px; white-space: nowrap; background: #fff; border: 0; border-right: 1px solid #dce3e8; }
.range-control button:last-child { border-right: 0; }
.range-control button[aria-pressed=true] { background: #edf3f8; color: #286ca7; }
.graph { position: relative; height: 240px; width: 100%; min-width: 0; }
.graph-empty { display: grid; place-content: center; height: 100%; color: var(--muted); font-size: 12px; }
.uplot { font-family: inherit; }
.graph-footer { display: flex; justify-content: space-between; gap: 12px; min-height: 27px; font-size: 10px; color: var(--muted); padding: 6px 0; }
#cursor-value { font-variant-numeric: tabular-nums; }
.table-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 15px; }
.tabs { display: flex; gap: 23px; }
.tabs button { height: 45px; padding: 0; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 12px; color: var(--muted); gap: 9px; }
.tabs button[aria-pressed=true] { border-bottom-color: var(--blue); color: #293c4c; }
.tabs span { font-size: 10px; color: #83929e; font-variant-numeric: tabular-nums; }
.result-count { color: var(--muted); font-size: 10px; }
.table-scroll { overflow: auto; width: 100%; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
th { font-weight: 500; font-size: 9px; color: #7d8a94; white-space: nowrap; background: #f8fafb; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
th, td { padding: 10px 12px; vertical-align: middle; }
td { border-bottom: 1px solid #ecf0f3; overflow-wrap: anywhere; }
tbody tr:hover { background: #f7fafc; }
tbody tr.selected { background: #f4f8fc; }
td.numeric, th.numeric { text-align: right; font-variant-numeric: tabular-nums; }
td.rank { color: #8b969d; font-size: 11px; min-width: 42px; }
.peak-rank { color: #2e6b9e; font-weight: 600; }
.record-title { border: 0; padding: 0; display: block; background: transparent; text-align: left; color: #263c4f; font-weight: 500; font-size: 12px; line-height: 1.5; }
.record-title:hover { color: var(--blue); text-decoration: underline; }
.artist { display: block; color: #7a858d; font-size: 10px; margin-top: 2px; line-height: 1.5; }
.title-cell { min-width: 220px; max-width: 390px; }
.label-cell { font-size: 11px; color: #7c858b; min-width: 110px; max-width: 190px; }
.selection-cell { width: 35px; padding-right: 0; }
input[type=checkbox] { accent-color: var(--blue); width: 13px; height: 13px; cursor: pointer; margin: 0; }
.trend-cell { width: 166px; }
.spark { display: block; width: 144px; height: 36px; }
.spark-path { stroke: #a0b5c7; stroke-width: 1.5; fill: none; }
.selected .spark-path { stroke: var(--blue); }
.spark-center { stroke: #e0e7ec; stroke-width: 1; stroke-dasharray: 2 2; }
.spark-dot { fill: #246da9; }
.null { color: #bdc5cb; }
.peak-date { font-size: 10px; white-space: nowrap; border: 0; background: transparent; padding: 0; color: var(--blue); }
.spotify-link { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; opacity: .5; }
.empty { color: var(--muted); padding: 40px 15px; text-align: center; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; color: var(--muted); font-size: 11px; }
.pagination > div { display: flex; gap: 6px; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; margin-bottom: 20px; border-left: 2px solid #c49643; background: #fbf8f0; color: #806831; font-size: 11px; }
.notice.error { background: #fcf4f3; border-left-color: #ba6b60; color: #99594e; }
#retry { width: 27px; height: 27px; flex: 0 0 27px; }
footer { display: flex; justify-content: space-between; gap: 14px; padding: 12px 28px; border-top: 1px solid var(--line); color: #89949c; font-size: 10px; }
[hidden] { display: none !important; }
@media (max-width: 400px) { .brand > span { display: none; } }
@media (max-width: 960px) { .controls { gap: 16px; flex-wrap: wrap; } .chart-control { width: 290px; max-width: none; flex: 1 1 260px; } .search-control { flex: 1 1 220px; } .date-controls { flex: 0 0 auto; } }
@media (max-width: 600px) {
  .app-header { padding: 14px 16px; } .brand { font-size: 12px; gap: 8px; } .snapshot { display: none; }
  .controls { padding: 14px 16px; gap: 14px; } .chart-control { flex: 1 1 100%; width: 100%; } .date-controls { width: 100%; gap: 8px; } .date-controls label { flex: 1; min-width: 0; } .date-controls select { width: 100% !important; } .search-control { margin: 0; width: 100%; flex-basis: 100%; }
  main { padding: 21px 16px 35px; } h1 { font-size: 20px; } .week-meta { font-size: 10px; } .eyebrow { font-size: 9px; }
  .graph-heading { flex-wrap: wrap; margin-bottom: 10px; gap: 12px; } .range-control { margin-left: auto; } .graph { height: 215px; }
  .legend-item > span { max-width: 220px; } .graph-footer { font-size: 9px; flex-wrap: wrap; }
  .tabs { gap: 16px; } .tabs button { font-size: 11px; } .result-count { font-size: 9px; }
  th, td { padding: 9px; } .title-cell { min-width: 200px; } .label-cell { min-width: 100px; }
  footer { padding: 12px 16px; font-size: 9px; flex-wrap: wrap; }
}
