/* owned by the timeline agent, see PLAN.md */

/* ── Shared panel look (timeline and lens legends) ── */
.tl, .lens {
  margin-top: 16px; padding: 16px 20px; line-height: 1.5;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.lens { max-width: 780px; margin-left: auto; margin-right: auto; }
.lens h2 { margin: 0 0 10px; font: 600 12px var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--gold); }
.lens .fine { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

/* ── Lens legends ── */
.lens .bar { height: 12px; border-radius: 6px; }
.lens .ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.lens .row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0; font-size: 14px; }
.lens .muted { color: var(--muted); font-size: 13px; }
.lens .swatch {
  flex: none; width: 14px; height: 14px; border-radius: 4px; transform: translateY(2px);
  background: var(--c, transparent); border: 1px solid #ffffff40;
}
.lens .camp { margin: 0 0 10px; }
.lens .who { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 24px; }
.lens .who button {
  background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.lens .who button:hover, .lens .who button:focus-visible { border-color: var(--gold); color: var(--gold); outline: none; }
.lens .note { min-height: 3em; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; }

/* ── Timeline ── */
.tl { --c-discovery: var(--gold); --c-world: #d9876a; --c-nobel: #f2d98f; --c-birth: #8dbf9c; --c-death: #9a9084; --c-life: var(--muted); }
.tl-bar { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px 24px; }
.tl-play {
  min-width: 96px; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer;
}
.tl-play:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.tl-play:disabled { opacity: .45; cursor: not-allowed; }
.tl-year { min-width: 4.4ch; text-align: center; font: 400 clamp(44px, 7vw, 72px)/1 var(--serif); color: var(--gold); font-variant-numeric: tabular-nums; }
.tl-slide { position: relative; padding-bottom: 54px; }
.tl-slide input { display: block; width: 100%; height: 28px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.tl-ticks { position: absolute; inset: 28px 0 auto; height: 16px; font-size: 11px; color: var(--muted); pointer-events: none; }
.tl-ticks span, .tl-slide .mark { position: absolute; left: calc(var(--f) * (100% - 16px) + 8px); transform: translateX(-50%); white-space: nowrap; }
.tl-slide .mark { top: 46px; transform: translateX(-0.45em); padding: 0; background: none; border: 0; color: var(--gold); font: inherit; font-size: 12px; cursor: pointer; }
.tl-slide .mark:hover, .tl-slide .mark:focus-visible { text-decoration: underline; outline: none; }
.tl-stats { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }

.tl-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-height: 2.6em; }
.ev { display: flex; align-items: baseline; gap: 12px; padding-left: 10px; border-left: 3px solid var(--c, var(--line)); }
.ev.discovery { --c: var(--c-discovery); }
.ev.world { --c: var(--c-world); }
.ev.nobel { --c: var(--c-nobel); }
.ev.birth { --c: var(--c-birth); }
.ev.death { --c: var(--c-death); }
.ev.life { --c: var(--c-life); }
.ev button, .ev-plain {
  display: flex; flex: 1; align-items: baseline; gap: 12px; margin: 0; padding: 2px 6px; text-align: left;
  background: none; border: 0; border-radius: 6px; color: var(--ink); font: inherit; font-size: 15px; line-height: 1.4;
}
.ev button { cursor: pointer; }
.ev button:hover, .ev button[aria-pressed="true"] { background: #ffffff12; }
.ev button:focus-visible { outline: 2px solid var(--gold); }
.ev-kind { flex: none; width: 5.6em; font: 600 11px/1.6 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.ev-src { flex: none; font-size: 12px; color: var(--muted); }
.ev-empty { color: var(--muted); font-size: 14px; font-style: italic; }
.tl-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .tl, .lens { padding: 14px; }
  .tl-bar { grid-template-columns: auto 1fr; }
  .tl-play { justify-self: start; }
  .tl-year { justify-self: end; }
  .tl-slide { grid-column: 1 / -1; }
  .ev { flex-wrap: wrap; gap: 2px 12px; }
  .ev-kind { width: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .ev button, .lens .who button, .tl-play { transition: background-color .15s, border-color .15s, color .15s; }
}
