/* The dashboard and editor, in the Daylight look (docs/design-system/brand-book.md): a top bar, a tab
 * rail with its panel, and the preview on the stage. Sizes and colours come from tokens.css. */

/* The editor fills the window under any flash message, and only its panel and stage scroll. */
body:has(> .editor) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.editor {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(var(--topbar-height), auto) minmax(0, 1fr);
  font-size: 13.5px;
  background: var(--canvas);
}

:is(.editor, .settings-page) :focus-visible { outline: 2px solid var(--select); outline-offset: 2px; }

/* Top bar. Where it's too narrow for everything on one line, the actions wrap onto a second (and
   a third), so none run off the screen. */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-6);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.topbar__brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-width: 0;
  margin: 0;
}

/* The logo, fading a little on hover like the marketing site's links. */
.wordmark { display: inline-flex; align-self: center; transition: opacity 0.2s ease; }
.wordmark:hover { opacity: 0.65; }
.wordmark img { display: block; width: auto; height: 15px; }

.topbar__device { margin-inline: auto; }

.publish-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.publish-bar p { margin: 0; }
.publish-bar__note { color: var(--ink-muted); }
a.publish-bar__note:hover { color: var(--ink); }
/* Words shown on phones only, in place of publish-bar__wide ones. */
.publish-bar__narrow { display: none; }

/* Narrower, the copy shrinks before the top bar wraps: Discard loses its "unpublished". */
@media (max-width: 1320px) { .publish-bar__long { display: none; } }

/* Buttons: quiet by default, one primary (Publish), and danger for deleting. */
:is(.editor, .settings-page) .btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--touch-target);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

:is(.editor, .settings-page) .btn:hover:not(:disabled) { background: var(--hover); }
:is(.editor, .settings-page) .btn:disabled { color: var(--ink-muted); cursor: default; }
:is(.editor, .settings-page) .btn[hidden] { display: none; }

:is(.editor, .settings-page) .btn--primary {
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 500;
}

:is(.editor, .settings-page) .btn--primary:hover:not(:disabled) { background: var(--ink); opacity: 0.88; }
:is(.editor, .settings-page) .btn--primary:disabled { background: var(--field); color: var(--ink-muted); }
:is(.editor, .settings-page) .btn--danger { color: var(--danger); }
/* A button that stays on until pressed again, such as Adjust crop (then Done). */
:is(.editor, .settings-page) .btn--toggle[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
/* Icon only, such as Undo and Redo, with an aria-label. */
:is(.editor, .settings-page) .btn--icon { justify-content: center; width: 38px; padding: 0; }

.publish-bar__history { display: inline-flex; }

/* Status: always a dot and a word, never colour alone. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--dot, var(--ink-muted));
}

/* Marigold, the brand's accent, is too light for words on white, so only the dot has it. */
.status--draft { --dot: var(--draft); }
.status--ok { --dot: var(--ok); }
.status--danger { --dot: var(--danger); color: var(--danger); }

/* A row of mutually exclusive options, such as Desktop and Mobile. */
.segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--field);
}

.segmented button {
  min-height: calc(var(--touch-target) - 4px);
  padding: 0 var(--space-4);
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: none;
  color: var(--ink-muted);
  font: inherit;
  cursor: pointer;
}

.segmented button[aria-pressed="true"] {
  background: var(--canvas);
  box-shadow: var(--shadow-chip);
  color: var(--ink);
  font-weight: 500;
}

/* Tab rail, panel and stage */
.editor__body {
  display: grid;
  grid-template-columns: var(--tabrail-width) calc(var(--sidebar-width) - var(--tabrail-width)) minmax(0, 1fr);
  min-height: 0;
}

.tabrail {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-2);
}

.tabrail a {
  display: flex;
  align-items: center;
  min-height: var(--touch-target);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  text-decoration: none;
}

.tabrail a:hover { background: var(--hover); }
.tabrail a[aria-current] { background: var(--field); color: var(--ink); font-weight: 500; }

/* The line between the tabs for building the site and the rest (Free months, Help, Account), which
   sit at the rail's foot, a little smaller. */
.tabrail__line,
.menu__line { width: 100%; margin: var(--space-2) 0; border: 0; border-top: 1px solid var(--line); }
.tabrail__line { margin-top: auto; }
.tabrail__line ~ a { min-height: 32px; font-size: 12.5px; white-space: nowrap; }

/* Free months' gift, in marigold (the draft dot's colour), after the words like one more character. */
.tab-gift { display: inline-flex; margin-left: 4px; color: var(--draft); vertical-align: -1px; }

/* A tab with a notice in it (see dashboard/_editor), in marigold too. */
.tab-dot { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--draft); vertical-align: middle; }
.tabbar :is(a, button):has(.tab-dot) { position: relative; }
.tabbar .tab-dot { position: absolute; top: 8px; left: calc(50% + 8px); margin: 0; }

.panel {
  --panel-heading: 24px;
  overflow-y: auto;
  padding: var(--space-6);
  border-right: 1px solid var(--line);
}

.panel h1 { margin: 0 0 var(--space-6); font-size: 17px; font-weight: 600; line-height: var(--panel-heading); }

/* What's over a link image, which waits for the link to be saved. */
.overlay-settings { min-width: 0; margin: 0; padding: 0; border: 0; }
.overlay-settings:disabled > :not(h3, .overlay-settings__unlinked) { opacity: 0.5; }
.overlay-settings:not(:disabled) > .overlay-settings__unlinked { display: none; }

.panel h2,
.panel h3 {
  margin: var(--space-6) 0 var(--space-3);
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.panel p { margin: 0 0 var(--space-3); }
.panel .hint { font-size: 13px; color: var(--ink-muted); }

.panel .notice {
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--field);
}

.panel .notice h2 { margin-top: 0; color: var(--ink); font-size: 13.5px; }

.panel input[type="text"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--touch-target);
  margin: var(--space-1) 0 var(--space-3);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--canvas);
  font: inherit;
  font-size: 15px;
}

turbo-frame.panel { display: block; }

/* A block's settings (BlockSettings in the design system). */
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  margin: calc(var(--space-3) * -1) 0 var(--space-3);
  color: var(--ink-muted);
  text-decoration: none;
}

.back-link::before { content: "←"; margin-right: var(--space-2); }
.back-link:hover { color: var(--ink); }
.panel h1 .muted { margin-left: var(--space-2); color: var(--ink-muted); font-size: 13px; font-weight: 400; }

.field { margin-bottom: var(--space-3); }
.field label,
.field__label { display: flex; justify-content: space-between; margin-bottom: var(--space-1); }
.field__meta { color: var(--ink-muted); font-size: 12.5px; }
.field .hint { margin: var(--space-1) 0 0; }

.panel textarea,
.panel select,
.panel input[type="number"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.panel textarea { resize: vertical; }

/* A slider, such as a chalkboard's columns, with its value beside the label. */
.panel input[type="range"] {
  display: block;
  width: 100%;
  min-height: var(--touch-target);
  margin: 0;
  accent-color: var(--select);
}
.panel .field input[type="text"] { margin: 0; background: var(--field); }

.checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
}

.checkbox input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }

/* Options filling the panel's width, wrapping when there are many (a span out of 12). */
.segmented--full { display: flex; flex-wrap: wrap; width: 100%; box-sizing: border-box; }
.segmented--full button { flex: 1 0 auto; padding: 0 var(--space-2); }
/* The chalkboard's four display modes, two by two. */
.segmented--pairs button { flex-basis: 40%; }

/* A font from a list, each shown in itself, opening under the one chosen. */
.font-picker__current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--field);
  font-size: 16px;
  list-style: none;
  cursor: pointer;
}
.font-picker__current::-webkit-details-marker { display: none; }
.font-picker__current::after { content: "▾"; color: var(--ink-muted); font-family: var(--font-sans); font-size: 12px; }
.font-picker[open] .font-picker__current::after { content: "▴"; }
.font-picker__options {
  display: grid;
  max-height: 300px;
  margin-top: var(--space-1);
  padding: var(--space-1);
  overflow-y: auto;
  border-radius: var(--radius-sm);
  background: var(--page);
  box-shadow: inset 0 0 0 1px var(--line-control);
}
.font-picker__options button {
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}
.font-picker__options button:hover { background: var(--hover); }
.font-picker__options button[aria-pressed="true"] { background: var(--field); font-weight: 600; }

/* Background colours (ColourField in the design system), with a colour of one's own under them. */
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-1); margin-bottom: var(--space-2); }
.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.swatch:hover { background: var(--hover); }
.swatch[aria-pressed="true"] { background: var(--field); color: var(--ink); }
.swatch__colour { width: 26px; height: 26px; border-radius: var(--radius-full); background: var(--page); box-shadow: inset 0 0 0 1px var(--line-control); }
.swatch[aria-pressed="true"] .swatch__colour { outline: 2px solid var(--select); outline-offset: 2px; }
/* Many short options, such as a chalkboard's 1 to 12 columns, in one row. */
.segmented--compact button { flex: 1 1 0; min-width: 0; padding: 0; }

.segmented--full + [data-block-settings-target="reveal"],
.segmented--full + .display-hints { margin-top: var(--space-3); }

.asset-row { display: flex; align-items: center; gap: var(--space-3); }

.asset-row img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--field);
  object-fit: cover;
}

.inline-buttons { display: flex; gap: var(--space-2); }

/* A line above each of a settings panel's sections (and Settings' Account, after them), so
   they're easier to tell apart. */
.block-settings section,
.block-settings + section {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.block-settings section > h2:first-child,
.block-settings + section > h2:first-child { margin-top: 0; }

.block-settings__foot {
  display: flex;
  justify-content: space-between;
}

/* Reset to default, whose page title can be long. */
.block-settings__foot .btn { text-align: left; }
.block-settings__foot .btn svg { flex-shrink: 0; }

.link-list { margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.link-list a { display: flex; align-items: center; min-height: var(--touch-target); color: var(--ink); }

/* Settings' links to its own pages, as a tray of rows (like the Pages tab's), each with its
   current value where it has one and an arrow. */
.link-list--tray { display: grid; gap: 2px; padding: var(--space-2); border-radius: var(--radius-md); background: var(--field); }
.link-list--tray a {
  gap: var(--space-2);
  padding: 0 var(--space-2) 0 var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
  text-decoration: none;
}
.link-list--tray li { min-width: 0; }
.link-list--tray a:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); }
.link-list__label { flex: 1; white-space: nowrap; }
.link-list__value { min-width: 0; overflow: hidden; color: var(--ink-muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.link-list--tray .icon { flex-shrink: 0; color: var(--ink-muted); }

/* Publishing's addresses: each address, wrapping if it's long, with its action on the right and
   whether it's live under it. */
.site-address { margin-bottom: var(--space-4); }
.panel .site-address h3 { margin: 0 0 var(--space-1); }
.site-address__row { display: flex; align-items: baseline; gap: var(--space-3); }
.site-address__value { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.site-address__value a { color: var(--ink); }
.site-address__value--empty { color: var(--ink-muted); font-size: 13px; }
.site-address__action { flex-shrink: 0; color: var(--ink); font-size: 13px; }
button.site-address__action { padding: 0; border: 0; background: none; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.panel .address-form { margin-top: var(--space-3); }
.panel .address-form label { display: block; margin-bottom: var(--space-1); }
.panel .address-form__field { background: var(--field); }
.panel .address-form__field input[type="text"] { flex: 1; min-width: 0; padding-right: 0; background: none; }
.panel .address-form__field input:focus-visible { outline: 0; }
.panel .address-form__suffix { font-size: 13.5px; }
.panel .address-form__result { min-height: 1.5em; margin: var(--space-2) 0 var(--space-3); color: var(--ink-muted); font-size: 12.5px; }
.panel .address-form__result--good { color: var(--ok); }
.panel .address-form__result--bad { color: var(--danger); }
.panel .site-address__status { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; color: var(--ink-muted); font-size: 12.5px; }

/* Publishing's published versions: a tray with a row each, V number over its date, the live one
   marked Live. */
.versions { display: grid; gap: 2px; margin: 0 0 var(--space-4); padding: var(--space-2); list-style: none; border-radius: var(--radius-md); background: var(--field); }

.versions__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.versions__name { display: flex; align-items: center; gap: var(--space-2); }
.versions__name .tag { margin-left: 0; }
/* The live version's tag starts with a green dot that slowly fades in and out. */
.versions__live { display: inline-flex; align-items: center; gap: 6px; }
.versions__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: versions-pulse 2s ease-in-out infinite; }
@keyframes versions-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .versions__dot { animation: none; } }
.versions__date { grid-column: 1; color: var(--ink-muted); font-size: 12.5px; }
/* Each past version's Preview and Restore, as small text links. */
.versions__actions { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; gap: var(--space-3); font-size: 13px; }
.versions__actions a,
.versions__restore { color: var(--ink); text-decoration: underline; }
.versions__restore-form { display: inline; }
.versions__restore { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.versions__restore:disabled { color: var(--ink-muted); text-decoration: none; cursor: default; }

/* Referral's link and code, in a box to read or select, with their Copy buttons. */
.copy-field {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--field);
  overflow-wrap: anywhere;
}
.copy-field code { font-size: 13.5px; }
.panel .copy-field + .inline-buttons { flex-wrap: wrap; margin-bottom: var(--space-3); }
.copy-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.panel .copy-row .copy-field { flex: 1; margin: 0; }
.copy-row .btn { flex-shrink: 0; }

/* Referral's friends who signed up, as a tray of rows like the versions', each with its status. */
/* Free months' tally, as on the marketing page: the months earned large in marigold, then each
   friend who signed up. */
.panel .tally { margin: var(--space-6) 0 var(--space-2); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); }
.tally__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.panel .tally__title { margin: 0; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.tally__count { color: var(--draft); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.tally__label { color: var(--ink-muted); font-size: 12.5px; }
.tally__list { margin: 0; padding: 0; list-style: none; }
.tally__list li { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.tally__list li:last-child { padding-bottom: 0; border-bottom: 0; }
.tally__list strong { font-weight: 600; }
.tally__name { min-width: 0; overflow-wrap: anywhere; }
.tally__waiting { color: var(--ink-muted); }

/* The Pages tab (PageList, option C "two trays", owner 26 Oct). Its heading sits beside Add,
   whose card floats under it. The open page is a strip at the top. The nav and the pages left out
   of it are soft grey trays holding white rows, so both read as places to drop a row; the tray
   under a dragged row gets a dark outline. */
/* As tall as the heading, so it sits where the other tabs' headings do: the taller Add button
   overflows it equally above and below. */
.panel__head { position: relative; display: flex; align-items: center; justify-content: space-between; height: var(--panel-heading); margin-bottom: var(--space-6); }
.panel .panel__head h1 { margin: 0; }
.pages__add > summary { list-style: none; }
.editor .pages__add > summary.btn { background: var(--field); }
.pages__add > summary::-webkit-details-marker { display: none; }
.pages__add-card {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  z-index: 5;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--canvas);
  box-shadow: var(--shadow-chip);
}
.pages__add-card .field { margin-bottom: var(--space-3); }

.this-page { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }
.this-page--end { margin: var(--space-4) 0 0; }
.this-page__text { display: grid; flex: 1 1 100%; min-width: 0; }
.this-page__text strong { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.this-page__text span { color: var(--ink-muted); font-size: 12.5px; }
.editor .this-page .btn { min-height: 30px; background: var(--field); font-size: 12.5px; }

.tray { margin-bottom: var(--space-3); padding: var(--space-2); border-radius: var(--radius-md); background: var(--field); }
.panel .tray__head { display: flex; gap: var(--space-2); margin: var(--space-1) var(--space-2) var(--space-2); }
.tray__count { color: var(--line-control); font-weight: 400; font-variant-numeric: tabular-nums; }

.page-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.page-zone { position: relative; }
.page-list__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: 0 var(--space-1);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
  color: var(--ink);
}
.page-list__row:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); }
.page-list__row[aria-current] { box-shadow: 0 0 0 1.5px var(--ink); }
.page-list__grip {
  display: inline-flex;
  padding: var(--space-1);
  border: 0;
  background: none;
  color: var(--line-control);
  cursor: grab;
  touch-action: none;
}
.page-list__link {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
/* The address gives way before the name does. */
.page-list__name { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.page-list__slug { flex: 0 100 auto; margin-left: auto; overflow: hidden; color: var(--ink-muted); font-size: 12.5px; text-overflow: ellipsis; }
.page-list__kind,
.page-list__home { display: inline-flex; flex-shrink: 0; color: var(--ink-muted); }
.page-list__more { flex-shrink: 0; }

/* The rows under a page or dropdown, along a thin line. An empty dropdown always shows a slot to
   drop into. A page's, while a row is dragged, is a small "Put under" target over the right of its
   row (taking no room, so nothing moves): drop there to put the row under it, anywhere else to
   reorder. */
.page-list--under { position: relative; margin: 2px 0 0 var(--space-6); }
.page-list--under::after { content: ""; position: absolute; top: 4px; bottom: 4px; left: -11px; width: 1px; background: var(--line-control); opacity: 0.35; }
.nav-row { position: relative; }
.nav-row[data-type=label] > .page-list--under:not(:has(> li)) { min-height: 36px; }
.nav-row[data-type=page] > .page-list--under:not(:has(> li)) { display: none; }
.pages--dragging .nav-row[data-type=page] > .page-list--under:not(:has(> li)) {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
  width: 62%;
  height: var(--touch-target);
  margin: 0;
}
.page-list--under:not(:has(> li))::after { display: none; }
.page-zone:not(:has(> li))::before,
.nav-row[data-type=label] > .page-list--under:not(:has(> li))::before,
.pages--dragging .nav-row[data-type=page] > .page-list--under:not(:has(> li))::before {
  content: attr(data-empty);
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-2);
  color: var(--ink-muted);
  font-size: 12.5px;
  text-align: center;
  pointer-events: none;
}
.nav-row[data-type=label] > .page-list--under:not(:has(> li))::before { inset: 0; border: 1px dashed var(--line-control); border-radius: var(--radius-sm); }
.pages--dragging .nav-row[data-type=page] > .page-list--under:not(:has(> li))::before {
  content: "Put under";
  inset: 4px 4px 4px 0;
  border: 1px dashed var(--line-control);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  font-size: 12px;
}
.pages--dragging .nav-row[data-type=page] > .page-list--under:not(:has(> li)):hover::before { border-color: var(--ink); color: var(--ink); }
/* Each list fills its tray, under its heading too, so a row dropped anywhere on the tray lands in it. */
.tray { position: relative; }
.panel .tray .tray__head { position: absolute; top: var(--space-2); left: var(--space-2); margin: var(--space-1) var(--space-2); pointer-events: none; }
/* With its padding, room for one row, or the empty tray's note, under the heading. */
.page-zone { box-sizing: border-box; min-height: 88px; margin: calc(var(--space-2) * -1); padding: 36px var(--space-2) var(--space-2); }
.page-zone:not(:has(> li))::before { inset: 36px var(--space-2) var(--space-2); }
.tray:has(> .page-zone > .sortable-ghost) { box-shadow: inset 0 0 0 1.5px var(--ink); }
.page-list--under:has(> .sortable-ghost)::after { opacity: 1; background: var(--ink); }
/* Where the dragged row will land, on the row under the pointer. */
.nav-row.sortable-fallback[data-landing]::after {
  content: attr(data-landing);
  position: absolute;
  top: -10px;
  right: 8px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: var(--on-ink);
  font-size: 11.5px;
}
.nav-row.sortable-ghost > .page-list__row { opacity: 0.4; }
.pages--dragging .nav-row.sortable-ghost > .page-list--under { display: none; }
/* The row being dragged, which follows the pointer outside the panel. */
.nav-row.sortable-fallback { list-style: none; color: var(--ink); font-size: 13.5px; }
.nav-row.sortable-fallback > .page-list__row { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14); }
.nav-row.sortable-fallback .page-list__more { visibility: hidden; }
.nav-row.sortable-fallback .page-menu,
.nav-row.sortable-fallback .page-list--under { display: none; }

/* A row's ⋯ menu: a card under it with its fields, then its actions in a row, Delete on the right. */
.page-menu {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-1) 0 var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--canvas);
  box-shadow: var(--shadow-chip);
}
.page-menu[hidden] { display: none; }
.page-menu .field { margin: 0; }
.page-menu__acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-1);
  margin: 0 calc(var(--space-2) * -1) calc(var(--space-1) * -1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}
.page-menu__acts form { margin: 0; }
.page-menu__acts .btn { font-size: 12.5px; }
.page-menu__acts .hint { padding-left: var(--space-2); }
.page-menu__delete { margin-left: auto; }

/* A page's Search and sharing, folded at the end of its menu. */
.page-menu__search { padding-top: var(--space-2); border-top: 1px solid var(--line); }
.page-menu__search > summary { cursor: pointer; font-weight: 500; }
.page-menu__search[open] > summary { margin-bottom: var(--space-3); }
.page-menu__search .field { margin-bottom: var(--space-3); }
.page-menu__search .field:last-child { margin-bottom: 0; }

/* A field with words before what's typed, such as a page's address after its "/". */
.input-prefix { display: flex; align-items: center; gap: var(--space-1); }
.input-prefix span { color: var(--ink-muted); }
.input-prefix input { flex: 1; }

.tag {
  margin-left: auto;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  background: var(--field);
  color: var(--ink-muted);
  font-size: 12.5px;
}

.stage {
  display: flex;
  justify-content: center;
  min-height: 0;
  padding: var(--space-8);
  background: var(--stage);
}

.stage__frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--page);
  box-shadow: var(--shadow-page);
  transition: width 200ms;
}

.editor[data-device="mobile"] .stage__frame { width: var(--preview-mobile); }

/* A box drawn from the grey round the preview, selecting the blocks it touches (preview_controller.js). */
.stage__box {
  position: fixed;
  z-index: 5;
  border: 1px solid var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  pointer-events: none;
}
.stage__box[hidden] { display: none; }

/* The asset library, open over the preview (AssetLibrary and AssetTile in the design system): a
 * canvas sheet on the stage, with its filters and an image's details in the panel. */
.stage--library { display: block; overflow-y: auto; }

/* A page of its own in the preview's place, such as Billing: a canvas sheet on the stage. */
.stage--page { display: block; overflow-y: auto; }
.stage--page .settings-page { min-height: 100%; background: var(--canvas); box-shadow: var(--shadow-page); }

.library {
  max-width: 1240px;
  min-height: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: var(--space-6) var(--space-8) var(--space-12);
  background: var(--canvas);
  box-shadow: var(--shadow-page);
}

.library__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.library__head h2 { margin: 0; font-size: 13.5px; font-weight: 500; }
.library__head .hint { margin: 2px 0 0; color: var(--ink-muted); }
.library__count { color: var(--ink-muted); font-weight: 400; }
.library__count::before { content: "· "; }
:is(.editor, .settings-page) .btn--outline { box-shadow: inset 0 0 0 1px var(--line-control); }
:is(.editor, .settings-page) .btn--outline:focus-within { outline: 2px solid var(--select); outline-offset: 2px; }
:is(.editor, .settings-page) .btn--disabled { color: var(--ink-muted); cursor: default; }

.library__notice {
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--field);
}

.dropzone {
  padding: var(--space-6) var(--space-4);
  border: 1px dashed var(--line-control);
  border-radius: var(--radius-sm);
  text-align: center;
}

.dropzone p { margin: 0 auto; }
.dropzone .dropzone__title { margin-bottom: var(--space-3); }
.dropzone__title .btn { margin-left: var(--space-2); }
.dropzone__note { color: var(--ink-muted); font-size: 13px; }
.dropzone--active { border-color: var(--select); background: var(--select-soft); }

.upload-progress { margin-top: var(--space-4); }
.upload-progress p { margin: 0 0 var(--space-1); }
.upload-progress progress,
.tile__progress { width: 100%; accent-color: var(--ink); }

/* Which note shows depends on the tiles: uploading ones take priority over resizing ones. */
.library__note { display: none; margin: var(--space-4) 0 0; color: var(--ink-muted); }
.library:has(.tile--uploading) .library__note--uploading { display: block; }
.library:has(.tile--processing):not(:has(.tile--uploading)) .library__note--resizing { display: block; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: var(--space-6) var(--space-4);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

.tiles:has(> li) + .tiles__empty { display: none; }
.tiles__empty { margin: var(--space-12) 0; color: var(--ink-muted); text-align: center; }
.tiles__mascot { display: block; width: auto; height: 72px; margin: 0 auto var(--space-4); transform: rotate(-6deg); }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tile p { margin: 0; }

/* Each image fills a square, so the tiles line up; its details show the whole image. */
.tile__thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  margin-bottom: 4px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
}

button.tile__thumb { cursor: pointer; }
.tile__thumb--empty { padding: 0 var(--space-3); background: var(--placeholder); }

.tile__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

button.tile__thumb:hover { box-shadow: 0 0 0 2px var(--select); }

.tile__chip {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: var(--chip);
  box-shadow: var(--shadow-chip);
  color: var(--ink);
  font-size: 13px;
  opacity: 0;
}

.tile__thumb:hover .tile__chip,
.tile__thumb:focus-visible .tile__chip { opacity: 1; }

/* Opened to add images: a circle in the corner, numbered once ticked, in the order ticked. */
.tile__tick {
  position: absolute;
  top: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  box-sizing: border-box;
  border: 1.5px solid var(--canvas);
  border-radius: var(--radius-full);
  background: rgb(0 0 0 / 0.2);
  box-shadow: var(--shadow-chip);
  color: var(--canvas);
  font-size: 12px;
  font-weight: 500;
}

.tile__thumb[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--select); }
.tile__thumb[aria-pressed="true"] .tile__tick { border-color: var(--select); background: var(--select); }

.tile__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A status under the picture. A long reason wraps beside its dot. */
.tile .status { display: flex; align-items: baseline; font-size: 13px; }
.tile .status::before { flex: none; transform: translateY(-1px); }
.tile .tile__status:not(.status--danger) { color: var(--ink-muted); }
/* An upload refused before it reached the server (asset_upload_controller.js). */
.tile.tile--failed .tile__status { --dot: var(--danger); color: var(--danger); }

/* How many are ticked, and Add, along the bottom of the library as it scrolls. */
.library__bar {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-6) calc(-1 * var(--space-8)) calc(-1 * var(--space-12));
  padding: var(--space-3) var(--space-8);
  border-top: 1px solid var(--line);
  background: var(--canvas);
}

.library__bar p { flex: 1; margin: 0; color: var(--ink-muted); }

.video-thumbnails { margin-top: var(--space-12); }
.video-thumbnails h3 { margin: 0; font-size: 13.5px; font-weight: 500; }
.video-thumbnails .hint { margin: 2px 0 0; color: var(--ink-muted); }

/* The library's filters and an image's details, in the panel. */
.filters { margin: 0 0 var(--space-6) calc(var(--space-2) * -1); padding: 0; list-style: none; }

.filters__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--touch-target);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
}

.filters__row:hover { background: var(--hover); }
.filters__row[aria-current] { background: var(--field); font-weight: 500; }
.filters__count { color: var(--ink-muted); font-weight: 400; }

.asset-details__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  margin-bottom: var(--space-4);
  background: var(--field);
  object-fit: contain;
}

/* The picture as a link to the original: it darkens and says so on hover or focus. */
.asset-details__original { position: relative; display: block; margin-bottom: var(--space-4); }
.asset-details__original .asset-details__image { margin-bottom: 0; }

.asset-details__original::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.35);
  opacity: 0;
  transition: opacity 150ms;
}

.asset-details__view {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--chip);
  box-shadow: var(--shadow-chip);
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 150ms;
}

.asset-details__original:hover::after,
.asset-details__original:focus-visible::after,
.asset-details__original:hover .asset-details__view,
.asset-details__original:focus-visible .asset-details__view { opacity: 1; }

.asset-details ul { margin: 0 0 var(--space-6); padding-left: var(--space-6); }
.asset-details ul a { color: var(--ink); }
.asset-row .btn { margin-left: auto; }
/* An image setting in Settings or SEO (dashboard/_setting_image): its name shortened to fit beside
   its buttons. */
.asset-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-row .inline-buttons { margin-left: auto; }
.asset-row .inline-buttons .btn { margin-left: 0; }

/* A social link's platform in Settings, with its icon. */
.social-label { display: inline-flex; align-items: center; gap: var(--space-2); }
.social-label svg { width: 16px; height: 16px; }

/* A page's search preview, in its Search and sharing, roughly as a search engine shows the page. */
.search-preview { padding: var(--space-3); border-radius: var(--radius-sm); background: var(--field); overflow-wrap: anywhere; }
.search-preview__url { color: var(--ink-muted); font-size: 12.5px; }
.search-preview__title { margin: 2px 0; font-size: 16px; }
.search-preview__description { color: var(--ink-muted); font-size: 13px; }

/* Only on phones (below). On wider screens the panel is always beside the preview. */
.sheet,
.publish-bar__state { display: contents; }

.editor .topbar__page,
.editor .publish-bar__more,
.editor .sheet__grab,
.editor .sheet__close,
.editor .tabbar,
.editor .editor__show,
.editor .stage__note,
.editor .block-settings__moves { display: none; }

/* Menus that open over the editor (popovers), on phones: the top bar's ⋯ and the bottom bar's More. */
.menu {
  margin: 0;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--canvas);
  box-shadow: var(--shadow-page);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
}

.menu form { margin: 0; }

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu__item:hover:not(:disabled) { background: var(--hover); }
.menu__item:disabled { color: var(--ink-muted); cursor: default; }
.menu__item--danger:not(:disabled) { color: var(--danger); }
.menu__item[aria-current] { background: var(--field); font-weight: 500; }
.menu__row { padding: var(--space-2) var(--space-3) var(--space-3); }
.menu__label { display: block; margin-bottom: var(--space-2); color: var(--ink-muted); font-size: 12.5px; }
.menu .segmented button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-height: 40px; }

/* Phones (MobileEditor in the design system): the page fills the screen between a 56px top bar
   and a 60px bottom bar, and the panel opens over it as a sheet (sheet_controller.js). */
@media (max-width: 767.98px) {
  .editor {
    --sheet-height: calc((100dvh - 116px) * 0.52);
    grid-template-rows: 56px minmax(0, 1fr) 60px;
  }

  /* Page name with the save state under it, then undo, redo, ⋯ and Publish. */
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas: "name history more publish" "state history more publish";
    /* The name and save state together in the middle of the bar, as tall as its 36px buttons. */
    grid-template-rows: 20px 16px;
    align-content: center;
    gap: 0 var(--space-1);
    padding: 0 var(--space-2) 0 var(--space-3);
  }

  /* With room, the save state goes beside the name instead (topbar_controller.js). */
  .topbar[data-one-line] {
    grid-template-columns: max-content minmax(0, 1fr) auto auto auto;
    grid-template-rows: 36px;
    grid-template-areas: "name state history more publish";
  }

  .topbar__brand { grid-area: name; line-height: 20px; }
  .topbar[data-one-line] .topbar__brand,
  .topbar[data-one-line] .publish-bar__state { align-self: center; }
  .topbar[data-one-line] .publish-bar__state { padding-left: var(--space-2); }
  .wordmark,
  .topbar__device,
  .editor .publish-bar__wide,
  .tabrail { display: none; }
  .editor .publish-bar__narrow { display: inline; }

  .editor .topbar__page {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
  }

  .topbar__page-name { overflow: hidden; text-overflow: ellipsis; }
  .topbar__page .icon { flex: none; }

  .publish-bar { display: contents; }

  .publish-bar__state {
    grid-area: state;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    min-width: 0;
    font-size: 12.5px;
    line-height: 16px;
  }

  .publish-bar__state .status { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .publish-bar__state .status::before { display: inline-block; margin-right: 6px; vertical-align: middle; }
  .publish-bar__state .btn { min-height: 24px; padding: 0 var(--space-2); font-size: 12.5px; }
  .publish-bar__history { grid-area: history; align-self: center; }
  .publish-bar__history .btn--icon,
  .publish-bar__more { width: 36px; min-height: 36px; }
  .editor .publish-bar__more { display: inline-flex; grid-area: more; align-self: center; }

  .publish-bar > .btn--primary,
  .publish-bar > form:last-child,
  .publish-bar__note { grid-area: publish; align-self: center; }

  .publish-bar__note { padding-left: var(--space-1); font-size: 12.5px; }
  .editor .btn--primary { min-height: 36px; padding: 0 var(--space-3); }

  .menu--editor {
    inset: auto var(--space-2) auto auto;
    top: 56px;
    width: min(320px, calc(100vw - 2 * var(--space-2)));
  }

  /* The preview, edge to edge, on the mobile layout. With the sheet open, it ends where the sheet
     starts, so the selected block stays in view above it (edit_mode.js). */
  .editor__body {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .stage {
    position: relative;
    display: block;
    overflow: hidden;
    padding: 0;
    transition: padding-bottom 200ms;
  }

  .editor[data-sheet] .stage { padding-bottom: var(--sheet-height); }
  .stage.stage--page { overflow-y: auto; }
  .stage--page .settings-page { padding: var(--space-6) var(--space-4) var(--space-12); box-shadow: none; }
  .stage__frame { box-shadow: none; transition: none; }
  .editor[data-device] .stage__frame { width: 100%; }

  /* The desktop layout, at a laptop's width, scaled to fit (device_controller.js). */
  .editor[data-device="desktop"] .stage__frame {
    width: 1280px;
    height: calc(100% / var(--preview-scale, 1));
    transform: scale(var(--preview-scale, 1));
    transform-origin: 0 0;
  }

  .editor[data-device="desktop"] .stage__note {
    position: absolute;
    top: var(--space-2);
    left: 50%;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin: 0;
    padding: 0 var(--space-3);
    min-height: 28px;
    border-radius: var(--radius-full);
    background: var(--chip);
    box-shadow: var(--shadow-chip);
    color: var(--ink-muted);
    font-size: 12.5px;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
  }

  /* The sheet: half height, or full once pulled up; no dimmed backdrop. */
  .sheet {
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: var(--sheet-height);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--canvas);
    box-shadow: var(--shadow-page);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 200ms, visibility 0s 200ms, height 200ms;
  }

  .editor[data-sheet] .sheet { transform: none; visibility: visible; transition: transform 200ms, height 200ms; }
  .editor[data-sheet-full] .sheet { height: 100%; }

  /* A strip at the top with the grabber, and Close at its end, over the panel's scrolling. */
  .editor .sheet__grab {
    display: grid;
    flex: none;
    place-items: center;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .sheet__grab span { width: 36px; height: 4px; border-radius: var(--radius-full); background: var(--line-control); }

  .editor .sheet__close {
    position: absolute;
    top: 0;
    right: var(--space-2);
    z-index: 1;
    display: inline-flex;
    width: 44px;
    min-height: 44px;
  }

  .panel {
    flex: 1;
    min-height: 0;
    padding: 0 var(--space-4) var(--space-6);
    border-right: 0;
  }

  .panel h1,
  .panel__head { margin-bottom: var(--space-4); }
  .panel .back-link { margin-top: 0; }

  .editor .block-settings__moves { display: flex; margin-bottom: var(--space-4); }
  .block-settings__moves .btn { flex: 1; justify-content: center; min-height: 44px; }
  .block-settings__position { display: none; }
  .panel .checkbox,
  .page-list__row,
  .link-list a,
  .filters__row { min-height: 44px; }

  /* The asset library takes the whole space, with its filters as a row over it; an image's
     details open in the sheet. */
  .editor__body:has(> .stage--library) { grid-template-rows: auto minmax(0, 1fr); }
  .editor__body:has(> .stage--library) .sheet { display: contents; visibility: visible; }
  .editor .editor__body:has(> .stage--library) .sheet__grab,
  .editor .editor__body:has(> .stage--library) .sheet__close { display: none; }

  .editor__body:has(> .stage--library) .panel {
    padding: var(--space-2) var(--space-4) 0;
    border-bottom: 1px solid var(--line);
  }

  .editor__body:has(> .stage--library) .panel > h1,
  .editor__body:has(> .stage--library) .panel > .hint,
  .editor__body:has(> .stage--library) .panel h2 { display: none; }

  .editor__body:has(> .stage--library) .filters { display: flex; gap: var(--space-2); margin: 0 0 var(--space-2); overflow-x: auto; }
  .editor__body:has(> .stage--library) .filters__row { gap: var(--space-2); min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-full); background: var(--field); white-space: nowrap; }
  .editor__body:has(> .stage--library) .filters__row[aria-current] { background: var(--ink); color: var(--on-ink); }
  .editor__body:has(> .stage--library) .filters__row[aria-current] .filters__count { color: inherit; }

  .editor__body:has(> .stage--library):has(.asset-details) .sheet {
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--canvas);
    box-shadow: var(--shadow-page);
  }

  .editor .editor__body:has(> .stage--library):has(.asset-details) .sheet__grab { display: grid; visibility: hidden; }
  .editor .editor__body:has(> .stage--library):has(.asset-details) .sheet__close { display: inline-flex; }
  .editor__body:has(> .stage--library):has(.asset-details) .panel { padding: 0 var(--space-4) var(--space-6); border-bottom: 0; }

  .stage--library { grid-row: 2; padding: 0; }
  .library { padding: var(--space-4); box-shadow: none; }
  .library__bar { margin: var(--space-4) calc(-1 * var(--space-4)) calc(-1 * var(--space-4)); padding: var(--space-3) var(--space-4); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-3); }
  .tile__chip { opacity: 1; }

  /* Pages, Style, Assets and More, in place of the tab rail. */
  .editor .tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    background: var(--canvas);
  }

  .tabbar a,
  .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-muted);
    font: inherit;
    font-size: 11.5px;
    text-decoration: none;
    cursor: pointer;
  }

  .tabbar [aria-current],
  .tabbar [data-current] { color: var(--ink); font-weight: 500; }

  .menu--more {
    inset: auto var(--space-2) calc(60px + var(--space-2)) auto;
    width: min(260px, calc(100vw - 2 * var(--space-2)));
  }

  .menu--more .menu__item { justify-content: space-between; }

}

/* Hide editor UI (Preview on a computer): only the page, and a way back. On a computer the
   preview fills the space, still at a phone's width for the mobile layout. */
.editor.editor--bare { grid-template-rows: minmax(0, 1fr); }
.editor--bare .topbar,
.editor--bare .tabrail,
.editor--bare .tabbar,
.editor--bare .sheet { display: none; }
.editor--bare .editor__body { grid-template-columns: minmax(0, 1fr); }

/* Top right, where Preview was. */
/* Bottom right, clear of the lightbox's close button (top right). */
.editor.editor--bare .editor__show {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 3;
  display: inline-flex;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-chip);
}

.editor.editor--bare .editor__show:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 80%, var(--on-ink)); }

@media (min-width: 768px) {
  .editor--bare .stage { padding: 0; }
  .editor--bare[data-device="mobile"] .stage { padding: var(--space-8) 0 0; }
  .editor--bare:not([data-device="mobile"]) .stage__frame { box-shadow: none; }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  .stage,
  .sheet,
  .editor[data-sheet] .sheet { transition: none; }
}

/* Help's stand-in for the guide library: faded rows of a video thumbnail and two title lines. */
.guides-soon { display: grid; gap: var(--space-2); margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.guides-soon__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border: 1px dashed var(--line-control);
  border-radius: var(--radius-md);
  opacity: 0.6;
}
.guides-soon__row:nth-child(2) { opacity: 0.4; }
.guides-soon__row:nth-child(3) { opacity: 0.2; }
.guides-soon__thumb {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  background: var(--placeholder);
}
/* A play triangle, since each guide has a video. */
.guides-soon__thumb::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -35% -50%;
  border-block: 6px solid transparent;
  border-left: 9px solid var(--placeholder-mark);
}
.guides-soon__lines { display: grid; flex: 1; gap: 6px; }
.guides-soon__lines span { height: 8px; border-radius: var(--radius-full); background: var(--placeholder); }
.guides-soon__lines span:last-child { width: 60%; }

/* A page of its own off the Settings tab (the Thunderchalk address, your own domain): the top bar,
   then one column in the editor's type, its section labels over grey cards. */
.settings-page {
  box-sizing: border-box;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-12);
  font-size: 13.5px;
}

.settings-page .back-link { margin: 0 0 var(--space-2); }
.settings-page h1 { margin: 0 0 var(--space-2); font-size: 22px; font-weight: 600; line-height: 1.3; }
.settings-page h2 { margin: var(--space-8) 0 var(--space-3); color: var(--ink-muted); font-size: 12.5px; font-weight: 500; }
.settings-page h4 { margin: var(--space-6) 0 var(--space-2); font-size: 13.5px; font-weight: 600; }
.settings-page p { margin: 0 0 var(--space-3); }
.settings-page a { color: var(--ink); }
.settings-page .hint { color: var(--ink-muted); font-size: 13px; }
.settings-page__lede { margin-bottom: var(--space-6); color: var(--ink-muted); font-size: 15px; }
.settings-page__lede strong { color: var(--ink); font-weight: 500; }
.settings-page__domain { margin: var(--space-6) 0 var(--space-1); font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.settings-page__domain a { text-decoration: none; }
.settings-page__domain a:hover { text-decoration: underline; }
.settings-page p.status { margin: 0 0 var(--space-6); }

.settings-card { margin: 0 0 var(--space-6); padding: var(--space-6); border-radius: var(--radius-md); background: var(--field); }
.settings-card > :last-child { margin-bottom: 0; }
.settings-page .settings-card h2 { margin: 0 0 var(--space-2); color: var(--ink); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.settings-card__value { margin: 0 0 var(--space-1); font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.settings-card__value a { text-decoration: none; }
.settings-card__value a:hover { text-decoration: underline; }
.settings-page .settings-card p.status { margin: 0; }

/* Fields: borderless, on the card's white where they sit in one. */
.settings-page label { display: block; margin-bottom: var(--space-1); font-weight: 500; }
.settings-page input[type="text"],
.settings-page select {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--touch-target);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.settings-card input[type="text"] { background: var(--canvas); }
.domain-form .hint { margin: var(--space-2) 0 var(--space-4); }

/* The new address, with .thunderchalk.com after it in the same field, and what the check found. */
.address-form__field { display: flex; align-items: center; border-radius: var(--radius-sm); background: var(--canvas); }
.address-form__field:focus-within { outline: 2px solid var(--select); outline-offset: 2px; }
.settings-page .address-form__field input[type="text"] { flex: 1; min-width: 0; padding-right: 0; background: none; }
.settings-page .address-form__field input:focus-visible { outline: 0; }
.address-form__suffix { padding-right: var(--space-3); color: var(--ink-muted); font-size: 15px; white-space: nowrap; }
.settings-page .address-form__result { min-height: 1.5em; margin: var(--space-2) 0 var(--space-4); color: var(--ink-muted); font-size: 13px; }
.settings-page .address-form__result--good { color: var(--ok); }
.settings-page .address-form__result--bad { color: var(--danger); }

/* The DNS records to add: a white table in the card. Long values wrap rather than widen the page,
   and the type (CNAME, TXT) stays whole. */
.dns-records { width: 100%; margin: var(--space-4) 0; border-collapse: collapse; border-radius: var(--radius-sm); background: var(--canvas); }
.dns-records th { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); color: var(--ink-muted); font-size: 12.5px; font-weight: 500; text-align: left; }
.dns-records td { padding: var(--space-3); vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.dns-records tr + tr td { border-top: 1px solid var(--line); }
.dns-records td:first-child { font-weight: 500; overflow-wrap: normal; }

/* A value to type into a DNS provider's form, and its Copy button. */
.settings-page code { padding: 1px 5px; border-radius: 4px; background: var(--field); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.copyable { white-space: nowrap; }
.copyable code { white-space: normal; overflow-wrap: anywhere; }
.copy-button {
  margin-left: var(--space-1);
  padding: 1px var(--space-2);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.copy-button:hover { box-shadow: inset 0 0 0 1px var(--line-control); }

/* The provider's steps, which Copy all copies. */
.dns-guide { margin: 0 0 var(--space-6); }
.dns-guide__picker { max-width: 360px; margin-bottom: var(--space-3); }
.dns-guide ol,
.dns-guide ul { margin: var(--space-4) 0; padding-left: var(--space-6); }
.dns-guide li { margin-bottom: var(--space-3); line-height: 1.6; }
.dns-guide li::marker { color: var(--ink-muted); }
.dns-guide__copy-all { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-6); }

/* Optional steps for forwarding the bare domain to www. */
.bare-domain { margin: var(--space-6) 0; padding: var(--space-4) var(--space-6); border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--line); }
.bare-domain summary { font-weight: 500; cursor: pointer; }
.bare-domain[open] summary { margin-bottom: var(--space-3); }
.bare-domain li { margin-bottom: var(--space-2); }

/* On the card's grey, a primary button waiting for a free address stays visible. */
.settings-card .btn--primary:disabled { background: var(--canvas); }

/* Billing's cards: the plan's price large, its sentences and buttons under it. */
.settings-page .billing-card h2 { margin-bottom: var(--space-2); color: var(--ink-muted); font-size: 12.5px; font-weight: 500; }
.billing-card .settings-card__value { margin-bottom: var(--space-2); font-size: 20px; font-weight: 600; }
.settings-card .btn:not(.btn--primary) { background: var(--canvas); }
.billing-card p:has(> .btn) { margin: var(--space-4) 0 0; }
.billing-card p:has(> .btn) + p:has(> .btn) { margin-top: var(--space-2); }
.billing-card form { margin: var(--space-3) 0 0; }

.settings-page__danger { margin-top: var(--space-8); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.settings-page__danger .btn { margin-left: calc(var(--space-3) * -1); }

@media (max-width: 600px) {
  .settings-page { padding: var(--space-6) var(--space-4) var(--space-12); }
  .settings-card { padding: var(--space-4); }
  .bare-domain { padding: var(--space-3) var(--space-4); }
}

/* As tall as the editor's top bar: 64px, and 56px on phones, where the editor's drops the wordmark
   for the page name but these pages keep it. */
.topbar--page { box-sizing: border-box; min-height: var(--topbar-height); }

@media (max-width: 767.98px) {
  .topbar.topbar--page { display: flex; height: 56px; min-height: 0; padding: 0 var(--space-2) 0 var(--space-3); }
  .topbar--page .wordmark { display: inline-flex; }
}
