/* Your whole timeline (static/js/timeline.js): the totals and a year of days,
   then months, days on a rail, and a card a session with its setlist as a
   little spreadsheet. No pill shapes: labels are text, tags have small corners. */
.tl { --tl-top: 0px; --tl-ink: var(--color-forest-main, #15666b); max-width: 760px; }

/* Totals and the heatmap. */
.tl-hero {
  margin-bottom: 22px; padding: 18px 18px 14px; border-radius: 16px; color: white;
  background: linear-gradient(135deg, var(--color-forest-deep, #0e4d51), var(--color-forest-light, #1d7f85));
}
.tl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.tl-big { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl-big strong { font-family: 'Lora', Georgia, serif; font-size: 1.6rem; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.tl-big span { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
.tl-heat { overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tl-heat-months, .tl-heat-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; width: max-content; }
.tl-heat-months { margin-bottom: 4px; font-size: 10px; line-height: 1; opacity: 0.75; }
.tl-heat-months span { white-space: nowrap; }
.tl-heat-grid { grid-template-rows: repeat(7, 12px); }
/* A day with nothing is an empty dashed box; any playing fills it, lighter for longer. */
.tl-heat-cell { box-sizing: border-box; width: 12px; height: 12px; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: default; }
.tl-heat-cell[data-level="0"] { border: 1px dashed rgba(255, 255, 255, 0.3); }
.tl-heat-cell[data-level="1"] { background: #5bb3a9; }
.tl-heat-cell[data-level="2"] { background: #8fd3c9; }
.tl-heat-cell[data-level="3"] { background: #c4ece5; }
.tl-heat-cell[data-level="4"] { background: #ffffff; box-shadow: 0 0 6px rgba(255, 255, 255, 0.75); }
.tl-heat-cell[data-day] { cursor: pointer; }
.tl-heat-cell[data-day]:hover, .tl-heat-cell[data-day]:focus-visible { outline: 2px solid white; outline-offset: 1px; }
.tl-heat-cell.is-future { visibility: hidden; }

/* Months: the heading stays put while its days scroll by. */
.tl-month + .tl-month { margin-top: 18px; }
.tl-month-head {
  position: sticky; top: var(--tl-top); z-index: 5; display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 4px 12px; margin: 0 -4px 10px; padding: 10px 4px 8px;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(6px);
}
.tl-month-head h3 { margin: 0; font-family: 'Lora', Georgia, serif; font-size: 1.25rem; font-weight: 700; color: var(--color-text-primary); }
.tl-month-stats { display: flex; gap: 12px; }
.tl-stat { display: inline-flex; align-items: center; gap: 3px; font-size: 0.82rem; color: var(--color-text-muted); }
.tl-stat .material-icons { font-size: 16px; color: var(--tl-ink); }
.tl-stat strong { font-weight: 700; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }

/* Days on a rail. */
.tl-day { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding-bottom: 12px; }
.tl-day::before { content: ''; position: absolute; top: 0; bottom: 0; left: 22px; width: 2px; background: var(--color-border-subtle, #e8e0d0); }
.tl-day-mark {
  position: relative; display: flex; flex-direction: column; align-items: center; align-self: start; padding: 6px 0;
  border-radius: 12px; background: white; box-shadow: 0 0 0 2px var(--color-border-subtle, #e8e0d0);
}
.tl-dow { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.tl-date { font-family: 'Lora', Georgia, serif; font-size: 1.3rem; font-weight: 700; line-height: 1.1; color: var(--color-text-primary); }
.tl-streak {
  display: inline-flex; align-items: center; margin-top: 3px;
  color: var(--color-rust-dark, #a86e20); font-size: 11px; font-weight: 800; line-height: 1.3;
}
.tl-streak .material-icons { font-size: 13px; color: #e8772e; }
.tl-day-body { display: grid; gap: 8px; min-width: 0; }
.tl-day.is-picked .tl-day-mark { animation: tl-pick 1.6s ease-out; }
@keyframes tl-pick { 0%, 40% { box-shadow: 0 0 0 4px var(--color-amber-main, #d4a537); } 100% { box-shadow: 0 0 0 2px var(--color-border-subtle, #e8e0d0); } }

/* A session: its first song's video, when and how long, and its songs. */
.tl-session {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 20px; align-items: start; gap: 12px; padding: 10px;
  border: 1px solid var(--color-border-subtle, #e8e0d0); border-radius: 12px; background: white; color: inherit;
  text-decoration: none; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tl-session:hover, .tl-session:focus-visible {
  transform: translateY(-1px); border-color: var(--color-sand, #d9cdb8); box-shadow: 0 6px 16px rgba(31, 47, 53, 0.08);
}
.tl-session > .material-icons { align-self: center; color: var(--color-text-light); }
.tl-cover {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  aspect-ratio: 16 / 9; border-radius: 8px; background: color-mix(in srgb, var(--tl-ink) 14%, white);
}
.tl-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-cover .material-icons { font-size: 20px; color: var(--tl-ink); }
.tl-session-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.tl-session-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 0.82rem; color: var(--color-text-muted); }
.tl-clock { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.tl-clock .material-icons { font-size: 16px; color: var(--color-amber-main, #d4a537); }
.tl-length { font-weight: 700; color: var(--color-text-secondary); }
.tl-jam {
  display: inline-flex; align-items: center; gap: 3px; max-width: 100%; overflow: hidden;
  color: var(--color-mountain-main, #4a7c8c); font-weight: 700; white-space: nowrap; text-overflow: ellipsis;
}
.tl-jam .material-icons { font-size: 15px; }
.tl-session.is-activity .tl-cover { background: color-mix(in srgb, var(--color-mountain-main, #4a7c8c) 14%, white); }
.tl-session.is-activity .tl-cover .material-icons { color: var(--color-mountain-main, #4a7c8c); }
/* The setlist: a numbered row a song, with grid lines like a spreadsheet. */
.tl-sheet {
  width: 100%; border-collapse: collapse; table-layout: fixed; background: white;
  font-size: 0.84rem; color: var(--color-text-primary);
}
.tl-sheet td { height: 26px; padding: 0 8px; border: 1px solid #e4ded1; }
.tl-sheet-num {
  width: 30px; padding: 0 !important; background: #f6f3eb; color: var(--color-text-muted);
  font-size: 0.72rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums;
}
.tl-sheet-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tl-sheet-title { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
/* The first time a song was ever played: its row lit up. */
.tl-sheet tr.is-new td { background: #fff3df; border-color: #f0dcb8; }
.tl-sheet tr.is-new .tl-sheet-num { background: #fbe4bd; color: var(--color-rust-dark, #a86e20); }
.tl-first {
  flex-shrink: 0; color: var(--color-rust-dark, #a86e20); font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.tl-sheet-removed .tl-sheet-song { color: var(--color-text-muted); font-style: italic; }
/* A session without songs: what it was spent on; it opens a setlist it changed, else nothing. */
div.tl-session.is-activity { grid-template-columns: 84px minmax(0, 1fr); cursor: default; }
div.tl-session.is-activity:hover { transform: none; box-shadow: none; border-color: var(--color-border-subtle, #e8e0d0); }
.tl-activities { display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0; }
.tl-activity {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden;
  color: var(--color-mountain-main, #4a7c8c); font-size: 0.86rem; font-weight: 700; white-space: nowrap; text-overflow: ellipsis;
}
.tl-activity .material-icons { font-size: 16px; }

/* Breaks, the bottom, and loading. */
.tl-gap {
  position: relative; margin: 0 0 12px; padding: 2px 0 2px 58px; font-size: 0.78rem; font-weight: 700; color: var(--color-text-light);
}
.tl-gap::before { content: ''; position: absolute; top: -12px; bottom: -12px; left: 22px; border-left: 2px dashed var(--color-border-subtle, #e8e0d0); }
.tl-start { display: flex; align-items: center; gap: 8px; margin: 6px 0 0 8px; color: var(--color-text-muted); font-size: 0.9rem; }
.tl-start .material-icons { color: var(--tl-ink); }
.tl-start strong { color: var(--color-text-primary); }
.tl-sentinel { display: flex; justify-content: center; padding: 18px 0; }
.tl-spinner {
  width: 22px; height: 22px; border: 3px solid var(--color-border-subtle, #e8e0d0); border-top-color: var(--tl-ink);
  border-radius: 50%; animation: tl-spin 0.8s linear infinite;
}
@keyframes tl-spin { to { transform: rotate(360deg); } }
.tl-note, .tl-empty { color: var(--color-text-muted); font-size: 0.9rem; }

@media (max-width: 600px) {
  .tl-hero { padding: 14px 14px 10px; }
  .tl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .tl-big strong { font-size: 1.35rem; }
  .tl-day { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .tl-day::before, .tl-gap::before { left: 19px; }
  .tl-gap { padding-left: 50px; }
  /* The setlist gets the card's width; the video picture steps aside. */
  .tl-session { grid-template-columns: minmax(0, 1fr) 16px; gap: 8px; padding: 8px; }
  .tl-cover { display: none; }
  .tl-session > .material-icons { font-size: 18px; }
  div.tl-session.is-activity { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .tl-session, .tl-day.is-picked .tl-day-mark, .tl-spinner { transition: none; animation: none; }
}
