/* THE THEME — generated from lib/theme.ts, the one table of colours. Edit it there. */
:root {
  color-scheme: light;
  --bg: #F2F2F7;
  --panel: #FFFFFF;
  --panel-2: #F2F2F7;
  --raised: #E5E5EA;
  --field: #FFFFFF;
  --line: #C6C6C8;
  --line-soft: #E5E5EA;
  --bar: rgba(242, 242, 247, 0.8);
  --material: rgba(255, 255, 255, 0.9);
  --overlay: rgba(0, 0, 0, 0.22);
  --ink: #000000;
  --ink-2: #3C3C43;
  --ink-3: #636366;
  --accent: #007AFF;
  --accent-ink: #0062C4;
  --accent-fill: #0071E3;
  --accent-fill-hover: #0062C4;
  --on-accent: #FFFFFF;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --warn: #C4001A;
  --warn-soft: rgba(255, 59, 48, 0.1);
  --warn-line: rgba(215, 0, 21, 0.35);
  --playhead: #FF3B30;
  --marker: #C93400;
  --wave: #248A3D;
  --beat: #000000;
  --check-a: #FFFFFF;
  --check-b: #E5E5EA;
  --viewer: #FFFFFF;
  --picture-ground: #151517;
  --picture-ink: #FFFFFF;
  --viewer-scrim: rgba(0, 0, 0, 0.86);
  --picture-ink-2: #AEAEB2;
  --picture-material: rgba(44, 44, 46, 0.72);
  --seg-track: rgba(118, 118, 128, 0.12);
  --seg-thumb: #FFFFFF;
  --kind-text: #5856D6;
  --kind-shape: #34C759;
  --kind-image: #FF9500;
  --kind-video: #32ADE6;
  --kind-solid: #AF52DE;
  --kind-composition: #FFCC00;
  --kind-adjustment: #FF2D55;
  --kind-audio: #00C7BE;
  --curve-1: #0062C4;
  --curve-2: #C93400;
  --curve-3: #248A3D;
  --curve-4: #D30F45;
  --curve-5: #8944AB;
  --curve-6: #0071A4;
  --tint: 22%;
  --tint-held: 34%;
  --tint-label: 50%;
  --tint-label-held: 66%;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-thumb: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --panel: #1C1C1E;
  --panel-2: #2C2C2E;
  --raised: #323234;
  --field: #141416;
  --line: #38383A;
  --line-soft: #2C2C2E;
  --bar: rgba(22, 22, 24, 0.78);
  --material: rgba(44, 44, 46, 0.9);
  --overlay: rgba(0, 0, 0, 0.55);
  --ink: #FFFFFF;
  --ink-2: #AEAEB2;
  --ink-3: #9D9DA2;
  --accent: #0A84FF;
  --accent-ink: #4DA3FF;
  --accent-fill: #0071E3;
  --accent-fill-hover: #0062C4;
  --on-accent: #FFFFFF;
  --accent-soft: rgba(10, 132, 255, 0.2);
  --warn: #FF6961;
  --warn-soft: rgba(255, 69, 58, 0.16);
  --warn-line: rgba(255, 105, 97, 0.4);
  --playhead: #FF453A;
  --marker: #FFD60A;
  --wave: #30D158;
  --beat: #FFFFFF;
  --check-a: #1A1A1C;
  --check-b: #111113;
  --viewer: #000000;
  --picture-ground: #151517;
  --picture-ink: #FFFFFF;
  --viewer-scrim: rgba(0, 0, 0, 0.86);
  --picture-ink-2: #AEAEB2;
  --picture-material: rgba(44, 44, 46, 0.72);
  --seg-track: rgba(118, 118, 128, 0.24);
  --seg-thumb: #636366;
  --kind-text: #5E5CE6;
  --kind-shape: #30D158;
  --kind-image: #FF9F0A;
  --kind-video: #64D2FF;
  --kind-solid: #BF5AF2;
  --kind-composition: #FFD60A;
  --kind-adjustment: #FF375F;
  --kind-audio: #63E6E2;
  --curve-1: #0A84FF;
  --curve-2: #FF9F0A;
  --curve-3: #30D158;
  --curve-4: #FF375F;
  --curve-5: #BF5AF2;
  --curve-6: #64D2FF;
  --tint: 34%;
  --tint-held: 50%;
  --tint-label: 36%;
  --tint-label-held: 44%;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 36px rgba(0, 0, 0, 0.55);
  --shadow-thumb: 0 1px 2px rgba(0, 0, 0, 0.3);
}
body.viewing {
  color-scheme: dark;
  --bg: #000000;
  --panel: #1C1C1E;
  --panel-2: #2C2C2E;
  --raised: #323234;
  --field: #141416;
  --line: #38383A;
  --line-soft: #2C2C2E;
  --bar: rgba(22, 22, 24, 0.78);
  --material: rgba(44, 44, 46, 0.9);
  --overlay: rgba(0, 0, 0, 0.55);
  --ink: #FFFFFF;
  --ink-2: #AEAEB2;
  --ink-3: #9D9DA2;
  --accent: #0A84FF;
  --accent-ink: #4DA3FF;
  --accent-fill: #0071E3;
  --accent-fill-hover: #0062C4;
  --on-accent: #FFFFFF;
  --accent-soft: rgba(10, 132, 255, 0.2);
  --warn: #FF6961;
  --warn-soft: rgba(255, 69, 58, 0.16);
  --warn-line: rgba(255, 105, 97, 0.4);
  --playhead: #FF453A;
  --marker: #FFD60A;
  --wave: #30D158;
  --beat: #FFFFFF;
  --check-a: #1A1A1C;
  --check-b: #111113;
  --viewer: #000000;
  --picture-ground: #151517;
  --picture-ink: #FFFFFF;
  --viewer-scrim: rgba(0, 0, 0, 0.86);
  --picture-ink-2: #AEAEB2;
  --picture-material: rgba(44, 44, 46, 0.72);
  --seg-track: rgba(118, 118, 128, 0.24);
  --seg-thumb: #636366;
  --kind-text: #5E5CE6;
  --kind-shape: #30D158;
  --kind-image: #FF9F0A;
  --kind-video: #64D2FF;
  --kind-solid: #BF5AF2;
  --kind-composition: #FFD60A;
  --kind-adjustment: #FF375F;
  --kind-audio: #63E6E2;
  --curve-1: #0A84FF;
  --curve-2: #FF9F0A;
  --curve-3: #30D158;
  --curve-4: #FF375F;
  --curve-5: #BF5AF2;
  --curve-6: #64D2FF;
  --tint: 34%;
  --tint-held: 50%;
  --tint-label: 36%;
  --tint-label-held: 44%;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 36px rgba(0, 0, 0, 0.55);
  --shadow-thumb: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* site/theme.css */
/*
 * What every page shares of its look: the face, the corners, the focus ring, the
 * appearance switch, and what happens when somebody asks for less motion.
 *
 * COMPOSED SECOND INTO EVERY STYLESHEET, after the colours `lib/theme.ts` writes and
 * before the page's own rules (`STYLESHEETS` there), by the build and the dev server
 * alike. NO COLOUR IS WRITTEN HERE OR IN ANY OTHER STYLESHEET — every one is a name
 * from that table, which is what makes a theme one column of it. `check:layers`
 * refuses a literal.
 *
 * APPLE'S FACE, NOT A COPY OF IT. The system font stack asks the platform for its
 * own UI face — San Francisco on an Apple device, Segoe or Roboto elsewhere — so no
 * font file of Apple's is shipped, and no request is made for one.
 */

:root {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* CONTINUOUS-LOOKING CORNERS: a control at 8, a card at 12 to 16, a sheet at 14. */
  --r-control: 8px;
  --r-card: 12px;
  --r-sheet: 14px;
  /* The pointer's target on a touch screen, which Apple's guidelines put at 44 points. */
  --touch: 44px;
}

/* A RING FOR THE KEYBOARD, everywhere a page has not drawn its own: systemBlue,
   outside the control, and only for a keyboard — a ring after every click teaches
   people to switch it off. */
:where(:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- the appearance switch: Light, Dark --------------------------------------
 *
 * APPLE'S SEGMENTED CONTROL: a sunken track and a raised thumb on the segment chosen.
 * Which one is chosen is read from the root's `data-theme`, which the head's script
 * set before anything painted — so the right segment is lit before the bundle
 * arrives, and the bundle only keeps `aria-checked` in step with it.
 */
.theme-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: var(--seg-track);
  flex: none;
}

.theme-opt {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.theme-opt:hover { color: var(--ink); }
.theme-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.theme-icon { display: block; width: 15px; height: 15px; }

:root:not([data-theme="dark"]) .theme-opt[data-choice="light"],
:root[data-theme="dark"] .theme-opt[data-choice="dark"] {
  background: var(--seg-thumb);
  color: var(--ink);
  box-shadow: var(--shadow-thumb);
}

@media (pointer: coarse) {
  .theme-opt { width: var(--touch); height: 36px; position: relative; }
  /* THE TARGET IS 44 TALL WHERE THE SEGMENT IS 36: the four points either side are
     the track's padding, and a finger landing on them means the segment. */
  .theme-opt::before { content: ''; position: absolute; inset: -4px 0; }
  .theme-seg { padding: 4px; border-radius: 12px; }
}

/* A FIELD'S HINT IS WORDS A PERSON READS, so it is the quietest label colour, which
   holds AA on a field in both themes — the browser's own grey is 4.0:1 on a dark
   field. Opaque, because Firefox fades a placeholder by default. */
::placeholder { color: var(--ink-3); opacity: 1; }

/* --- less motion, when it is asked for -----------------------------------------
 *
 * EVERYTHING THAT MOVES FOR ITS OWN SAKE STOPS: a transition, an animation, a
 * smooth scroll. What a person drives — a drag, the playhead, a film playing — is
 * not CSS and is untouched, because that motion is the work.
 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* site/hub.css */
/*
 * Home — your projects, each a card with its picture that opens it in its editor — and Media.
 *
 * APPLE'S GROUPED LIST, in either theme. A grey ground and white cards in light,
 * black and #1C1C1E in dark; a translucent bar that what scrolls shows through; one
 * blue; capsule buttons; corners at 8 for a control and 12 to 16 for a card. Every
 * colour is a role from `lib/theme.ts`, composed ahead of this file by both hosts —
 * no rule here names a colour, so a theme is a column of that table.
 *
 * DENSITY BETWEEN THE HOMEPAGE AND THE EDITOR, deliberately. The homepage makes one
 * statement a screen; the editor is packed because every pixel is a control. A list
 * of work is neither: it wants to be scannable, so it is a column of cards at a size
 * a person can read down quickly, on a page that still breathes.
 *
 * EVERY CONTROL IS A REAL CONTROL. Rows that open something are anchors, so
 * middle-click, open-in-new-tab and the back button all work; everything pressable
 * has a visible focus ring, because the fastest way through a form is the keyboard
 * and a ring that only appears for a mouse is no ring at all. On a touch screen a
 * target is 44 points, as Apple's guidelines put it.
 */

:root {
  --gutter: 22px;
  --wide: 980px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* A KEYBOARD ARRIVES AT THE TOP OF THE DOCUMENT and should not have to walk the
   whole header to reach the list. Visible only when it is focused. */
.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 10px 14px;
  background: var(--accent-fill);
  color: var(--on-accent);
  border-radius: var(--r-control);
  font-weight: 600;
  z-index: 40;
}
.skip:focus { left: 12px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* A LINK IS BLUE WORDS unless its own rule says it is a card, a row or a tab — at
   no specificity, so every one of those wins without having to say so. */
:where(a) { color: var(--accent-ink); }

/* --- the header, which is the same on every page ------------------------- */

/* A BAR THAT FLOATS: Apple's bar material, the page scrolling under it blurred,
   and a hairline under it rather than a border. */
.hub-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 var(--gutter);
  height: 52px;
  border-bottom: 0.5px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  z-index: 20;
}

.hub-mark {
  font: 600 17px/1 var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.hub-nav { display: flex; gap: 2px; }

.hub-link {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-control);
  /* A LINK IS ONE LINE. "Connect a chatbot" wrapped to three on a phone and
     took the header to 90px with it. */
  white-space: nowrap;
}
.hub-link:hover { color: var(--ink); background: var(--seg-track); }
/* WHERE YOU ARE, marked on the link rather than only in the title bar. */
.hub-link[aria-current="page"] { color: var(--ink); background: var(--seg-track); }

/* The account button: Apple's gray capsule, restated here because these pages do
   not load the editor's stylesheet. */
.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--seg-track);
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--raised); }
.btn:disabled { opacity: 0.55; cursor: default; }

/* --- the page ------------------------------------------------------------ */

main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 40px var(--gutter) 96px;
}

.hub-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* APPLE'S LARGE TITLE: 34 points, bold, tracked in. */
.hub-h1 {
  margin: 0;
  font: 700 34px/1.12 var(--display);
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.hub-h1:focus { outline: none; }

/* A grouped list's section header: small capitals in the secondary label. */
.hub-h2 {
  margin: 36px 0 10px 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.hub-lede {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 17px;
  max-width: 56ch;
}

.hub-note {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 14px;
  max-width: 60ch;
}

.hub-status {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}
.hub-status:empty { display: none; }

.hub-error {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: var(--r-card);
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 14px;
}

/* --- actions -------------------------------------------------------------- */

.hub-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
}

/* THE ONE ACTION A SCREEN HAS: a filled capsule, Apple's blue with white words. */
.hub-primary {
  display: inline-block;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent-fill);
  color: var(--on-accent);
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  text-decoration: none;
  cursor: pointer;
  margin-left: auto;
  transition: background-color 0.15s ease;
}
.hub-primary:hover:not(:disabled) { background: var(--accent-fill-hover); }
.hub-primary:disabled { opacity: 0.55; cursor: default; }
/* In an action row it is one of several, so it stops pushing itself right. */
.hub-actions .hub-primary,
.hub-empty .hub-primary { margin-left: 0; }

/* EVERY OTHER ACTION, TINTED: the accent thinly behind blue words. */
.hub-secondary {
  display: inline-block;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
/* A RING ON HOVER, as the pager's: a deeper tint takes the blue words under AA on the ground. */
.hub-secondary:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }

/* --- the list ------------------------------------------------------------- */

.hub-list { display: flex; flex-direction: column; }

/* A CELL OF A GROUPED LIST: a white card on the grey ground, no border. */
.hub-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--r-card);
  margin-bottom: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}
a.hub-row:hover { background: var(--raised); }

.hub-row-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A NAME THAT OPENS ITS PROJECT reads as the name, and shows it is a way there
   only under the pointer. */
a.hub-row-name { color: var(--ink); text-decoration: none; }
a.hub-row-name:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

.hub-row-meta {
  color: var(--ink-2);
  font-size: 13.5px;
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
/* AN EXPORT'S STATE CAN BE A WORKER'S WHOLE ERROR, so it wraps, anywhere, rather than
   pushing the page sideways — it did, to 730 px on a 390 px phone. */
.ex-line .hub-row-meta { white-space: normal; overflow-wrap: anywhere; }

.hub-row-go {
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.hub-row-go:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --- a list that grows a page at a time (editor/src/pager.ts) -------------- */

.hub-rows { display: flex; flex-direction: column; }
.hub-rows[aria-busy="true"],
.ver-exports[aria-busy="true"] { cursor: progress; }

.pager-more {
  align-self: center;
  margin: 6px 0 12px;
  padding: 8px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
/* A RING ON HOVER, NOT MORE BLUE: the tint deep enough to see as a change took the
   blue words under AA (4.14:1). */
.pager-more:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.pager-more:disabled { color: var(--ink-2); background: var(--seg-track); cursor: progress; }
.pager-more[hidden] { display: none; }

/* THE PAGE NUMBERS under Projects, Media and Exports (`editor/src/pages.ts`): ‹ Prev, the
   numbers, Next ›, and where this page is. The shown one is filled, as the pager's button is. */
.pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  margin: 26px 0 12px;
}
.pages[hidden] { display: none; }
.pages[aria-busy="true"] { cursor: progress; }
.pages-numbers { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pages-step,
.pages-number {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.pages-step:hover:not(:disabled):not([aria-disabled="true"]),
.pages-number:hover:not([aria-current]):not(:disabled):not([aria-disabled="true"]) { background: var(--seg-track); }
.pages-number[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); cursor: default; }
.pages-step:disabled,
.pages-number:disabled { color: var(--ink-3); cursor: default; }
/* WHILE A PAGE IS ON ITS WAY the buttons are said disabled and keep their focus (`aria-disabled`). */
.pages-step[aria-disabled="true"],
.pages-number[aria-disabled="true"] { color: var(--ink-3); cursor: progress; }
.pages-number[aria-current="page"]:disabled,
.pages-number[aria-current="page"][aria-disabled="true"] { color: var(--accent-ink); }
.pages-gap { min-width: 20px; color: var(--ink-3); text-align: center; }
.pages-count { flex-basis: 100%; color: var(--ink-3); font-size: 12.5px; text-align: center; }

/* --- Home: the projects, as a grid ------------------------------------------ */

/* One library card for Projects, Exports and Media. Its picture never chooses the
   grid's size: a vertical reel or a square picture stays whole on a dark ground. */
.home-card-grid:where(.proj-grid, .ex-list, .hub-rows) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 28px 22px;
}
.home-card-grid > .hub-status,
.home-card-grid > .pages,
.home-card-grid > .pager-more { grid-column: 1 / -1; }
.home-card,
.home-card.proj-card,
.home-card.ex-card,
.home-card.lib-row { position: relative; min-width: 0; color: var(--ink); }
.home-card:has(.card-menu[open]) { z-index: 4; }
.home-card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  min-width: 0;
  border-radius: 12px;
  background: var(--picture-ground);
  color: var(--picture-ink);
  overflow: hidden;
  isolation: isolate;
}
.home-card-media > .proj-open,
.home-card-media > .lib-thumb,
.home-card-visual { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; height: 100%; min-width: 0; margin: 0; padding: 0; border: 0; background: none; color: inherit; }
.home-card-media .lib-thumb { font: 400 44px/1 var(--sans); cursor: pointer; }
.home-card-media .lib-thumb:disabled { cursor: default; }
.home-card-media .proj-cover { position: absolute; inset: 0; }
.home-card-media img,
.home-card-media video { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Replaced images must not give the thumbnail button an intrinsic grid track. */
.home-card-media .lib-thumb img,
.home-card-media .lib-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.home-card-media .proj-cover[data-cover-state="loading"]:not(:has(img))::after { content: 'Loading preview…'; position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; color: var(--picture-ink); font: 400 12px/1.5 var(--sans); text-align: center; }
.home-card-media:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.home-card-placeholder { font: 400 38px/1 var(--sans); }
.home-card-duration { position: absolute; right: 8px; bottom: 8px; z-index: 2; padding: 2px 6px; border-radius: 5px; background: var(--picture-ground); color: var(--picture-ink); font: 600 11px/1.5 var(--sans); font-variant-numeric: tabular-nums; pointer-events: none; }
.home-card-duration[hidden] { display: none; }
.home-card-heading { display: flex; align-items: flex-start; gap: 8px; margin-top: 11px; min-width: 0; }
.home-card-heading .home-card-title,
.home-card-heading .proj-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; flex: 1 1 auto; min-width: 0; width: auto; max-width: 100%; margin: 0; padding: 0; border: 0; overflow: hidden; text-overflow: ellipsis; white-space: normal; overflow-wrap: anywhere; background: none; color: var(--ink); font: 600 15px/1.4 var(--sans); text-align: left; text-decoration: none; }
a.home-card-title,
button.home-card-title { cursor: pointer; }
a.home-card-title:hover,
button.home-card-title:hover:not(:disabled) { color: var(--ink-2); }
button.home-card-title:disabled { cursor: default; }
.home-card-meta,
.home-card-meta.proj-when,
.home-card-meta.ex-made,
.home-card-meta.lib-meta { margin: 4px 0 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font: 400 12px/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.home-card-state { margin: 5px 0 0; white-space: normal; overflow-wrap: anywhere; font-size: 12px; }
.home-card-state:empty { display: none; }
.home-card > .lib-bar { margin-top: 10px; }
.home-card .card-menu { margin-top: -7px; }

/* A FINISHED EXPORT IS A STILL ON ITS CARD, and nothing plays there: pressed, it opens in the
   one viewer below (editor/src/export-view.ts). A film wears Play, a carousel its stack. */
.home-card-media .ex-cover { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: none; color: var(--picture-ink); font: inherit; cursor: pointer; }
.home-card-media .ex-cover :is(.ex-cover-still, .ex-cover-video) { position: absolute; inset: 0; min-width: 0; min-height: 0; pointer-events: none; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.home-card-media .ex-cover:hover :is(.ex-cover-still, .ex-cover-video) { transform: scale(1.025); }
.home-card-media .ex-cover :is(.ex-cover-still, .ex-cover-video)[hidden],
.home-card-media .ex-cover .home-card-placeholder[hidden] { display: none; }
.ex-cover-play { position: relative; z-index: 2; display: grid; place-items: center; width: 52px; height: 52px; padding-left: 3px; border-radius: 50%; background: var(--picture-material); color: var(--picture-ink); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); transition: transform .2s ease; }
.home-card-media .ex-cover:hover .ex-cover-play { transform: scale(1.08); }
.ex-cover-count { position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--picture-material); color: var(--picture-ink); font: 600 11px/1.4 var(--sans); font-variant-numeric: tabular-nums; -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); }
.ex-cover-play svg,
.ex-cover-count svg { display: block; }
@media (prefers-reduced-motion: reduce) {
  .home-card-media .ex-cover :is(.ex-cover-still, .ex-cover-video),
  .ex-cover-play { transition: none; }
  .home-card-media .ex-cover:hover :is(.ex-cover-still, .ex-cover-video),
  .home-card-media .ex-cover:hover .ex-cover-play { transform: none; }
}

/* New project keeps its place as the first tile. */
.proj-new { display: flex; min-width: 0; aspect-ratio: 16 / 9; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--bg); }
.proj-new-start,
.proj-new-choose { display: flex; flex: 1; align-items: center; justify-content: center; gap: 10px; min-width: 0; border-radius: 12px; }
.proj-new-start { flex-direction: column; padding: 20px 12px; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.proj-new-start:hover { background: var(--panel-2); }
.proj-new-start[hidden],
.proj-new-choose[hidden] { display: none; }
.proj-new-choose { padding: 16px; }
.proj-new-kind { display: grid; flex: 1; place-items: center; min-height: 90px; border-radius: 10px; background: var(--ink); color: var(--panel); font-size: 14px; font-weight: 600; text-decoration: none; }
.proj-new-kind:hover { opacity: .8; }
.proj-new-plus { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); color: var(--ink); font: 400 28px/1 var(--sans); }
.proj-new-label { font-size: 15px; font-weight: 600; }
.proj-new-note { max-width: 23ch; color: var(--ink-2); font-size: 11px; font-weight: 400; line-height: 1.5; }

@media (max-width: 999px) {
  .home-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
}
@media (max-width: 599px) {
  .home-card-grid { grid-template-columns: 1fr; gap: 24px; }
  .home-card-heading .home-card-title { font-size: 16px; }
}

/* WHAT IT IS — Image or Video — as a quiet chip over its name; an image's in the accent. */
.proj-kind {
  align-self: flex-start;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  background: var(--panel-2);
}
.proj-kind[data-kind="image"] { color: var(--accent-ink); background: var(--accent-soft); }
.ver-head .proj-kind { align-self: center; }

/* --- a project, opened: its versions and what was made from each ------------- */

.hub-crumbs { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.hub-crumb { color: var(--accent-ink); text-decoration: none; }
a.hub-crumb:hover { text-decoration: underline; text-underline-offset: 3px; }
.hub-crumb + .hub-crumb::before { content: "›"; margin-right: 8px; color: var(--ink-3); }
.hub-crumb[aria-current="page"] { color: var(--ink-2); }

.ver-list { display: flex; flex-direction: column; gap: 12px; }
.ver {
  border-radius: 16px;
  background: var(--panel);
  padding: 4px 4px 10px;
}
.ver-head { margin-bottom: 0; background: none; }
.ver-name { font-weight: 600; font-size: 15px; }
/* OPEN IS THE ONE THING A VERSION IS FOR, so it is the one filled button on the card. */
.ver-open {
  font-size: 14px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent-fill);
  border-radius: 999px;
  padding: 6px 16px;
  text-decoration: none;
  white-space: nowrap;
}
.ver-open:hover { background: var(--accent-fill-hover); }
.ver-exports[hidden] { display: none; }
.ver-preview-button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent-ink);
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  white-space: nowrap;
}
.ver-preview-button:hover { background: var(--accent-soft); }
.ver-preview-button:disabled { color: var(--ink-2); background: none; cursor: progress; }
.ver-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 16px 8px; font-size: 14px; color: var(--ink-2); }
.ver-preview[hidden] { display: none; }
.ver-preview .hub-row-meta { margin-left: 0; }
/* WHAT WAS MADE FROM A VERSION, joined to it by a rule: never a row of its own. */
.ver-exports {
  display: flex;
  flex-direction: column;
  margin: 0 12px 4px 16px;
  padding-left: 12px;
  border-left: 2px solid var(--line-soft);
}
.ver-exports > .hub-secondary { align-self: flex-start; margin: 6px 0 2px; }
.ver-none { margin: 6px 0; font-size: 13.5px; color: var(--ink-2); }
/* A version's own exports, then the same film exported from another version. */
.ver-rows { display: flex; flex-direction: column; }
.ver-same { display: flex; flex-direction: column; margin-top: 4px; }
.ver-same[hidden] { display: none; }
.ver-all { display: inline-block; margin-top: 20px; max-width: 100%; white-space: normal; }
/* A PROJECT'S EXPORTS, newest first, on one card: a date and Download a line. */
.proj-exports {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--panel);
  padding: 4px 16px;
}
.proj-exports:empty { display: none; }
.ex-line { padding: 8px 4px; margin: 0; background: none; border-radius: 0; border-bottom: 0.5px solid var(--line-soft); }
.ex-line:last-of-type { border-bottom: 0; }
.ex-line .hub-row-name { flex: 1 1 auto; min-width: 0; font-weight: 400; white-space: normal; overflow-wrap: anywhere; }
.ex-links { display: inline-flex; gap: 8px; align-items: center; }
/* Copy link: blue words beside Download, a button only in what it does. */
.ex-copy {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-ink);
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  white-space: nowrap;
}
.ex-copy:hover { background: var(--accent-soft); }

/* --- the header's Help menu ---------------------------------------------------- */

.hub-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.hub-help { position: relative; }
.hub-help-button {
  list-style: none;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-control);
  cursor: pointer;
  white-space: nowrap;
}
.hub-help-button::-webkit-details-marker { display: none; }
.hub-help-button:hover,
.hub-help[open] > .hub-help-button { color: var(--ink); background: var(--seg-track); }
/* A MENU IS MATERIAL: what is under it shows through, blurred, as on a Mac. */
.hub-help-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border: 0.5px solid var(--line);
  border-radius: var(--r-card);
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow);
  z-index: 30;
}
.hub-help-item {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 7px;
}
.hub-help-item:hover { background: var(--accent-fill); color: var(--on-accent); }

.hub-view { display: contents; }

/* --- empty states --------------------------------------------------------- */

.hub-empty {
  max-width: 520px;
  margin: 8vh auto 0;
  text-align: center;
}
.hub-empty .hub-lede { margin-left: auto; margin-right: auto; }
.hub-empty .hub-actions { justify-content: center; }

.hub-empty-inline {
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
}
.hub-empty-inline .hub-lede,
.hub-empty-inline .hub-note { margin-left: auto; margin-right: auto; }
.hub-empty-inline .hub-actions { justify-content: center; margin-top: 18px; }

/* --- the library ---------------------------------------------------------- */

/* A LABEL, SO THE WHOLE PANEL IS THE FILE PICKER. A drop zone that is only a
   drop zone excludes anybody who does not drag, and a button beside it would be
   two ways in where one will do. */
.lib-drop {
  display: block;
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  padding: 28px 22px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 22px;
  background: var(--panel);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.lib-drop:hover, .lib-drop.lib-over { border-color: var(--accent); background: var(--accent-soft); }
.lib-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* OFF SCREEN, NOT `display:none`: a hidden input cannot be focused, and the
   keyboard is how a lot of people reach a file picker. */
.lib-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.lib-drop-title { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.lib-drop-note { display: block; color: var(--ink-2); font-size: 13px; }

/* GOOGLE DRIVE, beside the title: a tinted capsule, as every action that is not the
   page's one is, and when connected a quiet "Connected" with the way out beside it. */
.lib-drive { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.lib-drive-button {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.lib-drive-button:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.lib-drive-button:focus-visible, .lib-drive-off:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lib-drive-state { color: var(--ink-2); font-size: 13px; }
.lib-drive-off {
  font: inherit;
  font-size: 13px;
  color: var(--ink-2);
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 6px 6px;
  cursor: pointer;
}
.lib-drive-off:hover { color: var(--warn); background: var(--warn-soft); }
.lib-drive-off:disabled { opacity: 0.5; cursor: default; }
.lib-drive-button:disabled { opacity: 0.6; cursor: default; }
.lib-drive-off[hidden], .lib-drive-state[hidden], .lib-bar[hidden], .lib-retry[hidden] { display: none; }

/* AN IMPORT THAT STOPPED says why in the warning's colour, on the row it would have been. */
.lib-failed .lib-meta { color: var(--warn); }

.lib-progress:empty { display: none; }

/* An export's bar sits in a row, so it takes a share rather than the rest. */
.hub-row .lib-bar { flex: 0 0 120px; margin-left: 12px; }
.lib-uploading { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13.5px; }
.lib-up-name { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-bar { flex: 1; height: 5px; background: var(--raised); border-radius: 999px; overflow: hidden; }
.lib-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.15s linear; }
.lib-up-pct { color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 3.4em; text-align: right; }

/* --- exports -------------------------------------------------------------- */

/* THE GROUND UNDER THE PLAYER IS THE VIEWER'S — white in light, black in dark — so a
   vertical film in a wide box has bands that belong to the card rather than shout. */
.ex-video {
  display: block;
  width: 100%;
  max-height: 460px;
  border-radius: 10px;
  background: var(--viewer);
}


/* --- the form ------------------------------------------------------------- */

.hub-form { max-width: 560px; }

.hub-field { display: block; margin-bottom: 16px; flex: 1 1 0; min-width: 0; }

.hub-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 0;
}

.hub-input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  font: inherit;
  font-size: 16px;
  border-radius: 10px;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--ink);
}
.hub-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.hub-colour {
  width: 64px;
  height: 44px;
  padding: 3px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.hub-pair { display: flex; gap: 14px; }
/* HIDDEN MEANS HIDDEN: the `display` on these two beats the browser's own `[hidden]`, which kept
   New image's Slides on screen for every size, and Pieces across and down while the slides cut it. */
.hub-field[hidden], .hub-pair[hidden] { display: none; }

/* A TICK AND ITS WORDS ON ONE LINE, the whole line the target. */
.hub-tick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: -6px 0 12px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.hub-tick { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

.hub-presets {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
  min-width: 0;
}

.hub-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* TWO LINES: the size, and what it works out to. The derived half is quieter
   because it is the consequence, not the choice. */
.hub-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: 8px 14px;
  cursor: pointer;
  text-align: left;
}

.hub-chip-size { font-weight: 600; font-variant-numeric: tabular-nums; }

.hub-chip-note {
  font-size: 11.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.hub-chip[aria-pressed="true"] .hub-chip-note { color: var(--ink); }
.hub-chip:hover { border-color: var(--line); }
.hub-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hub-summary {
  margin: 18px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* --- the templates review ---------------------------------------------------- */

/* A GALLERY, WIDER THAN A LIST: a category a section, its templates as pictures at the shape
   they were drawn for, each named and nothing more. The categories stay in sight in a bar
   under the header, the one being read marked. */
body[data-page="review"] main { max-width: 1240px; }
.rv-bar {
  position: sticky;
  top: 52px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 calc(-1 * var(--gutter)) 8px;
  padding: 10px var(--gutter);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--line-soft);
}
.rv-nav {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
/* THE BACKGROUND THE PICTURES ARE DRAWN ON: a swatch each, and a picker for any other. */
.rv-backdrop { flex: none; display: flex; align-items: center; gap: 6px; }
.rv-backdrop-label { font-size: 12.5px; color: var(--ink-2); margin-right: 2px; }
.rv-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  cursor: pointer;
}
.rv-swatch[aria-pressed="true"], .rv-swatch-on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.rv-swatch-pick {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: var(--seg-track);
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
}
.rv-swatch-pick input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.rv-swatch-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 620px) { .rv-backdrop-label { display: none; } }
.rv-nav::-webkit-scrollbar { display: none; }
.rv-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--seg-track);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.rv-chip:hover { color: var(--ink); }
.rv-chip[aria-current="true"] { background: var(--accent-fill); color: var(--on-accent); }
.rv-chip-count { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.7; }
.rv-cat { scroll-margin-top: 116px; padding-top: 36px; }
.rv-cat + .rv-cat { margin-top: 20px; border-top: 0.5px solid var(--line-soft); }
.rv-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 700 24px/1.2 var(--display);
  letter-spacing: -0.015em;
}
.rv-count {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--seg-track);
  color: var(--ink-2);
  font: 600 13px/1.4 var(--sans);
  font-variant-numeric: tabular-nums;
}
.rv-means { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; max-width: 64ch; }
.rv-config { margin-top: 12px; font-size: 13.5px; }
.rv-config > summary, .rv-fold > summary {
  display: inline-flex;
  cursor: pointer;
  color: var(--accent-ink);
  font-weight: 500;
  list-style: none;
}
.rv-config > summary::-webkit-details-marker, .rv-fold > summary::-webkit-details-marker { display: none; }
.rv-config > summary::before, .rv-fold > summary::before { content: "›"; display: inline-block; width: 1em; transition: transform 0.15s; }
.rv-config[open] > summary::before, .rv-fold[open] > summary::before { transform: rotate(90deg); }
.rv-config[open] {
  max-width: 760px;
  padding: 12px 16px;
  border-radius: var(--r-card);
  background: var(--panel);
}
.rv-needs { margin: 10px 0 0; color: var(--ink-2); }
.rv-list { margin: 8px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; }
.rv-list dt { font-family: var(--mono); font-size: 12px; padding-top: 1px; }
.rv-list dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.rv-empty {
  margin: 16px 0 0;
  padding: 28px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-card);
  color: var(--ink-2);
  text-align: center;
}
.rv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 22px 16px;
  align-items: start;
  margin-top: 18px;
}
.rv-grid > .pager-more { grid-column: 1 / -1; justify-self: start; }
.rv-card { min-width: 0; }
.rv-card[data-shape="wide"] { grid-column: span 2; }
.rv-frame {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: var(--seg-track);
  box-shadow: 0 0 0 0.5px var(--line), var(--shadow);
  transition: box-shadow 0.15s, transform 0.15s;
}
.rv-frame:hover, .rv-frame:focus-visible { box-shadow: 0 0 0 2px var(--accent), var(--shadow); outline: none; }
.rv-poster, .rv-frame .fx-live { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
.rv-wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.rv-wait[hidden] { display: none; }
.rv-name { margin: 10px 2px 0; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.rv-id { display: block; margin: 2px 2px 0; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-fold { margin: 6px 2px 0; font-size: 12.5px; }
.rv-fold .rv-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
.rv-fold .rv-list dd { margin-bottom: 6px; }

/* WHAT WAS ASKED FOR AND NOT HAD (template-requests.ts): a card an ask, the gallery's cells
   in a grid of their own, every line of it allowed to wrap anywhere — its words are a
   chatbot's. */
.rv-reqs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  align-items: start;
  margin-top: 18px;
}
.rv-reqs > .pager-more { grid-column: 1 / -1; justify-self: start; }
.rv-req {
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--r-card);
  background: var(--panel);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.rv-req-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rv-req-cat { margin: 0; font-size: 15px; font-weight: 600; }
.rv-req-new {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 600;
}
.rv-req-when { margin-left: auto; color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rv-req-style { margin: 6px 0 0; font-size: 14px; }
.rv-req-look { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rv-req-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--seg-track);
  font-size: 12.5px;
}
.rv-req-swatch { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.rv-req-gave { margin: 8px 0 0; color: var(--ink-2); }
.rv-req-missing { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.rv-req-missing:empty { display: none; }
.rv-req-missing li + li { margin-top: 2px; }
.rv-req-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.rv-req-who { min-width: 0; color: var(--ink-2); font-size: 12.5px; }
.rv-req-foot .hub-secondary { margin-left: auto; }

/* --- Credits: the balance, Free and Pro, and the packs on sale --------------- */

/* THE BALANCE IS THE PAGE'S ONE NUMBER, on a card of its own above what buys more. */
.cr-balance {
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--panel);
  margin-bottom: 8px;
}
.cr-balance-count { margin: 0; font: 700 30px/1.15 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cr-balance-note { margin: 4px 0 0; color: var(--ink-2); font-size: 14.5px; }
.cr-balance .hub-secondary { margin-top: 14px; }
/* WHAT THE PAGE SAYS, brought into view below the sticky bar, which is two rows tall on a phone. */
.cr-status { scroll-margin-top: 124px; }

.cr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.cr-offer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: var(--panel);
}
.cr-offer-name { margin: 0; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.cr-offer-credits { margin: 0; font: 700 22px/1.2 var(--display); letter-spacing: -0.015em; }
.cr-offer-price { margin: 0 0 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cr-offer .hub-primary { margin: auto 0 0; align-self: flex-start; }

/* FREE AND PRO, side by side: a name, a price, what each gives — and the one this account is on marked. */
.cr-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; margin-bottom: 8px; }
.cr-offer-price-big { margin: 2px 0 0; font: 700 30px/1.15 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cr-gives { margin: 6px 0 14px; padding: 0; list-style: none; font: 500 15px/1.4 var(--sans); color: var(--ink-2); }
.cr-per { font: 500 15px/1 var(--sans); letter-spacing: 0; color: var(--ink-2); }
.cr-now { box-shadow: inset 0 0 0 2px var(--accent-fill); }
/* A CARD'S LAST WORD — "Given once", "Your plan" — at its foot, level with the other card's button. */
.cr-foot { margin: auto 0 0; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.cr-plan { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
/* MANAGE SUBSCRIPTION in a card half a phone wide: its words wrap rather than run out of the card. */
.cr-plans .hub-secondary { margin-top: 12px; align-self: flex-start; white-space: normal; text-align: left; }

/* --- a touch screen ----------------------------------------------------------- */

/* A FINGER IS 44 POINTS, as Apple's guidelines put a target; a mouse is not, so the
   desktop keeps its density. */
@media (pointer: coarse) {
  .hub-link, .hub-help-button, .btn, .hub-secondary, .pager-more,
  .ver-preview-button, .lib-remove, .lib-id, .hub-row-go, .ex-copy, .lib-drive-button, .lib-drive-off, .lib-retry {
    min-height: var(--touch);
    display: inline-flex;
    align-items: center;
  }
  .hub-help-item { min-height: var(--touch); display: flex; align-items: center; }
  /* AND HIDDEN STAYS HIDDEN: an author `display` beats the browser's own `[hidden]`,
     which put the editor-only Films button on every phone. */
  .btn[hidden], .hub-secondary[hidden], .pager-more[hidden] { display: none; }
}

@media (pointer: coarse) and (max-width: 620px) {
  /* Three segments and an account beside the mark on a phone: 40 points each, the
     most a 390-point row holds with the mark still whole. */
  .hub-bar .theme-opt { width: 40px; height: 40px; }
}

@media (max-width: 620px) {
  /* THE HEADER BECOMES TWO ROWS RATHER THAN SQUEEZING. Who you are and how the page
     looks stay beside the mark, where they are looked for; the two destinations and
     Help drop underneath, so nothing is ever cut off and nothing is ever unreachable
     — which is the entire point of it being in the header. The right-hand group
     lets go of its box (`display: contents`) so its pieces can sit on either row. */
  :root { --gutter: 16px; }
  .hub-bar {
    height: auto;
    flex-wrap: wrap;
    padding: 6px var(--gutter);
    gap: 6px 8px;
  }
  .hub-right { display: contents; }
  .hub-mark { order: 1; }
  .hub-bar .theme-seg { order: 2; margin-left: auto; }
  .hub-right > .btn { order: 3; max-width: 30vw; padding: 7px 12px; }
  /* At least most of a row, so it can never fit beside the mark and always opens the second. */
  .hub-nav { order: 4; flex: 1 0 60%; overflow-x: auto; scrollbar-width: none; }
  .hub-nav::-webkit-scrollbar { display: none; }
  .hub-help { order: 5; }
  .hub-help-button { padding: 6px 8px; }

  main { padding-top: 26px; }
  .hub-h1 { font-size: 28px; }
  .hub-head { gap: 12px; }
  .hub-pair { flex-direction: column; gap: 0; }

  /* EVERY ROW THE SAME SHAPE. Wrapping only when a name happened to be long
     gave a list where some rows were one line and some were two. */
  .hub-row { flex-wrap: wrap; gap: 4px 12px; }
  .lib-what { width: 100%; }
  .lib-id { margin-left: 0; }
  .lib-drive { margin-left: 0; width: 100%; }
  .hub-row .lib-bar { flex: 1 1 100%; margin-left: 0; }
  .hub-row-name { width: 100%; }
  .hub-row-meta { margin-left: 0; white-space: normal; overflow-wrap: anywhere; }
  .ex-links { flex-wrap: wrap; }
  .cr-grid { grid-template-columns: 1fr; }
  /* BUT THE TWO PLANS STAY SIDE BY SIDE: two short cards, each a name, a price and what it gives. */
  .cr-grid.cr-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ver-head .ver-name { width: auto; }
  .hub-row-go { margin-left: auto; }
  .hub-primary { margin-left: 0; }
}

/* --- Pricing: the homepage's open layout, only on the Credits route -------- */

body[data-page="credits"] {
  --gutter: 28px;
  --wide: 1160px;
  background: var(--panel);
}

body[data-page="credits"] .hub-bar {
  height: 76px;
  padding: 0 max(var(--gutter), calc((100% - var(--wide)) / 2));
  background: var(--material);
  border-bottom: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

/* The same original asset as the homepage, with its shape and transparency intact. */
body[data-page="credits"] .hub-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  font: 600 18px/1 var(--display);
}
body[data-page="credits"] .hub-mark::before {
  content: '';
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  background: var(--ink);
  -webkit-mask: url('/icon.svg') center / contain no-repeat;
  mask: url('/icon.svg') center / contain no-repeat;
  mask-mode: alpha;
}

body[data-page="credits"] .hub-link { font-size: 13px; font-weight: 400; }
body[data-page="credits"] .hub-link[aria-current="page"] { background: var(--bg); }
body[data-page="credits"] #main { padding-top: 54px; padding-bottom: 100px; }
body[data-page="credits"] .cr-intro { padding: 8px 0 36px; text-align: center; }
body[data-page="credits"] .cr-eyebrow {
  margin: 0 0 18px;
  color: var(--ink-3);
  font: 600 11px/1.5 var(--sans);
  letter-spacing: .13em;
  text-transform: uppercase;
}
body[data-page="credits"] .cr-intro .hub-h1 {
  font: 600 clamp(46px, 5.7vw, 70px)/1.02 var(--display);
  letter-spacing: -.06em;
}
body[data-page="credits"] .cr-intro .hub-lede {
  max-width: 42ch;
  margin: 20px auto 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: balance;
}

body[data-page="credits"] .cr-account,
body[data-page="credits"] .cr-catalogue,
body[data-page="credits"] .cr-status { max-width: 1000px; margin-left: auto; margin-right: auto; }
body[data-page="credits"] .cr-account { margin-bottom: 24px; color: var(--ink-2); font-size: 14px; }
body[data-page="credits"] .cr-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 24px;
  margin: 0;
  padding: 20px 26px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--bg);
}
body[data-page="credits"] .cr-balance-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}
body[data-page="credits"] .cr-balance-label {
  flex-basis: 100%;
  margin: 0;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
body[data-page="credits"] .cr-balance-count {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font: 600 27px/1.2 var(--display);
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
body[data-page="credits"] .cr-balance-note { margin: 0; color: var(--ink-2); font-size: 12px; }
body[data-page="credits"] .cr-balance > .hub-secondary { margin: 0; }
body[data-page="credits"] .cr-status { scroll-margin-top: 140px; }
body[data-page="credits"] .cr-status:not(:empty) {
  padding: 14px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}
body[data-page="credits"] .cr-catalogue { padding-top: 28px; }
body[data-page="credits"] .cr-catalogue > .hub-h2 {
  margin: 0 0 26px;
  color: var(--ink);
  font: 600 34px/1.12 var(--display);
  letter-spacing: -.045em;
  text-transform: none;
  text-align: center;
}
body[data-page="credits"] .cr-catalogue > .hub-h2:not(:first-child) { margin-top: 76px; }
body[data-page="credits"] .cr-catalogue > .hub-note {
  max-width: 48ch;
  margin: -10px auto 28px;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

body[data-page="credits"] .cr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
body[data-page="credits"] .cr-plans {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: none;
  margin-bottom: 0;
  gap: 22px;
}
body[data-page="credits"] .cr-offer {
  min-width: 0;
  gap: 0;
  padding: 28px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--panel);
}
body[data-page="credits"] .cr-plans .cr-offer { min-height: 330px; padding: 30px; }
body[data-page="credits"] .cr-free { background: var(--panel); }
body[data-page="credits"] .cr-pro { background: var(--bg); }
body[data-page="credits"] .cr-now { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
body[data-page="credits"] .cr-offer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 28px;
  margin-bottom: 20px;
}
body[data-page="credits"] .cr-offer-name { color: var(--ink); font-size: 14px; font-weight: 600; }
body[data-page="credits"] .cr-plans .cr-offer-name { font: 600 22px/1.2 var(--display); letter-spacing: -.03em; }
body[data-page="credits"] .cr-badge {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
}
body[data-page="credits"] .cr-offer-price-big {
  margin: 0;
  color: var(--ink);
  font: 600 56px/1.05 var(--display);
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
body[data-page="credits"] .cr-per { display: inline-block; margin-left: 6px; font: 400 13px/1.5 var(--sans); letter-spacing: 0; color: var(--ink-3); }
body[data-page="credits"] .cr-gives { display: grid; gap: 11px; margin: 28px 0; color: var(--ink-2); font: 400 14px/1.5 var(--sans); }
body[data-page="credits"] .cr-gives li { display: flex; align-items: baseline; gap: 9px; }
body[data-page="credits"] .cr-gives li::before { content: '✓'; flex: none; color: var(--ink); font-size: 12px; }
body[data-page="credits"] .cr-foot { padding-top: 14px; color: var(--ink-3); font-size: 12px; font-weight: 400; }
body[data-page="credits"] .cr-plan { margin-top: 8px; color: var(--ink-2); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
body[data-page="credits"] .cr-pack { min-height: 225px; padding: 24px; }
body[data-page="credits"] .cr-pack .cr-offer-name { margin-bottom: 18px; color: var(--ink-2); }
body[data-page="credits"] .cr-offer-credits { font: 600 29px/1.2 var(--display); letter-spacing: -.04em; overflow-wrap: anywhere; }
body[data-page="credits"] .cr-offer-price { margin: 8px 0 28px; color: var(--ink-3); font-size: 16px; }

body[data-page="credits"] .hub-primary {
  min-height: var(--touch);
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--panel);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  transition: opacity .15s ease;
}
body[data-page="credits"] .hub-primary:hover:not(:disabled) { background: var(--ink); opacity: .82; }
body[data-page="credits"] .hub-primary:disabled { opacity: .45; }
body[data-page="credits"] .cr-offer > .hub-primary { width: 100%; align-self: stretch; }
body[data-page="credits"] .hub-secondary {
  min-height: var(--touch);
  padding: 11px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  text-align: center;
}
body[data-page="credits"] .hub-secondary:hover { border-color: var(--ink-2); box-shadow: none; }
body[data-page="credits"] .cr-plans .hub-secondary { align-self: stretch; margin-top: 18px; text-align: center; }

body[data-page="credits"] :is(.hub-primary, .hub-secondary)[aria-busy="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  opacity: .85;
  cursor: progress;
}
body[data-page="credits"] :is(.hub-primary, .hub-secondary)[aria-busy="true"]::before {
  content: '';
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: cr-loading .8s linear infinite;
}
@keyframes cr-loading { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  body[data-page="credits"] { --gutter: 16px; }
  body[data-page="credits"] .hub-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 132px;
    gap: 6px 8px;
    height: auto;
    padding: 10px var(--gutter);
  }
  body[data-page="credits"] .hub-mark { grid-column: 1; grid-row: 1; justify-self: start; }
  body[data-page="credits"] .hub-right { display: contents; }
  body[data-page="credits"] .hub-right > #account { grid-column: 3; grid-row: 1; justify-self: end; max-width: 100%; }
  body[data-page="credits"] .hub-nav { grid-column: 1 / 3; grid-row: 2; min-width: 0; max-width: 100%; }
  body[data-page="credits"] .hub-link { padding: 7px 9px; font-size: 12px; }
  body[data-page="credits"] .hub-help { grid-column: 2; grid-row: 1; }
  body[data-page="credits"] .hub-help-button { padding: 7px; font-size: 12px; }
  body[data-page="credits"] .hub-help-menu { right: calc(-132px - 8px); max-width: calc(100vw - 32px); }
  body[data-page="credits"] .hub-bar .theme-seg { grid-column: 3; grid-row: 2; justify-self: end; margin: 0; }
  body[data-page="credits"] #main { padding-top: 36px; padding-bottom: 64px; }
  body[data-page="credits"] .cr-intro { padding: 6px 0 30px; }
  body[data-page="credits"] .cr-eyebrow { font-size: 10px; margin-bottom: 16px; }
  body[data-page="credits"] .cr-intro .hub-h1 { font-size: 46px; }
  body[data-page="credits"] .cr-intro .hub-lede { max-width: 30ch; margin-top: 17px; font-size: 14px; }
  body[data-page="credits"] .cr-balance { padding: 18px 20px; gap: 14px; }
  body[data-page="credits"] .cr-balance-count { font-size: 25px; }
  body[data-page="credits"] .cr-balance > .hub-secondary { width: 100%; }
  body[data-page="credits"] .cr-status { scroll-margin-top: 136px; }
  body[data-page="credits"] .cr-catalogue { padding-top: 22px; }
  body[data-page="credits"] .cr-catalogue > .hub-h2 { font-size: 29px; margin-bottom: 22px; }
  body[data-page="credits"] .cr-catalogue > .hub-h2:not(:first-child) { margin-top: 56px; }
  body[data-page="credits"] .cr-grid,
  body[data-page="credits"] .cr-grid.cr-plans { grid-template-columns: 1fr; gap: 16px; }
  body[data-page="credits"] .cr-plans .cr-offer { min-height: 292px; padding: 25px; }
  body[data-page="credits"] .cr-offer-price-big { font-size: 49px; }
  body[data-page="credits"] .cr-gives { margin-top: 24px; }
  body[data-page="credits"] .cr-pack { min-height: 215px; padding: 24px; }
}

/* Public pricing uses the homepage's visual language. Account billing remains private. */
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) {
  --gutter: 28px;
  --wide: 1160px;
  background: var(--panel);
}
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-bar {
  height: 76px;
  padding: 0 max(var(--gutter), calc((100% - var(--wide)) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: var(--material);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  font: 600 18px/1 var(--display);
}
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-mark::before {
  content: '';
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  background: var(--ink);
  -webkit-mask: url('/icon.svg') center / contain no-repeat;
  mask: url('/icon.svg') center / contain no-repeat;
  mask-mode: alpha;
}
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-nav { align-items: center; gap: 3px; }
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-nav a { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); font-size: 13px; font-weight: 400; text-decoration: none; white-space: nowrap; }
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-nav a:hover { color: var(--ink); background: var(--bg); }
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .pricing-auth { display: flex; align-items: center; gap: 5px; }
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) #account { background: var(--ink); color: var(--panel); font-size: 13px; max-width: 190px; padding: 9px 18px; }
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) #account:hover { opacity: .82; }
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .pricing-auth [hidden] { display: none; }
body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) #main { padding-top: 65px; padding-bottom: 44px; }
.pr-intro { text-align: center; padding-bottom: 64px; }
.pr-eyebrow { margin: 0 0 19px; color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.pr-title { margin: 0; font: 600 clamp(52px, 7.2vw, 86px)/1.03 var(--display); letter-spacing: -.065em; text-wrap: balance; }
.pr-title > span { display: block; }
.pr-title-soft { color: var(--ink-3); }
.pr-lede { max-width: 44ch; margin: 25px auto 0; color: var(--ink-2); font-size: 17px; line-height: 1.65; text-wrap: balance; }
.pr-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; max-width: 100%; padding: 14px 26px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--panel); font-size: 14px; font-weight: 500; line-height: 1.4; text-align: center; text-decoration: none; transition: opacity .15s ease; }
.pr-cta:hover { opacity: .8; }
.pr-intro > .pr-cta { margin-top: 29px; }
.pr-unlimited { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 64px; max-width: 1000px; margin: 0 auto; padding: 48px; border: 1px solid var(--line-soft); border-radius: 24px; background: var(--bg); }
.pr-limitless { min-width: 0; }
.pr-limitless > .pr-eyebrow { margin-bottom: 7px; }
.pr-infinity { margin: 0 0 20px; color: var(--ink); font: 400 clamp(160px, 20vw, 236px)/.85 var(--display); letter-spacing: -.08em; }
.pr-included-title { margin: 0; font: 600 clamp(30px, 3.4vw, 42px)/1.08 var(--display); letter-spacing: -.055em; text-wrap: balance; }
.pr-included-copy { max-width: 26ch; margin: 13px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.pr-benefits { display: grid; gap: 25px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.pr-benefits > li { padding-bottom: 25px; border-bottom: 1px solid var(--line-soft); }
.pr-benefits > li:last-child { padding-bottom: 0; border-bottom: 0; }
.pr-benefit-title { margin: 0; font: 600 26px/1.15 var(--display); letter-spacing: -.035em; }
.pr-benefit-copy { max-width: 35ch; margin: 9px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.pr-invitation { max-width: 640px; margin: 0 auto; padding: 72px 0; text-align: center; }
.pr-invitation-title { margin: 0 0 26px; font: 600 clamp(32px, 4vw, 44px)/1.1 var(--display); letter-spacing: -.055em; text-wrap: balance; }
.pr-export-option { max-width: 1000px; margin: 0 auto; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.pr-pro-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 25px 0; cursor: pointer; list-style: none; }
.pr-pro-summary::-webkit-details-marker { display: none; }
.pr-pro-label { display: grid; gap: 5px; min-width: 0; }
.pr-pro-question { font: 600 19px/1.3 var(--display); letter-spacing: -.025em; }
.pr-pro-hint { color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.pr-pro-plus { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border: 1px solid var(--line-soft); border-radius: 50%; font: 400 22px/1 var(--sans); transition: transform .2s ease; }
.pr-export-option[open] .pr-pro-plus { transform: rotate(45deg); }
.pr-pro-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 64px; padding: 9px 0 31px; }
.pr-pro-copy { min-width: 0; }
.pr-pro-title { margin: 0 0 10px; font: 600 25px/1.2 var(--display); letter-spacing: -.035em; }
.pr-pro-copy > p { max-width: 49ch; margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.pr-pro-purchase { text-align: right; }
.pr-pro-purchase > .pr-cta { background: var(--panel); border-color: var(--line); color: var(--ink); }
.pr-pro-note { margin: 11px 0 0; color: var(--ink-3); font-size: 11px; line-height: 1.5; }
.pr-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px 24px; max-width: 1000px; margin: 38px auto 0; padding: 0; color: var(--ink-3); font-size: 12px; }
.pr-footer > p { flex-basis: 100%; margin: 0 0 5px; text-align: center; }
.public-footer { padding: 0 16px 36px; }
.pr-link { color: var(--ink-2); text-decoration: none; }
.pr-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) {
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-bar { gap: 12px; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-nav a { padding-left: 9px; padding-right: 9px; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-right { gap: 8px; }
  .pr-unlimited { gap: 36px; padding: 36px; }
  .pr-pro-body { gap: 36px; }
}
@media (max-width: 620px) {
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) { --gutter: 16px; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto 132px; height: auto; padding: 10px var(--gutter); gap: 6px 8px; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-mark { grid-column: 1; grid-row: 1; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-right { display: contents; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .pricing-auth { grid-column: 2 / 4; grid-row: 1; justify-content: flex-end; min-width: 0; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .pricing-auth > .btn { max-width: 160px; font-size: 12px; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-nav { grid-column: 1 / 3; grid-row: 2; min-width: 0; max-width: 100%; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-nav a { padding: 8px; font-size: 12px; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) .hub-bar .theme-seg { grid-column: 3; grid-row: 2; justify-self: end; margin: 0; }
  body:is([data-page="pricing"], [data-page="privacy"], [data-page="terms"]) #main { padding-top: 39px; padding-bottom: 32px; }
  .pr-intro { padding-bottom: 36px; }
  .pr-eyebrow { font-size: 10px; margin-bottom: 17px; }
  .pr-title { font-size: clamp(40px, 10.9vw, 60px); }
  .pr-lede { max-width: 31ch; margin-top: 21px; font-size: 15px; }
  .pr-intro > .pr-cta { margin-top: 24px; }
  .pr-unlimited { grid-template-columns: 1fr; gap: 32px; padding: 29px 26px; border-radius: 20px; }
  .pr-limitless { text-align: center; }
  .pr-infinity { margin-bottom: 14px; font-size: 172px; }
  .pr-included-title { font-size: 34px; }
  .pr-included-copy { margin: 12px auto 0; }
  .pr-benefits { gap: 22px; }
  .pr-benefits > li { padding-bottom: 22px; }
  .pr-benefit-title { font-size: 24px; }
  .pr-benefit-copy { max-width: none; font-size: 13px; }
  .pr-invitation { padding: 49px 0; }
  .pr-invitation-title { max-width: 15ch; margin: 0 auto 23px; font-size: 34px; }
  .pr-pro-summary { gap: 16px; padding: 23px 0; }
  .pr-pro-question { font-size: 18px; }
  .pr-pro-hint { font-size: 12px; }
  .pr-pro-body { grid-template-columns: 1fr; gap: 23px; padding: 2px 0 27px; }
  .pr-pro-title { font-size: 23px; }
  .pr-pro-copy > p { font-size: 13px; }
  .pr-pro-purchase { text-align: left; }
  .pr-footer { margin-top: 32px; font-size: 11px; }
}

/* The private workspace shares the homepage's typography and quiet surfaces.
   Projects, Exports and Media keep their own content inside the same page shell. */
body:is([data-page="projects"], [data-page="media"], [data-page="account"]) {
  --gutter: 28px;
  --wide: 1160px;
  background: var(--panel);
}
body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-bar {
  height: 76px;
  padding: 0 max(var(--gutter), calc((100% - var(--wide)) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: var(--material);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  font: 600 18px/1 var(--display);
}
body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-mark::before {
  content: '';
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  background: var(--ink);
  -webkit-mask: url('/icon.svg') center / contain no-repeat;
  mask: url('/icon.svg') center / contain no-repeat;
  mask-mode: alpha;
}
body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-nav { gap: 3px; align-items: center; }
body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-link {
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 400;
}
body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-link[aria-current="page"] { background: var(--bg); }
body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-help-button { padding: 8px 11px; font-size: 13px; font-weight: 400; border-radius: 999px; }
body:is([data-page="projects"], [data-page="media"], [data-page="account"]) #account { max-width: 24vw; padding: 9px 16px; background: var(--bg); font-size: 13px; }
body:is([data-page="projects"], [data-page="media"], [data-page="account"]) #main { padding-top: 54px; padding-bottom: 96px; }

:is(.dash-home, .dash-exports, .dash-media) { min-width: 0; }
.dash-intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); align-items: center; gap: 52px; margin-bottom: 52px; }
.dash-intro-copy { min-width: 0; }
.dash-eyebrow { margin: 0 0 17px; color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.dash-intro .hub-h1 { font: 600 clamp(42px, 5.4vw, 62px)/1.04 var(--display); letter-spacing: -.06em; text-wrap: balance; }
.dash-lede { max-width: 36ch; margin: 20px 0 0; color: var(--ink-2); font-size: 16px; line-height: 1.65; text-wrap: pretty; }
.dash-connect { display: grid; gap: 13px; justify-self: end; width: 100%; max-width: 330px; padding: 25px 27px; border: 1px solid var(--line-soft); border-radius: 20px; background: var(--bg); color: var(--ink); text-decoration: none; transition: border-color .18s ease, transform .18s ease; }
.dash-connect:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.dash-connect-eyebrow { color: var(--ink-3); font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.dash-connect-title { max-width: 14ch; font: 600 26px/1.15 var(--display); letter-spacing: -.04em; }
.dash-connect-link { display: flex; justify-content: space-between; gap: 18px; margin-top: 2px; color: var(--ink-2); font-size: 12px; }
.dash-library-head { justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; padding-top: 30px; border-top: 1px solid var(--line-soft); }
.dash-library-title { margin: 0; font: 600 21px/1.25 var(--display); letter-spacing: -.035em; }
.dash-home .hub-list { gap: 20px; }
:is(.dash-home, .dash-exports, .dash-media) .hub-status { color: var(--ink-3); font-size: 13px; }
.dash-home .hub-empty-inline { margin-top: 4px; padding: 32px 26px; border: 1px solid var(--line-soft); border-radius: 20px; background: var(--bg); }
.dash-home .hub-empty-inline .hub-lede { margin-bottom: 10px; color: var(--ink); font: 600 24px/1.2 var(--display); letter-spacing: -.035em; }
.dash-home .hub-empty-inline .hub-note { max-width: 47ch; margin-bottom: 22px; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.dash-home .hub-empty-inline .hub-secondary { min-height: var(--touch); padding: 11px 20px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 13px; }
:is(.dash-home, .dash-exports, .dash-media) .pager-more { min-height: var(--touch); margin-top: 2px; padding: 12px 24px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 13px; }
:is(.dash-home, .dash-exports, .dash-media) .pager-more:hover { border-color: var(--ink-3); box-shadow: none; }
:is(.dash-home, .dash-exports, .dash-media) .pager-more:disabled { color: var(--ink-3); opacity: .55; cursor: progress; }

@media (max-width: 900px) {
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-bar { gap: 12px; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-right { gap: 6px; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-link { padding-left: 10px; padding-right: 10px; }
  .dash-intro { gap: 30px; grid-template-columns: minmax(0, 1.35fr) minmax(240px, 1fr); }
  .dash-connect { padding: 23px; }
  .dash-connect-title { font-size: 24px; }
}
@media (max-width: 760px) {
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto 132px; height: auto; padding: 10px var(--gutter); gap: 6px 8px; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-mark { grid-column: 1; grid-row: 1; justify-self: start; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-right { display: contents; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-right > #account { grid-column: 3; grid-row: 1; justify-self: end; max-width: 100%; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-nav { grid-column: 1 / 3; grid-row: 2; min-width: 0; max-width: 100%; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-link { padding: 8px; font-size: 12px; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-help { grid-column: 2; grid-row: 1; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-help-button { padding: 8px; font-size: 12px; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-help-menu { right: calc(-132px - 8px); max-width: calc(100vw - 32px); }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) .hub-bar .theme-seg { grid-column: 3; grid-row: 2; justify-self: end; margin: 0; }
}
@media (max-width: 620px) {
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) { --gutter: 16px; }
  body:is([data-page="projects"], [data-page="media"], [data-page="account"]) #main { padding-top: 34px; padding-bottom: 64px; }
  .dash-intro { grid-template-columns: 1fr; gap: 25px; margin-bottom: 34px; }
  .dash-eyebrow { margin-bottom: 15px; font-size: 10px; }
  .dash-intro .hub-h1 { font-size: 45px; }
  .dash-lede { max-width: 31ch; margin-top: 16px; font-size: 14px; }
  .dash-connect { justify-self: stretch; max-width: none; gap: 10px; padding: 20px 22px; border-radius: 17px; }
  .dash-connect-eyebrow { font-size: 9px; }
  .dash-connect-title { max-width: none; font-size: 24px; }
  .dash-connect-link { margin-top: 1px; font-size: 12px; }
  .dash-library-head { gap: 14px; padding-top: 25px; margin-bottom: 18px; }
  .dash-library-title { font-size: 19px; }
  .dash-home .hub-empty-inline { padding: 27px 22px; }
  .dash-home .hub-empty-inline .hub-lede { font-size: 22px; }
  .dash-home .hub-empty-inline .hub-note { font-size: 13px; }
}


/* Exports and source media belong to the same library as saved projects. */
.dash-page-head { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 44px; }
.dash-page-head .hub-h1 { font: 600 clamp(42px, 5.4vw, 62px)/1.04 var(--display); letter-spacing: -.06em; overflow-wrap: anywhere; text-wrap: balance; }
.dash-page-head .dash-lede { max-width: 46ch; }
.dash-exports .hub-secondary,
.dash-media .lib-drive-button { min-height: var(--touch); padding: 11px 18px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 12px; font-weight: 500; }
.dash-exports .hub-secondary:hover,
.dash-media .lib-drive-button:hover { border-color: var(--ink-3); box-shadow: none; }
.dash-exports .hub-secondary { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

.dash-media .dash-page-head { margin-bottom: 36px; }
.dash-media .lib-drive { max-width: 100%; gap: 9px; }
.dash-media .lib-drive-state { font-size: 12px; }
.dash-media .lib-drive-off { min-height: var(--touch); padding: 8px 10px; border-radius: 999px; font-size: 12px; }
.dash-media .lib-drop { margin-bottom: 36px; padding: 36px 24px; border: 1px dashed var(--line); border-radius: 24px; background: var(--bg); }
.dash-media .lib-drop:hover,
.dash-media .lib-drop.lib-over { border-color: var(--ink-3); background: var(--panel-2); }
.lib-drop-mark { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 0 auto 20px; border: 1px solid var(--line-soft); border-radius: 17px; background: var(--panel); color: var(--ink); font: 400 28px/1 var(--sans); }
.dash-media .lib-drop-title { margin-bottom: 9px; font: 600 21px/1.25 var(--display); letter-spacing: -.035em; }
.dash-media .lib-drop-note { max-width: 40ch; margin: 0 auto; font-size: 13px; line-height: 1.65; }
.dash-media .hub-list { gap: 18px; }
.dash-media .lib-progress:not(:empty) { margin: -10px 0 28px; padding: 18px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--bg); }
.dash-media .lib-uploading { margin: 0; min-height: var(--touch); font-size: 12px; }
.dash-media .lib-uploading + .lib-uploading { margin-top: 12px; }
.dash-media .lib-retry[hidden],
.dash-media .lib-drive-off[hidden],
.dash-media .lib-drive-state[hidden],
.dash-media .lib-bar[hidden] { display: none; }

@media (max-width: 620px) {
  .dash-page-head { flex-wrap: wrap; gap: 22px; margin-bottom: 34px; }
  .dash-page-head .hub-h1 { font-size: 45px; }
  .dash-exports .dash-library-head { align-items: flex-start; }
  .dash-media .dash-page-head { margin-bottom: 28px; }
  .dash-media .lib-drive { margin-left: 0; justify-content: flex-start; }
  .dash-media .lib-drop { margin-bottom: 28px; padding: 29px 20px; border-radius: 20px; }
  .lib-drop-mark { width: 48px; height: 48px; margin-bottom: 17px; border-radius: 15px; }
  .dash-media .lib-drop-title { max-width: 17ch; margin: 0 auto 10px; font-size: 20px; }
  .dash-media .lib-drop-note { font-size: 12px; }
  .dash-media .lib-progress:not(:empty) { padding: 15px; }
}


/* Media opens only when asked; each thumbnail and filename is a native button. */
.dash-media .lib-open:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.dash-media .lib-preview-thumb { padding: 0; cursor: pointer; }
.dash-media .lib-preview-thumb:hover:not(:disabled) { border-color: var(--ink-3); }
.dash-media .lib-preview-thumb:disabled { cursor: default; }
.media-preview { width: min(960px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); overflow: hidden; }
.media-preview[open] { display: flex; flex-direction: column; }
.media-preview::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.media-preview-head { display: flex; flex: 0 0 auto; align-items: center; gap: 20px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.media-preview-title { min-width: 0; margin: 0; font: 600 16px/1.4 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.media-preview-close { flex: 0 0 auto; min-height: var(--touch); margin-left: auto; padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--bg); color: var(--ink); font: 500 12px/1.4 var(--sans); cursor: pointer; }
.media-preview-close:hover { border-color: var(--ink-3); }
.media-preview-stage { display: flex; flex: 1 1 auto; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 0; padding: 16px; background: var(--viewer); overflow: auto; overscroll-behavior: contain; }
.media-preview-status { max-width: 48ch; margin: 8px 0; color: var(--ink-2); font-size: 13px; line-height: 1.6; text-align: center; }
.media-preview-status[hidden] { display: none; }
.media-preview-image { display: block; max-width: 100%; max-height: calc(100dvh - 150px); width: auto; height: auto; object-fit: contain; }
/* These wrappers use the existing player; only their available viewing space differs. */
.media-preview-stage > .export-player { flex: 0 0 auto; width: 100%; min-width: 0; }
.media-preview-video .ex-video { width: 100%; height: auto; max-height: calc(100dvh - 240px); border-radius: 0; object-fit: contain; }
.media-preview-audio .ex-video { display: none; }
.media-preview-art { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; max-height: 300px; object-fit: contain; background: var(--picture-ground); color: var(--picture-ink); font: 400 64px/1 var(--sans); }
.media-preview-audio .export-player-status { position: static; margin: 12px; }
.media-preview-sound { display: none; }
.media-preview .export-player:fullscreen .ex-video { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.media-preview-audio { width: min(520px, 100%); }
@media (max-width: 620px) {
  .media-preview { border-radius: 16px; }
  .media-preview-head { gap: 12px; padding: 12px 14px; }
  .media-preview-title { font-size: 14px; }
  .media-preview-stage { padding: 12px; }
}


/* Account settings uses the same quiet surfaces as the private libraries. */
.account-settings { max-width: 860px; min-width: 0; margin: 0 auto; }
.account-settings .dash-page-head { margin-bottom: 38px; }
.settings-layout { display: grid; gap: 20px; }
.settings-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 28px; padding: 28px 30px; border: 1px solid var(--line-soft); border-radius: 20px; background: var(--panel); }
.settings-card-head { grid-column: 1 / -1; margin-bottom: 15px; }
.settings-card-title { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.4; font-weight: 500; }
.settings-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; margin: 0; }
.settings-field { min-width: 0; }
.settings-field dt { margin-bottom: 8px; color: var(--ink-3); font-size: 11px; }
.settings-value { margin: 0; font: 500 17px/1.5 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.settings-plan,
.settings-balance { grid-column: 1; margin: 0; font: 600 30px/1.2 var(--display); letter-spacing: -.04em; overflow-wrap: anywhere; }
.settings-note { grid-column: 1; margin: 0; max-width: 48ch; color: var(--ink-2); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.settings-note:empty { display: none; }
.settings-action { grid-column: 2; grid-row: 2 / 4; display: inline-flex; align-items: center; justify-content: center; justify-self: end; max-width: 100%; min-height: var(--touch); padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 12px; font-weight: 500; line-height: 1.5; text-decoration: none; text-align: center; }
.settings-action:hover { border-color: var(--ink-3); }
@media (max-width: 620px) {
  .account-settings .dash-page-head { margin-bottom: 30px; }
  .account-settings .hub-h1 { font-size: 42px; }
  .settings-layout { gap: 16px; }
  .settings-card { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 23px 22px; border-radius: 18px; }
  .settings-card-head { margin-bottom: 12px; }
  .settings-fields { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .settings-value { font-size: 16px; }
  .settings-plan,
  .settings-balance { font-size: 27px; }
  .settings-action { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 12px; }
}


/* Public policies keep the site's typography, with a quiet reading column. */
.legal-page { min-width: 0; }
.legal-intro { max-width: 780px; margin: 4px 0 52px; }
.legal-eyebrow { margin: 0 0 19px; color: var(--ink-3); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.legal-intro .hub-h1 { margin: 0 0 20px; font: 600 clamp(42px, 6vw, 68px)/1.04 var(--display); letter-spacing: -.06em; }
.legal-updated { display: block; margin-bottom: 23px; color: var(--ink-3); font-size: 12px; }
.legal-lede { max-width: 53ch; margin: 0; color: var(--ink-2); font-size: 17px; line-height: 1.7; }
.legal-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 64px; padding-top: 32px; border-top: 1px solid var(--line-soft); }
.legal-toc { position: sticky; top: 108px; max-height: calc(100dvh - 140px); padding-right: 8px; overflow: auto; }
.legal-toc-title { margin: 0 0 18px; color: var(--ink-3); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.legal-toc-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.legal-toc-link { color: var(--ink-2); font-size: 12px; line-height: 1.6; text-decoration: none; }
.legal-toc-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.legal-content { min-width: 0; max-width: 720px; }
.legal-section { margin: 0 0 44px; scroll-margin-top: 112px; }
.legal-heading { margin: 0 0 17px; font: 600 23px/1.3 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.legal-section[id="warranties"],
.legal-section[id="liability"] { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.legal-section p,
.legal-bullets { margin: 0 0 17px; color: var(--ink-2); font-size: 14px; line-height: 1.85; overflow-wrap: anywhere; }
.legal-bullets { padding-left: 20px; }
.legal-bullets li + li { margin-top: 10px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0; padding: 0; list-style: none; }
.legal-links a,
.legal-foot a { color: var(--ink); font-size: 12px; line-height: 1.6; text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.legal-foot { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 12px; padding-top: 27px; border-top: 1px solid var(--line-soft); }
@media (max-width: 800px) {
  .legal-layout { grid-template-columns: 170px minmax(0, 1fr); gap: 34px; }
}
@media (max-width: 620px) {
  .legal-intro { margin-bottom: 32px; }
  .legal-eyebrow { margin-bottom: 16px; font-size: 10px; }
  .legal-intro .hub-h1 { font-size: 46px; }
  .legal-updated { margin-bottom: 19px; font-size: 11px; }
  .legal-lede { font-size: 15px; }
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 25px; }
  .legal-toc { position: static; max-height: none; padding: 0 0 25px; border-bottom: 1px solid var(--line-soft); }
  .legal-toc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
  .legal-toc-link { display: inline-flex; align-items: center; min-height: var(--touch); font-size: 11px; }
  .legal-section { margin-bottom: 34px; scroll-margin-top: 150px; }
  .legal-heading { font-size: 21px; }
  .legal-section[id="warranties"],
  .legal-section[id="liability"] { padding: 20px; }
  .legal-section p,
  .legal-bullets { font-size: 13px; }
  .legal-foot a,
  .legal-links a { display: inline-flex; align-items: center; min-height: var(--touch); }
}


/* Account storage remains visible while the library pages or refreshes. */
.lib-storage { display: flex; align-items: center; gap: 18px; margin: 0 0 22px; padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); color: var(--ink); }
.lib-storage[hidden] { display: none; }
.lib-storage[data-reached="true"] { border-color: var(--warn); }
.lib-storage-copy { flex: 1 1 auto; min-width: 0; }
.lib-storage-title { display: block; font-size: 13px; font-weight: 600; line-height: 1.45; }
.lib-storage-usage { display: block; margin-top: 3px; color: var(--ink-2); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.lib-storage-message { margin: 9px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.lib-storage-usage[hidden], .lib-storage-message[hidden], .lib-storage-upgrade[hidden] { display: none; }
.lib-storage-upgrade { flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: 12px; font-weight: 500; line-height: 1.5; text-decoration: none; }
.lib-storage-upgrade:hover { background: var(--bg); text-decoration: none; }
.lib-storage-upgrade:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 620px) {
  .lib-storage { align-items: flex-start; flex-direction: column; gap: 12px; padding: 14px 16px; }
  .lib-storage-upgrade { min-height: var(--touch); padding: 11px 13px; }
}

/* Quiet per-card actions, separate from the card's editor or player. */
.card-menu { position: relative; flex: 0 0 auto; }
.card-menu-toggle { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: var(--panel); color: var(--ink-2); font: 500 23px/1 var(--sans); list-style: none; cursor: pointer; }
.card-menu-toggle::-webkit-details-marker { display: none; }
.card-menu-toggle:hover,
.card-menu[open] > .card-menu-toggle { border-color: var(--line-soft); background: var(--bg); color: var(--ink); }
.card-menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-menu-items { position: absolute; top: calc(100% + 6px); right: 0; z-index: 12; display: flex; flex-direction: column; gap: 2px; width: 180px; max-width: calc(100vw - 48px); padding: 6px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.card-menu:not([open]) > .card-menu-items { display: none; }
.card-menu-item { display: flex; align-items: center; width: 100%; min-height: 36px; margin: 0; padding: 9px 10px; border: 0; border-radius: 7px; background: none; color: var(--ink); font: 400 12px/1.4 var(--sans); text-align: left; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; }
.card-menu-item:hover:not(:disabled) { background: var(--bg); text-decoration: none; }
.card-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.card-menu-danger { color: var(--warn); }
.card-menu-danger:hover:not(:disabled) { background: var(--warn-soft); }
.card-menu-item:disabled { color: var(--ink-3); cursor: default; }
.card-menu-item[hidden] { display: none; }
@media (pointer: coarse) {
  .card-menu-toggle { width: var(--touch); height: var(--touch); }
  .card-menu-item { min-height: var(--touch); }
}

/* Exported frames stay untouched; custom playback controls sit below the picture. */
.export-player { overflow: hidden; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--panel); }
.export-player:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.export-player-screen { position: relative; min-width: 0; background: var(--viewer); }
.dash-exports .export-player .ex-video { border-radius: 0; object-fit: contain; cursor: pointer; }
/* THE FILM'S POSTER, over the screen until it plays: the video's own box and fit, so nothing moves when it goes. */
.export-player-poster { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.export-player-poster[hidden] { display: none; }
.export-player-status { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; padding: 9px 12px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--panel); color: var(--ink-2); font-size: 12px; line-height: 1.5; text-align: center; }
.export-player-controls { display: grid; gap: 4px; padding: 8px 12px 11px; border-top: 1px solid var(--line-soft); background: var(--panel); }
.export-player-bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.export-player-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.export-player-button svg { display: block; }
.export-player-button:hover { background: var(--bg); color: var(--ink); }
.export-player-button.export-player-play { background: var(--ink); color: var(--panel); }
.export-player-play:hover { opacity: .82; }
.export-player-button[hidden],
.export-player-status[hidden] { display: none; }
.export-player-time { margin-right: auto; color: var(--ink-2); font: 400 11px/1.4 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.export-player-seek,
.export-player-volume { --progress: 0%; display: block; min-width: 0; height: 18px; margin: 0; padding: 0; border: 0; border-radius: 999px; -webkit-appearance: none; appearance: none; background: transparent; color: var(--ink); accent-color: var(--ink); cursor: pointer; }
.export-player-seek { width: 100%; }
.export-player-volume { flex: 0 1 60px; width: 60px; }
.export-player-seek::-webkit-slider-runnable-track,
.export-player-volume::-webkit-slider-runnable-track { height: 3px; border-radius: 999px; background: linear-gradient(to right, var(--ink) 0 var(--progress), var(--line) var(--progress) 100%); }
.export-player-seek::-webkit-slider-thumb,
.export-player-volume::-webkit-slider-thumb { width: 10px; height: 10px; margin-top: -3.5px; border: 0; border-radius: 50%; -webkit-appearance: none; appearance: none; background: var(--ink); }
.export-player-seek::-moz-range-track,
.export-player-volume::-moz-range-track { height: 3px; border-radius: 999px; background: var(--line); }
.export-player-seek::-moz-range-progress,
.export-player-volume::-moz-range-progress { height: 3px; border-radius: 999px; background: var(--ink); }
.export-player-seek::-moz-range-thumb,
.export-player-volume::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--ink); }
.export-player-seek:disabled,
.export-player-volume:disabled { opacity: .4; cursor: default; }
.export-player:fullscreen { display: flex; flex-direction: column; width: 100%; height: 100%; border: 0; border-radius: 0; background: var(--viewer); }
.export-player:fullscreen .export-player-screen { display: flex; flex: 1 1 auto; align-items: center; justify-content: center; min-height: 0; }
.dash-exports .export-player:fullscreen .ex-video { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.export-player:fullscreen .export-player-controls { flex: 0 0 auto; width: 100%; padding: 10px 18px 14px; }
@media (pointer: coarse) {
  .export-player-button { width: var(--touch); height: var(--touch); }
  .export-player-seek,
  .export-player-volume { height: var(--touch); }
}
@media (max-width: 620px) {
  .export-player-controls { padding: 7px 10px 9px; }
  .export-player-bar { gap: 7px; }
  .export-player-volume { display: none; }
  .export-player-time { font-size: 10px; }
}

/* AN EXPORT, OPENED (editor/src/export-view.ts): ONE VIEWER FOR EVERY KIND — a film of any shape,
   one picture or a carousel — the page dimmed to black behind it in both themes, as Photos and
   Instagram open one, and the thing in a frame at its own shape (`--ar`, width over height), as
   large as the window allows. Last in the file, so the player's own rules are laid over. */
.export-view { box-sizing: border-box; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); border: 0; background: none; color: var(--picture-ink); overflow: hidden; }
.export-view[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 14px; animation: export-view-in .26s cubic-bezier(.2, .8, .2, 1); }
.export-view::backdrop { background: var(--viewer-scrim); -webkit-backdrop-filter: blur(28px) saturate(150%); backdrop-filter: blur(28px) saturate(150%); animation: export-view-fade .26s ease; }
@keyframes export-view-in { from { opacity: 0; transform: scale(.975); } }
@keyframes export-view-fade { from { opacity: 0; } }
.export-view-head { display: flex; align-items: center; gap: 10px; width: min(1100px, 100%); min-width: 0; margin: 0 auto; }
.export-view-titles { flex: 1 1 auto; min-width: 0; }
.export-view-title { margin: 0; overflow: hidden; color: var(--picture-ink); font: 600 15px/1.35 var(--sans); letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.export-view-meta { margin: 2px 0 0; overflow: hidden; color: var(--picture-ink-2); font: 400 12px/1.4 var(--sans); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.export-view-meta:empty { display: none; }
.export-view-round { display: inline-grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--picture-material); color: var(--picture-ink); text-decoration: none; cursor: pointer; -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); transition: transform .15s ease, opacity .2s ease; }
.export-view-round:hover { transform: scale(1.06); }
.export-view-round:active { transform: scale(.96); }
.export-view-round:focus-visible { outline: 2px solid var(--picture-ink); outline-offset: 2px; }
.export-view-round:disabled { opacity: 0; pointer-events: none; }
.export-view-round svg { display: block; }
.export-view-stage { --ar: 1.7778; display: grid; place-items: center; min-width: 0; min-height: 0; container-type: size; }

/* A film: the existing player, its frame the film's shape, its controls floated over the picture
   and gone while it plays untouched. */
.export-view-player.export-player { position: relative; width: min(100cqw, 100cqh * var(--ar)); max-width: 100%; aspect-ratio: var(--ar); border: 0; border-radius: 14px; background: var(--picture-ground); box-shadow: var(--shadow); }
.export-view-player .export-player-screen { position: absolute; inset: 0; background: var(--picture-ground); }
.export-view-player .ex-video { display: block; width: 100%; height: 100%; max-height: none; border-radius: 0; object-fit: contain; background: var(--picture-ground); cursor: pointer; }
.export-view-player .export-player-poster { object-fit: contain; }
.export-view-player .export-player-controls { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 3; padding: 8px 12px 10px; border: 0; border-radius: 14px; background: var(--picture-material); color: var(--picture-ink); -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%); transition: opacity .25s ease; }
.export-view-player[data-playing="true"]:not([data-awake]):not(:has(.export-player-controls :focus-visible)) .export-player-controls { opacity: 0; pointer-events: none; }
.export-view-player[data-playing="true"]:not([data-awake]) { cursor: none; }
.export-view-player .export-player-button { color: var(--picture-ink); }
.export-view-player .export-player-button:hover { background: var(--picture-material); color: var(--picture-ink); }
.export-view-player .export-player-button.export-player-play { border-radius: 50%; background: var(--picture-ink); color: var(--picture-ground); }
.export-view-player .export-player-time { color: var(--picture-ink-2); }
.export-view-player :is(.export-player-seek, .export-player-volume) { color: var(--picture-ink); accent-color: var(--picture-ink); }
.export-view-player :is(.export-player-seek, .export-player-volume)::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--picture-ink) 0 var(--progress), var(--picture-ink-2) var(--progress) 100%); }
.export-view-player :is(.export-player-seek, .export-player-volume)::-webkit-slider-thumb { background: var(--picture-ink); }
.export-view-player :is(.export-player-seek, .export-player-volume)::-moz-range-track { background: var(--picture-ink-2); }
.export-view-player :is(.export-player-seek, .export-player-volume)::-moz-range-progress { background: var(--picture-ink); }
.export-view-player :is(.export-player-seek, .export-player-volume)::-moz-range-thumb { background: var(--picture-ink); }
.export-view-player .export-player-status { bottom: 84px; border: 0; background: var(--picture-material); color: var(--picture-ink); }
.export-view-player.export-player:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
.export-view-player.export-player:fullscreen .export-player-controls { width: auto; padding: 8px 12px 10px; }

/* Pictures: a strip that slides, one shown, with arrows, a count and Instagram's dots. */
.export-view-carousel { display: grid; justify-items: center; gap: 14px; min-width: 0; }
.export-view-frame { position: relative; width: min(100cqw, (100cqh - 22px) * var(--ar)); max-width: 100%; aspect-ratio: var(--ar); overflow: hidden; border-radius: 14px; background: var(--picture-ground); box-shadow: var(--shadow); touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.export-view-track { display: flex; height: 100%; transition: transform .38s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.export-view-slide { position: relative; display: grid; flex: 0 0 100%; place-items: center; min-width: 0; height: 100%; }
.export-view-picture { display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
.export-view-picture[hidden],
.export-view-missing[hidden] { display: none; }
.export-view-missing { margin: 0; padding: 16px; color: var(--picture-ink-2); font-size: 13px; text-align: center; }
.export-view-prev,
.export-view-next { position: absolute; top: 50%; z-index: 2; margin-top: -19px; }
.export-view-prev { left: 12px; }
.export-view-next { right: 12px; }
.export-view-count { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 3px 9px; border-radius: 999px; background: var(--picture-material); color: var(--picture-ink); font: 600 12px/1.5 var(--sans); font-variant-numeric: tabular-nums; -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }
.export-view-dots { display: flex; align-items: center; justify-content: center; gap: 6px; height: 8px; }
.export-view-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--picture-ink-2); opacity: .55; transition: transform .2s ease, opacity .2s ease; }
.export-view-dot.on { background: var(--picture-ink); opacity: 1; transform: scale(1.15); }
@media (pointer: coarse) {
  .export-view-prev,
  .export-view-next { display: none; }
}
@media (max-width: 599px) {
  .export-view { padding: max(12px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom)); gap: 10px; }
  .export-view-player.export-player,
  .export-view-frame { border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .export-view[open],
  .export-view::backdrop { animation: none; }
  .export-view-track,
  .export-view-round,
  .export-view-dot,
  .export-view-player .export-player-controls { transition: none; }
}

/* site/docs.css */
/*
 * The documentation: /docs and /docs/<slug>.
 *
 * COMPOSED AFTER site/hub.css, by the build and by the dev server alike, so the
 * ground, the ink, the accent, the face and the header are the hub's own and
 * this file only adds what a page of reading needs — and both read their colours
 * from lib/theme.ts, so the docs are light or dark with everything else.
 *
 * A PAGE OF READING, NOT A PAGE OF ROWS. The hub is scanned; this is read top to
 * bottom, so the measure is held near 68 characters, the type is a size above
 * the hub's, and the line height is generous. Code is set apart in its own box
 * and scrolls inside it, because a tool call is one long word that cannot wrap
 * and a page that scrolls sideways on a phone is a page nobody finishes.
 *
 * NO SCRIPT BUT THE THEME'S ONE LINE IN THE HEAD, which applies the appearance a
 * person chose before the page paints. The contents rail is a column on a wide
 * screen and a disclosure on a narrow one, which is two pieces of markup and a
 * media query rather than a toggle somebody has to load.
 */

:root {
  --measure: 68ch;
  --rail: 232px;
  --shell: 1180px;
}

html { scroll-behavior: smooth; }

/* A PAGE OF READING IS SET ON WHITE (or #1C1C1E in dark), as Apple sets its own
   documentation: the grey ground is for lists of cards, and a column of prose is
   not one. What sits on it in a box — code, the contents, previous and next — takes
   the grouped grey instead. */
body[data-page="docs"] { background: var(--panel); }
body[data-page="docs"] .hub-bar { background: var(--material); }

/* A heading a link jumps to lands below the sticky bar rather than under it. */
.docs-article :target { scroll-margin-top: 76px; }

/* A link in the header that looks like the hub's account button. */
.docs-open { text-decoration: none; display: inline-flex; align-items: center; }

/* --- the shell: a rail and a column --------------------------------------- */

.docs-shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 56px;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.docs-rail {
  position: sticky;
  top: 56px;
  align-self: start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 36px 4px 48px 0;
  font-size: 14px;
}

.docs-rail-home {
  display: block;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  padding: 6px 10px;
  margin: 0 0 6px -10px;
  border-radius: 7px;
}

.docs-rail-head {
  margin: 22px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.docs-rail-list { list-style: none; margin: 0; padding: 0; }
.docs-rail-list li { margin: 0; }

.docs-rail-list a {
  display: block;
  color: var(--ink-2);
  text-decoration: none;
  padding: 5px 10px;
  margin-left: -10px;
  border-radius: 7px;
  line-height: 1.4;
}
.docs-rail-list a:hover, .docs-rail-home:hover { color: var(--ink); background: var(--raised); }
/* WHERE YOU ARE, marked on the link itself, as the hub header marks its page. */
.docs-rail-list a[aria-current="page"], .docs-rail-home[aria-current="page"] {
  color: var(--ink);
  background: var(--raised);
}

/* The hub sets `main` as a narrow centred column; here the shell does that. */
.docs-main {
  max-width: none;
  margin: 0;
  padding: 40px 0 96px;
  min-width: 0;
}

/* --- the phone's contents: a disclosure above the article --------------- */

.docs-toc { display: none; }

.docs-toc summary {
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--r-card);
  background: var(--panel-2);
}
.docs-toc summary::-webkit-details-marker { display: none; }
.docs-toc summary::after { content: "  ▾"; color: var(--ink-2); }
.docs-toc[open] summary::after { content: "  ▴"; }

.docs-toc-list {
  padding: 4px 14px 14px;
  font-size: 15px;
}

/* --- the article ---------------------------------------------------------- */

.docs-article {
  max-width: var(--measure);
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.docs-section {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.docs-article h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 36px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.024em;
  text-wrap: balance;
}

.docs-lede {
  margin: 0 0 36px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
}

.docs-article h2 {
  margin: 48px 0 12px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.016em;
  text-wrap: balance;
}

.docs-article h3 {
  margin: 32px 0 8px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
}

.docs-article p { margin: 0 0 18px; }
.docs-article ul, .docs-article ol { margin: 0 0 18px; padding-left: 22px; }
.docs-article li { margin: 0 0 8px; padding-left: 2px; }
.docs-article li::marker { color: var(--ink-2); }
.docs-article strong { font-weight: 600; }

.docs-article a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent-ink) 40%, transparent);
  text-underline-offset: 3px;
}
.docs-article a:hover { text-decoration-color: var(--accent-ink); }

/* INLINE CODE BREAKS ANYWHERE, because a tool call is one long word: left to
   itself it pushes the column wider than a phone and the page scrolls sideways. */
.docs-article code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--panel-2);
  border: 0.5px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

/* A BLOCK OF CODE SCROLLS IN ITS OWN BOX, and only there. */
.docs-code {
  margin: 0 0 22px;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 0.5px solid var(--line);
  border-radius: var(--r-card);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}
.docs-code code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  white-space: pre;
  overflow-wrap: normal;
}

/* A placeholder's rows — every preset, every catalogue — and its runs of words. */
.docs-article .docs-rows { list-style: none; padding-left: 0; }
.docs-article .docs-rows li { padding-left: 0; }
.docs-words { line-height: 2; }

/* --- the contents page ---------------------------------------------------- */

/* The contents' section names are signposts, set like the rail's. */
.docs-contents h2 {
  margin: 40px 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.docs-article .docs-index { list-style: none; padding-left: 0; margin: 0 0 12px; }
.docs-article .docs-index li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.docs-index li:last-child { border-bottom: 0; }
.docs-index a { font-weight: 600; text-decoration: none; }
.docs-index span { color: var(--ink-2); font-size: 15.5px; line-height: 1.5; }

/* --- previous and next ---------------------------------------------------- */

.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: var(--measure);
  margin-top: 56px;
}

.docs-prev, .docs-next {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: var(--r-card);
  background: var(--panel-2);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  min-width: 0;
}
.docs-prev span, .docs-next span { color: var(--ink-2); font-size: 13px; font-weight: 400; }
.docs-next { text-align: right; grid-column: 2; }
.docs-prev:hover, .docs-next:hover { background: var(--raised); }

/* --- the foot ------------------------------------------------------------- */

.docs-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
}
.docs-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.docs-foot a { color: var(--ink-2); text-decoration: none; }
.docs-foot a:hover { color: var(--ink); }

/* --- narrower ------------------------------------------------------------- */

@media (max-width: 900px) {
  /* THE RAIL GIVES WAY TO A DISCLOSURE, so the article starts at the top of a
     phone rather than under twenty links. */
  .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-rail { display: none; }
  .docs-toc { display: block; margin-bottom: 28px; }
  .docs-main { padding-top: 24px; }
}

@media (max-width: 620px) {
  /* SIXTEEN PIXELS EACH SIDE ON A PHONE, a little more of the width for reading. */
  :root { --gutter: 16px; }
  .docs-article { font-size: 16.5px; }
  .docs-article h1 { font-size: 29px; }
  .docs-lede { font-size: 17.5px; margin-bottom: 28px; }
  .docs-article h2 { font-size: 21px; margin-top: 40px; }
  .docs-code { font-size: 13px; padding: 12px 14px; }
  .docs-pager { grid-template-columns: minmax(0, 1fr); }
  .docs-next { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
