/* Draft pages, cover, account and profile search. */
:root {
  /* Inset the desktop reading and admin title axes together. The plus ends at
     x=34px; the number begins at x=59px, leaving the same 25px glyph gap as the
     three-space number/date gutter. The text column stays at x=388px. */
  --index-inset: 11px;
}

/* red caret and red-tinted selection, draft mode only */
.editable {
  caret-color: #dc143c;
  cursor: text;
}
.editable:focus {
  outline: none;
}
:root ::selection {
  background: #dc143c;
  color: #000000;
} /* full crimson, it bleeds */

/* editable title: ghost placeholder when empty */
span.story-title.editable:empty::before {
  content: attr(data-ph);
  color: var(--hairline);
}

/* editable body: an empty paragraph keeps its line only while the caret is inside it;
   every other empty line stays collapsed, so clicking into the text never opens
   gaps between the paragraphs */
.story-text.editable {
  min-height: calc(var(--lh) * 1em);
}
.story-text.editable > :is(p, div):empty[data-focus] {
  min-height: calc(var(--lh) * 1em);
}

/* draft heads don't fold; the stack under the title is the piece's version history */
.draft-story .story-head {
  cursor: default;
}
.draft-story .story-head:hover .story-title {
  color: var(--dim);
}
.draft-story .story-title:hover,
.draft-story .story-title:focus {
  color: var(--ink);
}
.version-stack {
  display: block;
  margin-top: 4px;
}
.story-when.version {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  margin: 0; /* the stack already sits 4px under the title, exactly where the reading date sits */
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  line-height: inherit; /* buttons don't inherit it on their own; the head's 1.42 is what reading uses */
  letter-spacing: 0.04em;
  color: var(--dim);
}
.story-when.version:hover {
  color: var(--ink);
}
.story-when.version.current {
  color: var(--dim);
} /* same grey as the reading date */
.draft-story.open .story-when.version:not(.current) {
  color: var(--hairline);
}
.draft-story.open .story-when.version:not(.current):hover {
  color: var(--ink);
}
.version-add {
  display: flex;
  justify-content: center;
  width: 1ch;
  margin-left: calc(1ch + 0.04em);
  line-height: inherit;
  margin-top: 4px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.04em;
  color: var(--hairline);
}
.version-add:hover,
.version-add:focus-visible {
  color: var(--ink);
  outline: none;
}
.draft-remove {
  position: absolute;
  top: calc((0.817 + (var(--lh) - 1) / 2) * var(--fs) - 1.2 * var(--fs-mono));
  right: 0;
  background: none;
  border: 0;
  padding: 2px 0 2px 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  color: var(--hairline);
}
.draft-remove:hover,
.draft-remove:focus-visible {
  color: var(--ink);
  outline: none;
}

/* export/import overlay */
.io-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}
.io-panel {
  width: min(620px, 86vw);
  background: var(--bg);
  border: 1px solid var(--hairline);
  padding: 18px;
  box-sizing: border-box;
}
.io-title {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.04em;
  color: var(--ink);
}
.io-note {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 8.5pt;
  letter-spacing: 0.04em;
  color: var(--dim);
}
.io-panel textarea {
  width: 100%;
  height: 280px;
  box-sizing: border-box;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline);
  padding: 10px;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 8.5pt;
  line-height: 1.5;
  resize: vertical;
  caret-color: #dc143c;
}
.io-panel textarea:focus {
  outline: none;
  border-color: var(--dim);
}
.io-error {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 8.5pt;
  color: #e5484d;
}
.io-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}
.io-row button {
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 15px;
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 8.5pt;
  letter-spacing: 0.04em;
  color: var(--dim);
}
.io-row button:hover,
.io-row button:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
  outline: none;
}

/* toggled modes glow like a pressed key */
.controls button.on {
  color: var(--ink);
  border-color: var(--ink);
}
/* draft text keeps every space and line exactly as typed */
.story-text.editable,
.story-text.editable p,
.story-text.editable > div {
  white-space: pre-wrap;
}
/* a typed Tab is a real tab character; four spaces wide reads as an indent, not a gap */
.story-text {
  tab-size: 4;
}
/* commitment mode: what was deleted stays, struck and leaning */
s.ov {
  font-style: italic;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
  color: var(--dim);
}
/* focus dim: while writing, every paragraph but the caret's own fades to a whisper, and so do
   titles and the other pieces; the page comes back the moment the caret leaves the text */
:root.focusdim .story-text.editable > *,
:root.focusdim .story-head,
:root.focusdim .story-audio {
  transition: opacity 0.35s ease;
}
:root.focusdim.focus-in .story-text.editable > *:not([data-focus]),
:root.focusdim.focus-in .story-head,
:root.focusdim.focus-in .story-audio {
  opacity: 0.18;
}

:root.platen .page {
  padding-bottom: 70vh;
}
/* folding a draft folds its version dates with the rest; the current date stays, like the reading index */
.vrow {
  position: relative; /* the shelf number hangs off the current row's date line */
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  /* the row's strut is the date font's, not the body's: a body-size strut was the empty line */
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  transition:
    grid-template-rows 0.55s ease,
    opacity 0.55s ease,
    margin-top 0.55s ease;
}
/* the version dates keep the head's own rhythm: the pitch between rows equals the pitch
   between the title line and the first date line */
.version-stack .vrow + .vrow {
  margin-top: 4px;
}
.vrow-inner {
  overflow: hidden;
  min-height: 0;
}
/* the shelf row's fixed gutter: six mono slots (three digits, three spaces) measured in the
   date font, so a proportional title font can never move the text column. The fold middot
   rides the second slot on the title line; the piece number leads the current date line. */
.gutter {
  position: relative;
  display: inline-block;
  width: calc(6 * (1ch + 0.04em));
  white-space: nowrap;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.04em;
  color: var(--dim);
}
/* the middot sits over the number's second digit: one slot in, one slot wide, centered */
.story-head .fold-dot {
  left: calc(1ch + 0.04em);
  top: 0;
  width: 1ch;
  height: 100%;
  padding: 0;
  justify-content: center;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
}
/* the draft title leads its head-main block, the same first line reading sets */
.draft-story .story-title {
  display: block;
}
/* the date line leads with its own number gutter: pull it back to the row's left edge, so the
   number sits under the fold middot's slot and the date keeps the shared text column. Direct
   child only: the draft's version rows hang inside the version stack, which pulls itself. */
.story-head-main > .story-when {
  margin-left: calc(-6 * (1ch + 0.04em));
}
/* the draft's version stack leads with the same number gutter: pull it back the same six slots.
   The mono metrics come along so the ch in the pull is the date font's, not the title's. */
.story-head-main .version-stack {
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.04em;
  margin-left: calc(-6 * (1ch + 0.04em));
}
/* a span head-main keeps the reading geometry but not the button's pointer */
.draft-story .story-head-main {
  cursor: default;
}
/* reading: the head's main button rides beside its gutter, tops level so the baselines meet */
.story-head .gutter,
.story-head-main {
  vertical-align: top;
}
.story-head-main {
  display: inline-block;
}
/* inside a version row the number shares the date's baseline, the same flow reading sets
   (the head-wide top alignment is for the title line's gutter, not the date rows) */
.vrow-inner .gutter {
  vertical-align: baseline;
}
/* a version date shares its line with its gutter */
.vrow-inner .story-when.version {
  display: inline-block;
}
.draft-story:not(.open) .vrow:not(.current) {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
}
.draft-story:not(.open) .vrow:not(.current) button {
  pointer-events: none;
}
.version-stack {
  margin-top: 4px;
}
.vrow.add .version-add {
  margin-top: 4px;
}

/* ---- main page (Cover): one column, centered across, on the horizon - the folders, then + for a new one ---- */
.cover {
  /* on the horizon: the first folder's baseline is the baseline of a folder's first line of text.
       The page starts at the pin line; a piece's first line sits there on a wide screen, so no offset.
       On a phone the piece's head (title + date, then 16px) comes first - see the media rule below. */
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
/* Pinned logo keeps the button's top edge and sits beside the top of the rail. */
.logo:not(.logo-roaming) {
  position: fixed;
  right: calc(14px + 34px + 8px);
  top: 0;
  height: 34px;
  display: flex;
  align-items: center;
  z-index: 11;
  pointer-events: none;
}
@media (max-width: 700px) {
  .logo:not(.logo-roaming) {
    right: calc(8px + 34px + 8px);
  }
}
/* The roaming mark stays beneath the UI, but above the body background. */
.logo.logo-roaming {
  position: fixed;
  left: 4px;
  top: 4px;
  z-index: -1;
  pointer-events: none;
}
.logo {
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.04em;
  line-height: var(--lh);
  white-space: pre;
}
/* The pulled mark stands where a rail label would stand, without covering the button. */
.logo.logo-pulled {
  z-index: 11;
  transform: none;
}
.logo-mode-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}
.logo-mode-eye {
  display: inline-block;
  transition:
    opacity var(--blink-ease, 200ms) ease-in-out,
    transform var(--blink-ease, 200ms) ease-in-out;
}
.controls .logo-mode-button {
  position: fixed;
  right: 14px;
  top: 0;
  border: 0;
  user-select: none;
  -webkit-user-select: none;
}
@media (max-width: 700px) {
  .controls .logo-mode-button {
    right: 8px;
  }
}
.logo-mode-eye.blink-shut {
  opacity: 0.12;
  transform: scaleY(0.18);
}
@media (prefers-reduced-motion: reduce) {
  .logo-mode-eye {
    transition: none;
  }
}
.logo-shy .logo-word {
  text-shadow:
    0 0 0.7em var(--ink),
    0 0 1.6em var(--ink);
  color: var(--ink);
}
.logo-shy .logo-caret {
  box-shadow:
    0 0 0.7em var(--ink),
    0 0 1.6em var(--ink);
  background: var(--ink);
}
.logo-word {
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--dim);
}
.logo-caret {
  display: inline-block;
  width: 1px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.18em;
  background: var(--dim);
}
.logo-sel {
  background: var(--hairline);
  color: var(--ink);
}
.logo-caret.rest {
  animation: pin-caret 1.06s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .logo-caret {
    display: none;
  }
}
/* the logo mounts as an empty slot in the flow: the mark itself is pinned to the top rail
   (see .logo), so the slot takes no space and the title area keeps the horizon */
.cover-folders {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.cover-folder {
  background: none;
  border: 0;
  padding: 0;
  line-height: var(--lh); /* same line box as the text, so the baselines meet */
  color: var(--dim);
  font: inherit;
  font-size: var(--fs);
  cursor: pointer;
  transition: color 0.35s ease;
}
.cover-folder:hover,
.cover-folder:focus-visible {
  color: var(--ink);
  outline: none;
}
/* the count hangs off the title's right edge (out of the flow), so the title alone is centered;
   raised like a superscript, set in oldstyle figures */
.cover-folder-count {
  position: absolute;
  left: 100%;
  top: calc(
    (var(--lh) - 1) / 2 * var(--fs) + 0.06 * var(--fs)
  ); /* half-leading, then just under the cap line */
  margin-left: 0.3em;
  font-size: 0.55em;
  line-height: 1;
  opacity: 0.6;
  color: var(--dim);
  white-space: nowrap;
  font-variant-numeric: oldstyle-nums;
  font-feature-settings: "onum" 1;
}
/* the add plus, drawn his way (27 Sep 18:59): a custom plus from the same strokes as
   the horizon line and its vertical companion - 34px by 1px each way, the hairline's own -
   pinned on the horizon at the left-most side of the screen, the horizontal stroke exactly
   on the line, running right; it never scrolls, and it rides the horizon's drag. One seat
   on the cover for a new folder, one inside a folder for a new piece (27 Sep 19:29) */
.hair-plus {
  position: fixed;
  left: 0;
  top: calc(var(--hline) - 17px);
  width: 34px;
  height: 34px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 11;
}
.hair-plus::before,
.hair-plus::after {
  content: "";
  position: absolute;
  background: var(--hairline);
  transition: background 0.2s ease;
}
.hair-plus::before {
  left: 0;
  top: 17px; /* the stroke lies on the horizon line itself */
  width: 34px;
  height: 1px;
}
.hair-plus::after {
  left: 17px;
  top: 0;
  width: 1px;
  height: 34px;
}
.hair-plus.shine-h::before {
  background: var(--ink);
}
.hair-plus.shine-v::after {
  background: var(--ink);
}
.hair-plus:focus-visible {
  outline: none;
}
.cover-new {
  margin-top: 22px;
  min-height: 1.4em;
}
/* a folder row: the title alone sets the centering; the count (or "delete") hangs off its right edge */
.cover-row {
  position: relative;
  display: inline-block;
  line-height: var(--lh);
  font-size: var(--fs);
}
.cover-delete {
  background: none;
  border: 0;
  padding: 0;
  color: #dc143c;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  opacity: 0.85;
  animation: fx-rise 0.25s ease-out;
}
.cover-delete:hover,
.cover-delete:focus-visible {
  opacity: 1;
  outline: none;
}
/* a hit area wider than the word, reaching back over the gap to the title, so the way there never leaves it */
.cover-delete::after {
  content: "";
  position: absolute;
  inset: -0.6em -0.6em -0.6em -1.2em;
}
.cover-delete {
  position: absolute;
}
/* naming a folder: no line, no placeholder - the text and a blinking crimson caret, nothing else */
.cover-name {
  min-width: 1ch;
  max-width: 70vw;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs);
  text-align: center;
  padding: 2px 0;
  outline: none;
  caret-color: #dc143c;
}
.cover-folder {
  -webkit-touch-callout: none;
  user-select: none;
}
@media (max-width: 700px) {
  /* phone: a piece's text starts under its head (two mono lines + 8px of padding, then 16px), so the folders do too */
  .cover {
    margin-top: calc(2 * 1.42 * var(--fs-mono) + 8px + 16px);
  }
}

/* ---- sync: code field and join button, in the same panel style as the face list ---- */
.sync-panel form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.sync-panel form .pin + .box-submit {
  margin-top: -5px;
} /* one grid: the word's row sits one grid gap under the code */
.sync-actions {
  display: flex;
  flex-direction: column; /* one word per row, each row on the code's own four-box grid */
  gap: 5px;
  align-items: flex-end;
}
.sync-panel form .sync-actions {
  margin-top: -5px;
} /* one grid: the words sit one grid gap under the code */

/* the code field: small boxes, one per character; a typed character flashes, then settles into a middot */
.pin {
  position: relative;
}
.pin-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 16px;
  color: transparent;
  background: transparent;
  caret-color: transparent;
  cursor: text;
  z-index: 1;
}
/* the code and the action share one grid, four boxes wide: the code fills rows from the top, the word sits in the row(s) under it */
.pin-boxes,
.box-word {
  display: grid;
  grid-template-columns: repeat(4, 20px);
  gap: 5px;
  justify-content: end;
}
.pin-box {
  position: relative;
  width: 20px;
  height: 26px;
  box-sizing: border-box;
  border: 1px solid var(--hairline);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: 13px;
  line-height: 1;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.pin-box.filled {
  border-color: var(--dim);
}
.pin-box.active {
  border-color: var(--ink);
}
.pin-box.active::after {
  content: "";
  width: 1px;
  height: 13px;
  background: #dc143c;
  animation: pin-caret 1.06s steps(1) infinite;
}
.pin-char {
  animation: pin-in 0.12s ease-out;
}
.pin-dot {
  font-size: 22px;
  font-weight: 700;
  transform: translateY(-1px);
  animation: pin-seal 0.22s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes pin-caret {
  50% {
    opacity: 0;
  }
}
@keyframes pin-in {
  from {
    transform: translateY(3px);
    opacity: 0;
  }
}
@keyframes pin-seal {
  from {
    transform: translateY(-1px) scale(0.2);
    opacity: 0.2;
  }
}
.pin-shake .pin-boxes {
  animation: pin-shake 0.36s ease;
}
@keyframes pin-shake {
  20%,
  60% {
    transform: translateX(-4px);
  }
  40%,
  80% {
    transform: translateX(4px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pin-char,
  .pin-dot,
  .pin-shake .pin-boxes {
    animation: none;
  }
}
.sync-note {
  margin: 0;
  max-width: 170px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--dim);
  text-align: right;
}
/* under the code, a note keeps to the code's own width (the four boxes: 4 x 20px + 3 x 5px), so a message
   never widens the panel or pushes its grid apart; a longer one wraps inside that column */
.sync-form .sync-note {
  width: calc(4 * 20px + 3 * 5px);
  max-width: none;
  overflow-wrap: anywhere;
}

/* ---- past selves: a piece's snapshots, folded under its text in draft mode ---- */
.past {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  line-height: 1.42;
  color: var(--dim);
}
.past button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition:
    color 0.25s ease,
    opacity 0.25s ease;
}
.past-toggle {
  opacity: 0.6;
}
.past-toggle:hover,
.past-toggle:focus-visible,
.past.open .past-toggle {
  opacity: 1;
  color: var(--ink);
  outline: none;
}
.past-count {
  margin-left: 0.5em;
  font-size: 0.85em;
  opacity: 0.6;
}
.past-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--hairline);
  animation: fx-rise 0.22s ease;
}
.past-date:hover,
.past-date:focus-visible {
  color: var(--ink);
  outline: none;
}
.past-date.on {
  color: #dc143c;
}
.past-actions {
  display: flex;
  gap: 18px;
  margin-top: 12px;
}
.past-act:hover,
.past-act:focus-visible {
  color: var(--ink);
  outline: none;
}
.past-act.strong {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
/* peeking: the past self stands where the text was, a shade quieter, the live editor hidden but kept */
.snap-hidden {
  display: none;
}
.snap-peek {
  opacity: 0.72;
  animation: fx-rise 0.22s ease;
}
.snap-peek-title {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  color: #dc143c;
}
.snap-peek .story-text p {
  white-space: pre-wrap;
}

/* Search: the resting line follows the chrome; results occupy the third column only on use. */
.search-rail {
  position: fixed;
  left: calc(
    388px + min(var(--shelf-measure, 734px), max(0px, 100vw - 444px)) + 18px
  );
  right: 58px;
  top: calc(var(--hline) - 17px);
  height: 34px;
  max-height: calc(100vh - var(--hline) + 5px);
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  z-index: 12;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  font-family: var(--font-mono);
  font-variation-settings: var(--fvs-mono);
  font-size: var(--fs-mono);
  line-height: 1.42;
  letter-spacing: 0.04em;
  transition:
    opacity 0.45s ease,
    visibility 0s linear 0.45s;
}
:root.ui-awake .search-rail {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.45s ease;
}
.search-rail.showing {
  height: calc(100vh - var(--hline) + 5px);
  overflow-y: auto;
  background: var(--bg);
}
.admin-finder {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
:root.ui-awake .admin-finder {
  opacity: 1;
  pointer-events: auto;
}
.search-rail::-webkit-scrollbar {
  display: none;
}
.search-field-row {
  height: 34px;
  position: relative;
  font-size: var(--fs-mono);
}
.search-field-row::after {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: min(var(--find-width), 100%);
  height: 1px;
  background: var(--hairline);
  pointer-events: none;
  transition:
    width 0.26s ease,
    background 0.26s ease,
    box-shadow 0.26s ease;
}
.search-field-row:hover:not(:focus-within)::after {
  width: min(calc(var(--find-width) + 9px), 100%);
  background: var(--ink);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ink) 40%, transparent);
}
.search-field {
  display: block;
  width: min(calc(var(--find-width) + 12px), 100%);
  height: 17px;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  caret-color: #dc143c;
  font: inherit;
  text-align: left;
  transition: width 0.26s ease;
}
.search-results {
  padding-top: 10px;
  font-size: var(--fs-mono);
}
.search-group {
  display: flex;
  flex-direction: column;
  margin: 0 0 1.42em;
}
.search-group-title {
  color: var(--dim);
  margin: 0 0 0.35em;
}
.controls .search-hit {
  display: block;
  width: 100%;
  height: auto;
  padding: 0 0 0 2em;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: left;
  color: var(--dim);
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-hit-dot {
  display: inline-block;
  width: 2em;
  margin-left: -2em;
  color: var(--hairline);
}
.search-hit-title {
  color: var(--dim);
}
.search-hit-text {
  color: var(--dim);
}
.search-hit mark {
  background: none;
  color: var(--ink);
  text-decoration: none;
}
.controls .search-hit.on .search-hit-title,
.controls .search-hit:hover .search-hit-title,
.controls .search-hit.on .search-hit-text,
.controls .search-hit:hover .search-hit-text {
  color: var(--ink);
}
.search-results .sync-note {
  margin: 0;
  color: var(--dim);
}
::highlight(search-hit) {
  background-color: rgba(220, 20, 60, 0.28);
  color: inherit;
}
.search-flash {
  background: rgba(220, 20, 60, 0.18);
  transition: background 0.6s ease;
}
@media (max-width: 900px) {
  .search-rail {
    left: max(18px, calc(100vw - 370px));
    right: 56px;
  }
  .search-rail.showing {
    box-shadow: -16px 12px 22px 16px var(--bg);
  }
}
@media (max-width: 700px) {
  .search-rail {
    left: 18px;
    right: 55px;
    top: calc(var(--hline) - 17px);
    box-shadow: none;
  }
  .search-rail.showing {
    max-height: none;
  }
}

/* submit as a word in boxes (join, next, change, make it mine) */
.controls .face-choice.box-submit {
  padding: 0;
  border: 0;
  background: none;
  color: var(--dim);
  cursor: pointer;
}
.box-word .box-gap {
  width: 20px;
  height: 26px;
}
.box-submit .pin-box {
  font-size: 12px;
  color: var(--dim);
  border-color: var(--hairline);
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}
.controls .face-choice.box-submit:not(:disabled):hover .pin-box,
.controls .face-choice.box-submit:not(:disabled):focus-visible .pin-box {
  color: var(--ink);
  border-color: var(--ink);
}
.controls .face-choice.box-submit:not(:disabled) .pin-box {
  color: var(--ink);
  border-color: var(--dim);
}
.controls .face-choice.box-submit:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Menu words are lit at rest; hovering or keyboard focus on one quiets the others. */
.controls .sync-panel .sync-menu-item .pin-box {
  color: var(--ink);
  border-color: var(--dim);
}
.controls
  .sync-panel:has(.sync-menu-item:hover)
  .sync-menu-item:not(:hover)
  .pin-box,
.controls
  .sync-panel:has(.sync-menu-item:focus-visible)
  .sync-menu-item:not(:focus-visible)
  .pin-box {
  color: var(--dim);
  border-color: var(--hairline);
  opacity: 0.35;
}
.controls .sync-panel .sync-menu-item .pin-box {
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    opacity 0.25s ease;
}
/* Destructive word: white letters, crimson outlines. The two colors trade on hover. */
.controls .face-choice.sync-wipe .pin-box {
  color: #fff;
  border-color: #dc143c;
  transition:
    color 0.25s ease,
    border-color 0.25s ease;
}
.controls .face-choice.sync-wipe:hover .pin-box,
.controls .face-choice.sync-wipe:focus-visible .pin-box {
  color: #dc143c;
  border-color: #fff;
}
/* SURE starts pale. Four signs wake a soft crimson light. */
.controls .face-choice.sync-wipe:disabled .pin-box {
  color: #8a8a8a;
  border-color: #63313c;
  box-shadow: none;
}
.controls
  .face-choice.sync-wipe:not(:disabled)[aria-label="sure, wipe this shelf"]
  .pin-box {
  color: #fff;
  border-color: #dc143c;
  box-shadow: 0 0 7px rgba(220, 20, 60, 0.6);
  transition:
    color 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease;
}
.controls
  .face-choice.sync-wipe:not(
    :disabled
  )[aria-label="sure, wipe this shelf"]:hover
  .pin-box,
.controls
  .face-choice.sync-wipe:not(
    :disabled
  )[aria-label="sure, wipe this shelf"]:focus-visible
  .pin-box {
  color: #dc143c;
  border-color: #fff;
}
/* a file dragged over the page: a quiet frame says it can land (App: font drop) */
html.font-dropping body {
  box-shadow: inset 0 0 0 1px currentColor;
}

/* a state word in the sync panel: the code's boxes, dimmed, no border colour of its own */
.sync-note.sync-word {
  width: auto;
}
.sync-word .pin-box {
  color: var(--dim);
  border-style: dashed;
}
/* one grid: a state word sits one box gap under the row above it, like the submit word under the code */
.sync-panel form > .sync-word {
  margin-top: -5px;
}

.sync-panel .box-submit .box-word + .box-word {
  margin-top: 5px;
}
.sync-panel form > .box-submit {
  margin-top: -5px;
}

/* After a wipe, one random logo birth precedes the first-visit cover. */
.cover.cover-welcome > :not(.logo) {
  opacity: 0;
  pointer-events: none;
}
.cover:not(.cover-welcome) > :not(.logo) {
  transition: opacity 0.45s ease;
}

/* Closing curtain after an acknowledged wipe, before the one-cycle welcome. */
.wipe-curtain {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  line-height: 1.5;
}
.wipe-curtain-line {
  display: flex;
  gap: 1ch;
}

/* In this menu the crimson wipe frame stays crimson until another choice takes focus. */
.controls .sync-panel .sync-menu-item.sync-wipe .pin-box {
  color: #fff;
  border-color: #dc143c;
}
.controls
  .sync-panel:has(.sync-menu-item:hover)
  .sync-menu-item.sync-wipe:not(:hover)
  .pin-box,
.controls
  .sync-panel:has(.sync-menu-item:focus-visible)
  .sync-menu-item.sync-wipe:not(:focus-visible)
  .pin-box {
  color: #8a8a8a;
  border-color: #63313c;
  opacity: 0.35;
}
/* Reserved visual for an occupied code. Not connected to join until the owner
   decides whether an occupied code enters immediately or waits for a tap. */
.sync-occupied-hint {
  width: calc(4 * 20px + 3 * 5px);
  max-width: none;
  text-align: center;
  color: var(--dim);
}
.sync-occupied-hint span {
  display: block;
}
