/* One record, every output. The record in the middle, the outputs around it grouped by who uses them, and the real screen of the one you pick underneath.
   Ink, Paper, the site's type, hairlines, square buttons. The ring is the only device: true green when an output has received the change. */

.sf { container-type: inline-size; display: grid; gap: clamp(28px, 4vw, 56px); color: var(--paper); font-size: 16px; line-height: 1.45; }
.sf-map { position: relative; display: grid; gap: 28px; }
.sf-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.sf-l { fill: none; stroke: var(--rule2); stroke-width: 1.5; transition: stroke .3s; }
.sf-l.is-on { stroke: var(--paper); }
.sf.is-sent .sf-l { stroke: var(--true); stroke-dasharray: 100; animation: sf-run .9s var(--inout) both; }
@keyframes sf-run { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

/* the record */
.sf-rec { position: relative; z-index: 1; display: grid; gap: 10px; align-content: start; padding: 24px 22px 22px; background: var(--paper); color: var(--ink); border-radius: 2px; }
.sf-rec-h { font-family: var(--disp); font-weight: 800; font-size: 1.9em; line-height: 1; letter-spacing: -.02em; }
.sf-rec-p { color: rgba(12, 13, 16, .72); max-width: 22em; }
.sf-go { appearance: none; justify-self: start; min-height: 52px; padding: 0 22px; margin-top: 6px; background: #1C7A5A; color: #fff; border: 0; border-radius: 2px; font: inherit; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .sf-go:hover { background: #166247; } }
.sf-go:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sf-said { min-height: 1.45em; color: #1C7A5A; font-weight: 600; }

/* the outputs */
.sf-grp { position: relative; z-index: 1; display: grid; gap: 6px; align-content: start; }
.sf-gh { color: var(--quiet); font-weight: 600; margin-bottom: 4px; }
.sf-out { appearance: none; display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 14px 8px 10px; background: var(--ink); border: 0; border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--rule); color: var(--paper); font: inherit; font-weight: 600; text-align: left; cursor: pointer; transition: background .25s, color .25s, box-shadow .25s; }
@media (hover: hover) { .sf-out:hover { box-shadow: inset 0 0 0 1.5px var(--paper); } }
.sf-out:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
.sf-out.is-on { background: var(--paper); color: var(--ink); box-shadow: none; }
.sf-dot { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--rule2); background: var(--ink); }
.sf-out.is-on .sf-dot { box-shadow: inset 0 0 0 2px var(--ink); background: var(--paper); }
.sf-ring { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); overflow: visible; opacity: 0; }
.sf-ring circle { fill: none; stroke: var(--true); stroke-width: 9; stroke-dasharray: 100; stroke-dashoffset: 100; }
.sf-out.is-got .sf-ring { opacity: 1; }
.sf-out.is-got .sf-ring circle { animation: sf-ring .5s var(--inout) both; }
.sf-out.is-got .sf-dot { background: var(--true); box-shadow: none; }
@keyframes sf-ring { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

/* the real screen */
.sf-view { display: grid; gap: 14px; margin: 0; }
.sf-shot { background: var(--ink2); border-radius: 2px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--rule); }
.sf-shot img { display: block; width: 100%; height: auto; }
.sf-none { padding: 48px 24px; color: var(--soft); max-width: none; }
.sf-cap { color: var(--soft); max-width: 40em; }
.sf-cap b { color: var(--paper); font-weight: 700; }

/* phone and narrow: the record first, a spine down the left, the outputs under it; the group names sit clear of the spine */
.sf-gh { padding-left: 44px; }

@container (min-width: 640px) { .sf-map, .sf-view { font-size: 17px; } }
@container (min-width: 900px) {
  .sf-map, .sf-view { font-size: 18px; }
  .sf-map { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1fr); grid-template-rows: auto auto; column-gap: clamp(56px, 7cqi, 120px); row-gap: 40px; align-items: center; }
  .sf-grp-staff { grid-column: 1; grid-row: 1; }
  .sf-grp-guests { grid-column: 1; grid-row: 2; }
  .sf-grp-managers { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .sf-rec { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .sf-grp-managers .sf-out { flex-direction: row; }
  .sf-grp-staff .sf-out, .sf-grp-guests .sf-out { flex-direction: row-reverse; justify-content: space-between; padding: 8px 10px 8px 14px; }
  .sf-gh { padding-left: 0; }
  .sf-grp-staff .sf-gh, .sf-grp-guests .sf-gh { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  .sf.is-sent .sf-l, .sf-out.is-got .sf-ring circle { animation: none; stroke-dashoffset: 0; }
  .sf-out, .sf-l { transition: none; }
}

/* this page's name is a whole phrase, so it is set smaller than the other case names, and the diagram reaches the first screen */
@media (min-width: 900px) { [data-case="staff-tool"] .cs-name { font-size: clamp(3.4rem, 5.6vw, 6.2rem); line-height: .9; max-width: 13em; } }
[data-case="staff-tool"] .cs-cover.no-footage .scene-in { padding-top: calc(var(--hd) + clamp(28px, 4vw, 64px)); }
[data-case="staff-tool"] .cs-piece.at-cover { margin-top: clamp(24px, 3vw, 44px); }
.sf-view { scroll-margin-top: calc(var(--hd) + 16px); }

/* links never wrap: on the narrowest phones the "Next" link steps down a little instead of breaking */
[data-case="staff-tool"] .cs-next { white-space: nowrap; }
@media (max-width: 389px) { [data-case="staff-tool"] .cs-next { font-size: clamp(14px, 4.1vw, 16px); } }

/* the outputs section is turned over to Paper by staff-menu.js; the case reading colour is set for ink, so it is reset here for this page */
[data-case="staff-tool"] .cs-followed.paper { --read: rgba(12, 13, 16, .82); }

/* ---- Seven hand-offs, or one change: a race on one line of time (pieces/staff-menu.js mountChange; on the night band after the list) ----
   Phone first: the line of time runs down and the two lanes stand side by side. From 720px of width it runs across, one lane above the other. */
.mc { container-type: inline-size; margin: clamp(48px, 7vw, 104px) var(--pad) 0; display: grid; gap: 20px; color: var(--paper); --mc-red: #FF7A62; --mc-green: #5BD0A6; }
.mc-head { margin: 0; font-family: var(--disp); font-weight: 800; font-size: clamp(2rem, 6.4vw, 3.8rem); line-height: 1.02; letter-spacing: -.02em; }
.mc-sub { margin: 0; font-size: 17px; line-height: 1.45; color: var(--soft); }
.mc-race { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; row-gap: 14px; margin-top: 12px; }
.mc-lane { display: contents; }
.mc-old > * { grid-column: 1; } .mc-new > * { grid-column: 2; }
.mc-h { grid-row: 1; margin: 0; font-family: var(--text); font-weight: 600; font-size: 17px; line-height: 1.3; }
.mc-new .mc-h { color: var(--mc-green); }
.mc-outs { grid-row: 2; list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.mc-out { display: grid; gap: 2px; padding: 8px 10px; border: 1px dashed var(--mc-red); border-radius: 2px; transition: border-color .4s; }
.mc-out-t { font-size: 15px; line-height: 1.25; color: var(--paper); }
.mc-out-s { font-size: 14px; font-weight: 600; line-height: 1.3; }
.mc-s-old { color: var(--mc-red); } .mc-s-new { display: none; color: var(--mc-green); }
.mc-out.is-on { border-style: solid; border-color: var(--mc-green); }
.mc-out.is-on .mc-s-old { display: none; } .mc-out.is-on .mc-s-new { display: inline; }
/* the track: positions are percent of the one line of time (--at, --a, --b, --p, --end), the same scale in both lanes */
.mc-track { grid-row: 3; position: relative; height: 600px; margin: 10px 0 34px; }
.mc-line, .mc-wait, .mc-fill { position: absolute; left: 6px; top: 0; width: 2px; }
.mc-line { height: calc(var(--end) * 1%); background: repeating-linear-gradient(180deg, var(--rule2) 0 6px, transparent 6px 11px); }
.mc-wait { top: calc(var(--a) * 1%); height: calc((var(--b) - var(--a)) * 1%); background: repeating-linear-gradient(180deg, var(--mc-red) 0 6px, transparent 6px 11px); }
.mc-wait { z-index: 2; }
.mc-wait > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 8.5em; font-size: 14px; font-style: italic; line-height: 1.3; color: var(--quiet); }
.mc-fill { left: 5px; width: 4px; height: calc(var(--p, 0) * 1%); background: var(--paper); }
.mc-new .mc-fill { background: var(--mc-green); }
.mc-now { position: absolute; left: 7px; top: calc(var(--p, 0) * 1%); width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 6px rgba(237, 233, 225, .18); }
.mc-new .mc-now { background: var(--mc-green); box-shadow: 0 0 0 6px rgba(91, 208, 166, .2); }
.mc-lane.is-done .mc-now { opacity: 0; }
.mc-stops { list-style: none; margin: 0; padding: 0; }
.mc-stop { position: absolute; left: 0; top: calc(var(--at) * 1%); }
.mc-dot { position: absolute; left: 1px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 2px var(--rule2); transition: background .3s, box-shadow .3s; }
.mc-stop.is-on .mc-dot { background: var(--paper); box-shadow: none; }
.mc-new .mc-stop.is-on .mc-dot { background: var(--mc-green); }
.mc-lbl { position: absolute; left: 24px; top: -.7em; width: 9em; font-size: 15px; line-height: 1.3; color: var(--quiet); transition: color .3s; }
.mc-stop.is-on .mc-lbl { color: var(--paper); }
.mc-note { grid-column: 1 / -1 !important; position: relative; margin: 6px 0 0; padding-left: 22px; font-size: 17px; line-height: 1.45; max-width: 40em; }
.mc-note::before { content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.mc-risk::before { background: var(--mc-red); }
.mc-safe:empty::before { display: none; }
.mc-risk { grid-row: 4; color: var(--soft); }
.mc-safe { grid-row: 5; color: var(--mc-green); font-weight: 600; min-height: 1.45em; }
.mc-axis { display: none; }
.mc-again { appearance: none; justify-self: start; min-height: 48px; padding: 0 2px; background: none; border: 0; color: var(--soft); font: inherit; font-size: 17px; font-weight: 600; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; cursor: pointer; }
.mc-again:hover { color: var(--paper); }
.mc-again:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
/* what it does for the restaurant: after the race, on the same band */
.mc-does { margin-top: clamp(40px, 6vw, 80px); padding-top: clamp(28px, 4vw, 48px); border-top: 1px solid var(--rule); display: grid; gap: 20px; }
.mc-does-h { margin: 0; font-family: var(--disp); font-weight: 800; font-size: clamp(1.6rem, 4.4vw, 2.6rem); line-height: 1.05; letter-spacing: -.02em; }
.mc-does-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.mc-does-l li { position: relative; padding-left: 24px; font-size: 17px; line-height: 1.45; color: var(--paper); }
.mc-does-l li::before { content: ""; position: absolute; left: 0; top: .5em; width: 10px; height: 10px; border-radius: 50%; background: var(--mc-green); }
.mc-new .mc-stop.is-low .mc-lbl { top: 3.4em; }
@media (prefers-reduced-motion: reduce) { .mc-again { display: none; } .mc-out, .mc-dot, .mc-lbl { transition: none; } }

/* wide: time runs across. Each lane is a row: its name at the left, the track, then what the room is working from under it */
@container (min-width: 720px) {
  .mc-race { grid-template-columns: 9.5rem minmax(0, 1fr); column-gap: clamp(20px, 3cqi, 40px); row-gap: 0; }
  .mc-lane { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; row-gap: 6px; padding: 18px 0 22px; border-top: 1px solid var(--rule); }
  .mc-old > *, .mc-new > * { grid-column: 2; }
  .mc-h { grid-column: 1 !important; grid-row: 1; align-self: center; font-size: 19px; }
  .mc-track { grid-row: 1; height: 132px; margin: 0 24px 0 6px; }
  .mc-outs { grid-row: 2; display: flex; flex-wrap: wrap; gap: 10px; }
  .mc-out { grid-template-columns: auto auto; column-gap: 10px; align-items: baseline; padding: 8px 12px; white-space: nowrap; }
  .mc-note { grid-column: 2 !important; grid-row: 3; margin-top: 10px; }
  .mc-safe:empty { display: none; }
  .mc-line, .mc-wait, .mc-fill { left: 0; top: calc(50% - 1px); height: 2px; }
  .mc-line { width: calc(var(--end) * 1%); background: repeating-linear-gradient(90deg, var(--rule2) 0 6px, transparent 6px 11px); }
  .mc-wait { left: calc(var(--a) * 1%); width: calc((var(--b) - var(--a)) * 1%); background: repeating-linear-gradient(90deg, var(--mc-red) 0 6px, transparent 6px 11px); }
  .mc-wait > span { left: 50%; top: 0; transform: translate(-50%, -50%); width: auto; white-space: nowrap; padding: 0 8px; background: var(--ink); }
  .mc-fill { top: calc(50% - 2px); width: calc(var(--p, 0) * 1%); height: 4px; }
  .mc-now { left: calc(var(--p, 0) * 1%); top: 50%; margin: -7px 0 0 -8px; }
  .mc-stop { left: calc(var(--at) * 1%); top: 50%; }
  .mc-dot { left: -6px; top: -5px; }
  .mc-lbl { left: 0; top: auto; bottom: 16px; width: 8.6em; transform: translateX(-50%); text-align: center; }
  .mc-stop.is-low .mc-lbl { bottom: auto; top: 18px; }
  .mc-stop.is-first .mc-lbl { transform: translateX(-6px); text-align: left; }
  .mc-stop.is-last .mc-lbl { transform: translateX(calc(-100% + 6px)); text-align: right; }
  .mc-new .mc-track { height: 112px; }
  .mc-new .mc-lbl { transform: translateX(-6px); text-align: left; width: auto; white-space: nowrap; }
  .mc-new .mc-stop.is-low .mc-lbl { top: 18px; }
  .mc-does-l { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 5cqi, 80px); max-width: 1100px; }
  .mc-does-l li { font-size: 18px; }
  .mc-axis { display: block; grid-column: 2; max-width: none; margin: 0 24px 0 6px; padding-top: 8px; border-top: 1px solid var(--rule2); font-size: 14px; color: var(--quiet); }
  .mc-axis span::after { content: " \2192"; }
}
.mc-head .nw { white-space: nowrap; }

/* letter by letter (Brian: "instead of the dot going behind the text, it colors the font characters by letter"): a label's letters take the
   lane's colour in order as the change reaches it, red on the usual way and green on the record's; the travelling dot steps out of sight
   while it crosses a label on the line, so it never passes behind words. Every letter is readable at every moment. */
.mc .wd { white-space: nowrap; }
.mc .ch { transition: color .16s cubic-bezier(.2, .8, .2, 1); }
.mc-wait .ch.on { color: var(--mc-red); }
.mc-stop.is-on .mc-lbl .ch { color: var(--mc-red); transition-delay: calc(var(--i) * 14ms); }
.mc-new .mc-stop.is-on .mc-lbl .ch { color: var(--mc-green); }
.mc-now { transition: none; }
.mc-old.is-under .mc-now { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .mc .ch, .mc-now { transition: none; } .mc-stop.is-on .mc-lbl .ch { transition-delay: 0s; } }
