/* Each kind of block its own light colour, with dark text, in either
   scheme: the graph's nodes and the workshop's blocks share them */
:root {
  --kind-attribute: #e2d96e;
  --kind-derived: #e7e7ae;
  --kind-event: #c0deed;
  --kind-action: #a6bbcf;
  --kind-command: #d8bfd8;
  --kind-ask: #e6e0f8;
  --kind-rule: #fdd0a2;
  --kind-watcher: #ffcc66;
  --kind-reaction: #e9967a;
  --kind-procedure: #c7e9c0;
  --kind-function: #dbe9d0;
  --kind-definition: #f3f3f3;
  --kind-status: #f5b7b1;
  --kind-roll-modifier: #aed6f1;
  --kind-roll-tag: #d6eaf8;
  --kind-outcome: #d1f2eb;
  --kind-encounter: #e8d5b0;
  --kind-ink: #222222;
  /* The same hues made strong, for blocks with white words on them, each
     at least 4.6 to 1 against white */
  --kind-rule-strong: #b45d04;
  --kind-rule-edge: #874603;
  --kind-attribute-strong: #7b7419;
  --kind-attribute-edge: #5c5712;
  --kind-status-strong: #de2d1c;
  --kind-status-edge: #a62215;
  --kind-event-strong: #2e7ca3;
  --kind-event-edge: #235d7a;
  --kind-action-strong: #3577b6;
  --kind-action-edge: #285988;
  --kind-command-strong: #be37be;
  --kind-command-edge: #8e298e;
  --kind-function-strong: #4f8226;
  --kind-function-edge: #3b621c;
  --kind-procedure-strong: #368226;
  --kind-procedure-edge: #28621c;
  --kind-encounter-strong: #926f2a;
  --kind-encounter-edge: #6e5320;
  --kind-definition-strong: #757575;
  --kind-definition-edge: #585858;
  --kind-watcher-strong: #9e6900;
  --kind-watcher-edge: #774f00;
  --kind-reaction-strong: #c94c21;
  --kind-reaction-edge: #973919;
  --kind-ask-strong: #7959d9;
  --kind-ask-edge: #4f2abb;
  --kind-roll-modifier-strong: #207ab7;
  --kind-roll-modifier-edge: #185b89;
  --kind-roll-tag-strong: #1f78b7;
  --kind-roll-tag-edge: #175a89;
  --kind-outcome-strong: #25836f;
  --kind-outcome-edge: #1c6253;
  --kind-derived-strong: #777722;
  --kind-derived-edge: #59591a;
  --kind-map-strong: #7b68b6;
  --kind-map-edge: #584691;
  --kind-sheet-strong: #c24785;
  --kind-sheet-edge: #953263;
  --kind-system-strong: #5e758d;
  --kind-system-edge: #46586a;
  /* No node of the graph's: maps, sheets and the system, and who takes
     part in an encounter, apart from it */
  --kind-creature-strong: #227e87;
  --kind-creature-edge: #195f65;
}

:root {
  color-scheme: light dark;
  --paper: #f6f3ec;
  --panel: #fffdf8;
  --ink: #26221c;
  --quiet: #6f675a;
  --line: #d9d1c1;
  --accent: #8a3b12;
  --on-accent: #fffdf8;
  --waiting: #fbeec8;
  --waiting-ink: #5c4300;
  /* A note on the map, as a sticky note is */
  --note-paper: #fff3a3;
  --note-edge: #d8c25a;
  --note-ink: #3a2f00;
  --error: #a3201a;
  --info: #205f74;
  --map-ground: #ece5d3;
  --map-grid: #c9bfa9;
  --map-wall: #3f372b;
  --map-back: #d5ccb9;
  --map-reach: rgba(32, 95, 116, 0.22);
  --map-pass: rgba(32, 95, 116, 0.1);
  --map-choice: rgba(138, 59, 18, 0.16);
  --map-land: #8c7a55;
  --map-unseen: #16130f;
  --map-remembered: rgba(22, 19, 15, 0.58);
  --map-region: rgba(32, 95, 116, 0.2);
  --map-area: rgba(138, 59, 18, 0.34);
  --map-zone: #6b5a8c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191714;
    --panel: #23201b;
    --ink: #ece6da;
    --quiet: #a69c8b;
    --line: #3d382f;
    --accent: #e39a63;
    --on-accent: #23180f;
    --waiting: #3b3013;
    --waiting-ink: #f4dc9c;
    --note-paper: #e6d77e;
    --note-edge: #a8973f;
    --note-ink: #231c00;
    --error: #f08a80;
    --info: #86c7dc;
    --map-ground: #2c2822;
    --map-grid: #453f35;
    --map-wall: #d8cfbe;
    --map-back: #141210;
    --map-reach: rgba(134, 199, 220, 0.24);
    --map-pass: rgba(134, 199, 220, 0.11);
    --map-choice: rgba(227, 154, 99, 0.16);
    --map-land: #8c7a55;
    --map-unseen: #050403;
    --map-remembered: rgba(5, 4, 3, 0.62);
    --map-region: rgba(134, 199, 220, 0.2);
    --map-area: rgba(227, 154, 99, 0.36);
    --map-zone: #b3a2d6;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 system-ui, sans-serif;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.25;
}

h1 {
  font-size: 1.1rem;
}

h2 {
  font-size: 1.05rem;
}

h3 {
  font-size: 1rem;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

button:disabled {
  color: var(--quiet);
  cursor: not-allowed;
}

button.main {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

/* A filled button which cannot be pressed yet, e.g. Create before a
 * scenario is chosen, is not the heaviest thing on the page */
button.main:disabled {
  border-color: var(--line);
  border-style: dashed;
  background: transparent;
  color: var(--quiet);
}

/* A button which says why it cannot be used when pressed, such as Next
 * with a choice still to make, looks as a disabled one does. */
button[aria-disabled="true"] {
  border-style: dashed;
  color: var(--quiet);
  cursor: not-allowed;
}

button.main[aria-disabled="true"] {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
}

input, select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

/* A tick box or a radio as wide as itself, beside its words */
/* A placeholder in the quiet colour, AA on the paper, not the browser's
 * paler grey (a review measured New file's at 4.16) */
::placeholder {
  color: var(--quiet);
  opacity: 1;
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  accent-color: var(--accent);
}

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

/* The first screen, signed in or not, is over the picture, and wears the look
 * of the parchment theme (content/themes/parchment): paper, ink and gold,
 * cut-corner panels, and a book face for headings. The picture is not changed
 * by either colour scheme. */

.start {
  --paper: #f3ead6;
  --panel: #fbf5e6;
  --ink: #2b2116;
  --quiet: #74634a;
  --line: #cdb88e;
  --accent: #8a2f1b;
  --on-accent: #fbf5e6;
  --gold: #a57d2c;
  --book: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --cut: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px);
  display: grid;
  gap: 1rem;
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  .start {
    --paper: #1d1913;
    --panel: #27211a;
    --ink: #efe4cc;
    --quiet: #b3a283;
    --line: #5a4b33;
    --accent: #e08a62;
    --on-accent: #1d1913;
    --gold: #d7b061;
  }
}

.start::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #2c3b47 url("backdrop.webp") 50% 62% / cover no-repeat;
}

.start h1, .start h2, .start h3, .start summary {
  font-family: var(--book);
}

.start h2 {
  margin: 0;
  color: var(--accent);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.start h2::before, .start h2::after {
  content: "◆";
  content: "◆" / "";
  margin-inline: 0.4rem;
  color: var(--gold);
  font-size: 0.6rem;
  vertical-align: middle;
}

.start h2::before {
  margin-left: 0;
}

/* A game system's shelf, or the drafts. */
.start h3 {
  margin: 0.25rem 0 0.5rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--line);
  color: var(--quiet);
  font-size: 1.05rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

/* Signed in there is more to see. The characters take the wide column, and
 * the worlds, joining one and making one are beside them. On a phone they
 * stack, worlds first. */
.start-wide {
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
  align-items: start;
  max-width: 72rem;
}

.start-wide > h1 {
  grid-area: 1 / 1;
  align-self: center;
  color: #fbf5e6;
  font-size: 2.25rem;
  font-weight: 600;
  text-shadow: 0 2px 12px rgb(0 0 0 / 65%);
}

.start-wide > .who {
  grid-area: 1 / 2;
  margin: 0;
  padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--panel);
  clip-path: var(--cut);
}

.start-wide > .said {
  grid-row: 2;
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.start-wide > .characters {
  grid-column: 1;
}

.start-side {
  display: grid;
  grid-column: 2;
  gap: 1rem;
}

@media (max-width: 52rem) {
  .start-wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .start-wide > h1, .start-wide > .who, .start-wide > .said,
  .start-wide > .characters {
    grid-area: auto;
  }

  .start-side {
    display: contents;
  }

  .start-side > .worlds {
    order: 1;
  }

  .start-wide > .characters {
    order: 2;
  }

  .start-side > .join {
    order: 3;
  }

  .start-side > .new-world {
    order: 4;
  }
}

/* A GM's first screen: what they come for in the wide column, their worlds
 * then the Workshop, and their characters beside it, the page wider on a
 * wide screen. */
.start-gm {
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 26rem);
  max-width: 100rem;
}

.start-main {
  display: grid;
  grid-column: 1;
  gap: 1rem;
  align-content: start;
}

.start-gm > .start-side {
  grid-column: 2;
  grid-row: 3;
}

.start-gm > .start-main {
  grid-row: 3;
}

/* On a narrow screen one column, the header's too: these come after the
 * column rules of .start-gm and .start-player, so they win there */
@media (max-width: 52rem) {
  .start.start-gm, .start.start-player {
    grid-template-columns: minmax(0, 1fr);
  }

  .start.start-gm > .start-main, .start.start-gm > .start-side, .start.start-player > .start-main {
    display: grid;
    grid-area: auto;
  }
}

/* A player's first screen: one column, in the order a player wants it,
 * their worlds then their characters, on a phone as on a large screen. */
.start-player {
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 60rem;
}

.start-player > .start-main {
  grid-column: 1 / -1;
  grid-row: 3;
}

.start .join .said:empty, .start .new-world .said:empty {
  display: none;
}

.start .join .said, .start .new-world .said {
  margin: 0;
  padding: 0;
}

.start .more-options > summary {
  cursor: pointer;
  color: var(--quiet);
}

.start .more-options[open] > summary {
  margin-bottom: 0.5rem;
}

/* Buttons which unfold a form below them, one at a time. */
.drawer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Open, a button looks pressed, not filled, filled or not when folded: the
 * form's own button is then the one to press */
.drawer-bar button[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--paper);
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.start .drawer > form {
  max-width: 40rem;
  padding: 0.9rem 1rem;
  border-radius: 6px;
  background: var(--paper);
  clip-path: none;
}

.start .drawer:not(:has(> :not([hidden]))) {
  display: none;
}

/* The worlds, a row each, Open at the end of each. */
.world-lead:empty {
  display: none;
}

.world-table {
  width: 100%;
  border-collapse: collapse;
}

.world-table th, .world-table td {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.world-table .world-do {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

.world-table th {
  color: var(--quiet);
  font-size: 0.85rem;
  font-weight: 600;
}

.world-table td:last-child {
  text-align: right;
}

.world-table .world-id {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The server's users, for its operators (see The server's users in
 * PAGE.md): a table to search and sort, each row's roles as chips and what
 * can be done at its end, and what the operators did under it. */
.start-wide.users-page {
  grid-template-columns: minmax(0, 1fr);
  max-width: 96rem;
}

.start-wide.users-page > * {
  grid-area: auto;
  grid-column: 1 / -1;
}

.users-head h1 {
  margin: 0;
  color: #fbf5e6;
  font-size: 2.25rem;
  font-weight: 600;
  text-shadow: 0 2px 12px rgb(0 0 0 / 65%);
}

.users-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.users-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.users-tools label {
  flex: 0 1 24rem;
}

.users-list {
  overflow-x: auto;
}

.users-table th button.sort {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.users-table .user-worlds {
  max-width: 18rem;
  overflow-wrap: anywhere;
}

.user-do {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.user-role {
  display: inline-block;
  margin: 0 0.25rem 0.15rem 0;
  padding: 0 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.user-role.blocked {
  border-color: var(--error);
  color: var(--error);
}

.users-table tr.user-blocked td {
  background: color-mix(in srgb, var(--error) 6%, transparent);
}

.operator-acts {
  margin: 0;
  padding-left: 1.25rem;
}

.operator-acts li {
  margin-bottom: 0.25rem;
}

button.main.danger {
  border-color: var(--error);
  background: var(--error);
  color: var(--panel);
}

/* Before signing in: one card, over the picture. */
.landing {
  width: min(28rem, calc(100% - 2rem));
  margin: clamp(2rem, 14vh, 8rem) auto 2rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 12px 40px rgb(0 0 0 / 45%);
}

.landing > h1 {
  color: var(--accent);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.ways-in {
  display: grid;
  gap: 0.5rem;
}

.ways-in p {
  margin: 0;
  color: var(--quiet);
  font-size: 0.9rem;
  text-align: center;
}

.start form, .panel {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  background: var(--panel);
  clip-path: var(--cut);
}

/* Too short for the cut corners, which leave little of its sides. */
.start details.panel {
  border-radius: 6px;
  clip-path: none;
}

.start details.panel > form {
  padding: 0.75rem 0 0;
  border: none;
  clip-path: none;
}

.start form, .start section.panel {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.start section.panel > *, .start section.panel > .buttons > p {
  margin: 0;
}

/* The characters of one game system, or the drafts, as cards. */
/* What Carry on does, under Unfinished. */
.shelf-note {
  margin: 0 0 0.5rem;
  color: var(--quiet);
  font-size: 0.875rem;
}

/* The games to make a character in: each a card, its name, what it is, and
 * a button saying what it does, side by side where there is room. */
.games {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.75rem;
}

.games .game-choice {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.games .game-choice h3 {
  margin: 0;
}

.games .game-about {
  margin: 0;
  flex: 1;
  color: var(--quiet);
}

.games .game-choice button {
  align-self: flex-start;
}

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.6rem;
}

div:has(> .shelf) + div:has(> .shelf) {
  margin-top: 0.75rem;
}

.start section.panel > div:empty {
  display: none;
}

.shelf > .who {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  background: var(--paper);
}

.shelf .who-what {
  flex: 1 1 auto;
  font-family: var(--book);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.shelf .who-what .checked, .shelf .who-what .summary, .shelf .sent-back {
  font-family: system-ui, sans-serif;
  font-weight: normal;
}

.shelf .who-what .checked {
  margin-top: 0.15rem;
  font-size: 0.8rem;
}

/* The character just made. */
.shelf .who.fresh {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.shelf .who-what .new-mark {
  margin-left: 0.4rem;
  padding: 0 0.35rem;
  border-radius: 4px;
  background: var(--accent);
  color: var(--paper);
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}

.shelf .who-what .summary {
  margin-top: 0.15rem;
  font-size: 0.9rem;
}

.start label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.9rem;
}

.who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* A character or draft in the library: its name, its sheet's summary and
 * what it was checked against under it, and its buttons beside them, or
 * under them where the column is narrow. */
.who:has(> .who-what) {
  flex-wrap: wrap;
}

.who-what {
  flex: 1 1 11rem;
  min-width: 0;
}

.who-what .checked, .who-what .summary {
  display: block;
}

.who-acts {
  display: flex;
  flex: none;
  gap: 8px;
  white-space: nowrap;
}

/* On a character's card, its buttons wrap within it, however many there
 * are and however narrow the card, rather than running under the next */
.shelf > .who .who-acts {
  flex-wrap: wrap;
}

.token {
  overflow-wrap: anywhere;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

/* The play screen */

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.bar .where {
  flex: 1;
  min-width: 12rem;
  color: var(--quiet);
  font-size: 0.9rem;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.waits {
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--waiting);
  color: var(--waiting-ink);
  font-weight: 600;
}

.your-turn {
  font-size: 1.15em;
  letter-spacing: 0.02em;
}

.turn-order .order {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.turn-order .order li {
  display: block;
  padding: 0.2rem 0.4rem;
  border-left: 3px solid transparent;
}

.turn-order .order li.now {
  border-left-color: var(--accent);
  background: var(--paper);
  font-weight: 700;
}

.waits:empty, .said:empty {
  display: none;
}

/* What waits and what was said, above the map, never shorter than it has
   been, so the map does not move under the pointer as banners come and go
   (see app.js, notices). Its height is kept by the page. */
.notices {
  min-height: 0;
}

.said {
  padding: 0.35rem 1rem;
  color: var(--info);
}

.said.error {
  color: var(--error);
}

.play {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1rem;
  max-width: 70rem;
  margin: 0 auto;
  padding: 1rem;
}

.scene {
  display: grid;
  align-content: start;
  gap: 1rem;
  min-width: 0;
}

.view-panel {
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.view-panel p {
  margin: 0.25rem 0;
}

.list-label {
  color: var(--info);
}

.derived {
  color: var(--quiet);
  font-size: 0.85rem;
}

.errors {
  color: var(--error);
}

/* Explain (see Explain in ENGINE.md): a value is a button, and its explanation opens
 * below it. */
/* Inline, as the value it explains is, whatever `.why` says of a line of
   why: "5 of 5" stays on one line in a narrow column. */
button.why {
  display: inline-block;
  padding: 0 0.3rem;
  border-style: dashed;
  font: inherit;
}

button.why[aria-expanded="true"] {
  border-style: solid;
  border-color: var(--accent);
}

.why-region {
  margin: 0.25rem 0 0.5rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--paper);
}

.why-region ul {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}

.why-region .not-counted {
  color: var(--quiet);
  text-decoration: line-through;
}

.why-region .gm-note, .why-region .why-formula {
  color: var(--quiet);
  font-size: 0.85rem;
}

.why-region .why-formula code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

button.why-read {
  padding: 0 0.3rem;
  font: inherit;
}

/* What the page says, read out from one place which is never drawn again,
   and not shown, as the line in the page shows it. */
.announced {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.log {
  max-height: 16rem;
  overflow-y: auto;
}

.actions {
  align-self: start;
  display: grid;
  gap: 0.5rem;
}

.actions button {
  width: 100%;
  text-align: left;
}

.why {
  display: block;
  color: var(--quiet);
  font-size: 0.85rem;
  font-style: italic;
}

/* A few words beside an option, as a game notes it, e.g. a target which is
   no foe (see Several inputs in DSL.md) */
.option-note {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  color: var(--quiet);
  font-size: 0.8rem;
  font-style: normal;
  vertical-align: 0.05rem;
}

.advance {
  width: 6rem;
}

/* A face of a player's own dice, as they rolled it (see Asks in DSL.md) */
.faces .face {
  width: 4rem;
}

/* Dialogs */

dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

dialog::backdrop {
  background: rgb(0 0 0 / 50%);
}

dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

#dialog-body {
  display: grid;
  gap: 0.5rem;
}

#dialog-body p {
  margin: 0;
}

.choices button {
  display: block;
  width: 100%;
  margin-bottom: 0.4rem;
  text-align: left;
}

.lines p {
  overflow-wrap: anywhere;
}

@media (max-width: 40rem) {
  .play {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The GM's screen. */
.table {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, 2fr) minmax(14rem, 1.2fr);
  gap: 1rem;
  padding: 1rem;
  align-items: start;
}

@media (max-width: 60rem) {
  .table {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The GM's first window in tabs (see The GM's screen in tabs in PAGE.md):
   the tabs, what is to hand, then the tab shown, the map as big as fits. */
.table.tabbed {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.5rem 1rem 1rem;
}

.gm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.gm-tab-wrap {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 0.4rem 0.4rem 0 0;
  background: var(--panel);
}

.gm-tab-wrap.on {
  background: var(--accent);
  border-color: var(--accent);
}

.gm-tab-wrap button {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.gm-tab {
  padding: 0.35rem 0.8rem;
  font-weight: 600;
}

.gm-tab-out {
  padding: 0.35rem 0.45rem;
  color: var(--quiet);
}

.gm-tab-wrap.on button {
  color: var(--on-accent);
}

.to-hand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.2rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--panel);
}

.to-hand-turn,
.to-hand-chosen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.to-hand-turn > span {
  font-weight: 600;
}

/* While the rules take every turn nobody plays (see autoGmNote) */
.auto-gm {
  margin: 0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--waiting);
  color: var(--waiting-ink);
}

.to-hand-turn .auto-gm {
  flex-basis: 100%;
}

.to-hand .sheet-form {
  margin: 0;
}

.prepared-starts {
  margin: 0.2rem 0;
  font-style: italic;
}

.to-hand .map-reminders {
  flex-basis: 100%;
  margin: 0;
  padding: 0.4rem 0.6rem;
  border-color: var(--accent);
}

.to-hand-acts {
  flex-basis: 100%;
  gap: 0.25rem;
}

.to-hand-acts button {
  min-height: 0;
  padding: 0.15rem 0.5rem;
  font-size: 0.9em;
}

.to-hand-last {
  flex: 1 1 18rem;
  min-width: 0;
  margin: 0;
  color: var(--quiet);
  font-size: 0.9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gm-tab-body {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}

/* A tab of several parts, as Log and Time are, lays them side by side, as
   many as fit; one of a single part, as Turns or Chosen, has the width */
.gm-tab-body.tab-log,
.gm-tab-body.tab-time {
  grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr));
}

/* The tracker in a tab is not pinned or cut short, as in a column */
.gm-tab-body .turns-panel {
  position: static;
  max-height: none;
}

/* The party's cards side by side, as many as fit */
.gm-tab-body .party-cards,
.gm-tab-body .party-others {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
  gap: 0.75rem;
}

/* The world list's places in columns, as many as fit */
.gm-tab-body .world-places {
  columns: 20rem;
  column-gap: 1.5rem;
}

.gm-tab-body .world-places > .list-label {
  break-after: avoid;
}

.gm-tab-body .world-places li.pick {
  break-inside: avoid;
}

.gm-tab-body.tab-map .map-pane {
  min-height: calc(100dvh - 12rem);
}

.table-list ul {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

.table-list li button {
  width: 100%;
  text-align: left;
}

/* But what a line's form draws, which is as wide as it says */
.table-list li .sheet button {
  width: auto;
}

/* A tick box beside each thing, for the GM's selection (see The GM in ENGINE.md). */
li.pick, label.pick {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* An ending to choose, with its rewards, notes and read-aloud below its
   name (see Endings in DSL.md). */
label.pick.ending {
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

label.pick.ending > p,
label.pick.ending > figure {
  flex-basis: 100%;
  margin: 0.2rem 0 0 1.6rem;
}

.table-list .list-label button.small,
.order button.small {
  width: auto;
  padding: 0.05rem 0.4rem;
  font-size: 0.85em;
}

.selection {
  align-items: center;
  margin-bottom: 0.5rem;
}

.order li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

ol.undo li {
  margin-bottom: 0.3rem;
}

.table-list li button[aria-current] {
  background: var(--accent);
  color: var(--on-accent);
}

.detail table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.detail th {
  text-align: left;
  font-weight: normal;
  color: var(--quiet);
}

.detail td, .detail th {
  padding: 0.15rem 0.5rem 0.15rem 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.detail > button {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 0.25rem;
}

li.now {
  font-weight: bold;
}

form.edit {
  display: grid;
  gap: 0.5rem;
}

.field {
  display: grid;
  gap: 0.15rem;
}

/* Choosing an action's inputs (see Several inputs in DSL.md): one option on each line, with
   its box or number first. */
.choice {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.choice input[type="number"] {
  width: 4rem;
}

/* Making a character (see creation.js). Three columns, which stack on a
   phone. */
.wz {
  display: grid;
  gap: 0.75rem;
  max-width: 70rem;
  margin: 0 auto;
  padding: 0.75rem 1rem 2rem;
}

.wz h1 {
  font-size: 1.1rem;
}

.wz h2 {
  font-size: 1.25rem;
}

.wz h2:focus {
  outline: none;
}

.wz h3 {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--quiet);
  font-weight: 600;
}

.wz-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.wz-status {
  font-size: 0.875rem;
  color: var(--quiet);
}

.wz-status.saved::before {
  content: "✓ ";
  color: var(--info);
  font-weight: 700;
}

.wz-status-note {
  font-size: 0.875rem;
  color: var(--quiet);
}

@media (max-width: 720px) {
  .wz-status-note {
    display: none;
  }
}

.wz-status.lost {
  color: var(--error);
  font-weight: 600;
}

.wz-grid {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr) 16.25rem;
  gap: 0.75rem;
  align-items: start;
}

.wz-grid[inert] {
  opacity: 0.6;
}

.wz-pane {
  min-width: 0;
  padding: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.wz-step {
  display: grid;
  gap: 0.75rem;
}

.wz-steps {
  display: grid;
  gap: 2px;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.wz-steps button {
  display: grid;
  grid-template-columns: 1.1rem 1fr auto;
  gap: 0.25rem;
  width: 100%;
  padding: 0.3rem 0.4rem;
  border: 0;
  border-radius: 4px;
  background: none;
  text-align: left;
}

.wz-steps button[aria-current="step"] {
  background: var(--paper);
  font-weight: 600;
}

.wz-mark {
  color: var(--quiet);
}

.wz-needs-attention .wz-mark, .wz-count {
  color: var(--error);
  font-weight: 600;
}

/* On a line of its own, so neither it nor the step's name breaks. */
.wz-new {
  display: block;
  color: var(--info);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.wz-explained {
  position: relative;
  min-width: 0;
}

.wz-short, .wz-why, .wz-quiet {
  font-size: 0.875rem;
  color: var(--quiet);
}

.wz-short {
  display: block;
}

.wz-long {
  display: none;
  position: absolute;
  z-index: 20;
  left: 0;
  top: 100%;
  width: min(20rem, 100%);
  min-width: 12.5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 400;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 18%, transparent);
}

.wz-long.open {
  display: block;
  position: static;
  width: auto;
  margin-top: 0.25rem;
  box-shadow: none;
}

@media (hover: hover) {
  .wz-explained:hover > .wz-long, .wz-line:hover .wz-long {
    display: block;
  }

  /* An option's long help, on pointing, covers the options under it
   * rather than growing its card, which would move every row below it as
   * the pointer crossed the list. Opened with ?, or in a short list, it is
   * part of the card. */
  .wz-picks:not(.wz-few) .wz-pick:is(:hover, :focus-visible) .wz-more:not(.shown) {
    display: block;
    position: absolute;
    z-index: 20;
    top: calc(100% - 0.25rem);
    left: 0.5rem;
    right: 0.5rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 18%, transparent);
  }
}

.wz-explained:has(.wz-help:focus-visible) > .wz-long, .wz-line dt:focus-visible .wz-long {
  display: block;
}

.wz-help {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border-radius: 999px;
  color: var(--quiet);
  font-size: 0.8rem;
}

.wz-opt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}

.wz-opt:first-child {
  border-top: 0;
}

.wz-opt .wz-why {
  grid-column: 1 / -1;
}

.wz-stepper {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.wz-stepper button {
  width: 2.25rem;
  padding: 0.3rem 0;
}

.wz-stepper input {
  width: 3rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.wz-choice {
  width: 6.5rem;
}

.wz-blocked, .wz-reason {
  color: var(--error);
}

.wz-reason {
  grid-column: 2 / -1;
  font-size: 0.875rem;
}

/* Why an option cannot be taken: in ink, as the one thing on a faded
 * option to read, and not red, as it is information, not a fault. Red is
 * for what is wrong (see Creation in ENGINE.md). */
.wz-why-not {
  grid-column: 2 / -1;
  color: var(--ink);
  font-size: 0.875rem;
}

/* A step an edit cannot change, or any step while an edit waits for the GM
   (see Editing a character in play in ENGINE.md). */
.wz-fixed {
  border: 1px dashed var(--line);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: 0;
}

.wz-fixed legend {
  font-size: 0.875rem;
  font-weight: 600;
}

.wz-waiting {
  background: var(--waiting);
  color: var(--waiting-ink);
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
}

.wz-waiting, .wz-clash {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.wz-change ul {
  margin: 0.25rem 0 0.75rem;
}

.wz-opt.wz-blocking strong, dt.wz-stops, dd.wz-stops, .wz-opt.wz-blocking .wz-needs {
  color: var(--error);
  font-weight: 600;
}

.wz-needs {
  margin-left: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.wz-list, .wz-picks, .wz-field {
  display: grid;
  gap: 0.4rem;
}

.wz-list {
  gap: 0.75rem;
}

/* How many of an option are chosen, on a step which allows several. */
.wz-counter {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.wz-counter button {
  width: 2rem;
  padding: 0.2rem 0;
}

.wz-count-shown {
  min-width: 1.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.wz-pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.4rem;
  /* Cards side by side are as tall as the tallest, not ragged (A human QA
   * pass, 32) */
  align-items: stretch;
}

.wz-pick {
  position: relative;
  display: grid;
  align-content: start;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  gap: 0.15rem 0.6rem;
  width: 100%;
  padding: 0.6rem 0.5rem;
  background: none;
  text-align: left;
}

.wz-pick[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  /* Chosen, solid and in ink, even when the step is full and no more can
   * be added */
  border-style: solid;
  color: var(--ink);
}

.wz-pick.wz-flagged {
  border-color: var(--error);
}

/* An option which cannot be taken is plainly so at a glance, the same on
 * every step: hatched and flat, its name, cost and words faded, a ⊘ where
 * a chosen one has its tick, and no border coming up on pointing. One chosen,
 * on a step which takes several of one, is still chosen when full (see
 * Making a character in PAGE.md). */
.wz-pick[aria-disabled="true"]:not([aria-pressed="true"]) {
  border-style: dashed;
  background: repeating-linear-gradient(
    135deg,
    transparent 0 7px,
    color-mix(in srgb, var(--line) 55%, transparent) 7px 8px
  );
  box-shadow: none;
}

.wz-pick[aria-disabled="true"]:not([aria-pressed="true"]):hover {
  border-color: var(--line);
}

.wz-pick[aria-disabled="true"]:not([aria-pressed="true"]) strong {
  font-weight: 500;
}

.wz-pick[aria-disabled="true"]:not([aria-pressed="true"]) strong,
.wz-pick[aria-disabled="true"]:not([aria-pressed="true"]) .wz-cost,
.wz-pick[aria-disabled="true"]:not([aria-pressed="true"]) .wz-desc {
  color: var(--quiet);
}

.wz-pick[aria-disabled="true"]:not([aria-pressed="true"]) .wz-tick::before {
  content: "⊘";
  color: var(--quiet);
  font-weight: 400;
}

.wz-tick {
  color: var(--accent);
  font-weight: 700;
}

.wz-cost {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.wz-desc, .wz-effects {
  grid-column: 2 / -1;
  font-size: 0.875rem;
}

.wz-desc {
  color: var(--quiet);
}

.wz-more {
  display: none;
  color: var(--ink);
}

.wz-more.shown, .wz-few .wz-more {
  display: block;
}

.wz-preview-note {
  margin: 0 0 0.4rem;
  color: var(--info);
  font-weight: 600;
}

.wz-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  color: var(--info);
  font-variant-numeric: tabular-nums;
}

.wz-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.wz-filters input {
  flex: 1 1 10rem;
  width: auto;
}

.wz-filters button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.wz-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.wz-dice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.wz-die {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  animation: wz-land 0.22s ease-out backwards;
}

/* One throw of several: its dice, then its total, a line each. */
.wz-throw {
  align-items: center;
  margin-bottom: 0.4rem;
}

.wz-throw .wz-die {
  width: 2rem;
  height: 2rem;
}

.wz-die.wz-dropped {
  opacity: 0.45;
  text-decoration: line-through;
  border-style: dashed;
}

.wz-throw-total {
  margin-left: 0.25rem;
  font-variant-numeric: tabular-nums;
}

@keyframes wz-land {
  from {
    transform: translateY(-6px) rotate(-8deg);
    opacity: 0;
  }
}

/* What is left of the budgets a step spends, large, with the step. */
.wz-spends {
  margin: 0.5rem 0;
  font-size: 1.15rem;
}

.wz-spends strong {
  font-size: 1.35rem;
}

/* A choice which would take others off, asked about before it is made. */
.wz-asking {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border: 2px solid var(--waiting-ink);
  border-radius: 6px;
  background: var(--waiting);
  color: var(--waiting-ink);
}

.wz-asking p {
  margin: 0 0 0.5rem;
}

.wz-problems {
  display: grid;
  gap: 2px;
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}

.wz-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-align: left;
  text-decoration: underline;
}

.wz-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.wz-nav .wz-why {
  flex: 1 1 100%;
  text-align: right;
}

.wz-side {
  display: grid;
  gap: 0.75rem;
  position: sticky;
  top: 0.5rem;
}

.wz-values {
  display: grid;
  gap: 2px;
  margin: 0.4rem 0 0;
}

.wz-small {
  font-size: 0.875rem;
}

.wz-line {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 0.75rem;
}

.wz-line.has-help {
  cursor: help;
}

.wz-sheet .wz-long {
  top: auto;
  bottom: 100%;
}

.wz-values dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

dt.wz-moved, dd.wz-moved {
  color: var(--info);
  font-weight: 600;
}

.wz-was {
  margin-right: 0.25rem;
  color: var(--quiet);
  font-weight: 400;
  text-decoration: line-through;
}

.wz-of {
  font-size: 0.8rem;
  color: var(--quiet);
}

dd.wz-below {
  color: var(--error);
  font-weight: 600;
}

dd.wz-flash {
  animation: wz-flash 1s ease-out;
}

@keyframes wz-flash {
  from {
    background: var(--waiting);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wz-die, dd.wz-flash {
    animation: none;
  }
}

.wz-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wz-narrow {
  display: none;
}

.checked {
  color: var(--quiet);
  font-size: 0.875rem;
}

/* An unfinished edit of a character, on its own card. */
.shelf .editing-note {
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
  color: var(--waiting-ink);
}

/* An offer the GM did not take, and why (see Editing a character in play in ENGINE.md). */
.sent-back {
  color: var(--error);
  font-size: 0.875rem;
}

/* A character's levels, each with Revise, and Gain a level (see Advancement in ENGINE.md).
   Each wraps within its card, which is narrow in the library's grid. */
.shelf .levels {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
}

.level {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin: 0;
}

.due {
  font-weight: 600;
}

@media (max-width: 54rem) {
  .wz-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .wz-side {
    display: contents;
  }

  .wz-budgets {
    order: 1;
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 0.5rem 0.75rem;
  }

  .wz-budgets h3, .wz-budgets .wz-short {
    display: none;
  }

  .wz-budgets .wz-values {
    margin: 0;
  }

  .wz-step {
    order: 2;
  }

  .wz-sheet {
    order: 3;
  }

  .wz-wide {
    display: none;
  }

  .wz-narrow {
    display: block;
  }
}

/* The map: it takes the middle of the page (see Drawing the map in PAGE.md). */

.play.with-map {
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  max-width: none;
  align-items: start;
}

.table.with-map {
  grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr) minmax(16rem, 22rem);
}

.map-side {
  display: grid;
  align-content: start;
  gap: 1rem;
  min-width: 0;
  max-height: calc(100dvh - 7rem);
  overflow-y: auto;
}

.map-pane {
  display: grid;
  grid-template-rows: auto minmax(25rem, 1fr) auto auto;
  gap: 0.5rem;
  min-width: 0;
  min-height: calc(100dvh - 7rem);
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.map-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
}

.map-about {
  flex: 1;
  color: var(--quiet);
  font-size: 0.9rem;
}

.map-chooser {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.map-chooser select {
  width: auto;
}

.map-fold {
  display: none;
}

.map-notice {
  flex-basis: 100%;
  margin: 0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--waiting);
  color: var(--waiting-ink);
  font-size: 0.85rem;
}

.map-notice[hidden] {
  display: none;
}

.map-reminder p {
  margin: 0 0 0.25rem;
}

.map-reminder-title {
  font-weight: 600;
}

.map-reminder + .map-reminder {
  margin-top: 0.75rem;
}

.map-middle {
  display: flex;
  gap: 0.5rem;
  min-height: 0;
}

.map-toolbar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0.25rem;
  min-height: 0;
  overflow-y: auto;
}

.map-tool {
  min-width: 4.5rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
}

.map-tool.is-held {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.map-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  border-radius: 6px;
  background: var(--map-back);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.map-stage.is-dragging {
  cursor: grabbing;
}

.map-stage:not([data-tool="select"]) {
  cursor: crosshair;
}

.map-world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.map-ground {
  display: block;
}

.map-things, .map-tools, .map-layers, .map-overlay, .map-fog {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}

.map-fog, .map-layers, .map-overlay {
  pointer-events: none;
}

.map-layer, .map-layer canvas, .map-layer-marks, .map-overlay-marks {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}

/* A filter with no picture greys what is under it. */
.map-layer-grey {
  mix-blend-mode: saturation;
}

.map-mark circle {
  fill: var(--panel);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.map-mark text {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

/* A mark's words as a sticky note: pale paper, a little shadow, dark ink
   (see Drawing the map in PAGE.md) */
.map-note-paper {
  fill: var(--note-paper);
  stroke: var(--note-edge);
  stroke-width: 0.5;
  filter: drop-shadow(1px 2px 1.5px rgb(0 0 0 / 0.35));
}

.map-mark .map-mark-text {
  fill: var(--note-ink);
  font-size: 13px;
  font-weight: 500;
}

.map-mark-danger circle {
  fill: var(--waiting);
  stroke: var(--accent);
}

.map-mark-area {
  fill: var(--map-area);
}

.map-edges {
  pointer-events: none;
}

.map-edges .barrier-knob, .map-edges .wall-hit {
  pointer-events: auto;
}

.map-option input[type="number"] {
  width: 4rem;
}

.map-layer-row {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
}

.map-layer-row input[type="range"] {
  width: 5rem;
}

.map-layer-row .map-option:first-child {
  min-width: 8.5rem;
}

.map-layer-row button {
  padding: 0.1rem 0.45rem;
  font-size: 0.8rem;
}

.map-warning {
  flex-basis: 100%;
  margin: 0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--error);
  color: var(--on-accent);
  font-size: 0.85rem;
}

.map-warning[hidden] {
  display: none;
}

.map-hide-hidden .token-faded {
  display: none;
}

.map-overlay-land {
  fill: none;
  stroke: var(--map-land);
  stroke-width: 2;
}

.map-overlay-region {
  fill: var(--map-region);
  stroke: var(--info);
}

.map-overlay-secret {
  stroke: var(--accent);
  stroke-dasharray: 4 3;
}

.map-overlay-name {
  fill: var(--ink);
  font-size: 11px;
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: 3px;
}

.map-overlay-lit {
  fill: #f2c94c;
}

.map-overlay-dark {
  fill: #1c2a55;
}

.map-overlay-sense {
  opacity: 0.32;
}

.map-sense-a {
  fill: #e8c15a;
}

.map-sense-b {
  fill: #5a7fbf;
}

.map-sense-c {
  fill: #ff5a1f;
}

.map-sense-d {
  fill: #4caf7d;
}

.map-overlay-wall {
  stroke-width: 4;
  stroke-linecap: round;
  stroke: #888;
}

.map-overlay-wall.stops-move {
  stroke: #2f7fbf;
}

.map-overlay-wall.stops-senses {
  stroke: #c0392b;
}

.map-overlay-wall.stops-move.stops-senses {
  stroke: #8e44ad;
}

.map-overlay-secret-door {
  stroke: #f1c40f;
  stroke-dasharray: 6 4;
  stroke-width: 6;
}

.map-tools {
  pointer-events: none;
}

.map-regions {
  pointer-events: none;
}

.map-zones {
  pointer-events: none;
}

.map-zone-cell {
  fill-opacity: 0.28;
  stroke: none;
}

.map-zone-plain {
  fill: var(--map-zone);
}

.map-zone-name {
  fill: var(--ink);
  font-size: 12px;
  font-style: italic;
  opacity: 0.8;
}

.wall-hit {
  stroke: transparent;
  stroke-width: 16;
  cursor: not-allowed;
}

.map-run {
  stroke-dasharray: 6 6;
}

.barrier {
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
}

.barrier-open {
  stroke-dasharray: 3 9;
  stroke-width: 4;
}

.barrier-knob circle {
  fill: var(--panel);
  stroke: var(--accent);
  stroke-width: 3;
}

.barrier-knob {
  cursor: pointer;
}

.barrier-knob.barrier-open circle {
  stroke-dasharray: none;
  fill: var(--accent);
}

.barrier-knob.is-chosen circle {
  stroke: var(--info);
  stroke-width: 5;
}

.map-region {
  fill: var(--map-region);
  stroke: var(--info);
  stroke-width: 1;
}

.map-region-name {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.map-options {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  order: 3;
  max-height: 11rem;
  overflow-y: auto;
}

.map-options[hidden] {
  display: none;
}

.map-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.map-option input[type="text"] {
  width: 9rem;
}

.map-option select {
  width: auto;
  max-width: 14rem;
}

.map-option input[type="color"] {
  width: 2rem;
  height: 1.6rem;
  padding: 0;
}

.map-option input[type="checkbox"] {
  width: auto;
}

.map-settings, .map-settings > div, .map-fields {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.map-settings .map-option {
  justify-content: space-between;
}

.wall {
  stroke: var(--map-wall);
  stroke-width: 4;
  stroke-linecap: round;
}

.wall.see-through {
  stroke-dasharray: 2 7;
}

.token {
  cursor: pointer;
  outline: none;
}

.token-yours, .table.with-map .token, .table.tabbed .token {
  cursor: grab;
}

.token.is-held {
  cursor: grabbing;
  opacity: 0.85;
}

.token-shadow {
  fill: #000;
  opacity: 0.28;
}

.token-body {
  stroke: none;
}

.token-mob .token-body {
  stroke: var(--ink);
  stroke-width: 1.5;
}

.token-character .token-body {
  stroke: var(--ink);
  stroke-width: 3.5;
}

.token-scenery {
  opacity: 0.72;
}

.token-scenery .token-shadow {
  opacity: 0.12;
}

.token-label {
  font-weight: 700;
  pointer-events: none;
}

.token-turn, .token-chosen {
  fill: none;
  stroke-width: 3;
  opacity: 0;
}

.token-up .token-turn {
  stroke: var(--accent);
  opacity: 1;
  animation: token-up 1.4s ease-in-out infinite;
}

@keyframes token-up {
  50% {
    opacity: 0.25;
  }
}

.token.is-chosen .token-chosen, .token:focus-visible .token-chosen {
  stroke: var(--info);
  opacity: 1;
}

/* What an action pointed at in a list would act on, outside the chosen ring
   so a token can be both */
.token-target {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 5 3;
  opacity: 0;
}

.token.is-target .token-target {
  opacity: 1;
}

.token-faded .token-body, .token-faded .token-label {
  opacity: 0.5;
}

/* Down, e.g. dead: pale and crossed, beneath the living */
.token-down .token-body, .token-down .token-label {
  opacity: 0.4;
}

.token-down .token-shadow {
  opacity: 0;
}

.token-down-mark line {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.8;
}

.token-hidden circle {
  fill: var(--panel);
  stroke: var(--quiet);
}

.token-hidden path, .token-hidden line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
}

.token-bar-back {
  fill: var(--ink);
  opacity: 0.45;
}

.token-bar-fill {
  fill: var(--info);
}

.token-badge rect {
  fill: var(--panel);
  stroke: var(--ink);
}

.token-badge text {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.map-reach {
  fill: var(--map-reach);
}

.map-pass {
  fill: var(--map-pass);
}

.map-route polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linejoin: round;
}

.map-route rect {
  fill: var(--panel);
  stroke: var(--line);
}

.map-route text {
  fill: var(--ink);
  font-size: 12px;
}

.map-ruler circle {
  fill: var(--accent);
}

.map-choice {
  fill: var(--map-choice);
}

.map-covered {
  fill: var(--map-area);
  stroke: var(--accent);
  stroke-width: 1;
}

.map-ping circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  transform-box: fill-box;
  transform-origin: center;
  animation: map-ping 0.8s ease-out 2 both;
}

.map-ping circle + circle {
  animation-delay: 0.2s;
}

@keyframes map-ping {
  from {
    opacity: 1;
    transform: scale(0.3);
  }

  to {
    opacity: 0;
    transform: scale(2.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-ping circle {
    animation: none;
  }
}

.map-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
}

.map-status {
  flex: 1;
  min-width: 8rem;
  min-height: 1.5em;
  margin: 0;
  color: var(--quiet);
  font-size: 0.9rem;
}

.map-zoom {
  min-width: 3rem;
  text-align: center;
  font-size: 0.9rem;
}

.map-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 0.5rem 1rem;
}

.map-tray[hidden] {
  display: none;
}

.map-zone {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 10rem;
  min-height: 2.5rem;
  padding: 0.25rem 0.4rem;
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.map-zone h3 {
  width: 100%;
  color: var(--quiet);
  font-size: 0.8rem;
  font-weight: 600;
}

.map-empty {
  margin: 0;
  color: var(--quiet);
  font-size: 0.85rem;
}

.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.5rem 0.1rem 0.15rem;
  border-radius: 999px;
  font-size: 0.9rem;
  touch-action: none;
}

.map-dot {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.map-ghost {
  position: fixed;
  z-index: 10;
  width: 2.4rem;
  height: 2.4rem;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.map-list ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

@media (prefers-reduced-motion: reduce) {
  .token-up .token-turn {
    animation: none;
  }
}

/* On a phone the map takes the screen, and the rest folds away under it. */
@media (max-width: 54rem) {
  .play.with-map, .table.with-map {
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
    gap: 0;
  }

  .table.with-map .table-list {
    display: none;
    order: 3;
    margin: 0 0.75rem 0.75rem;
  }

  .table.with-map.unfolded .table-list {
    display: block;
  }

  .map-pane {
    grid-template-rows: auto minmax(22rem, 1fr) auto auto;
    min-height: calc(100dvh - 9rem);
    border: 0;
    border-radius: 0;
  }

  .map-fold {
    display: inline-block;
  }

  .map-middle {
    flex-direction: column;
  }

  .map-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .map-tool {
    min-width: 0;
  }

  .map-side {
    max-height: none;
    padding: 0.75rem;
    overflow: visible;
  }

  .map-side.folded {
    display: none;
  }

  .map-tray {
    max-height: 7rem;
    overflow-y: auto;
  }
}

/* Triggers, for the GM alone. */

.map-overlay-trigger {
  fill: var(--waiting);
  fill-opacity: 0.28;
  stroke: var(--waiting-ink);
  stroke-opacity: 0.5;
  stroke-dasharray: 4 3;
}

.map-overlay-trigger.is-spent {
  fill-opacity: 0.08;
  stroke-opacity: 0.25;
}

.map-trigger-pin path {
  fill: var(--waiting-ink);
  stroke: var(--panel, #fff);
  stroke-width: 1;
}

.map-trigger-pin circle {
  fill: var(--panel, #fff);
}

.map-trigger-pin.is-spent {
  opacity: 0.4;
}

.map-trigger-list {
  display: grid;
  gap: 0.5rem;
  width: 100%;
}

.map-trigger {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.map-trigger > span:not(.map-trigger-state),
.map-trigger > .buttons {
  grid-column: 1 / -1;
}

.map-trigger-state {
  font-size: 0.8rem;
  opacity: 0.8;
}

.map-trigger-off,
.map-trigger-spent {
  opacity: 0.7;
}

.map-trigger-note {
  white-space: pre-wrap;
}

dialog .map-option textarea {
  flex: 1;
  min-width: min(22rem, 60vw);
  font: inherit;
}

@media (min-width: 54.01rem) {
  .map-tool {
    padding-block: 0.15rem;
    font-size: 0.85rem;
  }
}

/* Choosing several, drawing and the keyboard's place on the map. */

.token.is-picked .token-chosen {
  stroke: var(--info);
  opacity: 1;
}

.map-box {
  fill: var(--map-region);
  stroke: var(--info);
  stroke-dasharray: 6 4;
}

.map-drawing {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

text.map-drawing {
  font-size: 16px;
  font-weight: 600;
  paint-order: stroke;
}

.map-drawing.is-secret {
  stroke-dasharray: 2 6;
}

.map-cursor {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
}

/* What is happening now, over the map, as it is what a player is deciding */
.above-map {
  display: grid;
  gap: 0.5rem;
  padding: 1rem 1rem 0;
}

.above-map .view-panel {
  border-color: var(--accent, var(--line));
  border-width: 2px;
}

.has-detail {
  border-bottom: 1px dotted currentColor;
  cursor: help;
}

/* Cards with pictures, in a row which wraps */
.view-panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.game-card {
  width: 5.5rem;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: help;
}

.game-card img {
  display: block;
  width: 100%;
  aspect-ratio: 416 / 576;
  object-fit: cover;
}

.game-card figcaption {
  padding: 0.15rem 0.25rem;
  font-size: 0.75rem;
  line-height: 1.15;
}

.above-map .view-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  align-items: flex-start;
}

.above-map .view-panel > h3, .above-map .view-panel > p {
  flex-basis: 100%;
  margin-block: 0;
}

/* Explain on the sheet (see Explain in ENGINE.md): a value is a button, and its
 * explanation opens below the sheet. */
button.wz-explain {
  padding: 0 0.3rem;
  border-style: dashed;
  font: inherit;
}

button.wz-explain[aria-expanded="true"] {
  border-style: solid;
  border-color: var(--accent);
}

.wz-explain-pane {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--paper);
}

.wz-explain-pane ul {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}

/* A sum, a term to a line, its amounts in a column. */
.wz-explain-pane ul.wz-terms, .why-region ul.why-terms, .why-region ul.why-reads {
  list-style: none;
  padding-left: 0;
}

.wz-term-by, .why-term-by {
  display: inline-block;
  min-width: 3em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* What contributes stands out; what could and does not now is greyed. */
.wz-terms li:not(.wz-nil) > .wz-term-by, .why-terms li:not(.why-nil) > .why-term-by, .why-reads li:not(.why-nil) > .why-term-by {
  font-weight: 700;
}

.wz-nil, .why-nil {
  color: var(--quiet);
}

/* A value's own explanation, opened beneath its line, as a tree. */
.wz-why-sub, .why-sub {
  margin: 0.25rem 0 0.25rem 1.5rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--line);
}

/* A held action on its line of the order (see Readied actions in ENGINE.md). */
.order .held {
  font-size: 0.9em;
  color: var(--quiet);
}

.difficulty {
  font-weight: bold;
}

/* A character's abilities, under each kind (see Abilities in DSL.md) */
.ability-kind {
  margin: 0.6em 0 0.2em;
}

.ability.unready {
  opacity: 0.6;
}

/* Sheets (see Sheets in DSL.md): the plain look of every component, with the page's
 * own colours. A theme's stylesheet, served inside `.sheet[data-themes~=...]`,
 * styles the same class names, and may set the colours for its sheets. */

/* A sheet in a dialog keeps its top where it is, so a shorter page does not
 * move the tabs from under the pointer; and the dialog's own heading names
 * it, so the sheet's is not said twice. */
dialog.with-sheet {
  width: min(90rem, calc(100vw - 2rem));
  margin-top: 1rem;
}

dialog.with-sheet .sheet-title {
  display: none;
}

.sheet {
  display: grid;
  gap: 0.75rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sheet-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.sheet-title {
  margin: 0;
  font-size: 1.4rem;
}

.sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.sheet-tab {
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: var(--paper);
}

.sheet-tab[aria-selected="true"] {
  background: var(--panel);
  color: var(--accent);
  font-weight: 600;
}

.sheet-body {
  display: grid;
  gap: 0.75rem;
}

.sheet-columns {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
}

.sheet-column {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.sheet-column.narrow {
  flex: 1 1 17rem;
}

.sheet-column.medium {
  flex: 2 1 21rem;
}

.sheet-column.wide {
  flex: 3 1 30rem;
}

.sheet-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  background: var(--panel);
  min-width: 0;
}

.sheet-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.sheet-group-title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--quiet);
}

.sheet-group-body {
  display: grid;
  gap: 0.35rem;
}

.sheet-group.scroll .sheet-group-body {
  max-height: 22rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sheet-group.layout-cards .sheet-group-body {
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.5rem;
}

/* A card's name and the small value under it on the left, its stat large on
 * the right, and its rows below, as a printed sheet has them. */
/* The name is never narrower than its longest word, so a large value
 * changing, "+2 → +3", wraps rather than running over it. */
.layout-cards .sheet-card {
  grid-template-columns: minmax(min-content, 1fr) auto;
  column-gap: 0.5rem;
}

/* A large value changing: the new one large, the old one small. */
.sheet-big .was {
  font-size: 0.55em;
}

.layout-cards .sheet-card > .sheet-stat > .sheet-big {
  text-align: end;
}

.layout-cards .sheet-card > * {
  grid-column: 1 / -1;
}

.layout-cards .sheet-card > .sheet-card-title {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.layout-cards .sheet-card > .sheet-stat {
  display: contents;
}

.layout-cards .sheet-card > .sheet-stat > .sheet-label:empty {
  display: none;
}

.layout-cards .sheet-card > .sheet-stat > .sheet-big {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 1.9rem;
}

.layout-cards .sheet-card > .sheet-stat > .sheet-small {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  align-self: start;
}

.layout-cards .sheet-card > .sheet-stat > .why-box {
  grid-column: 1 / -1;
}

.sheet-group.layout-badges .sheet-group-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sheet-group.layout-grid .sheet-group-body {
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
}

/* A group in prose: each row and text a paragraph, its label run in, as a
 * book's stat block sets out its traits and actions. */
.sheet-group.layout-prose .sheet-row {
  display: block;
}

.layout-prose .sheet-row > .sheet-mark.none {
  display: none;
}

.layout-prose .sheet-row > .sheet-label,
.layout-prose .sheet-text-head > .sheet-label {
  color: inherit;
  font-weight: 600;
  font-style: italic;
}

.layout-prose .sheet-row > .sheet-label:not(:empty)::after,
.layout-prose .sheet-text-head > .sheet-label:not(:empty)::after {
  content: ". ";
}

.layout-prose .sheet-row > .sheet-from {
  display: inline;
  margin-inline-end: 0.35rem;
}

.layout-prose .sheet-row > .sheet-value,
.layout-prose .sheet-row > button.why {
  display: inline;
  text-align: start;
}

.layout-prose .sheet-text > .sheet-text-head,
.layout-prose .sheet-text > .sheet-prose {
  display: inline;
}

.sheet-card {
  display: grid;
  gap: 0.25rem;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem;
  background: var(--paper);
}

.sheet-card-title {
  margin: 0;
  font-size: 0.9rem;
}

.sheet-label {
  color: var(--quiet);
}

.sheet-stat {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  min-width: 4.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  text-align: center;
}

.sheet-card .sheet-stat {
  border: none;
  background: none;
}

.sheet-stat .sheet-label {
  font-size: 0.8rem;
}

/* A stat's label is under its value, as on a printed sheet, whether or not
 * it has a shape, and an explanation under both. */
.sheet-stat > .sheet-label {
  order: 1;
}

.sheet-stat > .why-box {
  order: 2;
}

.sheet-big {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.1;
}

.sheet-big button.why {
  font-size: inherit;
  font-weight: inherit;
}

.sheet-small {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 0.5rem;
  font-size: 0.85rem;
}

/* A shaped stat: the value inside the shape, centred in its body, and its
 * label under it, so neither crosses the shape's edges (A human QA pass,
 * 30: the armour's shield and the proficiency's hexagon). */
.sheet-stat.shaped {
  min-width: 6rem;
  padding: 0.4rem 0.9rem 0.25rem;
}

.sheet-stat.shaped > .sheet-big {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.6rem;
  padding: 0.25rem 0 0.5rem;
  font-size: 1.4rem;
}

/* Why it changes wraps to the shape's width, not widening the shape. */
.sheet-stat.shaped .sheet-because {
  max-width: 6rem;
  margin-inline: auto;
}

/* While a character is made, what a choice would make of it stays inside
 * the shape too: the old value small above the new, where "10 → 16" in a
 * line ran out of the shield. The value's label still says "becoming". */
.sheet-stat.shaped .sheet-value.moved {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 0;
  line-height: 1;
}

.sheet-stat.shaped .sheet-value.moved .was {
  font-size: 0.8rem;
}

.sheet-stat.shaped .sheet-value.moved .becomes {
  font-size: 1.4rem;
}

/* And a value still to choose, "Needs Ability scores", wraps small. */
.sheet-stat.shaped .sheet-value.to-choose {
  max-width: 4.5rem;
  font-size: 0.75rem;
  line-height: 1.15;
  white-space: normal;
}

.sheet-stat.shaped .sheet-shape {
  position: absolute;
  inset: 0.2rem 0 1.45rem;
  width: 100%;
  height: calc(100% - 1.65rem);
  /* Its own proportions, not stretched to the badge: a squashed shield's
   * top edge ran through the number */
  object-fit: contain;
  opacity: 0.35;
  pointer-events: none;
}

.sheet-stat.shaped > :not(.sheet-shape) {
  position: relative;
}

/* The mark, the label, where it came from, and the value. Short of room, the
 * source gives way, cut short with its whole name in its tooltip, so it never
 * runs over the label or the value. */
.sheet-row {
  display: grid;
  grid-template-columns: 1rem auto minmax(0, max-content) 1fr;
  align-items: baseline;
  gap: 0.35rem;
}

.sheet-row > .sheet-from {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  justify-self: start;
}

/* A long value, such as an attack, wraps between its words rather than run
 * past the sheet's edge on a phone; it is never narrower than its longest
 * word, so a source beside it gives way first. */
.sheet-row > .sheet-value,
.sheet-row > button.why {
  justify-self: end;
  text-align: end;
  overflow-wrap: break-word;
}

/* A row with no source keeps its value in the last column. */
.sheet-row > .sheet-value:nth-child(3),
.sheet-row > button.why:nth-child(3) {
  grid-column: 4;
}

.sheet-row > .why-box {
  grid-column: 1 / -1;
}

.sheet-row:hover {
  background: var(--paper);
}

.sheet-mark {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border: 1.5px solid var(--quiet);
  transform: rotate(45deg);
}

.sheet-mark.none {
  visibility: hidden;
}

.marked > .sheet-mark,
.sheet-key-item > .sheet-mark,
.sheet-chip > .sheet-mark,
.sheet-entry .sheet-mark,
.sheet-ability > .sheet-mark,
.sheet-ability summary > .sheet-mark {
  border-color: var(--accent);
  background: var(--accent);
}

/* An ability's description and source, opened from its name as an
 * explanation is: dotted underneath, like any value which says why. */
.sheet-ability-more > summary {
  cursor: pointer;
  list-style: none;
}

.sheet-ability-more > summary::-webkit-details-marker {
  display: none;
}

.sheet-ability-more > summary strong {
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

.sheet-ability-more > p {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.9em;
}

.marked > button.why,
.marked > .sheet-value {
  color: var(--accent);
}

.sheet-from {
  display: inline-block;
  margin-inline: 0.3rem;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--quiet);
}

/* A value which can say how it was worked out: dotted underneath, as the
 * design has it, and pressed to explain (see Explain in ENGINE.md). */
.sheet button.sheet-value.asks {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--quiet);
  text-underline-offset: 0.2em;
  cursor: help;
}

/* A value which opens another page of the sheet, as a line under Attacks
 * opens Spells: a link's solid underline, not Explain's dotted one, and an
 * arrow saying it goes somewhere. */
.sheet button.sheet-value.sheet-opens {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  text-align: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.sheet button.sheet-value.sheet-opens::after {
  content: " ›";
}

.sheet button.sheet-value.asks[aria-expanded="true"] {
  text-decoration-style: solid;
  text-decoration-color: var(--accent);
}

.sheet-asks-sample {
  text-decoration: underline dotted;
  text-decoration-color: var(--quiet);
  text-underline-offset: 0.2em;
}

.sheet-value.hidden,
.sheet-value.failed {
  color: var(--quiet);
}

.sheet-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.sheet-track > .why-box {
  flex-basis: 100%;
}

.sheet-of {
  flex: none;
  white-space: nowrap;
}

.sheet-meter {
  flex: 1 1 6rem;
  min-width: 4rem;
  height: 0.8rem;
}

.sheet-pips {
  display: inline-flex;
  gap: 0.2rem;
}

.sheet-pips .pip {
  width: 0.7rem;
  height: 0.7rem;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
}

.sheet-track.boxes .pip {
  border-radius: 2px;
}

.sheet-pips .pip.full {
  background: var(--accent);
}

.sheet-chips-part,
.sheet-abilities {
  display: grid;
  gap: 0.25rem;
}

.sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sheet-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.sheet-text-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.sheet-eye {
  font-size: 0.8rem;
  color: var(--quiet);
}

.sheet-prose {
  white-space: pre-wrap;
  font-style: italic;
}

.sheet-notes {
  width: 100%;
  min-height: 8rem;
  box-sizing: border-box;
  font: inherit;
}

.sheet-list {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.sheet-list-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.sheet-filter[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.sheet-list-table {
  width: 100%;
  border-collapse: collapse;
}

.sheet-list-table th,
.sheet-list-table td {
  padding: 0.2rem 0.35rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.sheet-list-heading th {
  color: var(--quiet);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.sheet-entry.chosen {
  background: var(--paper);
}

.sheet-entry-art {
  display: block;
  width: 4.5rem;
  margin-bottom: 0.2rem;
  border-radius: 4px;
}

.sheet-group.compact .sheet-entry-art {
  display: none;
}

button.sheet-entry-name {
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted;
  cursor: pointer;
}

.sheet-group.compact .sheet-entry-about {
  display: none;
}

.sheet-detail {
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
}

.sheet-act .why {
  display: block;
  font-size: 0.8rem;
}

.sheet-abilities ul,
.sheet-seats,
.sheet-figure-side {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sheet-journal h4,
.sheet-preview h4 {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

.sheet-journal-lines {
  margin: 0;
  padding-left: 1.2rem;
}

.sheet-preview .was {
  text-decoration: line-through;
  color: var(--quiet);
}

.sheet-preview .becomes {
  color: var(--info);
  font-weight: 600;
}

/* The picture gives way before the callouts, so a figure fits a narrow
 * column: Fifth's, while a character is made, at 1440 pixels. */
.sheet-figure {
  display: grid;
  grid-template-columns: minmax(min-content, 1fr) minmax(3.5rem, 0.8fr) minmax(min-content, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.sheet-figure-picture {
  position: relative;
  width: 100%;
  max-width: 10rem;
  justify-self: center;
}

.sheet-figure-picture img {
  display: block;
  width: 100%;
}

.sheet-figure-worn {
  position: absolute;
  inset: 0;
}

.sheet-figure-anchors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sheet-anchor {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  opacity: 0;
}

.sheet-anchor.filled {
  opacity: 0.45;
}

.sheet-anchor.lit {
  opacity: 1;
}

.sheet-figure-side {
  display: grid;
  gap: 0.4rem;
}

.sheet-figure-side.left {
  text-align: right;
}

.sheet-slot {
  display: grid;
  border-bottom: 1px solid var(--line);
}

.sheet-slot.empty {
  border-bottom-style: dashed;
  color: var(--quiet);
}

.sheet-slot .sheet-label {
  font-size: 0.8rem;
}

.sheet-errors {
  color: var(--error);
}

.sheet-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 0.4rem;
  font-size: 0.85rem;
}

.sheet-key-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.sheet-swatch {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--quiet);
}

@media (max-width: 40rem) {
  .sheet-columns {
    display: grid;
  }

  .sheet-figure {
    grid-template-columns: 1fr;
  }

  /* Its slots say what is held; the picture is small, so the scores are
   * not a screen away. */
  .sheet-figure-picture {
    max-width: 5rem;
  }

  .sheet-figure-side.left {
    text-align: left;
  }
}

/* A sheet beside the steps of making a character (see The sheet in character creation in
 * ENGINE.md). */

/* With a sheet of the game system's own, the wizard takes the width of the
 * screen. Beside the steps is one column: the step, what a choice changes,
 * then the whole sheet, as the library shows it, with the budgets in the bar
 * (see One column in docs/REVIEW_SHEET_LAYOUT.md). */
.wz.with-form {
  max-width: 120rem;
}

/* What a choice changes keeps one height while choices are pointed at, so
 * the sheet under it never moves as the pointer crosses a list: its box is
 * drawn over the sheet's top when it says more than fits, with the same
 * borders whether it has something to say or not. On Review, where nothing
 * is pointed at, it takes the room it needs. */
.wz-changes {
  position: relative;
  font-size: 0.9rem;
}

.wz-changes:not(.wz-changes-review) {
  height: 3.25rem;
}

.wz-changes:not(.wz-changes-review) .wz-changes-box {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  min-height: 100%;
}

.wz-changes-box {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  border-width: 2px 2px 2px 6px;
  box-shadow: 0 2px 6px rgb(0 0 0 / 8%);
}

/* It stands out while there is something to say: the step's own colour
 * for information, and a brief glow as it appears, so it is not missed
 * between the step and the sheet. */
.wz-changes-box.has-changes {
  border-color: var(--info);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 18%, transparent), 0 4px 10px rgb(0 0 0 / 15%);
  animation: wz-changes-in 0.4s ease-out;
}

@keyframes wz-changes-in {
  from {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--info) 35%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wz-changes-box.has-changes {
    animation: none;
  }
}

.wz-changes ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wz-changes-said {
  color: var(--info);
  font-weight: 600;
}

.wz-changes strong {
  color: var(--info);
}

.wz-changes .wz-was {
  text-decoration: line-through;
  color: var(--quiet);
}

/* The budgets in the bar: one line, each a label and what is left. */
.wz-bar .wz-budgets {
  position: static;
  order: 0;
  flex: 1 1 auto;
  padding: 0;
  border: none;
  background: none;
}

.wz-bar .wz-budgets h3, .wz-bar .wz-budgets .wz-short {
  display: none;
}

.wz-bar .wz-budgets .wz-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  font-size: 0.95rem;
}

.wz-bar .wz-budgets .wz-line {
  grid-template-columns: auto auto;
  gap: 0 0.5rem;
}

/* With nothing to point with, each option says what it changes in words
 * beside it, so the strip has nothing to show. */
@media (hover: none) {
  .wz-changes {
    display: none;
  }
}

/* On a phone the column is the page's: the step, what a choice changes,
 * then the sheet, with the bar and its budgets held at the top. */
@media (max-width: 54rem) {
  .wz-col {
    display: contents;
  }

  .wz-changes {
    order: 3;
  }

  .wz.with-form .wz-bar {
    position: sticky;
    top: 0;
    z-index: 6;
  }

  .wz-bar .wz-budgets {
    flex-basis: 100%;
  }
}

@media (min-width: 54.01rem) {
  .wz.with-form .wz-grid {
    grid-template-columns: 13rem minmax(0, 1fr);
  }

  /* Each part keeps its own height, the column scrolling, so the step is
   * never squeezed by a long sheet under it. */
  .wz-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .wz-col > * {
    flex: none;
  }

  /* The step at its own height, a long list scrolling inside it, so what a
   * choice changes is in sight under it. */
  .wz.with-form .wz-col .wz-step {
    max-height: 55vh;
    max-height: 55dvh;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  /* Options two or three a row, with the room the column has. */
  .wz.with-form .wz-picks {
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  }

  /* What a choice changes stays in sight while the sheet scrolls under it. */
  .wz.with-form .wz-changes {
    position: sticky;
    top: 0;
    z-index: 4;
  }

  /* The wizard fills the screen, and no more: the bar on top, and the steps,
   * the step and the sheet each scrolling by itself. The page never scrolls,
   * so the foot of each is always in sight, and where one step was scrolled
   * to is not where the next starts. */
  .wz.with-form {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding-bottom: 0.75rem;
  }

  .wz.with-form .wz-grid {
    flex: 1 1 0;
    min-height: 0;
    align-items: stretch;
  }

  .wz.with-form .wz-grid > * {
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  /* The step stays at the top of its pane, rather than spread down it,
   * with Back and Next in sight at its foot however long its list. */
  .wz.with-form .wz-step {
    align-content: start;
  }

  .wz.with-form .wz-step .wz-nav {
    position: sticky;
    bottom: -0.75rem;
    z-index: 2;
    margin: 0 -0.75rem -0.75rem;
    padding: 0.75rem;
    background: var(--panel);
  }

  .wz.with-form .wz-side {
    position: relative;
    top: auto;
    align-content: start;
  }

  /* An explanation stays in sight at the foot of the sheet's pane. */
  .wz.with-form .wz-explain-pane {
    position: sticky;
    bottom: 0;
    z-index: 3;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 -2px 8px rgb(0 0 0 / 15%);
  }

}

.sheet-group.filled-now {
  box-shadow: inset 0 0 0 2px var(--info);
}

.sheet-group.needs-step .sheet-group-title::after {
  content: " !";
  color: var(--error);
}

.sheet-filled-by {
  font-size: 0.8rem;
  color: var(--info);
}

.sheet-open-step {
  font-size: 0.8rem;
}

.sheet-value.moved .was {
  text-decoration: line-through;
  color: var(--quiet);
}

.sheet-value.moved .becomes {
  color: var(--info);
  font-weight: 600;
}

.sheet-small .sheet-because {
  display: none;
}

.sheet-because {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--info);
  white-space: normal;
}

button.sheet-value.to-choose {
  white-space: nowrap;
  border-style: dashed;
  color: var(--info);
  font: inherit;
  font-size: 0.85rem;
}

/* In a card or a badge it wraps, not past the card's edge. */
.sheet-card button.sheet-value.to-choose, .layout-badges button.sheet-value.to-choose {
  max-width: 100%;
  white-space: normal;
}

.sheet-slot button.sheet-value.to-choose {
  padding: 0.1rem 0.3rem;
  font-size: 0.8rem;
  white-space: normal;
}

.sheet-value.to-choose-again {
  color: var(--quiet);
}

/* Make a character, apart from the heading above it and the lists below. */
.making {
  margin: 0.5rem 0 1rem;
}

/* The turn order as a tracker, pinned at the top of the GM's column (see
   The GM's table on the page in PAGE.md): each slot its Initiative, its name, whether it is up or on
   deck, and its entity's line. */
.turns-panel {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  max-height: 50dvh;
  overflow-y: auto;
}

.turns-panel .order {
  padding-left: 0;
  list-style: none;
}

.turns-panel .order li {
  display: block;
  padding: 0.3rem 0.4rem;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--line);
}

.turns-panel .order li.now {
  border-left-color: var(--accent);
  background: var(--paper);
}

.turns-panel .order li.on-deck {
  border-left-color: var(--line);
}

.slot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.slot-initiative {
  min-width: 1.6rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--quiet);
}

button.slot-name {
  width: auto;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline dotted;
}

button.slot-name[aria-current] {
  text-decoration: underline;
}

.slot-mark {
  padding: 0 0.35rem;
  border-radius: 0.6rem;
  font-size: 0.8em;
  font-weight: normal;
}

.slot-mark.up {
  background: var(--accent);
  color: var(--on-accent);
}

.slot-mark.deck {
  border: 1px solid var(--line);
  color: var(--quiet);
}

/* A form: a line is one row, smaller than a page's parts. */
.sheet-form.form-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.6rem;
  margin: 0.2rem 0 0 1.9rem;
  font-size: 0.9em;
  font-weight: normal;
}

.sheet-form.form-line .sheet-stat,
.sheet-form.form-line .sheet-row,
.sheet-form.form-line .sheet-track,
.sheet-form.form-line .sheet-chips-part {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}

.sheet-form.form-line .sheet-big {
  font-size: 1em;
}

.sheet-form.form-line .sheet-mark.none,
.sheet-form.form-line .sheet-chips-part > .sheet-label,
.sheet-form.form-line .sheet-track > .sheet-label {
  display: none;
}

.sheet-form.form-line .sheet-meter {
  width: 4rem;
}

.sheet-form.form-line .sheet-chips {
  margin: 0;
}

.sheet-form.form-line > .why-box:empty {
  display: none;
}

.sheet-form.form-line .sheet-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: none;
}

.sheet-form.form-line .sheet-actions > .sheet-label {
  display: none;
}

.sheet-form.form-line .sheet-act {
  width: auto;
  padding: 0.05rem 0.45rem;
  font-size: 0.85em;
}

/* The GM's chosen entity: its line under its name, then its sheet, whose
   own title the panel's heading already gives (see The GM's table on the page in PAGE.md). */
.detail > .sheet-form.form-line {
  margin: 0 0 0.4rem;
}

.detail > .sheet > .sheet-head {
  display: none;
}

.detail .edit-values {
  margin: 0.5rem 0;
}

.detail .edit-values > summary {
  cursor: pointer;
  color: var(--quiet);
}

/* Another sheet inside one: a stat block in a monster's sheet. */
.sheet-embedded {
  display: grid;
  gap: 0.5rem;
}

.sheet-embedded-title {
  margin: 0;
}

/* The world list as the scene (see The GM's table on the page in PAGE.md): each thing on a line, what
   it holds folded under it by its holder, and a search box beside Lines. */
.world-search,
.status-search {
  width: 100%;
  margin: 0.25rem 0 0.5rem;
}

.world-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.world-tools .world-search {
  flex: 1;
  min-width: 0;
}

.world-tools button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* A place folded in the world list: its name and how much is in it */
.table-list details.world-place > summary {
  cursor: pointer;
}

.table-list details.world-place > button {
  margin: 0.2rem 0;
}

.table-list .holds-label {
  margin: 0.35rem 0 0.1rem;
  color: var(--quiet);
  font-size: 0.85em;
  font-variant: small-caps;
}

.table-list details.holds ul {
  margin: 0;
}

/* What a thing holds is smaller than the things in a place */
.table-list details.holds .pick-head button {
  min-height: 0;
  padding: 0.1rem 0.45rem;
  font-size: 0.9em;
}

.table-list details.holds li.pick {
  margin: 0.1rem 0;
}

.table-list li.pick {
  display: block;
}

.table-list .pick-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.table-list .sheet-form.form-line {
  margin: 0.1rem 0 0.3rem 1.6rem;
}

.table-list details.holds {
  margin: 0 0 0.3rem 1.6rem;
}

.table-list details.holds > summary {
  cursor: pointer;
  color: var(--quiet);
  font-size: 0.9em;
}

/* The party: each seated character by its card. */
.party-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.party-card {
  border-radius: 0.4rem;
  background: var(--panel);
}

.party-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.party-card-head .slot-name {
  font-weight: 600;
}

.party-card-kind {
  margin: -0.2rem 0 0.35rem;
  color: var(--quiet);
  font-size: 0.85em;
}

.party-panel li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
}

.party-panel li.party-card {
  padding: 0.5rem;
  border: 1px solid var(--line);
}

.party-panel .sheet-form.form-card {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.2rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.9em;
}

/* A creature's line in its card lines up with a character's card, not
   under a name to its left as in a list */
.party-card .sheet-form.form-line {
  margin: 0;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.party-panel .sheet-form.form-card.drawn-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.6rem;
}

.party-panel .sheet-form .sheet-chips-part > .sheet-label,
.party-panel .sheet-form .sheet-track > .sheet-label,
.party-panel .sheet-form .sheet-actions > .sheet-label {
  display: none;
}

.party-panel .sheet-form .sheet-meter {
  width: 4rem;
}

/* A game's conditions, first among the statuses to start. */
.status-picker button.condition {
  font-weight: bold;
}

/* What a search hides stays hidden, whatever its display. */
[hidden] {
  display: none !important;
}

/* A token's card, while the pointer is over it (see The GM's table on the page in PAGE.md). */
.map-card {
  position: fixed;
  z-index: 20;
  max-width: 18rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  font-size: 0.9em;
}

.map-card .sheet-form {
  display: grid;
  gap: 0.2rem;
}

.map-card .form-title {
  font-weight: bold;
}

.map-card .sheet-meter {
  width: 5rem;
}

/* What the rules did in the turns they took, under the tracker (see
   The GM's table on the page in PAGE.md): each turn's Event Log lines, with Undo beside it. */
.rules-did {
  max-height: 40dvh;
  overflow-y: auto;
}

.rules-turn {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
}

.rules-turn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.rules-turn-head button {
  width: auto;
}

.rules-turn .lines p {
  margin: 0.15rem 0;
}

/* The GM's screen in columns of panels (see Windows in PAGE.md). A panel
   lays out as its parts do, in its column. */
.table-column {
  display: grid;
  align-content: start;
  gap: 1rem;
  min-width: 0;
}

.table-panel {
  display: contents;
}

.table.columns-1 {
  grid-template-columns: minmax(0, 1fr);
}

.table.columns-2 {
  grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr);
}

/* Opening a panel in a window of its own (see Windows in PAGE.md). */
button.panel-out {
  justify-self: end;
  width: auto;
}

/* A player's panels (see A player's windows in PAGE.md): each a box of its
   parts, under its Open in a window. */
.play-panel {
  display: grid;
  align-content: start;
  gap: 1rem;
  min-width: 0;
}

.play.alone {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
}

.map-out:empty {
  display: none;
}

/* A phone cannot put a window beside another. */
@media (max-width: 54rem) {
  .play button.panel-out,
  #dialog-body button.panel-out,
  .map-out {
    display: none;
  }
}

/* A table display: the map for a screen the players see, as one of them
   sees it, with none of the GM's tools (see Windows in PAGE.md). */
.table.display .map-toolbar,
.table.display .map-head > :not(h2),
.table.display .map-bar,
.table.display .map-tray,
.table.display .map-options {
  display: none;
}

.table.display .map-stage {
  pointer-events: none;
}

/* Action modifiers: a row of switches for each group (see Action modifiers
   on the page in PAGE.md) */
.modifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin-bottom: 0.4rem;
}
.modifiers button.modifier.on {
  outline: 2px solid var(--accent, currentColor);
  font-weight: bold;
}

/* The Graph view: a scenario's blocks and wires (see The graph in MVP44.md) */
.graph-view {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100vh;
}

/* In the workshop's Graph tab, under its header, not a page of its own */
.ws-graph .graph-view {
  padding: 0;
  min-height: 0;
}

.graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.graph-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.graph-tabs {
  display: flex;
  gap: 0.25rem;
}

.graph-tabs button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.graph-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem 1rem;
}

.graph-ask label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.graph-ask input[type="number"] {
  width: 4.5rem;
}

.graph-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26rem;
  gap: 0.75rem;
  flex: 1;
}

.graph-main {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.graph-tools {
  display: flex;
  gap: 0.25rem;
}

.graph-canvas {
  border: 1px solid var(--line);
  background: var(--panel);
  height: 62vh;
  overflow: hidden;
}

.graph-drawing {
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

.graph-wire {
  fill: none;
  stroke: var(--quiet);
  stroke-width: 2;
}

.graph-wire.reads {
  stroke-dasharray: 6 4;
}

.graph-wire.changes {
  stroke: var(--error);
  stroke-width: 3;
}

.graph-wire.emits,
.graph-wire.hears {
  stroke: var(--info);
}

/* Three groups by colour, each kind in one by its dashes: what a
   definition gives, what a status does, and what a roll meets */
.graph-wire.grants,
.graph-wire.holds,
.graph-wire.offers,
.graph-wire.makes {
  stroke: var(--accent);
}

.graph-wire.starts,
.graph-wire.ends,
.graph-wire.has {
  stroke: var(--map-zone);
}

.graph-wire.modifies,
.graph-wire.rolls,
.graph-wire.grades {
  stroke: var(--info);
}

.graph-wire.grants,
.graph-wire.starts,
.graph-wire.modifies {
  stroke-dasharray: 2 3;
}

.graph-wire.holds,
.graph-wire.ends,
.graph-wire.rolls {
  stroke-dasharray: 9 4;
}

.graph-wire.offers,
.graph-wire.has,
.graph-wire.grades {
  stroke-dasharray: 9 3 2 3;
}

.graph-wire.makes {
  stroke-dasharray: 1 2;
}

.graph-node {
  cursor: pointer;
}

/* A wire is pointed at by a wider line over it, which is not seen */
.graph-wire-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 12;
  pointer-events: stroke;
  cursor: pointer;
}

.graph-wire-at:hover .graph-wire,
.graph-wire-at:focus .graph-wire,
.graph-wire-at.chosen .graph-wire {
  stroke-width: 4;
  filter: drop-shadow(0 0 2px var(--accent));
}

.graph-wire-at:focus {
  outline: none;
}

.graph-source.marked {
  background-image: linear-gradient(
    to bottom,
    transparent calc(0.5rem + var(--mark) * 1.35em),
    var(--waiting) calc(0.5rem + var(--mark) * 1.35em),
    var(--waiting) calc(0.5rem + (var(--mark) + 1) * 1.35em),
    transparent calc(0.5rem + (var(--mark) + 1) * 1.35em)
  );
  background-attachment: local;
}

.graph-places {
  list-style: none;
  padding: 0;
  margin: 0 0 0.4rem;
  max-height: 12rem;
  overflow: auto;
}

.graph-place {
  width: 100%;
  text-align: left;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.graph-place[aria-pressed="true"] {
  border-color: var(--accent);
}

.graph-key-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.1rem 0.3rem;
  border: 1px solid transparent;
  background: none;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.graph-key-item:hover,
.graph-key-item:focus-visible {
  border-color: var(--line);
}

.graph-key-item.off {
  opacity: 0.45;
  text-decoration: line-through;
}

/* Each kind its own light colour, with dark text, in either scheme */
.graph-node rect {
  fill: #eeeeee;
  stroke: #777777;
}

.graph-node text {
  fill: #222222;
}

.graph-node text.kind {
  font-size: 10px;
  fill: #555555;
}

.graph-node.k-attribute rect { fill: var(--kind-attribute); }
.graph-node.k-derived rect { fill: var(--kind-derived); }
.graph-node.k-event rect { fill: var(--kind-event); }
.graph-node.k-action rect { fill: var(--kind-action); }
.graph-node.k-command rect { fill: var(--kind-command); }
.graph-node.k-ask rect { fill: var(--kind-ask); }
.graph-node.k-rule rect { fill: var(--kind-rule); }
.graph-node.k-watcher rect { fill: var(--kind-watcher); }
.graph-node.k-reaction rect { fill: var(--kind-reaction); }
.graph-node.k-procedure rect { fill: var(--kind-procedure); }
.graph-node.k-function rect { fill: var(--kind-function); }
.graph-node.k-definition rect { fill: var(--kind-definition); }
.graph-node.k-status rect { fill: var(--kind-status); }
.graph-node.k-roll_modifier rect { fill: var(--kind-roll-modifier); }
.graph-node.k-roll_tag rect { fill: var(--kind-roll-tag); }
.graph-node.k-outcome rect { fill: var(--kind-outcome); }
.graph-node.k-encounter rect { fill: var(--kind-encounter); }

.graph-node rect.behind {
  opacity: 0.75;
}

/* A design's own blocks, apart from its game system's: a heavy edge */
.graph-node.own rect {
  stroke: #222222;
  stroke-width: 2.5;
}

.graph-node:hover rect,
.graph-node:focus rect {
  stroke: var(--accent);
  stroke-width: 2;
}

.graph-node:focus {
  outline: none;
}

.graph-node.chosen rect {
  stroke: var(--accent);
  stroke-width: 3;
}

.graph-side h3 {
  margin-top: 0;
  overflow-wrap: anywhere;
}

.graph-side dd {
  margin: 0 0 0.4rem;
  overflow-wrap: anywhere;
}

.graph-offers {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.graph-key {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
}

.graph-key summary {
  cursor: pointer;
}

.graph-key-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 0 1.5rem;
}

.graph-key h4 {
  margin: 0.4rem 0 0.2rem;
}

.graph-key ul {
  list-style: none;
  margin: 0 0 0.3rem;
  padding: 0;
}

.graph-key li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.5rem;
}

.graph-key li svg {
  flex: none;
}

.graph-key-how {
  margin-left: 0.6rem;
  font-size: 0.8rem;
  color: var(--quiet);
}

.graph-key-all {
  margin-left: 0.6rem;
  padding: 0 0.4rem;
  font-size: 0.8rem;
}

.graph-key-times {
  font-family: ui-monospace, monospace;
  min-width: 34px;
  text-align: center;
}

/* A block's HCL, highlighted, in either scheme */
.hcl-comment { color: var(--quiet); font-style: italic; }
.hcl-string { color: #2e7d32; }
.hcl-interp { color: #6a1b9a; }
.hcl-number { color: #b45309; }
.hcl-keyword { color: #1d4ed8; font-weight: 600; }
.hcl-block { color: var(--accent); font-weight: 600; }
.hcl-attr { color: var(--info); }

@media (prefers-color-scheme: dark) {
  .hcl-string { color: #9ccc65; }
  .hcl-interp { color: #ce93d8; }
  .hcl-number { color: #fbbf24; }
  .hcl-keyword { color: #93c5fd; }
}

.graph-file-header {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.85rem;
  white-space: pre-line;
}

.graph-pop {
  margin-bottom: 0.3rem;
}

dialog.with-source {
  width: min(70rem, calc(100vw - 2rem));
}

dialog.with-source .graph-source {
  max-height: calc(100vh - 9rem);
  font-size: 0.85rem;
}

.graph-written h4 {
  margin: 0.8rem 0 0.2rem;
}

.graph-source {
  margin: 0;
  padding: 0.5rem;
  max-height: 40vh;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  line-height: 1.35;
  white-space: pre;
  tab-size: 2;
}

.graph-row {
  border-collapse: collapse;
  font-size: 0.85rem;
  width: 100%;
}

.graph-row th,
.graph-row td {
  border-bottom: 1px solid var(--line);
  padding: 0.15rem 0.4rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.graph-row th {
  font-family: ui-monospace, monospace;
  font-weight: normal;
  color: var(--quiet);
  white-space: nowrap;
}

.graph-stack {
  padding-left: 1.1rem;
  max-height: 50vh;
  overflow: auto;
}

/* A design's own blocks, each a way in */
.graph-own h4 {
  margin: 0.6rem 0 0.2rem;
}

.graph-own ul {
  padding-left: 1.1rem;
  margin: 0;
}

.graph-list ul {
  padding-left: 1.2rem;
}

.graph-list li {
  margin-bottom: 0.8rem;
}

.graph-machine {
  border-top: 1px solid var(--line);
  padding: 0.4rem 0;
}

.graph-machine h3 {
  margin: 0.2rem 0;
  font-size: 1rem;
}

.no-way-out {
  color: var(--error);
}

@media (max-width: 760px) {
  .graph-body {
    grid-template-columns: 1fr;
  }
}

/* The workshop: a GM's designs, and each file as text and structure (see
   The workshop in MVP44.md) */
.workshop-panel .designs {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}

/* A design a row: its name, its game system and files, and Open, each in
 * its column, so Open is in one place down the list. */
.workshop-panel .designs li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.25rem 0.75rem;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
}

.workshop-panel .designs li.hint {
  display: block;
  border: none;
}

.workshop-panel .design-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.workshop {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100vh;
  /* Centred on a very large screen, not kept to its left edge */
  max-width: 140rem;
  margin: 0 auto;
  box-sizing: border-box;
}

/* What the workshop says, at the foot of the screen, over the work, so it
 * never moves it; clicks go through it to what is under */
.workshop > .said {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 20;
  transform: translateX(-50%);
  max-width: min(48rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 6px 24px rgb(0 0 0 / 25%);
  pointer-events: none;
}

.workshop > .said:empty {
  display: none;
}

.workshop > .said.error {
  border-color: var(--error);
}

.ws-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.ws-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.ws-header .buttons {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* The buttons which make a world, set apart from the rest */
.ws-makes-world {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--line);
}

.ws-makes-world .hint {
  font-size: 0.85rem;
}

/* The workshop's text boxes for words, such as read-aloud and notes, read
 * as words, as tall as what is in them, not as code */
.workshop textarea:not(.ws-text) {
  width: 100%;
  min-height: 4.5em;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  font: inherit;
  line-height: 1.4;
  resize: vertical;
  field-sizing: content;
}

.ws-header .kept {
  color: var(--quiet);
  font-size: 0.9rem;
}

.file-button input[type="file"] {
  max-width: 14rem;
}

.ws-more {
  position: relative;
}

.ws-more summary {
  cursor: pointer;
  list-style: none;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.ws-more summary::-webkit-details-marker {
  display: none;
}

.ws-more summary::after {
  content: " ▾";
}

.ws-more-list {
  position: absolute;
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.3rem;
  padding: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  min-width: 12rem;
}

.ws-more-list .danger {
  margin-top: 0.4rem;
  color: var(--error);
  border-color: var(--error);
}

button[aria-busy="true"] {
  cursor: progress;
}

/* On a phone, the header's buttons in one row, smaller */
@media (max-width: 760px) {
  .ws-header {
    gap: 0.3rem 0.6rem;
  }

  .ws-header h1 {
    font-size: 1.1rem;
    flex-basis: 100%;
    order: 1;
  }

  .ws-header .kept {
    order: 2;
  }

  .ws-header .buttons {
    order: 3;
    margin-left: 0;
    gap: 0.3rem;
  }

  .ws-header .buttons button,
  .ws-more summary {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
  }
}

.ws-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 760px) {
  .ws-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ws-side h2,
.ws-check h2,
.ws-file-bar h2 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

.ws-files {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
}

.ws-files button {
  width: 100%;
  text-align: left;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  background: none;
  border: 1px solid transparent;
  overflow-wrap: anywhere;
}

.ws-files li.chosen button {
  border-color: var(--line);
  background: var(--panel);
  font-weight: 600;
}

.ws-check {
  margin-top: 1rem;
}

.ws-check .ok {
  color: var(--info);
}

.ws-problems {
  padding-left: 1.1rem;
  font-size: 0.85rem;
}

.ws-problems li {
  margin-bottom: 0.3rem;
  overflow-wrap: anywhere;
}

.ws-problems li.error::marker {
  color: var(--error);
}

/* An error is said in the error colour, its help quieter */
.ws-check p.error, .ws-problems li.error {
  color: var(--error);
}

.ws-problems li.error .hint {
  color: var(--quiet);
}

.party-first {
  display: grid;
  gap: 0.5rem;
  justify-items: start;
  margin: 0.5rem 0;
}

.ws-problems li.warning::marker {
  color: var(--waiting-ink);
}

.ws-problems button {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  padding: 0 0.3rem;
}

.ws-file-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.5rem;
}

.ws-file-bar h2 {
  margin: 0 auto 0 0;
  font-family: ui-monospace, monospace;
}

.ws-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
}

.ws-panes[data-view="text"] .ws-pane-structure,
.ws-panes[data-view="structure"] .ws-pane-text,
.ws-panes[data-view="text-blocks"] .ws-pane-structure,
.ws-panes[data-view="blocks"] .ws-pane-text,
.ws-panes[data-view="blocks"] .ws-pane-structure,
.ws-panes:not([data-view$="blocks"]) .ws-pane-blocks {
  display: none;
}

/* One pane, the width of both (a review found Text and Structure blank:
 * their selectors had run into the rule above, hiding the panes) */
.ws-panes[data-view="text"],
.ws-panes[data-view="structure"],
.ws-panes[data-view="blocks"] {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1000px) {
  .ws-panes {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ws-text {
  width: 100%;
  min-height: 70vh;
  box-sizing: border-box;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  tab-size: 2;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.5rem;
  resize: vertical;
}

.ws-structure {
  max-height: 75vh;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0.5rem;
  font-size: 0.9rem;
}

.ws-structure.stale {
  opacity: 0.5;
}

.ws-block {
  border-left: 3px solid var(--line);
  padding: 0.2rem 0 0.2rem 0.6rem;
  margin: 0.3rem 0;
}

.ws-block > summary {
  cursor: pointer;
  font-family: ui-monospace, monospace;
}

.ws-ident {
  color: var(--accent);
  font-weight: 600;
}

.ws-body {
  margin-left: 0.3rem;
}

.ws-comment {
  margin: 0.1rem 0;
  color: var(--quiet);
  font-style: italic;
  font-size: 0.85rem;
  white-space: pre-line;
}

.ws-attribute {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.5rem;
  margin: 0.15rem 0;
}

.ws-attribute .ws-comment {
  flex-basis: 100%;
}

.ws-attribute label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 18rem;
  min-width: 0;
}

.ws-key {
  font-family: ui-monospace, monospace;
  min-width: 7rem;
}

.ws-attribute input,
.ws-grid input {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  min-width: 0;
  flex: 1;
}

.ws-tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.ws-tools button,
.ws-add button {
  font-size: 0.75rem;
  padding: 0.05rem 0.4rem;
}

.ws-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0.3rem 0;
}

.ws-add input {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

.ws-add label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--quiet);
}

.ws-menu {
  display: inline-block;
  position: relative;
}

.ws-menu summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
}

.ws-menu summary::-webkit-details-marker {
  display: none;
}

.ws-menu[open] {
  display: inline-flex;
  align-items: center;
}

.ws-menu[open] .ws-menu-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-left: 0.2rem;
}

.ws-text-value {
  font-family: inherit;
}

.ws-add-top {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.ws-grid-scroll {
  overflow-x: auto;
}

.ws-grid {
  border-collapse: collapse;
  font-size: 0.8rem;
}

.ws-grid th {
  font-family: ui-monospace, monospace;
  text-align: left;
  padding: 0.1rem 0.3rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.ws-grid td {
  padding: 0.05rem 0.15rem;
}

.ws-grid input {
  width: 8rem;
}

.ws-versions {
  padding-left: 1.1rem;
}

.ws-versions li {
  margin-bottom: 0.4rem;
}

.ws-versions li.named {
  border-left: 3px solid var(--accent);
  padding-left: 0.4rem;
  margin-left: -0.7rem;
}

.ws-version-name {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.ws-version-name input {
  flex: 1;
  min-width: 0;
}

/* The editor, in the workshop: kinds, their entries, and a form (see The
   editor in MVP44.md) */
.ws-tabs {
  display: flex;
  gap: 0.3rem;
}

.ws-tabs button[aria-pressed="true"], .ws-header button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* Files, Editor and Graph are for those who know the blocks: quieter than
   the guide and the tabs a GM starts with, until one is open */
.ws-tabs button.ws-quiet-tab:not([aria-pressed="true"]) {
  background: transparent;
  color: var(--quiet);
  border-style: dashed;
  font-weight: normal;
}

.ed-layout {
  display: grid;
  /* The form keeps room at 1280 pixels wide */
  grid-template-columns: minmax(9rem, 12rem) minmax(13rem, 18rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1000px) {
  .ed-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ed-kinds h2,
.ed-list h2,
.ed-form h2 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

.ed-kinds-list,
.ed-entries {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0;
  max-height: 65vh;
  overflow: auto;
}

.ed-kinds-list li,
.ed-entries li {
  padding: 0.05rem 0;
}

.ed-kinds-list button,
.ed-entries button {
  background: none;
  border: 1px solid transparent;
  text-align: left;
  padding: 0.1rem 0.3rem;
}

.ed-kinds-list li.chosen button,
.ed-entries li.chosen button {
  border-color: var(--line);
  background: var(--panel);
  font-weight: 600;
}

.ed-entries li.own button {
  color: var(--accent);
}

.ed-yours {
  font-size: 0.75rem;
  color: var(--accent);
}

.ed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
}

.ed-find {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ed-find input {
  flex: 1;
  min-width: 0;
}

.ed-filters-box {
  margin: 0.3rem 0;
}

.ed-filters-box summary {
  cursor: pointer;
  font-size: 0.85rem;
}

.ed-filters-box .ed-filters {
  margin-top: 0.3rem;
}

.ed-naming {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: end;
  margin: 0.4rem 0;
}

.ed-naming label {
  display: grid;
  gap: 0.15rem;
  flex: 1 1 12rem;
}

.said.warning {
  color: var(--waiting-ink);
}

.ed-form fieldset {
  border: 1px solid var(--line);
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
}

.ed-form legend {
  font-weight: 600;
  padding: 0 0.3rem;
}

.ed-field {
  margin: 0.3rem 0;
}

.ed-field label {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.ed-field .ed-many {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.ed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.ed-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.05rem 0.2rem 0.05rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.85rem;
}

.ed-chip button {
  padding: 0 0.35rem;
  border: none;
  background: none;
}

.ed-chips input {
  flex: 1 1 10rem;
  width: auto;
}

.ed-field input,
.ed-field select,
.ed-field textarea {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.ed-field .hint,
.ed-field .said {
  margin: 0.1rem 0 0;
  padding-left: calc(min(12rem, 30%) + 0.5rem);
  font-size: 0.8rem;
}

.ed-field.wrong input,
.ed-field.wrong select,
.ed-field.wrong textarea {
  border-color: var(--error);
  outline: 1px solid var(--error);
}

.ed-preview {
  float: right;
  width: min(18rem, 40%);
  margin: 0 0 0.75rem 1rem;
}

.ed-preview.whole {
  width: min(28rem, 50%);
}

.ed-preview-switch {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 0.4rem;
}

.ed-preview-switch button[aria-pressed="true"] {
  font-weight: 600;
  border-color: var(--accent);
}

.ed-preview:empty {
  display: none;
}

.ed-preview h3 {
  font-size: 0.9rem;
  margin: 0 0 0.3rem;
}

@media (max-width: 760px) {
  .ed-preview,
  .ed-preview.whole {
    float: none;
    width: auto;
    margin: 0 0 0.75rem;
  }
}

/* A field's row: its label and control, then its "?" at the end; what
 * follows takes the whole width */
.ed-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.4rem;
  align-items: center;
}

.ed-field > * {
  grid-column: 1 / -1;
}

.ed-field > label, .ed-field > .ed-many {
  grid-column: 1;
}

.ed-field > .ed-why-button {
  grid-column: 2;
  align-self: center;
}

.ed-why-button {
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 0 0.4rem;
  border-radius: 999px;
}

/* The pool builder and its charts (see The dice pool builder in MVP44.md):
   a bar's sure part solid, and the part a range may add lighter above it. */
.dice-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  margin: 0.4rem 0;
}

.dice-die {
  display: inline-flex;
  gap: 0.15rem;
}

.dice-panel label input {
  width: 100%;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.dice-chart {
  display: block;
  width: 100%;
  height: auto;
  max-width: 40rem;
}

.dice-chart .bar-hit {
  fill: transparent;
}

.dice-chart .bar-sure {
  fill: var(--accent);
}

.dice-chart .bar-maybe {
  fill: var(--accent);
  opacity: 0.3;
}

.dice-chart .bar.marked .bar-sure,
.dice-chart .bar.marked .bar-maybe {
  fill: var(--info);
}

.dice-chart .bar:hover .bar-hit,
.dice-chart .bar:focus .bar-hit {
  fill: var(--line);
  opacity: 0.5;
}

.dice-chart .bar:focus {
  outline: none;
}

.dice-chart .bar-label {
  fill: var(--quiet);
  font-size: 11px;
}

.dice-said {
  min-height: 1.4em;
  margin-top: 0.2rem;
}

.dice-pools {
  list-style: none;
  padding: 0;
}

.dice-pools li {
  margin: 0.2rem 0;
}

.dice-pool-name {
  font-weight: 600;
}

/* The encounter builder, in the workshop: a design's encounters, each built
   with its creatures, map, party and how it starts (see The builder in
   MVP44.md) */
.en-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr) minmax(12rem, 18rem);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1000px) {
  .en-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.en-list h2,
.en-build h2 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

/* The builder in two columns where there is room, its map and how hard it
 * is beside what it is and who, not 2,000 pixels further down */
.en-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 1.5rem;
  align-items: start;
}

@media (min-width: 1500px) {
  .en-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.en-build h3,
.en-card h3 {
  font-size: 0.9rem;
  margin: 0.9rem 0 0.3rem;
}

.en-encounters,
.en-catalogue,
.en-started {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0;
}

.en-catalogue {
  max-height: 40vh;
  overflow: auto;
}

.en-encounters button {
  background: none;
  border: 1px solid transparent;
  text-align: left;
  padding: 0.1rem 0.3rem;
}

/* The encounter wizard's steps, and what Done will write (see The encounter
   wizard in MVP49.md) */
.en-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0;
  margin: 0.3rem 0 0.8rem;
}

.en-steps li.chosen button {
  border-color: var(--line);
  background: var(--panel);
  font-weight: 600;
}

.en-preview {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 0.5rem;
  overflow: auto;
  white-space: pre;
}

.en-encounters li.chosen button {
  border-color: var(--line);
  background: var(--panel);
  font-weight: 600;
}

.en-fields {
  display: grid;
  gap: 0.4rem;
  max-width: 32rem;
}

.en-fields label {
  display: grid;
  gap: 0.15rem;
}

.en-creatures {
  margin: 0.3rem 0;
  padding-left: 1.4rem;
}

.en-creatures li {
  padding: 0.15rem 0;
}

.en-creatures li.placing {
  font-weight: 600;
}

.en-points {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-left: 0.4rem;
}

.en-map {
  display: block;
  width: 100%;
  max-width: 36rem;
  height: auto;
  margin: 0.5rem 0;
  background: var(--map-ground);
  touch-action: none;
  cursor: crosshair;
}

.en-cell {
  fill: none;
  stroke: var(--map-grid);
  stroke-width: 1;
}

.en-region {
  fill: var(--map-region);
  stroke: none;
}

.en-zone {
  fill: var(--map-zone);
  fill-opacity: 0.2;
  stroke: none;
}

.en-wall {
  fill: none;
  stroke: var(--map-wall);
  stroke-width: 4;
  stroke-linecap: round;
}

.en-token {
  fill: var(--map-land);
  fill-opacity: 0.5;
}

.en-point {
  cursor: grab;
}

.en-point circle {
  fill: var(--accent);
}

.en-point.placing circle {
  stroke: var(--ink);
  stroke-width: 2;
}

.en-point text {
  fill: var(--on-accent);
  font-size: 0.8rem;
  pointer-events: none;
}

.en-party,
.en-stand-in {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: end;
}

.en-stand-in input {
  width: 5rem;
}

.en-library {
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
}

.en-difficulty p {
  margin: 0.3rem 0;
}

.en-figure {
  margin: 0.5rem 0;
}

.en-figure .en-map {
  margin: 0 0 0.25rem;
}

.en-region-label {
  fill: var(--info);
  font-size: 0.7rem;
  pointer-events: none;
}

.en-point.dragged {
  cursor: grabbing;
  opacity: 0.8;
}

/* A prepared encounter's text to read out, set apart as boxed text is in a
   printed adventure */
.read-aloud {
  margin: 0.5rem 0;
}

.read-aloud figcaption {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--quiet);
}

.read-aloud blockquote {
  margin: 0.2rem 0 0;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  font-style: italic;
  white-space: pre-line;
}

/* The workshop's blocks (see docs/STUDY_BLOCK_EDITOR.md), in the manner
   of Scratch: blocks which read as sentences, white words on strong
   colours, sockets inline, stacked blocks notched into each other, a rule
   a hat over a mouth which holds its effects, on a dotted canvas */
.blk-view {
  --canvas: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1rem;
  background-color: var(--canvas);
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 16px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 70vh;
  box-sizing: border-box;
}

.blk-view.stale {
  opacity: 0.5;
}

/* A script: a block, with its comment stuck beside it */
.blk-script {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 100%;
}

/* A block gone to, e.g. what a recipe just made, marked a moment */
.blk-found {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 0.5rem;
  transition: outline-color 0.6s;
}

.blk {
  --c: var(--kind-definition-strong);
  --edge: var(--kind-definition-edge);
  position: relative;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  background: var(--c);
  color: #ffffff;
  border: 1px solid var(--edge);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  font: 600 0.85rem/1.25 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.blk.k-rule { --c: var(--kind-rule-strong); --edge: var(--kind-rule-edge); }
.blk.k-attribute { --c: var(--kind-attribute-strong); --edge: var(--kind-attribute-edge); }
.blk.k-status { --c: var(--kind-status-strong); --edge: var(--kind-status-edge); }
.blk.k-event { --c: var(--kind-event-strong); --edge: var(--kind-event-edge); }
.blk.k-action { --c: var(--kind-action-strong); --edge: var(--kind-action-edge); }
.blk.k-command { --c: var(--kind-command-strong); --edge: var(--kind-command-edge); }
.blk.k-function { --c: var(--kind-function-strong); --edge: var(--kind-function-edge); }
.blk.k-procedure { --c: var(--kind-procedure-strong); --edge: var(--kind-procedure-edge); }
.blk.k-encounter { --c: var(--kind-encounter-strong); --edge: var(--kind-encounter-edge); }
.blk.k-definition { --c: var(--kind-definition-strong); --edge: var(--kind-definition-edge); }
.blk.k-creature { --c: var(--kind-creature-strong); --edge: var(--kind-creature-edge); }
.blk.k-watcher { --c: var(--kind-watcher-strong); --edge: var(--kind-watcher-edge); }
.blk.k-reaction { --c: var(--kind-reaction-strong); --edge: var(--kind-reaction-edge); }
.blk.k-ask { --c: var(--kind-ask-strong); --edge: var(--kind-ask-edge); }
.blk.k-roll_modifier { --c: var(--kind-roll-modifier-strong); --edge: var(--kind-roll-modifier-edge); }
.blk.k-roll_tag { --c: var(--kind-roll-tag-strong); --edge: var(--kind-roll-tag-edge); }
.blk.k-outcome { --c: var(--kind-outcome-strong); --edge: var(--kind-outcome-edge); }
.blk.k-derived { --c: var(--kind-derived-strong); --edge: var(--kind-derived-edge); }
.blk.k-map { --c: var(--kind-map-strong); --edge: var(--kind-map-edge); }
.blk.k-sheet { --c: var(--kind-sheet-strong); --edge: var(--kind-sheet-edge); }
.blk.k-system { --c: var(--kind-system-strong); --edge: var(--kind-system-edge); }

.blk-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 30px;
}

.blk-words {
  white-space: pre-wrap;
}

.blk-unknown {
  text-decoration: underline wavy;
}

.blk-hint {
  font-weight: 400;
  opacity: 0.85;
}

/* A block's name, e.g. a rule's, as a tag at its start */
.blk-name-tag {
  font-family: ui-monospace, monospace;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 4px;
}

/* Sockets: a ring round a white field, shaped by what it takes; the ring
   turns yellow with the focus, red when what is written cannot fit */
.sock {
  display: inline-flex;
  max-width: 100%;
  padding: 2px;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
}

.sock:focus-within {
  background: #ffd60a;
}

.sock.misfit {
  background: #ff3b30;
}

.sock.needed {
  background: rgba(255, 255, 255, 0.85);
}

.blk-socket {
  field-sizing: content;
  min-width: 3ch;
  max-width: 40ch;
  border: 0;
  outline: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: #222222;
  font: 500 0.8rem/1.2 ui-monospace, monospace;
}

/* AA on the socket's white (a review measured #8a8a8a at 3.45) */
.blk-socket::placeholder {
  color: #666666;
}

.sock.s-text {
  border-radius: 6px;
}

.sock.s-text .blk-socket {
  border-radius: 4px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  max-width: 60ch;
}

/* A list, e.g. a scenario's players, as a row of sockets, each with its
 * × to take it out, and a + to add another */
.blk-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.blk-list-item {
  align-items: center;
  gap: 2px;
}

.blk-list-out {
  border: 0;
  border-radius: 999px;
  padding: 0 6px;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  cursor: pointer;
}

/* Prose, read out or kept as notes: a box as wide as the block allows,
 * as tall as what it holds, wrapping, with a way to open it wide */
.sock.s-prose {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  width: min(60ch, 100%);
  border-radius: 6px;
}

.sock.s-prose .blk-prose {
  flex: 1;
  min-width: 0;
  max-width: none;
  border-radius: 4px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  white-space: pre-wrap;
  overflow: hidden;
  resize: none;
}

.sock.s-prose .blk-prose-long {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 0;
  border-radius: 4px;
  padding: 3px 10px;
  background: #ffffff;
  color: #222222;
  font: 500 0.8rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
}

.sock.s-prose .blk-prose-open {
  border: 0;
  border-radius: 4px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  cursor: pointer;
}

/* Prose in its window, wide */
.blk-prose-window {
  width: min(70ch, 80vw);
  font: 1rem/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* A condition is pointed at both ends */
.sock.s-condition,
.sock.s-condition .blk-socket {
  border-radius: 0;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}

.sock.s-condition {
  padding: 2px 3px;
}

.sock.s-condition .blk-socket {
  padding: 3px 14px;
}

/* A name picked from the design's, e.g. an event, a darker pill */
.sock.s-event .blk-socket,
.sock.s-status .blk-socket,
.sock.s-definition .blk-socket,
.sock.s-sustain .blk-socket,
.sock.s-ending .blk-socket,
.sock.s-names .blk-socket {
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
}

.sock.s-event .blk-socket::placeholder,
.sock.s-status .blk-socket::placeholder,
.sock.s-definition .blk-socket::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.blk-misfit:empty {
  display: none;
}

.blk-misfit,
.blk-choice,
.blk-problems {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 4px 0 0;
  padding: 2px 8px;
  background: #ffffff;
  color: #a3201a;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.78rem;
}

.blk-problems {
  padding-left: 1.4rem;
}

.blk-problems .warning {
  color: #5c4300;
}

.blk-problems .hint {
  color: #555555;
}

/* What else a block may say: a small ⋯ at the end of its sentence */
.blk-more {
  /* As wide as ⋯, not as its longest option */
  width: 2.6em;
  field-sizing: content;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

.blk-more option,
.blk-slot option {
  color: #222222;
  background: #ffffff;
}

/* Darker than the block, not lighter, so their white words keep AA on
 * every block's colour (a white wash took the Text chip to 3.1 to 1) */
.blk-text-link,
.blk-tools button,
.blk-plus {
  border: 0;
  border-radius: 4px;
  padding: 1px 6px;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.blk-text-link {
  margin-left: auto;
}

/* A stacked block's tools, which show on hover and with the focus */
.blk-tools {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
  padding-left: 8px;
  opacity: 0;
}

.blk-stack:hover > .blk-head .blk-tools,
.blk-stack:hover > .blk-top > .blk-head .blk-tools,
.blk-head:focus-within .blk-tools,
.blk-head:focus .blk-tools {
  opacity: 1;
}

.blk-head:focus-visible {
  outline: 2px solid #ffd60a;
  outline-offset: 2px;
  border-radius: 4px;
}

/* What a block touches, from the graph: a tag with the graph's colour of
   what is at its other end */
.blk-touch {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-left: 6px solid var(--kind-definition);
}

.blk-touch.k-rule { border-left-color: var(--kind-rule); }
.blk-touch.k-attribute { border-left-color: var(--kind-attribute); }
.blk-touch.k-status { border-left-color: var(--kind-status); }
.blk-touch.k-event { border-left-color: var(--kind-event); }
.blk-touch.k-procedure { border-left-color: var(--kind-procedure); }
.blk-touch.k-function { border-left-color: var(--kind-function); }
.blk-touch.k-definition { border-left-color: var(--kind-definition); }
.blk-touch.k-encounter { border-left-color: var(--kind-encounter); }
.blk-touch.k-derived { border-left-color: var(--kind-derived); }

/* Stacked blocks touch, each notched at its top, with a tab at its foot
   which fits the notch of the next */
.blk-mouth {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 16px;
  padding: 0 8px 8px 0;
  min-height: 24px;
  background: var(--canvas);
  border-radius: 6px 0 0 6px;
}

.blk-stack {
  padding-top: 9px;
  border-radius: 4px;
}

.blk-stack::before,
.blk-stack::after {
  content: "";
  position: absolute;
  left: 16px;
  width: 26px;
  height: 7px;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%);
}

.blk-stack::before {
  top: -1px;
  background: var(--canvas);
}

.blk-stack::after {
  bottom: -7px;
  background: var(--c);
  z-index: 1;
}

/* A C block: its top and its foot round a mouth, as a rule holds its
   effects and an encounter its creatures */
.blk-c {
  padding: 0;
}

.blk-c > .blk-hat,
.blk-c > .blk-top {
  padding: 6px 10px;
}

.blk-foot {
  min-height: 14px;
  padding: 2px 10px 6px;
}

.blk-foot:empty {
  min-height: 16px;
}

.blk-c > .blk-foot .blk-touch {
  margin-right: 4px;
}

/* A rule's hat: a dome over the block which starts the script */
.blk-rule {
  border-top-left-radius: 48px 22px;
  border-top-right-radius: 14px;
}

.blk-rule > .blk-hat {
  padding-top: 12px;
}

.blk-cap {
  border-radius: 6px 6px 0 0;
}

/* Where a block can be added to a stack: an empty dashed slot */
.blk-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.blk-slot {
  width: auto;
  /* As wide as the canvas, then its line wraps, as its names grow */
  max-width: 100%;
  field-sizing: content;
  appearance: none;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 2px dashed var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--quiet);
  font: 600 0.8rem "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
}

/* A choice in a block's line, e.g. a trigger's Any character, in white
 * on the block's colour (in the page's grey it was 1.2 to 1) */
.blk-line .blk-slot {
  border-color: rgba(255, 255, 255, 0.7);
  color: #ffffff;
}

/* A slot within a block, e.g. for an effect's `values`, in white */
.blk-slot.in-block {
  border-color: rgba(255, 255, 255, 0.7);
  color: #ffffff;
  margin-top: 4px;
}

/* But one in a block's mouth, on the canvas, which is in the canvas's
 * quiet words, as "+ let" beside it is (a review found "+ entry" and
 * "+ wall" white on cream, 1.1 to 1) */
.blk-mouth > .blk-slot.in-block,
.blk-slots > .blk-slot.in-block {
  border-color: var(--quiet);
  color: var(--quiet);
}

/* The kind of a new block, in a slot on the canvas: a choice, with its
 * arrow, as the page's other pick lists are */
.blk-slot .blk-kind {
  width: auto;
  border: 1px solid var(--quiet);
  border-radius: 4px;
  padding: 2px 4px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

/* A slot's name, e.g. a new block's, as long as it is typed */
.blk-slot .blk-socket {
  max-width: 100%;
}

.blk-new-block {
  flex-wrap: wrap;
  max-width: 100%;
}

.blk-slot .blk-plus {
  background: var(--line);
  color: var(--ink);
}

.blk-slot .sock {
  background: var(--line);
}

/* A comment above a block, as a note stuck beside it */
.blk-note {
  max-width: 16rem;
  margin: 0;
  padding: 6px 8px;
  background: #fff4a3;
  color: #3d3500;
  border: 1px solid #e0d26a;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  font: 400 0.8rem/1.35 "Helvetica Neue", Helvetica, Arial, sans-serif;
  white-space: pre-wrap;
}

/* In the dark, the blocks keep their colours, but their white sockets and
 * yellow notes, the brightest things on the page, are dimmed */
@media (prefers-color-scheme: dark) {
  .blk-socket {
    background: #d6d0c4;
    color: #1b1712;
  }

  .blk-socket::placeholder {
    color: #5f5a52;
  }

  .blk-note {
    background: #4a4418;
    color: #f4ecc2;
    border-color: #6b6224;
  }
}

/* Entities, and what makes them, in a colour by their sort: by the sheet
   the game draws them by, so characters, monsters and items differ */
.blk.k-look-0 { --c: #3974c6; --edge: #2b5794; }
.blk.k-look-1 { --c: #c24f38; --edge: #913b2a; }
.blk.k-look-2 { --c: #268245; --edge: #1c6234; }
.blk.k-look-3 { --c: #a14dcb; --edge: #7c2fa3; }
.blk.k-look-4 { --c: #8e6d29; --edge: #6b511f; }
.blk.k-look-5 { --c: #257e7e; --edge: #1c5f5f; }
.blk.k-look-6 { --c: #c84185; --edge: #9a2d63; }
.blk.k-look-7 { --c: #4c8226; --edge: #39621c; }

/* A block's title: its name, larger, then what it is and its id */
.blk-title .blk-title-name .blk-socket {
  font: 700 0.95rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.blk-title-text {
  font-weight: 700;
}

/* With no name, its id stands as one, as large */
.blk-title-id {
  font: 700 0.95rem/1.2 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* An attribute's key beside its label, e.g. STR_BASE beside Strength */
.blk-key-tag {
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.8;
  margin-right: 4px;
}

/* A long file's tabs, by what each block is, each in its blocks' colour,
   and Find beside them */
.blk-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  border-bottom: 2px solid var(--line);
  padding-bottom: 6px;
}

.blk-tab {
  --c: var(--panel);
  --edge: var(--line);
  border: 1px solid var(--edge);
  border-radius: 6px 6px 0 0;
  padding: 3px 10px;
  background: var(--panel);
  color: var(--ink);
  font: 600 0.8rem "Helvetica Neue", Helvetica, Arial, sans-serif;
  border-top: 4px solid var(--c);
}

.blk-tab[aria-selected="true"] {
  background: var(--c);
  color: #ffffff;
}

.blk-tab-plain[aria-selected="true"] {
  background: var(--ink);
  color: var(--panel);
}

.blk-tab:focus-visible {
  outline: 2px solid #ffd60a;
  outline-offset: 2px;
}

.blk-find {
  width: min(20rem, 100%);
}

.blk-tab.k-rule { --c: var(--kind-rule-strong); --edge: var(--kind-rule-edge); }
.blk-tab.k-attribute { --c: var(--kind-attribute-strong); --edge: var(--kind-attribute-edge); }
.blk-tab.k-status { --c: var(--kind-status-strong); --edge: var(--kind-status-edge); }
.blk-tab.k-event { --c: var(--kind-event-strong); --edge: var(--kind-event-edge); }
.blk-tab.k-action { --c: var(--kind-action-strong); --edge: var(--kind-action-edge); }
.blk-tab.k-command { --c: var(--kind-command-strong); --edge: var(--kind-command-edge); }
.blk-tab.k-function { --c: var(--kind-function-strong); --edge: var(--kind-function-edge); }
.blk-tab.k-procedure { --c: var(--kind-procedure-strong); --edge: var(--kind-procedure-edge); }
.blk-tab.k-encounter { --c: var(--kind-encounter-strong); --edge: var(--kind-encounter-edge); }
.blk-tab.k-definition { --c: var(--kind-definition-strong); --edge: var(--kind-definition-edge); }
.blk-tab.k-creature { --c: var(--kind-creature-strong); --edge: var(--kind-creature-edge); }
.blk-tab.k-watcher { --c: var(--kind-watcher-strong); --edge: var(--kind-watcher-edge); }
.blk-tab.k-reaction { --c: var(--kind-reaction-strong); --edge: var(--kind-reaction-edge); }
.blk-tab.k-ask { --c: var(--kind-ask-strong); --edge: var(--kind-ask-edge); }
.blk-tab.k-roll_modifier { --c: var(--kind-roll-modifier-strong); --edge: var(--kind-roll-modifier-edge); }
.blk-tab.k-roll_tag { --c: var(--kind-roll-tag-strong); --edge: var(--kind-roll-tag-edge); }
.blk-tab.k-outcome { --c: var(--kind-outcome-strong); --edge: var(--kind-outcome-edge); }
.blk-tab.k-derived { --c: var(--kind-derived-strong); --edge: var(--kind-derived-edge); }
.blk-tab.k-map { --c: var(--kind-map-strong); --edge: var(--kind-map-edge); }
.blk-tab.k-sheet { --c: var(--kind-sheet-strong); --edge: var(--kind-sheet-edge); }
.blk-tab.k-system { --c: var(--kind-system-strong); --edge: var(--kind-system-edge); }
.blk-tab.k-look-0 { --c: #3974c6; --edge: #2b5794; }
.blk-tab.k-look-1 { --c: #c24f38; --edge: #913b2a; }
.blk-tab.k-look-2 { --c: #268245; --edge: #1c6234; }
.blk-tab.k-look-3 { --c: #a14dcb; --edge: #7c2fa3; }
.blk-tab.k-look-4 { --c: #8e6d29; --edge: #6b511f; }
.blk-tab.k-look-5 { --c: #257e7e; --edge: #1c5f5f; }
.blk-tab.k-look-6 { --c: #c84185; --edge: #9a2d63; }
.blk-tab.k-look-7 { --c: #4c8226; --edge: #39621c; }

/* What an entity holds, stacked in a mouth of its block as an
   encounter's creatures are, each with the slot it is held in */
.blk-holds > .blk {
  width: 100%;
}

.blk-holds > .blk-folded {
  border-radius: 4px;
}

.blk-holds-slot {
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgb(0 0 0 / 25%);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.blk-holds .blk-fold {
  margin-right: 4px;
}

/* Whose a block is, where its holder is not drawn */
.blk-held-by {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink);
  opacity: 0.75;
}

/* A block folded to one line in a long file, opened by a press */
.blk-folded {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  text-align: left;
}

.blk-folded:focus-visible,
.blk-fold:focus-visible {
  outline: 2px solid #ffd60a;
  outline-offset: 2px;
}

.blk-fold {
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 6px;
  background: var(--panel);
  color: var(--ink);
}

/* A block with no shape: grey, folded, its text inside */
.blk-text summary {
  cursor: pointer;
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.blk-text summary .blk-words {
  font-family: ui-monospace, monospace;
}

.blk-source {
  max-height: 16rem;
  overflow: auto;
  background: var(--panel);
  color: var(--ink);
  border-radius: 4px;
  font-weight: 400;
}

@media (max-width: 600px) {
  .blk-view {
    padding: 0.5rem;
  }

  .blk-note {
    max-width: 100%;
  }
}

/* The design's party (see For a design in PAGE.md) */
.ws-party {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 48rem;
}

.ws-party-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ws-party-member {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ws-party-who {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.ws-party-library {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ws-party-library select {
  max-width: 100%;
}

/* A character's choices in the blocks, folded to what it is */
.blk-choices-fold {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.blk-choices > summary {
  cursor: pointer;
}

/* Given by the GM, under a character made by choices: a line across the
   member, below its name and buttons */
.ws-party-given {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-top: 1px solid var(--line);
  padding-top: 0.4rem;
}

.ws-party-given h3 {
  font-size: 0.95rem;
  margin: 0;
}

.ws-party-given-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ws-party-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}

.ws-party-form select,
.ws-party-form input {
  max-width: 100%;
}

.wz-for {
  font-weight: normal;
}

/* The Endings tab, in the workshop: a design's endings, each with its words
   and rewards (see The Endings tab in MVP48.md) */
/* Each ending a row: its name, then its rewards in words under it, the
 * same width down the list */
.ending-list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.ending-list li > button {
  justify-self: stretch;
  text-align: left;
}

.ending-list li > .quiet {
  font-size: 0.85rem;
  color: var(--quiet);
}

.ending-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 18rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1000px) {
  .ending-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ending-form h2 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

.ending-form h3 {
  font-size: 0.9rem;
  margin: 0.9rem 0 0.3rem;
}

.ending-list li {
  display: grid;
  gap: 0.1rem;
}

.ending-rewards {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0;
  display: grid;
  gap: 0.4rem;
}

.ending-reward,
.ending-new {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem;
  border: 1px solid var(--line);
  padding: 0.4rem 0.5rem;
}

.ending-new {
  border: 0;
  padding: 0;
}

.ending-form .buttons {
  margin-top: 0.8rem;
}

/* A recipe's questions beside what it makes (see Recipes in MVP49.md) */

dialog.with-recipe {
  width: min(64rem, calc(100vw - 2rem));
  /* A field gone to, by Tab or a click, is scrolled clear of the foot
   * which keeps Done in sight (a review found it behind it) */
  scroll-padding-bottom: 5rem;
}

/* Done always in sight, however long the questions, and why it waits */
dialog.with-recipe #dialog-body > .buttons {
  position: sticky;
  bottom: 0;
  z-index: 1;
  align-items: center;
  padding: 0.6rem 0 0.2rem;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.rc-waiting {
  margin-left: 0.4rem;
}

.rc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 48rem) {
  .rc-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.rc-asks {
  display: grid;
  gap: 0.6rem;
}

.rc-ask label {
  display: grid;
  gap: 0.2rem;
}

.rc-ask label.rc-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rc-on-map {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem;
  margin: 0;
}

.rc-typed-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.rc-typed {
  flex: 1;
  min-width: 0;
}

.rc-picked {
  fill: var(--accent);
  fill-opacity: 0.45;
  stroke: var(--accent);
  stroke-width: 1;
}

.rc-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rc-corner {
  fill: var(--accent);
}

.rc-made h3 {
  margin: 0 0 0.4rem;
}

.rc-summary {
  margin: 0 0 0.5rem;
  padding-left: 1.1rem;
}

.rc-blocks > summary {
  cursor: pointer;
  margin: 0.4rem 0;
}

.rc-block {
  margin: 0 0 0.6rem;
}

.rc-block pre {
  margin: 0.2rem 0 0;
  padding: 0.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  font-size: 0.85rem;
}

/* The scenario guide (see The scenario guide in MVP49.md): the steps down
 * its side, and the step open beside them */

/* What the game system chosen is, and the scenario copied, under each */
.new-design .new-design-about {
  margin: -0.2rem 0 0.2rem;
  font-size: 0.9rem;
}

.new-design-then {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  border: none;
  padding: 0;
  margin: 0;
}

.new-design-then legend {
  padding: 0;
}

/* A radio as wide as itself, beside its words, not stretched as other
 * inputs are */
.new-design-then label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.new-design-then input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.gd-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

/* The encounter wizard open in the fights step: its steps alone, the
 * guide's put away, and the step the whole width */
.gd-wizard-note {
  display: none;
}

.gd-view.gd-wizarding .gd-wizard-note {
  display: block;
}

.gd-view.gd-wizarding .gd-steps,
.gd-view.gd-wizarding .gd-moves {
  display: none;
}

.gd-view.gd-wizarding .gd-layout {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1000px) {
  .gd-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.gd-steps ol {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.gd-steps ol button {
  width: 100%;
  text-align: left;
  white-space: pre;
}

/* The step open: a bar down its side and a tint, which a hover does not
   give, so the two are not mistaken (a UI review found them alike) */
.gd-steps button[aria-current="step"] {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
  background: var(--map-choice);
  font-weight: 600;
}

.gd-steps button.gd-done {
  color: var(--info);
}

.gd-steps button.gd-skipped {
  color: var(--quiet);
}

/* The step's title above its question, and the question above the rest */
.gd-step h2 {
  margin-top: 0;
  margin-bottom: 0.2rem;
  font-size: 1.6rem;
}

.gd-question {
  margin-top: 0;
  font-size: 1.15rem;
}

.gd-items {
  margin: 0.75rem 0;
}

.gd-items ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.3rem 0 0;
  padding: 0;
  list-style: none;
}

.gd-part {
  margin: 0.75rem 0;
}

.gd-form {
  display: grid;
  gap: 0.4rem;
  max-width: 36rem;
}

.gd-form label {
  display: grid;
  gap: 0.2rem;
}

.gd-form > button {
  justify-self: start;
}

.gd-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gd-row input {
  width: 6rem;
}

.gd-recipes p {
  margin: 0.3rem 0;
}

.gd-moves {
  margin-top: 1rem;
}

/* The check's errors, in the error colour, as Check's are */
.gd-problems li {
  color: var(--error);
}

.gd-problems li .hint {
  color: var(--quiet);
}

.gd-later ul {
  margin: 0.25rem 0 0;
}

/* What is left of a turn, e.g. "Actions 0 of 1", one to a line; one spent
 * is quieter, as what is left is what a player looks for */
.turn-left h4 {
  margin: 0.6rem 0 0.2rem;
}

.turn-left ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
}

.turn-left li.spent {
  color: var(--quiet);
}

/* Actions all unavailable because their actor cannot act: one line, with
   them folded under it (see Playing in PAGE.md) */
.actions details.cannot-act {
  margin: 0.25rem 0;
}
.actions details.cannot-act summary {
  color: var(--quiet);
  font-style: italic;
  cursor: pointer;
}
