/* Admin-only aliases are scoped to the rendered admin surface, never :root.
   The existing text/index controls drive independent type and size lanes. */
.admin-surface {
  --admin-text-font: "Fragment Mono", monospace;
  --admin-index-font: "Fragment Mono", monospace;
  --admin-text-size: 10pt;
  --admin-index-size: 10pt;
  --admin-text-fvs: normal;
  --admin-index-fvs: normal;
  --admin-code-font: var(--admin-text-font);
  --admin-code-size: var(--admin-text-size);
  --fs: var(--admin-text-size);
  --fs-mono: var(--admin-index-size);
  --font-body: var(--admin-text-font);
  --font-mono: var(--admin-index-font);
  --fvs-body: var(--admin-text-fvs);
  --fvs-mono: var(--admin-index-fvs);
}
/* Admin shelf, code editor, changes, history and finder. */
.admin-page {
  max-width: 34em;
  margin: 0;
  padding: 0;
  font-family: var(--admin-text-font);
  font-size: var(--admin-text-size);
  color: var(--ink);
}
.admin-invite,
.admin-note,
.admin-warn {
  color: var(--dim);
}
.admin-warn {
  color: var(--pin);
}
.admin-gate {
  display: flex;
  gap: 0.6em;
  align-items: center;
}
.admin-code {
  font: inherit;
  letter-spacing: 0.5em;
  width: 6.5em;
  padding: 0.35em 0.6em 0.35em 1.1em;
  background: none;
  color: var(--ink);
  border: none;
  border-bottom: 1px solid var(--hairline);
  outline: none;
}
.admin-go,
.admin-add {
  font: inherit;
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 0.35em 0;
}
.admin-go:not(:disabled):hover,
.admin-add:not(:disabled):hover {
  color: var(--ink);
}
.admin-go:disabled {
  color: var(--hairline);
  cursor: default;
}
.admin-row {
  display: flex;
  align-items: baseline;
  gap: 1em;
  padding: 0.45em 0;
  border-bottom: 1px solid var(--hairline);
}
.admin-row-head {
  border-bottom: none;
  margin-top: 0.5em;
}
.admin-col-title {
  flex: 1;
}
.admin-counts {
  color: var(--dim);
}
.admin-face-name {
  flex: 1;
}
.admin-face-file {
  color: var(--dim);
}
.admin-row-new .admin-face-name::after {
  content: " · staged";
  color: var(--dim);
}
.admin-row-out {
  opacity: 0.45;
}
.admin-row-out .admin-face-name {
  text-decoration: line-through;
}
.admin-face-del {
  font: inherit;
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
}
.admin-face-del:hover {
  color: var(--ink);
}
.admin-move {
  font: inherit;
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 0 0.25em;
}
.admin-move:not(:disabled):hover {
  color: var(--ink);
}
.admin-move:disabled {
  opacity: 0.3;
  cursor: default;
}
.admin-row-add,
.admin-row-publish {
  border-bottom: none;
  margin-top: 1.2em;
}
.admin-row-publish {
  gap: 1.4em;
  align-items: center;
}
.admin-rollback {
  font: inherit;
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
}
.admin-rollback:hover {
  color: var(--ink);
}

/* ---- the code editor and the changes folder -------------------------------
 * the admin idiom stretched wide: the code's titles where titles live, the
 * text in the main area; verizon folds the titles over the text */
.editor-page,
.mailing-page,
.changes-page,
.shelf-page,
.history-page {
  max-width: none;
}
.admin-nav {
  border-bottom: none;
  gap: 1.4em;
  margin-top: 0.4em;
}
.admin-nav-link {
  font: inherit;
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 0.3em 0;
}
.admin-nav-link.on,
.admin-nav-link:not(.on):hover {
  color: var(--ink);
}
/* the editor in the story idiom: the code's titles in the titles column (they fold under
   their dot), the file itself in the text column, as wide as the measure says */
.editor-story {
  margin-top: 0.8em;
}
.editor-head {
  position: relative;
}
.editor-list-fold {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s ease;
}
.editor-list-fold.open {
  grid-template-rows: 1fr;
}
.editor-list-fold > .editor-titles {
  overflow: hidden;
  min-height: 0;
}
.editor-titles {
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  align-items: flex-start;
  margin-top: 6px;
  max-height: 62vh;
  overflow-y: auto;
}
.editor-title {
  font: inherit;
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  text-align: left;
  padding: 0.3em 0;
  white-space: nowrap;
}
.editor-title.on {
  color: var(--ink);
}
.editor-title.out {
  opacity: 0.45;
  text-decoration: line-through;
}
.changes-open > .admin-face-del {
  display: block;
  margin-bottom: 0.8em;
}
.editor-title:not(.on):hover {
  color: var(--ink);
}
.editor-body {
  max-width: var(--measure, 29em);
  margin-top: 0;
  font-family: var(--admin-text-font);
  font-size: var(--admin-text-size);
  font-variation-settings: var(--admin-text-fvs);
}
.editor-body > * {
  font-size: var(--admin-text-size);
}
.editor-body > .code-surface {
  font-size: var(--admin-code-size);
}
.editor-loading {
  min-height: 20vh;
}

/* the code surface: a transparent textarea over the colored lines; the caret is his,
   the colors and the numbers are the page's. One font metric for both layers. */
.code-surface {
  /* line 1's baseline sits on the story head's calibration constant, so the code's first
       baseline meets the title's baseline exactly as the text's does on every story */
  --code-pad: calc(
    (0.817 + (var(--lh) - 1) / 2) * var(--fs) - 1.05 * var(--fs-mono)
  );
  position: relative;
  height: 62vh;
  min-height: 300px;
  font-family: var(--admin-code-font);
  font-variation-settings: var(--admin-text-fvs);
  font-size: var(--admin-code-size);
  line-height: var(--admin-code-line-height);
}
.code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: var(--code-pad) 0 0 44px;
  font: inherit;
  line-height: inherit;
  letter-spacing: 0;
  background: transparent;
  color: transparent;
  caret-color: var(--palette-caret, #dc143c);
  border: 0;
  outline: none;
  resize: none;
  white-space: pre-wrap; /* the code reflows to the measure - the width grip re-lays lines, never covers them */
  word-break: break-all;
  tab-size: 8;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* the site's own scroller hides it too - and a gutter here would skew the wrap math */
}
.code-input::-webkit-scrollbar {
  display: none;
}
.code-input::selection {
  background: var(--palette-selection, #dc143c);
  color: transparent;
}
.code-view,
.code-gutter {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.code-shift {
  position: absolute;
  top: var(--code-pad);
  left: 0;
  width: 100%;
  will-change: transform;
} /* full width: the view's wrap column is the textarea's, to the pixel */
.code-line {
  position: absolute;
  left: 44px;
  width: calc(100% - 44px);
  white-space: pre-wrap;
  word-break: break-all;
  tab-size: 8;
  color: var(--ink);
}
.code-measure {
  position: absolute;
  top: var(--code-pad);
  left: 44px;
  width: calc(100% - 44px);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-all;
  tab-size: 8;
} /* the wrap yardstick: the textarea's own text box, offstage */
.code-measure > div {
  min-height: calc(var(--admin-code-line-height) * 1em);
}
.code-gutter {
  width: 44px;
  right: auto;
}
.code-num {
  position: absolute;
  left: 0;
  width: 32px;
  height: calc(var(--admin-code-line-height) * 1em);
  text-align: right;
  color: var(--dim);
  user-select: none;
}
.tok-com,
.tok-pun {
  color: var(--dim);
}
.tok-str {
  color: var(--palette-accent, #dc143c);
}

/* the admin rings' slot in the rail's stack: one flex child holding the page's rings in the
   same column rhythm, so the whole stack - page buttons and admin rings alike - travels with
   the horizon and nothing overlaps (his ruling, 27 Sep 21:00) */
.admin-slot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* the ring atom outside the rail: the same 34px hairline circle, the word in the tip */
.ring-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  position: relative;
  text-decoration: none;
  transition:
    color 0.35s ease,
    border-color 0.35s ease;
}
.ring-btn:hover:not(:disabled),
.ring-btn:focus-visible:not(:disabled) {
  color: var(--ink);
  border-color: var(--ink);
}
.ring-btn:disabled {
  color: var(--hairline);
  cursor: default;
}

.admin-apply {
  font: inherit;
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 0.55em 0;
  letter-spacing: 0.06em;
}
.admin-apply:not(:disabled):hover {
  color: var(--ink);
}
.admin-apply:disabled {
  color: var(--hairline);
  cursor: default;
}
.changes-title {
  flex: 1;
  font: inherit;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  padding: 0;
}
.diff-block {
  padding: 0.4em 0 0.9em 1.2em;
  line-height: 1.5;
}
.diff-block div {
  white-space: pre-wrap;
  word-break: break-all;
}
.diff-out {
  color: var(--dim);
  text-decoration: line-through;
}
.diff-in {
  color: var(--ink);
}
.diff-ctx {
  color: var(--hairline);
}
@media (max-aspect-ratio: 1/1) {
  .code-surface {
    height: 50vh;
  }
}

/* The four admin sections share one title axis. There is no duplicate heading above
   their content: the right column alone changes when a title is chosen. */
.admin-page {
  position: relative;
  min-height: calc(100vh - var(--pin));
  --admin-index-line-height: var(--lh, 1.5);
  --admin-code-line-height: var(--lh, 1.5);
}
.admin-titles {
  position: fixed;
  left: calc(48px + var(--index-inset));
  /* The first row's baseline sits on the horizon (--hline, the plus's horizontal stroke).
     --admin-index-base is the row's own baseline offset below its top. AdminTitles measures it
     for the live face, size and line height; this formula (Fragment Mono's ascent) is the
     value before the first measure. --hline is read as is: it carries the reader's font size
     and line height, so the admin surface's own --fs and --lh must not be used to rebuild it. */
  --admin-index-base: calc(
    ((var(--admin-index-line-height) - 1) / 2 + 0.84) * var(--fs-mono)
  );
  --admin-titles-top: calc(var(--hline) - var(--admin-index-base));
  top: var(--admin-titles-top);
  width: calc(300px - var(--index-inset));
  font: var(--admin-index-size)/var(--admin-index-line-height)
    var(--admin-index-font);
  font-variation-settings: var(--admin-index-fvs);
  letter-spacing: 0;
  /* The column scrolls by itself, and only when the open sections outgrow the viewport.
     Folded and short, it has no overflow and nothing scrolls. No scrollbar (D46). */
  box-sizing: border-box;
  max-height: calc(100vh - var(--admin-titles-top, 0px));
  max-height: calc(100dvh - var(--admin-titles-top, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-behavior: auto;
}
.admin-titles::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.admin-code-gap {
  flex: none;
  height: calc(var(--fs-mono) * var(--admin-index-line-height));
}
.admin-title-group {
  margin-bottom: calc(1.42 * var(--fs-mono));
}
.admin-title-group + .admin-title-group {
  margin-top: calc(1.42 * var(--fs-mono));
}
.admin-title-group:first-child > .admin-children {
  margin-top: 4px;
}
.admin-section-title,
.admin-child {
  font: inherit;
  letter-spacing: inherit;
  border: 0;
  background: none;
  color: var(--dim);
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.admin-section-title {
  display: flex;
  gap: calc(2 * (1ch + 0.04em));
  align-items: baseline;
  white-space: nowrap;
}
.admin-section-title:hover,
.admin-title-group.on .admin-section-title,
.admin-child:hover,
.admin-child.on {
  color: var(--ink);
}
.admin-title-dot {
  display: inline-block;
  width: calc(1ch + 0.04em);
  color: var(--ink);
}
.admin-children {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.24s cubic-bezier(0.2, 0, 0, 1), opacity 0.18s ease-out;
}
.admin-children.open {
  grid-template-rows: 1fr;
  opacity: 1;
}
.admin-children-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: calc(0.4 * var(--fs-mono));
}
@media (prefers-reduced-motion: reduce) {
  .admin-children { transition: none; }
}
.admin-head-row {
  gap: calc(2 * (1ch + 0.04em));
  display: flex;
  align-items: baseline;
  width: 100%;
}
/* The metadata and font rows share one story-body width and flex columns.
   Keep a full empty line between metadata and row 01. */
.shelf-page > .story {
  padding-top: calc(
    (0.817 + (var(--lh) - 1) / 2) * var(--fs) - 1.05 * var(--fs-mono)
  );
}
.admin-shelf-meta {
  display: flex;
  align-items: baseline;
  gap: 1em;
  width: 100%;
  max-width: var(--measure, 29em);
  font: var(--admin-text-size)/var(--admin-code-line-height)
    var(--admin-text-font);
  font-variation-settings: var(--admin-text-fvs);
  letter-spacing: 0;
  margin-bottom: calc(1.5 * var(--fs-mono));
  min-height: calc(var(--fs-mono) * var(--admin-index-line-height));
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.admin-meta-number {
  min-width: 2.5ch;
}
.admin-meta-name {
  flex: 1;
  text-align: right;
}
.admin-meta-ghost {
  visibility: hidden;
  pointer-events: none;
}
.admin-child {
  display: block;
  white-space: nowrap;
  position: relative;
  margin-left: calc(3 * (1ch + 0.04em));
}
.admin-kind {
  display: flex;
  justify-content: space-between;
  width: calc(100% - 3 * (1ch + 0.04em));
}
.admin-kind-count {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.admin-page > .story {
  display: block;
  margin-left: 340px;
  margin-top: 0;
}
.admin-page .story-fold {
  display: block;
  opacity: 1;
}
.admin-page .story-body {
  overflow: visible;
}
.admin-page .editor-body {
  margin-top: 0;
}
.admin-face-number {
  color: var(--dim);
  min-width: 2.5ch;
}
.admin-kindpick {
  position: relative;
  flex: none;
}
.admin-kindpick-btn,
.admin-kindpick-one {
  font: inherit;
  letter-spacing: inherit;
  color: var(--dim);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.admin-kindpick-btn:hover,
.admin-kindpick-one:hover {
  color: var(--ink);
}
.admin-kindpick-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}
.admin-kindpick-one.on {
  color: var(--ink);
}
.admin-ring-gap {
  height: 34px;
  display: block;
}
.controls .admin-return {
  position: fixed;
  right: 14px;
  bottom: 14px;
  font: var(--fs-mono)/1 var(--font-mono);
}
@media (max-width: 700px) {
  .controls .admin-return {
    right: 8px;
    bottom: 8px;
  }
}
.tok-num {
  color: var(--palette-extra-ed788e, #ed788e);
}
.code-num {
  color: var(--palette-extra-626262, #626262);
}
.code-num.active {
  color: var(--palette-extra-b7b7b7, #b7b7b7);
}
.code-input::selection {
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.code-line .code-picked {
  background: var(--palette-accent, #dc143c);
  color: var(--palette-extra-000, #000);
}
.code-line .tok-str.code-picked {
  color: var(--palette-extra-23ebc3, #23ebc3);
} /* inverse of crimson */
.code-line .tok-num.code-picked {
  color: var(--palette-extra-23ebc3, #23ebc3);
} /* bright cyan contrasts the crimson field */
@media (max-aspect-ratio: 1/1) {
  .admin-titles {
    position: relative;
    left: 0;
    top: 0;
    width: calc(100% - 42px);
    padding-bottom: 18px;
    /* stacked layout: the index is in the page flow and the page scrolls, not the column */
    max-height: none;
    overflow: visible;
  }
  .admin-page > .story {
    margin-left: 0;
    margin-right: 42px;
  } /* keep both the index and rows clear of the mobile control rail */
}

/* The source starts at the horizon, then flows through the page scroller to the top
   edge and all the way down, exactly like the main text; no nested scroll box. */
/* The travelling admin mark stays below the editor, never over source text.
   Other pages keep their existing logo layering and movement. */
#root .editor-page .logo {
  z-index: -1;
}
.editor-page .code-surface {
  background: var(--bg);
  height: auto;
  min-height: calc(100vh - var(--pin));
}
.editor-page .code-input {
  position: relative;
  display: block;
  height: auto;
  min-height: calc(100vh - var(--pin));
  overflow: hidden;
  resize: none;
}
.editor-page .code-view,
.editor-page .code-gutter {
  overflow: hidden;
}

/* The code's own finder: a horizon stroke on the right of its text area. The
   hit area is larger than the hairline; the code itself never moves. */
.admin-finder {
  position: fixed;
  top: calc(var(--hline) - 17px);
  width: 34px;
  height: 34px;
  z-index: 12;
  font: var(--admin-code-size)/var(--admin-code-line-height)
    var(--admin-code-font);
}
.admin-find-line {
  position: absolute;
  right: 0;
  top: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: none;
  cursor: text;
}
.admin-finder.open .admin-find-line {
  pointer-events: none;
}
.admin-find-line::after {
  content: "";
  position: absolute;
  right: 0;
  top: 17px;
  width: 34px;
  height: 1px;
  background: var(--hairline);
  transition:
    width 0.26s ease,
    background 0.26s ease,
    box-shadow 0.26s ease;
}
.admin-finder:hover .admin-find-line::after,
.admin-finder:focus-within .admin-find-line::after {
  width: 43px;
  background: var(--ink);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ink) 40%, transparent);
}
.admin-find-input {
  position: absolute;
  right: 0;
  bottom: 17px;
  width: 0;
  height: 18px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--palette-caret, #dc143c);
  font: inherit;
  text-align: right;
  pointer-events: none;
}
.admin-finder.open .admin-find-input {
  width: min(var(--find-width, 34px), 260px);
  pointer-events: auto;
}
.admin-finder.open .admin-find-line::after {
  width: min(var(--find-width, 34px), 260px);
}
.admin-find-count {
  position: absolute;
  right: calc(min(var(--find-width, 34px), 260px) + 12px);
  top: 0;
  line-height: 34px;
  color: var(--dim);
  white-space: nowrap;
}
.code-fold {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 14px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
}
.code-fold:hover,
.code-fold:focus-visible {
  color: var(--ink);
}
.code-fold.closed {
  color: var(--ink);
}
.code-match {
  text-decoration: underline;
  text-decoration-color: var(--palette-accent, #dc143c);
  text-underline-offset: 3px;
}

.code-gutter {
  pointer-events: auto;
}
.code-gutter .code-shift {
  pointer-events: none;
}
.code-gutter .code-fold {
  pointer-events: auto;
}

.code-gutter {
  z-index: 2;
}
.code-fold {
  z-index: 3;
}

/* Tango uses the admin's existing titles, hairlines and mono controls. */
.logo-phrase-add { display: flex; align-items: baseline; gap: 1em; }
.logo-phrase-text { width: 100%; min-width: 0; font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--hairline); padding: .45em 0; caret-color: var(--palette-caret, #dc143c); }
.logo-range { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) minmax(0, 1fr); gap: .6em; align-items: baseline; padding: .3em 0; }
.logo-range input { width: 100%; min-width: 0; font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--hairline); }
.logo-preview { min-height: 2.8em; display: flex; align-items: center; overflow-wrap: anywhere; }
.logo-preview .logo-word { white-space: pre-wrap; }
.logo-ending { display: inline-flex; align-items: center; gap: .3em; margin: .5em .8em .5em 0; color: var(--dim); }
.logo-library-page { max-width: none; width: 100%; }
.logo-library-page > .story { max-width: none; }
.logo-library-page .logo-preview .logo-word { font: inherit; font-size: var(--admin-text-size); }
.logo-ending input { accent-color: var(--palette-accent, #dc143c); }
.logo-library-page .editor-body > .admin-child { display: block; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }

.logo-library-page .editor-body { font-family: var(--admin-text-font); font-size: var(--admin-text-size); }
/* Same ring, axis and ten-pixel air as admin; no separate rail. */
.controls .instinct-bridge {
  position: fixed;
  right: 14px;
  bottom: 58px;
  font: var(--fs-mono)/1 var(--font-mono);
}
@media (max-width: 700px) {
  .controls .instinct-bridge { right: 8px; bottom: 52px; }
}

/* The dot of the i: one mark, centred in the existing button box.
   Instinct has no middots wordmark, two-dot eyes or roaming identity. */
.instinct-dot {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.controls .instinct-logo { color: var(--dim); }
.controls .instinct-logo:hover,
.controls .instinct-logo:focus-visible { color: var(--ink); }

/* Keep the 34px ring and its place; give its marks a little more room inside it. */
.ring-btn > svg {
  width: 18px;
  height: 18px;
}
.ring-btn > span[aria-hidden="true"] {
  font-size: 16px;
}
.audio-migration-page { width: 100%; max-width: none; }
.audio-migration-page > .story { max-width: 38em; }
.audio-migration-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .65em; margin: 1.5em 0; }
.audio-migration-actions button { text-align: left; }
.audio-migration-actions button:disabled { opacity: .4; cursor: default; }
.audio-plan input { max-width: 100%; font: inherit; color: var(--dim); }
.audio-migration-status, .audio-migration-file { overflow-wrap: anywhere; }
.audio-migration-file { font-size: inherit; color: var(--dim); }
.audio-migration-page .editor-body > p { font: inherit; line-height: 1.5; }
.audio-migration-page .editor-body,
.audio-migration-page .editor-body > p { font-family: var(--admin-text-font); font-size: var(--admin-text-size); line-height: 1.5; }

/* the mailing: same admin idiom, the preview is the mail itself at its true 800x500 */
.mailing-body { display: flex; flex-direction: column; gap: calc(0.8 * var(--fs-mono)); }
.mailing-kinds { display: flex; flex-wrap: wrap; gap: 0 calc(1.2 * var(--fs-mono)); }
.mailing-text { font: inherit; width: 100%; background: none; color: inherit; border: 0; outline: 0; resize: vertical; caret-color: var(--palette-caret, crimson); }
.mailing-field { display: flex; gap: 1ch; align-items: baseline; }
.mailing-field input { font: inherit; width: 5ch; background: none; color: inherit; border: 0; border-bottom: 1px solid var(--dim); outline: 0; }
/* The preview comes first and keeps the mail's native proportions. Corner brackets
   share the horizon/verizon's 34px reach, 1px hairline and theme hairline color. */
.mailing-preview {
  position: relative;
  flex: none;
  width: min(800px, calc(100% - 34px));
  aspect-ratio: 8 / 5;
  margin: 17px;
  background: var(--palette-extra-000, #000);
}
.mailing-frame {
  display: block;
  position: absolute;
  inset: 0 auto auto 0;
  width: 800px;
  height: 500px;
  border: 0;
  background: var(--palette-extra-000, #000);
  transform: scale(var(--mailing-preview-scale, 1));
  transform-origin: top left;
}
.mailing-crosshair {
  position: absolute;
  width: 34px;
  height: 34px;
  color: var(--hairline);
  pointer-events: none;
  z-index: 1;
}
.mailing-crosshair::before,
.mailing-crosshair::after {
  content: "";
  position: absolute;
  background: currentColor;
}
/* Equal-arm L brackets meet the canvas corners; no stroke extends outside. */
.mailing-crosshair::before { left: 0; width: 34px; height: 1px; }
.mailing-crosshair::after { top: 0; width: 1px; height: 34px; }
.mailing-crosshair.top-left { top: 0; left: 0; }
.mailing-crosshair.top-right { top: 0; right: 0; }
.mailing-crosshair.bottom-left { bottom: 0; left: 0; }
.mailing-crosshair.bottom-right { bottom: 0; right: 0; }
.mailing-crosshair.top-left::before,
.mailing-crosshair.top-right::before { top: 0; }
.mailing-crosshair.bottom-left::before,
.mailing-crosshair.bottom-right::before { bottom: 0; }
.mailing-crosshair.top-left::after,
.mailing-crosshair.bottom-left::after { left: 0; }
.mailing-crosshair.top-right::after,
.mailing-crosshair.bottom-right::after { right: 0; }
.mailing-kinds .admin-child.dim { opacity: 0.35; }

/* The right working area has one metric, including nested form controls.
   The email preview is a separate document and receives none of these tokens. */
.admin-page .editor-body,
.admin-page .editor-body * {
  font-family: var(--admin-text-font, "Fragment Mono", monospace);
  font-size: var(--admin-text-size, 10pt);
  font-variation-settings: var(--admin-text-fvs, normal);
}
.admin-page .story:not(:has(.editor-body)) {
  font-family: var(--admin-text-font, "Fragment Mono", monospace);
  font-size: var(--admin-text-size, 10pt);
  font-variation-settings: var(--admin-text-fvs, normal);
}

/* Compact the preview choices without moving the admin horizon. */
@media (min-aspect-ratio: 1/1) {
  .mailing-body > .mailing-kinds { line-height: 1.2; }
  .mailing-body > .mailing-kinds + .mailing-kinds { margin-top: calc(-0.4 * var(--fs-mono)); }
}

/* The original dot is the fold control; title text remains page navigation. */
.admin-section-fold {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}


/* Logo lives in the same native canvas as mailing; its controls remain below. */
.logo-panel { background: var(--bg); }
.logo-panel-canvas { background: var(--bg); overflow: hidden; color: var(--ink); }
.logo-panel-canvas .logo-preview { position: absolute; inset: 0; min-height: 0; padding: 34px; justify-content: center; text-align: center; }
.logo-panel-canvas .logo { position: absolute !important; inset: 0 !important; width: auto !important; height: auto !important; display: flex !important; align-items: center !important; justify-content: center !important; transform: none !important; }
.logo-panel-canvas .logo-word { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 732px; }

.logo-panel-canvas .logo-caret { height: calc(1.05 * var(--admin-text-size)); }

.logo-library-page .editor-body > .logo-panel { width: min(800px, calc(100% - 34px)); max-width: none; }

.logo-library-page .editor-body { max-width: none; }

.logo-panel-canvas .logo-word { font-size: var(--admin-text-size); }

/* the admin plus on a page with nothing to add: the horizontal stroke alone, in the plus's own seat */
.hair-plus.hair-dash {
  cursor: default;
  pointer-events: none;
}
.hair-plus.hair-dash::after {
  display: none;
}
/* the plus becomes a bare name field for a new file, on the horizon, like the reader's new folder */
.admin-plus-name {
  position: fixed;
  left: 6px;
  top: calc(var(--hline) - 0.8em);
  z-index: 12;
}
.admin-plus-name .cover-name {
  text-align: left;
}
.admin-plus-note {
  position: fixed;
  left: 6px;
  top: calc(var(--hline) + 22px);
  z-index: 12;
}

/* Logo typography stays at the selected text-slot size. Unlike the mail iframe,
   the live logo fills the fitted frame directly rather than scaling its glyphs. */
.logo-panel-canvas { width: 100%; height: 100%; transform: none; }

/* the plus's word: typed upward from the top of the plus, reading bottom to top; it takes no room */
.hair-plus-seat {
  display: contents;
}
.hair-plus-word {
  position: fixed;
  left: 34px; /* the script then seats the letters' baseline exactly on the plus's right end */
  bottom: calc(100vh - var(--hline) + 17px + 14px); /* 6px above the plus, raised a further 8px toward the top of the page */
  transform-origin: 0 100%;
  transform: rotate(-90deg); /* reads bottom to top, growing upward from the pivot */
  white-space: pre;
  pointer-events: none;
  z-index: 11;
  color: var(--dim);
  font-family: var(--admin-text-font, var(--font-mono));
  font-size: var(--admin-text-size, 10pt);
  font-variation-settings: var(--admin-text-fvs, var(--fvs-mono));
  line-height: 1;
}
.hair-plus-base {
  display: inline-block;
  width: 0;
  height: 0;
}
/* the typing head: a thin bar standing on the baseline after the last letter, blinking slowly like the page's other carets */
.hair-plus-caret {
  display: none;
  width: 1px;
  height: 0.8em;
  margin-left: 3px;
  background: var(--palette-accent, #dc143c);
}
.hair-plus-caret.on {
  display: inline-block;
  animation: caret-blink 1.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  /* reduced motion: no animation, no caret (relayed 2 Oct) */
  .hair-plus-caret, .hair-plus-caret.on { display: none; }
}

/* the admin lane owns its horizon: --pin is derived from --hz at :root, so it is re-derived here from the admin --hz */
.admin-surface { --pin: calc(190px + var(--hz) + var(--vt)); }
@media (max-width: 700px) { .admin-surface { --pin: calc(120px + var(--hz) + var(--vt)); } }

/* phone admin index: the first index line's baseline sits on the horizon, as on desktop (it started 69px above it).
   1.05 x --fs-mono is the index line's baseline offset (the scroll team's constant; fitted to Fragment Mono). */
@media (max-width: 700px) {
  .admin-titles { margin-top: calc(var(--hline) - 1.05 * var(--fs-mono) - var(--pin)); }
}

/* phone: the admin index rows are 20px high on a 25px pitch; widen each row's hit area to the full pitch without moving anything */
@media (max-width: 700px), (pointer: coarse) {
  .admin-child, .admin-section-title, .admin-title-dot { position: relative; }
  .admin-child::before, .admin-section-title::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; bottom: -3px; }
  .admin-title-dot::before { content: ""; position: absolute; left: -6px; right: -8px; top: -2px; bottom: -3px; }
}

/* phone: a staged face row ("name · staged") is wider than the column; let the name shrink and wrap so the x stays on screen */
@media (max-width: 700px) {
  .admin-row .admin-face-name { min-width: 0; overflow-wrap: anywhere; }
}

/* the logo page's controls under the preview keep the text measure (the admin's verizon), not the page's full width */
.logo-library-page .editor-body > :not(.logo-panel) { max-width: var(--measure); box-sizing: border-box; }

/* stepper: minus, value, plus - three separate cells */
.stepper { display: inline-flex; align-items: stretch; gap: 3px; min-width: 0; }
.stepper input { flex: 1 1 auto; min-width: 0; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-cell { font: inherit; line-height: 1; color: var(--ink); background: none; border: 1px solid var(--hairline); padding: 0 .5em; min-width: 1.8em; cursor: pointer; opacity: .55; }
.step-cell:not(:disabled):hover { opacity: 1; }
.step-cell:disabled { opacity: .2; cursor: default; }
.logo-range .stepper { width: 100%; }
.mailing-field .stepper input { width: 5ch; flex: none; }

/* the play icon: three open strokes blinking on their own clocks */
.play-icon { background: none; border: 0; padding: 0; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.play-icon svg { display: block; overflow: visible; }
.play-icon path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: butt; animation-name: play-blink; animation-timing-function: steps(1, end); animation-iteration-count: infinite; }
@keyframes play-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: .12; } }
.play-icon:hover path { stroke-width: 2; }
@media (prefers-reduced-motion: reduce) { .play-icon path { animation: none; } }
/* centred under the preview, on the preview's own width */
.mailing-preview.has-footer { margin-bottom: 44px; }
.mailing-footer { position: absolute; left: 0; right: 0; top: calc(100% + 6px); display: flex; justify-content: center; }

/* ---- logo page: two phrase fields, glyph buttons, own list and own switch cells ---- */
.glyph-plus.play-icon, .glyph-edit.play-icon, .glyph-save.play-icon, .glyph-cross.play-icon { width: 30px; height: 30px; }
.play-icon svg { width: 100%; height: 100%; }
.play-icon:disabled { cursor: default; opacity: .35; }
.play-icon:disabled path { animation: none; }
.logo-phrase-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; align-items: center; gap: .9em; max-width: var(--measure); margin: 1.1em 0 .5em; }
.logo-pick { display: flex; align-items: center; gap: .9em; max-width: var(--measure); margin: .5em 0; }
.logo-pick .drop { flex: 1 1 auto; min-width: 0; }
.logo-edit { max-width: var(--measure); margin: .6em 0 1em; }
.logo-toggles { display: flex; flex-wrap: wrap; gap: .5em .6em; margin: .8em 0; }
.logo-range { max-width: var(--measure); }
.drop { position: relative; display: block; }
.drop-cell { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 1em; font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--hairline); padding: .45em 0; cursor: pointer; text-align: left; }
.drop-cell:disabled { color: var(--dim); cursor: default; }
.drop-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-mark { color: var(--dim); }
.drop-cell:not(:disabled):hover .drop-mark { color: var(--ink); }
.drop-list { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; max-height: 16em; overflow: auto; background: var(--bg, #000); border: 1px solid var(--hairline); }
.drop-one { display: flex; width: 100%; justify-content: space-between; gap: 1em; font: inherit; color: var(--dim); background: none; border: 0; border-bottom: 1px solid var(--hairline); padding: .45em .6em; cursor: pointer; text-align: left; }
.drop-one:last-child { border-bottom: 0; }
.drop-one:hover, .drop-one.on { color: var(--ink); }
.drop-one-tag { color: var(--dim); font-size: .8em; white-space: nowrap; }
.toggle-cell { font: inherit; color: var(--dim); background: none; border: 1px solid var(--hairline); padding: .25em .7em; cursor: pointer; }
.toggle-cell.on { color: var(--ink); border-color: currentColor; }
.toggle-cell:not(:disabled):hover { color: var(--ink); }
.logo-phrase-text:focus-visible, .drop-cell:focus-visible, .drop-one:focus-visible, .toggle-cell:focus-visible, .play-icon:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
@media (max-width: 560px) { .logo-phrase-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ---- mailing page: hit layer, three formats, small crosshair tools, balanced rows ---- */
.mailing-hit { position: absolute; inset: 0; z-index: 3; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mailing-hit.open { background: rgba(0, 0, 0, .72); }
.mailing-hit:focus-visible { outline: 1px solid var(--ink); outline-offset: -4px; }
.mailing-formats { display: flex; gap: 2.4em; align-items: center; justify-content: center; }
.mailing-format { display: flex; flex-direction: column; align-items: center; gap: .3em; animation: format-in .28s ease-out both; }
.mailing-format-name { color: var(--dim); font-size: .8em; }
.mailing-format:hover .mailing-format-name { color: var(--ink); }
@keyframes format-in { from { opacity: 0; transform: translateY(8px) scale(.85); } to { opacity: 1; transform: none; } }
.play-icon.big { width: 54px; height: 54px; }
.play-icon.small { width: 24px; height: 24px; }
.mailing-tools { display: inline-flex; align-items: center; gap: 1.2em; }
.mailing-page .mailing-body { gap: 0; }
.mailing-body > .mailing-kinds { margin: 0 0 .5em; }
.mailing-body > .mailing-preview { margin-top: .6em; }
.mailing-page .mailing-field { display: grid; grid-template-columns: 8.5em auto; align-items: center; gap: .6em; max-width: var(--measure); padding: .3em 0; }
.mailing-page .mailing-body > .admin-note { margin: .5em 0 0; max-width: var(--measure); }
.mailing-page .mailing-body > .admin-note:first-of-type { margin-top: .9em; }
.mailing-page .mailing-text { max-width: var(--measure); margin: .6em 0 .9em; border: 0; border-bottom: 1px solid var(--hairline); padding: .45em 0; resize: none; field-sizing: content; min-height: 6em; }
.mailing-page .mailing-body > .admin-child { align-self: flex-start; margin-top: .9em; }
@media (prefers-reduced-motion: reduce) { .mailing-format { animation: none; } }
.drop-list { overflow-x: hidden; }
.drop-one { min-width: 0; }
.drop-one-text { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-one-tag { flex: none; }
.drop-list { right: auto; width: max(100%, min(24em, calc(100vw - 68px))); box-sizing: border-box; }

/* Logo identity navigation reuses the house text controls, without new chrome. */
.logo-scope-row, .logo-home-choice { display:flex; align-items:baseline; flex-wrap:wrap; gap:.8em; margin:0 0 1em; font:inherit; color:var(--dim); }
.logo-scope-row { gap:0; white-space:pre-wrap; }
.logo-scope-row button { border:0; padding:0; background:none; font:inherit; color:var(--dim); cursor:pointer; }
.logo-scope-row button[aria-selected="true"], .logo-scope-row button:hover { color:var(--ink); }
.logo-scope-row button:focus-visible { outline:1px solid var(--ink); outline-offset:3px; }
.logo-home-choice .toggle-cell { width:auto; }
.logo-library-page .logo-phrase-add { grid-template-columns:minmax(0,1fr) auto auto; }
.logo-library-page .editor-body > .logo-scope-row { width:100%; max-width:none; display:grid; grid-template-columns:1fr auto 1fr auto 1fr; gap:.5em; align-items:baseline; }
.logo-scope-row button:first-child { text-align:left; justify-self:start; }
.logo-scope-row button:nth-child(3) { text-align:center; justify-self:center; }
.logo-scope-row button:last-child { text-align:right; justify-self:end; }
.logo-scope-row button { white-space:nowrap; }
@media(max-width:560px) { .logo-library-page .editor-body > .logo-scope-row { font-size:clamp(6px,2.15vw,10px); gap:.15em; } }
.logo-library-page .editor-body > .logo-scope-row { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); }
.logo-library-page .editor-body .logo-scope-row * { font-size:inherit; white-space:nowrap; }
