/* Tokens. Names and values are the design's; see the palette's note on ink. */
@layer base, components, states;

@font-face { font-family: "Literata"; src: url("/assets/literata-roman-bb7066c7.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/literata-italic-6177d02b.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
/* Georgia, adjusted so the swap does not move a line. */
@font-face { font-family: "Literata Fallback"; src: local("Georgia"); size-adjust: 103%; ascent-override: 114%; descent-override: 29%; line-gap-override: 0%; }

/* Resolved where it is given, so what is light inside a dark page still wears the page's colour. */
@property --hue { syntax: "<color>"; inherits: true; initial-value: transparent; }

:root {
  color-scheme: light dark;

  --page: light-dark(#ffffff, #12142a);
  --ink: light-dark(#1a1d3b, #e6e7f4);
  --quiet: light-dark(#5f6384, #a0a4c8);
  --wash: light-dark(#f0f1f8, #1c1f3d);
  --wash-deep: light-dark(#e0e2f0, #2b2f57);
  --rule: light-dark(#c9ccdf, #444970);
  --action: light-dark(#2a3ce0, #9aa6ff);
  --on-action: light-dark(#ffffff, #12142a);
  --madder: light-dark(#b4234f, #f38dab);
  --violet: light-dark(#6a35c9, #bb9ff7);
  --veil: light-dark(rgb(13 15 34 / .62), rgb(5 6 16 / .72));

  /* A document's colour is data-hue. --on is the only ink that goes on one, in both themes. */
  --on: #14162f;
  --pink: light-dark(#ff6fb0, #f767a6);
  --yellow: light-dark(#ffdd1f, #f2d01a);
  --green: light-dark(#1fcf7c, #1dc073);
  --lilac: light-dark(#a78bff, #9f82f8);
  --sky: light-dark(#3db4ff, #37a8f2);
  --house: var(--sky);

  /* Back to the page, from inside a coloured surface. */
  --paper: var(--page);
  --paper-ink: var(--ink);
  --paper-quiet: var(--quiet);
  --paper-action: var(--action);
  --paper-rule: var(--rule);
  --paper-wash: var(--wash);
  --paper-wash-deep: var(--wash-deep);

  --family: "Literata", "Literata Fallback", Georgia, serif;
  --body: 19px;
  --line: 31px;
  --ui: 15px;
  --ui-line: 22px;
  --small: 13.5px;
  --measure: 628px;
  --bleed: 28px;
  --strip: 56px;
  --foot: 52px;
  --touch: 32px;
  --part: 200ms;
  --ease: cubic-bezier(.3, .7, .2, 1);

  &[data-theme="light"] { color-scheme: light; }
  &[data-theme="dark"] { color-scheme: dark; }

  @media (prefers-contrast: more) {
    --quiet: light-dark(#3d4163, #cfd2ec);
    --rule: light-dark(#5f6384, #a0a4c8);
    --wash: light-dark(#e8eaf6, #1c1f3d);
  }
  @media (max-width: 760px) { --body: 18px; --line: 30px; --bleed: 20px; --touch: 44px; --strip: 52px; --foot: 48px; }
  @media (pointer: coarse) { --touch: 44px; }
  @media (prefers-reduced-motion: reduce) { --part: 0ms; }
}

[data-hue="pink"] { --hue: var(--pink); }
[data-hue="yellow"] { --hue: var(--yellow); }
[data-hue="green"] { --hue: var(--green); }
[data-hue="lilac"] { --hue: var(--lilac); }
[data-hue="sky"] { --hue: var(--sky); }
[data-hue="plain"] { --hue: var(--page); }

/* A surface in the document's colour. What is inside needs no colour rules of its own. */
[data-tinted] .wears {
  --page: #fff; --ink: var(--on); --quiet: var(--on); --rule: var(--on);
  --action: var(--on); --on-action: #fff; --madder: #a81a45; --violet: #6a35c9; --wash: var(--hue); --wash-deep: #fff;
  color: var(--on); caret-color: var(--on); background: var(--hue);

  & ::selection { background: #fff; color: var(--on); }
}

/* Agents: violet, with a double line under the name, broken while they are paused. */
@layer components {
  .agent-name[data-paused], [data-paused] .agent-name { border-block-end-style: dashed; border-block-end-width: 1.5px; }
  .agent-face:not(:has(.avatar-agent)) { display: inline-grid; border-block-end: 4px double var(--violet); padding-block-end: 2px; }
  .agent-face .avatar { inline-size: 36px; block-size: 36px; font-size: 16px; }
  .agents li { padding-block: 16px; column-gap: 18px; }
  .agent-title { display: flex; align-items: center; gap: 18px; & .agent-face .avatar { inline-size: 44px; block-size: 44px; font-size: 20px; } }
  .agent-state strong { font-weight: 600; }

  /* One line for each thing it did, when it did it under it */
  .deeds { font-size: 18px; line-height: 26px; & li { padding-block: 8px; border-block-end: 1px solid var(--rule); overflow-wrap: anywhere; } & li:last-child { border-block-end: 0; } & small { display: block; font-size: var(--small); line-height: 20px; color: var(--quiet); } & em { font-style: normal; font-weight: 600; } }

  .consent > p + form { margin-block-start: 22px; }
  .consent-part { border: 0; padding: 0; min-inline-size: 0; & + .consent-part { margin-block-start: 22px; } & legend { padding: 0; font-size: 22px; line-height: 30px; font-weight: 550; margin-block-end: 4px; } }
  .consent-choice { display: flex; align-items: center; gap: 4px 12px; min-block-size: var(--touch); font-size: 18px; line-height: 28px; cursor: pointer; & input:is([type="radio"], [type="checkbox"]) { inline-size: 20px; block-size: 20px; margin: 0; flex: none; accent-color: var(--action); } & > span { min-inline-size: 0; overflow-wrap: anywhere; } &:has(.field) { flex-wrap: wrap; } & .field { flex: 1 1 180px; inline-size: auto; font-size: 18px !important; line-height: 28px !important; } }
  .consent-no { margin-block-start: 10px !important; }
  @media (max-width: 760px) { .consent-choice { min-block-size: 44px; } }
}

@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  html { background: var(--page); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-block: calc(var(--strip) + 24px) calc(var(--foot) + 24px); }
  html:has(.document) { overflow-y: scroll; } /* a title that grows past the window must not move sideways */
  body { margin: 0; min-block-size: 100dvh; background: var(--page); color: var(--ink); font: 400 var(--ui)/var(--ui-line) var(--family); font-optical-sizing: auto; font-kerning: normal; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
  h1, h2, h3, p, ul, ol, fieldset { margin: 0; }
  ul, ol { padding: 0; list-style: none; }
  h1 { font-weight: 500; letter-spacing: -.018em; text-wrap: balance; overflow-wrap: anywhere; }
  button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
  button, input[type="submit"] { background: none; border: 0; padding: 0; text-align: start; cursor: pointer; }
  a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
  kbd { font: inherit; }
  strong { font-weight: 600; overflow-wrap: anywhere; }
  [hidden] { display: none !important; }
  :focus-visible { outline: 2px solid var(--action); outline-offset: 3px; border-radius: 1px; }
  ::selection { background: color-mix(in srgb, var(--action) 22%, transparent); }
  [tabindex="-1"]:focus { outline: 0; }
}

@layer components {
  .icon { inline-size: 22px; block-size: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

  /* A word you can press. The whole interface is made of these. */
  .word {
    min-block-size: var(--touch); display: inline-flex; align-items: center; padding-inline: 6px; margin-inline: -6px;
    color: var(--quiet); white-space: nowrap; text-decoration: none;

    &:hover, &[aria-current], &[aria-expanded="true"] { color: var(--ink); }
    &:active:not(:disabled) { background: color-mix(in srgb, currentColor 14%, transparent); border-radius: 2px; }
    &[aria-current] { font-weight: 650; }
    &:focus-visible { outline-offset: -3px; }
    &:disabled { opacity: .6; cursor: default; }

    @media (max-width: 760px) { padding-inline: 10px; margin-inline: -10px; }
    @media (forced-colors: active) { &[aria-current] { text-decoration: underline; } }
  }
  .act { color: var(--action); font-weight: 600; &:hover { color: var(--action); text-decoration: underline; text-underline-offset: .25em; } }
  [data-tinted] .wears .act { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .28em; }

  /* The one thing to do here. Solid, so it is seen first. */
  .do {
    min-block-size: 33px; padding: 4px 13px 5px; margin-inline: 0; border: 1px solid transparent; border-radius: 2px;
    background: var(--action); color: var(--on-action); font-size: var(--ui); line-height: var(--ui-line); font-weight: 600; transition: background-color 120ms;

    &:hover { background: color-mix(in srgb, var(--action) 84%, var(--ink)); color: var(--on-action); }
    &:active:not(:disabled) { background: color-mix(in srgb, var(--action) 70%, var(--ink)); opacity: 1; }
    &:focus-visible { outline-offset: 3px; }
    @media (max-width: 760px) { min-block-size: 44px; padding-inline: 16px; margin-inline: 0; }
    @media (prefers-reduced-motion: reduce) { transition: none; }
  }
  [data-tinted] .wears .do:hover { background: #333762; }
  .do.house { background: var(--house); color: var(--on); &:hover { background: color-mix(in srgb, var(--house) 84%, #fff); color: var(--on); } }

  .phrase { color: var(--action); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; overflow-wrap: anywhere; &:hover { text-decoration-thickness: 2px; } }
  .words { display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px; @media (max-width: 760px) { column-gap: 24px; } }

  .field { inline-size: 100%; min-inline-size: 0; background: transparent; border: 0; border-block-end: 1.5px solid var(--quiet); border-radius: 0; padding: 4px 0 6px; outline: 0; &:focus { border-block-end-color: var(--action); box-shadow: 0 1.5px var(--action); } &::placeholder { color: var(--quiet); opacity: 1; } @media (max-width: 760px) { min-block-size: 44px; } @media (forced-colors: active) { &:focus { outline: 2px solid Highlight; outline-offset: 2px; } } }
  .label { display: block; color: var(--quiet); }

  .avatar { inline-size: 28px; block-size: 28px; border-radius: 2px; background: var(--wash-deep); color: var(--ink); display: inline-grid; place-items: center; font-size: 12px; line-height: 1; font-weight: 650; object-fit: cover; flex: none; overflow: hidden; }
  .avatar.avatar-agent { background: var(--wash); color: var(--violet); font-style: italic; border-block-end: 4px double currentColor; border-radius: 0; }
  .agent-name { color: var(--violet); font-style: italic; border-block-end: 3px double var(--violet); }
  code { font: inherit; background: var(--page); color: var(--ink); padding: 2px 6px; border-radius: 2px; overflow-wrap: anywhere; font-feature-settings: "tnum", "lnum"; letter-spacing: .02em; }

  /* What happened, said once, above the foot. */
  .said {
    position: fixed; z-index: 40; inset-block-end: calc(var(--foot) + 8px); inset-inline: 0; margin-inline: auto; inline-size: fit-content; max-inline-size: calc(100% - 40px);
    padding: 9px 18px 11px; border: 1px solid transparent; border-radius: 2px; background: var(--paper-ink); color: var(--paper); overflow-wrap: anywhere;
    animation: rise var(--part) var(--ease); transition: opacity var(--part), translate var(--part) var(--ease);
    &[data-going] { opacity: 0; translate: 0 12px; }
    &[role="alert"] { background: light-dark(#a81a45, #f38dab); }
  }
  /* What was lost to someone else's deletion, for whoever wrote it to have. */
  .removed {
    position: fixed; z-index: 39; inset-block-end: calc(var(--foot) + 8px); inset-inline-end: 28px; inline-size: min(420px, 100vw - 40px); padding: 16px 20px 10px; background: var(--wash); color: var(--ink); border-block-start: 8px solid var(--hue, var(--house)); font-size: var(--ui); line-height: var(--ui-line); animation: rise var(--part) var(--ease);
    & blockquote { margin: 8px 0 6px; max-block-size: 30vh; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 18px; line-height: 28px; }
    & p { text-wrap: pretty; }
    body[data-hue="plain"] & { border-block-start-color: var(--house); }
    @media (max-width: 760px) { inset-inline: 0; inline-size: 100vw; inset-block-end: 0; padding: 16px 20px 18px; }
    @media (forced-colors: active) { border: 1px solid CanvasText; }
  }
  /* Each that can be taken back has its own place and time, the newest on top. */
  .notices {
    position: fixed; z-index: 40; inset-block-end: calc(var(--foot) + 8px); inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
    & .said { position: static; pointer-events: auto; }
    .door & { display: contents; }
  }
  .unreachable { inset-block-end: auto; inset-block-start: calc(var(--strip) + 8px); }
  @keyframes rise { from { translate: 0 12px; opacity: 0; } }

  .visually-hidden, .skip:not(:focus) { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .skip:focus { position: fixed; z-index: 50; inset: 10px auto auto 20px; padding: 8px 14px; background: var(--paper-ink); color: var(--paper); }

  /* The page, loading. Turbo's own bar, in the colour of where you are. */
  .turbo-progress-bar { height: 4px !important; background: var(--house) !important; }
  body[data-tinted] .turbo-progress-bar, html:has(body[data-tinted]) .turbo-progress-bar { background: var(--on) !important; }

  [data-theme-word="light"] { display: none; }
  :root[data-theme="dark"] [data-theme-word="light"] { display: inline; }
  :root[data-theme="dark"] [data-theme-word="dark"] { display: none; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme]) [data-theme-word="light"] { display: inline; }
    :root:not([data-theme]) [data-theme-word="dark"] { display: none; }
  }
  @media (scripting: none) { .theme { display: none; } }

  /* A question that stops you. It drops on a lip of the page's colour. */
  .question {
    font: 400 var(--ui)/var(--ui-line) var(--family); border: 0; padding: 0; margin: auto; inline-size: min(520px, 100vw - 40px); max-inline-size: none; background: transparent; color: var(--ink);
    clip-path: inset(0 0 100% 0); transition: clip-path var(--part) var(--ease), display var(--part) allow-discrete, overlay var(--part) allow-discrete;
    &::backdrop { background: var(--veil); opacity: 0; transition: opacity var(--part) var(--ease), display var(--part) allow-discrete, overlay var(--part) allow-discrete; }
    &[open] { clip-path: inset(0); @starting-style { clip-path: inset(0 0 100% 0); } }
    &[open]::backdrop { opacity: 1; @starting-style { opacity: 0; } }
    & .question-body { background: var(--wash); border-block-start: 10px solid var(--house); padding: 24px 32px 20px; }
    & p { font-size: 22px; line-height: 31px; text-wrap: pretty; overflow-wrap: anywhere; }
    & .words { margin-block-start: 18px; column-gap: 24px; }
    @media (max-width: 760px) { margin-block-end: 0; inline-size: 100vw; & .question-body { padding: 18px 20px 24px; } }
    @media (forced-colors: active) { & .question-body { border: 1px solid CanvasText; } }
  }
  body[data-tinted] .question-body { border-block-start-color: var(--hue); }
  @keyframes drop { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
}
@layer states { .wrap { white-space: normal; overflow-wrap: anywhere; text-align: start; } }
@layer states {
  [data-by-keys] :is(.field, textarea.title):focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
  .field { text-overflow: ellipsis; &::placeholder { text-overflow: ellipsis; } }
}

/* The title block: the strip, the title and who you are here wear the document's colour. */
@layer components {
  .title-block { padding-block: calc(var(--strip) + 64px) 28px; background: var(--page); }
  body[data-hue="plain"] .title-block { padding-block-end: 10px; }
  .column { position: relative; inline-size: min(var(--measure), 100% - 40px); margin-inline: auto; }
  .title, .title-shown { display: block; inline-size: 100%; margin: 0; padding: 0; border: 0; background: none; font: 500 44px/52px var(--family); letter-spacing: -.018em; }
  .title-shown { min-block-size: 52px; overflow-wrap: anywhere; white-space: pre-wrap; }
  h1.title, .title-shown { text-wrap: balance; overflow-wrap: anywhere; }
  textarea.title { text-wrap: wrap; overflow-wrap: anywhere; }

  /* The title wraps and grows where it is read. Its text, set behind it, gives the line its height, and is what is seen until one writes. */
  .title-line { display: block; position: relative; font: inherit; letter-spacing: inherit; }
  .title-line:focus-within .title-shown { visibility: hidden; }
  .title-line:not(:focus-within) textarea.title { color: transparent; }
  @media (forced-colors: active) { .title-shown { visibility: hidden; } }
  textarea.title { position: absolute; inset: -8px 0; inline-size: 100%; padding-inline-end: var(--beside, 0); block-size: calc(100% + 16px); padding-block: 8px; overflow: hidden; resize: none; cursor: text; outline: 0; border-radius: 0; white-space: pre-wrap; overflow-wrap: anywhere; &::placeholder { color: var(--quiet); opacity: 1; } &:focus { box-shadow: none; } @media (forced-colors: active) { &:focus { outline: 2px solid Highlight; } } }
  @media (max-width: 760px) { .title, .title-shown { font-size: 34px; line-height: 41px; min-block-size: 41px; } }

  .standfirst { margin-block-start: 10px; font-size: 22px; line-height: 33px; overflow-wrap: anywhere; text-wrap: pretty; @media (max-width: 760px) { font-size: 20px; line-height: 30px; } }
  .picker {
    position: absolute; z-index: 4; inset-block-start: 10px; right: calc(100% + 72px); text-align: end;
    & summary { display: inline-flex; list-style: none; cursor: pointer; color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; &::-webkit-details-marker { display: none; } }
    & fieldset { display: flex; gap: 6px; border: 0; padding: 0; min-inline-size: 0; }
    @media (max-width: 1180px) {
      inset-block-start: -48px; right: auto; left: 0; display: flex; align-items: center; gap: 14px;
      &[open] { display: flex; } & fieldset { padding: 0; }
    }
  }
  /* Where a details cannot be a flex box, the swatches sit on the line all the same. */
  @media (max-width: 1180px) { .picker::details-content { display: contents; } .picker:not([open]) form { display: none; } }
  .title-history { display: none; @media (max-width: 760px) { display: inline-flex; position: absolute; z-index: 4; inset-block-start: -50px; right: 0; color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; body[data-history] & { display: none; } } }
  .picker[open] ~ .title-history, body[data-mode="viewing"] .title-history { display: none; }
  @media (max-width: 760px) { .title-block:has(.title-history) { padding-block-start: calc(var(--strip) + 54px); } }
  body[data-mode="viewing"] .picker { display: none; }
  .swatch {
    inline-size: 26px; block-size: 26px; border: 2px solid var(--paper-ink); border-radius: 2px; background: var(--hue); display: grid; place-items: center; color: var(--on); position: relative; forced-color-adjust: none;
    [data-tinted] .wears & { border-color: var(--on); }
    &[data-hue="plain"] { background: var(--paper); color: var(--paper-ink); }
    &[aria-pressed="true"]::after { content: ""; inline-size: 6px; block-size: 11px; border: solid currentColor; border-width: 0 2.5px 2.5px 0; rotate: 42deg; translate: 0 -1px; }
    &:hover:not([aria-pressed="true"])::after { content: ""; inline-size: 8px; block-size: 8px; background: currentColor; border-radius: 50%; }
    &:focus-visible { outline-offset: 2px; }
    @media (forced-colors: active) { border-color: CanvasText; [data-tinted] .wears & { border-color: CanvasText; } }
    @media (max-width: 760px) { &::before { content: ""; position: absolute; inset: -11px -8px; } }
  }
  @media (max-width: 760px) {
    .title-block:has(.picker) { padding-block-start: calc(var(--strip) + 54px); }
    .picker { inset-block-start: -50px; gap: 18px; & fieldset { gap: 18px; } }
  }
}

/* Coming in, and being told no: a solid opening, then one thing to do. */
@layer components {
  .door { min-block-size: 100dvh; display: flex; flex-direction: column; }
  .door-top { order: -1; background: var(--hue); color: var(--on); padding-block: 120px 28px; min-block-size: clamp(188px, 35.4dvh, 380px); display: flex; align-items: end; margin-block-end: 28px; & h1 { font-size: 40px; line-height: 49px; } }
  .door .column { inline-size: min(560px, 100% - 40px); }
  .door-body { padding-block-end: 90px; & > p { font-size: var(--body); line-height: var(--line); text-wrap: pretty; overflow-wrap: anywhere; } & > :not([hidden]) + p { margin-block-start: 12px; } & form { margin-block-start: 28px; } }
  .door .field { font-size: 24px; line-height: 36px; }
  .door-row { display: flex; gap: 20px; align-items: center; margin-block-start: 18px; flex-wrap: wrap; }
  .door .said { order: 0; position: static; margin-block: 0 22px; inline-size: min(560px, 100% - 40px); animation: none; }
  .strip:has(.door-mark) { block-size: 72px; }
  .door-body > p.door-row { margin-block-start: 22px; font-size: var(--ui); line-height: var(--ui-line); }
  .ways legend { padding: 0; }
  .door-mark { margin-inline-start: -6px; display: flex; align-items: center; gap: 8px; min-block-size: 44px; font-weight: 550; color: var(--on); text-decoration: none; }

  /* What opened, pointing up at what it is about. */
  .opened {
    position: relative; margin: 14px calc(var(--bleed) * -1) 0; padding: 18px var(--bleed) 16px; background: var(--wash);
    &::before { content: ""; position: absolute; inset-block-start: -9px; left: 60px; inline-size: 18px; block-size: 9.5px; background: inherit; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
    & p { font-size: var(--body); line-height: var(--line); } & form { margin: 0; } & .words { margin-block-start: 8px; }
    &.wears { animation: part 260ms var(--ease); }
    @media (prefers-reduced-motion: reduce) { &.wears { animation: none; } }
    @media (forced-colors: active) { border: 1px solid CanvasText; }
  }
  @keyframes part { from { clip-path: inset(-10px 0 100% 0); } to { clip-path: inset(-10px 0 0 0); } }
  .kept-said { margin-block-end: 24px !important; padding-inline-start: 16px; border-inline-start: 3px solid var(--house); font-size: 18px !important; line-height: 28px !important; text-wrap: pretty; }
  .door-sent { margin-block-start: 28px; }
  .door-error { color: var(--madder); font-size: var(--ui) !important; line-height: var(--ui-line) !important; margin-block-start: 8px !important; }
  .field[aria-invalid="true"] { border-block-end-color: var(--madder); box-shadow: 0 1.5px var(--madder); }
  .sent-to { font-size: 24px; line-height: 36px; overflow-wrap: anywhere; border-block-end: 1.5px solid var(--rule); padding-block: 4px 6px; }
  .door .sent-to { font-size: 24px; line-height: 36px; }
  .said-small { color: var(--quiet); font-size: var(--ui) !important; line-height: var(--ui-line) !important; margin-block-start: 20px !important; }

  @media (min-width: 761px) { .door:has(.opened) .door-top { min-block-size: clamp(188px, 29.4dvh, 340px); } }
  @media (max-width: 760px) { .opened { padding-block: 16px 10px; } .door-top { min-block-size: 188px; & h1 { font-size: 32px; line-height: 40px; } } }
}

/* Files in, files out, and the page on paper. */
@layer components {
  .beginning-file { cursor: pointer; &:focus-within { outline: 2px solid currentColor; outline-offset: 0; } }
  .drop-place {
    position: fixed; z-index: 45; inset: 0; display: grid; place-items: center; pointer-events: none; background: color-mix(in srgb, var(--house) 92%, transparent); color: var(--on); font-size: 30px; line-height: 40px; font-weight: 500; text-align: center; padding: 24px;
    & span { display: block; font-size: 18px; line-height: 28px; }
  }
  .import-said { position: fixed; }

  .download {
    & h2 { font-size: 22px; line-height: 31px; font-weight: 550; overflow-wrap: anywhere; }
    & .words { margin-block-start: 12px; }
    & .words.download-forms { column-gap: 28px; font-size: 18px; & .word { color: var(--action); font-weight: 600; } }
    & .also { margin-block-start: 10px; font-size: var(--ui); line-height: 24px; color: var(--quiet); }
    & output { display: block; min-block-size: 24px; margin-block-start: 8px; font-size: var(--ui); line-height: 24px; }
  }
}

@media print {
  @layer print {
    @page { margin: 22mm 20mm; }
  }
  :root, :root[data-theme] { color-scheme: light !important; --page: #fff !important; --ink: #000 !important; --quiet: #333 !important; --paper: #fff !important; --paper-ink: #000 !important; --on: #000 !important; --hue: #fff !important; --action: #000 !important; --wash: #f4f4f4 !important; --rule: #bbb !important; }
  html:has(.document), body { background: #fff !important; color: #000 !important; }
  .strip, .foot, .keybar, .layer, .outline, .picker, .said, .skip, .connection, .history, dialog, .here, .edges, .tools, .bubble, .tip, .sizing, turbo-frame#sharing, .commands { display: none !important; }
  .document .title-block { padding: 0 0 14pt !important; background: none !important; }
  .document .column, .writing.column { inline-size: auto !important; margin: 0 !important; max-inline-size: none !important; }
  .document :is(.title, .title-shown) { font-size: 26pt !important; line-height: 1.2 !important; color: #000 !important; visibility: visible !important; }
  .document textarea.title { display: none !important; }
  .writing { padding: 0 !important; margin: 0 !important; display: block !important; position: static !important; visibility: visible !important; block-size: auto !important; overflow: visible !important; opacity: 1 !important; }
  .manuscript { margin: 0 !important; padding: 0 !important; font-size: 11.5pt !important; line-height: 1.5 !important; color: #000 !important; min-block-size: 0 !important; }
  .manuscript > p:first-child { margin: 0 0 10pt !important; font-size: inherit !important; line-height: inherit !important; background: none !important; box-shadow: none !important; clip-path: none !important; color: #000 !important; }
  .manuscript :is(h1, h2, h3, h4, h5, h6) { break-after: avoid; break-inside: avoid; }
  .manuscript :is(p, li, blockquote) { orphans: 2; widows: 2; }
  .manuscript :is(figure, tr, img) { break-inside: avoid; }
  .manuscript img { max-block-size: 230mm; inline-size: auto; max-inline-size: 100%; object-fit: contain; }
  .manuscript, .manuscript * { caret-color: transparent !important; }
  [data-painted~="active"] ::highlight(active), [data-painted~="asking"] ::highlight(asking), [data-painted~="held"] ::highlight(held), [data-painted~="unwritten"] ::highlight(unwritten), [data-painted~="who-madder"] ::highlight(who-madder), [data-painted~="who-viridian"] ::highlight(who-viridian), [data-painted~="who-umber"] ::highlight(who-umber), [data-painted~="who-teal"] ::highlight(who-teal), [data-painted~="who-indigo"] ::highlight(who-indigo), [data-painted~="who-plum"] ::highlight(who-plum), [data-painted~="who-clay"] ::highlight(who-clay), [data-painted~="who-olive"] ::highlight(who-olive), [data-painted~="who-pine"] ::highlight(who-pine), [data-painted~="who-violet"] ::highlight(who-violet), [data-painted~="said-madder"] ::highlight(said-madder), [data-painted~="said-viridian"] ::highlight(said-viridian), [data-painted~="said-umber"] ::highlight(said-umber), [data-painted~="said-teal"] ::highlight(said-teal), [data-painted~="said-indigo"] ::highlight(said-indigo), [data-painted~="said-plum"] ::highlight(said-plum), [data-painted~="said-clay"] ::highlight(said-clay), [data-painted~="said-olive"] ::highlight(said-olive), [data-painted~="said-pine"] ::highlight(said-pine), [data-painted~="said-violet"] ::highlight(said-violet) { background: none; text-decoration: none; color: inherit; } /* who else is here is not on paper */
  .manuscript thead { display: table-header-group; }
  .manuscript code[data-language], .manuscript .lexxy-content__table-wrapper { overflow: visible !important; white-space: pre-wrap; }
  .manuscript li[role="checkbox"]::after, .manuscript [style*="--highlight-bg-"], .manuscript code { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .manuscript [data-parted]::before { display: none !important; }
  .manuscript [data-parted] { padding-block-end: 0 !important; border-block-end-width: 0 !important; }
  .manuscript p.provisional-paragraph { display: none; }
  .manuscript figcaption[data-placeholder] { display: none; }
  .lexxy-editor--empty .manuscript > :is(p, h1, h2, h3, h4):only-child::after { content: none !important; }
  /* Where someone prints a version of the past, it is that */
  body[data-past] .history { display: block !important; }
  body[data-past] .history :is(.history-panel, .past-bar, .past-since) { display: none !important; }
  body[data-past] .writing { display: none !important; }
  body[data-past] .past-text { padding: 0 !important; margin: 0 !important; }
}

/* Find: what opens, and what is found in the text. */
@layer components {
  .find-row { display: flex; align-items: baseline; gap: 16px; & .field { flex: 1; min-inline-size: 0; } & output { white-space: nowrap; font-size: var(--small); } }
  .find output:empty { display: none; }
  .find [name="other"] { margin-block-start: 8px; }
  .find [aria-pressed="true"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; font-weight: 600; &::before { content: "\2713\00A0" / ""; } }
  .find button:disabled { opacity: .5; cursor: default; text-decoration: none; }
  @media (max-width: 760px) { .find-row { flex-wrap: wrap; row-gap: 4px; & .field { flex-basis: 100%; } } }

  .character-count { white-space: nowrap; @media (max-width: 1700px) { display: none; } }
  .count table { inline-size: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; & :is(th, td) { text-align: end; font-weight: 400; padding: 3px 0 3px 12px; } & :is(th, td):first-child { text-align: start; padding-inline-start: 0; } @media (max-width: 420px) { font-size: var(--small); line-height: 18px; & :is(th, td) { padding-inline-start: 6px; white-space: normal; } } & tbody td { font-weight: 600; } }

  [data-painted~="found"] ::highlight(found) { background-color: color-mix(in srgb, var(--action) 22%, transparent); }
  [data-painted~="found"] body[data-tinted] ::highlight(found) { background-color: color-mix(in srgb, var(--hue) 42%, transparent); }
  [data-painted~="guessed"] ::highlight(guessed) { background-color: color-mix(in srgb, var(--action) 8%, transparent); text-decoration: underline dashed currentColor 1.5px; text-underline-offset: 4px; }
  [data-painted~="met"] ::highlight(met) { background-color: var(--paper-ink); color: var(--paper); }
  /* The first paragraph where it has the title's colour */
  body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) { [data-painted~="found"] &::highlight(found), [data-painted~="found"] & ::highlight(found) { background-color: color-mix(in srgb, var(--on) 22%, transparent); } [data-painted~="met"] &::highlight(met), [data-painted~="met"] & ::highlight(met) { background-color: var(--on); color: #fff; } }
  @media print { [data-painted~="found"] ::highlight(found), [data-painted~="guessed"] ::highlight(guessed), [data-painted~="met"] ::highlight(met) { background: none; color: inherit; text-decoration: none; } }
}

/* What the document was, under its title: page inside a frame of the document's colour. */
@layer components {
  .history { transition: display var(--part) allow-discrete; }
  .history-panel { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--part) var(--ease), opacity var(--part); .history:not([hidden]) & { @starting-style { grid-template-rows: 0fr; } } .history[hidden] & { grid-template-rows: 0fr; opacity: 0; } & > div { min-block-size: 0; } &:not(:has(.moment)) .history-body { min-block-size: 310px; } .history[hidden] & .history-body { min-block-size: 0; } }

  .history-panel { margin-block-start: 12px; }
  .history-body {
    position: relative; margin-inline: calc(var(--bleed) * -1); padding: 22px var(--bleed) 14px; border: 8px solid var(--wash-deep); background: var(--page); color: var(--ink); padding-inline: calc(var(--bleed) - 8px);
    &::before { content: ""; position: absolute; inset-block-start: -17px; left: calc(50% - 9px); inline-size: 18px; block-size: 9.5px; background: var(--wash-deep); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
    [data-tinted] & { border-color: var(--hue); &::before { background: var(--hue); } }
    @media (max-width: 760px) { margin-inline: -20px; border-width: 6px; padding-inline: 14px; &::before { inset-block-start: -15px; } }
  }
  .history-top { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; & h2 { font-size: 20px; line-height: 30px; font-weight: 600; } }
  .history-close { display: none; @media (max-width: 760px) { display: inline-flex; } }
  @media (max-width: 760px), (max-height: 500px) { .history-end { display: none !important; } .history-close { display: inline-flex !important; } }
  .history-end { display: flex; justify-content: flex-end; margin-block-start: 8px; position: sticky; inset-block-end: var(--foot); background: var(--page); }
  body[data-past] {
    & .history-body { border-block-end: 0; padding-block-end: 0; } & .history-end { display: none; }
    & .past-bar { margin-block-start: 0; padding-block: 0; background: none; border: 0; pointer-events: none; & > .column { pointer-events: auto; inline-size: min(var(--measure) + 2 * var(--bleed), 100%); border: 8px solid var(--wash-deep); border-block-start: 0; padding: 10px calc(var(--bleed) - 8px) 12px; background: var(--page); } }
    &[data-tinted] .past-bar > .column { border-color: var(--hue); }
    & .past-words .act { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .28em; }
    @media (max-width: 760px) { & .past-bar > .column { border-width: 6px; border-block-start: 0; padding-inline: 14px; } }
  }
  html:has(body[data-history]) { overscroll-behavior-y: contain; }
  .history-panel:not([data-held]) { transition-property: grid-template-rows, opacity, translate; }
  body[data-history] [data-review] { visibility: hidden; }
  body[data-history] .title-block { padding-block-end: 10px; }
  .history-which { margin-block-start: 2px; }
  .history-day { margin-block-start: 16px; & h3 { font-size: var(--ui); line-height: 24px; font-weight: 400; color: var(--quiet); margin-block-end: 2px; } }

  .moment {
    display: grid; grid-template-columns: 148px 1fr; gap: 0 18px; min-block-size: var(--touch); padding: 6px 8px; margin-inline: -8px; border-radius: 2px; font-size: 17px; line-height: 26px; text-decoration: none;
    & time { color: var(--quiet); font-size: var(--ui); }
    & .moment-said { display: grid; min-inline-size: 0; overflow-wrap: anywhere; }
    & b { font-weight: inherit; } 
    & .who { color: inherit; }
    &:hover { background: var(--wash); }
    &:focus-visible { outline-offset: 2px; }
    &[aria-current] { background: var(--ink); color: var(--page); & :is(time, .who) { color: inherit; } }
    [data-tinted] &[aria-current] { background: var(--hue); color: var(--on); }
    @media (max-width: 760px) { grid-template-columns: 1fr; padding-inline: 8px; }
    @media (forced-colors: active) { &[aria-current] { outline: 2px solid Highlight; } }
  }
  .moment-name { font-weight: 650; }
  .moment-parts {
    margin-inline-start: 166px; & > summary { list-style: none; cursor: pointer; inline-size: fit-content; font-size: var(--ui); &::-webkit-details-marker { display: none; } &::after { content: "\25BE"; margin-inline-start: 6px; } }
    &[open] > summary::after { content: "\25B4"; }
    & .moment { grid-template-columns: 84px 1fr; font-size: 16px; line-height: 24px; }
    @media (max-width: 760px) { margin-inline-start: 0; padding-inline-start: 16px; border-inline-start: 2px solid var(--rule); }
  }

  /* The version that is open. Its bar stays while one reads. */
  .past-bar {
    position: sticky; z-index: 6; inset-block-start: var(--strip); margin-block-start: 22px; padding-block: 12px 8px; background: var(--page); border-block-end: 1px solid var(--rule);
    & .past-said { display: flex; flex-wrap: wrap; gap: 0 14px; font-size: 17px; line-height: 26px; & span { color: var(--quiet); } }
    @media (max-width: 760px) { padding-block: 8px 4px; }
  }
  .past-words { row-gap: 0; & > .push { margin-inline-start: auto; } & details[open] { flex-basis: 100%; } & summary { list-style: none; cursor: pointer; &::-webkit-details-marker { display: none; } } @media (max-width: 760px) { column-gap: 18px; } }
  .past-form { display: flex; align-items: baseline; gap: 18px; max-inline-size: 460px; padding-block-end: 6px; }
  .past-asks { margin-block: 6px 10px; padding: 14px 18px 12px; background: var(--wash); font-size: 17px; line-height: 26px; text-wrap: pretty; animation: drop var(--part) var(--ease); & .words { margin-block-start: 10px; column-gap: 24px; font-size: var(--ui); } @media (forced-colors: active) { border: 1px solid CanvasText; } }
  .past-since { margin-block-start: 14px; color: var(--quiet); & select { max-inline-size: 100%; min-block-size: var(--touch); color: var(--ink); background: var(--page); border: 0; border-block-end: 1.5px solid var(--quiet); border-radius: 0; } }
  .past-text { margin-block-start: 34px; padding-block-end: 40vh; &:focus { outline: 0; } }

  .past-text > p:first-child:has(+ h2) { margin-block: 0 18px !important; background: none !important; box-shadow: none !important; clip-path: none !important; color: var(--paper-ink) !important; }

  .change { text-decoration: none; color: inherit; }
  .change--ins { background: color-mix(in srgb, var(--who, var(--action)) 13%, transparent); border-block-end: 1.5px solid var(--who, var(--action)); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  .change--ins[data-ink="violet"] { border-block-end: 3px double var(--who); }
  .change--del { color: var(--who, var(--quiet)); text-decoration: line-through; text-decoration-color: var(--who, var(--quiet)); text-decoration-thickness: 1.5px; }
  .change--restyled { border-block-end: 2px dotted var(--who, var(--quiet)); }
  .past-text :is(figure, .lexxy-content__table-wrapper, blockquote, code)[data-change] { box-shadow: -18px 0 0 -14px var(--who, var(--action)); }
  .past-text :is(p, h1, h2, h3, h4, h5, h6, li, code)[data-change="restyled"] { box-shadow: -18px 0 0 -15px var(--who, var(--quiet)); }
  .past-text [data-change="del"]:is(figure, .lexxy-content__table-wrapper) { opacity: .55; }
  .past-text li[role="checkbox"]::after { cursor: default; }

  body[data-history] {
    & .writing { position: absolute; inset-inline: 0; block-size: 0; overflow: hidden; visibility: hidden; margin: 0; padding: 0; }
    &:not([data-past]) .writing { position: relative; block-size: auto; visibility: visible; overflow: visible; inline-size: min(var(--measure), 100% - 40px); --head: 44px; margin: 22px auto 0; }
    & :is(.keybar, .outline, .proof-notes, .edges) { visibility: hidden; }
    & .foot-modes { pointer-events: none; }
    &[data-past] .title-form { display: none; } /* what is read has a title of its own */
    &[data-past] :is(.picker, .foot-middle, .foot-again, .word-count, .character-count, #comments-word, .foot [data-command="commands"], .edges) { visibility: hidden !important; } /* the document's, which is not what is read */
  }
  @media print { .history-panel, .past-bar, .past-since { display: none; } }
}

@layer components { .past-merge { margin-block: 6px 2px; font-size: 17px; line-height: 26px; & ul { max-inline-size: var(--measure); margin-block: 2px 8px; & li { padding-block: 4px; border-block-end: 1px solid var(--rule); overflow-wrap: anywhere; } } & details > summary { cursor: pointer; inline-size: fit-content; } } }

/* Home, and the quiet pages beside it. A solid block in the margin beside each title; hover or focus and it fills the row. */
@layer components {
  body:has(.index) { overflow-x: clip; }
  .index { inline-size: min(760px, 100% - 40px); margin: calc(var(--strip) + 34px) auto 0; padding-block-end: 24px; }
  .index > h1, .agent-title h1 { font-size: 34px; line-height: 44px; padding-block: 5px; font-weight: 450; letter-spacing: -.015em; }
  .index-filters { margin-block: 4px 26px; }
  .index section { position: relative; & + section { margin-block-start: 26px; } }
  .index section > h2 { position: absolute; inset-block-start: 9px; inset-inline-end: calc(100% + 112px); inline-size: max-content; font-size: var(--ui); line-height: 34px; font-weight: 400; color: var(--quiet); }

  .entry {
    --w: min(760px, 100vw - 40px); --block: 72px; --space: 24px;
    position: relative; padding: 9px 88px 9px 0; min-block-size: 70px;

    & .entry-line a::after { content: ""; position: absolute; inset: 2px calc(var(--w) / 2 - 50vw); }
    & .entry-line a:focus-visible { outline: 0; }
    & .entry-line a:focus-visible .entry-title { outline: 2px solid currentColor; outline-offset: 3px; }
  }
  .entry-line { font-size: 24px; line-height: 34px; letter-spacing: -.008em; text-wrap: pretty; overflow-wrap: anywhere; & a { text-decoration: none; font-weight: 550; } }
  .entry-when time { position: relative; z-index: 1; } /* over the link that covers the row, so hovering says when exactly */
  .entry-when { font-size: var(--small); line-height: 22px; color: var(--quiet); overflow-wrap: anywhere; }

  .entry[data-hue] {
    z-index: 0;
    &::before { content: ""; position: absolute; z-index: -1; inset-block: 2px; left: calc(var(--w) / 2 - 50vw); inline-size: 100vw; background: var(--hue); clip-path: inset(0 calc(50vw + var(--w) / 2 + var(--space)) 0 calc(50vw - var(--w) / 2 - var(--space) - var(--block))); transition: clip-path 180ms var(--ease); }
    &:is(:has(:focus-visible, [aria-expanded="true"]), :has(a:active))::before { clip-path: inset(0); }
    @media (hover: hover) { &:hover::before { clip-path: inset(0); } }
    @media (prefers-reduced-motion: reduce) { &::before { transition: none; } }
    @media (forced-colors: active) { &::before { forced-color-adjust: none; clip-path: inset(0 calc(50vw + var(--w) / 2 + var(--space)) 0 calc(50vw - var(--w) / 2 - var(--space) - var(--block))) !important; } }
  }
  .entry[data-tinted] {
    &:is(:has(:focus-visible, [aria-expanded="true"]), :has(a:active)) { color: var(--on); --quiet: var(--on); --ink: var(--on); & mark { background: #fff; } }
    @media (hover: hover) { &:hover { color: var(--on); --quiet: var(--on); --ink: var(--on); & mark { background: #fff; } } }
    @media (forced-colors: active) { color: CanvasText; --quiet: CanvasText; }
  }
  .entry[data-hue="plain"] {
    &::before { background: var(--wash-deep); }
    &::after { content: ""; position: absolute; inset-block: 2px; left: calc(-1 * var(--space) - var(--block)); inline-size: var(--block); border: 1.5px solid var(--quiet); background: var(--page); pointer-events: none; }
    &:has(:focus-visible) { --quiet: var(--ink); }
    @media (hover: hover) { &:hover { --quiet: var(--ink); } }
  }
  .entry-said { font-size: 18px; line-height: 28px; letter-spacing: 0; color: var(--quiet); }
  .entry mark { background: var(--hue, var(--house)); color: var(--on); padding-block: 1px; }
  .entry[data-hue="plain"] mark { background: var(--wash-deep); color: var(--ink); }
  .entry-acts .icon { inline-size: 20px; block-size: 20px; }
  .entry-acts { position: absolute; z-index: 2; inset-block-start: 10px; inset-inline-end: -10px; display: flex; & form { display: flex; } }
  @media (hover: hover) { .entry:not(:hover, :focus-within, :has([aria-expanded="true"])) .entry-act:not([aria-pressed="true"]) { opacity: 0; } }
  .entry .part-in { @media (pointer: coarse) { touch-action: none; } }
  .entry .part { position: relative; z-index: 2; margin-inline: calc(var(--bleed) * -1) calc(-88px - var(--bleed)); & .part-in { background: var(--paper); color: var(--paper-ink); --ink: var(--paper-ink); --quiet: var(--paper-quiet); padding: 12px var(--bleed); margin-block: 14px 10px; } & .part-in::before { inset-block-start: -8px; inline-size: 18px; block-size: 9px; } & .field { flex: 1 1 240px; inline-size: auto; font-size: 18px; } & span { color: var(--paper-ink); } }
  .entry:not([data-hue]) .part .part-in { background: var(--wash); }
  .index-home > .asks { margin-block: -6px 26px; border-inline-start: 2px solid var(--action); padding-inline-start: 16px; font-size: 18px; line-height: 28px; & li { padding-block: 3px; overflow-wrap: anywhere; } & .phrase { position: relative; @media (max-width: 760px) { &::before { content: ""; position: absolute; inset: -9px -8px; } } } & b { font-weight: 600; } }

  .index-search .field { font-size: 34px; line-height: 44px; block-size: 54px; font-weight: 450; letter-spacing: -.015em; border-block-end: 0; padding: 0; box-shadow: none; appearance: none; &::-webkit-search-cancel-button { display: none; } }
  .index-search:has(:focus-visible) { box-shadow: 0 2px var(--action); }
  .index-count { color: var(--quiet); overflow-wrap: anywhere; &:not(:empty) { margin-block-end: 16px; } &:not(:has(*)):empty { display: none; } }
  .index-new { --hue: var(--house); & .part { margin-inline: calc(var(--bleed) * -1); } & .part-in { background: var(--house); color: var(--on); --quiet: var(--on); --ink: var(--on); --action: var(--on); padding: 12px var(--bleed); margin-block: 0 24px; } & .part-in::before { inset-block-start: -8px; inline-size: 18px; block-size: 9px; } & .part[data-open] > div { padding-block-start: 14px; } }
  .beginnings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 32px; font-size: 18px; line-height: 28px; }
  .beginning { display: block; inline-size: 100%; padding-block: 7px; & b { display: block; font-weight: 600; overflow-wrap: anywhere; } & span { display: block; font-size: var(--ui); line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } &:hover b { text-decoration: underline; text-underline-offset: 4px; } &:focus-visible { outline-offset: 0; } }

  /* More of the list, on its way */
  .page-waiting { position: relative; & > a { position: absolute; opacity: 0; &:focus-visible { opacity: 1; z-index: 2; background: var(--page); } } }
  .ghosts li { position: relative; block-size: 108px; border-block: 2px solid var(--page); &::before { content: ""; position: absolute; inset-block: 0; left: -96px; inline-size: 72px; background: var(--wash-deep); } &::after { content: ""; position: absolute; inset-block-start: 16px; inline-size: 46%; block-size: 22px; background: var(--wash); box-shadow: 0 36px var(--wash); } @media (max-width: 760px) { &::before { left: -20px; inline-size: 12px; } } }
  html[aria-busy="true"] .index-home #documents { opacity: .55; transition: opacity 200ms 400ms; }
  .index turbo-frame > section { margin-block-start: 26px; } .index #documents > turbo-frame > section:first-child { margin-block-start: 0; } .index turbo-frame turbo-frame > section:first-child:not(:has(h2)) { margin-block-start: 0; }

  /* Nothing here yet */
  .index-empty { font-size: 24px; line-height: 36px; max-inline-size: 24em; margin-block: 40px 0; text-wrap: pretty; & p + p { margin-block-start: 14px; font-size: 18px; line-height: 28px; color: var(--quiet); } }

  .index-foot { inline-size: min(760px, 100% - 40px); margin: 40px auto 0; padding-block-end: 90px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 20px; color: var(--quiet); & > span { overflow-wrap: anywhere; min-inline-size: 0; } }

  body:has(.strip-end .theme) .index-foot .theme { display: none; } /* said once */

  @media (max-width: 1300px) { .index section > h2 { position: static; line-height: 24px; padding-block-end: 4px; } }
  @media (max-width: 760px) {
    .index { margin-block-start: calc(var(--strip) + 14px); }
    .index > h1 { font-size: 28px; line-height: 40px; }
    .index-filters { margin-block-end: 18px; }
    .entry { --block: 12px; --space: 8px; padding: 11px 44px 11px 0; & .part { margin-inline-end: calc(-44px - var(--bleed)); } }
    .entry-said { font-size: 17px; line-height: 26px; }
    .entry-acts { flex-direction: column; inset-block-start: 2px; inset-inline-end: -12px; }
    .index-search .field { font-size: 28px; line-height: 44px; }
        .beginnings { grid-template-columns: minmax(0, 1fr); }
    .strip-end .agents-word { display: none; }
    .index-foot { flex-wrap: nowrap; & > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } & .words { flex-wrap: nowrap; flex: none; } }
    .entry-line { font-size: 21px; line-height: 30px; }
  }
}

/* With no line */
@layer components { .offline-opening { color: var(--quiet); font-style: italic; } .offline-title { font-size: 34px; line-height: 44px; padding-block: 5px; font-weight: 450; letter-spacing: -.015em; } .index .lead { font-size: 18px; line-height: 28px; color: var(--quiet); margin-block: 4px 26px; max-inline-size: var(--measure); } .offline-other, .index-home[data-away] .entry:not([data-kept]) .entry-title { color: var(--quiet); } }
@layer components { .index-foot .agents-word { display: none; @media (max-width: 760px) { display: inline-flex; } } @media (max-width: 760px) { .index-foot:has(.agents-word) { flex-wrap: wrap; & > span { flex-basis: 100%; white-space: normal; } } } }

/* The text. The same rules dress what the server drew and what the editor has, so the one becomes the other unseen. */
@layer components {
  html:has(.writing) { overflow-anchor: none; } /* the editor holds the passage being read itself */

  .writing { --head: 26px; --tail: 45vh; @media (max-width: 760px) { --head: 22px; --tail: 60vh; } }
  body[data-hue="plain"] .writing { --head: 20px; }
  /* The space around the lines belongs to the text: a press there puts the caret at the nearest place. */
  .writing .manuscript { --side: calc((100vw - 100%) / 2); margin-inline: calc(-1 * var(--side)); padding-inline: var(--side); padding-block: var(--head) var(--tail); }
  .document { overflow-x: clip; } /* 100vw has the scrollbar in it */
  lexxy-editor { display: block; position: relative; &[hidden] { display: block !important; position: absolute; inset-inline: 0; visibility: hidden; pointer-events: none; } }

  .manuscript {
    min-block-size: 40vh; font-size: var(--body); line-height: var(--line); outline: 0; caret-color: var(--ink); white-space: pre-wrap; overflow-wrap: break-word; word-break: normal !important; font-variant-ligatures: common-ligatures; tab-size: 4;

    & > :first-child { margin-block-start: 0; }
    & h1 { font-size: 34px; line-height: 42px; font-weight: 550; letter-spacing: -.014em; margin-block: 60px 12px; text-wrap: wrap; }
    & h2 { font-size: 26px; line-height: 34px; font-weight: 600; letter-spacing: -.008em; margin-block: 56px 10px; }
    & h3 { font-size: 20px; line-height: var(--line); font-weight: 650; margin-block: 28px 2px; }
    & :is(h4, h5, h6) { font-size: var(--body); line-height: var(--line); font-weight: 650; font-style: italic; margin-block: 24px 0; }
    & p { margin-block: 0; }
    & > p, & > ul, & > ol { margin-block-end: 18px; }
    & blockquote > * + * { margin-block-start: 18px; }

    & a { color: var(--action); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; cursor: text; }
    [data-mode="viewing"] & a, lexxy-editor[data-links-openable] & a { cursor: pointer; }
    & :is(strong, b) { font-weight: 650; overflow-wrap: inherit; }
    & .lexxy-content__italic { font-style: italic; } /* one element carries every format: <strong> alone would stand upright */
    & .lexxy-content__underline { text-decoration: underline; text-underline-offset: .18em; }
    & .lexxy-content__strikethrough { text-decoration: line-through; }
    & .lexxy-content__underline.lexxy-content__strikethrough { text-decoration: underline line-through; }
    & :is(sub, sup, :is(mark, code) > :is(.lexxy-content__subscript, .lexxy-content__superscript)) { font-size: .72em; line-height: 0; }
    & :is(mark, code) > .lexxy-content__subscript { vertical-align: sub; }
    & :is(mark, code) > .lexxy-content__superscript { vertical-align: super; }
    & mark { background: none; color: inherit; }
    & [style*="--highlight-bg-"] { padding-block: .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; border-radius: 1px; }
    & :not(pre) > code:not([data-language], [data-highlight-language]), & p code, & li code { font: inherit; font-size: .92em; background: var(--wash); color: inherit; padding: 1px 5px; border-radius: 2px; font-feature-settings: "tnum", "lnum"; letter-spacing: .02em; }

    & blockquote { margin-block: 38px !important; margin-inline: 0; padding-inline: 0 32px; font-size: 27px; line-height: 38px; font-style: italic; letter-spacing: -.01em; --line: 38px; & :is(em, i, .lexxy-content__italic) { font-style: normal; } }

    /* Lists. The marker is drawn after, because what parts the lines is drawn before. */
    & :is(ul, ol) { padding: 0; list-style: none; }
    & li { position: relative; padding-inline-start: 34px; min-block-size: var(--line); &::after { position: absolute; inset-block-start: 0; } &:not([role="checkbox"])::after { pointer-events: none; } }
    & ul > li::after { content: "\2013"; content: "\2013" / ""; inset-inline-start: 0; }
    & ul ul > li::after { content: "\2022"; content: "\2022" / ""; inset-inline-start: 0; }
    & ul ul ul > li::after { content: "\00B7"; content: "\00B7" / ""; inset-inline-start: 1px; font-weight: 700; }
    & ul ul ul ul > li::after, & ul ul ul ul ul ul ul > li::after, & ul ul ul ul ul ul ul ul ul ul > li::after { content: "\2013"; content: "\2013" / ""; inset-inline-start: 0; font-size: inherit; }
    & ul ul ul ul ul > li::after, & ul ul ul ul ul ul ul ul > li::after { content: "\2022"; content: "\2022" / ""; inset-inline-start: 0; }
    & ul ul ul ul ul ul > li::after, & ul ul ul ul ul ul ul ul ul > li::after { content: "\00B7"; content: "\00B7" / ""; inset-inline-start: 1px; font-weight: 700; }
    & ol { counter-reset: item; }
    & ol > li:not(.lexxy-nested-listitem) { counter-increment: item; }
    & ol > li::after { content: counter(item); inset-inline-start: 0; font-weight: 650; font-feature-settings: "tnum", "lnum"; }
    & > ol[start] > li::after { content: attr(value); } /* elsewhere counted here: two people's items can arrive with the same value */
    & ol ol > li::after { content: counter(item, lower-alpha); }
    & ol ol ol > li::after { content: counter(item, lower-roman); }
    & ol ol ol ol > li::after, & ol ol ol ol ol ol ol > li::after, & ol ol ol ol ol ol ol ol ol ol > li::after { content: counter(item); }
    & ol ol ol ol ol > li::after, & ol ol ol ol ol ol ol ol > li::after { content: counter(item, lower-alpha); }
    & ol ol ol ol ol ol > li::after, & ol ol ol ol ol ol ol ol ol > li::after { content: counter(item, lower-roman); }
    & > ol > li:not(:first-child, .lexxy-nested-listitem), & > ol > li.lexxy-nested-listitem + li { margin-block-start: 10px; }
    & .lexxy-nested-listitem { &::after { content: none !important; } }
    & li[role="checkbox"] {
      cursor: text;
      &:not([data-parted])::before { inline-size: 26px; } /* never drawn: how far in a press ticks the line, as Lexical asks */
      &::after { content: "" !important; inset-inline-start: 0; inset-block-start: calc((var(--line) - 18px) / 2); inline-size: 18px; block-size: 18px; border: 1.5px solid var(--quiet); border-radius: 2px; cursor: pointer; }
      &[aria-checked="true"] { color: var(--quiet); }
      &[aria-checked="true"]::after { border: 0; background: var(--ink); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill-rule='evenodd' d='M2 0h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm5.6 13.6L14.4 6 13 4.7 7.5 10.9 4.9 8.4 3.6 9.8z'/%3E%3C/svg%3E"); }
      &:focus-visible { outline: 0; &::after { outline: 2px solid var(--action); outline-offset: 2px; } }
    }
    @media (max-width: 760px) { & li[role="checkbox"] { padding-block: 7px; &::after { inset-block-start: calc(7px + (var(--line) - 18px) / 2); } } }

    /* Code */
    & :is(code[data-language], code[data-highlight-language]) {
      display: block; position: relative; margin-block: 26px; padding: 16px 20px 17px; background: var(--wash); border-radius: 2px; font: 400 15px/24px ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0;
      white-space: pre; overflow-x: auto; tab-size: 2; font-feature-settings: normal; overscroll-behavior-x: contain; scrollbar-width: thin;
      & .code-token__comment { color: var(--quiet); font-style: italic; }
      & .code-token__attr { color: light-dark(#8a1c5a, #f58cc0); }
      & .code-token__property { color: light-dark(#8a3b00, #f2a968); }
      & .code-token__selector { color: light-dark(#0a6847, #6fd3a5); }
      & .code-token__function { color: light-dark(#2433c9, #9aa6ff); }
      & .code-token__variable { color: light-dark(#6a35c9, #bb9ff7); }
      & .code-token__operator, & .code-token__punctuation { color: var(--quiet); }
    }

    /* Tables */
    & .lexxy-content__table-wrapper { margin-block: 8px 26px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; margin-inline-end: -1px; padding-inline-end: 1px; }
    & table { inline-size: 100%; table-layout: auto; border-collapse: collapse; font-size: 17px; line-height: 26px; --line: 26px; &:has(col) { inline-size: max-content; min-inline-size: 0; table-layout: fixed; } }
    & :is(th, td) { position: relative; padding: 8px 18px 8px 0; border: 0; border-block-end: 1px solid var(--rule); text-align: start; vertical-align: baseline; min-inline-size: 72px; font-weight: 400; max-inline-size: 420px; white-space: pre-wrap; overflow-wrap: normal; }
    & th, & .lexxy-content__table-cell--header { font-weight: 650; }
    & :is(th, td)[style*="--highlight-bg-"] { padding-inline-start: 10px; padding-block: 8px; border-radius: 0; }
    & [data-figures] { text-align: end; font-feature-settings: "tnum", "lnum"; }
    & tr[data-total] > * { font-weight: 650; border-block-end-color: transparent; }
    & .lexxy-content__table-cell--selected { background: color-mix(in srgb, var(--hue) 34%, var(--page)); box-shadow: -6px 0 color-mix(in srgb, var(--hue) 34%, var(--page)); [data-tinted] & { background: var(--hue); color: var(--on); box-shadow: -6px 0 var(--hue); } }
    &[data-resizing] { cursor: col-resize; & * { cursor: inherit; } }
    & .lexxy-content__table--selection *::selection { background: none; }
    & table blockquote { font-size: inherit; line-height: inherit; margin-block: 0 !important; padding: 0; }
    & table :is(h1, h2, h3, h4) { font-size: inherit; line-height: inherit; margin: 0; }

    /* Pictures and files */
    & figure { margin: 28px 0; }
    & figure.attachment { position: relative; inline-size: fit-content; max-inline-size: 100%; cursor: default; user-select: none; -webkit-user-select: none; }
    & .attachment--preview { inline-size: 100%; }
    & .attachment[data-align] { inline-size: fit-content; max-inline-size: 100%; margin-inline: auto; }
    & .attachment[data-align="right"] { margin-inline-end: 0; }
    & .attachment[data-sized] { inline-size: min(var(--shown), 100%); & img { inline-size: 100%; } }
    & :is(.attachment-gallery, .image-gallery) .attachment[data-sized] { inline-size: auto; }
    & .attachment__container { display: block; }
    & .attachment--preview > img, & .attachment__container img { display: block; max-inline-size: 100%; block-size: auto; background: var(--wash); border-radius: 2px; }
    & figcaption { font-size: var(--ui); line-height: 24px; color: var(--quiet); margin-block-start: 8px; white-space: pre-wrap; }
    & .lexxy-fake-selection { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
    & figcaption[data-placeholder] .attachment__caption-text { font-size: 0; &::before { content: "Add a caption"; font-size: var(--ui); } }
    & figcaption[data-placeholder] { opacity: .0; transition: opacity 120ms; }
    & figure:is(:hover, .node--selected, :focus-within) figcaption[data-placeholder] { opacity: 1; }
    [data-mode="viewing"] & figcaption[data-placeholder] { display: none; }
    & .attachment__caption--editing .attachment__caption-text { visibility: hidden; }
    & :is(.node--selected, .within) { outline: 2px solid var(--hue-line); outline-offset: 4px; border-radius: 1px; }
    & .attachment--preview:is(.node--selected, .within) { outline: 0; & img { outline: 2px solid var(--hue-line); outline-offset: 3px; border-radius: 0; } }
    & .attachment--file { display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 12px; background: var(--wash); border-radius: 2px; margin-block: 18px; & figcaption { margin: 0; display: flex; gap: 12px; color: var(--ink); } & strong { font-weight: 550; } & .attachment__size { color: var(--quiet); } }
    & .attachment__icon { display: grid; place-items: center; min-inline-size: 46px; block-size: 40px; padding-inline: 8px; background: var(--page); border-radius: 2px; font-size: var(--small); font-weight: 650; text-transform: uppercase; }
    & .attachment:has(> progress) { min-inline-size: 220px; min-block-size: 40px; }
    & .attachment > progress { position: absolute; inset-inline: 0; inset-block-end: -6px; inline-size: 100%; block-size: 4px; appearance: none; border: 0; background: var(--wash-deep); &::-webkit-progress-bar { background: var(--wash-deep); } &::-webkit-progress-value { background: var(--hue-line); transition: inline-size 120ms; } &::-moz-progress-bar { background: var(--hue-line); } }
    & .attachment--picture { flex-direction: column; align-items: start; gap: 8px; padding: 0 0 16px; & img { display: block; max-inline-size: 100%; block-size: auto; border-radius: 2px; } & figcaption, & .attachment__said { padding-inline: 12px; } }
    & figure.attachment.attachment--coming { box-sizing: border-box; inline-size: min(var(--own), 100%); aspect-ratio: var(--ratio); margin-block: 28px calc(28px + var(--ui-line) + 16px); align-items: end; padding: 12px; }
    & .attachment[data-waiting] { & .attachment__name + .attachment__size { margin-inline-start: 12px; } & img { opacity: .8; } & > progress { display: none; } & .attachment__said { color: var(--ink); font-size: var(--ui); line-height: var(--ui-line); } }
    & .attachment__said:empty { display: none; }
    & .attachment--error { padding: 12px 18px; background: var(--wash); color: var(--madder); border-radius: 2px; & button { margin-inline-start: 14px; } }
    & .attachment:not(.attachment--file, .attachment--error) img:not([src]) { min-block-size: 120px; inline-size: 100%; }
    & figure:is([data-failed], [data-loading]) {
      &::before { content: "The picture is on its way\2026"; position: absolute; z-index: 1; inset: 0 0 auto; padding: 22px 28px; font: 400 var(--ui)/var(--ui-line) var(--family); color: var(--quiet); pointer-events: none; }
    }
    & figure[data-failed] {
      inline-size: 100%; cursor: pointer;
      & .attachment__container { background: var(--wash); border-inline-start: 3px solid var(--madder); inline-size: min(100%, var(--wide, 100%)); }
      & img { inline-size: min(100%, var(--wide, 100%)); min-block-size: 120px; opacity: 0; }
      &::before { content: "This picture could not be loaded."; }
      &::after { content: "Try again"; position: absolute; z-index: 1; inset: 50px auto auto 28px; font: 600 var(--ui)/var(--ui-line) var(--family); color: var(--action); text-decoration: underline; text-underline-offset: .28em; pointer-events: none; }
      &[data-asking]::before { content: "Asking for it again\2026"; } &[data-asking]::after { content: none; }
      @media (forced-colors: active) { & .attachment__container { outline: 1px solid CanvasText; } }
    }
    & .attachment-gallery, & .image-gallery { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 28px; & figure { flex: 1 1 200px; margin: 0; min-inline-size: 0; } & img { inline-size: 100%; } }

    & figure.horizontal-divider { margin: 0; padding-block: 36px; inline-size: 100%; & hr { border: 0; border-block-start: 1px solid var(--rule); margin: 0; } &.node--selected { outline: 0; & hr { border-block-start: 2px solid var(--hue-line); margin-block-end: -1px; } } }
    & p.provisional-paragraph.hidden { block-size: 0; margin: 0; overflow: hidden; opacity: 0; }

    @media (max-width: 760px) {
      & h1 { font-size: 30px; line-height: 38px; margin-block-start: 48px; }
      & h2 { font-size: 24px; line-height: 32px; margin-block-start: 44px; }
      & blockquote { font-size: 23px; line-height: 33px; --line: 33px; padding-inline-end: 0; }
      & table { font-size: 15.5px; line-height: 23px; --line: 23px; }
      & :is(th, td) { padding-inline-end: 12px; }
    }
  }
  :root { --hue-line: var(--action); }
  [data-tinted] { --hue-line: color-mix(in oklab, var(--hue) 82%, var(--ink)); }

  /* The first paragraph, when it is short and a section follows it, belongs to the title (editor/lead.js). */
  .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) {
    margin-block: -16px 30px; font-size: 22px; line-height: 33px; text-wrap: pretty;
    [data-tinted] & { color: var(--on); caret-color: var(--on); background: var(--hue); box-shadow: 0 0 0 100vmax var(--hue); clip-path: inset(0 -100vmax -26px); margin-block: -44px 57px; --action: var(--on); --wash: #fff; --page: #fff; --ink: var(--on); --quiet: var(--on); }
    [data-tinted] &::selection, [data-tinted] & *::selection { background: #fff; color: var(--on); }
    @media (max-width: 760px) { text-wrap: wrap; font-size: 20px; line-height: 31px; [data-tinted] & { margin-block: -40px 48px; } body[data-hue="plain"] & { margin-block-start: -12px; } }
  }
  body[data-hue="plain"] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) { margin-block: -10px 30px; }

  .lexxy-editor--empty .manuscript > :is(p, h1, h2, h3, h4):only-child::after { content: "Write, or press / for everything else"; color: var(--quiet); position: absolute; inset: 0 auto auto 0; pointer-events: none; }
  .lexxy-editor--empty .manuscript > :is(p, h1, h2, h3, h4):only-child { position: relative; }
  [data-mode="viewing"] .lexxy-editor--empty .manuscript > :is(p, h1, h2, h3, h4):only-child::after { content: "Nothing is written here yet."; }
  [data-mode="viewing"] .manuscript { caret-color: transparent; }

  [data-tinted] .manuscript ::selection { background: var(--hue); color: var(--on); }
  [data-painted~="held"] ::highlight(held) { background-color: color-mix(in srgb, var(--action) 22%, transparent); }
  [data-painted~="held"] [data-tinted] ::highlight(held) { background-color: var(--hue); color: var(--on); }

  .lexxy-caption-editor { position: absolute; z-index: 3; border: 0; padding: 0; margin: 0; background: transparent; resize: none; outline: 0; overflow: hidden; border-block-end: 1.5px solid var(--quiet); &::placeholder { color: var(--quiet); opacity: 1; } }

  :root {
    --highlight-1: light-dark(#8a6500, #f2d01a); --highlight-2: light-dark(#a8480a, #f7a35c); --highlight-3: light-dark(#b4234f, #f38dab);
    --highlight-4: light-dark(#a3187e, #f58cd6); --highlight-5: light-dark(#6a35c9, #bb9ff7); --highlight-6: light-dark(#1d52c4, #86b4ff);
    --highlight-7: light-dark(#08745a, #5fc9a8); --highlight-8: light-dark(#7a5c3c, #d8b98f); --highlight-9: light-dark(#5f6384, #a0a4c8);
    --highlight-bg-1: light-dark(#fff0a3, #5b4d00); --highlight-bg-2: light-dark(#ffdfc2, #61360f); --highlight-bg-3: light-dark(#ffd3de, #642338);
    --highlight-bg-4: light-dark(#ffd3f2, #5d1f4c); --highlight-bg-5: light-dark(#e6dbff, #402a70); --highlight-bg-6: light-dark(#d5e4ff, #1f3a70);
    --highlight-bg-7: light-dark(#c9f2e2, #0f4a3a); --highlight-bg-8: light-dark(#f0e4d2, #4d3d2a); --highlight-bg-9: light-dark(#e4e5f0, #353a5c);
  }
  @media print { .layer, .outline, .strip, .foot { display: none; } }
}
@layer components { .sizing-corner::before { content: ""; position: absolute; inset: -6px; @media (pointer: coarse) { inset: -16px; } } }

/* The parting of the lines. A float stands before the text, as wide as the line and empty but for a band where the lines part:
   only the lines that reach the band move. The band and what opens grow together. */
@layer components {
  [data-parted] { --part-move: var(--part) var(--ease); }
  [data-parted="inside"]::before { content: ""; float: left; inline-size: 100%; block-size: calc(var(--part-at) + var(--part-gap, 0px)); margin-inline: 0; shape-outside: inset(var(--part-at) 0 0 0); transition: block-size var(--part-move); pointer-events: none; }
  [data-parted="end"] { padding-block-end: var(--part-gap, 0px) !important; transition: padding-block-end var(--part-move); }
  [data-parted="after"] { border-block-end: var(--part-gap, 0px) solid transparent; background-clip: padding-box !important; transition: border-block-end-width var(--part-move); }
  li[data-parted="inside"]::before { inline-size: 100%; }

  .layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; & > * { pointer-events: auto; } }

  .parting {
    --part-around: 22px;
    position: absolute; inset-block-start: var(--y); inset-inline: calc(var(--bleed) * -1); block-size: var(--height, 0px); overflow: clip; overflow-clip-margin: 0; transition: block-size var(--part) var(--ease);
    font: 400 var(--ui)/var(--ui-line) var(--family); letter-spacing: 0;
    @media (max-width: 660px) { inset-inline: -20px; }
  }
  .parting-body {
    position: relative; margin-block: 12px 10px; padding: 18px var(--bleed) 16px; background: var(--wash); color: var(--ink);
    &::before { content: ""; position: absolute; inset-block-start: -9px; left: clamp(10px, calc(var(--notch, 40px) + var(--bleed) - 9px), calc(100% - 28px)); inline-size: 18px; block-size: 9.5px; background: inherit; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
    &:focus { outline: 0; }
    [data-tinted] & { color-scheme: light; background: var(--hue); }
    [data-tinted] & :focus-visible:not(.field) { outline-color: var(--on); }
    [data-tinted] & .field:focus { border-block-end-color: var(--on); box-shadow: 0 .5px var(--on); }
    @media (max-width: 760px) { padding-block: 16px 10px; }
    @media (forced-colors: active) { border: 1px solid CanvasText; }
    @media (prefers-contrast: more) { box-shadow: inset 0 0 0 1.5px currentColor; }
  }

  .passage-title { font-weight: 600; margin-block-end: 0; &:first-child { margin-block-start: 12px; } }
  .parting-body .field:focus { box-shadow: 0 .5px var(--action); }
  .passage .field { font-size: var(--body); line-height: 28px; color: var(--ink); }
  .passage > .field:first-of-type:not(.passage-title + *, .find *, [data-words] ~ *) { margin-block-start: 12px; }
  .passage [data-words][hidden] + .field { margin-block-start: 12px; }
  .passage [data-words] { margin-block-end: 8px; }
  .passage-error { color: var(--madder); margin-block-start: 6px; font-weight: 550; }
  [data-tinted] .passage-error { background: #fff; padding: 0 5px; inline-size: fit-content; }
  .passage-foot { display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px; margin-block-start: 8px; & > .push { margin-inline-start: auto; } & label.word { cursor: pointer; &:focus-within { outline: 2px solid currentColor; outline-offset: -3px; } } }
  .styles { display: grid; row-gap: 2px; & .words + .words { border-block-start: 1px solid color-mix(in srgb, currentColor 30%, transparent); padding-block-start: 4px; margin-block-start: 4px; } & [aria-checked="true"], & [aria-pressed="true"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .25em; color: var(--ink); } }
  .parting-body .word:not(.act) { color: var(--ink); &:hover { text-decoration: underline; text-underline-offset: .25em; } }

  #unsaved textarea { inline-size: 100%; margin-block-start: 12px; font-size: var(--ui); line-height: var(--ui-line); resize: vertical; }
  .commands-field { font-size: var(--body); line-height: 28px; margin-block-end: 12px; color: var(--ink); }
  .commands-top { display: flex; align-items: baseline; gap: 18px; }
  .commands-close { display: none; @media (pointer: coarse), (max-width: 760px) { display: inline-flex; } }
  .commands-list { columns: 3; column-gap: 24px; @media (max-width: 760px) { columns: auto; } }
  .commands-group { break-inside: avoid; padding-block-end: 14px; &.none { display: none; } & > p { color: var(--quiet); font-size: var(--small); line-height: 24px; } }
  .commands [role="option"] {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; min-block-size: 28px; padding: 2px 6px; margin-inline: -6px; border-radius: 2px; cursor: pointer; scroll-margin: 90px; break-inside: avoid;
    & kbd { font-size: var(--small); white-space: nowrap; color: var(--quiet); }
    & span { overflow: hidden; text-overflow: ellipsis; }
    &[aria-selected="true"] { background: var(--ink); color: var(--page); & :is(kbd, span) { color: inherit; } }
    &[aria-disabled="true"] { opacity: .5; cursor: default; }
    &:is([aria-checked="true"], [aria-checked="mixed"]) > span { font-weight: 650; &::after { content: "\00A0\2713" / ""; } }
    &[aria-checked="mixed"] > span::after { content: "\00A0\2013" / ""; }
    @media (max-width: 760px) { min-block-size: 44px; & kbd { display: none; } }
  }
  .commands-none, .commands-keys { color: var(--quiet); }
  .commands-keys { font-size: var(--small); margin-block-start: 10px; @media (hover: none) { display: none; } }
  .slash .commands-list { columns: 2; @media (max-width: 760px) { columns: auto; max-block-size: 46vh; overflow: auto; padding-inline: 6px; margin-inline: -6px; } }

  .inks-row .word[aria-pressed="true"] { font-weight: 650; }
  .styles-close { display: none; @media (pointer: coarse) { display: flex; justify-content: flex-end; } }
  @media (max-width: 360px) { .passage .field { font-size: 16px; } }
  .inks { display: grid; row-gap: 8px; }
  .inks-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; & > span { inline-size: 76px; } & .word { margin-inline-start: 4px; } @media (max-width: 760px) { display: grid; grid-template-columns: repeat(5, 44px); gap: 4px; & > span { grid-column: 1 / -1; inline-size: auto; color: var(--quiet); } & .word { margin: 0; padding: 0; justify-content: center; } } }
  .ink {
    inline-size: 28px; block-size: 28px; border-radius: 2px; display: grid; place-items: center; font-weight: 650; background: #fff; border: 1.5px solid transparent; color: var(--on); position: relative; forced-color-adjust: none;
    [data-tinted] & { border-color: var(--on); }
    :root:not(:has([data-tinted])) & { border-color: var(--rule); }
    &[aria-pressed="true"]::after { content: ""; position: absolute; inset-inline-start: 8px; inset-block-start: 3px; inline-size: 7px; block-size: 13px; border: solid var(--on); border-width: 0 2.5px 2.5px 0; rotate: 42deg; }
    &:hover { box-shadow: 0 0 0 2px currentColor; }
    @media (max-width: 760px) { inline-size: 44px; block-size: 44px; &[aria-pressed="true"]::after { inset-inline-start: 15px; inset-block-start: 10px; } }
  }
  .ink[data-property="color"] {
    color-scheme: light; background: #fff;
    &[data-ink="1"] { color: var(--highlight-1); } &[data-ink="2"] { color: var(--highlight-2); } &[data-ink="3"] { color: var(--highlight-3); } &[data-ink="4"] { color: var(--highlight-4); } &[data-ink="5"] { color: var(--highlight-5); }
    &[data-ink="6"] { color: var(--highlight-6); } &[data-ink="7"] { color: var(--highlight-7); } &[data-ink="8"] { color: var(--highlight-8); } &[data-ink="9"] { color: var(--highlight-9); }
  }
  .ink[data-property="background-color"] {
    color-scheme: light;
    &[data-ink="1"] { background: var(--highlight-bg-1); } &[data-ink="2"] { background: var(--highlight-bg-2); } &[data-ink="3"] { background: var(--highlight-bg-3); } &[data-ink="4"] { background: var(--highlight-bg-4); } &[data-ink="5"] { background: var(--highlight-bg-5); }
    &[data-ink="6"] { background: var(--highlight-bg-6); } &[data-ink="7"] { background: var(--highlight-bg-7); } &[data-ink="8"] { background: var(--highlight-bg-8); } &[data-ink="9"] { background: var(--highlight-bg-9); }
  }

  .sizes { display: grid; gap: 4px; inline-size: fit-content; margin-block: 8px; & > div { display: flex; gap: 4px; } & span { inline-size: 26px; block-size: 20px; border: 1.5px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 2px; cursor: pointer; &[data-on] { background: var(--ink); border-color: var(--ink); } } @media (max-width: 760px) { inline-size: 100%; gap: 2px; & > div { gap: 2px; } & span { flex: 1; inline-size: auto; min-inline-size: 0; block-size: 44px; &[data-column="8"] { display: none; } } } }

  .bubble {
    position: absolute; z-index: 12; left: var(--x); top: var(--y); display: flex; block-size: 36px; padding-inline: 4px; border-radius: 2px; background: var(--ink); color: var(--page); font: 400 var(--ui)/var(--ui-line) var(--family); white-space: nowrap;
    &::after { content: ""; position: absolute; top: calc(100% - .5px); left: clamp(8px, calc(var(--tip) - 7px), calc(100% - 22px)); inline-size: 14px; block-size: 7px; background: inherit; clip-path: polygon(0 0, 100% 0, 50% 100%); }
    &[data-below]::after { top: auto; bottom: calc(100% - .5px); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
    & button { position: relative; padding-inline: 11px; block-size: 100%; display: inline-flex; align-items: center; &:hover { background: color-mix(in srgb, var(--page) 16%, transparent); } &[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 5px; } &[aria-pressed="true"] { text-decoration-thickness: 2px; } &:active { opacity: .7; } &:focus-visible { outline: 2px solid var(--page); outline-offset: -4px; } }
    & .bold { font-weight: 700; } & .italic { font-style: italic; }
    &[data-over]::after { content: none; }
    &[data-aside] { flex-wrap: wrap; inline-size: 232px; block-size: auto; & button { block-size: 36px; } }
    &[data-through] { pointer-events: none; opacity: .35; }
    @media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
      &[data-of="words"] { display: none; }
      position: fixed; align-items: center; z-index: 26; inset: auto 0 var(--keyboard, 0px); block-size: 48px; padding-inline: 8px; border-radius: 0; background: var(--page); color: var(--ink); border-block-start: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; justify-content: space-between; padding-inline-end: 28px; mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
      &::after { content: none; } & button { flex: none; min-inline-size: 44px; }
    }
    @media (forced-colors: active) { border: 1px solid CanvasText; }
  }
  .tip {
    position: fixed; z-index: 40; left: var(--x); top: var(--y); padding: 1px 8px 3px; background: var(--ink); color: var(--page); border-radius: 2px; font: 400 var(--small)/20px var(--family); white-space: nowrap; pointer-events: none !important; animation: tell 120ms both;
    & kbd { font: inherit; opacity: .8; margin-inline-start: 8px; }
    @media (forced-colors: active) { border: 1px solid CanvasText; }
  }
  @keyframes tell { from { opacity: 0; } }

  .sizing { position: absolute; left: var(--x); top: var(--y); inline-size: var(--w); block-size: var(--h); pointer-events: none !important; }
  .sizing-corner {
    position: absolute; inline-size: 12px; block-size: 12px; padding: 0; background: var(--page); border: 2px solid var(--hue-line); border-radius: 2px; pointer-events: auto; touch-action: none;
    &::after { content: ""; position: absolute; inset: -8px; }
    &[data-corner="nw"] { left: -7px; top: -7px; cursor: nwse-resize; } &[data-corner="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
    &[data-corner="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; } &[data-corner="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }
  }
  .sizing-said { position: absolute; right: 10px; bottom: 10px; padding: 1px 8px 3px; background: var(--ink); color: var(--page); border-radius: 2px; font: 400 var(--small)/20px var(--family); font-feature-settings: "tnum"; white-space: nowrap; }
  body:is([data-sizing], [data-dragging]) .bubble { visibility: hidden; }
  .column-guide { position: absolute; left: var(--x); top: var(--y); inline-size: 2px; block-size: var(--height); background: var(--hue-line); translate: -1px; pointer-events: none !important; }
  .drop-mark { position: absolute; inset-inline: 0; inset-block-start: var(--y); block-size: 3px; translate: 0 -1.5px; background: var(--hue-line); border-radius: 2px; pointer-events: none !important; }

  .outline {
    position: absolute; z-index: 3; inset-block: 0 40vh; right: calc(100% + 72px); inline-size: 190px; line-height: 22px; text-align: end; pointer-events: none; transition: opacity 240ms;
    & ol { block-size: 100%; display: flex; flex-direction: column; }
    & li { position: sticky; flex: none; block-size: 26px; inset-block-start: calc(var(--strip) + 40px + var(--i) * 26px); inset-block-end: calc(var(--foot) + 12px + var(--j) * 26px); }
    & .outline-space { position: static; flex: none; block-size: var(--h); }
    & a { display: block; inline-size: fit-content; max-inline-size: 100%; margin-inline-start: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--paper); color: var(--quiet); text-decoration: none; pointer-events: auto; &:hover, &[aria-current] { color: var(--ink); } &[aria-current] { font-weight: 650; } padding-inline-end: calc(var(--level) * 12px); &[data-under] { font-size: var(--small); } }
    &[data-long] ol { position: sticky; inset-block-start: calc(var(--strip) + 24px); display: block; block-size: auto; max-block-size: calc(100vh - var(--strip) - var(--foot) - 48px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; pointer-events: auto; }
    &[data-long] li { position: static; &.outline-space { display: none; } }
    [data-receded] & { opacity: 0; }
    @media (max-width: 1180px) { display: none; }
  }

  body:has(.parting[data-open]) .tools { visibility: hidden; }
  .tools { position: absolute; z-index: 4; left: var(--x); top: var(--y); display: flex; gap: 2px; font: 400 var(--small)/20px var(--family); background: var(--paper); translate: -100% -100%; padding-inline: 4px; & .word { margin: 0; min-block-size: 24px; padding-inline: 6px; } @media (max-width: 760px) { & .word { min-block-size: 44px; } } }
}

/* Inside the title's colour: a piece of page. What is long parts the colour from edge to edge, in a frame of it. */
[data-tinted] .parting[data-lead] .parting-body {
  color-scheme: inherit; --page: var(--paper); --ink: var(--paper-ink); --quiet: var(--paper-quiet); --action: var(--paper-action); --on-action: var(--paper); --rule: var(--paper-rule); --wash: var(--paper-wash); --wash-deep: var(--paper-wash-deep);
  background: var(--paper); color: var(--ink); caret-color: var(--ink);
  & ::selection { background: var(--hue); color: var(--on); }
  & :focus-visible:not(.field) { outline-color: var(--action); } & .field:focus { border-block-end-color: var(--action); box-shadow: 0 .5px var(--action); }
  & .act { color: var(--action); }
  & .word:not(.act) { color: var(--quiet); &:hover { color: var(--ink); } }
  &.parting-body :is(.who, .choice-change ins, .mention) { background: none; padding: 0; color: var(--who, var(--ink)); color-scheme: inherit; } & .who:not([data-ink]), & .mention { color: var(--ink); } & .choice-change del { color: var(--quiet); text-decoration-color: currentColor; }
}
[data-tinted] .parting[data-lead]:has(.commands) { background: var(--paper); box-shadow: 0 0 0 100vmax var(--paper); clip-path: inset(0 -100vmax); z-index: 1; & .parting-body { box-shadow: inset 0 0 0 8px var(--hue); padding-block: 26px 22px; &::before { background: var(--hue); } } }

/* Sentences about people, and the few settings there are. */
@layer components {
  .rows { font-size: 18px; line-height: 28px; & li { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; padding-block: 10px; border-block-end: 1px solid var(--rule); } }
  .row-who { flex: 1 1 200px; min-inline-size: 0; overflow-wrap: anywhere; & small { display: block; font-size: var(--small); line-height: 20px; color: var(--quiet); } & b, & a { font-weight: 600; } & a { text-decoration: none; &:hover { text-decoration: underline; } } }
  .row-role, .rows li > form { font-size: 18px; }
  .row-end .word { font-size: var(--ui); }
  .row-end { display: flex; align-items: center; gap: 14px; margin-inline-start: auto; & form { display: flex; align-items: center; gap: 14px; } }
  @media (max-width: 760px) { .row-end { flex-basis: 100%; padding-inline-start: 50px; gap: 24px; } }
  .people { padding-block: 28px 120px; }
  body[data-hue="plain"] .people { padding-block-start: 8px; }

  .setting code { background: none; padding-inline: 0; }
  .setting { border-block-start: 1px solid var(--rule); padding-block: 22px 26px; & > h2 { position: static !important; padding: 0 !important; font-size: 22px !important; line-height: 30px !important; font-weight: 550 !important; color: var(--ink) !important; margin-block-end: 8px; } & p { font-size: 18px; line-height: 28px; text-wrap: pretty; max-inline-size: var(--measure); } & + .setting { margin-block-start: 0 !important; } }
  .index > p.lead { font-size: 18px; line-height: 28px; color: var(--quiet); margin-block: 4px 26px; max-inline-size: var(--measure); overflow-wrap: anywhere; }
  .line { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 20px; & > div { flex: 1 1 240px; min-inline-size: 0; } & .field { font-size: 22px; line-height: 32px; } }
  .picture { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; & .avatar { inline-size: 72px; block-size: 72px; font-size: 26px; } & form { flex: 1 1 260px; min-inline-size: 0; } }
  input[type="file"] { max-inline-size: 100%; min-block-size: var(--touch); color: var(--quiet); margin-block-start: 4px; &::file-selector-button { font: inherit; font-weight: 600; color: var(--action); background: none; border: 1.5px solid var(--quiet); border-radius: 2px; padding: 5px 12px 6px; margin-inline-end: 12px; cursor: pointer; } }
  .key { background: var(--wash); padding: 14px 20px 16px; margin-block: 8px 12px; & p + p { margin-block-start: 6px; } }
  .key.fresh { background: var(--house); color: var(--on); --quiet: var(--on); & code { background: #fff; color: var(--on); box-decoration-break: clone; -webkit-box-decoration-break: clone; } }
  .agents-new { margin-block-end: 30px; }
}

/* Who is here. Each person has an ink, told apart with any colour vision, and 4.5 to 1 on the page, on a sheet and on the white a name has on a document's colour: the tenth person has
   the first ink again, in dashes. An agent's marks are doubled, a guest's are dotted. */
:root {
  --who-madder: light-dark(#c23870, #ed8b86); --who-viridian: light-dark(#146d34, #75fb99); --who-indigo: light-dark(#232ea0, #7480fa);
  --who-umber: light-dark(#643400, #e56022); --who-teal: light-dark(#0573aa, #71d0d3); --who-plum: light-dark(#8e0f6d, #bc71ab); --who-clay: light-dark(#9f5c52, #f4c3b7); --who-olive: light-dark(#5f7601, #bcd939); --who-pine: light-dark(#134e48, #78b0a6); --who-violet: light-dark(#6a35c9, #bb9ff7);
}
[data-ink="madder"] { --who: var(--who-madder); } [data-ink="viridian"] { --who: var(--who-viridian); } [data-ink="indigo"] { --who: var(--who-indigo); } [data-ink="umber"] { --who: var(--who-umber); }
[data-ink="teal"] { --who: var(--who-teal); } [data-ink="plum"] { --who: var(--who-plum); } [data-ink="clay"] { --who: var(--who-clay); } [data-ink="olive"] { --who: var(--who-olive); } [data-ink="pine"] { --who: var(--who-pine); } [data-ink="violet"] { --who: var(--who-violet); }

@layer components {
  .presence { position: absolute; inset: 0; pointer-events: none !important; z-index: 5; }

  .caret {
    position: absolute; left: -1px; top: 0; translate: var(--x) var(--y); block-size: var(--h); inline-size: 2px; background: var(--who); box-shadow: 0 0 0 1px var(--paper); transition: opacity 240ms;
    &[data-travel] { transition: translate var(--time) var(--ease), opacity 240ms; }
    &[data-dashed] { background: repeating-linear-gradient(var(--who) 0 5px, transparent 5px 8px); }
    &[data-agent] { inline-size: 6px; left: -3px; background: none; border-inline: 2px solid var(--who); box-shadow: none; }
    &[data-away] { opacity: .55; }
    &[data-hidden] { opacity: 0; }

    /* The name, as an attribute: there is no text here for a deletion beside it to take in. */
    & i {
      position: absolute; left: var(--shift, 0); bottom: calc(100% - 6px); padding: 0 3px 0 1px; background: color-mix(in srgb, var(--paper) 90%, transparent); color: var(--who); font: 600 11.5px/13px var(--family); inline-size: max-content; max-inline-size: min(520px, 100vw - 24px); overflow-wrap: anywhere; transition: opacity 400ms;
      &::before { content: attr(data-name); }
    }
    & s { display: none; position: absolute; left: var(--left); top: var(--top); inline-size: var(--width); block-size: var(--height); background: color-mix(in srgb, var(--who) 16%, transparent); box-shadow: inset 0 0 0 1.5px var(--who); }
    &[data-cells] { background: none; box-shadow: none; & s { display: block; } }
    &[data-agent] i { font-style: italic; }
    &[data-under] i { bottom: auto; top: calc(100% - 1px); }
    &[data-right] i { left: auto; right: 0; }
    &[data-rest]:not([data-pointed]) i { opacity: 0; }
    &[data-pointed] i { transition-duration: 80ms; }
    @media (prefers-reduced-motion: reduce) { &, &[data-travel], & i { transition: none; } }
    @media (forced-colors: active) { background: CanvasText; & i { background: Canvas; color: CanvasText; } }
  }

  .here {
    display: flex; gap: 10px; align-items: center; min-block-size: var(--touch);
    & .who { position: relative; color: var(--who); font-weight: 600; line-height: 20px; white-space: nowrap; border-block-end: 1.5px solid currentColor; &::before { content: attr(data-name); } }
    & .who::after { content: ""; position: absolute; inset: -6px -5px; }
    & .who[data-dashed] { border-block-end-style: dashed; }
    & .who[data-guest] { border-block-end: 2px dotted; }
    & .who[data-agent] { border-block-end: 4px double; font-style: italic; }
    & .who[data-agent]::before { content: attr(data-name) "\0000a0agent"; @media (max-width: 760px) { content: attr(data-name); } } /* on a phone the double rule and the slant say it */
    & .who[data-away] { font-weight: 400; border-block-end-color: transparent; }
    & .who[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--who); border-radius: 2px; }
    & .who:focus-visible { outline-offset: 3px; }
    & .here-more { color: var(--quiet); border-block-end-color: transparent; }
    @media (max-width: 760px) { gap: 8px; & .who::after { inset: -12px -5px; } }
  }
  /* On the document's colour an ink stands on white. */
  [data-tinted] .strip .here { gap: 8px; color-scheme: light; & .who { background: #fff; padding: 0 5px 1px; border-radius: 2px; line-height: 22px; } & .who[data-agent] { line-height: 20px; } & .here-more { color: var(--on); } & .who[data-away] { background: color-mix(in srgb, #fff 72%, var(--hue)); color: color-mix(in srgb, var(--who) 70%, var(--on)); } & .who[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--on); } }

  .here-list {
    font-size: 18px; line-height: 28px; margin-block-start: 8px;
    & li { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 20px; padding-block: 5px; overflow-wrap: anywhere; & > span { min-inline-size: 0; } & .word { flex: none; } }
    & .who-name { color: var(--who); font-weight: 600; }
    & [data-agent] { border-block-end: 4px double; font-style: italic; } & [data-guest] { border-block-end: 2px dotted; } & [data-dashed] { border-block-end: 1.5px dashed; }
  }

  /* Those out of view, by name, at the edge of the column they are beyond */
  .edges {
    position: fixed; z-index: 15; inset-inline: 0; display: flex; gap: 4px 10px; pointer-events: none; transition: opacity 240ms;
    &[data-edge="top"] { inset-block-start: calc(var(--strip) + 14px); } &[data-edge="bottom"] { inset-block-end: calc(var(--foot) + 6px); }
    & button { pointer-events: auto; background: var(--paper); padding: 0 8px; min-block-size: var(--touch); font-size: var(--small); font-weight: 600; color: var(--who); max-inline-size: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; &::before { content: attr(data-name); } &:hover::before { text-decoration: underline; text-underline-offset: 3px; } }
    & [data-agent]::before { font-style: italic; border-block-end: 3px double; } & [data-guest]::before { border-block-end: 2px dotted; } & [data-dashed]::before { border-block-end: 1.5px dashed; } & [data-away] { font-weight: 400; }
    & .here-more { color: var(--quiet); }
    [data-receded] & { opacity: 0; & button { pointer-events: none; } }
    @media (min-width: 1101px) { padding-inline-start: calc(50% + var(--measure) / 2 + var(--bleed) + 16px); }
    @media (max-width: 1100px) { justify-content: flex-end; padding-inline: 12px; &:not(:empty) { inset-block: auto; } &[data-edge="top"]:not(:empty) { inset-block-start: var(--strip); } &[data-edge="bottom"]:not(:empty) { inset-block-end: var(--foot); } & button { box-shadow: 0 0 0 1px var(--wash-deep); border-radius: 2px; } }
    @media (max-width: 760px) { &:not(:empty) { background: var(--paper); } & button { min-inline-size: 44px; box-shadow: none; } body:has(.parting) &, [data-typing] & { visibility: hidden; } }
    @media (prefers-reduced-motion: reduce) { transition: none; }
    @media (forced-colors: active) { & button { color: ButtonText; } }
  }

  .foot-following { display: flex; align-items: center; gap: 14px; color: var(--ink); white-space: nowrap; & [data-whom] { overflow: hidden; text-overflow: ellipsis; max-inline-size: 22em; } }
  @media (max-width: 760px) { .foot-writing:has(.foot-following:not([hidden])) { grid-template-columns: 1fr; & .foot-modes, & .foot-end, & .foot-said { display: none; } & .foot-middle { display: block; } & .foot-following { justify-content: space-between; } } }
}

[data-painted~="unwritten"] ::highlight(unwritten) { color: transparent; text-decoration: none; }
[data-painted~="who-madder"] ::highlight(who-madder) { background-color: color-mix(in srgb, var(--who-madder) 22%, transparent); } [data-painted~="who-viridian"] ::highlight(who-viridian) { background-color: color-mix(in srgb, var(--who-viridian) 22%, transparent); }
[data-painted~="who-indigo"] ::highlight(who-indigo) { background-color: color-mix(in srgb, var(--who-indigo) 22%, transparent); } [data-painted~="who-umber"] ::highlight(who-umber) { background-color: color-mix(in srgb, var(--who-umber) 22%, transparent); }
[data-painted~="who-teal"] ::highlight(who-teal) { background-color: color-mix(in srgb, var(--who-teal) 22%, transparent); } [data-painted~="who-plum"] ::highlight(who-plum) { background-color: color-mix(in srgb, var(--who-plum) 22%, transparent); } [data-painted~="who-clay"] ::highlight(who-clay) { background-color: color-mix(in srgb, var(--who-clay) 22%, transparent); } [data-painted~="who-olive"] ::highlight(who-olive) { background-color: color-mix(in srgb, var(--who-olive) 22%, transparent); } [data-painted~="who-pine"] ::highlight(who-pine) { background-color: color-mix(in srgb, var(--who-pine) 22%, transparent); } [data-painted~="who-violet"] ::highlight(who-violet) { background-color: color-mix(in srgb, var(--who-violet) 22%, transparent); }

/* A typesetter's proof: conversations underlined, words struck and written in, each in its author's ink. Nothing here is in the text. */
:root {
  /* A suggestion has the colour its author has at their caret (presence.css). */
  --ink-madder: var(--who-madder); --ink-viridian: var(--who-viridian); --ink-indigo: var(--who-indigo); --ink-umber: var(--who-umber); --ink-teal: var(--who-teal); --ink-plum: var(--who-plum); --ink-clay: var(--who-clay); --ink-olive: var(--who-olive); --ink-pine: var(--who-pine); --ink-violet: var(--who-violet);
}

@layer components {
  [data-painted~="said-madder"] ::highlight(said-madder) { text-decoration: underline var(--ink-madder) 1px; text-underline-offset: 5px; }
  [data-painted~="said-viridian"] ::highlight(said-viridian) { text-decoration: underline var(--ink-viridian) 1px; text-underline-offset: 5px; }
  [data-painted~="said-indigo"] ::highlight(said-indigo) { text-decoration: underline var(--ink-indigo) 1px; text-underline-offset: 5px; }
  [data-painted~="said-umber"] ::highlight(said-umber) { text-decoration: underline var(--ink-umber) 1px; text-underline-offset: 5px; }
  [data-painted~="said-teal"] ::highlight(said-teal) { text-decoration: underline var(--ink-teal) 1px; text-underline-offset: 5px; }
  [data-painted~="said-plum"] ::highlight(said-plum) { text-decoration: underline var(--ink-plum) 1px; text-underline-offset: 5px; }
  [data-painted~="said-clay"] ::highlight(said-clay) { text-decoration: underline var(--ink-clay) 1px; text-underline-offset: 5px; }
  [data-painted~="said-olive"] ::highlight(said-olive) { text-decoration: underline var(--ink-olive) 1px; text-underline-offset: 5px; }
  [data-painted~="said-pine"] ::highlight(said-pine) { text-decoration: underline var(--ink-pine) 1px; text-underline-offset: 5px; }
  [data-painted~="said-violet"] ::highlight(said-violet) { text-decoration: underline double var(--ink-violet) 1px; text-underline-offset: 5px; }

  [data-painted~="cut-madder"] ::highlight(cut-madder) { color: var(--paper-quiet); text-decoration: line-through var(--ink-madder) 1.5px; }
  [data-painted~="cut-viridian"] ::highlight(cut-viridian) { color: var(--paper-quiet); text-decoration: line-through var(--ink-viridian) 1.5px; }
  [data-painted~="cut-indigo"] ::highlight(cut-indigo) { color: var(--paper-quiet); text-decoration: line-through var(--ink-indigo) 1.5px; }
  [data-painted~="cut-umber"] ::highlight(cut-umber) { color: var(--paper-quiet); text-decoration: line-through var(--ink-umber) 1.5px; }
  [data-painted~="cut-teal"] ::highlight(cut-teal) { color: var(--paper-quiet); text-decoration: line-through var(--ink-teal) 1.5px; }
  [data-painted~="cut-plum"] ::highlight(cut-plum) { color: var(--paper-quiet); text-decoration: line-through var(--ink-plum) 1.5px; }
  [data-painted~="cut-clay"] ::highlight(cut-clay) { color: var(--paper-quiet); text-decoration: line-through var(--ink-clay) 1.5px; }
  [data-painted~="cut-olive"] ::highlight(cut-olive) { color: var(--paper-quiet); text-decoration: line-through var(--ink-olive) 1.5px; }
  [data-painted~="cut-pine"] ::highlight(cut-pine) { color: var(--paper-quiet); text-decoration: line-through var(--ink-pine) 1.5px; }
  [data-painted~="cut-violet"] ::highlight(cut-violet) { color: var(--paper-quiet); text-decoration: line-through double var(--ink-violet) 1px; }

  [data-painted~="strike-madder"] ::highlight(strike-madder) { text-decoration: line-through var(--ink-madder) 1.5px; }
  [data-painted~="strike-viridian"] ::highlight(strike-viridian) { text-decoration: line-through var(--ink-viridian) 1.5px; }
  [data-painted~="strike-indigo"] ::highlight(strike-indigo) { text-decoration: line-through var(--ink-indigo) 1.5px; }
  [data-painted~="strike-umber"] ::highlight(strike-umber) { text-decoration: line-through var(--ink-umber) 1.5px; }
  [data-painted~="strike-teal"] ::highlight(strike-teal) { text-decoration: line-through var(--ink-teal) 1.5px; }
  [data-painted~="strike-plum"] ::highlight(strike-plum) { text-decoration: line-through var(--ink-plum) 1.5px; }
  [data-painted~="strike-clay"] ::highlight(strike-clay) { text-decoration: line-through var(--ink-clay) 1.5px; }
  [data-painted~="strike-olive"] ::highlight(strike-olive) { text-decoration: line-through var(--ink-olive) 1.5px; }
  [data-painted~="strike-pine"] ::highlight(strike-pine) { text-decoration: line-through var(--ink-pine) 1.5px; }
  [data-painted~="strike-violet"] ::highlight(strike-violet) { text-decoration: line-through var(--ink-violet) 1.5px; }

  [data-painted~="under-madder"] ::highlight(under-madder) { text-decoration: line-through var(--ink-madder) 5px; }
  [data-painted~="under-viridian"] ::highlight(under-viridian) { text-decoration: line-through var(--ink-viridian) 5px; }
  [data-painted~="under-indigo"] ::highlight(under-indigo) { text-decoration: line-through var(--ink-indigo) 5px; }
  [data-painted~="under-umber"] ::highlight(under-umber) { text-decoration: line-through var(--ink-umber) 5px; }
  [data-painted~="under-teal"] ::highlight(under-teal) { text-decoration: line-through var(--ink-teal) 5px; }
  [data-painted~="under-plum"] ::highlight(under-plum) { text-decoration: line-through var(--ink-plum) 5px; }
  [data-painted~="under-clay"] ::highlight(under-clay) { text-decoration: line-through var(--ink-clay) 5px; }
  [data-painted~="under-olive"] ::highlight(under-olive) { text-decoration: line-through var(--ink-olive) 5px; }
  [data-painted~="under-pine"] ::highlight(under-pine) { text-decoration: line-through var(--ink-pine) 5px; }
  [data-painted~="under-violet"] ::highlight(under-violet) { text-decoration: line-through var(--ink-violet) 5px; }

  [data-painted~="dress-madder"] ::highlight(dress-madder) { text-decoration: underline wavy var(--ink-madder) 1px; text-underline-offset: 5px; }
  [data-painted~="dress-viridian"] ::highlight(dress-viridian) { text-decoration: underline wavy var(--ink-viridian) 1px; text-underline-offset: 5px; }
  [data-painted~="dress-indigo"] ::highlight(dress-indigo) { text-decoration: underline wavy var(--ink-indigo) 1px; text-underline-offset: 5px; }
  [data-painted~="dress-umber"] ::highlight(dress-umber) { text-decoration: underline wavy var(--ink-umber) 1px; text-underline-offset: 5px; }
  [data-painted~="dress-teal"] ::highlight(dress-teal) { text-decoration: underline wavy var(--ink-teal) 1px; text-underline-offset: 5px; }
  [data-painted~="dress-plum"] ::highlight(dress-plum) { text-decoration: underline wavy var(--ink-plum) 1px; text-underline-offset: 5px; }
  [data-painted~="dress-clay"] ::highlight(dress-clay) { text-decoration: underline wavy var(--ink-clay) 1px; text-underline-offset: 5px; }
  [data-painted~="dress-olive"] ::highlight(dress-olive) { text-decoration: underline wavy var(--ink-olive) 1px; text-underline-offset: 5px; }
  [data-painted~="dress-pine"] ::highlight(dress-pine) { text-decoration: underline wavy var(--ink-pine) 1px; text-underline-offset: 5px; }
  [data-painted~="dress-violet"] ::highlight(dress-violet) { text-decoration: underline wavy var(--ink-violet) 1px; text-underline-offset: 5px; }

  [data-painted~="again"] ::highlight(again) { background-color: color-mix(in srgb, var(--action) 22%, transparent); }
  @media print { [data-painted~="again"] ::highlight(again) { background: none; } }
  [data-painted~="active"] ::highlight(active) { background-color: color-mix(in srgb, var(--action) 18%, transparent); }
  [data-painted~="asking"] ::highlight(asking) { background-color: color-mix(in srgb, var(--action) 12%, transparent); text-decoration: underline dashed var(--action) 1.5px; text-underline-offset: 5px; }
  [data-painted~="active"] body[data-tinted] ::highlight(active), [data-painted~="asking"] body[data-tinted] ::highlight(asking) { background-color: var(--hue); color: var(--on); }

  [data-painted~="struck"] body[data-tinted] ::highlight(struck) { color: var(--on); text-decoration: line-through var(--on) 2px; }

  [data-tinted] .proof-notes i[data-lead] { color-scheme: light; background: #fff; }
  .proof-notes { position: absolute; inset: 0; pointer-events: none !important; & i { position: absolute; left: var(--x); top: var(--y); translate: 0 calc(-100% + 7px); padding: 0 3px; border-radius: 2px; background: var(--paper); color: var(--who); font: italic 550 11.5px/12px var(--family); white-space: nowrap; &[data-open] { translate: 0 calc(-100% + 5px); padding: 0 5px 1px; font-size: 14px; line-height: 17px; } &::before { content: attr(data-said); } } @media print { display: none; } }

  [data-painted~="active"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2)::highlight(active),
  [data-painted~="active"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(active) { background-color: #fff; color: var(--on); }

  .manuscript [data-now] { &[data-now-open]::before { content: "\2060"; vertical-align: 16px; } &[data-now="bold"] { font-weight: inherit; } &[data-now="italic"] { font-style: inherit; } } /* as they are; what they would be is said over them, and the line makes room once it is opened: at rest nothing moves as a page opens */
  [data-painted~="dress-madder"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(dress-madder),
  [data-painted~="dress-viridian"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(dress-viridian),
  [data-painted~="dress-indigo"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(dress-indigo),
  [data-painted~="dress-umber"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(dress-umber),
  [data-painted~="dress-teal"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(dress-teal),
  [data-painted~="dress-plum"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(dress-plum),
  [data-painted~="dress-clay"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(dress-clay),
  [data-painted~="dress-olive"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(dress-olive),
  [data-painted~="dress-pine"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(dress-pine),
  [data-painted~="dress-violet"] body[data-tinted] .writing:not([data-long-lead]) .manuscript > p:first-child:has(+ h2) ::highlight(dress-violet) { text-decoration-color: var(--on); }

  /* Words written in */
  .pending {
    color: var(--who); text-decoration: underline 1.5px; text-decoration-color: var(--who); text-underline-offset: 5px; text-decoration-skip-ink: none; cursor: text;
    &[data-agent] { text-decoration-style: double; text-decoration-thickness: 1px; }
    &[data-over] { display: inline-block; white-space: nowrap; vertical-align: 24px; line-height: 20px; font-size: 16px; font-weight: 550; letter-spacing: 0; text-indent: 0; text-underline-offset: 3px; margin-inline-end: calc(-1 * var(--w, 0px)); }
    &[data-break]::after, &[data-break-alone]::before { content: "¶"; color: var(--who); opacity: .7; font-style: normal; }
    &[data-active] { background: color-mix(in srgb, var(--who) 9%, var(--page)); }
    body[data-tinted] &[data-active] { background: var(--hue); color: var(--on); text-decoration-color: var(--on); }
  }

  /* Blocks put in, taken out, or made into something else. A rule beside them, and a word above where one is needed. */
  [data-proof-ink="madder"] { --who: var(--ink-madder); } [data-proof-ink="viridian"] { --who: var(--ink-viridian); } [data-proof-ink="indigo"] { --who: var(--ink-indigo); } [data-proof-ink="umber"] { --who: var(--ink-umber); }
  [data-proof-ink="teal"] { --who: var(--ink-teal); } [data-proof-ink="plum"] { --who: var(--ink-plum); } [data-proof-ink="clay"] { --who: var(--ink-clay); } [data-proof-ink="olive"] { --who: var(--ink-olive); } [data-proof-ink="pine"] { --who: var(--ink-pine); } [data-proof-ink="violet"] { --who: var(--ink-violet); }
  .manuscript {
    & [data-proof]:not(tr, td, th) { position: relative; box-shadow: -14px 0 var(--page), -16px 0 var(--who); @media (max-width: 760px) { box-shadow: -8px 0 var(--page), -10px 0 var(--who); } }
    & li[data-proof] { box-shadow: -8px 0 var(--page), -10px 0 var(--who); }
    & [data-agent][data-proof]:not(tr, td, th) { box-shadow: -12px 0 var(--page), -13px 0 var(--who), -15px 0 var(--page), -16px 0 var(--who); }
    & [data-said][data-said] { outline: 2px solid var(--quiet); outline-offset: 4px; &[data-said="madder"] { --said: var(--ink-madder); outline-color: var(--ink-madder); } &[data-said="viridian"] { --said: var(--ink-viridian); outline-color: var(--ink-viridian); } &[data-said="indigo"] { --said: var(--ink-indigo); outline-color: var(--ink-indigo); } &[data-said="umber"] { --said: var(--ink-umber); outline-color: var(--ink-umber); } &[data-said="teal"] { --said: var(--ink-teal); outline-color: var(--ink-teal); } &[data-said="plum"] { --said: var(--ink-plum); outline-color: var(--ink-plum); } &[data-said="clay"] { --said: var(--ink-clay); outline-color: var(--ink-clay); } &[data-said="olive"] { --said: var(--ink-olive); outline-color: var(--ink-olive); } &[data-said="pine"] { --said: var(--ink-pine); outline-color: var(--ink-pine); } &[data-said="violet"] { --said: var(--ink-violet); outline-color: var(--ink-violet); } }
    & figure[data-said][data-parted] { outline: none; & img { outline: 4px solid var(--said, var(--quiet)); outline-offset: 4px; } } /* what is open below it is not within */
    & [data-said][data-said-active] { outline-width: 4px; }
    & [data-proof~="add"] { color: var(--who); }
    & tr[data-proof~="add"] > :is(td, th), & :is(td, th)[data-proof~="add"] { color: var(--who); border-block-end: 1.5px solid var(--who); }
    & [data-proof~="cut"] { opacity: .62; }
    & tr[data-proof~="cut"] > :is(td, th), & :is(td, th)[data-proof~="cut"] { background: linear-gradient(var(--who), var(--who)) 0 50% / 100% 1.5px no-repeat; }
    & figure[data-proof~="cut"], & .lexxy-content__table-wrapper[data-proof~="cut"] { outline: 1.5px dashed var(--who); outline-offset: 4px; }
    & [data-proof-said] { &::before { content: attr(data-proof-said); float: none; display: block; font: italic 550 14px/20px var(--family); letter-spacing: 0; color: var(--who); block-size: auto; inline-size: auto; pointer-events: none; } }
    & [data-proof-said][data-parted="inside"]::before { font-size: 0; }
    & [data-proof-active] { background: color-mix(in srgb, var(--who) 9%, transparent); body[data-tinted] & { background: color-mix(in srgb, var(--hue) 34%, var(--page)); } }
    & [data-proof~="add"][data-proof-active] { background: color-mix(in srgb, var(--who) 9%, transparent); body[data-tinted] & { background: none; box-shadow: none !important; } } /* its words are filled */
  }
  body[data-preview] { & .writing > lexxy-editor, & .writing > .layer, & .keybar, & .outline { display: none; } & .foot-modes, & .foot-ask { visibility: hidden; } }
  .foot-middle:has(.foot-ask) { display: flex; gap: 22px; }
  .preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 18px; & .word { min-block-size: 32px; text-decoration: underline; text-underline-offset: .22em; color: inherit; } }
  body[data-mode="suggesting"] .manuscript { caret-color: var(--me, var(--action)); }

  /* A conversation, opened */
  .thread, .choice { font-size: var(--body); line-height: var(--line); & .passage-foot { font-size: var(--ui); line-height: var(--ui-line); } }
  .remark + .remark, .remarks-more + .remark, .remark + .remarks-more { margin-block-start: 10px; }
  .remark-by { font-size: var(--ui); line-height: var(--ui-line); color: var(--quiet); display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; min-block-size: 24px; }
  .parting-body .agent-name { font-style: normal; }
  .parting-body .remark-by span.avatar { display: none; } /* the name says it */
  .choice .remark[data-note] .remark-by { display: none; }
  .remark-by .avatar { inline-size: 22px; block-size: 22px; font-size: 10px; align-self: center; }
  #discussions .remark-words { cursor: pointer; }
  .remark-words { overflow-wrap: anywhere; & a { color: var(--action); text-decoration: underline; } }
  .remark-mine { display: inline-flex; gap: 14px; margin-inline-start: auto; font-size: var(--small); & .word { min-block-size: 24px; margin: 0; padding-inline: 4px; } @media (hover: hover) { &:not([data-asking]) { opacity: 0; } .remark:is(:hover, :focus-within) & { opacity: 1; } } @media (max-width: 760px) { & .word { min-block-size: 44px; min-inline-size: 44px; } } }
  .remarks-more { font-size: var(--ui); }
  .thread-lost { margin-block-end: 8px; font-size: var(--ui); font-style: italic; }
  .thread-also { display: grid; gap: 4px; margin-block-start: 12px; justify-items: start; & .word { display: block; text-align: start; font-size: var(--ui); line-height: var(--ui-line); font-weight: 400; overflow-wrap: anywhere; & b { font-weight: 600; } } }
  .who { font-weight: 600; color: var(--who, var(--ink)); }
  :is(.remark-by, .choice-change) .who[data-guest] { border-block-end: 2px dotted currentColor; }
  .mention { font-weight: 550; color: var(--action); white-space: nowrap; }
  .parting-body :is(.who, .choice-change ins, .mention) { --who: var(--chip-ink, var(--on)); }
  [data-ink] { --chip-ink: var(--on); }
  body[data-tinted] .parting-body {
    & .who, & .choice-change ins, & .mention { background: #fff; padding: 0 5px 1px; border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; color: var(--chip); color-scheme: light; }
    & .who:not([data-ink]), & .mention { color: var(--on); }
    & [data-ink="madder"] { --chip: #c23870; } & [data-ink="viridian"] { --chip: #146d34; } & [data-ink="indigo"] { --chip: #232ea0; } & [data-ink="umber"] { --chip: #643400; } & [data-ink="teal"] { --chip: #0573aa; } & [data-ink="plum"] { --chip: #8e0f6d; } & [data-ink="clay"] { --chip: #9f5c52; } & [data-ink="olive"] { --chip: #5f7601; } & [data-ink="pine"] { --chip: #134e48; } & [data-ink="violet"] { --chip: #6a35c9; }
    & .remark-words a { color: var(--on); }
    & .choice-change del { color: var(--on); text-decoration-color: var(--on); text-decoration-thickness: 2px; }
  }
  body:not([data-tinted]) .choice-change ins, .entry-thread .who { color: var(--who); text-decoration: none; font-weight: 550; }
  .choice-change { & p { overflow-wrap: anywhere; text-wrap: pretty; } & ins { text-decoration: none; font-weight: 550; } & del { color: var(--quiet); text-decoration-color: var(--who); } }
  .choice .remarks:not(:empty) { margin-block-start: 8px; &:has(> [data-note]:first-child) { margin-block-start: 0; } }
  .choice-lost { font-weight: 550; }
  .choice-note { font-size: var(--ui); margin-block-end: 8px; & .word { margin-inline-start: 8px; } }
  .choice-when { white-space: nowrap; margin-inline-start: 10px; color: var(--quiet); font-size: var(--small, .85em); }
  body[data-tinted] .parting:not([data-lead]) .parting-body .choice-when { color: var(--on); }
  .choice-words { font-style: italic; }

  .reply { margin-block-start: 12px; position: relative; }
  .composer {
    font-size: var(--body); line-height: 28px; min-block-size: 38px; max-block-size: 40vh; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; -webkit-user-select: text; user-select: text;
    &[data-empty]::before { content: attr(data-placeholder); color: var(--quiet); float: left; block-size: 0; pointer-events: none; }
  }
  .reply-others:empty { display: none; }
  .entry-thread .who:not([data-ink]) { color: var(--ink); }
  .reply-others { display: inline-flex; gap: 20px; }
  .mentions { display: flex; flex-wrap: wrap; column-gap: 18px; padding-block-start: 6px; font-size: var(--ui); line-height: var(--ui-line); & [role="option"] { min-block-size: var(--touch); display: inline-flex; align-items: center; cursor: pointer; color: var(--quiet); } & [aria-selected="true"] { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: .25em; } & [data-outside] { font-style: italic; } }
  .outside { margin-block-start: 8px; font-size: var(--ui); line-height: var(--ui-line); & label.word { cursor: pointer; &:has(:checked) { color: var(--ink); font-weight: 650; text-decoration: underline; text-underline-offset: .25em; } &:focus-within { outline: 2px solid currentColor; outline-offset: -3px; } } & .act { font-weight: 600; } }
  .word:disabled { text-decoration: none !important; }

  /* All of them */
  @media (min-width: 761px) {
    #comments-sheet {
      inset: auto 28px calc(var(--foot) + 10px) auto; inline-size: clamp(280px, calc(50vw - var(--measure) / 2 - 56px), 420px); max-block-size: calc(100dvh - var(--strip) - var(--foot) - 34px); clip-path: inset(100% 0 -12px 0); box-shadow: 0 0 0 1px var(--wash-deep);
      &[open] { clip-path: inset(0 0 -12px 0); @starting-style { clip-path: inset(100% 0 -12px 0); } }
      &::backdrop { background: transparent; }
      @media (max-width: 1290px) { inline-size: auto; left: 28px; max-block-size: 44dvh; } /* under the words, where there is no room beside them */
      &::before { display: block !important; inset-block: auto -9px; right: var(--notch-right, 120px); background: var(--wash) !important; clip-path: polygon(0 0, 100% 0, 50% 100%); }
    }
  }
  #discussions span.avatar { display: none; } /* the name says it */
  dialog.comments-sheet { &::before { display: none; } &:focus-visible { outline: 0; } }
  .comments-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 20px; margin-block-start: 6px; & [aria-checked="true"], & [aria-pressed="true"] { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: .25em; } }
  #discussions { font-size: 18px; line-height: 28px; &[data-which="open"] > [data-state="resolved"], &[data-which="resolved"] > [data-state="open"] { display: none; } }
  .entry-thread { padding-block: 14px 8px; border-block-end: 1px solid var(--rule); & .remark-by { color: var(--quiet); } }
  .entry-about { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: baseline; margin-block-end: 4px; font-size: var(--ui); line-height: 24px; color: var(--quiet); }
  .entry-quote { border-block-end: 1.5px solid var(--who, var(--action)); overflow-wrap: anywhere; &:hover { color: var(--ink); } @media (max-width: 760px) { position: relative; &::before { content: ""; position: absolute; inset: -10px 0; } } }
  .entry-thread[data-lost] .entry-quote { border-block-end-style: dashed; text-decoration: line-through; }
  .entry-lost { font-style: italic; }
  .entry-foot { display: flex; flex-wrap: wrap; gap: 0 20px; align-items: center; font-size: var(--ui); line-height: var(--ui-line); color: var(--quiet); margin-block-start: 2px; }
  .comments-none { color: var(--quiet); padding-block: 14px; display: none; #discussions[data-which="open"]:not(:has(> [data-state="open"])) > &[data-of="open"], #discussions[data-which="resolved"]:not(:has(> [data-state="resolved"])) > &[data-of="resolved"], #discussions[data-which="all"]:not(:has(> article)) > &[data-of="open"] { display: block; } }
  .comments-involvement { display: flex; flex-wrap: wrap; align-items: center; gap: 0 18px; margin-block-start: 14px; color: var(--quiet); & :checked + span { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: .25em; } & label:focus-within span { outline: 2px solid var(--action); outline-offset: 2px; } & label { cursor: pointer; } }
  @media (max-width: 760px) { .foot-end #comments-word { white-space: nowrap; } }
  @media (forced-colors: active) { .pending { text-decoration-color: Highlight; } }
  /* Paper has what the document says, and nothing of what is only suggested or said of it. */
  @media print {
    .pending, .manuscript [data-proof~="add"] { display: none; }
    .manuscript [data-proof] { opacity: 1; background: none; outline: 0; box-shadow: none !important; &::before { content: none !important; } }
    .manuscript tr[data-proof] > :is(td, th), .manuscript :is(td, th)[data-proof] { background: none; border-block-end-color: var(--rule); }
    [data-painted~="active"] ::highlight(active), [data-painted~="asking"] ::highlight(asking), [data-painted~="strike-madder"] ::highlight(strike-madder), [data-painted~="strike-viridian"] ::highlight(strike-viridian), [data-painted~="strike-indigo"] ::highlight(strike-indigo), [data-painted~="strike-umber"] ::highlight(strike-umber), [data-painted~="strike-teal"] ::highlight(strike-teal), [data-painted~="strike-plum"] ::highlight(strike-plum), [data-painted~="strike-clay"] ::highlight(strike-clay), [data-painted~="strike-olive"] ::highlight(strike-olive), [data-painted~="strike-pine"] ::highlight(strike-pine), [data-painted~="strike-violet"] ::highlight(strike-violet), [data-painted~="under-madder"] ::highlight(under-madder), [data-painted~="under-viridian"] ::highlight(under-viridian), [data-painted~="under-indigo"] ::highlight(under-indigo), [data-painted~="under-umber"] ::highlight(under-umber), [data-painted~="under-teal"] ::highlight(under-teal), [data-painted~="under-plum"] ::highlight(under-plum), [data-painted~="under-clay"] ::highlight(under-clay), [data-painted~="under-olive"] ::highlight(under-olive), [data-painted~="under-pine"] ::highlight(under-pine), [data-painted~="under-violet"] ::highlight(under-violet), [data-painted~="cut-indigo"] ::highlight(cut-indigo), [data-painted~="cut-madder"] ::highlight(cut-madder), [data-painted~="cut-plum"] ::highlight(cut-plum), [data-painted~="cut-teal"] ::highlight(cut-teal), [data-painted~="cut-umber"] ::highlight(cut-umber), [data-painted~="cut-violet"] ::highlight(cut-violet), [data-painted~="cut-viridian"] ::highlight(cut-viridian), [data-painted~="dress-indigo"] ::highlight(dress-indigo), [data-painted~="dress-madder"] ::highlight(dress-madder), [data-painted~="dress-plum"] ::highlight(dress-plum), [data-painted~="dress-teal"] ::highlight(dress-teal), [data-painted~="dress-umber"] ::highlight(dress-umber), [data-painted~="dress-violet"] ::highlight(dress-violet), [data-painted~="dress-viridian"] ::highlight(dress-viridian), [data-painted~="said-indigo"] ::highlight(said-indigo), [data-painted~="said-madder"] ::highlight(said-madder), [data-painted~="said-plum"] ::highlight(said-plum), [data-painted~="said-teal"] ::highlight(said-teal), [data-painted~="said-umber"] ::highlight(said-umber), [data-painted~="said-violet"] ::highlight(said-violet), [data-painted~="said-viridian"] ::highlight(said-viridian) { background: none; color: inherit; text-decoration: none; }
  }
}

/* A sheet drops from a word in the strip, on a lip of the document's colour. Inside, sentences part. */
@layer components {
  dialog.sheet {
    border: 0; margin: 0; padding: 0; background: transparent; color: var(--ink); position: fixed; inset: calc(var(--strip) - 2px) 28px auto auto; inline-size: min(620px, 100vw - 56px); max-inline-size: none; max-block-size: calc(100dvh - var(--strip) - 24px); overflow: visible;
    &::backdrop { background: var(--veil); opacity: 0; transition: opacity var(--part) var(--ease), display var(--part) allow-discrete, overlay var(--part) allow-discrete; }
    &[open]::backdrop { opacity: 1; @starting-style { opacity: 0; } }
    &::before { content: ""; position: absolute; inset-block-start: -9px; right: var(--notch-right, 12px); inline-size: 18px; block-size: 9.5px; background: var(--wash); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
    clip-path: inset(-10px 0 100% 0); pointer-events: none; transition: clip-path var(--part) var(--ease), translate var(--part) var(--ease), display var(--part) allow-discrete, overlay var(--part) allow-discrete;
    &[open] { clip-path: inset(-10px 0 0 0); pointer-events: auto; @starting-style { clip-path: inset(-10px 0 100% 0); } }
    @media (max-width: 760px) { inset-inline: 0; inline-size: 100%; max-block-size: calc(100dvh - var(--strip)); }
    &[data-held] { transition: none; }
  }
  .sheet-body {
    background: var(--wash); max-block-size: inherit; overflow-y: auto; overscroll-behavior: contain; padding: 24px 32px 20px;
    @media (max-width: 760px) { padding: 18px 20px 24px; }
    @media (forced-colors: active) { border: 1px solid CanvasText; }
  }
  body[data-tinted] { & .sheet-body { border-block-start: 10px solid var(--hue); } & dialog.sheet::before { background: var(--hue); } }
  .sheet-top .word { font-size: 18px; }
  .sheet-top { position: sticky; z-index: 2; inset-block-start: 0; background: var(--wash); display: flex; justify-content: space-between; align-items: baseline; gap: 16px; & h2 { font-size: 22px; line-height: 30px; font-weight: 550; letter-spacing: -.005em; } }
  turbo-frame { display: block; }
  .sheet turbo-frame:has(> .also:only-child) { min-block-size: 340px; & .also { color: var(--quiet); font-size: var(--ui); margin-block-start: 12px; } }

  .share {
    font-size: 18px; line-height: 28px;
    & section { margin-block-start: 18px; }
    & .say { padding-block: 4px; overflow-wrap: anywhere; & > .word { margin-inline-start: 6px; font-size: var(--ui); } }
    & .also { color: var(--quiet); font-size: var(--ui); line-height: 24px; overflow-wrap: anywhere; }
    & .phrase { overflow-wrap: normal; }
    & .agent-name { border: 0; } /* said in words */
    @media (max-width: 760px) { & .say { padding-block: 14px; line-height: 40px; } & .also { line-height: 24px; } & .share-request .say { padding-block: 6px; } & .phrase { padding-block: 9px; } }
  }
  .share-request { border-inline-start: 2px solid var(--action); padding-inline-start: 16px; & > .words { margin-block-start: 2px; } }
  .share-error { color: var(--madder); font-size: var(--ui); line-height: 24px; inline-size: 100%; &:empty { display: none; } & .share-fine { color: var(--ink); } }
  .share-end { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-block-start: 18px; font-size: var(--ui); gap: 4px 20px; min-block-size: 44px; }
  #share-said:empty { display: none; }
  .sheet .field:focus, .sheet .chips:focus-within { box-shadow: 0 .5px var(--action); }
  .share-copy { display: flex; flex: 1; justify-content: space-between; & .do { min-block-size: 39px; @media (max-width: 760px) { min-block-size: 44px; } } flex-wrap: wrap; align-items: center; gap: 4px 14px; & textarea { position: fixed; opacity: 0; inset: 0 auto auto 0; } }

  .invite {
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; margin-block-start: 10px;
    & > .field { flex: 1 1 230px; inline-size: auto; }
    & > .part, & > .invite-more, & > .invite-agents { flex-basis: 100%; min-inline-size: 0; }
    @media (max-width: 760px) { & > .field { flex-basis: 100%; } & > .word { min-block-size: 44px; } }
  }
  .chips {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; cursor: text;
    &:focus-within { border-block-end-color: var(--action); box-shadow: 0 1.5px var(--action); }
    & .chips-list { display: contents; }
    & .chips-field { flex: 1 1 140px; min-inline-size: 0; border: 0; padding: 0; background: transparent; outline: 0; min-block-size: 28px; @media (max-width: 760px) { min-block-size: 40px; } &::placeholder { color: var(--quiet); opacity: 1; } }
    @media (forced-colors: active) { &:focus-within { outline: 2px solid Highlight; } }
  }
  .chip {
    display: inline-flex; align-items: center; max-inline-size: 100%; background: var(--page); font-size: var(--ui); line-height: 26px; border-radius: 2px;
    & span { padding-inline-start: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    & button { flex: none; inline-size: 28px; block-size: 26px; text-align: center; color: var(--quiet); &:hover { color: var(--ink); } &:focus-visible { outline-offset: -3px; } @media (max-width: 760px) { inline-size: 40px; block-size: 36px; } }
    &[data-bad] { color: var(--madder); & span { text-decoration: underline wavy 1px; text-underline-offset: 4px; } }
    @media (forced-colors: active) { border: 1px solid CanvasText; }
  }
  .invite-more { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-block: 8px 4px; font-size: var(--ui); line-height: var(--ui-line); & .field { flex: 1 1 260px; inline-size: auto; resize: none; field-sizing: content; max-block-size: 7lh; } }
  .tick { display: inline-flex; align-items: center; gap: 8px; min-block-size: var(--touch); & input { accent-color: var(--action); inline-size: 16px; block-size: 16px; margin: 0; } }
  .invite-agents { margin-block-start: 8px; }

  .part { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--part) var(--ease); visibility: hidden; &[data-open] { grid-template-rows: 1fr; visibility: visible; } & > div { overflow: hidden; min-block-size: 0; } }
  .part-close { display: none; @media (pointer: coarse) { display: inline-flex; margin-inline-start: auto; } }
  .part-in {
    margin-block: 8px; padding: 6px 16px; background: var(--page); color: var(--ink); position: relative; font-size: var(--ui); line-height: var(--ui-line);
    &::before { content: ""; position: absolute; inset-block-start: -7px; left: var(--notch, 24px); inline-size: 16px; block-size: 7.5px; background: inherit; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
    & .word:is([aria-pressed="true"], :has(:checked)) { color: var(--ink); font-weight: 650; }
    & label.word { cursor: pointer; position: relative; &:focus-within { outline: 2px solid var(--action); outline-offset: -3px; } }
    & .words > span { padding-block: 5px; }
    @media (forced-colors: active) { border: 1px solid CanvasText; }
  }

  [data-tinted] .strip .share-word { text-decoration: none; &:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .28em; } }
  .waiting { display: inline-grid; place-items: center; min-inline-size: 18px; block-size: 18px; margin-inline-start: 6px; padding-inline: 4px; border-radius: 2px; background: var(--action); color: var(--on-action); font-size: 12px; line-height: 1; font-weight: 700; }
  .strip-guest { color: var(--quiet); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-inline-size: 18em; @media (max-width: 760px) { display: none; } }
  .entry-act { inline-size: 36px; block-size: 36px; display: grid; place-items: center; color: var(--quiet); &:hover { color: var(--ink); } &[aria-pressed="true"] { color: var(--ink); & svg { fill: currentColor; } } &:focus-visible { outline-offset: -4px; } @media (max-width: 760px) { inline-size: 44px; block-size: 44px; } }
  .strip .entry-act { margin-inline: -8px; }
  .foot-said { display: flex; align-items: center; column-gap: 14px; white-space: nowrap; @media (max-width: 760px) { & .foot-wide { display: none; } } }
  .said:has(.said-undo) { display: flex; align-items: center; gap: 18px; }
  .said-undo { font-weight: 650; text-decoration: underline; text-underline-offset: .22em; min-block-size: 28px; &:focus-visible { outline-color: currentColor; } }

  .ways { border: 0; padding: 0; margin-block: 0 18px; min-inline-size: 0; }
  .way { display: inline-flex; align-items: center; min-block-size: 44px; font-size: 22px; line-height: 32px; cursor: pointer; color: var(--quiet); & input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; } &:has(:checked) { color: var(--ink); font-weight: 600; & span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; } } &:has(:focus-visible) span { outline: 2px solid var(--action); outline-offset: 4px; } @media (hover: hover) { &:hover { color: var(--ink); } } }
  .door textarea.field { resize: none; field-sizing: content; min-block-size: 2lh; font-size: 20px; line-height: 30px; }
}

@layer components {
  .strip, .foot { position: fixed; inset-inline: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding-inline: 28px; background: var(--page); @media (max-width: 760px) { padding-inline: 20px; gap: 14px; } }
  .strip { inset-block-start: 0; block-size: var(--strip); }
  .foot { inset-block-end: 0; min-block-size: var(--foot); justify-content: space-between; color: var(--quiet); }

  .strip nav { display: flex; align-items: center; gap: 8px; min-inline-size: 0; }
  .strip:not(:has(.strip-title)) nav { flex: 1; }
  .strip-home { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 36px; min-block-size: var(--touch); margin-inline-start: -10px; color: var(--ink); @media (max-width: 760px) { min-inline-size: 44px; margin-inline-start: -12px; } }
  .strip-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-inline-size: 0; max-inline-size: 34em; text-decoration: none; @media (max-width: 760px) { display: none; } }
  a.strip-title { line-height: 32px; padding-inline: 4px; margin-inline: -4px; &:hover { text-decoration: underline; } &:focus-visible { outline-offset: -3px; } }
  .strip-end { margin-inline-start: auto; display: flex; align-items: center; gap: 22px; flex: none; min-inline-size: 0; }
  .account { display: inline-flex; align-items: center; gap: 8px; min-inline-size: 0; & span:last-child { max-inline-size: 16em; overflow: hidden; text-overflow: ellipsis; } }
  @media (max-width: 760px) { .strip-end { gap: 18px; } .account { justify-content: center; min-inline-size: 44px; & span:last-child { position: absolute; inline-size: 1px; overflow: hidden; clip-path: inset(50%); } } .foot { font-size: var(--small); } }

  .strip, .foot { transition: opacity 240ms; @media (prefers-reduced-motion: reduce) { transition: none; } }
  [data-receded] .foot:not(:focus-within, :hover) { opacity: 0; pointer-events: none; }
  /* All of the strip goes while someone types, but what has become of what they type. */
  .strip > *, .strip-end > * { transition: opacity 240ms; @media (prefers-reduced-motion: reduce) { transition: none; } }
  @media (max-width: 760px) { [data-receded] .strip .connection { flex: none !important; } }
  [data-receded] .strip:not(:focus-within, :hover) {
    background: transparent; pointer-events: none;
    & > :not(.strip-end), & .strip-end > :not(.connection) { opacity: 0; }
    & .connection { padding: 1px 8px 2px; margin-inline: -8px; border-radius: 2px; background: var(--paper); color: var(--paper-quiet); }
  }
  body[data-hue="plain"] .connection:is([data-state="saved"], [data-state="saving"]) { color: var(--quiet); }
  .connection[data-opens] { cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
  .connection { white-space: nowrap; text-align: end; &:is([data-state="offline"], [data-state="reconnecting"], [data-state="trouble"]) { font-weight: 600; } @media (max-width: 760px) { font-size: var(--small); line-height: 17px; white-space: normal; max-inline-size: 132px; text-align: start; } }
  @media (max-width: 760px) { .strip:has(.connection) { & nav { flex: none; } & .strip-end { flex: 1; } & .connection { margin-inline-end: auto; max-inline-size: none; min-inline-size: 40px; overflow-wrap: normal; flex: 1 1 0; } & .star-form { display: none; } } }
  .strip-comments { display: none; position: relative; color: var(--ink); & b { position: absolute; inset-block-start: 9px; inset-inline-start: 26px; min-inline-size: 15px; block-size: 15px; padding-inline: 3px; border-radius: 2px; background: var(--ink); color: var(--page); font-size: 11px; line-height: 15px; font-weight: 700; text-align: center; } @media (max-width: 760px) { display: grid; } }
  .strip-comments.none { display: none; }
  [data-tinted] .strip-comments b { color: #fff; }
  .foot-writing { display: grid; grid-template-columns: 1fr auto 1fr; @media (min-width: 1100px) { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); } & kbd { font: inherit; margin-inline-start: 8px; } }
  .foot-modes { display: flex; gap: 18px; & [aria-checked="true"] { color: var(--ink); font-weight: 650; } @media (max-width: 760px) { gap: 20px; } }
  .foot-again { display: flex; gap: 14px; & [aria-disabled="true"] { opacity: .45; cursor: default; } @media (max-width: 1180px) { display: none; } }
  .foot-end { display: flex; justify-content: flex-end; align-items: center; gap: 22px; & .word-count { white-space: nowrap; font-variant-numeric: tabular-nums; &:empty { display: none; } } }
  @media (max-width: 1000px) { .foot-writing :is(.word-count, .history-word) { display: none; } .foot-writing kbd { display: none; } .foot-writing:has([data-review]:not([hidden])) .foot-again { display: none; } } /* all of them are among the commands */
  @media (max-width: 760px) { .foot-writing { grid-template-columns: auto 1fr; & .foot-middle, & .word-count, & kbd, & .history-word { display: none; } & .foot-modes, & .foot-end { gap: 13px; } & .word { white-space: nowrap; } } }
  @media (max-width: 760px) { .foot-writing #comments-word { display: none; } .foot-writing .foot-modes { gap: 20px; } .foot-writing { font-size: var(--ui); } }
  @media (max-width: 430px) { .foot-writing .foot-said > span { display: none; } .foot-writing .foot-modes { gap: 18px; } }
  @media (max-width: 350px) { .foot-writing { font-size: var(--small); & .foot-modes { gap: 12px; } } }

  .keybar { display: none; }
  @media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
    [data-typing] .keybar { display: flex; position: fixed; z-index: 25; inset-inline: 0; inset-block-end: var(--keyboard, 0px); block-size: 48px; align-items: stretch; padding-inline: 8px; background: var(--page); border-block-start: 1px solid var(--rule); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
    .keybar button { flex: none; min-inline-size: 44px; min-block-size: 44px; padding-inline: 8px; text-align: center; color: var(--ink); white-space: nowrap; &:active { opacity: .6; } &:focus-visible { outline-offset: -4px; } &[aria-pressed="true"] { color: var(--action); text-decoration: underline; text-underline-offset: .28em; } }
    .keybar [data-chosen], body:has(.writing[data-selected]) .keybar [data-plain] { display: none; }
    .keybar-end { position: sticky; inset-inline-end: -8px; margin-inline-end: -8px; padding-inline: 14px 8px; flex: none; display: flex; background: linear-gradient(to right, transparent, var(--page) 14px); }
    .keybar { gap: 4px; }
    @media (max-width: 360px) { .keybar { gap: 0; & button { padding-inline: 5px; } } }
    body:has(.writing[data-selected]) .keybar [data-chosen] { display: block; }
    [data-typing] .foot, body:has(.bubble[data-of="things"]:not([hidden])) .foot { visibility: hidden; }
    body:has(.bubble[data-of="things"]:not([hidden])) .keybar, body:has(.parting[data-open] :is(.thread, .choice)) .keybar { display: none !important; }
    body:has(.parting[data-open] :is(.thread, .choice)) .foot { visibility: visible !important; }
    body:has(.bubble[data-of="things"]:not([hidden])) .layer { z-index: 26; }
  }
}
