/* ---------- timelines (section 22b) ----------
   An arrow with stages on it, in its ink: a dot on the line for each, a hairline stem from it and words at the stem's
   tip, their first line heavier; words at its ends; and while it has a countdown, the line dotted where the time has
   gone, with a ring and the time left in figures at the split. Stages and ends with no words show only while it is
   selected or typed in: a dot alone on the line, else. */
.obj.arrow > .tml { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.obj.arrow.ar-none > .tml { display: none; }
.obj.arrow[data-tml] > .ar-lb { display: none; }        /* a timeline's words are its stages' */
.tml-f {
  position: absolute; left: 0; top: 0; width: max-content; max-width: 14.15em; min-width: 1ch;     /* 184px at its 13px */
  font: 400 13px/17px var(--f-ui); letter-spacing: calc(var(--ls, -.003em) + var(--trk, 0em)); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere;
  pointer-events: auto; cursor: pointer; outline: none; transition: opacity 160ms ease-out;
}
.tml-f:focus { cursor: text; }
.tml-t::first-line { font-weight: 600; color: var(--ink); }   /* a stage's first line names it: a date, an event */
.tml-t[data-ph]:empty::before { font-weight: 400; }
.tml-s, .tml-x { font-weight: 500; color: var(--ar); }
/* its words' size, typeface and ink (the Text card, section 21e; style.js makes the rules for sizes and faces of
   one's own), and their letter spacing (--trk, style.css) */
.obj.arrow[data-fs="s"] .tml-f { font-size: 11.5px; line-height: 15px; }
.obj.arrow[data-fs="l"] .tml-f { font-size: 16px; line-height: 21px; }
.obj.arrow[data-fs="xl"] .tml-f { font-size: 20px; line-height: 26px; --ls: -.006em; }
.obj.arrow[data-ff="serif"] .tml-f { font-family: var(--f-display); font-optical-sizing: auto; }
.obj.arrow[data-ff="mono"] .tml-f { font-family: var(--f-mono); --ls: -.012em; }
.obj.arrow[data-ink] .tml-f, .obj.arrow[data-ink] .tml-t::first-line { color: var(--ink-c); }
.obj.arrow:not(.sel):not(:focus-within) .tml-f.vac { opacity: 0; pointer-events: none; }
.obj.arrow:not(.sel):not(:focus-within) .tml-n.vac .tml-st { opacity: 0; }
.tml-f.past { opacity: .5; }
.tml-f.off { opacity: .3; }
.tml-n { pointer-events: none; transition: opacity 160ms ease-out; }
.tml-st { stroke: var(--ar); stroke-width: 1px; stroke-opacity: .55; stroke-linecap: round; transition: opacity 160ms ease-out; }
.tml-d { fill: var(--ar); stroke: var(--canvas); stroke-width: 2.5px; paint-order: stroke; }
.tml-h { fill: none; stroke: transparent; stroke-width: 22px; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: grab; }
.tml-n.past { opacity: .45; }
.tml-n.off { opacity: .3; }
/* the stage chosen (Delete takes it), and the one something carried would stand across from */
:is(.obj.arrow.sel, .obj.arrow:focus-within) .tml-n.cur .tml-d, .tml-n.near .tml-d { stroke: var(--sel); stroke-width: 3px; }
.obj.arrow.tml-near .ar-hl { stroke: color-mix(in srgb, var(--sel) 20%, transparent); }
body.linking .tml-h, body.bending .tml-h, body.moving .tml-h, body.linking .tml-f, body.bending .tml-f { pointer-events: none; }
body.tmling, body.tmling * { cursor: grabbing !important; }

/* its countdown: the line behind the split dotted (under the line, which is drawn from the split on: timeline.js),
   and at the split a ring with the time left beside it, across the line from the stages */
.tml-past { fill: none; stroke: var(--ar); stroke-linecap: round; }
.tml-mp { fill: none; stroke: #fff; stroke-linecap: butt; stroke-dasharray: 1 1; }      /* the dotted line's mask: the line up to the split */
.obj.arrow:not([data-tdur]) .tml-past, .obj.arrow:not([data-tdur]) .tml-c { display: none; }
/* its place on the line: --tml-at, which timeline.js moves (an animated offset-distance would be a layer of its own in
   Safari's engine, and the whole canvas with it, drawn blurred when zoomed in: objects.css, html.wk) */
@property --tml-at { syntax: '<length-percentage>'; inherits: false; initial-value: 0%; }
.tml-c {
  position: absolute; left: 0; top: 0; width: 0; height: 0; margin: 0; padding: 0; border: 0; background: none; font: inherit;
  offset-rotate: 0deg; offset-anchor: 0 0; offset-distance: var(--tml-at); color: var(--ar); pointer-events: auto; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent;
}
.tml-c > i {
  position: absolute; left: -5.5px; top: -5.5px; width: 11px; height: 11px; box-sizing: border-box; border-radius: 50%;
  border: 1.5px solid currentColor; background: var(--canvas); transition: background-color 140ms ease-out, scale 160ms ease-out;
}
.tml-c > i::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; }    /* a finger's worth to press */
.tml-c[data-s="done"] > i { background: currentColor; }
.tml-c > span {
  position: absolute; left: 0; top: 0; translate: calc(-50% + var(--cx, 0px)) calc(-50% + var(--cy, 0px));
  font: 500 12px/16px var(--f-mono); letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none;
}
.tml-c:is([data-s="set"], [data-s="pause"]) > span { opacity: .62; }
@media (hover: hover) { .tml-c:hover > i { scale: 1.2; background: color-mix(in srgb, currentColor 22%, var(--canvas)); } .tml-c[data-s="done"]:hover > i { background: currentColor; } }
.tml-c:focus-visible > i { outline: 2px solid var(--sel); outline-offset: 2px; }

/* over the selected timeline's line: where a click adds a stage */
#tmlg {
  position: absolute; left: 0; top: 0; z-index: 3; width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; box-sizing: border-box; border-radius: 50%;
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--sel), 0 1px 2px var(--drop-2); pointer-events: none;
}
#tmlg::before, #tmlg::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 1.5px; margin: -.75px 0 0 -3.5px; border-radius: 1px; background: var(--sel); }
#tmlg::after { rotate: 90deg; }
#tmlg[hidden], body.moving #tmlg, body.tmling #tmlg, body.bending #tmlg, body.linking #tmlg, body.dv #tmlg { display: none; }

/* the Timeline card: a time typed for its countdown */
#ipop .ip-tmi {
  display: block; width: 100%; height: 32px; margin-top: 8px; padding: 0 10px; box-sizing: border-box; border: 0; border-radius: 6px; outline: none;
  font: 500 12px/32px var(--f-mono); letter-spacing: -.01em; color: var(--ink); background: var(--press-bg); box-shadow: var(--press);
}
#ipop .ip-tmi::placeholder { font-family: var(--f-ui); letter-spacing: 0; color: var(--ink-3); }
#ipop .ip-tmi:focus-visible { box-shadow: var(--press), 0 0 0 1.5px var(--ink-3); }
#ipop .ip-tmi.bad { box-shadow: var(--press), 0 0 0 1.5px var(--danger); }
#ipop .ip-act svg .f { fill: currentColor; stroke: none; }
@media (prefers-reduced-motion: reduce) { .tml-f, .tml-n, .tml-st, .tml-c > i { transition: none; } }
