/* EYE · timeline — the mission dock. One x-scale for lanes, CRI band and axis. */

.tl {
  height: 100%;
  display: grid;
  grid-template-columns: var(--dock-left-w) minmax(0, 1fr) var(--dock-right-w);
  min-width: 0;
}

/* ─── Left: clock, transport, status ──────────────────────────────────────── */
.tl-left {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 6px 10px 6px 12px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.tl-clock { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.tl-clock__t { font: 500 19px/1 var(--mono); letter-spacing: 0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.tl-clock__day { font: 600 10.5px/1 var(--mono); letter-spacing: 0.1em; color: var(--blue-2); }
.tl-clock__len { font: 500 10.5px/1 var(--mono); color: var(--muted); }
.tl.is-empty .tl-clock__t, .tl.is-empty .tl-clock__day { color: var(--faint); }

.tl-transport { display: flex; align-items: center; gap: 2px; }
.tl-btn {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm);
  color: var(--ink-2); transition: background var(--t-fast), color var(--t-fast);
}
.tl-btn:hover:not(:disabled) { background: var(--bg-3); color: var(--ink); }
.tl-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.tl-btn svg { width: 14px; height: 14px; }
.tl-btn--edge svg { width: 13px; height: 13px; }
.tl-btn--play { width: 34px; height: 30px; background: var(--blue-a); color: var(--blue-2); border: 1px solid rgba(88, 166, 255, 0.4); margin: 0 2px; }
.tl-btn--play:hover:not(:disabled) { background: rgba(88, 166, 255, 0.24); color: #fff; }
.tl-btn--play.is-on { background: var(--blue); color: #06101c; border-color: var(--blue); }
.tl-btn--play svg { width: 15px; height: 15px; }
.tl-speed {
  margin-left: 6px; height: 24px; min-width: 34px; padding: 0 6px; border-radius: 4px;
  border: 1px solid var(--line-2); color: var(--ink-2); font: 600 var(--fs-xs)/1 var(--mono);
}
.tl-speed:hover, .tl-speed[aria-expanded='true'] { border-color: var(--line-strong); color: var(--ink); background: var(--bg-3); }

.tl-status { display: flex; align-items: center; gap: 6px; min-height: 20px; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; }
.tl-status .spinner { width: 11px; height: 11px; border-width: 1.5px; }
.tl-st { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.tl-hint { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; }
.tl-live { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-xs)/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-2); }
.tl-live__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); animation: hud-live 1.6s ease-out infinite; }
.tl-golive { height: 20px; padding: 0 7px; }
.tl-stale { cursor: pointer; }
.tl-status .chip { height: 18px; }

/* ─── Centre: lanes, CRI band, axis ───────────────────────────────────────── */
.tl-center {
  position: relative;
  display: grid; grid-template-columns: 34px minmax(0, 1fr);
  padding: 6px 14px 4px 4px;
  min-width: 0;
}
.tl-center.is-focus .tl-scale { box-shadow: 0 0 0 2px var(--blue); border-radius: 3px; }
.tl-gutter { display: grid; grid-template-rows: 14px 14px 36px 1fr; padding-top: 4px; }
.tl-gl { font: 600 8.5px/14px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); text-align: right; padding-right: 6px; }
.tl-gl--cri { line-height: 36px; }

.tl-scale {
  position: relative;
  display: grid; grid-template-rows: 4px 28px 36px minmax(22px, 1fr);
  min-width: 0; cursor: pointer; touch-action: none; user-select: none;
}
.tl.is-empty .tl-scale { cursor: default; }
.tl.is-scrubbing .tl-scale { cursor: ew-resize; }
.tl-head { grid-row: 1; }
.tl-lanes, .tl-cri, .tl-axis { position: relative; min-width: 0; }
.tl-lanes { grid-row: 2; }
.tl-cri { grid-row: 3; background: rgba(160, 190, 220, 0.03); border-radius: 2px; }
.tl-axis { grid-row: 4; }
.tl-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.tl-cri__empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: 0.08em; color: var(--faint);
  pointer-events: none;
}

/* SVG strokes */
.tl-grid { stroke: rgba(160, 190, 220, 0.09); stroke-width: 1; }
.tl-rowrule { stroke: rgba(160, 190, 220, 0.08); stroke-width: 1; stroke-dasharray: 2 3; }
.tl-reassess { fill: rgba(160, 190, 220, 0.25); }
.tl-reassess.is-esc { fill: #d36fd8; }
.tl-link { fill: none; stroke: #d36fd8; stroke-width: 1; opacity: 0.75; stroke-dasharray: 2 2; }
.tl-s-good { stop-color: var(--good); }
.tl-s-warn { stop-color: var(--warn); }
.tl-s-bad { stop-color: var(--bad); }
.tl-hatch { stroke: rgba(160, 190, 220, 0.18); stroke-width: 1.5; }
.tl-guide { stroke: rgba(160, 190, 220, 0.16); stroke-width: 1; stroke-dasharray: 3 3; }
.tl-guide-lbl { font: 500 7.5px var(--mono); fill: var(--faint); }
.tl-cri-area { fill: url(#tl-cri-grad); opacity: 0.16; }
.tl-cri-line { fill: none; stroke: url(#tl-cri-grad); stroke-width: 1.75; stroke-linejoin: round; }
.tl-cri-pending { fill: url(#tl-hatch); }
.tl-cri-prev { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.tl-prev-lbl { font: 600 8px var(--mono); fill: var(--muted); letter-spacing: 0.06em; }
.tl-base { stroke: var(--line-strong); stroke-width: 1; }
.tl-tick { stroke: rgba(160, 190, 220, 0.35); stroke-width: 1; }
.tl-tick.is-major { stroke: rgba(160, 190, 220, 0.7); }
.tl-lbl { font: 500 9px var(--mono); fill: var(--muted); letter-spacing: 0.04em; }
.tl-lbl.is-major { fill: var(--ink-2); font-weight: 600; }

/* Markers */
.tl-mks { position: absolute; inset: 0; pointer-events: none; }
.tl-mk {
  position: absolute; top: 0; transform: translateX(-50%);
  display: grid; place-items: center;
  width: 14px; height: 14px; padding: 0; border-radius: 3px;
  pointer-events: auto; cursor: pointer;
  color: var(--muted);
}
.tl-mk.row-act { top: 14px; }
.tl-mk:hover, .tl-mk:focus-visible { background: var(--bg-4); z-index: 2; }
.tl-mk svg { overflow: visible; }
.tl-mk svg path { fill: currentColor; }
.tl-mk svg .tl-stroke, .tl-tip__shape svg .tl-stroke { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tl-mk svg .tl-x, .tl-tip__shape svg .tl-x { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.tl-mk--plan svg path { fill: none; stroke: var(--red); stroke-width: 1.3; }
.tl-mk--plan.is-landed svg path { stroke: rgba(248, 81, 73, 0.55); }
.tl-mk--plan.is-aborted svg path, .tl-mk--plan.is-pending svg path { stroke: var(--muted); }
.tl-mk--strike { color: var(--red); }
.tl-mk--strike.is-miss svg path { fill: none; stroke: var(--red); stroke-width: 1.3; }
.tl-mk--strike.is-reactive { color: #d36fd8; }
.tl-mk--strike.is-reactive.is-miss svg path { stroke: #d36fd8; }
.tl-mk--aborted { color: var(--muted); }
.tl-mk--esc { color: #d36fd8; }
.tl-mk--loss { color: var(--red); }
.tl-mk--damage { color: var(--amber-2); }
.tl-mks--flags .tl-mk { top: 1px; height: 13px; }
.tl-mk--moment { color: var(--muted); }
.tl-mk--moment.sev-critical { color: var(--red); }
.tl-mk--moment.sev-warning { color: var(--amber-2); }
.tl-mk--moment.sev-info { color: var(--blue-2); }
.tl-mk--bookmark { color: var(--ink); }
.tl-mk--n {
  width: auto; min-width: 16px; height: 13px; padding: 0 3px; border-radius: 7px;
  font: 700 8.5px/1 var(--mono); color: var(--ink);
  background: var(--bg-4); border: 1px solid var(--line-strong);
}
.tl-mks--flags .tl-mk--n { top: 0; }
.tl-mk--n.tl-tone-red { border-color: rgba(248, 81, 73, 0.7); color: #ffb3ad; }
.tl-mk--n.tl-tone-reactive { border-color: rgba(211, 111, 216, 0.7); color: #eab3ee; }
.tl-mk--n.tl-tone-amber { border-color: rgba(227, 179, 65, 0.6); color: var(--amber-2); }

/* Playhead & future veil */
.tl-veilclip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: 2px; }
.tl-veil { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; background: rgba(7, 10, 14, 0.42); will-change: transform; }
.tl.is-empty .tl-veil, .tl.is-live .tl-veil { display: none; }
.tl-ph {
  position: absolute; top: 0; bottom: 0; left: -1px; width: 2px;
  background: var(--ink); pointer-events: none; will-change: transform;
  box-shadow: 0 0 0 1px rgba(7, 10, 14, 0.6);
}
.tl-ph__head {
  position: absolute; top: -3px; left: 50%; width: 12px; height: 12px; margin-left: -6px;
  border-radius: 3px 3px 6px 6px; background: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.tl.is-empty .tl-ph { opacity: 0; }
.tl.is-live .tl-ph { background: var(--blue-2); }
.tl.is-live .tl-ph__head { background: var(--blue-2); }
.tl-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; pointer-events: none; -webkit-appearance: none; appearance: none;
}

/* ─── Right: instruments at the playhead ──────────────────────────────────── */
.tl-right { min-width: 0; border-left: 1px solid var(--line); }
.tl-inst {
  height: 100%;
  display: grid; grid-template-columns: 94px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 24px;
  gap: 4px 10px; padding: 7px 12px 7px 10px;
}
.tl-inst--loading { display: flex; align-items: center; justify-content: center; gap: 8px; }
.tl-k { font: 600 9px/1 var(--mono); letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); }
.tl-cri-k {
  --tone: var(--ink);
  grid-row: 1; grid-column: 1;
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  text-align: left; padding: 2px 4px; margin: -2px -4px; border-radius: var(--r-sm);
}
button.tl-cri-k:hover { background: var(--bg-3); }
.tl-cri-k__v { font: 500 25px/1 var(--mono); color: var(--tone); letter-spacing: -0.02em; }
.tl-cri-k__v small { font-size: 12px; margin-left: 1px; color: var(--tone); opacity: 0.8; }
.tl-cri-k.tone-good { --tone: var(--good); }
.tl-cri-k.tone-warn { --tone: var(--warn); }
.tl-cri-k.tone-bad { --tone: var(--bad); }
.tl-cri-k.tone-muted, .tl-cri-k--plan { --tone: var(--ink); }
.tl-cri-k__d { display: flex; flex-direction: column; gap: 1px; }
.tl-delta { font: 500 9px/1.2 var(--mono); color: var(--muted); white-space: nowrap; }
.tl-delta b { font-weight: 700; }
.tl-delta.tone-good b { color: var(--good); }
.tl-delta.tone-bad b { color: var(--bad); }

.tl-lines { grid-row: 1; grid-column: 2; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.tl-line {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 6px;
  height: 16px; font-size: var(--fs-xs); color: var(--ink-2); min-width: 0; text-align: left;
}
.tl-line--btn { border-radius: 3px; padding: 0 3px; margin: 0 -3px; }
.tl-line--btn:hover:not(:disabled) { background: var(--bg-3); }
.tl-line--btn:disabled { cursor: default; }
.tl-line--btn.is-cycling { box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.35); }
.tl-line__k { font: 600 8.5px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.tl-line__v { display: flex; align-items: baseline; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; }
.tl-line__v b { font: 600 11px/1 var(--mono); color: var(--ink); }
.tl-line__v b.is-bad { color: var(--bad); }
.tl-line__v .muted { font-size: 9.5px; }
.tl-dmg { font: 600 9px/1 var(--mono); color: var(--amber-2); margin-left: 2px; }
.tl-pip { display: inline-flex; align-items: center; gap: 1px; font: 600 9px/1 var(--mono); color: var(--ink-2); }
.tl-pip i { font-style: normal; color: var(--friendly); font-size: 8.5px; border: 1px solid rgba(88, 166, 255, 0.45); border-radius: 3px; padding: 1px 2px; margin-right: 1px; }
.tl-pip--sea i { color: #6cc9ff; border-color: rgba(108, 201, 255, 0.45); border-radius: 50%; }
.tl-24 { font-size: 9.5px; }
.tl-mag__m { display: inline-flex; align-items: center; gap: 3px; font: 600 9px/1 var(--mono); color: var(--ink-2); }
.tl-mag__n { color: #ff8b84; font-size: 8.5px; }
.tl-mag__bar { width: 16px; height: 3px; border-radius: 2px; background: rgba(248, 81, 73, 0.2); overflow: hidden; display: inline-block; }
.tl-mag__bar > span { display: block; height: 100%; width: var(--v, 0%); background: #ff8b84; }
.tl-mag__m.is-low .tl-mag__bar > span { background: var(--amber-2); }
.tl-mag__m.is-out { opacity: 0.5; }
.tl-mag__m.is-out .tl-mag__n { text-decoration: line-through; }

.tl-next {
  grid-row: 2; grid-column: 1 / -1;
  display: flex; align-items: center; gap: 6px; min-width: 0;
  height: 22px; padding: 0 7px; border-radius: 4px;
  border: 1px solid rgba(248, 81, 73, 0.35); background: rgba(248, 81, 73, 0.07);
  font-size: var(--fs-xs); color: var(--ink-2); text-align: left; white-space: nowrap; overflow: hidden;
}
button.tl-next:hover { background: rgba(248, 81, 73, 0.14); }
.tl-next.is-reactive { border-color: rgba(211, 111, 216, 0.45); background: rgba(211, 111, 216, 0.08); }
.tl-next.is-none { border-color: var(--line); background: transparent; }
.tl-next .tl-k { color: #ff8b84; }
.tl-next.is-none .tl-k { color: var(--muted); }
.tl-next__t { font: 600 10px/1 var(--mono); color: var(--ink); }
.tl-next__b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tl-next__m { font: 500 9.5px/1 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.tl-next__x { margin-left: auto; font: 600 9px/1 var(--mono); color: var(--muted); flex: none; }
.tl-next__x.is-warn { color: var(--amber-2); }

/* ─── Tooltip ─────────────────────────────────────────────────────────────── */
.tl-tip {
  position: fixed; z-index: var(--z-pop); max-width: 340px; min-width: 180px;
  padding: 8px 10px; border-radius: var(--r-md);
  background: var(--glass-strong); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  font-size: var(--fs-xs); color: var(--ink-2); pointer-events: none;
}
.tl-tip__h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font: 600 10px/1.2 var(--mono); color: var(--ink); }
.tl-tip__k { font: 500 9px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tl-tip__k.tl-tone-red { color: #ff8b84; }
.tl-tip__k.tl-tone-reactive { color: #eab3ee; }
.tl-tip__k.tl-tone-amber { color: var(--amber-2); }
.tl-tip__k.tl-tone-blue { color: var(--blue-2); }
.tl-tip__t { color: var(--ink); font-size: var(--fs-sm); font-weight: 500; margin-bottom: 2px; }
.tl-tip__l { color: var(--muted); line-height: 1.45; }
.tl-tip__row { display: flex; align-items: baseline; gap: 6px; line-height: 1.45; padding: 1px 0; }
.tl-tip__shape { display: inline-grid; place-items: center; width: 12px; flex: none; color: var(--muted); }
.tl-tip__shape svg path { fill: currentColor; }
.tl-tip__shape.tl-mk--strike { color: var(--red); }
.tl-tip__shape.tl-mk--strike.is-reactive, .tl-tip__shape.tl-mk--esc { color: #d36fd8; }
.tl-tip__shape.tl-mk--loss { color: var(--red); }
.tl-tip__shape.tl-mk--damage { color: var(--amber-2); }
.tl-tip__shape.tl-mk--plan svg path { fill: none; stroke: var(--red); stroke-width: 1.3; }
.tl-tip__cri { font: 600 10px/1 var(--mono); }
.tl-tip__cri.tone-good b { color: var(--good); }
.tl-tip__cri.tone-warn b { color: var(--warn); }
.tl-tip__cri.tone-bad b { color: var(--bad); }
.tl-tip__hint { margin-top: 5px; font: 500 8.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.tl-tip__fob { display: grid; grid-template-columns: minmax(0, 1fr) 54px 34px; align-items: center; gap: 8px; padding: 2px 0; }
.tl-tip__fob span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.tl-tip__fob b { text-align: right; }
.tl-tip__fob b.tone-good { color: var(--good); }
.tl-tip__fob b.tone-warn { color: var(--warn); }
.tl-tip__fob b.tone-bad { color: var(--bad); }
.tl-fobbar { height: 4px; border-radius: 2px; background: var(--bg-4); overflow: hidden; }
.tl-fobbar > span { display: block; height: 100%; width: var(--v, 0%); background: var(--muted); }
.tl-fobbar.tone-good > span { background: var(--good); }
.tl-fobbar.tone-warn > span { background: var(--warn); }
.tl-fobbar.tone-bad > span { background: var(--bad); }
.tl-sev { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--blue); transform: translateY(-1px); }
.tl-sev--warning { background: var(--amber-2); }
.tl-sev--critical { background: var(--red); }

/* ─── Popovers ────────────────────────────────────────────────────────────── */
.tl-pop { padding: 8px; }
.tl-speedpop { display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.tl-speedpop__hint { font-size: var(--fs-xs); color: var(--muted); display: flex; align-items: center; gap: 4px; }
.tl-pop--menu { padding: 6px; }
.tl-cl { max-width: 360px; max-height: 300px; overflow: auto; }
.tl-cl__item { align-items: flex-start; }
.tl-cl__main { display: flex; flex-direction: column; min-width: 0; }
.tl-cl__t { color: var(--muted); margin-right: 6px; font-size: var(--fs-xs); }
.tl-bm { width: 300px; display: flex; flex-direction: column; gap: 8px; }
.tl-bm__head { display: flex; align-items: center; gap: 7px; color: var(--ink); }
.tl-bm__head .num { margin-left: auto; color: var(--ink-2); font-size: var(--fs-xs); }
.tl-bm__sel { font-size: var(--fs-xs); }
.tl-bm__count { color: var(--faint); letter-spacing: 0; text-transform: none; }
.tl-bm .field { margin-bottom: 0; }
.tl-bm__foot { display: flex; align-items: center; gap: 6px; }
.tl-bm__foot .grow { flex: 1; }

/* ─── Briefing mode & narrow ──────────────────────────────────────────────── */
body.briefing .tl { grid-template-columns: 210px minmax(0, 1fr) 0; }
body.briefing .tl-right, body.briefing .tl-gutter, body.briefing .tl-status, body.briefing .tl-clock__len { display: none; }
body.briefing .tl-left { flex-direction: row; align-items: center; gap: 10px; padding: 0 10px; }
body.briefing .tl-clock__t { font-size: 15px; }
body.briefing .tl-center { grid-template-columns: 0 minmax(0, 1fr); padding: 6px 14px; }
body.briefing .tl-scale { grid-template-rows: 0 0 1fr 0; }
body.briefing .tl-lanes, body.briefing .tl-axis { display: none; }
body.briefing .tl-speed, body.briefing .tl-btn--edge { display: none; }

@media (max-width: 1023px) {
  .tl-right { display: none; }
  .tl-left { padding: 6px 8px; }
  .tl-speed { display: none; }
  .tl-btn--edge { display: none; }
}
@media (max-width: 767px) {
  .tl { grid-template-columns: 0 minmax(0, 1fr) 0; }
  .tl-left { display: none; }
}
