/* Condei — condei.app
 * The product story on the home page (docs/site-design-plan.md, "Product
 * story"). A live HTML replica of Condei for Mac — MacBoardInline frame 1,
 * the photo block from MacEditorAttachments, presence from
 * MacShareEditorLive — and the same note on an Android tablet
 * (AndroidTabletBoardInline) and iPhone (PhoneEditorBoard). Every
 * measurement below is the artboards' own. The Mac window is MacBoardInline
 * widened to 1560 × 800 points, so its note pane holds the whole board
 * (three 264-point columns, 12 apart: BoardTheme.swift) with no clipping;
 * each device is drawn at full size and scaled as one piece.
 *
 * Three ways it can render, and all of them show everything:
 *   - no JavaScript, or Reduce Motion: a static sequence. The six captions,
 *     then the window in its end state, then the tablet, the phone, the
 *     lock screen and the ciphertext.
 *   - .is-live (assets/story.js): the stage pins and the scroll scrubs the
 *     story. Only transform and opacity change while scrolling.
 * The colours are the site tokens, which are the app's own (the artboards'
 * light and dark values are the same hex pairs).
 */

/* ---------------------------------------------------------------- tokens */

.story {
  --ana: #587154;                      /* presence slot 1, both schemes */
  --m-brass-text: #8A6B3B;             /* brass for small text in the replica: 4.7:1 on paper, 4.9:1 on white */
  --m-tint: rgba(156, 122, 69, 0.12);
  --m-tint-ring: rgba(156, 122, 69, 0.22);
  --m-link-line: rgba(156, 122, 69, 0.45);
  --m-bar: rgba(251, 250, 248, 0.72);
  --m-side: rgba(255, 255, 255, 0.72);
  --m-search: rgba(27, 42, 65, 0.05);
  --m-light-edge: rgba(27, 42, 65, 0.12);
  --m-bg: radial-gradient(760px 520px at 4% -10%, rgba(156, 122, 69, 0.13), rgba(156, 122, 69, 0) 68%),
          radial-gradient(560px 440px at 99% 106%, rgba(27, 42, 65, 0.07), rgba(27, 42, 65, 0) 70%), var(--paper);
  --m-card-sh: 0 0 0 1px var(--line), 0 1px 2px rgba(27, 42, 65, 0.05);
  --m-hover-sh: 0 0 0 1px var(--line), 0 6px 16px -6px rgba(27, 42, 65, 0.18);
  --m-lift-sh: 0 4px 10px rgba(27, 42, 65, 0.10), 0 20px 40px -14px rgba(27, 42, 65, 0.34);
  --m-board-sh: inset 0 0 0 1px var(--line), 0 1px 1px rgba(27, 42, 65, 0.03), 0 10px 24px -14px rgba(27, 42, 65, 0.16);
  --m-photo-edge: rgba(27, 42, 65, 0.08);
  --m-window-sh: 0 0 0 1px rgba(27, 42, 65, 0.08), 0 2px 4px rgba(27, 42, 65, 0.05), 0 40px 90px -30px rgba(27, 42, 65, 0.42);
  --m-dot-0: #D9C48C; --m-dot-1: #B3A7C6; --m-dot-2: #A7BDA0; --m-dot-3: #E5DACA;
  --m-dot-4: #A3B6C9; --m-dot-5: #C99C98; --m-dot-6: #E5DACA; --m-dot-7: #E5DACA;
  --m-tag-0: #C99C98; --m-tag-1: #E5DACA; --m-tag-2: #E5DACA; --m-tag-3: #A7BDA0; --m-tag-4: #A3B6C9; --m-tag-5: #D9C48C;
  --m-chk-on: #FFFFFF;                 /* the tick on a filled checkbox */
  --m-on-brass: var(--ink);            /* a label on the brass fill */
  --m-del: #A6392E;
  --m-menu: rgba(251, 250, 248, 0.97);
  --m-pop-edge: rgba(27, 42, 65, 0.22);
  --m-pop-sh: 0 0 0 0.5px rgba(27, 42, 65, 0.22), 0 16px 40px -8px rgba(27, 42, 65, 0.28), 0 2px 6px rgba(27, 42, 65, 0.08);
}
@media (prefers-color-scheme: dark) {
  .story {
    --m-brass-text: var(--brass-text);
    --m-tint: rgba(201, 163, 102, 0.16);
    --m-tint-ring: rgba(201, 163, 102, 0.22);
    --m-link-line: rgba(201, 163, 102, 0.45);
    --m-bar: rgba(20, 21, 24, 0.72);
    --m-side: rgba(29, 31, 36, 0.72);
    --m-search: rgba(0, 0, 0, 0.09);
    --m-light-edge: rgba(0, 0, 0, 0.216);
    --m-bg: radial-gradient(760px 520px at 4% -10%, rgba(201, 163, 102, 0.13), rgba(201, 163, 102, 0) 68%),
            radial-gradient(560px 440px at 99% 106%, rgba(0, 0, 0, 0.126), rgba(0, 0, 0, 0) 70%), var(--paper);
    --m-card-sh: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.09);
    --m-hover-sh: 0 0 0 1px var(--line), 0 6px 16px -6px rgba(0, 0, 0, 0.324);
    --m-lift-sh: 0 0 0 1px var(--line), 0 20px 40px -12px rgba(0, 0, 0, 0.6);
    --m-board-sh: inset 0 0 0 1px var(--line), 0 1px 1px rgba(0, 0, 0, 0.054), 0 10px 24px -14px rgba(0, 0, 0, 0.288);
    --m-photo-edge: rgba(255, 255, 255, 0.06);
    --m-window-sh: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 90px -30px rgba(0, 0, 0, 0.75);
    --m-dot-0: #7A6A3E; --m-dot-1: #6F6388; --m-dot-2: #587154; --m-dot-3: #2A2D34;
    --m-dot-4: #586C84; --m-dot-5: #8D5C58; --m-dot-6: #2A2D34; --m-dot-7: #2A2D34;
    --m-tag-0: #8D5C58; --m-tag-1: #2A2D34; --m-tag-2: #2A2D34; --m-tag-3: #587154; --m-tag-4: #586C84; --m-tag-5: #7A6A3E;
    --m-chk-on: #141518;
    --m-on-brass: #141518;
    --m-del: #E4776A;
    --m-menu: rgba(29, 31, 36, 0.97);
    --m-pop-edge: rgba(0, 0, 0, 0.4);
    --m-pop-sh: 0 0 0 0.5px rgba(0, 0, 0, 0.396), 0 16px 40px -8px rgba(0, 0, 0, 0.504), 0 2px 6px rgba(0, 0, 0, 0.144), 0 0 0 1px #2A2D34;
  }
}

/* ------------------------------------------------- the static sequence */

.story { margin-top: clamp(40px, 2rem + 2.4vw, 72px); }

.st-wrap {
  width: 100%;
  max-width: calc(1400px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  gap: clamp(32px, 1.5rem + 2vw, 56px);
}

.st-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-5) clamp(24px, 1rem + 2vw, 48px); }
@media (min-width: 900px) { .st-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.st-step h3 { font-size: var(--t-h3); font-weight: 700; line-height: 1.3; letter-spacing: -0.008em; text-wrap: balance; }
.st-step p { margin-top: var(--s-1); max-width: 34ch; font-size: var(--t-body); line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.st-step .st-tag { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--s-2); font-size: var(--t-small); font-weight: 600; color: var(--muted); }
.st-tag::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); }
.st-rail { display: none; }

.st-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); margin-top: var(--s-5); }
.st-help { max-width: 44ch; font-size: var(--t-small); line-height: 1.5; color: var(--muted); }
.st-reset { min-height: 44px; padding: 8px 18px; font-size: var(--t-small); }
.st-copy { min-width: 0; }
.st-reset[hidden] { display: none; }
.st-help-touch { display: none; }
@media (pointer: coarse) {
  .st-help-fine { display: none; }
  .st-help-touch { display: inline; }
}
/* Nothing is draggable without the script, so its instructions stay away too. */
html:not(.js) .st-controls { display: none; }

.st-stage { display: grid; gap: clamp(32px, 1.5rem + 2vw, 56px); align-items: center; min-width: 0; }
@media (min-width: 900px) {
  .st-stage { grid-template-columns: minmax(0, 1fr) auto auto; }
  .st-frame--mac { grid-column: 1 / -1; }
  .st-frame--phone { grid-column: 2; grid-row: 2 / span 2; }
  .st-frame--lock { grid-column: 3; grid-row: 2 / span 2; }
}

/* The window's frame is a size container; the window inside it is scaled
   by --k, which story.js sets exactly and these steps approximate without
   it (they never round up, so the window never overflows its frame). */
.st-frame--mac { container: st / inline-size; min-width: 0; }
.st-box {
  --k: 0.2;
  --cx: 0;
  position: relative;
  width: 100%;
  height: calc(800px * var(--k));
  overflow: clip;
  border-radius: calc(12px * var(--k) + 2px);
  box-shadow: var(--m-window-sh);
}
.st-frame--phone, .st-frame--lock { justify-self: center; align-self: center; }
.st-pbox { --kp: 0.5; width: calc(414px * var(--kp)); height: calc(868px * var(--kp)); }
.st-pbox .ph { transform: scale(var(--kp)); transform-origin: 0 0; }
.st-lbox { --kl: 0.5; width: calc(414px * var(--kl)); height: calc(868px * var(--kl)); }
.st-lbox .ph { transform: scale(var(--kl)); transform-origin: 0 0; }
.st-frame--tab { container: stt / inline-size; min-width: 0; max-width: 820px; }
.st-tbox { --kt: 0.2; width: calc(1308px * var(--kt)); height: calc(828px * var(--kt)); }
.st-tbox .tb { transform: scale(var(--kt)); transform-origin: 0 0; }

/* ----------------------------------------------------- the Mac window */

.mw {
  position: absolute;
  left: 0;
  top: 0;
  width: 1560px;
  height: 800px;
  display: flex;
  flex-direction: column;
  overflow: clip;
  background: var(--m-bg);
  color: var(--ink);
  font-family: "Karla", system-ui, sans-serif;
  font-size: 16px;
  line-height: normal;
  text-align: left;
  transform: scale(var(--k)) translateX(calc(var(--cx) * -1px));
  transform-origin: 0 0;
  -webkit-user-select: none;
  user-select: none;
}
.mw p, .mw ol, .mw ul { margin: 0; padding: 0; }
.mw svg { display: block; max-width: none; }
.mw-flex { flex: 1; }
.mw-vr { flex: none; width: 1px; align-self: stretch; background: var(--line); }

.mw-bar { flex: none; display: flex; align-items: stretch; height: 52px; background: var(--m-bar); border-bottom: 1px solid var(--line); }
.mw-bar-side { width: 240px; display: flex; align-items: center; gap: 14px; padding: 0 10px 0 20px; }
.mw-lights { display: flex; align-items: center; gap: 8px; }
.mw-lights i { width: 12px; height: 12px; border-radius: 6px; background: #FF5F57; box-shadow: inset 0 0 0 0.5px var(--m-light-edge); }
.mw-lights i:nth-child(2) { background: #FEBC2E; }
.mw-lights i:nth-child(3) { background: #28C840; }
.mw-bar-list { width: 320px; display: flex; align-items: center; gap: 4px; padding: 0 10px; }
.mw-bar-note { flex: 1; display: flex; align-items: center; gap: 6px; padding: 0 20px 0 12px; }
.mw-groups { display: flex; align-items: center; }
.mw-group { display: flex; align-items: center; gap: 2px; }
.mw-sep { flex: none; width: 1px; height: 20px; margin: 0 4px; background: var(--line); }
.mw-tool { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.mw-tool--on { color: var(--brass-text); background: var(--m-tint); }
.mw-share > svg { opacity: 0; }
.mw-presence { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.mw-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ana); color: #ECEDEF; font-size: 11px; font-weight: 700;
  box-shadow: 0 0 0 1.5px var(--paper), 0 0 0 3.5px var(--ana);
}

.mw-main { flex: none; display: flex; height: 748px; }
.mw-cols { display: flex; height: 748px; }

.mw-side { width: 240px; height: 748px; display: flex; flex-direction: column; padding: 10px 10px 8px; background: var(--m-side); overflow: clip; }
.mw-sgroup { display: flex; flex-direction: column; gap: 2px; }
.mw-shead { display: flex; align-items: center; height: 26px; padding: 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.mw-side .mw-shead { margin-top: 14px; }
.mw-srow { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 10px; }
.mw-srow--on { background: var(--m-tint); }
/* The top group's selection is one plate that travels from row to row. */
.mw-sgroup--top { position: relative; }
.mw-sgroup--top .mw-srow { position: relative; }
.mw-sgroup--top .mw-srow--on { background: none; }
.mw-sel { position: absolute; left: 0; right: 0; top: 0; height: 32px; border-radius: 10px; background: var(--m-tint); transform: translateY(68px); }
.mw-srow--f { gap: 8px; padding: 0 10px 0 8px; }
.mw-srow--sub { padding-left: 28px; }
.mw-sico { display: flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; color: var(--muted); }
.mw-sico.is-on { color: var(--brass-text); }
.mw-chev { display: flex; flex: none; width: 12px; height: 12px; color: var(--muted); }
.mw-slabel { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-srow--on .mw-slabel { font-weight: 600; }
.mw-srow--f .mw-slabel { letter-spacing: 0; }
.mw-count { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.mw-tag { flex: none; width: 10px; height: 10px; border-radius: 5px; }
.mw-tag--0 { background: var(--m-tag-0); } .mw-tag--1 { background: var(--m-tag-1); } .mw-tag--2 { background: var(--m-tag-2); }
.mw-tag--3 { background: var(--m-tag-3); } .mw-tag--4 { background: var(--m-tag-4); } .mw-tag--5 { background: var(--m-tag-5); }
.mw-srow--del { margin-bottom: 10px; }
.mw-brand { display: flex; align-items: center; height: 50px; padding: 8px 10px 0; border-top: 1px solid var(--line); }
.mw-brand svg { height: 25px; width: auto; color: var(--ink); }
.mw-vault { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; font-size: 11.5px; font-weight: 500; letter-spacing: 0.01em; color: var(--muted); }
.mw-vault-ico { display: flex; width: 14px; height: 14px; color: var(--brass-text); }

.mw-list { position: relative; width: 320px; height: 748px; display: flex; flex-direction: column; background: var(--raised); overflow: clip; }
/* Upcoming (MacUpcoming, MacCardReminderUpcoming), laid over All Notes. */
.mw-up { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--raised); }
.mw-up .mw-shead { margin-top: 4px; }
.mw-rbell { display: flex; width: 12px; height: 12px; color: var(--brass-text); }
.mw-rmeta .mw-rbell + span { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.mw-rboard { display: flex; flex: none; width: 12px; height: 12px; color: var(--muted); }
.mw-ntitle .mw-rboard + span { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-search { flex: none; padding: 12px; border-bottom: 1px solid var(--line); }
.mw-search-box { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border-radius: 10px; background: var(--m-search); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.mw-search-box span { flex: 1; font-size: 13px; }
.mw-search-box kbd { font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.mw-lbody { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; }
.mw-lbody .mw-shead { margin-bottom: -2px; }
.mw-nrow { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border-radius: 10px; }
.mw-nrow--on { background: var(--m-tint); box-shadow: inset 0 0 0 1px var(--m-tint-ring); }
.mw-ntitle { display: flex; align-items: center; gap: 8px; }
.mw-ntitle span:last-child { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-ndot { flex: none; width: 8px; height: 8px; border-radius: 4px; }
.mw-ndot--0 { background: var(--m-dot-0); } .mw-ndot--1 { background: var(--m-dot-1); } .mw-ndot--2 { background: var(--m-dot-2); } .mw-ndot--3 { background: var(--m-dot-3); }
.mw-ndot--4 { background: var(--m-dot-4); } .mw-ndot--5 { background: var(--m-dot-5); } .mw-ndot--6 { background: var(--m-dot-6); } .mw-ndot--7 { background: var(--m-dot-7); }
.mw-nprev { font-size: 12.5px; line-height: 17px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-nmeta { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; color: var(--muted); }
.mw-nmeta span:first-child { font-weight: 500; font-variant-numeric: tabular-nums; }
.mw-nmeta i, .mw-meta i { flex: none; width: 3px; height: 3px; border-radius: 2px; background: var(--muted); }

/* The note pane. Without JavaScript the note sits scrolled to its board
   (the story's end state); story.js scrolls it with a transform. */
.mw-pane { flex: 1; min-width: 0; height: 748px; position: relative; background: var(--paper); overflow: clip; }
.mw-scroll { position: absolute; inset: 0; transform: translateY(var(--ns-end, -541px)); }
.mw-note { position: absolute; left: 79px; top: 40px; width: 840px; display: flex; flex-direction: column; }
.mw-title { font-size: 30px; font-weight: 700; line-height: 38px; letter-spacing: -0.018em; }
.mw-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; white-space: nowrap; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.mw-meta-f { font-weight: 400; }
.mw-e2e { display: flex; align-items: center; gap: 5px; }
.mw-e2e svg { color: var(--brass-text); }
.mw-shared { position: absolute; left: 0; top: 70px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.mw-text { margin-top: 28px; font-size: 16px; line-height: 27px; letter-spacing: 0.002em; }
.mw-link { color: var(--m-brass-text); text-decoration: underline; text-decoration-color: var(--m-link-line); text-underline-offset: 3px; }
.mw-gap { margin-top: 20px !important; font-size: 16px; line-height: 27px; letter-spacing: 0.002em; }
.mw-photo { position: relative; flex: none; width: 840px; height: 420px; margin-top: 12px; border-radius: 12px; overflow: hidden; }
.mw-photo::after { content: ""; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--m-photo-edge); }
.mw-photo-img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.mw-last { margin-top: 18px !important; font-size: 16px; line-height: 27px; letter-spacing: 0.002em; white-space: nowrap; }
.mw-ana-text { display: inline-block; white-space: pre; }
.mw-caret { position: relative; display: inline-block; width: 2px; height: 20px; margin: 0 -1px; vertical-align: -4px; border-radius: 1px; background: var(--ana); }
.mw-flag {
  position: absolute; left: -1px; bottom: 20px; height: 18px; padding: 0 8px;
  border-radius: 4px 4px 4px 0; background: var(--ana); color: #ECEDEF;
  font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap;
}
.mw-pointer { position: absolute; left: 0; top: 0; z-index: 12; opacity: 0; pointer-events: none; transform-origin: 2px 2px; }
.mw-pointer path { fill: #1B2A41; stroke: #FFFFFF; stroke-width: 1.4; stroke-linejoin: round; }

/* The checklist (MacReminderPopover's editor): a 19-point box, brass when
   ticked, the tick drawn, the title fading to secondary with its strike.
   story.js drives --d (fill), --b (the box's spring), --c (the tick) and
   --s (the strike, 60 ms behind); the classes are the end state. */
.mw-cl { margin-top: 14px !important; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.mw-cl li { display: flex; }
.cl-row { display: inline-flex; align-items: flex-start; gap: 12px; margin: 0 -6px; padding: 0 6px; border-radius: 7px; font-size: 16px; line-height: 26px; outline: none; -webkit-tap-highlight-color: transparent; }
.cl-row[tabindex] { cursor: pointer; }
.cl-row[aria-disabled] { cursor: default; }
.cl-box { position: relative; flex: none; width: 19px; height: 19px; margin-top: 4px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--muted); }
.cl-fill { position: absolute; inset: 0; border-radius: 6px; background: var(--brass-text); opacity: var(--d, 0); transform: scale(var(--b, 1)); }
.cl-check { position: absolute; left: 3.5px; top: 3.5px; color: var(--m-chk-on); }
.cl-check path { stroke-dasharray: 20; stroke-dashoffset: calc((1 - var(--c, 0)) * 20); }
.cl-t { position: relative; color: color-mix(in srgb, var(--muted) calc(var(--s, 0) * 100%), var(--ink)); }
.cl-t::after { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 1.25px; background: currentColor; transform-origin: 0 50%; transform: scaleX(var(--s, 0)); }
.cl.is-done { --d: 1; --c: 1; --s: 1; }
.cl-row:focus-visible { box-shadow: 0 0 0 1.5px var(--brass-text), 0 0 0 4.5px var(--m-tint-ring); }
@media (hover: hover) and (pointer: fine) { .cl-row[tabindex]:hover .cl-box { box-shadow: inset 0 0 0 1.5px var(--ink); } }
.mw-ucaret { position: absolute; left: 0; top: 0; width: 2px; height: 20px; border-radius: 1px; background: var(--brass-text); opacity: 0; pointer-events: none; }

/* A card's own reminder on its face (board-spec §5.13): a bell and the time
   under the notes. A card in a done column shows none. */
.bc-rem { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; line-height: 16px; color: var(--muted); }
.bc-rem svg { flex: none; }
.bc.no-rem .bc-rem, .mb-col--done .bc-rem, .tb-col[data-col="done"] .bc-rem { display: none; }

/* The card menu (board-spec §5.7, in MacListContextMenu's idiom) and the
   reminder popover (MacReminderPopover). Both are shown only while the story
   plays them. */
.mm, .rp { position: absolute; left: 0; top: 0; z-index: 9; opacity: 0; visibility: hidden; pointer-events: none; box-shadow: var(--m-pop-sh); }
.mm { width: 236px; padding: 5px; border-radius: 10px; background: var(--m-menu); display: flex; flex-direction: column; transform-origin: 0 0; }
.mm-row { display: flex; align-items: center; gap: 8px; height: 24px; padding: 0 10px 0 28px; border-radius: 5px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.mm-l { flex: 1; }
.mm-chev { display: flex; color: var(--muted); }
.mm-row--del { color: var(--m-del); }
.mm-div { height: 1px; margin: 5px 10px; background: var(--line); }
.mm-pal { display: flex; gap: 4px; padding: 1px 4px; }
.mm-ico { position: relative; flex: 1; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink); }
.mm-ico svg { position: relative; }
.mm-ico--bell::before { content: ""; position: absolute; inset: 0; border-radius: 6px; background: var(--brass); opacity: var(--hot, 0); }

.rp { width: 316px; padding: 10px 8px 12px; border-radius: 12px; background: var(--raised); display: flex; flex-direction: column; transform-origin: 158px 0; }
.rp-arrow { position: absolute; left: 151px; top: -6px; width: 13px; height: 13px; background: var(--raised); transform: rotate(45deg); border-radius: 2px 0 0 0; box-shadow: -0.5px -0.5px 0 0 var(--m-pop-edge); }
.rp-h { position: relative; padding: 0 10px 8px !important; font-size: 13px; font-weight: 700; }
.rp-qs { display: flex; flex-direction: column; gap: 2px; }
.rp-q { position: relative; display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 10px 0 9px; border-radius: 7px; }
.rp-q > span { position: relative; }
.rp-q--pick::before { content: ""; position: absolute; inset: 0; border-radius: 7px; background: var(--m-tint); opacity: var(--pk, 1); }
.rp-ico { display: flex; color: var(--muted); }
.rp-q--pick.is-on .rp-ico { color: var(--brass-text); }
.rp-l { flex: 1; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.rp-q--pick.is-on .rp-l { font-weight: 600; }
.rp-w { font-size: 12.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-ok { display: flex; width: 14px; color: var(--brass-text); }
.rp-ok svg { opacity: var(--ok, 1); transform: scale(var(--okb, 1)); }
.rp-div { height: 1px; margin: 6px 4px; background: var(--line); }
.rp-line { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; }
.rp-k { flex: 1; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.rp-f { position: relative; display: flex; align-items: center; height: 22px; padding: 0 6px; border-radius: 5px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-f--d { width: 88px; }
.rp-f--t { width: 46px; }
.rp-v { opacity: calc(1 - var(--pv, 1)); }
.rp-v--b { position: absolute; left: 6px; top: 0; line-height: 22px; opacity: var(--pv, 1); }
.rp-st { display: flex; align-items: center; justify-content: center; width: 13px; height: 22px; border-radius: 5px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.rp-gap { width: 2px; }
.rp-pop { display: flex; align-items: center; gap: 10px; height: 22px; padding: 0 3px 0 9px; border-radius: 6px; background: var(--raised); box-shadow: 0 0 0 0.5px var(--m-pop-edge), 0 1px 1px rgba(27, 42, 65, 0.08); font-size: 13px; }
.rp-popi { display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; color: var(--muted); }
.rp-foot { display: flex; justify-content: flex-end; padding: 4px 4px 0 10px; }
.rp-set { height: 28px; padding: 0 14px; border-radius: 10px; background: var(--brass); display: flex; align-items: center; font-size: 13px; font-weight: 700; color: var(--m-on-brass); white-space: nowrap; transform: scale(var(--pr, 1)); }

/* ---------------------------------------------------------- the board */

.mb { position: relative; flex: none; width: 840px; margin-top: 18px; border-radius: 14px; background: var(--raised); box-shadow: var(--m-board-sh); overflow: clip; }
.mb-head { height: 36px; display: flex; align-items: center; justify-content: flex-end; padding: 0 6px; }
.mb-clip { position: relative; overflow: clip; }
.mb-track { position: relative; display: flex; align-items: flex-start; gap: 12px; width: max-content; padding: 0 12px 12px; }
.mb-col { flex: none; width: 264px; display: flex; flex-direction: column; gap: 8px; }
.mb-colhead { flex: none; height: 32px; display: flex; align-items: center; gap: 6px; padding-left: 4px; }
.mb-name { font-size: 15px; font-weight: 600; white-space: nowrap; }
.mb-count { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.mb-colmenu { flex: none; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 7px; color: var(--muted); }
.mb-cards { display: flex; flex-direction: column; gap: 8px; list-style: none; }
.mb-add { flex: none; height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 4px; color: var(--m-brass-text); font-size: 16px; font-weight: 600; }
.mb-fade { display: none; position: absolute; top: 0; bottom: 1px; width: 24px; pointer-events: none; }
.mb-fade--r { right: 1px; background: linear-gradient(to right, transparent, var(--raised)); }
.mb-fade--l { left: 1px; background: linear-gradient(to left, transparent, var(--raised)); }

.bc {
  --d: 0;
  --lift: 0;
  position: relative;
  flex: none;
  width: 264px;
  padding: 12px;
  border-radius: 10px;
  background: var(--raised);
  box-shadow: var(--m-card-sh);
  cursor: grab;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.mb-col--done .bc { --d: 1; }
/* The brass ring a card wears for a moment when it arrives from another device. */
.bc::before, .tc::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 0 2px var(--brass), 0 0 0 6px var(--m-tint-ring);
  opacity: var(--ring, 0);
  pointer-events: none;
}
.bc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--m-lift-sh);
  opacity: var(--lift);
  pointer-events: none;
}
.bc-tick { position: absolute; left: 12px; top: 14.5px; color: var(--brass-text); }
.bc-tick path { stroke-dasharray: 20; stroke-dashoffset: calc((1 - var(--d)) * 20); }
.bc-body { display: block; transform: translateX(calc(var(--sh, var(--d)) * 24px)); }
.bc-t { display: block; font-size: 16px; line-height: 21px; color: color-mix(in srgb, var(--muted) calc(var(--d) * 100%), var(--ink)); }
.bc-n { display: block; margin-top: 4px; font-size: 14px; line-height: 19px; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .bc:hover { box-shadow: var(--m-hover-sh); } }
/* MacBoardInline's own keyboard selection: a brass ring and a soft halo. */
.bc:focus-visible { box-shadow: 0 0 0 1.5px var(--brass-text), 0 0 0 4.5px var(--m-tint-ring); }
.bc.is-lifted { z-index: 5; cursor: grabbing; }

/* story.js lays the cards out itself, so a card can travel between
   columns: absolute, moved by transform only. */
.mb.is-abs .bc { position: absolute; left: 0; top: 0; will-change: transform; }
.mb.is-abs .mb-add { position: absolute; left: 0; top: 0; width: 264px; will-change: transform; }
.mb.is-abs .mb-cards { display: block; }

/* -------------------------------------------------------------- iPhone */

.ph {
  width: 414px; height: 868px; padding: 12px; border-radius: 62px;
  background: #1B1D22;
  box-shadow: inset 0 0 0 1.5px #3A3D45, 0 40px 80px -30px rgba(27, 42, 65, 0.45);
  font-family: "Karla", system-ui, sans-serif; color: var(--ink); line-height: normal; text-align: left;
}
@media (prefers-color-scheme: dark) { .ph { box-shadow: inset 0 0 0 1.5px #3A3D45, 0 40px 80px -30px rgba(0, 0, 0, 0.8); } }
.ph p, .ph ol { margin: 0; padding: 0; }
.ph svg { display: block; max-width: none; flex: none; }
.ph-screen { display: flow-root; position: relative; width: 390px; height: 844px; border-radius: 50px; overflow: clip; background: var(--paper); }
.ph-island { position: absolute; top: 11px; left: 50%; width: 122px; height: 35px; margin-left: -61px; border-radius: 20px; background: #000; }
.ph-nav { display: flex; align-items: center; justify-content: space-between; height: 44px; margin-top: 44px; padding: 0 12px; background: var(--m-bar); border-bottom: 1px solid var(--line); }
.ph-back { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px 0 4px; color: var(--m-brass-text); font-size: 17px; font-weight: 500; letter-spacing: -0.2px; }
.ph-act { display: flex; color: var(--muted); }
.ph-act svg { margin: 11.5px; }
.ph-body { padding: 14px 20px 0; }
.ph-title { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.5px; }
.ph-meta { display: flex; align-items: center; gap: 7px; margin-top: 6px !important; font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; }
.ph-meta b { font-weight: 500; }
.ph-e2e { display: flex; align-items: center; gap: 5px; }
.ph-e2e svg { color: var(--brass-text); }
.ph-p { margin-top: 14px !important; font-size: 17px; line-height: 26px; }
.ph-meta + .ph-p { margin-top: 18px !important; }
.ph-cl { margin-top: 12px !important; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ph-cl li, .tb-cl li { display: flex; align-items: flex-start; gap: 10px; font-size: 17px; line-height: 24px; }
.ph-box, .tb-box { flex: none; width: 20px; height: 20px; margin-top: 2px; display: flex; align-items: center; justify-content: center; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--muted); color: var(--m-chk-on); }
.ph-box svg, .tb-box svg { visibility: hidden; }
.ph-cl .is-done .ph-box, .tb-cl .is-done .tb-box { background: var(--brass-text); box-shadow: none; }
.ph-cl .is-done svg, .tb-cl .is-done svg { visibility: visible; }
.ph-cl .is-done span:last-child, .tb-cl .is-done span:last-child { color: var(--muted); text-decoration: line-through; }
.ph-photo { height: 197px; margin-top: 14px; border-radius: 12px; overflow: hidden; }

.ph-strip { margin-top: 14px; display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--m-board-sh); overflow: hidden; }
.ph-cols { height: 104px; display: flex; gap: 10px; padding: 12px; }
.ph-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ph-colhead { height: 18px; display: flex; align-items: baseline; gap: 5px; font-size: 13px; line-height: 18px; white-space: nowrap; }
.ph-colhead b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.ph-count { color: var(--muted); }
.ph-card { height: 22px; display: flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 6px; background: var(--paper); font-size: 13px; line-height: 22px; white-space: nowrap; }
.ph-card span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ph-card svg { display: none; color: var(--brass-text); }
.ph-col--done .ph-card svg { display: block; }
.ph-col--done .ph-card span { color: var(--muted); }
.ph-card.is-empty { visibility: hidden; }
.ph-add { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-top: 1px solid var(--line); color: var(--m-brass-text); font-size: 16px; font-weight: 600; }

/* ------------------------------------------- the iPhone lock screen */
/* PhoneCardReminderNotification: the card's reminder, long-pressed, on a
   lock screen whose wallpaper is a holiday photo. */
.lk-screen { background: #1B1D22; }
.lk-wall { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 30% 50%; }
.lk-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 14, 22, 0.42) 0%, rgba(10, 14, 22, 0.08) 42%, rgba(10, 14, 22, 0.3) 100%); }
.lk-top { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 54px; color: #FFFFFF; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.3); }
.lk-date { padding-top: 6px; font-size: 20px; line-height: 26px; font-weight: 600; }
.lk-time { font-size: 80px; line-height: 82px; font-weight: 600; letter-spacing: -2.5px; }
.lk-stack { position: absolute; left: 12px; right: 12px; top: 206px; }
.lk-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 16px 14px; border-radius: 22px; background: var(--raised); box-shadow: 0 0 0 1px var(--line), 0 14px 34px -18px rgba(27, 42, 65, 0.4); }
.lk-icon { flex: none; width: 38px; height: 38px; border-radius: 9px; }
.lk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lk-ts { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 18px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); }
.lk-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lk-row b { font-size: 15px; line-height: 20px; font-weight: 700; letter-spacing: -0.2px; }
.lk-row span { font-size: 13px; line-height: 18px; color: var(--muted); }
.lk-body { font-size: 15px; line-height: 20px; letter-spacing: -0.2px; }
.lk-acts { width: 250px; margin-top: 10px; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--raised); box-shadow: 0 0 0 1px var(--line), 0 14px 34px -18px rgba(27, 42, 65, 0.4); transform-origin: 0 0; }
.lk-act { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 18px; border-top: 1px solid var(--line); font-size: 17px; line-height: 22px; }
.lk-act:first-child { border-top: 0; }
.lk-act span { flex: 1; white-space: nowrap; }
.lk-bottom { position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: space-between; padding: 0 36px; }
.lk-bottom i { width: 50px; height: 50px; border-radius: 25px; background: rgba(255, 255, 255, 0.2); }

/* ---------------------------------------------- what the server stores */

.st-cipher {
  margin: 0;
  justify-self: start;
  min-width: 0;
  max-width: min(19rem, 100%);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--radius);
  background: var(--raised);
  box-shadow: var(--shadow);
}
.st-cipher-label { font-size: var(--t-small); font-weight: 600; color: var(--muted); text-wrap: balance; }
.st-cipher-plain { margin-top: var(--s-1); font-size: var(--t-body); color: var(--ink); }
.st-cipher-bytes {
  margin-top: var(--s-2);
  max-width: 100%;
  overflow: clip;
  white-space: nowrap;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--t-micro);
  line-height: 1.7;
  letter-spacing: 0.02em;
  word-spacing: 0.15em;
  color: var(--muted);
  /* The bytes stream past; fade them out at the card's edge rather than cut a glyph in half. */
  mask-image: linear-gradient(90deg, #000 calc(100% - 2.5em), transparent);
}
.st-cipher-bytes span { display: inline-block; }

/* ------------------------------------------------------ Android tablet */
/* AndroidTabletBoardInline at 1280 × 800 dp without its navigation rail (the
   list-detail layout of AndroidTabletNoteEditing), so the detail pane's text
   column holds the whole board. In a 14 dp bezel. */

.tb {
  position: relative;
  width: 1308px; height: 828px; padding: 14px; border-radius: 34px;
  background: #1B1D22;
  box-shadow: inset 0 0 0 1.5px #3A3D45, 0 40px 80px -30px rgba(27, 42, 65, 0.45);
  font-family: "Karla", system-ui, sans-serif; color: var(--ink); line-height: normal; text-align: left;
}
@media (prefers-color-scheme: dark) { .tb { box-shadow: inset 0 0 0 1.5px #3A3D45, 0 40px 80px -30px rgba(0, 0, 0, 0.8); } }
.tb p, .tb ol, .tb ul { margin: 0; padding: 0; }
.tb svg { display: block; max-width: none; flex: none; }
.tb-cam { position: absolute; top: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #2C2F36; }
.tb-screen { width: 1280px; height: 800px; display: flex; flex-direction: column; border-radius: 20px; overflow: clip; background: var(--paper); }
.tb-status { flex: none; height: 24px; display: flex; align-items: center; padding: 0 24px; font-size: 12px; font-weight: 600; }
.tb-nav { flex: none; height: 24px; display: flex; align-items: center; justify-content: center; }
.tb-nav i { width: 108px; height: 4px; border-radius: 2px; background: var(--ink); opacity: 0.32; }
.tb-panes { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 8px 12px; }
.tb-list, .tb-ed { display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: 20px; overflow: clip; box-shadow: 0 1px 3px rgba(27, 42, 65, 0.04); }
.tb-list { flex: none; width: 300px; }
.tb-ed { flex: 1; min-width: 0; }
.tb-btn { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 24px; color: var(--ink); }
.tb-btn--s { width: 40px; height: 40px; color: var(--muted); }
.tb-btn--on { color: var(--brass-text); background: var(--m-tint); }
.tb-lhead { flex: none; height: 64px; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 20px; }
.tb-lhead p { flex: 1; display: flex; align-items: baseline; gap: 8px; }
.tb-lhead b { font-size: 22px; line-height: 28px; font-weight: 500; }
.tb-lhead span { font-size: 14px; color: var(--muted); }
.tb-search { flex: none; height: 48px; margin: 0 12px 12px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-radius: 24px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.tb-lsec { flex: none; height: 36px; display: flex; align-items: center; padding: 0 20px; font-size: 14px; font-weight: 500; color: var(--muted); }
.tb-row { flex: none; display: flex; flex-direction: column; gap: 4px; margin: 0 8px 2px; padding: 12px; border-radius: 10px; }
.tb-row--on { background: var(--m-tint); }
.tb-rtitle { display: flex; align-items: center; gap: 10px; }
.tb-rtitle .mw-ndot { width: 10px; height: 10px; border-radius: 5px; }
.tb-rtitle b { flex: 1; min-width: 0; font-size: 16px; line-height: 22px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-row--on b { font-weight: 600; }
.tb-rtitle span { flex: none; font-size: 12px; line-height: 22px; color: var(--muted); }
.tb-rprev { font-size: 14px; line-height: 20px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-bar { flex: none; height: 64px; display: flex; align-items: center; gap: 4px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.tb-tools { flex: none; height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 8px; border-top: 1px solid var(--line); }
.tb-tools .tb-btn:not(.tb-btn--on) { color: var(--ink); }
/* The detail pane sits scrolled so the whole board shows, as at the end of the story. */
.tb-view { flex: 1; min-height: 0; position: relative; overflow: clip; }
.tb-scroll { position: absolute; left: 20px; right: 20px; top: 16px; display: flex; flex-direction: column; gap: 10px; transform: translateY(-404px); }
.tb-title { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.2px; }
.tb-meta { display: flex; align-items: center; gap: 8px; margin-top: -4px !important; font-size: 12px; line-height: 18px; color: var(--muted); }
.tb-saved { display: flex; color: var(--brass-text); }
.tb-p { font-size: 17px; line-height: 28px; }
.tb-cl { list-style: none; display: flex; flex-direction: column; gap: 4px; visibility: hidden; } /* scrolled out of view above the photo */
.tb-photo { flex: none; height: 300px; border-radius: 12px; overflow: hidden; }
.tb-board { flex: none; position: relative; overflow: clip; background: var(--raised); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 10px rgba(27, 42, 65, 0.05); }
.tb-bhead { height: 40px; display: flex; justify-content: flex-end; align-items: center; padding: 0 4px; }
.tb-track { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 0 12px 8px; }
.tb-col { flex: none; width: 264px; display: flex; flex-direction: column; gap: 8px; }
.tb-colhead { flex: none; height: 36px; display: flex; align-items: center; gap: 6px; padding-left: 4px; }
.tb-colhead b { font-size: 15px; font-weight: 600; }
.tb-count { font-size: 14px; color: var(--muted); }
.tb-colmenu { flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.tb-cards { display: flex; flex-direction: column; gap: 8px; list-style: none; }
.tb-add { flex: none; height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 4px; color: var(--m-brass-text); font-size: 16px; font-weight: 600; }
.tc { --d: 0; position: relative; width: 264px; padding: 12px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(27, 42, 65, 0.05); }
.tc::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: var(--m-lift-sh); opacity: var(--lift, 0); pointer-events: none; }
.tb-col[data-col="done"] .tc { --d: 1; }
.tc .bc-tick { position: absolute; left: 12px; top: 15px; color: var(--brass-text); }
.tc-t { display: block; font-size: 16px; line-height: 22px; color: color-mix(in srgb, var(--muted) calc(var(--d) * 100%), var(--ink)); }
.tc-n { display: block; margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--muted); }
.tb-touch { position: absolute; left: 0; top: 0; z-index: 6; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(27, 42, 65, 0.16); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7); opacity: 0; pointer-events: none; }
@media (prefers-color-scheme: dark) { .tb-touch { background: rgba(236, 237, 239, 0.22); box-shadow: inset 0 0 0 2px rgba(236, 237, 239, 0.5); } }
.tb-board.is-abs .tc { position: absolute; left: 0; top: 0; will-change: transform; }
.tb-board.is-abs .tb-add { position: absolute; left: 0; top: 0; width: 264px; }
.tb-board.is-abs .tb-cards { display: block; }

/* ================================================================ live */

/* Wide screens: one caption band on top, the devices filling the rest. */
.story.is-live { --st-len: 700svh; height: var(--st-len); margin-top: clamp(8px, 1vw, 24px); }
.is-live .st-pin {
  position: sticky;
  top: var(--hdr, 72px);
  height: calc(100svh - var(--hdr, 72px));
  overflow: clip;
}
.is-live .st-wrap {
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(16px, 2.6vh, 32px);
  padding-block: clamp(14px, 2.6vh, 32px);
}
.is-live .st-copy { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4) var(--s-7); padding-left: var(--s-5); }
.is-live .st-steps { flex: 1 1 32rem; max-width: 40rem; display: grid; grid-template-columns: none; }
.is-live .st-step { grid-area: 1 / 1; align-self: end; opacity: 0; transition: opacity 280ms ease; }
.is-live .st-step.is-on { opacity: 1; }
.is-live .st-step p { max-width: 52ch; }
.is-live .st-rail { display: block; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.is-live .st-rail i { position: absolute; inset: 0; background: var(--brass); transform-origin: 0 0; transform: scaleY(0); }
.is-live .st-controls { flex: 0 1 auto; margin-top: 0; justify-content: flex-end; opacity: 0; transition: opacity 280ms ease; }
.is-live .st-help { max-width: 40ch; }
.is-live.is-board .st-controls { opacity: 1; }
.is-live .st-stage { position: relative; display: block; height: 100%; }
.is-live .st-frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform, opacity; }
.is-live .st-frame--phone, .is-live .st-frame--tab, .is-live .st-frame--lock { opacity: 0; }
.is-live .st-cipher { position: absolute; left: 0; top: 0; transform-origin: 0 0; opacity: 0; will-change: transform, opacity; }
.is-live .st-cipher-bytes { mask-image: linear-gradient(90deg, transparent, #000 1.5em, #000 calc(100% - 2.5em), transparent); }
.is-live .st-box { width: auto; }
.is-live .st-tbox { width: calc(1308px * var(--kt)); }

@media (max-width: 1023px) {
  .is-live .st-copy { flex-wrap: wrap; }
  .is-live .st-controls { justify-content: flex-start; }
}
@media (max-width: 759px) {
  .story.is-live { --st-len: 560svh; }
  .is-live .st-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; align-items: stretch; gap: var(--s-4); }
  .is-live .st-copy { order: 2; display: block; min-height: 10rem; padding-left: var(--s-6); }
  .is-live .st-stage { order: 1; }
  .is-live .st-step p { font-size: var(--t-small); }
  .is-live .st-cipher { padding: var(--s-3) var(--s-4); }
  .is-live .st-controls { margin-top: var(--s-3); justify-content: flex-start; }
}

/* Without story.js: each device's scale, stepped by its frame's width (they
   never round up, so nothing overflows its frame). Narrow frames crop the
   window to its note pane (x 631-1491), as the live stage does. */
@container st (min-width: 280px) { .st-box { --k: 0.326; --cx: 631; } }
@container st (min-width: 310px) { .st-box { --k: 0.36; --cx: 631; } }
@container st (min-width: 340px) { .st-box { --k: 0.395; --cx: 631; } }
@container st (min-width: 370px) { .st-box { --k: 0.43; --cx: 631; } }
@container st (min-width: 400px) { .st-box { --k: 0.465; --cx: 631; } }
@container st (min-width: 430px) { .st-box { --k: 0.5; --cx: 631; } }
@container st (min-width: 460px) { .st-box { --k: 0.535; --cx: 631; } }
@container st (min-width: 490px) { .st-box { --k: 0.57; --cx: 631; } }
@container st (min-width: 520px) { .st-box { --k: 0.605; --cx: 631; } }
@container st (min-width: 550px) { .st-box { --k: 0.64; --cx: 631; } }
@container st (min-width: 580px) { .st-box { --k: 0.674; --cx: 631; } }
@container st (min-width: 610px) { .st-box { --k: 0.709; --cx: 631; } }
@container st (min-width: 640px) { .st-box { --k: 0.744; --cx: 631; } }
@container st (min-width: 670px) { .st-box { --k: 0.779; --cx: 631; } }
@container st (min-width: 700px) { .st-box { --k: 0.448; --cx: 0; } }
@container st (min-width: 740px) { .st-box { --k: 0.474; --cx: 0; } }
@container st (min-width: 780px) { .st-box { --k: 0.499; --cx: 0; } }
@container st (min-width: 820px) { .st-box { --k: 0.525; --cx: 0; } }
@container st (min-width: 860px) { .st-box { --k: 0.551; --cx: 0; } }
@container st (min-width: 900px) { .st-box { --k: 0.576; --cx: 0; } }
@container st (min-width: 940px) { .st-box { --k: 0.602; --cx: 0; } }
@container st (min-width: 980px) { .st-box { --k: 0.628; --cx: 0; } }
@container st (min-width: 1020px) { .st-box { --k: 0.653; --cx: 0; } }
@container st (min-width: 1060px) { .st-box { --k: 0.679; --cx: 0; } }
@container st (min-width: 1100px) { .st-box { --k: 0.705; --cx: 0; } }
@container st (min-width: 1140px) { .st-box { --k: 0.73; --cx: 0; } }
@container st (min-width: 1180px) { .st-box { --k: 0.756; --cx: 0; } }
@container st (min-width: 1220px) { .st-box { --k: 0.782; --cx: 0; } }
@container st (min-width: 1260px) { .st-box { --k: 0.807; --cx: 0; } }
@container st (min-width: 1300px) { .st-box { --k: 0.833; --cx: 0; } }
@container st (min-width: 1340px) { .st-box { --k: 0.858; --cx: 0; } }
@container st (min-width: 1380px) { .st-box { --k: 0.884; --cx: 0; } }
@container st (min-width: 1420px) { .st-box { --k: 0.91; --cx: 0; } }
@container st (min-width: 1460px) { .st-box { --k: 0.935; --cx: 0; } }
@container st (min-width: 1500px) { .st-box { --k: 0.961; --cx: 0; } }
@container st (min-width: 1540px) { .st-box { --k: 0.987; --cx: 0; } }
@container stt (min-width: 260px) { .st-tbox { --kt: 0.198; } }
@container stt (min-width: 300px) { .st-tbox { --kt: 0.229; } }
@container stt (min-width: 340px) { .st-tbox { --kt: 0.259; } }
@container stt (min-width: 380px) { .st-tbox { --kt: 0.29; } }
@container stt (min-width: 420px) { .st-tbox { --kt: 0.321; } }
@container stt (min-width: 460px) { .st-tbox { --kt: 0.351; } }
@container stt (min-width: 500px) { .st-tbox { --kt: 0.382; } }
@container stt (min-width: 540px) { .st-tbox { --kt: 0.412; } }
@container stt (min-width: 580px) { .st-tbox { --kt: 0.443; } }
@container stt (min-width: 620px) { .st-tbox { --kt: 0.474; } }
@container stt (min-width: 660px) { .st-tbox { --kt: 0.504; } }
@container stt (min-width: 700px) { .st-tbox { --kt: 0.535; } }
@container stt (min-width: 740px) { .st-tbox { --kt: 0.565; } }
@container stt (min-width: 780px) { .st-tbox { --kt: 0.596; } }
@container stt (min-width: 820px) { .st-tbox { --kt: 0.626; } }
@container stt (min-width: 860px) { .st-tbox { --kt: 0.657; } }
@container stt (min-width: 900px) { .st-tbox { --kt: 0.688; } }
@container stt (min-width: 940px) { .st-tbox { --kt: 0.718; } }
@container stt (min-width: 980px) { .st-tbox { --kt: 0.749; } }
@container stt (min-width: 1020px) { .st-tbox { --kt: 0.779; } }
@container stt (min-width: 1060px) { .st-tbox { --kt: 0.81; } }
@container stt (min-width: 1100px) { .st-tbox { --kt: 0.84; } }
@container stt (min-width: 1140px) { .st-tbox { --kt: 0.871; } }
@container stt (min-width: 1180px) { .st-tbox { --kt: 0.902; } }
@container stt (min-width: 1220px) { .st-tbox { --kt: 0.932; } }
@container stt (min-width: 1260px) { .st-tbox { --kt: 0.963; } }
@container stt (min-width: 1300px) { .st-tbox { --kt: 0.993; } }
