/*
 * A quiet, modern admin: a neutral ground, cards a step off it, one blue for
 * what you act on, green and red only for state. System fonts only: the page's
 * content policy loads nothing from outside the server.
 *
 * It comes light and dark. Every colour is a variable set once for each; the
 * rules below never name a colour of their own, except on the map and the
 * consoles, which are dark in both. Which is used follows the system unless
 * the reader has chosen: the script sets data-theme on the root for a choice,
 * and leaves it off to follow the system.
 */
:root {
  --ground: #f5f6f8;
  --surface: #ffffff;
  --sunken: #fafbfc;
  --line: #e3e6eb;
  --line-soft: #eef0f3;
  --line-strong: #c9ced6;
  --ink: #18202b;
  --ink-2: #3b4554;
  --muted: #566070;
  --accent: #2f5fe0;
  --accent-dark: #2548b4;
  --accent-soft: #eef2fd;
  --good: #1a7f4b;
  --good-ink: #14653b;
  --good-soft: #e6f4ec;
  --bad: #b42318;
  --bad-ink: #9a1f14;
  --bad-soft: #fde8e6;
  --bad-line: #e7b4ae;
  --warn: #b25e09;
  --warn-ink: #8a4b06;
  --warn-soft: #fdf1dc;
  --sea: #1b2b3c;
  --edge: #d5d9e0;
  --hover: #e9ecf1;
  --on-accent: #ffffff;
  --notice-line: #c7d4f6;
  --warn-line: #f0cf94;
  --reveal: #fff8eb;
  --reveal-ink: #5c3a05;
  /* What a log or a secret is shown on: dark whatever the theme. */
  --console: #18202b;
  color-scheme: light;
  --sans:
    Inter, 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue',
    sans-serif;
  --mono: Consolas, 'Cascadia Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 12px;
}

:root[data-theme='dark'] {
  --ground: #12171f;
  --surface: #1a212c;
  --sunken: #161c26;
  --line: #2a3442;
  --line-soft: #222b37;
  --line-strong: #3b4758;
  --edge: #36414f;
  --hover: #232c39;
  --ink: #e8ecf1;
  --ink-2: #c3cad4;
  --muted: #9aa5b4;
  --accent: #7da2ff;
  --accent-dark: #a4bdff;
  --accent-soft: #1f2d4a;
  --on-accent: #0c1424;
  --notice-line: #2c4270;
  --good: #3fb97a;
  --good-ink: #7fe0aa;
  --good-soft: #17382a;
  --bad: #c93a2e;
  --bad-ink: #ff9d94;
  --bad-soft: #3a1b18;
  --bad-line: #6a2f2a;
  --warn: #d08a2a;
  --warn-ink: #f0c56a;
  --warn-soft: #3a2c0d;
  --warn-line: #6b5220;
  --reveal: #2e2410;
  --reveal-ink: #f0c56a;
  --console: #0c1118;
  color-scheme: dark;
}

/* No choice made: the system's. Kept the same as the block above. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #12171f;
    --surface: #1a212c;
    --sunken: #161c26;
    --line: #2a3442;
    --line-soft: #222b37;
    --line-strong: #3b4758;
    --edge: #36414f;
    --hover: #232c39;
    --ink: #e8ecf1;
    --ink-2: #c3cad4;
    --muted: #9aa5b4;
    --accent: #7da2ff;
    --accent-dark: #a4bdff;
    --accent-soft: #1f2d4a;
    --on-accent: #0c1424;
    --notice-line: #2c4270;
    --good: #3fb97a;
    --good-ink: #7fe0aa;
    --good-soft: #17382a;
    --bad: #c93a2e;
    --bad-ink: #ff9d94;
    --bad-soft: #3a1b18;
    --bad-line: #6a2f2a;
    --warn: #d08a2a;
    --warn-ink: #f0c56a;
    --warn-soft: #3a2c0d;
    --warn-line: #6b5220;
    --reveal: #2e2410;
    --reveal-ink: #f0c56a;
    --console: #0c1118;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 14px/1.45 var(--sans);
  font-variant-numeric: tabular-nums;
}

[hidden] {
  display: none !important;
}

h1 {
  margin: 0;
  font: 600 1.625rem/1.2 var(--sans);
  letter-spacing: -0.01em;
}

h2 {
  margin: 0;
  font: 600 1rem/1.3 var(--sans);
}

h3 {
  margin: 0;
  font: 600 0.875rem/1.3 var(--sans);
}

p {
  margin: 0;
}

a {
  color: var(--accent);
}

.muted {
  color: var(--muted);
}

.mono {
  font: 0.8125rem/1.5 var(--mono);
}

/* ---- controls ---- */

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

button {
  min-height: 2.25rem;
  padding: 0 0.875rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

button.quiet,
button.danger {
  border-color: var(--edge);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

button.quiet:hover {
  background: var(--line-soft);
  border-color: var(--line-strong);
}

button.danger {
  border-color: var(--bad-line);
  color: var(--bad-ink);
}

button.danger:hover {
  background: var(--bad-soft);
  border-color: var(--bad);
}

button.destroy {
  border-color: var(--bad);
  background: var(--bad);
  color: #fff;
}

button.destroy:hover {
  background: var(--bad-ink);
  border-color: var(--bad-ink);
}

button.small,
td button {
  min-height: 1.875rem;
  padding: 0 0.625rem;
  font-size: 0.8125rem;
}

/* A button that reads as a link: a name or a position inside a table. */
button.link {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--accent);
  font-weight: 600;
  text-align: left;
}

button.link:hover {
  background: none;
  color: var(--accent-dark);
  text-decoration: underline;
}

button.link.mono {
  font-weight: 400;
}

button:disabled,
select:disabled,
input:disabled {
  opacity: 0.55;
  cursor: default;
}

input,
select {
  width: 100%;
  min-height: 2.375rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

/* A box of several lines: a profile, a comment, an answer to a page. */
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  resize: vertical;
}

/* Words as they were written, line breaks kept: a profile, a page, a speech log in the asking window. */
.prewrap,
#ask-text {
  white-space: pre-wrap;
}

div.small {
  font-size: 0.8125rem;
}

/* A short list without bullets: the firewall, the addresses accounts use. */
ul.plain {
  list-style: none;
  margin: 0.25rem 0 0.75rem;
  padding: 0;
}

ul.plain li {
  margin: 0.25rem 0;
  overflow-wrap: anywhere;
}

input[type='checkbox'] {
  width: 1.375rem;
  min-height: 0;
  height: 1.375rem;
  padding: 0;
  accent-color: var(--accent);
}

td select {
  width: auto;
  min-height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
}

input.search {
  flex: 0 1 18rem;
  min-width: 0;
  min-height: 2.25rem;
}

:focus-visible {
  outline: 3px solid rgba(47, 95, 224, 0.45);
  outline-offset: 2px;
}

/* ---- sign-in ---- */

.signin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.signin-card {
  width: min(25rem, 100%);
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(15, 23, 33, 0.08);
}

.signin-card h1 {
  font-size: 1.5rem;
}

.signin-card label {
  display: block;
  margin: 1rem 0 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.signin-card input {
  min-height: 2.625rem;
}

.signin-card button {
  margin-top: 1.25rem;
  width: 100%;
  min-height: 2.75rem;
}

.lede {
  margin-top: 0.3rem;
  color: var(--muted);
}

.error {
  margin-top: 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: var(--bad-soft);
  color: var(--bad-ink);
  font-weight: 500;
}

/* ---- the frame: a bar across the top to steer by, the working page under it ---- */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.5rem;
  padding: 0 clamp(1rem, 2vw, 1.75rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3.5rem;
}

.brand-mark {
  width: 1.875rem;
  height: 1.875rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-transform: uppercase;
}

.brand-name {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.brand-line {
  color: var(--muted);
  font-size: 0.75rem;
}

/* On the login service's panel: which shard these pages are, in place of the shard's name. */
.shard-switch {
  max-width: 14rem;
  padding: 0.125rem 0.375rem;
  font-weight: 600;
  font-size: 1rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  flex-grow: 1;
  gap: 2px;
}

.nav button {
  min-height: 3.5rem;
  padding: 0 0.75rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.nav button:hover {
  background: transparent;
  color: var(--ink);
}

.nav button[aria-current='page'] {
  border-bottom-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

.top-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3.5rem;
}

.top-user select {
  width: auto;
  min-height: 1.875rem;
  padding: 0 0.4rem;
  font-size: 0.8125rem;
}

.signin-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.signin-theme select {
  width: auto;
  min-height: 1.875rem;
  padding: 0 0.4rem;
  font-size: 0.8125rem;
}

.main {
  max-width: 90rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 2vw, 1.75rem) 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.masthead .muted:empty {
  display: none;
}

.masthead .muted {
  margin-top: 0.125rem;
  max-width: 60rem;
}

.masthead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.notice {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--notice-line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 500;
}

/* What an action answered stays in sight however far down the page it was asked from. */
#notice {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.14);
}

.notice.warn {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.notice.failed {
  border-color: var(--bad-line);
  background: var(--bad-soft);
  color: var(--bad-ink);
}

/* ---- layout pieces ---- */

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
}

.split.stretch {
  align-items: stretch;
}

.split > * {
  min-width: 0;
}

.grow1 {
  flex: 1 1 20rem;
}

.grow2 {
  flex: 2 1 22rem;
}

.grow3 {
  flex: 3 1 34rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}

.card.pad {
  padding: 1rem 1.125rem 1.125rem;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
}

.card-head h2 {
  flex-grow: 1;
}

.card-head.tabbed {
  padding: 0.5rem 1rem 0;
  border-bottom: 1px solid var(--line);
}

.card-head.tabbed .tabs {
  flex-grow: 1;
}

.card-head.tabbed .search,
.card-head.tabbed > button {
  margin-bottom: 0.375rem;
}

.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.card-foot:empty {
  display: none;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.row > input {
  flex: 1 1 10rem;
  width: auto;
  min-width: 0;
}

/* ---- numbers in a strip ---- */

.stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
}

.stat dt {
  color: var(--muted);
  font-size: 0.75rem;
}

.stat dd {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.stat dd.small {
  font-size: 0.875rem;
  font-weight: 500;
}

.stat small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.grow {
  flex-grow: 1;
}

td > .tag:first-child {
  margin-left: 0;
}

/* ---- chips, tabs, tags ---- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.chip {
  min-height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid var(--edge);
  border-radius: 1rem;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 500;
}

.chip:hover {
  background: var(--line-soft);
  border-color: var(--line-strong);
}

.chip[aria-pressed='true'],
.chip[aria-pressed='true']:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ground);
}

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

.tabs button {
  min-height: 2.5rem;
  padding: 0 0.75rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}

.tabs button:hover {
  background: transparent;
  color: var(--ink);
}

.tabs button[aria-selected='true'] {
  border-bottom-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

/* Two or three choices side by side, one of them pressed in. */
.seg {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--line-soft);
}

.seg button {
  min-height: 2rem;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 500;
}

.seg button:hover {
  background: transparent;
  color: var(--ink);
}

.seg button[aria-selected='true'] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  /* Ringed as well as raised, so the one chosen shows on a dark ground too. */
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 1px 2px rgba(15, 23, 33, 0.14);
}

.tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0 0.5rem;
  border-radius: 0.625rem;
  background: var(--line-soft);
  color: var(--ink-2);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.tag.bad {
  background: var(--bad-soft);
  color: var(--bad-ink);
}

.tag.good {
  background: var(--good-soft);
  color: var(--good-ink);
}

.tag.info {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.tag.warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tags .tag {
  margin: 0;
}

.pill {
  padding: 0.125rem 0.625rem;
  border-radius: 0.625rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 600;
}

/* A thin bar showing how full something is. */
.bar {
  display: inline-block;
  width: 4.5rem;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  vertical-align: middle;
}

.bar.wide {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 4px;
}

.bar-fill {
  display: block;
  height: 100%;
  background: var(--good);
}

.bar-fill.low {
  background: var(--warn);
}

.bar-fill.plain {
  background: var(--accent);
}

.health {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* ---- tables ---- */

.scroll {
  overflow-x: auto;
}

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

/* On a narrow screen a table keeps its shape and scrolls sideways inside its card. */
.scroll table {
  min-width: 38rem;
}

th,
td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th:first-child,
td:first-child {
  padding-left: 1rem;
}

th:last-child,
td:last-child {
  padding-right: 1rem;
}

th {
  border-top: 1px solid var(--line);
  border-bottom-color: var(--line);
  background: var(--sunken);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.card-head.tabbed + .scroll th,
.card-head.tabbed + div > .scroll th {
  border-top: 0;
}

td.num,
th.num {
  text-align: right;
}

td.act {
  text-align: right;
  white-space: nowrap;
}

td.act button {
  margin-left: 0.375rem;
}

td.detail {
  font: 0.75rem/1.5 var(--mono);
  overflow-wrap: anywhere;
  color: var(--muted);
}

td .link + .link {
  margin-left: 0.75rem;
}

.empty {
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
}

.card > div:first-child > .empty {
  border-top: 0;
}

/* ---- small forms ---- */

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: 1rem;
}

.tool {
  padding: 1rem 1.125rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tool h3 {
  font-size: 1rem;
}

.tool > .muted {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
}

/* Several small forms sharing one card, a line between them. */
.tools-card .tool {
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: none;
}

.tools-card .tool h3 {
  font-size: 0.875rem;
}

.tools-card > .tabs {
  padding: 0.5rem 0.625rem 0;
  border-bottom: 1px solid var(--line);
}

.tools-card > .tabs + div .tool {
  border-top: 0;
}

.tools-card > .tabs + div .tool h3 {
  font-size: 1rem;
}

.fields,
.bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.625rem;
  margin-top: 0.75rem;
}

.field {
  display: block;
  flex: 1 1 5.5rem;
  min-width: 0;
}

.field.wide {
  flex: 2 1 12rem;
}

.field span {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ---- the map ---- */

.map-card {
  overflow: hidden;
}

.chart-frame {
  position: relative;
  background: var(--sea);
  line-height: 0;
}

#map {
  width: 100%;
  height: auto;
  aspect-ratio: 896 / 512;
  cursor: crosshair;
  touch-action: none;
}

.chart-tools {
  position: absolute;
  right: 0.625rem;
  bottom: 0.625rem;
  display: flex;
  gap: 0.375rem;
  line-height: 1.2;
}

.chart-tools button {
  width: 2.125rem;
  min-height: 2.125rem;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}

.chart-tools button:hover {
  background: var(--line-soft);
}

.chart-tools button.wide {
  width: auto;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.chart-empty {
  position: absolute;
  left: 1rem;
  top: 1rem;
  right: 1rem;
  color: #d5dbe3;
  line-height: 1.4;
}

.readout {
  position: absolute;
  left: 0.625rem;
  bottom: 0.625rem;
  max-width: calc(100% - 12rem);
  padding: 0.375rem 0.625rem;
  border-radius: 8px;
  background: rgba(15, 23, 33, 0.82);
  color: #fff;
  font-size: 0.8125rem;
  line-height: 1.3;
  pointer-events: none;
}

.readout:empty {
  display: none;
}

.map-help {
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
}

/* Which map the live map shows: as wide as the longest name. */
.map-facet {
  width: auto;
}

.legend {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.875rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
}

.mark {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  margin-right: 0.4rem;
  vertical-align: -0.05rem;
}

.mark-player {
  border-radius: 50%;
  background: #f5a524;
  box-shadow: 0 0 0 2px #18202b;
}

.mark-house {
  background: #fff;
  box-shadow: 0 0 0 2px #18202b;
}

.mark-spawner {
  border: 2px solid var(--bad);
  transform: rotate(45deg) scale(0.8);
}

.mark-creature {
  width: 0.35rem;
  height: 0.35rem;
  margin-left: 0.14rem;
  border-radius: 50%;
  background: var(--bad);
}

.broadcast label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

/* ---- events ---- */

.event {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.75rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--line-soft);
}

.event time {
  flex: 0 0 4.25rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.event strong {
  flex: 0 0 9.5rem;
  font: 600 0.75rem/1.6 var(--mono);
}

.event span {
  flex: 1 1 14rem;
  min-width: 0;
  color: var(--muted);
  font: 0.75rem/1.6 var(--mono);
  overflow-wrap: anywhere;
}

/* ---- the first setup ---- */

/* The pages of the setup, in order: the one being done, and those done. */
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps button::before {
  content: counter(step) '. ';
  color: var(--muted);
}

.steps li.current button {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.steps li.done button::after {
  content: ' \2713';
  color: var(--good-ink, inherit);
}

.wizard-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1.125rem 1rem;
  border-top: 1px solid var(--line-soft);
}

.stack.tight {
  gap: 0.5rem;
}

/* A row of the setup whose control is a list: under its words, the width of the card. */
.setting.wide .setting-control {
  flex: 1 1 100%;
  justify-content: flex-start;
}

.setting.wide .setting-control > .stack {
  flex: 1 1 auto;
}

.setting.wide .row > select {
  flex: 0 1 12rem;
  width: auto;
}

.card > .pad {
  margin: 0;
  padding: 0.25rem 1.125rem 0.75rem;
}

.choices {
  display: grid;
  gap: 0.5rem;
  padding: 0 1.125rem 1rem;
}

.choice,
.piece {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* A radio or tick beside its words, not stretched across the row as the panel's other inputs are. */
.choice input,
.piece input {
  flex: none;
  width: auto;
  min-height: 0;
  margin: 0.2rem 0 0;
}

.choice span,
.piece span {
  flex: 1 1 auto;
  display: grid;
  gap: 0.125rem;
  text-align: left;
}

.choice small,
.piece small {
  color: var(--muted);
}

.choice-more {
  padding-left: 2.25rem;
}

.pieces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  gap: 0.5rem;
  padding: 0 1.125rem 1rem;
}

.piece.off {
  cursor: default;
  opacity: 0.6;
}

/* A tick in a table or beside a label is the size of a tick, not stretched as the panel's other inputs are. */
td input[type='checkbox'],
label.inline input[type='checkbox'] {
  flex: none;
  width: auto;
  min-height: 0;
}

/* A new shard's port, beside its name. */
input.port {
  flex: 0 0 7rem;
}

/* A config file to copy. */
.snippet {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  overflow: auto;
  border-radius: 8px;
  background: var(--console);
  color: #d5dbe3;
  font: 0.8125rem/1.6 var(--mono);
  user-select: all;
}

.done-list {
  display: grid;
  gap: 0.375rem;
  list-style: none;
}

/* ---- the shards on the login service ---- */

.shard-row {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--line-soft);
}

.shard-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.shard-row .muted {
  font-size: 0.875rem;
}

/* ---- the last hour ---- */

.trend-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 1rem;
}

.trend {
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.trend h3 {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.trend-value {
  margin: 0.125rem 0 0.4rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.trend svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

.trend .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.trend .axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.trend .tick {
  fill: var(--muted);
  font: 10px var(--sans);
}

.trend .series {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.trend .cross {
  stroke: var(--muted);
  stroke-width: 1;
}

.trend .dot {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

/* ---- a character ---- */

.crumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.875rem 1.125rem;
}

.sheet {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meter-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.375rem;
}

.meter-line strong {
  font-weight: 600;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 0.625rem;
}

.tile {
  display: flex;
  flex-direction: column;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  background: var(--ground);
}

.tile span {
  color: var(--muted);
  font-size: 0.75rem;
}

.tile strong {
  font-size: 1.125rem;
  font-weight: 600;
}

.tile em {
  margin-left: 0.25rem;
  color: var(--bad-ink);
  font-size: 0.75rem;
  font-style: normal;
}

.tile em.up {
  color: var(--good-ink);
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem 1rem;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.skill {
  margin-top: 0.75rem;
}

.skill .bar {
  height: 6px;
}

/* ---- settings ---- */

.jump {
  flex: 1 1 11rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jump button {
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-weight: 500;
  text-align: left;
}

.jump button:hover {
  background: var(--hover);
  color: var(--ink);
}

.settings {
  flex: 999 1 34rem;
  max-width: 58rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings fieldset {
  margin: 0;
  padding: 0;
  min-width: 0;
}

.settings legend {
  float: left;
  width: 100%;
  padding: 0.875rem 1.125rem 0.625rem;
  font-size: 1rem;
  font-weight: 600;
}

.setting {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 0.875rem 1.125rem;
  border-top: 1px solid var(--line-soft);
}

.setting-text {
  flex: 1 1 20rem;
  min-width: 0;
}

.setting-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.setting label {
  font-weight: 600;
}

.setting .muted {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
}

.setting-control {
  flex: 0 1 16rem;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.settings .facts {
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: 0;
}

.settings .facts dt,
.settings .facts dd {
  padding: 0.75rem 1.125rem;
  border-top: 1px solid var(--line-soft);
  text-align: left;
}

.danger-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem 1.125rem;
  border-color: var(--bad-line);
}

.danger-card > div {
  flex: 1 1 20rem;
  min-width: 0;
}

.danger-card .muted {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
}

/* ---- logs ---- */

.log {
  min-height: 20rem;
  max-height: 36rem;
  padding: 0.875rem 0;
  overflow: auto;
  background: var(--console);
  color: #d5dbe3;
  font: 0.8125rem/1.7 var(--mono);
}

.log .line {
  padding: 0 1.125rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.log .line.warn {
  background: rgba(240, 197, 106, 0.08);
  color: #f0c56a;
}

.log .line.error {
  background: rgba(255, 157, 148, 0.1);
  color: #ff9d94;
}

.following::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--good);
}

/* ---- the dialog that asks ---- */

.ask {
  width: min(27rem, calc(100vw - 2rem));
  padding: 1.375rem 1.5rem 1.25rem;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 48px rgba(15, 23, 33, 0.3);
}

.ask::backdrop {
  background: rgba(15, 23, 33, 0.55);
}

.ask h2 {
  margin-bottom: 0.375rem;
  font-size: 1.1875rem;
}

.ask .muted {
  color: var(--ink-2);
}

.ask .field {
  margin-top: 1rem;
}

.ask-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* ---- a secret shown once ---- */

.reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  background: var(--reveal);
  color: var(--ink);
  font-weight: 400;
}

.reveal > div:first-child {
  flex: 1 1 16rem;
  min-width: 0;
}

.reveal small {
  display: block;
  color: var(--reveal-ink);
  font-size: 0.8125rem;
}

.secret {
  flex: 2 1 20rem;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--console);
  color: #fff;
  font: 0.8125rem/1.4 var(--mono);
  overflow-wrap: anywhere;
  user-select: all;
}

.callout {
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
}

.howto ol {
  margin: 0.625rem 0;
  padding-left: 1.25rem;
  color: var(--ink-2);
}

.howto li + li {
  margin-top: 0.4rem;
}

.howto .muted {
  font-size: 0.8125rem;
}

/* ---- in the game ---- */

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8.5rem, 100%), 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* A button whose click in the game is still being waited for. */
button.quiet[aria-pressed='true'],
button.danger[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

label.inline.grow {
  flex: 1 1 12rem;
}

label.inline.grow input,
label.inline.grow select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.found {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.75rem;
}

.found p {
  flex-basis: 100%;
  font-size: 0.8125rem;
}

.callout.warn {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn-ink);
}

/* ---- decorating, inside the staff tool ---- */

.deco-pad {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0 1rem 0.75rem;
}

.deco-pad .seg,
.deco-pad .search.wide {
  align-self: stretch;
  flex: none;
}

.deco-pad .seg button {
  flex: 1 1 0;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.75rem;
}

.check input {
  width: 1.05rem;
  height: 1.05rem;
}

label.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

label.inline input {
  width: 4.5rem;
  min-height: 2rem;
}

.art-grid {
  height: 26rem;
  overflow-y: auto;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--radius) var(--radius);
}

.art-sizer {
  position: relative;
}

.art-tile {
  position: absolute;
  left: 0;
  top: 0;
  width: 68px;
  height: 82px;
  min-height: 0;
  margin: 2px;
  padding: 3px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 400;
}

.art-tile:hover {
  background: var(--sunken);
  border-color: var(--line-strong);
}

.art-tile[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.art-tile b {
  position: absolute;
  right: 2px;
  top: 2px;
  padding: 0 0.3rem;
  border-radius: 0.6rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.625rem;
  font-weight: 600;
}

.hue-grid {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--line-soft);
  line-height: 0;
}

.hue-grid canvas {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  cursor: crosshair;
}

.chosen {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.chosen > div {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

canvas.preview {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ground);
}

/* What a recipe makes, beside its name: only inside the tool, which has the game's pictures. */
canvas.thumb {
  width: 2.75rem;
  height: 2.75rem;
  margin-right: 0.6rem;
  vertical-align: middle;
  border-radius: 6px;
  background: var(--ground);
}

canvas.shades {
  width: 100%;
  max-width: 16rem;
  height: 12px;
  border: 1px solid var(--line);
}

.deco-line {
  align-items: center;
  margin-top: 0.75rem;
}

.deco-line.thing p {
  flex: 1 1 10rem;
  min-width: 0;
}

.deco-rows {
  margin: 0.5rem 0 0;
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 0.5rem;
}

.deco-rows dt {
  color: var(--muted);
}

.deco-rows dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

@media (prefers-reduced-motion: no-preference) {
  .notice {
    animation: settle 0.25s ease-out;
  }
  @keyframes settle {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
  }
}

/* In a narrow window, such as the staff tool beside the game, the bar keeps to two short lines: who and where, then the sections in a row that scrolls. */
@media (max-width: 46rem) {
  .top {
    gap: 0 0.75rem;
  }
  .brand {
    min-height: 2.75rem;
  }
  .top-user {
    margin-left: auto;
    min-height: 2.75rem;
  }
  .nav {
    order: 3;
    flex-basis: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    /* It scrolls by wheel, touch and the keyboard; a bar under a row this short would be most of it. */
    scrollbar-width: none;
  }
  .nav button {
    flex: none;
    min-height: 2.5rem;
    padding: 0 0.625rem;
  }
  .main {
    padding-top: 1rem;
    gap: 1rem;
  }
  .masthead > div:first-child {
    flex: 1 1 14rem;
    min-width: 0;
  }
}

@media (max-width: 40rem) {
  .readout {
    max-width: calc(100% - 1.25rem);
    bottom: 3.25rem;
  }
}

/*
 * The script manager: the scripts to choose from, narrowed by kind and by what
 * is so of them, and beside them the one chosen: what it sets up, its
 * settings, and its switch. In a narrow window the two take turns.
 */
.script-bar {
  align-items: center;
  justify-content: space-between;
}

.script-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.scripts {
  display: grid;
  grid-template-columns: minmax(18rem, 26rem) minmax(0, 1fr);
  align-items: start;
}

.script-side {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.script-filters {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem;
  border-bottom: 1px solid var(--line);
}

.script-filters .search {
  flex: none;
  width: 100%;
}

.script-filters .chip {
  min-height: 1.75rem;
  padding: 0 0.625rem;
}

.only {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
}

.only-chip {
  min-height: 1.625rem;
  padding: 0 0.5rem;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.only-chip:hover {
  background: var(--hover);
  border-color: var(--line-strong);
}

.only-chip.warn {
  border-color: var(--warn-line);
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.only-chip.bad {
  border-color: var(--bad-line);
  background: var(--bad-soft);
  color: var(--bad-ink);
}

.only-chip.info {
  border-color: var(--notice-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

/* One that is on is ringed in its own colour, so it reads as pressed in either theme. */
.only-chip[aria-pressed='true'] {
  box-shadow: inset 0 0 0 2px currentColor;
}

.script-list {
  max-height: 44rem;
  overflow-y: auto;
  padding: 0.375rem;
}

.script-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.125rem;
  padding: 0 0.5rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
}

.script-head:hover {
  background: none;
  color: var(--ink);
}

.script-head::before {
  content: '▸';
  width: 0.75rem;
}

.script-head[aria-expanded='true']::before {
  content: '▾';
}

.script-head span:first-child {
  flex-grow: 1;
}

.script-head .muted {
  font-weight: 500;
  letter-spacing: 0;
}

.script-row {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
  width: 100%;
  min-height: 0;
  padding: 0.4375rem 0.625rem 0.5rem 1.625rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
}

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

.script-row[aria-selected='true'] {
  background: var(--accent-soft);
}

.script-row[aria-selected='true'] .script-name {
  color: var(--accent-dark);
}

.script-line {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.script-name {
  flex-grow: 1;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.script-name .muted {
  font-weight: 400;
}

.script-tags {
  display: flex;
  flex: none;
  gap: 0.25rem;
}

.script-tags .tag {
  margin: 0;
}

.script-about {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-detail {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  min-width: 0;
  padding: 1.25rem 1.5rem 1.5rem;
}

.script-back {
  display: none;
  align-self: flex-start;
}

.script-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.script-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0;
  margin-bottom: 0.25rem;
}

.script-title h2 {
  font-size: 1.375rem;
}

.script-detail .mono {
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.script-detail p {
  max-width: 68ch;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
}

/* On or off, as a switch: a track with a knob at one end of it. */
.switch,
.switch:hover {
  position: relative;
  width: 2.75rem;
  min-height: 0;
  height: 1.625rem;
  padding: 0;
  border: 0;
  border-radius: 0.8125rem;
  background: var(--line-strong);
}

.switch[aria-checked='true'],
.switch[aria-checked='true']:hover {
  background: var(--good);
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--surface);
}

.switch[aria-checked='true']::after {
  left: calc(100% - 1.25rem - 3px);
}

.script-wrong {
  padding: 0.75rem 0 0;
  border: 1px solid var(--bad-line);
  border-radius: 10px;
  background: var(--bad-soft);
  color: var(--bad-ink);
  overflow: hidden;
}

.script-wrong strong {
  display: block;
  padding: 0 1rem 0.625rem;
}

.script-wrong table {
  background: var(--surface);
  color: var(--ink);
}

.script-facts {
  margin: 0;
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.script-facts dt,
.script-facts dd {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}

.script-facts dt {
  background: var(--sunken);
  color: var(--muted);
}

.script-facts dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}

.script-facts dt:nth-last-of-type(1),
.script-facts dd:nth-last-of-type(1) {
  border-bottom: 0;
}

.fact {
  padding: 0.0625rem 0.5625rem;
  border-radius: 6px;
  background: var(--line-soft);
  font-size: 0.8125rem;
}

.script-settings-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.375rem;
}

.script-settings-head h3 {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.script-settings-head .link {
  margin-left: auto;
  font-size: 0.8125rem;
}

/* A script's settings, one to a row in a box of their own. Kept to this list: the Settings section lays its own out differently. */
.settings-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.settings-list .setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.125rem 1rem;
  padding: 0.6875rem 0.875rem;
  border-top: 0;
  border-bottom: 1px solid var(--line-soft);
}

.settings-list .setting:last-child {
  border-bottom: 0;
}

.settings-list .setting.changed {
  background: var(--warn-soft);
}

.settings-list .setting label {
  font-weight: 600;
}

.settings-list .setting-control {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
}

.settings-list .setting-control input[type='number'] {
  width: 6.5rem;
}

.settings-list .setting-control input[type='text'] {
  width: 14rem;
}

.setting-help {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  max-width: 62ch;
}

.settings-list .setting.changed .setting-help {
  color: var(--ink-2);
}

.setting-help:empty {
  display: none;
}

.settings-list .fold {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: var(--sunken);
  color: var(--accent-dark);
  font-size: 0.8125rem;
  font-weight: 600;
}

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

  .script-side {
    border-right: 0;
  }

  .script-list {
    max-height: none;
  }

  /* The list, then the one chosen from it, with a way back. */
  .scripts[data-view='detail'] .script-side,
  .scripts[data-view='list'] .script-detail {
    display: none;
  }

  .script-back {
    display: block;
  }

  .script-detail {
    padding: 1rem;
  }
}

/* ---- eras, and starting from a backup ---- */

.tag.muted {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-soft);
  color: var(--ink-2);
}

td.row-action {
  text-align: right;
  white-space: nowrap;
}

.era-card tr.current td {
  font-weight: 600;
}

.era-card table {
  margin: 0.75rem 0;
}

.era-moves {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

.era-moves li + li {
  margin-top: 0.25rem;
}

.backup-note {
  margin: 0.75rem 1rem 0;
}

/* ---- windows: previews drawn as the client draws them, and the client's art ---- */

.windows-side {
  flex: 1 1 16rem;
  max-width: 24rem;
}

.windows-side .script-list {
  max-height: 46rem;
}

.window-head {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0 0.125rem;
  padding: 0 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.window-head span:first-child {
  flex-grow: 1;
}

.window-head .muted {
  font-weight: 500;
  letter-spacing: 0;
}

.window-tools select {
  width: auto;
}

.window-pad {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0 1rem 1rem;
  min-width: 0;
}

.window-pad > p {
  margin: 0;
}

/* The window at its pixels, made bigger without blurring; the outlines over it are drawn at the size shown. */
.gump-stage {
  position: relative;
  max-width: 100%;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sea);
  line-height: 0;
}

.gump-stage .gump {
  image-rendering: pixelated;
}

.gump-outline {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  cursor: crosshair;
  touch-action: none;
}

.gump-outline.pressable {
  cursor: pointer;
}

.gump-stage.small {
  max-height: 32rem;
}

.part-list {
  max-height: 22rem;
}

.part-row {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0.3rem 0.625rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font: 0.8125rem/1.35 var(--sans);
  text-align: left;
  overflow-wrap: anywhere;
}

.part-row:hover,
.part-row:focus-visible {
  background: var(--hover);
}

.part-row[aria-selected='true'] {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.part-facts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.part-facts dd,
.copies dd {
  overflow-wrap: anywhere;
}

.layout-text {
  max-height: 16rem;
  margin: 0.375rem 0 0.75rem;
  padding: 0.625rem 0.75rem;
  overflow: auto;
  border-radius: 8px;
  background: var(--console);
  color: #fff;
  font: 0.75rem/1.45 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

details > summary {
  cursor: pointer;
  font-weight: 600;
}

details[open] > summary {
  margin-bottom: 0.625rem;
}

.theme-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(32rem, 100%), 1fr));
  gap: 1rem;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.875rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
}

.tones li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.swatch {
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
}

.art-view {
  max-width: 100%;
  overflow: auto;
}

canvas.art-big {
  image-rendering: pixelated;
  max-width: 100%;
}

.copies {
  margin-top: 0.75rem;
  grid-template-columns: 7rem minmax(0, 1fr);
}

.copies dd {
  justify-content: space-between;
}

.copies code {
  font-size: 0.8125rem;
}

.copy-fallback {
  position: fixed;
  left: -100vw;
  top: 0;
}

canvas.hue-ramp {
  width: 100%;
  max-width: 24rem;
  height: 20px;
  border: 1px solid var(--line);
  image-rendering: pixelated;
}

.hue-grid canvas:focus-visible,
.art-grid:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 46rem) {
  .windows-side {
    max-width: none;
  }
}

/* What the layout checker found in a window: one row a finding. */
.findings {
  margin: 0;
  padding: 0;
  list-style: none;
}

.findings li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.625rem 0.5rem;
  border-top: 1px solid var(--line-soft);
}

.findings li:first-child {
  border-top: 0;
}

.findings li.flagged {
  background: var(--accent-soft);
}

.findings .tag {
  margin: 0.125rem 0 0;
}

.findings p {
  margin: 0;
}

.findings p + p {
  margin-top: 0.25rem;
}

.findings .rule {
  font-size: 0.75rem;
}

/* The previews followed by buttons that lead on, above the window. */
.preview-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}
