.lifeos-timeline {
  --timeline-navy: #162c45;
  --timeline-gold: #b99761;
  display: grid;
  min-width: 0;
  gap: 1rem;
}

#root .lifeos-timeline .lifeos-timeline-hero {
  min-height: 0;
  padding: clamp(1.15rem, 3vw, 2.25rem);
  border: 1px solid var(--timeline-gold);
  border-radius: 1.1rem;
  background: linear-gradient(110deg, #101f34, #1c3954 75%, #36536a);
  box-shadow: inset 0 1px #e5cb9866, 0 10px 24px #13294321;
  color: #fff6e3;
}

#root .lifeos-timeline-hero h1 { margin: 0; color: inherit; }

.lifeos-timeline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem 1.25rem;
}

.lifeos-timeline-period,
.lifeos-timeline-filters {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

.lifeos-timeline-range { color: var(--timeline-navy); font-weight: 650; }
.lifeos-timeline-filters { gap: .6rem 1rem; }
.lifeos-timeline-filters label { display: grid; gap: .2rem; font-size: .85rem; font-weight: 650; }
.lifeos-timeline-filters :is(input, select) {
  min-height: 2.55rem;
  padding: .35rem .6rem;
  border: 1px solid #bda578;
  border-radius: .5rem;
  background: #fffdf8;
  color: var(--timeline-navy);
  font: inherit;
}

.lifeos-timeline-coverage { flex: 1 0 100%; margin: 0; font-size: .9rem; }
.lifeos-timeline-notice { display: grid; justify-items: start; gap: .45rem; }
.lifeos-timeline :is(.lifeos-timeline-notice, .lifeos-timeline-empty) a { text-decoration: underline; }

.lifeos-timeline-rail {
  --timeline-marker: 2.65rem;
  position: relative;
  display: grid;
  gap: 1.25rem;
  margin: .3rem 0 0;
  padding: 0;
  list-style: none;
}

.lifeos-timeline-rail::before {
  content: "";
  position: absolute;
  inset-block: calc(var(--timeline-marker) / 2) .2rem;
  inset-inline-start: calc(var(--timeline-marker) / 2);
  width: 1px;
  background: linear-gradient(var(--timeline-gold) 22%, #7d97ac 74%, #7d97ac30);
}

.lifeos-timeline-day {
  position: relative;
  display: grid;
  grid-template-columns: var(--timeline-marker) minmax(0, 1fr);
  align-items: start;
  gap: clamp(.65rem, 1.4vw, 1.1rem);
}

.lifeos-timeline-marker {
  display: grid;
  width: var(--timeline-marker);
  height: var(--timeline-marker);
  place-items: center;
  border: 1px solid #718ca5;
  border-radius: 50%;
  background: var(--timeline-navy);
  color: #f6e7ca;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lifeos-timeline-day[data-today="true"] .lifeos-timeline-marker {
  border-color: var(--timeline-gold);
  background: linear-gradient(135deg, #f8e9c8, #d7b475);
  color: var(--timeline-navy);
}

#root .lifeos-timeline-day-content h2 {
  display: flex;
  min-height: var(--timeline-marker);
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .7rem;
  margin: 0 0 .35rem;
  color: var(--timeline-navy);
  font-size: clamp(1.45rem, 2.5vw, 2.05rem);
}

.lifeos-timeline-today {
  border: 1px solid #c6a36a;
  border-radius: 2rem;
  padding: .14rem .55rem;
  background: #fbf0d7;
  color: #67491d;
  font: 700 .78rem/1.3 var(--lifeos-sans, sans-serif);
}

#root .lifeos-timeline-items { margin: 0; padding: 0; list-style: none; border-color: #c3a674; }
.lifeos-timeline-items li + li { border-top: 1px solid #e1d5bf; }
.lifeos-timeline-row {
  display: grid;
  grid-template-columns: 5.1rem minmax(0, 1fr) minmax(5rem, auto) auto;
  align-items: baseline;
  gap: .3rem .75rem;
  padding: .65rem .8rem;
  color: var(--timeline-navy);
  text-decoration: none;
}

.lifeos-timeline-row strong { overflow-wrap: anywhere; }
.lifeos-timeline-row :is(.lifeos-timeline-row-time, .lifeos-timeline-row-source) { color: #4c6177; font-size: .84rem; }
.lifeos-timeline-row:hover { background: #f7ecd7; }
.lifeos-timeline :is(a, button, input, select):focus-visible { outline: 2px solid #7b551b; outline-offset: 2px; }
.lifeos-timeline-row:focus-visible { outline-offset: -2px; }

@media (max-width: 560px) {
  .lifeos-timeline-rail { --timeline-marker: 2rem; }
  .lifeos-timeline-row { grid-template-columns: minmax(0, 1fr) auto; }
  .lifeos-timeline-row strong { grid-column: 1; grid-row: 2; }
  .lifeos-timeline-row > :last-child { grid-column: 2; grid-row: 2; }
  .lifeos-timeline-row-source { justify-self: end; }
  .lifeos-timeline-controls :is(button, input, select) { min-height: 2.75rem; }
}
