  :root {
    --bg: #fbf7ee;
    --bg2: #ffffff;
    --bg3: #f3ede0;
    --row-a: #e7eef4;
    --row-a-hover: #c8d6e3;
    --row-b: #f5e8cf;
    --row-b-hover: #e6cf9f;
    --border: #e8e1d0;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent2: #ea580c;
    --text: #1c1917;
    --text2: #44403c;
    --text3: #78716c;
    --art-size: 100px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    min-height: 100vh;
  }

  .header {
    padding: 28px 40px 0;
    border-bottom: 1px solid var(--border);
    background: #dde7ef;
    display: flex;
    align-items: flex-end;
    gap: 32px;
  }

  .header-title {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.5px;
    padding-bottom: 18px;
    flex-shrink: 0;
  }

  .content-tabs {
    display: flex;
    gap: 0;
    flex: 1;
  }

  .content-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 8px 20px 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text3);
    cursor: pointer;
    transition: color 0.15s;
  }

  .content-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
  }

  .content-tab:hover:not(.active) { color: var(--text2); }

  .time-filter {
    display: flex;
    gap: 2px;
  }

  .time-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--text3);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 12px 18px;
    cursor: pointer;
    transition: color 0.15s;
  }

  .time-btn:hover { color: var(--text2); }

  .time-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  /* Charts view — 3-column grid */
  .charts-view {
    padding: 0 40px 60px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }

  /* Last Played view — centered, comfortable reading width */
  .lastplayed-view {
    padding: 32px 40px 60px;
    max-width: 800px;
    margin: 0 auto;
  }

  .lp-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
  }

  .lp-page-title {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    color: var(--text);
  }

  .lp-view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--accent);
    border-radius: 4px;
    overflow: hidden;
  }

  .lp-view-btn {
    background: var(--bg2);
    border: none;
    color: var(--accent);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }

  .lp-view-btn.active {
    background: var(--accent);
    color: #fff;
  }

  .lp-view-btn:hover:not(.active) { background: var(--row-a); }

  /* List view rows */
  #lastplayed-view.list-view { max-width: 1100px; }

  .lp-list-row {
    display: grid;
    grid-template-columns: 65px 1fr 1.6fr 1.4fr;
    gap: 16px;
    padding: 7px 10px;
    border-radius: 3px;
    align-items: baseline;
    transition: background 0.1s;
    cursor: pointer;
  }

  #lastplayed-view.list-view .lp-list-row:nth-child(odd)  { background: var(--row-a); }
  #lastplayed-view.list-view .lp-list-row:nth-child(even) { background: var(--row-b); }
  #lastplayed-view.list-view .lp-list-row:nth-child(odd):hover  { background: var(--row-a-hover); }
  #lastplayed-view.list-view .lp-list-row:nth-child(even):hover { background: var(--row-b-hover); }

  .lp-list-time {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--accent2);
  }

  .lp-list-artist {
    font-size: 13px;
    color: var(--text2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lp-list-track {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lp-list-album {
    font-size: 12px;
    color: var(--text3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #lastplayed-view .track-art,
  #lastplayed-view .track-art-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 4px;
  }

  #lastplayed-view .last-row {
    gap: 16px;
    padding: 10px 8px;
    align-items: flex-start;
  }

  #lastplayed-view .last-time {
    font-size: 12px;
    width: 75px;
    padding-top: 8px;
  }

  #lastplayed-view .last-info { padding-top: 6px; }

  #lastplayed-view .last-album {
    font-size: 11px;
    margin-bottom: 4px;
  }

  #lastplayed-view .last-track { font-size: 16px; }

  #lastplayed-view .last-artist {
    font-size: 13px;
    margin-top: 4px;
  }

  .hidden { display: none !important; }

  .section { padding: 24px 0; }

  .section:not(:last-child) {
    padding-right: 32px;
    border-right: 1px solid var(--border);
  }

  .section:not(:first-child) { padding-left: 32px; }

  .section-header {
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
  }

  .section-title {
    font-family: 'DM Mono', monospace;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
  }

  .section-title a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
  }

  .section-title a:hover { color: var(--accent-dark); }

  .track-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .track-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 8px;
    border-radius: 4px;
    transition: background 0.1s;
    cursor: default;
  }

  .track-list .track-row:nth-child(odd)  { background: var(--row-a); }
  .track-list .track-row:nth-child(even) { background: var(--row-b); }
  .track-list .track-row:nth-child(odd):hover  { background: var(--row-a-hover); }
  .track-list .track-row:nth-child(even):hover { background: var(--row-b-hover); }

  .track-num {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text3);
    width: 18px;
    text-align: right;
    flex-shrink: 0;
    padding-top: 4px;
  }

  .track-art {
    width: var(--art-size);
    height: var(--art-size);
    flex-shrink: 0;
    border-radius: 3px;
    object-fit: cover;
    background: var(--bg3);
  }

  .track-art-placeholder {
    width: var(--art-size);
    height: var(--art-size);
    flex-shrink: 0;
    border-radius: 3px;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text3);
    font-size: 24px;
  }

  .track-info {
    flex: 1;
    min-width: 0;
  }

  .track-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
  }

  .track-sub {
    font-size: 12px;
    color: var(--text2);
    margin-top: 2px;
  }

  .track-plays-inline {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text3);
    margin-top: 4px;
  }

  /* Last Played rows */
  .last-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 8px;
    border-radius: 4px;
    transition: background 0.1s;
  }

  .track-list .last-row:nth-child(odd)  { background: var(--row-a); }
  .track-list .last-row:nth-child(even) { background: var(--row-b); }
  .track-list .last-row:nth-child(odd):hover  { background: var(--row-a-hover); }
  .track-list .last-row:nth-child(even):hover { background: var(--row-b-hover); }

  .last-time {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--accent2);
    flex-shrink: 0;
    width: 70px;
    text-align: right;
    padding-top: 4px;
  }

  .last-info {
    flex: 1;
    min-width: 0;
  }

  .last-track {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
  }

  .last-album {
    font-size: 11px;
    color: var(--text3);
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.03em;
    margin-bottom: 3px;
  }

  .last-artist {
    font-size: 12px;
    color: var(--text2);
    margin-top: 2px;
  }

  .last-plays {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text3);
    margin-top: 16px;
  }

  #lastplayed-view .last-plays {
    font-size: 12px;
    margin-top: 18px;
  }

  .loading {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text3);
    padding: 20px 8px;
    letter-spacing: 0.05em;
  }

  .error {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: #8b3030;
    padding: 20px 8px;
  }

  /* Expanded view */
  .expanded-view {
    display: none;
    padding: 40px;
  }

  .expanded-view.active { display: block; }

  .back-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text2);
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 3px;
    margin-bottom: 32px;
    transition: color 0.15s, border-color 0.15s;
  }

  .back-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
  }

  .expanded-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--accent);
    margin-bottom: 24px;
  }

  .expanded-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-width: 700px;
  }

  .pagination {
    display: flex;
    gap: 8px;
    margin-top: 32px;
    align-items: center;
  }

  .page-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text2);
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 3px;
    transition: color 0.15s, border-color 0.15s;
  }

  .page-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
  }

  .page-btn:disabled {
    opacity: 0.3;
    cursor: default;
  }

  .page-info {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text3);
    margin: 0 8px;
  }

  .is-clickable { cursor: pointer; }

  .col-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--text2);
  }

  .col-pag-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text2);
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    padding: 5px 11px;
    cursor: pointer;
    border-radius: 3px;
    transition: color 0.15s, border-color 0.15s;
  }

  .col-pag-btn:hover:not(:disabled) {
    color: var(--accent);
    border-color: var(--accent);
  }

  .col-pag-btn:disabled {
    opacity: 0.3;
    cursor: default;
  }

  .artist-link { color: inherit; text-decoration: none; }
  .artist-link:hover { color: var(--accent); text-decoration: underline; }

  .stats-strip {
    padding: 12px 40px;
    border-bottom: 1px solid var(--border);
    background: var(--bg3);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 32px;
    min-height: 44px;
  }

  .np-section {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: start;
    margin-left: 80px;
    margin-right: 32px;
    grid-column: 1;
  }

  .stats-content { grid-column: 2; }

  .np-art {
    width: 125px;
    height: 125px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg3);
  }

  .np-info { min-width: 0; max-width: 240px; }

  .np-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 5px;
  }

  .np-track {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
  }

  .np-artist {
    font-size: 12px;
    color: var(--text2);
    margin-top: 3px;
  }

  .np-album {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
  }

  .stats-content {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 4px;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    color: var(--text3);
  }

  .stat-header { color: var(--text2); font-weight: 500; margin-right: 16px; }
  .stat-num { color: var(--text); }
  .stat-sep { margin: 0 14px; color: var(--border); }

  /* ── Charts tab ── */
  .graph-nav {
    padding: 28px 40px 12px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
  }

  .graph-nav-label {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text3);
    margin-right: 14px;
    vertical-align: middle;
  }

  .chart-select {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: var(--accent);
    background: var(--bg2);
    border: 2px solid var(--accent);
    border-radius: 6px;
    padding: 7px 36px 7px 14px;
    cursor: pointer;
    outline: none;
    transition: background 0.15s;
  }

  .chart-select:hover { background: var(--row-a); }

  .graphs-content {
    padding: 24px 40px 60px;
    max-width: 1100px;
    margin: 0 auto;
  }

  .graph-canvas-wrap {
    position: relative;
  }

  /* ── Rewind tab ── */
  .rewind-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 28px 40px;
    border-bottom: 1px solid var(--border);
  }

  .rewind-nav-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text2);
    font-family: 'DM Mono', monospace;
    font-size: 16px;
    padding: 6px 16px;
    cursor: pointer;
    border-radius: 3px;
    transition: color 0.15s, border-color 0.15s;
  }

  .rewind-nav-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
  .rewind-nav-btn:disabled { opacity: 0.25; cursor: default; }

  .rewind-select {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    text-align: center;
  }

  .rewind-content {
    padding: 0 40px 60px;
    max-width: 1100px;
    margin: 0 auto;
  }

  .rewind-row {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
  }

  .rewind-art-wrap { flex-shrink: 0; width: 300px; }

  .rewind-art {
    width: 300px;
    height: 300px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
    background: var(--bg3);
  }

  .rewind-art-ph {
    width: 300px;
    height: 300px;
    border-radius: 4px;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: var(--text3);
  }

  .rewind-row-content { flex: 1; min-width: 0; padding-top: 4px; }

  .rewind-row-label {
    font-family: 'DM Mono', monospace;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
  }

  .rewind-row-headline {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 6px;
  }

  .rewind-row-plays {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    color: var(--text3);
    margin-bottom: 28px;
  }

  .rewind-runners { display: flex; flex-direction: column; gap: 12px; }

  .rewind-runner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    font-size: 15px;
    color: var(--text);
    max-width: 480px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }

  .rewind-runner:last-child { border-bottom: none; }

  .rewind-runner-plays {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--text3);
  }

  .rewind-stats-section { padding: 40px 0; }

  .rewind-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 24px;
  }

  .rewind-stat-item { text-align: center; }

  .rewind-stat-num {
    font-family: 'DM Mono', monospace;
    font-size: 40px;
    color: var(--text);
    line-height: 1;
    margin-bottom: 8px;
  }

  .rewind-stat-label {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
  }

  .track-album {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--text3);
    letter-spacing: 0.03em;
    margin-bottom: 2px;
  }
