/* Other people's tools on a flat desk on a Friday: their colours are the tools', kept soft; the product is never
   drawn here. The team chat, a pile of saved BOM copies over the shared one, the tally under it, and the inbox. Its
   type and bars are the other mock-ups' size, so the week reads as a screen beside them, not a zoomed one. The pile's
   strips step 12 px on both edges, which is what makes them a pile; a phone's barely tilt, on the rotate property, so
   transform stays free for motion. The HTML paints the end of the week; today.js holds back what lands and lands it
   one beat at a time. Red marks only what costs: Vale's Rev A and the one supplier with it. */
.today-desk {
  --today-chat-bg: oklch(97% 0.012 175);
  --today-chat-fg: oklch(47% 0.08 185);
  --today-chat-tint: oklch(94% 0.035 175);
  --today-cell: color-mix(in oklab, var(--neutral-8) 9%, transparent);
  --today-fs: 15px;
  --today-sm: 14px;
  --today-row: 38px;
  --today-bar: 36px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "chat" "sheet" "mail" "count";
  gap: 12px;
  align-items: start;
  padding: 14px 10px 16px;
  border-radius: var(--r-lg);
  background: var(--desk);
  color: var(--ink);
  font-size: var(--today-fs);
  line-height: 1.35;
  overflow-anchor: none;
}
.today-desk p { margin: 0; }
.today-left { display: contents; }

/* A window: white sheet, quiet chrome, the app's own small mark */
.today-win { position: relative; isolation: isolate; min-width: 0; background: var(--card); border-radius: var(--r-sm); box-shadow: var(--depth-float); overflow: hidden; }
.today-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; min-height: var(--today-bar); padding: 0 12px; background: var(--neutral-1); border-bottom: 1px solid var(--line); }
.today-dots { display: flex; gap: 5px; flex: none; }
.today-dots i { width: 7px; height: 7px; border-radius: var(--r-full); background: var(--neutral-4); }
.today-app { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; margin-left: 4px; border-radius: var(--r-xs); }
.today-app .i { width: 13px; height: 13px; stroke-width: 1.7; }
.today-app-mail { background: var(--tint-info-bg); color: var(--tint-info-fg); }
.today-app-xls { background: var(--tint-good-bg); color: var(--tint-good-fg); }
.today-app-chat { background: var(--today-chat-tint); color: var(--today-chat-fg); }
.today-title { overflow-wrap: break-word; font-size: var(--today-sm); font-weight: var(--w-title); color: var(--ink-2); }
.today-file { font: 500 var(--today-sm)/1 var(--font-mono); letter-spacing: -0.01em; }
/* The open copy is the one on the shared drive, the one a teammate's save can write over */
.today-shared { display: inline-flex; align-items: center; gap: 5px; flex: none; margin-left: auto; font-size: var(--today-sm); color: var(--ink-3); }
.today-shared .i { width: 13px; height: 13px; stroke-width: 1.5; }
/* A phone's card plays its part on its own, far from the tally's control, so its bar carries a Skip while it plays;
   it fits the bar, so showing it moves nothing. */
.today-bar .today-skip { flex: none; width: 30px; min-width: 30px; height: 30px; margin-left: auto; visibility: hidden; }
.today-bar .today-skip::after { inset: -3px -7px -11px; }
.today-bar .today-skip[data-on] { visibility: visible; }
.today-shared + .today-skip { margin-left: 6px; }
.today-skip path, .today-again [data-ic="skip"] { fill: currentColor; stroke-linejoin: round; }
.today-skip path { display: inline; }

/* The spotlight: while the week plays, the cards it is not about sink into the desk */
.today-dim { position: absolute; inset: 0; z-index: 5; border-radius: inherit; background: var(--desk); opacity: 0; pointer-events: none; }

/* The BOM's copies, piled over each other and over the open sheet */
.today-sheets { grid-area: sheet; position: relative; isolation: isolate; min-width: 0; }
.today-vers { display: grid; position: relative; }
/* Each strip is overlapped by 12 px of the next, so its name is centred in the part that shows */
.today-ver { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; min-height: calc(var(--today-bar) + 4px); padding: 0 6px 12px 12px; background: var(--card); border-radius: var(--r-sm); box-shadow: var(--depth-float); }
.today-ver .today-title { margin-left: 4px; color: var(--ink-2); line-height: 1.25; }
.today-ver + .today-ver { margin-top: -12px; }
.today-ver:nth-child(1) { margin-right: 24px; }
.today-ver:nth-child(2) { margin-inline: 12px; z-index: 1; }
.today-ver:nth-child(3) { margin-inline: 24px 0; z-index: 2; }
.today-ver-new .today-title { color: var(--ink); }
/* The question sits at the end of the newest copy's own strip, after its name, so it never lies over a file name */
.today-tag { flex: none; margin-left: auto; padding: 2px 9px; border-radius: var(--r-xs); background: var(--neutral-2); color: var(--ink); font: var(--w-title) var(--today-sm)/20px var(--font-sans); white-space: nowrap; }
/* The newest copy is the pile's top: it shows whole, as tall as what shows of each copy under it */
.today-ver-new { min-height: calc(var(--today-bar) - 8px); padding-bottom: 0; }
.today-xls { z-index: 0; }

/* Adam's save, as the spreadsheet itself says it, in the formula bar's line: what it threw away stays readable */
.today-ban { display: flex; align-items: center; gap: 8px; min-height: var(--today-bar); padding: 6px 12px; background: var(--neutral-1); border-bottom: 1px solid var(--line); color: var(--ink); font-weight: var(--w-title); line-height: 1.3; }
.today-ban .i { width: 14px; height: 14px; flex: none; color: var(--ink-2); }
.today-ban-t { display: grid; gap: 1px; }
.today-was { font-size: var(--today-sm); font-weight: 400; color: var(--ink-2); }
.today-was s { color: var(--ink-3); text-decoration-thickness: 1.5px; }
.today-sheet { width: 100%; border-collapse: collapse; table-layout: fixed; line-height: 1.3; color: var(--ink); }
/* A cell's value wraps rather than clips when the reader's own text spacing widens it */
.today-sheet td { height: var(--today-row); padding: 4px 8px; border: 1px solid var(--today-cell); overflow-wrap: break-word; }
.today-sheet td:first-child { border-left: 0; }
.today-sheet td:last-child { border-right: 0; }
.today-sheet tr:last-child td { border-bottom: 0; }
.today-c1 { width: 25%; }
.today-c3 { width: 10%; }
.today-c4 { width: 36%; }
.today-th td { height: 32px; font-size: var(--today-sm); font-weight: var(--w-title); color: var(--ink-2); background: var(--neutral-0); }
.today-pn { font: 400 var(--today-sm)/1.3 var(--font-mono); letter-spacing: -0.02em; color: var(--ink-2); }
/* An overwritten cell keeps the corner mark a spreadsheet's tracked changes put on it: three this week. The cell the
   banner names carries the sheet's own selection box. */
.today-sheet td.today-cell { position: relative; }
.today-mark { position: absolute; top: 0; left: 0; border-top: 7px solid var(--ink-3); border-right: 7px solid transparent; }
.today-sheet td.is-sel .today-mark { top: 2px; left: 2px; }
/* What the save threw away stays in its cell, struck, on a line of its own: a phone's status cell is too narrow for both */
.today-sheet td:has(.today-lost) { padding-block: 2px; line-height: 17px; }
.today-lost { display: block; font-size: var(--today-sm); color: var(--ink-3); text-decoration-thickness: 1.5px; }
.today-sheet td.is-sel::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--tint-good-fg); pointer-events: none; }

/* The tally, under the sheet: the week in three numbers, each the desk's own count */
/* Its first row holds the control's height on a phone, so the card is the same size with or without it */
.today-count { grid-area: count; position: relative; z-index: 4; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(44px, auto) auto; gap: 0 8px; padding: 4px 6px 6px 14px; background: var(--card); border-radius: var(--r-md); box-shadow: var(--depth-float); line-height: 1.35; color: var(--ink-2); }
.today-count-t { display: contents; }
.today-count b { grid-row: 1; grid-column: 1; align-self: center; color: var(--ink); font-weight: var(--w-title); white-space: nowrap; }
.today-ns { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; padding: 0 0 4px; }
.today-n { white-space: nowrap; }
.today-count em { display: inline-block; min-width: 1ch; margin-right: 2px; font-style: normal; font-size: 1.45em; line-height: 1.2; font-weight: var(--w-display); color: var(--ink); }
.today-count [data-t="c2"] em { color: var(--attention); }
.today-ctl { grid-row: 1; grid-column: 2; display: flex; gap: 6px; justify-self: end; align-self: center; }
/* Play before the week starts, Skip while it plays, Replay once it rests: one slot, as wide as its widest word, so the
   swap moves nothing. While a card plays on its own its bar holds the Skip, and this slot stays empty. */
.today-again path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.today-again[data-state="playing"] [data-ic="skip"], .today-again[data-state="ready"] [data-ic="play"] { display: inline; }
.today-again-l { display: inline-grid; }
.today-again-l > * { grid-area: 1 / 1; visibility: hidden; }
.today-again[data-state="ready"] [data-l="play"], .today-again[data-state="playing"] [data-l="skip"], .today-again[data-state="done"] [data-l="replay"] { visibility: visible; }
.today-again[data-state="off"] { visibility: hidden; }

/* Mail: newest on top */
.today-mail { grid-area: mail; }
.today-mails { --mail-pad: 14px; position: relative; padding-bottom: var(--mail-pad); }
/* Older mail hangs under the inbox's foot, out of the window, until a new arrival's room lifts it into view */
.today-mails.today-older { height: 0; margin: calc(-1 * var(--mail-pad)) 0 var(--mail-pad); padding: 0; }
.today-mails li { position: relative; display: grid; gap: 1px; padding: 9px 12px 10px 11px; border-left: 3px solid transparent; border-top: 1px solid var(--line); background: var(--card); }
.today-mails li:first-child { border-top: 0; }
.today-from { display: flex; align-items: baseline; gap: 8px; }
.today-from b { font-weight: 500; color: var(--ink); }
.today-from span { margin-left: auto; flex: none; font-size: var(--today-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.today-sub { color: var(--ink-2); }
.today-pre { font-size: var(--today-sm); color: var(--ink-3); }
.today-pre b { font-weight: var(--w-title); color: var(--attention); }
/* Vale's line is the desk's last word: at rest it is the strongest text in the inbox */
.today-mails .is-unread .today-pre { font-size: calc(var(--today-fs) + 1px); font-weight: 650; color: var(--ink); }
.today-mails .is-unread .today-pre b { font-weight: inherit; }
.today-mails .is-unread { border-left-color: var(--tint-info-fg); }
.today-mails .is-unread .today-from b, .today-mails .is-unread .today-sub { font-weight: var(--w-title); color: var(--ink); }
/* An older mail mostly under the inbox's foot fades, so the window never ends on a sliver of a line; at rest, and
   without script, it is gone */
.today-older li > *, .today-older li:first-child::before { opacity: var(--cut, 0); }
.today-older li:first-child::before { content: ""; position: absolute; top: -1px; left: -3px; right: 0; border-top: 1px solid var(--line); }

/* Chat: Maya's own lines on the right, as her phone shows them */
.today-chat { grid-area: chat; background: var(--today-chat-bg); }
.today-msgs { --msgs-gap: 8px; --msgs-top: 10px; position: relative; display: flex; flex-direction: column; gap: var(--msgs-gap); padding: var(--msgs-top) 10px 12px; }
/* The morning's earlier lines, scrolled up under the title bar; the list brings them back down while the week is
   armed. Hidden while scrolled away, so no pixel row of them shows at the card's top edge. */
.today-msgs-older { position: absolute; left: 10px; right: 10px; bottom: calc(100% - var(--msgs-top) + var(--msgs-gap)); visibility: hidden; }
.today-msgs-older > ol { display: flex; flex-direction: column; gap: var(--msgs-gap); }
.today-msgs.is-back .today-msgs-older { visibility: visible; }
/* Whatever the title bar cuts reads as scrolled content: the lines fade out over the bar's last 12 px of the window */
.today-chat::after { content: ""; position: absolute; top: var(--today-bar); left: 0; right: 0; z-index: 1; height: 12px; background: linear-gradient(var(--today-chat-bg), transparent); opacity: var(--msgs-fade, 0); pointer-events: none; }
/* The day's first line: above the morning's messages, it fills the top of the window where they wrap less than the
   week's last two */
.today-day { align-self: center; padding: 2px 10px; border-radius: var(--r-xs); background: var(--card); box-shadow: var(--depth-thumb); font-size: var(--today-sm); line-height: 20px; color: var(--ink-3); }
.today-msg { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 0 10px; max-width: 90%; padding: 6px 10px 6px 12px; border-radius: 10px 10px 10px 3px; background: var(--card); box-shadow: var(--depth-thumb); color: var(--ink); }
.today-msg b { grid-column: 1 / -1; font-size: var(--today-sm); font-weight: var(--w-title); color: var(--today-chat-fg); }
.today-msg time { display: grid; justify-items: end; font-size: var(--today-sm); line-height: 18px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.today-msg time > span { display: inline-flex; align-items: center; gap: 4px; }
.today-msg.is-out { align-self: flex-end; border-radius: 10px 10px 3px 10px; background: var(--today-chat-tint); }
.today-ticks { width: 16px; height: 10px; fill: none; stroke: var(--tint-info-fg); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Phone: one full-width card after another, in the order the week happens: the question in the chat, the copies,
   Vale's mail, and the week's one tally after them */
@container (max-width: 679px) {
  .today-dots { display: none; }
  .today-bar .today-app { margin-left: 0; }
  .today-ver .today-title { margin-left: 0; }
  .today-xls .today-bar .today-app { display: none; }
  .today-shared .i { display: none; }
  .today-sheet { font-size: var(--today-sm); }
  .today-c1 { width: 88px; }
  .today-c3 { width: 42px; }
  .today-c4 { width: 34%; }
  .today-sheet td { padding-inline: 5px; }
  .today-pn { font-size: 14px; }
  /* A phone's pile barely tilts and keeps one left edge, so no strip shows a corner sliver */
  .today-ver:nth-child(1) { margin-inline: 0 26px; rotate: -0.3deg; }
  .today-ver:nth-child(2) { margin-inline: 0 13px; rotate: 0.3deg; }
  .today-ver:nth-child(3) { margin-inline: 0; rotate: -0.3deg; }
  /* The time sits at the end of a message's last line, as a phone's chat sets it, and takes a line of its own only
     when that line is full: a column of its own wrapped the text early and left one word on its last line. */
  .today-msg { --msg-t: 44px; position: relative; display: block; text-wrap: balance; }
  .today-msg.is-out { --msg-t: 64px; max-width: 100%; }
  .today-msg b { display: block; }
  .today-msg > span::after { content: ""; display: inline-block; width: var(--msg-t); }
  .today-msg time { position: absolute; right: 10px; bottom: 6px; }
  .today-mails { --mail-pad: 0px; }
  /* A phone's chat cuts the line under its bar where a sender's name can fall: the fade covers a whole name */
  .today-chat::after { height: 20px; }
  /* Each count on its own line: a phone has no room for the separators */
  .today-ns { flex-direction: column; align-items: flex-start; }
  /* Sample data and the control take the tally's empty first row, beside "This week:", so they sit inside the desk
     at no height of their own */
  .today-desk > .scene-bar-box { position: relative; inset: auto; grid-area: count; align-self: start; justify-self: end; height: 44px; margin: 4px 6px 0 0; transform: none; z-index: 5; }
}
/* A narrow phone: the part name takes two lines rather than the sheet losing a column or clipping a status */
@container (max-width: 359px) {
  .today-desk { padding-inline: 8px; }
  .today-file { font-size: 14px; }
  .today-tag { padding-inline: 6px; font-size: 14px; }
  .today-sheet td:nth-child(2) { white-space: normal; line-height: 17px; }
}
/* The inbox's bar keeps its day before its owner */
@container (max-width: 309px) {
  .today-who { display: none; }
}
@container (max-width: 329px) {
  .today-pn { letter-spacing: -0.04em; }
  .today-c1 { width: 84px; }
  .today-c3 { width: 36px; }
  .today-c4 { width: 94px; }
}
/* Too narrow for the name and the question side by side: the question takes a line under the name */
@container (max-width: 349px) {
  .today-ver-new { flex-wrap: wrap; row-gap: 4px; padding-block: 8px; }
  .today-ver-new .today-tag { margin-left: 0; }
}

/* Tablet up: the chat over the inbox on the left, the copies, the sheet and the tally on the right, so the beats run
   as the eye reads, and the tally that ends the week sits where the eye ends. Both columns end on one line: the
   shorter one's last card stretches, its content at its top. Sample data and the control sit at the end of the
   chat's bar, the desk's first, as the other frames carry them in theirs; the bar keeps their room. */
@container (min-width: 680px) {
  .today-desk { --today-fs: 14px; --today-sm: 13px; --today-row: 40px; --today-bar: 34px; --today-gap: 24px; --today-room: calc((100% - 72px) / 2); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "chat left" "mail left"; grid-template-rows: auto 1fr; gap: 16px var(--today-gap); padding: 28px 24px 30px; }
  .today-desk > .scene-bar-box { inset: 28px calc(var(--today-room) + var(--today-gap) + 24px + 12px) auto auto; height: var(--today-bar); transform: none; }
  .today-chat .today-bar { padding-right: 212px; }
  .today-left { grid-area: left; align-self: stretch; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
  .today-mail { align-self: stretch; }
  .today-left > .today-count { flex: 1 0 auto; align-content: start; }
  .today-mails { --mail-pad: 10px; }
  /* The dot sits in the gap before an item, so a wrap clips the one that would start a line, never leaving one at an end */
  .today-ns { gap: 0 18px; overflow: hidden; }
  .today-n { position: relative; }
  .today-n + .today-n::before { content: "·"; position: absolute; bottom: 0; left: -9px; translate: -50% 0; color: var(--ink-3); }
  .today-dots { display: none; }
  .today-bar .today-app { margin-left: 0; }
  .today-ver .today-title { margin-left: 0; }
  .today-xls .today-bar .today-app { display: none; }
  .today-sheet td:nth-child(2) { white-space: normal; line-height: 18px; }
  /* A tablet's columns keep a part number and the Rev heading whole; the name takes two lines instead */
  .today-c1 { width: 88px; }
  .today-c3 { width: 40px; }
  .today-sheet td { padding-inline: 6px; }
}
/* A tablet's half of the desk is narrow for the pile: its strips step 8 px, so the newest copy's name and its question
   share a line */
@container (min-width: 680px) and (max-width: 1059px) {
  .today-ver:nth-child(1) { margin-right: 16px; }
  .today-ver:nth-child(2) { margin-inline: 8px; }
  .today-ver:nth-child(3) { margin-inline: 16px 0; }
}

/* Desktop: more room for the windows, at the same type as the hero's and In TERIO's mock-ups */
@container (min-width: 1060px) {
  .today-desk { --today-row: 46px; --today-bar: 36px; --today-gap: 36px; --today-room: calc((100% - 132px) * 11 / 19); grid-template-columns: minmax(0, 8fr) minmax(0, 11fr); gap: 14px var(--today-gap); padding: 32px 48px 28px; }
  .today-desk > .scene-bar-box { inset: 32px calc(var(--today-room) + var(--today-gap) + 48px + 12px) auto auto; }
  .today-dots, .today-xls .today-bar .today-app { display: flex; }
  .today-bar .today-app, .today-ver .today-title { margin-left: 4px; }
  .today-sheet td:nth-child(2) { white-space: nowrap; }
  .today-c1 { width: 25%; }
  .today-c3 { width: 10%; }
  .today-sheet td { padding-inline: 8px; }
  .today-mails li { padding: 9px 14px 10px 13px; }
  .today-msgs { padding: var(--msgs-top) 12px 12px; }
  .today-msgs-older { left: 12px; right: 12px; }
}

/* A phone's screen holds the tab row, one window and the tally, never the whole desk: the windows become tabs, as a
   phone switches between its apps, over the tally that stays. Each window keeps its own rows, so every count the tally
   names is still on the desk, a tab away. The windows share one cell, the tallest's height, so neither the tally nor
   the tab row moves when the window changes; the chat fills it and keeps its newest line at the foot, as a chat does,
   the morning's lines over it. Without script, or on a screen too short for it, the cards stand one under another. */
.today-tabs { grid-area: tabs; display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.today-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 44px; padding: 4px 8px; border: 0; border-radius: var(--r-sm); background: var(--card); box-shadow: var(--depth-card); color: var(--ink-2); font: 500 15px/20px var(--font-sans); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.today-tab .i { width: 15px; height: 15px; flex: none; stroke-width: 1.6; }
.today-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.today-tab[aria-selected="true"] { background: var(--selected); box-shadow: 0 0 0 1px var(--ink-2); color: var(--ink); font-weight: var(--w-title); cursor: default; }
.today-tab[aria-selected="true"] .i { color: var(--accent); }
@media (min-width: 360px) and (max-width: 759px) and (min-height: 600px) {
  body:not(.no-js) .today-desk { --today-fs: 15px; --today-sm: 14px; --today-row: 38px; --today-bar: 36px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "tabs" "win" "count"; gap: 8px; padding: 10px 10px 12px; }
  body:not(.no-js) .today-tabs { display: grid; }
  body:not(.no-js) .today-left { display: contents; }
  body:not(.no-js) :is(.today-chat, .today-sheets, .today-mail) { grid-area: win; align-self: start; }
  body:not(.no-js) .today-desk:not([data-tab="chat"]) .today-chat,
  body:not(.no-js) .today-desk:not([data-tab="sheet"]) .today-sheets,
  body:not(.no-js) .today-desk:not([data-tab="mail"]) .today-mail { visibility: hidden; }
  body:not(.no-js) .today-chat { align-self: stretch; display: flex; flex-direction: column; }
  body:not(.no-js) .today-chat .today-bar { padding-right: 12px; }
  body:not(.no-js) .today-chat .today-msgs { margin-top: auto; }
  body:not(.no-js) .today-chat .today-msgs-older { visibility: visible; }
  body:not(.no-js) .today-chat::after { height: 20px; opacity: 1; }
  body:not(.no-js) .today-desk > .scene-bar-box { position: relative; inset: auto; grid-area: count; align-self: start; justify-self: end; height: 44px; margin: 4px 6px 0 0; transform: none; z-index: 5; }
}
/* A narrow phone's window: the question stays on its copy's strip and the overwrite note on one line, so the sheet is
   no taller than the inbox */
@media (min-width: 360px) and (max-width: 389px) and (min-height: 600px) {
  body:not(.no-js) .today-desk { padding-inline: 8px; }
  body:not(.no-js) .today-ver-new { padding-block: 0; padding-left: 10px; }
  body:not(.no-js) .today-ver-new .today-tag { margin-left: auto; }
  body:not(.no-js) .today-ban .i { display: none; }
  body:not(.no-js) .today-c1 { width: 84px; }
}
