.tl-page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-12);
  width: 100%;
}

.tl-header { margin-bottom: var(--space-5); }
.tl-title  { font-size: var(--text-2xl); font-weight: 700; letter-spacing: var(--tracking-tight); color: var(--fg-1); }
.tl-subtitle { font-size: var(--text-sm); color: var(--fg-3); margin-top: var(--space-1); }

.tl-controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--space-6); }
.tl-search-wrap { position: relative; display: inline-flex; align-items: center; }
#tl-view-toggle .filter-btn { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; }
.tl-search-wrap svg { position: absolute; left: 10px; color: var(--fg-4); pointer-events: none; }
.tl-search-input {
  background: var(--bg-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full); color: var(--fg-1); font-family: var(--font-sans);
  font-size: 12px; padding: 4px 14px 4px 30px; outline: none; width: 200px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.tl-search-input:focus { border-color: var(--brand-teal); box-shadow: 0 0 0 2px var(--brand-teal-10); }
.tl-search-input::placeholder { color: var(--fg-4); }

.tl-loading {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 80px var(--space-4); color: var(--fg-4); font-size: var(--text-sm);
}
.tl-empty {
  padding: var(--space-8) var(--space-4); text-align: center;
  color: var(--fg-4); font-size: var(--text-sm);
}

/* ── Timeline list ── */
.tl-root { display: flex; flex-direction: column; }

.tl-section {
  display: flex; gap: var(--space-4); align-items: flex-start;
  padding-bottom: var(--space-8);
}
.tl-section:last-child { padding-bottom: 0; }

.tl-node {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; width: 16px; padding-top: 3px;
}
.tl-node-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand-teal); flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--bg-page), 0 0 0 4px var(--brand-teal);
}
.tl-node-line {
  width: 2px; background: var(--border-subtle); flex: 1;
  margin-top: 6px; min-height: 40px;
}
.tl-section:last-child .tl-node-line { display: none; }

.tl-content { flex: 1; min-width: 0; }

.tl-date-row {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: var(--space-2); margin-bottom: var(--space-2);
}
.tl-date  { font-size: var(--text-lg); font-weight: 700; color: var(--fg-1); }
.tl-rel   { font-size: var(--text-xs); color: var(--fg-4); font-family: var(--font-mono); }
.tl-count {
  font-size: var(--text-xs); font-family: var(--font-mono); font-weight: 600;
  color: var(--brand-teal); background: var(--brand-teal-10);
  border-radius: var(--radius-full); padding: 1px 8px;
}

.tl-date-note {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: var(--text-xs); color: var(--fg-4); margin-bottom: var(--space-2);
  background: var(--bg-2); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 5px 10px; line-height: var(--lh-snug);
}
.tl-date-note svg { flex-shrink: 0; margin-top: 1px; }

.tl-cat-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3); }
.tl-cat-badge {
  font-size: 11px; color: var(--fg-4);
  background: var(--bg-2); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full); padding: 1px 8px;
}
.tl-cat-badge strong { color: var(--fg-2); font-weight: 600; }

/* ── Item grid ── */
.tl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: var(--space-2);
}

.tl-item-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: var(--space-2);
  text-decoration: none; color: inherit;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.tl-item-card:hover { border-color: var(--brand-teal); background: var(--bg-2); text-decoration: none; }
.tl-item-card img { width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.tl-item-name {
  font-size: 10px; color: var(--fg-3); text-align: center; line-height: 1.3; width: 100%;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.tl-show-more {
  margin-top: var(--space-3); background: none;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  color: var(--fg-3); font-size: var(--text-xs); padding: 5px 14px;
  cursor: pointer; transition: border-color var(--dur-fast), color var(--dur-fast);
}
.tl-show-more:hover { border-color: var(--brand-teal); color: var(--brand-teal); }

/* ── Chart view ── */
.tl-chart-wrap { display: flex; flex-direction: column; gap: var(--space-3); }

.tl-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.tl-legend-item { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--fg-3); }
.tl-legend-dot  { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

.tl-svg-scroll { overflow-x: auto; }
.tl-chart-svg  { display: block; min-width: 480px; }

.tl-chart-tip {
  position: fixed; z-index: 9999; pointer-events: none;
  background: var(--bg-4); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs); color: var(--fg-2); box-shadow: var(--shadow-md);
  min-width: 130px;
}
.tl-tip-date  { font-weight: 700; color: var(--fg-1); margin-bottom: 4px; }
.tl-tip-total { font-family: var(--font-mono); color: var(--brand-teal); margin-bottom: 4px; font-size: 11px; }

/* ── Mobile ── */
@media (max-width: 600px) {
  .tl-grid { grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); }
  .tl-date { font-size: var(--text-base); }
  .tl-section { gap: var(--space-3); }
}
