/* MiCerebro — Cronología dispersa. Solo existe el tiempo que contiene memoria. */
.life-timeline {
  --tl-bg: #020711;
  --tl-panel: rgba(7, 16, 32, .94);
  --tl-card: rgba(10, 22, 43, .88);
  --tl-line: rgba(92, 157, 223, .18);
  --tl-text: #f3f8ff;
  --tl-soft: #bdcbe0;
  --tl-muted: #7889a5;
  --tl-cyan: #31d7ef;
  --tl-violet: #8f73ff;
  --tl-amber: #ffb064;
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  grid-template-rows: auto 1fr;
  color: var(--tl-text);
  background:
    radial-gradient(780px 480px at 18% -8%, rgba(38, 145, 255, .12), transparent 70%),
    radial-gradient(640px 520px at 100% 32%, rgba(126, 75, 255, .09), transparent 72%),
    linear-gradient(155deg, #02050c, var(--tl-bg) 52%, #030612);
  font-family: Inter, Sora, system-ui, sans-serif;
}
.life-timeline[hidden] { display: none !important; }
.life-timeline *, .life-timeline *::before, .life-timeline *::after { box-sizing: border-box; }
.life-timeline button { font: inherit; }

.tl-head {
  min-height: 78px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: max(13px, env(safe-area-inset-top)) clamp(14px, 2.5vw, 34px) 13px;
  border-bottom: 1px solid rgba(99, 139, 205, .14);
  background: rgba(2, 8, 19, .84);
  backdrop-filter: blur(24px) saturate(130%);
}
.tl-back, .tl-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(90, 153, 218, .22);
  border-radius: 14px;
  color: #ddecff;
  background: rgba(9, 22, 43, .82);
  cursor: pointer;
}
.tl-back[hidden] { visibility: hidden; display: block !important; }
.tl-title { min-width: 0; }
.tl-title h1 { margin: 0; color: #f7fbff; font: 600 clamp(20px, 2.6vw, 28px)/1.12 Sora, sans-serif; letter-spacing: -.025em; }
.tl-title p { margin: 5px 0 0; overflow: hidden; color: var(--tl-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.tl-head-actions { display: flex; align-items: center; gap: 8px; }
.tl-map-button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(49, 200, 239, .23);
  border-radius: 13px;
  color: #bdefff;
  background: rgba(8, 68, 94, .35);
  cursor: pointer;
}

.tl-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  overflow: hidden;
}
.tl-rail {
  min-height: 0;
  overflow: auto;
  padding: 18px 13px 28px;
  border-right: 1px solid rgba(99, 139, 205, .12);
  background: rgba(3, 10, 23, .68);
  scrollbar-width: thin;
}
.tl-rail-intro { margin: 3px 5px 16px; }
.tl-rail-intro b { display: block; color: #eaf5ff; font: 600 11px Sora, sans-serif; }
.tl-rail-intro span { display: block; margin-top: 5px; color: #697b97; font-size: 10px; line-height: 1.45; }
.tl-year-list { display: grid; gap: 7px; }
.tl-year {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: #9babc1;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.tl-year:hover, .tl-year.active {
  color: #edf8ff;
  border-color: rgba(55, 196, 239, .23);
  background: linear-gradient(135deg, rgba(8, 78, 115, .44), rgba(43, 37, 112, .36));
}
.tl-year b { color: inherit; font: 600 18px Sora, sans-serif; }
.tl-year small { display: block; margin-top: 3px; color: #6f819d; font-size: 9px; }
.tl-year strong { color: #57d8f1; font: 600 12px Sora, sans-serif; }

.tl-main {
  min-height: 0;
  overflow: auto;
  padding: clamp(18px, 3vw, 36px) clamp(14px, 3.2vw, 44px) 70px;
  scroll-behavior: smooth;
}
.tl-overview { max-width: 1080px; margin: 0 auto; }
.tl-kicker { color: #54d8f2; font: 600 9px/1 Sora, sans-serif; letter-spacing: .15em; text-transform: uppercase; }
.tl-overview h2 { margin: 9px 0 5px; color: #f4f9ff; font: 600 clamp(22px, 3vw, 34px)/1.15 Sora, sans-serif; letter-spacing: -.03em; }
.tl-overview > p { margin: 0 0 22px; max-width: 720px; color: #8191aa; font-size: 12px; line-height: 1.55; }

.tl-month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.tl-month {
  min-height: 126px;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--tl-line);
  border-radius: 20px;
  color: var(--tl-soft);
  background: linear-gradient(145deg, rgba(12, 27, 52, .88), rgba(5, 13, 28, .90));
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.tl-month::after {
  content: "";
  position: absolute;
  width: 150px; height: 150px; right: -70px; top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(44, 206, 239, .15), transparent 68%);
}
.tl-month:hover { border-color: rgba(55, 208, 240, .39); transform: translateY(-1px); }
.tl-month h3 { margin: 0; color: #eef8ff; font: 600 16px Sora, sans-serif; }
.tl-month p { margin: 4px 0 0; color: #71829e; font-size: 10px; }
.tl-month-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border: 1px solid rgba(75, 160, 219, .16); border-radius: 999px; color: #88a5c2; background: rgba(7, 25, 43, .55); font-size: 9px; }
.tl-pill.planned { color: #ffd29e; border-color: rgba(255, 174, 87, .22); background: rgba(98, 58, 16, .24); }

.tl-days { max-width: 930px; margin: 0 auto; position: relative; }
.tl-days::before { content: ""; position: absolute; left: 47px; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(#31d7ef44, #7d6cff2c, transparent); }
.tl-day {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 18px;
  padding: 0 0 23px;
}
.tl-day:last-child { padding-bottom: 0; }
.tl-day-marker { position: relative; z-index: 2; align-self: start; text-align: center; }
.tl-day-marker::before { content: ""; position: absolute; left: 50%; top: 23px; width: 11px; height: 11px; border: 2px solid #65dff4; border-radius: 50%; background: #061422; box-shadow: 0 0 18px rgba(49, 215, 239, .35); transform: translateX(-50%); }
.tl-day-marker b { display: block; color: #eaf8ff; font: 600 19px Sora, sans-serif; }
.tl-day-marker span { display: block; margin-top: 29px; color: #657893; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.tl-day-content { min-width: 0; display: grid; gap: 8px; }
.tl-entry {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid rgba(93, 148, 210, .15);
  border-radius: 17px;
  color: #d5e2f3;
  background: linear-gradient(145deg, rgba(10, 24, 46, .88), rgba(5, 13, 28, .88));
}
.tl-entry[data-phase="planned"] { border-color: rgba(255, 174, 87, .22); background: linear-gradient(145deg, rgba(51, 34, 21, .74), rgba(11, 17, 29, .90)); }
.tl-entry[data-phase="agenda_past"] { opacity: .73; border-style: dashed; }
.tl-entry-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(57, 200, 237, .23); border-radius: 14px; color: #8cecff; background: rgba(8, 74, 98, .28); font-size: 19px; }
.tl-entry[data-phase="planned"] .tl-entry-icon { color: #ffd09b; border-color: rgba(255, 174, 87, .25); background: rgba(105, 64, 20, .24); }
.tl-entry-copy { min-width: 0; }
.tl-entry-copy b { display: block; overflow-wrap: anywhere; color: #eff7ff; font-size: 12px; }
.tl-entry-copy p { margin: 4px 0 0; overflow-wrap: anywhere; color: #8798b1; font-size: 10.5px; line-height: 1.45; }
.tl-entry-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.tl-entry-meta span { color: #69809c; font-size: 8.5px; }
.tl-entry-time { padding-top: 2px; color: #7991ad; font: 500 9px Sora, sans-serif; white-space: nowrap; }
.tl-entry-phase { display: inline-flex; align-items: center; min-height: 22px; margin-top: 6px; padding: 0 7px; border-radius: 999px; color: #9ab4ce; background: rgba(27, 48, 74, .52); font-size: 8px; }
.tl-entry[data-phase="planned"] .tl-entry-phase { color: #ffd19b; background: rgba(105, 64, 20, .35); }
.tl-load-more { width: min(100%, 480px); min-height: 45px; display: block; margin: 19px auto 0; border: 1px solid rgba(49, 200, 239, .24); border-radius: 14px; color: #bfefff; background: rgba(8, 61, 86, .38); cursor: pointer; }
.tl-empty { max-width: 540px; margin: 15vh auto 0; padding: 24px; border: 1px solid rgba(92, 157, 223, .16); border-radius: 20px; color: #7c8ea8; background: rgba(7, 16, 32, .72); text-align: center; }
.tl-empty b { display: block; margin-bottom: 7px; color: #edf7ff; font: 600 16px Sora, sans-serif; }
.tl-loading { padding: 18vh 20px 20px; color: #7f91ad; text-align: center; }

.tl-neuromap-switch {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(60, 197, 235, .26);
  border-radius: 999px;
  color: #bdefff !important;
  background: rgba(5, 54, 75, .54) !important;
  cursor: pointer;
}

@media (max-width: 900px) {
  .tl-body { grid-template-columns: 190px minmax(0, 1fr); }
  .tl-month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .life-timeline { grid-template-rows: auto 1fr; }
  .tl-head { min-height: 68px; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 9px 8px; }
  .tl-title h1 { font-size: 17px; }
  .tl-title p { font-size: 9px; }
  .tl-map-button { display: none; }
  .tl-close { width: 44px; min-width: 44px; padding: 0; }
  .tl-body { display: block; overflow: hidden; }
  .tl-rail {
    position: absolute;
    z-index: 4;
    left: 0; right: 0; top: 68px;
    min-height: 0;
    height: auto;
    overflow: auto hidden;
    display: flex;
    padding: 7px 9px;
    border: 0;
    border-bottom: 1px solid rgba(99, 139, 205, .11);
    background: rgba(3, 10, 23, .92);
    backdrop-filter: blur(18px);
  }
  .tl-rail-intro { display: none; }
  .tl-year-list { display: flex; gap: 6px; }
  .tl-year { width: auto; min-width: 90px; min-height: 44px; display: flex; gap: 8px; padding: 6px 9px; border-radius: 12px; }
  .tl-year b { font-size: 13px; }
  .tl-year small { display: none; }
  .tl-year strong { font-size: 10px; }
  .tl-main { height: 100%; padding: 68px 10px calc(32px + env(safe-area-inset-bottom)); }
  .tl-overview h2 { font-size: 22px; }
  .tl-overview > p { font-size: 10.5px; }
  .tl-month-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tl-month { min-height: 105px; padding: 12px; border-radius: 16px; }
  .tl-month h3 { font-size: 13px; }
  .tl-pill { min-height: 22px; padding-inline: 6px; font-size: 8px; }
  .tl-days::before { left: 30px; }
  .tl-day { grid-template-columns: 49px minmax(0, 1fr); gap: 9px; padding-bottom: 17px; }
  .tl-day-marker::before { top: 20px; width: 9px; height: 9px; }
  .tl-day-marker b { font-size: 15px; }
  .tl-day-marker span { margin-top: 25px; font-size: 7px; }
  .tl-entry { grid-template-columns: 36px minmax(0, 1fr); gap: 9px; padding: 10px; border-radius: 15px; }
  .tl-entry-icon { width: 36px; height: 36px; border-radius: 12px; font-size: 16px; }
  .tl-entry-time { grid-column: 2; padding: 0; }
  .tl-entry-copy b { font-size: 11px; }
  .tl-entry-copy p { font-size: 9.5px; }
}

@media (max-width: 390px) {
  .tl-month-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .life-timeline *, .life-timeline *::before, .life-timeline *::after { transition: none !important; scroll-behavior: auto !important; }
}
