.timeline-shell {
  color-scheme: light;
  --ink: #0d1b36;
  --muted: #5f6877;
  --soft-line: #e7ebf1;
  --paper: #fbfbf8;
  --panel: #ffffff;
  --blue: #2768c9;
  --teal: #168f8b;
  --amber: #bc7a17;
  --coral: #e75848;
  --shadow: 0 18px 45px rgba(16, 28, 52, 0.08);
}

.timeline-shell * {
  box-sizing: border-box;
}

.timeline-shell {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 248, 245, 0.96)),
    radial-gradient(circle at 50% 0%, #ffffff 0, var(--paper) 58%, #f0f2ec 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.timeline-shell button {
  font: inherit;
}

.timeline-shell {
  margin: 0 auto;
  padding: 0;
}

.timeline-shell {
  min-width: 0;
  overflow-x: visible;
  padding-bottom: 18px;
}

.timeline-shell .timeline-empty-state {
  width: min(100%, 520px);
  margin: clamp(96px, 18vh, 180px) auto;
  padding: 2rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.timeline-shell .timeline-empty-state h2 { margin: 0 0 .75rem; font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.timeline-shell .timeline-empty-state p { margin: 0 auto 1rem; max-width: 30rem; color: var(--muted); line-height: 1.6; font-size: .92rem; }
.timeline-shell .timeline-empty-state a { color: var(--blue); text-decoration: none; font-size: .85rem; font-weight: 600; }
.timeline-shell .timeline-empty-state a:hover { text-decoration: underline; }
.timeline-shell .timeline-empty-state .timeline-empty-icon {
  margin: 0 0 .75rem;
  color: var(--muted);
}
.timeline-shell .timeline-empty-state .timeline-empty-icon svg {
  width: 32px;
  height: 32px;
}

.timeline-shell .timeline-history-view {
  width: min(100%, 1160px);
  min-width: 0;
  margin: clamp(48px, 10vh, 96px) auto 0;
  padding: 0 clamp(14px, 4vw, 32px);
}

.timeline-shell .timeline-history-grid {
  min-width: 0;
}

.timeline-shell .timeline-history-lede {
  margin: 0 0 18px;
}

.timeline-shell .timeline-history-lede h2 {
  font-size: clamp(1.08rem, 1.8vw, 1.45rem);
}

.timeline-shell .timeline-history-lede p {
  max-width: 42rem;
}

.timeline-shell .timeline-history-legend {
  margin-top: 12px;
}

.timeline-shell .day-event,
.timeline-shell .hour-event,
.timeline-shell .minute-event,
.timeline-shell .micro-event {
  position: relative;
  width: min(100%, 230px);
  padding: 0 12px 0 18px;
  border-left: 2px solid var(--accent);
}

.timeline-shell .day-event::before,
.timeline-shell .day-event::after,
.timeline-shell .hour-event::before,
.timeline-shell .hour-event::after,
.timeline-shell .minute-event::before,
.timeline-shell .minute-event::after,
.timeline-shell .micro-event::before,
.timeline-shell .micro-event::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  background: var(--accent);
}

.timeline-shell .day-event::before,
.timeline-shell .hour-event::before,
.timeline-shell .minute-event::before,
.timeline-shell .micro-event::before {
  margin: 0 0 10px -18px;
}

.timeline-shell .day-event::after,
.timeline-shell .hour-event::after,
.timeline-shell .minute-event::after,
.timeline-shell .micro-event::after {
  margin: 12px 0 0 -18px;
}

.timeline-shell .day-date {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: clamp(0.78rem, 0.85vw, 0.94rem);
  font-weight: 800;
  line-height: 1.1;
}

.timeline-shell h2,

.timeline-shell h3 {
  margin: 0;
  color: #0c1b36;
  font-size: clamp(1.02rem, 1.08vw, 1.22rem);
  font-weight: 850;
  line-height: 1.1;
}

.timeline-shell p {
  margin: 10px 0 0;
  color: #303847;
  font-size: clamp(0.78rem, 0.82vw, 0.93rem);
  line-height: 1.38;
}

.timeline-shell .accent-blue {
  --accent: var(--blue);
}

.timeline-shell .accent-teal {
  --accent: var(--teal);
}

.timeline-shell .accent-amber {
  --accent: var(--amber);
}

.timeline-shell .accent-coral {
  --accent: var(--coral);
}

.timeline-shell .month-view {
  --axis-top: 304px;
  position: relative;
  overflow: hidden;
}

.timeline-shell .month-view::before {
  content: "";
  position: absolute;
  top: var(--axis-top);
  left: 0;
  right: 0;
  z-index: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ink), #263a5e);
}

.timeline-shell .edge-node,
.timeline-focus-node {
  display: grid;
  place-items: center;
  border: 2px solid #11213d;
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.timeline-shell .edge-node {
  position: absolute;
  z-index: 4;
  top: var(--axis-top);
  width: 78px;
  height: 78px;
  transform: translateY(-50%);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.94);
  font-size: 1rem;
}

.timeline-shell .edge-node.timeline-prev {
  left: -16px;
}

.timeline-shell .edge-node.timeline-next {
  right: -16px;
}

.timeline-shell .edge-node:hover,
.timeline-shell .edge-node:focus-visible,
.timeline-focus-node:hover,
.timeline-focus-node:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: 0;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.94),
    0 10px 24px rgba(16, 28, 52, 0.13);
}

.timeline-shell .edge-node:hover,
.timeline-shell .edge-node:focus-visible {
  transform: translateY(calc(-50% - 2px));
}

.timeline-focus-node:hover,
.timeline-focus-node:focus-visible {
  transform: translateY(-2px);
}

.timeline-focus-panel {
  position: relative;
  z-index: 2;
  padding: 0 118px;
}

.timeline-focus-heading {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 8px;
}

.timeline-focus-node {
  width: 74px;
  height: 74px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.96);
  color: var(--accent);
  font-size: 1.06rem;
}

.timeline-focus-label {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 850;
  white-space: nowrap;
}

.timeline-shell .events-lane {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 240px), 1180px);
  height: 170px;
  overflow: visible;
}

.timeline-shell .events-lane.timeline-top {
  top: 108px;
}

.timeline-shell .events-lane.timeline-bottom {
  top: 386px;
}

.timeline-shell .month-connectors {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.timeline-shell .day-event {
  position: absolute;
  width: 170px;
  z-index: 2;
}

.timeline-shell .day-event.timeline-top {
  bottom: 18px;
}

.timeline-shell .day-event.timeline-bottom {
  top: 18px;
}

.timeline-shell .day-date {
  font-size: 0.78rem;
}

.timeline-shell .day-event h3 {
  font-size: 1rem;
}

.timeline-shell .day-event p {
  font-size: 0.78rem;
}

.timeline-shell .day-grid {
  position: absolute;
  top: calc(var(--axis-top) - 16px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(0, 1fr));
  gap: 5px;
  width: min(calc(100% - 240px), 1180px);
  padding: 0;
}

.timeline-shell .day-grid::before {
  display: none;
}

.timeline-shell .day-cell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 32px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: #3d4654;
  appearance: none;
  font-size: clamp(0.55rem, 0.75vw, 0.72rem);
  font-weight: 760;
  padding: 0;
}

.timeline-shell .day-cell.weekend {
  border-color: #d9e1eb;
  background: #eef3f6;
  color: #475569;
}

.timeline-shell .day-cell.has-event {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent), white 89%);
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

/* day-cell perpendicular dotted-pip removed; SVG layer in
   .month-connectors now draws slanted connectors from each card to
   its anchor day cell. The .day-cell.has-event tint above remains
   as the chip-on-cell cue. */

.timeline-shell .day-cell {
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.timeline-shell .day-cell:hover,
.timeline-shell .day-cell:focus-visible {
  border-color: var(--accent);
  outline: 0;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(16, 28, 52, 0.12);
}

.timeline-shell .day-view {
  --axis-top: 304px;
  position: relative;
  overflow: hidden;
}

.timeline-shell .day-view::before {
  content: "";
  position: absolute;
  top: var(--axis-top);
  left: 0;
  right: 0;
  z-index: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ink), #263a5e);
}

.timeline-shell .edge-day,
.timeline-shell .day-focus-node {
  display: grid;
  place-items: center;
  border: 2px solid #11213d;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.timeline-shell .edge-day {
  position: absolute;
  z-index: 4;
  top: var(--axis-top);
  width: 72px;
  height: 54px;
  border-radius: 8px;
  transform: translateY(-50%);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.94);
  font-size: 1rem;
}

.timeline-shell .edge-day.timeline-prev {
  left: -18px;
}

.timeline-shell .edge-day.timeline-next {
  right: -18px;
}

.timeline-shell .day-focus-node {
  width: 86px;
  height: 62px;
  border-radius: 8px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.96);
  color: var(--accent);
  font-size: 1.1rem;
}

.timeline-shell .edge-day:hover,
.timeline-shell .edge-day:focus-visible,
.timeline-shell .day-focus-node:hover,
.timeline-shell .day-focus-node:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: 0;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.94),
    0 10px 24px rgba(16, 28, 52, 0.13);
}

.timeline-shell .edge-day:hover,
.timeline-shell .edge-day:focus-visible {
  transform: translateY(calc(-50% - 2px));
}

.timeline-shell .day-focus-node:hover,
.timeline-shell .day-focus-node:focus-visible {
  transform: translateY(-2px);
}

.timeline-shell .hour-panel {
  position: relative;
  z-index: 2;
  padding: 0 118px;
}

.timeline-shell .hour-lane {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 240px), 1180px);
  height: 170px;
  overflow: visible;
}

.timeline-shell .hour-lane.timeline-top {
  top: 108px;
}

.timeline-shell .hour-lane.timeline-bottom {
  top: 386px;
}

.timeline-shell .day-connectors {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.timeline-shell .hour-grid {
  position: absolute;
  top: calc(var(--axis-top) - 18px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 5px;
  width: min(calc(100% - 240px), 1180px);
}

.timeline-shell .hour-cell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: #3d4654;
  appearance: none;
  cursor: pointer;
  font-size: clamp(0.5rem, 0.72vw, 0.68rem);
  font-weight: 760;
  padding: 0;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.timeline-shell .hour-cell:hover,
.timeline-shell .hour-cell:focus-visible {
  border-color: var(--accent);
  outline: 0;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(16, 28, 52, 0.12);
}

.timeline-shell .hour-cell.personal {
  background: #eef3f6;
}

.timeline-shell .hour-cell.work {
  background: #ffffff;
}

.timeline-shell .hour-cell.has-hour-event {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent), white 90%);
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

/* hour-cell perpendicular dotted-pip removed; SVG layer in
   .day-connectors now draws slanted connectors anchored to each card's
   actual position. The .hour-cell.has-hour-event tint above remains
   as the chip-on-cell cue. */

.timeline-shell .hour-event {
  position: absolute;
  width: 170px;
  z-index: 2;
}

.timeline-shell .hour-event.timeline-top {
  bottom: 18px;
}

.timeline-shell .hour-event.timeline-bottom {
  top: 18px;
}

/* Origin is internal-only: kept on the .day-event/.hour-event/.minute-event
   title attribute (for hover/inspection) and on data-anchor-* (for layout),
   never rendered as visible chrome. */

.timeline-shell .hour-time {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
}

.timeline-shell .hour-event h3 {
  font-size: 1rem;
}

.timeline-shell .hour-event p {
  font-size: 0.78rem;
}

.timeline-shell .minute-view {
  --axis-top: 304px;
  position: relative;
  overflow: hidden;
}

.timeline-shell .minute-view::before {
  content: "";
  position: absolute;
  top: var(--axis-top);
  left: 0;
  right: 0;
  z-index: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ink), #263a5e);
}

.timeline-shell .edge-hour,
.timeline-shell .minute-focus-node {
  display: grid;
  place-items: center;
  border: 2px solid #11213d;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.timeline-shell .edge-hour {
  position: absolute;
  z-index: 4;
  top: var(--axis-top);
  width: 72px;
  height: 54px;
  border-radius: 8px;
  transform: translateY(-50%);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.94);
  font-size: 1rem;
}

.timeline-shell .edge-hour.timeline-prev {
  left: -18px;
}

.timeline-shell .edge-hour.timeline-next {
  right: -18px;
}

.timeline-shell .minute-focus-node {
  width: 100px;
  height: 62px;
  border-radius: 8px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.96);
  color: var(--accent);
  font-size: 1.02rem;
}

.timeline-shell .edge-hour:hover,
.timeline-shell .edge-hour:focus-visible,
.timeline-shell .minute-focus-node:hover,
.timeline-shell .minute-focus-node:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: 0;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.94),
    0 10px 24px rgba(16, 28, 52, 0.13);
}

.timeline-shell .edge-hour:hover,
.timeline-shell .edge-hour:focus-visible {
  transform: translateY(calc(-50% - 2px));
}

.timeline-shell .minute-focus-node:hover,
.timeline-shell .minute-focus-node:focus-visible {
  transform: translateY(-2px);
}

.timeline-shell .minute-panel {
  position: relative;
  z-index: 2;
  padding: 0 118px;
}

.timeline-shell .minute-lane {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 300px), 980px);
  height: 170px;
  overflow: visible;
}

.timeline-shell .minute-lane.timeline-top {
  top: 108px;
}

.timeline-shell .minute-lane.timeline-bottom {
  top: 386px;
}

.timeline-shell .minute-connectors {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.timeline-shell .minute-grid {
  position: absolute;
  top: calc(var(--axis-top) - 18px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  width: min(calc(100% - 300px), 980px);
}

.timeline-shell .segment-cell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: #3d4654;
  appearance: none;
  cursor: pointer;
  font-size: clamp(0.55rem, 0.8vw, 0.74rem);
  font-weight: 760;
  padding: 0;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.timeline-shell .segment-cell:hover,
.timeline-shell .segment-cell:focus-visible {
  border-color: var(--accent);
  outline: 0;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(16, 28, 52, 0.12);
}

.timeline-shell .segment-cell.timeline-focus {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent), white 90%);
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

/* Per-cell availability tints (set by renderMinute from the day
   endpoint's hours_avail.buckets). The .timeline-focus tint above (event
   pick lands here) wins when both are present. */
.timeline-shell .segment-cell.avail-screen:not(.timeline-focus) {
  background: color-mix(in srgb, var(--teal), white 92%);
  border-color: color-mix(in srgb, var(--teal), white 65%);
  color: color-mix(in srgb, var(--teal), var(--ink) 50%);
}
.timeline-shell .segment-cell.avail-audio:not(.timeline-focus) {
  background: color-mix(in srgb, var(--coral), white 92%);
  border-color: color-mix(in srgb, var(--coral), white 65%);
  color: color-mix(in srgb, var(--coral), var(--ink) 50%);
}
.timeline-shell .segment-cell.avail-browser:not(.timeline-focus) {
  background: color-mix(in srgb, var(--blue), white 94%);
  border-color: color-mix(in srgb, var(--blue), white 68%);
  color: color-mix(in srgb, var(--blue), var(--ink) 45%);
}
.timeline-shell .segment-cell.avail-both:not(.timeline-focus) {
  background: color-mix(in srgb, var(--accent), white 90%);
  border-color: color-mix(in srgb, var(--accent), white 60%);
  color: color-mix(in srgb, var(--accent), var(--ink) 30%);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--accent), white 60%);
}
.timeline-shell .segment-cell.avail-none {
  background: rgba(245, 247, 250, 0.7);
  border-color: var(--soft-line);
  color: rgba(61, 70, 84, 0.35);
  cursor: not-allowed;
}
.timeline-shell .segment-cell.avail-none:hover,
.timeline-shell .segment-cell.avail-none:focus-visible {
  transform: none;
  box-shadow: none;
  border-color: var(--soft-line);
}
.timeline-shell .segment-cell:disabled {
  pointer-events: none;
}

/* Empty-state river when a 5-min cell has no underlying segment data. */
.timeline-shell .segment-empty {
  margin: 240px auto 0;
  text-align: center;
  font-style: italic;
  color: var(--muted);
  opacity: 0.55;
  font-size: 0.9rem;
}

/* segment-cell perpendicular dotted-pip removed; SVG layer in
   .minute-connectors now draws slanted connectors anchored to each
   card's actual position. The .segment-cell.timeline-focus tint above remains
   as the chip-on-segment cue. */

.timeline-shell .minute-event {
  position: absolute;
  width: 170px;
  z-index: 2;
}

.timeline-shell .minute-event.timeline-top {
  bottom: 18px;
}

.timeline-shell .minute-event.timeline-bottom {
  top: 18px;
}

.timeline-shell .minute-time {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
}

.timeline-shell .minute-event h3 {
  font-size: 1rem;
}

.timeline-shell .minute-event p {
  font-size: 0.78rem;
}

/* 5-min "segment" view — river of observations.
   Replaces the event-cards pattern of higher levels with a direct
   visualization of what sol observed in the slice. */
.timeline-shell .segment-view {
  --axis-top: 304px;
  position: relative;
  overflow: hidden;
}

.timeline-shell .segment-panel {
  position: relative;
  z-index: 2;
  padding: 56px 118px 24px;
}

.timeline-shell .segment-view .timeline-focus-heading {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}

/* Header strip */
.timeline-shell .segment-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 78px;
  margin-bottom: 14px;
  padding: 0 4px;
}

.timeline-shell .seg-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  font-size: 0.84rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.timeline-shell .seg-header-time {
  color: var(--ink);
  font-weight: 700;
}
.timeline-shell .seg-header-mid, .timeline-shell .seg-header-end {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.timeline-shell .seg-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.timeline-shell .topic-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent), white 87%);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent), white 70%);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* The river — central time axis with screen above and audio below. */
.timeline-shell .segment-river {
  position: relative;
  height: 240px;
  margin: 0 auto 18px;
  max-width: 1180px;
}

.timeline-shell .river-axis {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--ink), transparent 80%),
    var(--ink) 6%,
    var(--ink) 94%,
    color-mix(in srgb, var(--ink), transparent 80%));
  z-index: 1;
}
.timeline-shell .axis-mark {
  position: absolute;
  top: 100%;
  transform: translate(-50%, 6px);
  text-align: center;
}
.timeline-shell .axis-mark::before {
  content: "";
  display: block;
  margin: -10px auto 4px;
  width: 1px;
  height: 6px;
  background: var(--ink);
  opacity: 0.3;
}
.timeline-shell .axis-mark span {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.66rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.timeline-shell .river-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  z-index: 2;
}

.timeline-shell .river-tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: center;
}

.timeline-shell .river-tick-bar {
  display: block;
  margin: 0 auto;
  width: 2px;
  height: 16px;
  background: var(--cat, var(--muted));
  opacity: 0.6;
  border-radius: 1px;
  transition: opacity 140ms ease, height 140ms ease, transform 140ms ease;
}

.timeline-shell .river-tick.is-featured .river-tick-bar {
  height: 36px;
  opacity: 0.9;
}

.timeline-shell .river-tick:hover .river-tick-bar,
.timeline-shell .river-tick:focus-visible .river-tick-bar,
.timeline-shell .river-tick.is-active .river-tick-bar {
  opacity: 1;
  height: 56px;
  transform: scaleX(1.8);
}

/* A faint pip above featured ticks — signals "more content here, click
   to see" without burning real estate on text. */
.timeline-shell .river-tick-pip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cat, var(--muted));
  opacity: 0.5;
  pointer-events: none;
}
.timeline-shell .river-tick:hover .river-tick-pip,
.timeline-shell .river-tick.is-active .river-tick-pip {
  opacity: 1;
  transform: translate(-50%, -6px) scale(1.4);
}

.timeline-shell .river-browser {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 34px;
  transform: translateY(-50%);
  z-index: 3;
  pointer-events: none;
}

.timeline-shell .river-browser-mark {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--blue), var(--ink) 20%);
  border-radius: 2px;
  background: color-mix(in srgb, var(--blue), white 82%);
  opacity: 0.76;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.timeline-shell .river-browser-mark:hover,
.timeline-shell .river-browser-mark:focus-visible,
.timeline-shell .river-browser-mark.is-active {
  opacity: 1;
  background: color-mix(in srgb, var(--blue), white 65%);
  transform: translate(-50%, -50%) rotate(45deg) scale(1.45);
}

.timeline-shell .river-audio {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  z-index: 2;
}

.timeline-shell .river-audio-dot {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cat, var(--muted));
  opacity: 0.7;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: opacity 140ms ease, transform 140ms ease;
}
.timeline-shell .river-audio-dot:hover,
.timeline-shell .river-audio-dot:focus-visible,
.timeline-shell .river-audio-dot.is-active {
  opacity: 1;
  transform: translateX(-50%) scale(1.6);
}
.timeline-shell .river-empty {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-style: italic;
  color: var(--muted);
  opacity: 0.55;
  font-size: 0.85rem;
}

/* Inline detail panel — populated when a tick is clicked. */
.timeline-shell .segment-detail {
  max-width: 1180px;
  margin: 0 auto 14px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--soft-line);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  min-height: 80px;
}
.timeline-shell .seg-detail-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 0.82rem;
  text-align: center;
  padding: 14px 0;
}
.timeline-shell .seg-detail-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.74rem;
  color: var(--muted);
}
.timeline-shell .seg-detail-time {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--ink);
  font-weight: 600;
}
.timeline-shell .seg-detail-cat {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat, var(--muted)), white 86%);
  color: var(--cat, var(--muted));
  border: 1px solid color-mix(in srgb, var(--cat, var(--muted)), white 60%);
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}
.timeline-shell .seg-detail-frame {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  opacity: 0.7;
}
.timeline-shell .seg-detail-desc {
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 10px;
}
.timeline-shell .seg-detail-content {
  margin-top: 8px;
  padding: 6px 0;
  border-top: 1px dashed var(--soft-line);
}
.timeline-shell .seg-detail-content-tag {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.timeline-shell .seg-detail-content-body {
  margin: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.4;
  max-height: 280px;
  overflow: auto;
}

/* Audio detail — three transcript lines (prev/focus/next) for context. */
.timeline-shell .seg-detail-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.timeline-shell .seg-detail-line {
  display: grid;
  grid-template-columns: 76px 32px 1fr auto;
  gap: 10px;
  padding: 4px 6px;
  font-size: 0.84rem;
  color: var(--muted);
  border-left: 2px solid transparent;
}
.timeline-shell .seg-detail-line.is-focus {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent), white 92%);
  border-left-color: var(--accent);
}
.timeline-shell .seg-detail-line-time {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  opacity: 0.85;
}
.timeline-shell .seg-detail-line-sp {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.65;
}
.timeline-shell .seg-detail-line-text {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-style: italic;
  line-height: 1.4;
}
.timeline-shell .seg-detail-line-emotion {
  font-size: 0.66rem;
  color: var(--muted);
  opacity: 0.7;
  text-transform: lowercase;
}

.timeline-shell .seg-browser-section {
  display: grid;
  gap: 8px;
}

.timeline-shell .seg-browser-section + .seg-browser-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--soft-line);
}

.timeline-shell .seg-browser-header {
  display: grid;
  gap: 2px;
}

.timeline-shell .seg-browser-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.2;
}

.timeline-shell .seg-browser-title {
  color: var(--muted);
  font-size: 0.74rem;
}

.timeline-shell .seg-browser-error {
  padding: 7px 9px;
  border-left: 3px solid var(--coral);
  background: color-mix(in srgb, var(--coral), white 90%);
  color: color-mix(in srgb, var(--coral), var(--ink) 40%);
  font-size: 0.78rem;
}

.timeline-shell .seg-browser-entry {
  padding: 8px 10px;
  border-left: 2px solid color-mix(in srgb, var(--blue), white 55%);
  background: color-mix(in srgb, var(--blue), white 96%);
}

.timeline-shell .seg-browser-entry.is-focus {
  border-left-color: var(--blue);
  background: color-mix(in srgb, var(--blue), white 90%);
}

.timeline-shell .seg-browser-entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.timeline-shell .seg-browser-markdown {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.45;
}

.timeline-shell .seg-browser-markdown p {
  margin: 0 0 6px;
}

.timeline-shell .seg-browser-markdown p:last-child {
  margin-bottom: 0;
}

.timeline-shell .seg-browser-markdown pre,
.timeline-shell .seg-browser-pre {
  margin: 6px 0 0;
  padding: 8px 10px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--soft-line);
  border-radius: 4px;
  white-space: pre-wrap;
}

.timeline-shell .segment-footer {
  max-width: 1180px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  opacity: 0.7;
}


.timeline-shell .edge-segment,
.timeline-shell .segment-focus-node {
  display: grid;
  place-items: center;
  border: 2px solid #11213d;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.timeline-shell .edge-segment {
  position: absolute;
  z-index: 4;
  top: var(--axis-top);
  width: 88px;
  height: 54px;
  border-radius: 8px;
  transform: translateY(-50%);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.94);
  font-size: 0.95rem;
}

.timeline-shell .edge-segment.timeline-prev {
  left: -22px;
}

.timeline-shell .edge-segment.timeline-next {
  right: -22px;
}

.timeline-shell .segment-focus-node {
  width: 124px;
  height: 62px;
  border-radius: 8px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.96);
  color: var(--accent);
  font-size: 0.96rem;
}

.timeline-shell .edge-segment:hover,
.timeline-shell .edge-segment:focus-visible,
.timeline-shell .segment-focus-node:hover,
.timeline-shell .segment-focus-node:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: 0;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.94),
    0 10px 24px rgba(16, 28, 52, 0.13);
}

.timeline-shell .edge-segment:hover,
.timeline-shell .edge-segment:focus-visible {
  transform: translateY(calc(-50% - 2px));
}

.timeline-shell .segment-focus-node:hover,
.timeline-shell .segment-focus-node:focus-visible {
  transform: translateY(-2px);
}

.timeline-shell .micro-lane {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 12px;
  width: min(calc(100% - 340px), 860px);
  align-items: end;
}

.timeline-shell .micro-lane.timeline-top {
  top: 108px;
}

.timeline-shell .micro-lane.timeline-bottom {
  top: 386px;
  align-items: start;
}

.timeline-shell .micro-cell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--soft-line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.92);
  color: #3d4654;
  appearance: none;
  cursor: pointer;
  font-size: clamp(0.64rem, 0.9vw, 0.82rem);
  font-weight: 780;
  padding: 0;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.timeline-shell .micro-cell:hover,
.timeline-shell .micro-cell:focus-visible {
  border-color: var(--accent);
  outline: 0;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(16, 28, 52, 0.12);
}

.timeline-shell .micro-cell.timeline-focus {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent), white 90%);
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.timeline-shell .micro-cell.timeline-focus::before,
.timeline-shell .micro-cell.timeline-focus::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.timeline-shell .micro-cell.timeline-focus::before {
  width: 2px;
  height: 22px;
  border-left: 2px dotted var(--accent);
}

.timeline-shell .micro-cell.timeline-focus::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-shell .micro-cell.timeline-focus.timeline-top::before {
  bottom: 49px;
}

.timeline-shell .micro-cell.timeline-focus.timeline-top::after {
  bottom: 70px;
}

.timeline-shell .micro-cell.timeline-focus.timeline-bottom::before {
  top: 49px;
}

.timeline-shell .micro-cell.timeline-focus.timeline-bottom::after {
  top: 70px;
}

.timeline-shell .micro-event {
  width: min(100%, 220px);
}

.timeline-shell .micro-event.timeline-top {
  align-self: end;
  margin-bottom: 18px;
}

.timeline-shell .micro-event.timeline-bottom {
  align-self: start;
  margin-top: 18px;
}

.timeline-shell .micro-time {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
}

.timeline-shell .micro-event h3 {
  font-size: 1rem;
}

.timeline-shell .micro-event p {
  font-size: 0.78rem;
}

@media (max-width: 768px) {
  .timeline-shell {
    width: min(100% - 28px, 520px);
    padding: 24px 0 34px;
  }

  .timeline-shell {
    overflow: visible;
    padding: 0;
  }

  .timeline-shell h2 {
    max-width: 18rem;
    font-size: 1.08rem;
  }

  .timeline-shell p {
    max-width: 24rem;
    font-size: 0.9rem;
  }

  .timeline-shell .month-view {
    display: block;
    min-width: 0;
    min-height: 0;
    overflow: visible;
  }

  .timeline-shell .month-view::before {
    display: none;
  }

  .timeline-shell .edge-node {
    position: static;
    display: inline-grid;
    width: 44px;
    height: 44px;
    margin: 0 8px 16px 0;
    transform: none;
    font-size: 0.68rem;
  }

  .timeline-shell .edge-node:hover,
  .timeline-shell .edge-node:focus-visible {
    transform: translateY(-2px);
  }

  .timeline-focus-panel {
    display: block;
    min-height: 0;
    padding: 0;
    padding-top: 0;
  }

  .timeline-focus-heading {
    position: static;
    transform: none;
    justify-items: start;
    margin: 4px 0 18px;
  }

  .timeline-focus-node {
    width: 58px;
    height: 58px;
    font-size: 0.88rem;
  }

  .timeline-shell .events-lane {
    position: static;
    display: block;
    transform: none;
    width: auto;
    min-width: 0;
  }

  .timeline-shell .day-event,
  .timeline-shell .day-event.timeline-top,
  .timeline-shell .day-event.timeline-bottom {
    width: 100%;
    margin: 0 0 18px;
  }

  .timeline-shell .day-grid {
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    width: 100%;
    min-width: 0;
    margin: 8px 0 24px;
  }

  .timeline-shell .day-cell {
    width: 100%;
  }

  .timeline-shell .day-cell.has-event::before,
  .timeline-shell .day-cell.has-event::after {
    display: none;
  }

  .timeline-shell .day-view {
    display: block;
    min-width: 0;
    min-height: 0;
    overflow: visible;
  }

  .timeline-shell .day-view::before {
    display: none;
  }

  .timeline-shell .edge-day {
    position: static;
    display: inline-grid;
    width: 50px;
    height: 38px;
    margin: 0 8px 16px 0;
    transform: none;
    font-size: 0.8rem;
  }

  .timeline-shell .edge-day:hover,
  .timeline-shell .edge-day:focus-visible {
    transform: translateY(-2px);
  }

  .timeline-shell .hour-panel {
    display: block;
    min-height: 0;
    padding: 0;
  }

  .timeline-shell .hour-lane {
    position: static;
    display: block;
    transform: none;
    width: auto;
    min-width: 0;
  }

  .timeline-shell .hour-event,
  .timeline-shell .hour-event.timeline-top,
  .timeline-shell .hour-event.timeline-bottom {
    width: 100%;
    margin: 0 0 18px;
  }

  .timeline-shell .hour-grid {
    position: static;
    grid-template-columns: repeat(6, minmax(34px, 1fr));
    transform: none;
    width: 100%;
    min-width: 0;
    margin: 8px 0 24px;
  }

  .timeline-shell .hour-cell {
    width: 100%;
  }

  .timeline-shell .hour-cell.has-hour-event::before,
  .timeline-shell .hour-cell.has-hour-event::after {
    display: none;
  }

  .timeline-shell .minute-view {
    display: block;
    min-width: 0;
    min-height: 0;
    overflow: visible;
  }

  .timeline-shell .minute-view::before {
    display: none;
  }

  .timeline-shell .edge-hour {
    position: static;
    display: inline-grid;
    width: 50px;
    height: 38px;
    margin: 0 8px 16px 0;
    transform: none;
    font-size: 0.8rem;
  }

  .timeline-shell .edge-hour:hover,
  .timeline-shell .edge-hour:focus-visible {
    transform: translateY(-2px);
  }

  .timeline-shell .minute-panel {
    display: block;
    min-height: 0;
    padding: 0;
  }

  .timeline-shell .minute-lane {
    position: static;
    display: block;
    transform: none;
    width: auto;
    min-width: 0;
  }

  .timeline-shell .minute-event,
  .timeline-shell .minute-event.timeline-top,
  .timeline-shell .minute-event.timeline-bottom {
    width: 100%;
    margin: 0 0 18px;
  }

  .timeline-shell .minute-grid {
    position: static;
    grid-template-columns: repeat(4, minmax(54px, 1fr));
    transform: none;
    width: 100%;
    min-width: 0;
    margin: 8px 0 24px;
  }

  .timeline-shell .segment-cell {
    width: 100%;
  }

  .timeline-shell .segment-cell.timeline-focus::before,
  .timeline-shell .segment-cell.timeline-focus::after {
    display: none;
  }

  .timeline-shell .segment-view {
    display: block;
    min-width: 0;
    min-height: 0;
    overflow: visible;
  }

  .timeline-shell .segment-view::before {
    display: none;
  }

  .timeline-shell .edge-segment {
    position: static;
    display: inline-grid;
    width: 68px;
    height: 38px;
    margin: 0 8px 16px 0;
    transform: none;
    font-size: 0.76rem;
  }

  .timeline-shell .edge-segment:hover,
  .timeline-shell .edge-segment:focus-visible {
    transform: translateY(-2px);
  }

  .timeline-shell .segment-panel {
    display: block;
    min-height: 0;
    padding: 0;
  }

  .timeline-shell .segment-header {
    margin-top: 4px;
    padding: 0;
  }

  .timeline-shell .seg-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .timeline-shell .segment-river,
  .timeline-shell .segment-detail,
  .timeline-shell .segment-footer {
    width: 100%;
    max-width: none;
  }

  .timeline-shell .segment-detail {
    padding: 12px;
  }

  .timeline-shell .seg-detail-line {
    grid-template-columns: 64px 28px 1fr;
  }

  .timeline-shell .seg-detail-line-emotion {
    display: none;
  }

  .timeline-shell .micro-lane {
    position: static;
    display: block;
    transform: none;
    width: auto;
    min-width: 0;
  }

  .timeline-shell .micro-event,
  .timeline-shell .micro-event.timeline-top,
  .timeline-shell .micro-event.timeline-bottom {
    width: 100%;
    margin: 0 0 18px;
  }

  .timeline-shell .micro-cell {
    width: 100%;
  }

  .timeline-shell .micro-cell.timeline-focus::before,
  .timeline-shell .micro-cell.timeline-focus::after {
    display: none;
  }
}

.timeline-shell .timeline-origin-chip {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

.timeline-shell .timeline-origin-chip:hover,
.timeline-shell .timeline-origin-chip:focus {
  text-decoration: underline;
}

.timeline-shell .timeline-day-provenance {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}
