/* ─── Page shell ─────────────────────────────────────────────────────────── */
body {
  overflow: hidden;
  height: 100vh;
}

.tl-header {
  justify-content: space-between;
  flex-wrap: nowrap;
}

.tl-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--font-body);
  text-decoration: none;
  flex-shrink: 0;
  transition: all var(--transition);
  white-space: nowrap;
}
.tl-back-btn:hover { border-color: var(--border-h); color: var(--text); text-decoration: none; }

/* ─── Scroll container ───────────────────────────────────────────────────── */
.tl-scroll-outer {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.tl-scroll-outer.dragging { cursor: grabbing; user-select: none; }
.tl-scroll-outer::-webkit-scrollbar       { height: 6px; width: 6px; }
.tl-scroll-outer::-webkit-scrollbar-track { background: transparent; }
.tl-scroll-outer::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── Track ──────────────────────────────────────────────────────────────── */
.tl-track {
  display: flex;
  align-items: flex-start;
  padding: 36px 80px 120px 80px;
  min-width: max-content;
}

/* ─── Patch column ───────────────────────────────────────────────────────── */
.tl-patch-col {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Era label row — always reserves the same height so dots align */
.tl-era-slot {
  height: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 10px;
}

.tl-era-pill {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dimmer);
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  white-space: nowrap;
  visibility: hidden;
}
.tl-patch-col.era-start .tl-era-pill { visibility: visible; }

/* Era-specific pill accent colours */
.tl-patch-col.era-ac.era-start    .tl-era-pill { color: #ffb74d; border-color: rgba(255,183,77,0.35); }
.tl-patch-col.era-a2.era-start    .tl-era-pill { color: #4fc3f7; border-color: rgba(79,195,247,0.35); }
.tl-patch-col.era-a3.era-start    .tl-era-pill { color: var(--green); border-color: rgba(61,214,140,0.35); }
.tl-patch-col.era-a4.era-start    .tl-era-pill { color: #ce93d8; border-color: rgba(206,147,216,0.35); }

.tl-patch-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  line-height: 1.3;
}

.tl-patch-date {
  font-size: 10px;
  color: var(--text-dimmer);
  margin-top: 3px;
  margin-bottom: 8px;
  text-align: center;
}

/* ─── Horizontal line + dot ──────────────────────────────────────────────── */
.tl-line-row {
  display: flex;
  align-items: center;
  width: 100%;
  height: 16px;
}

.tl-line {
  flex: 1;
  height: 2px;
  background: var(--border);
}
.tl-line.fade-l { background: linear-gradient(to right, transparent 0%, var(--border) 60%); }
.tl-line.fade-r { background: linear-gradient(to right, var(--border) 40%, transparent 100%); }

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  flex-shrink: 0;
  z-index: 1;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(0,168,255,0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Era dot colours */
.era-ac .tl-dot { background: #ffb74d; box-shadow: 0 0 8px rgba(255,183,77,0.5); }
.era-a2 .tl-dot { background: #4fc3f7; box-shadow: 0 0 8px rgba(79,195,247,0.5); }
.era-a3 .tl-dot { background: var(--green); box-shadow: 0 0 8px rgba(61,214,140,0.5); }
.era-a4 .tl-dot { background: #ce93d8; box-shadow: 0 0 8px rgba(206,147,216,0.5); }

/* gap columns between eras */
.tl-era-gap {
  width: 48px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tl-era-gap .tl-era-slot  { visibility: hidden; }
.tl-era-gap .tl-gap-info  {
  height: 39px; /* patch-name + patch-date height */
  margin-bottom: 8px;
}
.tl-era-gap .tl-gap-line  {
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, var(--border), transparent 40%, transparent 60%, var(--border));
  margin-top: 7px; /* centres it with the dots */
}

/* ─── Connector + chips ──────────────────────────────────────────────────── */
.tl-connector {
  width: 2px;
  height: 10px;
  background: var(--border);
}

.tl-ships {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  width: 100%;
  padding: 0 6px;
  margin-top: 2px;
}

.tl-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 11px;
  color: var(--text-dim);
  transition: all var(--transition);
  text-align: left;
  width: 100%;
}
.tl-chip:hover  { border-color: var(--border-h);   color: var(--text);   background: var(--bg-card-h); }
.tl-chip.active { border-color: var(--border-acc); color: var(--accent); background: var(--accent-glow); }

.tl-chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.tl-chip.waiting .tl-chip-dot { background: var(--amber); }

.tl-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

/* ─── Unreleased zone ────────────────────────────────────────────────────── */
.tl-unreleased-col {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: 48px;
}

.tl-unreleased-col .tl-era-slot { visibility: visible; }
.tl-unreleased-col .tl-era-pill {
  visibility: visible;
  color: var(--amber);
  border-color: rgba(255,183,77,0.35);
  border-style: dashed;
}

.tl-unreleased-desc {
  font-size: 10px;
  color: var(--text-dimmer);
  font-style: italic;
  text-align: center;
  line-height: 1.4;
  height: 39px; /* matches patch-name + patch-date height */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  padding: 0 8px;
}

.tl-unreleased-line-row {
  display: flex;
  align-items: center;
  width: 100%;
  height: 16px;
}

.tl-unreleased-left {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--border) 0%, rgba(255,183,77,0.3) 100%);
}

.tl-unreleased-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 183, 77, 0.6);
  background: rgba(255, 183, 77, 0.05);
  flex-shrink: 0;
}

.tl-unreleased-right {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, rgba(255,183,77,0.3) 0%, transparent 80%);
}

/* ─── Info bar ───────────────────────────────────────────────────────────── */
.tl-info-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-acc);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
  padding: 16px 56px 20px 28px;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
}
.tl-info-bar.open { transform: translateY(0); }

.tl-info-close {
  position: absolute;
  top: 14px;
  right: 18px;
  color: var(--text-dimmer);
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 3px;
  line-height: 1;
  transition: color var(--transition);
}
.tl-info-close:hover { color: var(--text); }

.tl-info-content {
  display: flex;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}

.tl-info-ship { min-width: 160px; }
.tl-info-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.tl-info-mfr {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
}

.tl-info-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tl-info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dimmer);
  font-weight: 600;
}
.tl-info-value {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tl-info-patch {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0,168,255,0.1);
  color: var(--accent);
  border: 1px solid rgba(0,168,255,0.2);
  border-radius: 4px;
  padding: 1px 7px;
}
.tl-info-delta {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}
.tl-info-delta.flyable { color: var(--accent); }
.tl-info-delta.waiting { color: var(--amber); }
.tl-info-delta-sub {
  font-size: 11px;
  color: var(--text-dimmer);
  margin-top: 1px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .tl-patch-col  { width: 130px; }
  .tl-track      { padding: 28px 40px 120px; }
  .tl-info-bar   { padding: 14px 48px 18px 18px; }
  .tl-info-content { gap: 20px; }
  .tl-info-name  { font-size: 15px; }
  .tl-info-delta { font-size: 16px; }
}
