:root {
  --bg: #0c0d10;
  --fg: #c9c7c0;
  --dim: #7d7b75;
  --white: #f2f0ea;
  --gray: #8a8a8a;
  --red: #d05a4c;
  --green: #6faa5f;
  --yellow: #d6b04a;
  --cyan: #5fb4c4;
  --electric: #2f6bff;
  --panel: #15171c;
  --panel2: #111318;
  --edge: #1f2228;
  --vitality: #c42f2f;
  --stamina: #d9822b;
  --mana: #2f4fb0;
  --acuity: #6b3fa0;
  --divinity: #c9a227;
  --mount: #8a6a46;
  --echo: #6f8fb3;
  /* A quest by how it comes round (the journal, the map's markers): regular, daily, weekly, monthly. */
  --quest: #d6b04a;
  --quest-daily: #5fb4c4;
  --quest-weekly: #6faa5f;
  --quest-monthly: #b07ad6;
  --quest-rare: #e8743b;
  /* Text sizes, from the Options tab's Web client section (client.js applyTextSize): every font size
     is a multiple of one. The game window (its lines, the focus tab, the input) takes --game-text,
     everything else --panel-text; each is the All text slider times its own. */
  --game-text: 1;
  --panel-text: 1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: calc(14px * var(--panel-text))/1.35 "Cascadia Mono", "JetBrains Mono", Consolas, "DejaVu Sans Mono", monospace;
}

#client {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---- header: hands, position, status, link ---- */
#status {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 5px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--edge);
  font-size: calc(13px * var(--panel-text));
  white-space: nowrap;
  overflow: hidden;
}
#status .balance { color: var(--dim); }
#status .link { margin-left: auto; color: var(--dim); }
#status .link.up { color: var(--green); }
#status .link.down { color: var(--red); }
#status .link.slow { color: var(--yellow); }
#icons { display: flex; gap: 6px; }
#icons .icon { padding: 0 6px; border-radius: 3px; font-size: calc(11px * var(--panel-text)); line-height: 16px; background: #2a2020; color: var(--red); border: 1px solid #4a2a2a; }
#icons .icon.open { background: #2a2718; color: var(--yellow); border-color: #4a4420; }
#icons .icon.fleeing { background: #1c2230; color: var(--cyan); border-color: #24364a; }
#icons .icon.spell { background: #221a2c; color: #a46be8; border-color: #3a2a4a; }
#icons .icon.spell.ready { color: var(--white); border-color: #a46be8; }

/* ---- room panel, top ---- */
#roompanel {
  max-height: 22vh;
  overflow-y: auto;
  padding: 8px 12px;
  background: var(--panel2);
  border-bottom: 1px solid var(--edge);
  font-size: calc(13px * var(--panel-text));
}
#roompanel .desc { color: var(--fg); }
/* The panel's and the Here list's text is colored by the game's kinds, as the game window paints them
   (server/ansi.ts PALETTE), so a recolored kind reaches all three: the rules the client writes for a
   recolor select [data-kind] anywhere. These are the standard colors. */
#roompanel [data-kind="roomName"], #side [data-kind="roomName"] { color: var(--white); font-weight: bold; }
#roompanel [data-kind="exits"], #side [data-kind="exits"] { color: var(--gray); }
#roompanel [data-kind="players"], #side [data-kind="players"] { color: var(--cyan); }
#roompanel [data-kind="creatures"], #side [data-kind="creatures"] { color: #d787af; }
#roompanel [data-kind="roomObjects"], #side [data-kind="roomObjects"] { color: #d7af87; }
#roompanel [data-kind="people"], #side [data-kind="people"] { color: #5f87ff; }

/* ---- middle: game window and the side panels ---- */
#middle {
  flex: 1;
  display: flex;
  min-height: 0;
}
#game-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
#script-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: #3a1612;
  border-bottom: 2px solid var(--red);
  color: var(--white);
  font-weight: bold;
}
#script-banner[hidden] { display: none; }
#script-banner-text { flex: 1; white-space: pre-wrap; word-break: break-word; }
#script-banner-close { background: none; border: none; color: var(--white); font-size: calc(18px * var(--panel-text)); line-height: 1; cursor: pointer; padding: 0 2px; }
#script-banner-close:hover { color: var(--red); }
/* A new client since the page was opened: calmer than a script's banner, since nothing's wrong. */
#build-banner { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #13262e; border-bottom: 2px solid var(--cyan); color: var(--white); }
#build-banner[hidden] { display: none; }
#build-banner-text { flex: 1; }
#build-banner-reload { background: none; border: 1px solid var(--cyan); color: var(--cyan); border-radius: 3px; padding: 2px 10px; cursor: pointer; font: inherit; }
#build-banner-reload:hover { background: var(--cyan); color: #13262e; }
#build-banner-close { background: none; border: none; color: var(--white); font-size: calc(18px * var(--panel-text)); line-height: 1; cursor: pointer; padding: 0 2px; }
#build-banner-close:hover { color: var(--cyan); }
#out {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
  font-size: calc(14px * var(--game-text));
}
#out .line { min-height: 1.35em; }
#out .echo { color: var(--echo); }
:is(#out, #focus-body) .bold { font-weight: bold; }
:is(#out, #focus-body) .dim { color: var(--dim); }
:is(#out, #focus-body) .white { color: var(--white); }
:is(#out, #focus-body) .gray { color: var(--gray); }
:is(#out, #focus-body) .red { color: var(--red); }
:is(#out, #focus-body) .green { color: var(--green); }
:is(#out, #focus-body) .yellow { color: var(--yellow); }
:is(#out, #focus-body) .cyan { color: var(--cyan); }
:is(#out, #focus-body) .x27 { color: var(--electric); }
/* Reversed (SGR 7): a badge, its color behind the word; AUTO's tag before each line it sends. */
:is(#out, #focus-body) .badge { color: var(--bg); background: var(--fg); border-radius: 3px; padding: 0 4px; font-size: calc(11px * var(--game-text)); font-weight: bold; vertical-align: 1px; }
:is(#out, #focus-body) .badge.green { background: var(--green); }
/* A script that stopped on its own, or failed: full size, to cut through a fight. */
:is(#out, #focus-body) .badge.red { background: var(--red); color: var(--white); font-size: inherit; }
/* Your own spellcraft (xterm 135): shaping, ready, aimed, cast. */
:is(#out, #focus-body) .x135 { color: #af87ff; }
/* A clean strike (xterm 210). */
:is(#out, #focus-body) .x210 { color: #ff8787; }
:is(#out, #focus-body) .x180 { color: #d7af87; }
/* Who's speaking, "Atrix says," (xterm 114). */
:is(#out, #focus-body) .x114 { color: #87d787; }
/* Creatures, what you fight (xterm 175). */
:is(#out, #focus-body) .x175 { color: #d787af; }
/* People who aren't players, townsfolk and residents (xterm 69). */
:is(#out, #focus-body) .x69 { color: #5f87ff; }
/* A familiar come to you, holding something out or calling you to follow (xterm 170). */
:is(#out, #focus-body) .x170 { color: #d75fd7; }

/* The drawer: a panel opened from the vertical tabs, between the game window and the sidebar. */
#drawer {
  /* Wide enough for EXP's row whole (name, ranks, the mind's word, and its count) beside the scrollbar. */
  width: 450px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--edge);
  background: var(--panel2);
  min-height: 0;
}
#drawer[hidden] { display: none; }
/* Each side panel's left edge drags its width (client.js, panel widths); a double click puts it back. */
#drawer, #side { position: relative; }
.width-grip { position: absolute; left: -3px; top: 0; bottom: 0; width: 6px; z-index: 4; cursor: col-resize; touch-action: none; }
.width-grip:hover, .width-grip.dragging { background: var(--edge); }
body.width-dragging { cursor: col-resize; user-select: none; }
#drawer .panel { display: none; flex: 1; flex-direction: column; min-height: 0; padding: 10px 12px; font-size: calc(13px * var(--panel-text)); }
#drawer .panel.open { display: flex; }

/* The tabs: a thin vertical strip, labels turned on their side. */
#tabs {
  width: 26px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-left: 1px solid var(--edge);
  background: var(--panel);
}
#tabs button {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: inherit;
  font-size: calc(11px * var(--panel-text));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  background: transparent;
  border: 0;
  border-right: 2px solid transparent;
  padding: 10px 4px;
  cursor: pointer;
}
#tabs button:hover { color: var(--fg); }
#tabs button.active { color: var(--white); border-right-color: var(--cyan); background: var(--panel2); }

#side {
  /* As wide as the drawer, for the map's sake. */
  width: 420px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--edge);
  background: var(--panel2);
  min-height: 0;
}
#side .panel, #drawer .panel { font-size: calc(13px * var(--panel-text)); }
#side .panel { display: flex; flex-direction: column; min-height: 0; padding: 10px 12px; }
#side #map-panel { flex: 1 1 55%; border-bottom: 1px solid var(--edge); padding-bottom: 6px; }
#side #map-panel h3 .sub { margin-left: 8px; font-weight: normal; text-transform: none; letter-spacing: 0; color: var(--dim); }
#side .map-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
#side #map { flex: 1; width: 100%; min-height: 0; background: #0a0b0d; border: 1px solid var(--edge); border-radius: 3px; cursor: grab; user-select: none; -webkit-user-select: none; }
#side .map-card { position: absolute; right: calc(100% + 10px); width: 220px; background: var(--panel); border: 1px solid #3a3f4a; border-radius: 4px; padding: 8px 10px; font-size: calc(12px * var(--panel-text)); box-shadow: 0 4px 16px #000; z-index: 3; }
#side .map-card .head { display: flex; align-items: flex-start; gap: 6px; }
#side .map-card .name { flex: 1; color: var(--white); font-weight: bold; }
#side .map-card .close { font: inherit; color: var(--dim); background: none; border: 0; cursor: pointer; padding: 0 2px; }
#side .map-card .meta { color: var(--dim); margin: 2px 0 6px; }
#side .map-card .exit { display: flex; gap: 8px; }
/* The map legend (Design/world/maps/legend.md): icons on the rooms, a + for more, the card's list, and the Legend button's drop-down. */
#side #map .landmark { pointer-events: none; font-family: "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", sans-serif; }
#side #map .landmark.more { fill: #f2f0ea; font-weight: bold; }
#side #map .landmark.found { fill: #c4b5fd; font-weight: bold; }
#side .map-legend .mark .icon.found { color: #c4b5fd; font-weight: bold; }
#side .map-card .found { color: #c4b5fd; margin: 0 0 6px; }
#side #map .landmark.waymark { fill: #f6c860; font-weight: bold; }
#side .map-legend .mark .icon.waymark { color: #f6c860; font-weight: bold; }
#side .map-card .waymark { color: #f6c860; margin: 0 0 6px; }
#side .map-card .marks { margin: 0 0 6px; }
#side .map-card .mark, #side .map-legend .mark { display: flex; gap: 8px; align-items: baseline; }
#side .map-card .mark .icon, #side .map-legend .mark .icon { min-width: 1.4em; text-align: center; font-family: "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", sans-serif; }
#side .map-legend .mark .icon.more { color: #f2f0ea; font-weight: bold; }
#side .legend-button { position: absolute; right: 4px; bottom: 4px; z-index: 2; font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--gray); background: var(--panel); border: 1px solid #3a3f4a; border-radius: 3px; padding: 1px 6px; cursor: pointer; }
#side .legend-button:hover { color: var(--white); }
/* The big map's button, at the map's top right, and the window it opens: the same map, pulled out (Savicki, October 2026). */
#side .map-expand { position: absolute; right: 4px; top: 4px; z-index: 2; font: inherit; font-size: calc(13px * var(--panel-text)); line-height: 1; color: var(--gray); background: var(--panel); border: 1px solid #3a3f4a; border-radius: 3px; padding: 2px 5px; cursor: pointer; }
#side .map-expand:hover { color: var(--white); }
#side .map-big { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.55); z-index: 10; }
#side .map-big[hidden] { display: none; }
#side .map-big-sheet { display: flex; flex-direction: column; width: max(min(760px, 100%), 75vw); height: max(min(520px, 100%), 75vh); background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; }
#side .map-big-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--white); border-bottom: 1px solid var(--edge); }
#side .map-big-head button { margin-left: auto; font: inherit; font-size: calc(18px * var(--panel-text)); line-height: 1; color: var(--dim); background: none; border: 0; cursor: pointer; }
#side .map-big-head button:hover { color: var(--white); }
#side .map-big-body { flex: 1; min-height: 0; display: flex; padding: 8px; }
#side .map-big-body .map-wrap { flex: 1; }
#side .map-legend { position: absolute; right: 4px; bottom: 26px; z-index: 3; max-height: calc(100% - 32px); overflow-y: auto; background: var(--panel); border: 1px solid #3a3f4a; border-radius: 4px; padding: 6px 10px; font-size: calc(12px * var(--panel-text)); box-shadow: 0 4px 16px #000; }
#side .map-legend .letters { display: block; margin-top: 6px; color: var(--dim); cursor: pointer; }
#side .map-card .exit .dir { color: var(--gray); min-width: 9ch; }
#side .map-card .exit .to { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#side .map-card .exit.untaken .to { color: #3b8fd8; }
#side .map-card .actions { margin-top: 8px; }
#side .map-card .actions button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: #1f2a1f; border: 1px solid #35503a; border-radius: 3px; padding: 3px 10px; cursor: pointer; }
#side .map-card .actions button:disabled { color: var(--dim); background: #0a0b0d; border-color: var(--edge); cursor: default; }
#side #map.dragging { cursor: grabbing; }
#side #map .link { stroke: #3a3f4a; stroke-width: 1.5; }
/* A door or named way (GO in, OUT back, a climb): dashed and warmer, so it never reads as a compass step. */
#side #map .link.door { stroke: #8a6a42; stroke-dasharray: 3 2; }
#side #map .room { fill: #2a2e37; stroke: #4a5060; stroke-width: 1; cursor: pointer; }
#side #map .room:hover { filter: brightness(1.35); }
/*
 * Room color (Savicki, October 2026): by its kind of ground first, then a few
 * places drawn over it. The city in warm cobblestone, so civilization reads at
 * a glance; the wilds each their own; water light blue, under it deeper.
 */
#side #map .room.env-street { fill: #3a4252; }
#side #map .room.env-building { fill: #4d3b28; }
#side #map .room.env-field { fill: #2f4a2f; }
#side #map .room.env-underground { fill: #3a2a4a; }
/* The city: streets cobblestone, buildings warm timber, its farmland wheat, its sewers murk. */
#side #map .room.type-street { fill: #5a544a; }
#side #map .room.type-building { fill: #6b4f33; }
#side #map .room.type-farmland { fill: #6a6a34; }
#side #map .room.type-sewer { fill: #34392c; }
/* The wilds. */
#side #map .room.type-meadow { fill: #3f6e36; }
#side #map .room.type-forest { fill: #2b5a32; }
#side #map .room.type-deep-forest { fill: #1c3f25; }
#side #map .room.type-hills { fill: #6e5e3c; }
#side #map .room.type-mountain { fill: #6c6c6c; }
#side #map .room.type-marsh { fill: #34584e; }
#side #map .room.type-badlands { fill: #7d4c2c; }
#side #map .room.type-cave { fill: #4b4640; }
#side #map .room.type-shore { fill: #8f8056; }
/* Drawn over the ground: the city's alleys, gates, and shrine, the sky, and water. */
#side #map .room.env-alley { fill: #3c3832; }
#side #map .room.env-gate { fill: #6e6858; }
#side #map .room.env-shrine { fill: #7a6526; }
#side #map .room.env-sky { fill: #2a4460; }
/* In the sky, the ground below grayed out beneath it (web/client.js, drawMap). */
#side #map .below { opacity: 0.55; filter: grayscale(1); pointer-events: none; }
#side #map.aloft .room.env-sky { fill: none; stroke: #4a7aa8; stroke-width: 1.5; }
/* Your own ship, where she lies (Map.Ship). */
#side #map .own-ship { pointer-events: auto; font-weight: bold; }
.icon.own-ship { color: #e8b84a; }
#side #map .room.env-water { fill: #6fa8dc; }
#side #map .room.env-underwater { fill: #2f5f9e; }
#map-legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; }
/* A hunting ground you've met creatures in: a marked edge, under the here, target, and unexplored strokes. */
#side #map .room.hunted { stroke: #c46a5a; stroke-width: 1.5; stroke-dasharray: 3 1.5; }
#side .map-card .hunted { color: #c46a5a; margin: 0 0 6px; }
/* Where you've found what you last recalled (Map.Gathered): a ring just outside the square, a faint one where only the old patch is known. */
#side #map .gathered { fill: none; stroke: #b9a24a; stroke-width: 1.5; pointer-events: none; }
#side #map .gathered.faint { stroke-opacity: 0.45; stroke-dasharray: 2 2; }
#side .map-card .gathered { color: #b9a24a; margin: 0 0 6px; }
#side #map .room.here { stroke: #f2f0ea; stroke-width: 2.5; }
#side #map .room.target { stroke: var(--cyan); stroke-width: 2; }
#side #map .room.hunted.here, #side #map .room.hunted.target { stroke-dasharray: none; }
#side #map .room.unexplored { stroke: #3b8fd8; stroke-width: 1.5; }
#side #map .room.unexplored.here { stroke: #f2f0ea; }
/* Seen through a familiar's eyes, never stood in: faint, and no walking there (Design/details/familiars.md, Its eyes). */
#side #map .room.seen { opacity: 0.35; stroke-dasharray: 2 2; }
#side #map .stub { stroke: #2a2e37; stroke-width: 1.5; stroke-dasharray: 2 2; }
/* A way onto another map: a solid stub and an arrowhead jutting out, a little brighter so it reads as a way on. */
#side #map .stub.offmap { stroke: #8f96a8; stroke-dasharray: none; }
#side #map .offmap-arrow { fill: #8f96a8; }
#side #map .caret { fill: none; stroke: #c9c7c0; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#side #map .out { fill: #f2f0ea; font-size: 12px; font-weight: bold; pointer-events: none; }
#side #here-panel { flex: 1 1 45%; }
#side h3, #drawer h3 { margin: 0 0 6px; font-size: calc(11px * var(--panel-text)); font-weight: bold; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
#side .list, #drawer .list { overflow-y: auto; min-height: 0; }
/* The scrollbar's room kept from the start, so the rows don't narrow when it appears. */
#drawer .list { scrollbar-gutter: stable; }
/* EXP's columns, fixed: name, ranks (to 9999.99), the mind's word (to "engrossed"), its count ("34/34"), so every row lines up. */
#side .skill, #drawer .skill { display: grid; grid-template-columns: minmax(0, 1fr) 8ch 10ch 6ch; column-gap: 6px; white-space: nowrap; line-height: 1.5; }
#side .skill .n, #drawer .skill .n { overflow: hidden; text-overflow: ellipsis; }
/* The empty line takes the whole row, not the name's column, so it reads in full. */
#side .skill.empty, #drawer .skill.empty { display: block; white-space: normal; color: var(--dim); }
#side .skill .r, #drawer .skill .r { color: var(--white); text-align: right; }
#side .skill .r, #drawer .skill .r, #side .skill .c, #drawer .skill .c { font-variant-numeric: tabular-nums; }
#side .skill .m, #drawer .skill .m { color: var(--dim); }
#side .skill .c, #drawer .skill .c { color: var(--dim); text-align: right; }
#side .skill.locked .m, #drawer .skill.locked .m, #side .skill.locked .c, #drawer .skill.locked .c { color: var(--yellow); }

/* The script log: time, script, what it said, the text wrapping under itself. */
#drawer h3 .log-clear { float: right; font: inherit; font-size: calc(11px * var(--panel-text)); text-transform: none; letter-spacing: 0; color: var(--dim); background: transparent; border: 1px solid var(--edge); border-radius: 3px; padding: 0 8px; cursor: pointer; }
#drawer h3 .log-clear:hover { color: var(--white); border-color: var(--cyan); }
#drawer .log-line { display: grid; grid-template-columns: 8ch 10ch minmax(0, 1fr); column-gap: 6px; line-height: 1.5; }
#drawer .log-line .t { color: var(--dim); font-variant-numeric: tabular-nums; }
#drawer .log-line .s { color: var(--cyan); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#drawer .log-line .x { overflow-wrap: anywhere; }
#drawer .log-line.start .x { color: var(--green); }
#drawer .log-line.end .x { color: var(--yellow); }
#drawer .log-line.empty { display: block; color: var(--dim); }
#side .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
/* Each row is colored by its kind (players, creatures, what else is here), with the room panel above. */
#side .who .note { color: var(--dim); }

/* ---- the dock: three slim rows on the left (hotbar, bars and hands, prompt); the lantern, posture, injuries, and compass beside them ---- */
#dock {
  display: flex;
  align-items: stretch;
  background: var(--panel);
  border-top: 1px solid var(--edge);
}
#dock-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#dock-right { flex: none; display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-left: 1px solid var(--edge); }
/* Your state in one framed box, as the bars are: the lantern over the posture figure, the injury figure beside them, the drop in its corner. */
#dock .status-box { position: relative; display: flex; align-items: center; gap: 10px; height: 82px; padding: 2px 24px 2px 8px; background: var(--panel2); border: 1px solid var(--edge); border-radius: 4px; box-sizing: border-box; }
#dock .status-col { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* ---- hotbar: twelve slots on 1 to 0, - and = ---- */
#hotbar {
  display: flex;
  gap: 4px;
  padding: 4px 12px;
  background: var(--panel2);
  overflow: hidden;
}
#hotbar button {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 3px 6px;
  font: inherit;
  font-size: calc(12px * var(--panel-text));
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
#hotbar button .key { color: var(--dim); }
#hotbar button .title { overflow: hidden; text-overflow: ellipsis; }
#hotbar button.empty .title { color: var(--dim); }
#hotbar button:hover { border-color: var(--cyan); }
#hotbar-editor {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10;
}
#hotbar-editor[hidden] { display: none; }
#hotbar-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 4px;
}
#hotbar-form .head { color: var(--white); }
#hotbar-form label { display: flex; flex-direction: column; gap: 4px; color: var(--dim); font-size: calc(12px * var(--panel-text)); }
/* Cast when ready: the checkbox and the form's dropdown, one row of the slot's editor. */
#hotbar-form label.cast { flex-direction: row; align-items: center; gap: 6px; cursor: pointer; }
#hotbar-form label.cast input { margin: 0; }
#hotbar-form label.cast select { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel); border: 1px solid var(--edge); border-radius: 3px; padding: 2px 3px; }
#hotbar-form input, #hotbar-form textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--edge); border-radius: 3px; padding: 4px 6px; }
#hotbar-form .actions { display: flex; gap: 6px; justify-content: flex-end; }
#hotbar-form .actions button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 10px; cursor: pointer; }

/* ---- the hotbar's row: the arrows that turn the six bars, then the bar showing ---- */
#hotbar-row { display: flex; align-items: stretch; background: var(--panel2); }
#hotbar-row #hotbar { flex: 1; min-width: 0; padding-left: 6px; }
#hotbar-turn { flex: none; display: flex; align-items: center; gap: 2px; padding: 0 0 0 12px; font-size: calc(11px * var(--panel-text)); }
#hotbar-turn button { font: inherit; font-size: calc(9px * var(--panel-text)); line-height: 1; color: var(--dim); background: var(--panel); border: 1px solid var(--edge); border-radius: 3px; padding: 4px 4px; cursor: pointer; }
#hotbar-turn button:hover { color: var(--white); border-color: var(--cyan); }
#hotbar-num { min-width: 1.4em; text-align: center; color: var(--white); }

/* ---- settings: the cog at the top right, and its window ---- */
#status .cog { display: flex; align-items: center; padding: 1px 2px; color: var(--dim); background: none; border: 0; cursor: pointer; }
#status .cog:hover, #status .cog:focus-visible { color: var(--white); }
#settings {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10;
  /* The body's size, from its own --panel-text: a text-size slider holds this window still while it's dragged (client.js). */
  font-size: calc(14px * var(--panel-text));
}
#settings[hidden] { display: none; }
/* The room panel's right: Calder's bubble and the sky dial side by side, kept in view as the panel scrolls, the room's text wrapping around them. */
#room-side { float: right; position: sticky; top: 0; display: flex; align-items: flex-start; gap: 6px; margin: 0 0 4px 10px; }
/* The sky dial (Room.Sky), about the compass's size: drawn in client.js drawSky. An oval, its rim feathered into the panel rather than edged, so it sits soft beside the text; the drawing keeps the sun's arc and the ground inside the fade. */
#sky { width: 128px; height: 68px; line-height: 0; border-radius: 50%; overflow: hidden; -webkit-mask-image: radial-gradient(closest-side, #000 80%, transparent 100%); mask-image: radial-gradient(closest-side, #000 80%, transparent 100%); }
#sky[hidden] { display: none; }
#sky svg { width: 100%; height: 100%; }
#sky .twinkle { animation: sky-twinkle 3.2s ease-in-out infinite alternate; }
#sky .twinkle:nth-child(3n) { animation-delay: -1.1s; }
#sky .twinkle:nth-child(3n+1) { animation-delay: -2.3s; }
@keyframes sky-twinkle { from { opacity: 1; } to { opacity: 0.35; } }
#sky .drift { animation: sky-drift 40s linear infinite alternate; }
@keyframes sky-drift { from { transform: translateX(-6px); } to { transform: translateX(6px); } }
#sky .fall { animation: sky-fall 0.9s linear infinite; }
#sky .fall.snow { animation-duration: 6s; }
#sky .fall.ash { animation: sky-ash 8s linear infinite; }
@keyframes sky-fall { from { transform: translateY(-64px); } to { transform: translateY(0); } }
/* Ash swings side to side as it settles, back where it started at the loop's seam. */
@keyframes sky-ash { 0% { transform: translate(0, -64px); } 50% { transform: translate(6px, -32px); } 100% { transform: translate(0, 0); } }
#sky .blow { animation: sky-blow 2.4s linear infinite; }
@keyframes sky-blow { from { transform: translateX(0); } to { transform: translateX(-120px); } }
#sky .rise { animation: sky-rise 5s linear infinite; }
@keyframes sky-rise { from { transform: translateY(0); } to { transform: translateY(-64px); } }
@media (prefers-reduced-motion: reduce) { #sky * { animation: none !important; } }
/* Calder's window (systems/calder-chat.ts): the bubble at the room panel's right, and the talk in the reading window's sheet. */
#calder-button { position: relative; padding: 4px 6px; line-height: 0; color: var(--dim); background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; cursor: pointer; }
#calder-button[hidden] { display: none; }
#calder-button:hover, #calder-button.waiting { color: var(--white); border-color: #35503a; background: #1f2a1f; }
#calder-button.waiting { animation: calder-wait 1.2s ease-in-out infinite alternate; }
@keyframes calder-wait { from { opacity: 1; } to { opacity: 0.55; } }
/* An answer waiting unseen: a dot on the bubble's corner. */
#calder-button.unread { color: var(--white); }
#calder-button.unread::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--panel2); }
#calder { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.55); z-index: 10; }
#calder[hidden] { display: none; }
#calder .sheet { display: flex; flex-direction: column; width: min(720px, 100%); height: max(min(520px, 100%), 75vh); background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; }
#calder .sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--white); border-bottom: 1px solid var(--edge); }
#calder .sheet-head .sub { color: var(--dim); font-size: calc(12px * var(--panel-text)); }
#calder .sheet-head .fresh { margin-left: auto; font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--dim); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 2px 10px; cursor: pointer; }
#calder .sheet-head .fresh:hover { color: var(--white); }
#calder #calder-close { font: inherit; font-size: calc(18px * var(--panel-text)); line-height: 1; color: var(--dim); background: none; border: 0; cursor: pointer; }
#calder #calder-close:hover { color: var(--white); }
#calder-log { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 18px; line-height: 1.5; }
#calder-log .line { margin: 0 0 12px; white-space: pre-wrap; }
#calder-log .line.you { color: var(--cyan); }
#calder-log .line.you::before { content: "You: "; color: var(--dim); }
#calder-log .line.calder { color: var(--fg); }
#calder-log .line.calder::before { content: "Calder: "; color: var(--white); }
#calder-log .none { color: var(--dim); font-style: italic; }
#calder-status { padding: 4px 18px; color: var(--dim); font-style: italic; font-size: calc(12px * var(--panel-text)); border-top: 1px solid var(--edge); }
#calder-status[hidden] { display: none; }
#calder-form { display: flex; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--edge); }
#calder-input { flex: 1; resize: none; font: inherit; color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 6px 8px; }
#calder-send { font: inherit; color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 14px; cursor: pointer; }
#calder-send:disabled { color: var(--dim); cursor: default; }
/* The reading window (Design/initiatives/active/books.md): the settings' sheet, with the contents down the side and the page beside them. */
#book { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.55); z-index: 10; }
#book[hidden] { display: none; }
#book .sheet { display: flex; flex-direction: column; width: min(calc(max(min(760px, 100%), 70vw) + 70px), 100%); height: max(min(520px, 100%), 75vh); background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; }
#book .sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--white); border-bottom: 1px solid var(--edge); }
#book .sheet-head .sub { color: var(--dim); font-size: calc(12px * var(--panel-text)); }
#book .sheet-head button { margin-left: auto; font: inherit; font-size: calc(18px * var(--panel-text)); line-height: 1; color: var(--dim); background: none; border: 0; cursor: pointer; }
#book .sheet-head button:hover { color: var(--white); }
#book .book-body { flex: 1; min-height: 0; display: flex; }
#book .book-side { width: 300px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--edge); }
#book .book-side input { margin: 8px 10px 0; font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 4px 8px; }
#book .book-contents { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0; font-size: calc(12px * var(--panel-text)); }
#book .book-contents button.section { color: var(--dim); padding-left: 20px; font-style: italic; }
#book .book-contents button.section::before { content: "\25B8  "; font-style: normal; }
#book .book-contents button.section.unfolded::before { content: "\25BE  "; }
#book .book-contents button.page.in-section { padding-left: 34px; }
#book .book-contents .none { color: var(--dim); padding: 3px 14px; }
#book .book-contents button { display: block; width: 100%; text-align: left; font: inherit; color: var(--dim); background: none; border: 0; padding: 3px 14px; cursor: pointer; }
#book .book-contents button.chapter { color: var(--white); margin-top: 6px; }
#book .book-contents button.chapter::before { content: "\25B8  "; color: var(--dim); }
#book .book-contents button.chapter.unfolded::before { content: "\25BE  "; }
#book .book-contents button.page { padding-left: 26px; }
#book .book-contents button:hover, #book .book-contents button.here { color: var(--white); background: var(--panel2); }
#book .book-page { flex: 1; min-width: 0; overflow-y: auto; padding: 12px 18px; line-height: 1.5; }
#book .book-page .book-head { color: var(--white); margin-bottom: 10px; }
#book .book-page .book-para { margin: 0 0 10px; white-space: pre-wrap; }
#book .book-page .book-section { color: var(--dim); font-style: italic; margin: 12px 0 4px; }
#book .book-page .book-row { display: grid; grid-template-columns: 6em minmax(0, 1fr) 5em 16em; gap: 12px; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 2px 6px; cursor: pointer; border-radius: 3px; }
#book .book-page .book-row:hover { background: var(--panel2); color: var(--white); }
#book .book-page .book-row .n, #book .book-page .book-row .code { color: var(--dim); }
#book .book-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 18px; border-top: 1px solid var(--edge); font-size: calc(12px * var(--panel-text)); }
#book .book-actions[hidden] { display: none; }
#book .book-actions button { font: inherit; color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 12px; cursor: pointer; }
#book .book-actions .note { color: var(--yellow, #e5c07b); }
#book .book-foot { display: flex; gap: 8px; justify-content: center; padding: 8px 14px; border-top: 1px solid var(--edge); }
#book .book-foot button, .line button.book-open { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 12px; cursor: pointer; }
@media (max-width: 600px) { #book .book-body { flex-direction: column; } #book .book-side { width: auto; max-height: 35%; border-right: 0; border-bottom: 1px solid var(--edge); } }
#settings .sheet {
  display: flex;
  flex-direction: column;
  /* three quarters of the screen, the same size on every tab, so scripts have room to read */
  width: max(min(760px, 100%), 75vw);
  height: max(min(520px, 100%), 75vh);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 4px;
}
#settings .sheet-head { display: flex; align-items: center; padding: 10px 14px; color: var(--white); border-bottom: 1px solid var(--edge); }
#settings .sheet-head button { margin-left: auto; font: inherit; font-size: calc(18px * var(--panel-text)); line-height: 1; color: var(--dim); background: none; border: 0; cursor: pointer; }
#settings .sheet-head button:hover { color: var(--white); }
#settings .sheet-tabs { display: flex; gap: 2px; padding: 6px 14px 0; border-bottom: 1px solid var(--edge); }
#settings .sheet-tabs button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--dim); background: none; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; padding: 4px 12px; cursor: pointer; }
#settings .sheet-tabs button.active { color: var(--white); background: var(--panel2); border-color: var(--edge); }
#settings .pane { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; overflow-y: auto; }
#settings .pane[hidden] { display: none; }
#settings .hint { margin: 0; color: var(--dim); font-size: calc(12px * var(--panel-text)); }
#settings .capture { padding: 8px 10px; color: var(--white); background: #1c2230; border: 1px solid #24364a; border-radius: 3px; font-size: calc(12px * var(--panel-text)); }
#settings .capture[hidden] { display: none; }
#settings .capture .note { display: block; margin-top: 4px; color: var(--yellow); }
#settings .actions { display: flex; gap: 6px; justify-content: flex-end; }
#settings button.plain { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 10px; cursor: pointer; }
#settings .actions button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 10px; cursor: pointer; }
#settings .actions button:hover, #settings button.plain:hover { border-color: var(--cyan); }
.keys-list { display: grid; grid-template-columns: minmax(7em, auto) 1fr auto auto; align-items: center; gap: 2px 10px; font-size: calc(12px * var(--panel-text)); }
.keys-list .key, .keys-list .command { min-width: 0; text-align: left; font: inherit; color: var(--fg); background: none; border: 1px solid transparent; border-radius: 3px; padding: 2px 4px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keys-list .key { color: var(--white); }
.keys-list .key:hover, .keys-list .command:hover { border-color: var(--edge); background: var(--panel2); }
.keys-list .command.unbound { color: var(--dim); font-style: italic; }
.keys-list .state { color: var(--dim); font-size: calc(11px * var(--panel-text)); }
.keys-list .state.yours, .keys-list .state.changed { color: var(--cyan); }
.keys-list .row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.keys-list .row-actions button { font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--gray); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 1px 6px; cursor: pointer; }
.keys-list .row-actions button:hover { color: var(--white); border-color: var(--cyan); }
.keys-list input { min-width: 0; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--cyan); border-radius: 3px; padding: 2px 4px; }
.keys-list.aliases { grid-template-columns: minmax(5em, auto) 1fr auto; }
.keys-list.triggers { grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto; }
.keys-list .kind { font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--dim); background: none; border: 1px solid var(--edge); border-radius: 3px; padding: 1px 5px; cursor: pointer; }
.keys-list .kind:hover { color: var(--white); border-color: var(--cyan); }
.keys-list .off { opacity: 0.45; }
#settings .reply { margin: 0; padding: 6px 8px; color: var(--fg); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; font-size: calc(12px * var(--panel-text)); white-space: pre-line; }
#settings .reply[hidden] { display: none; }
#settings .sheet { position: relative; }

/* ---- the scripting guide, a large window over the settings ---- */
#guide { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.6); z-index: 20; }
#guide[hidden] { display: none; }
#guide .guide-sheet { display: flex; flex-direction: column; width: min(980px, 100%); height: min(92vh, 100%); background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; }
#guide .sheet-head { display: flex; align-items: center; padding: 10px 14px; color: var(--white); border-bottom: 1px solid var(--edge); }
#guide .sheet-head button { margin-left: auto; font: inherit; font-size: calc(18px * var(--panel-text)); line-height: 1; color: var(--dim); background: none; border: 0; cursor: pointer; }
#guide .sheet-head button:hover { color: var(--white); }
#guide .guide-body { overflow-y: auto; padding: 4px 20px 24px; font-size: calc(13px * var(--panel-text)); line-height: 1.5; }
#guide .guide-contents { position: sticky; top: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; background: var(--panel); border-bottom: 1px solid var(--edge); font-size: calc(12px * var(--panel-text)); }
#guide .guide-contents a { color: var(--cyan); text-decoration: none; }
#guide .guide-contents a:hover { text-decoration: underline; }
#guide h2 { margin: 22px 0 8px; font-size: calc(14px * var(--panel-text)); color: var(--white); }
#guide h3 { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; font-size: calc(13px * var(--panel-text)); color: var(--white); }
#guide p, #guide ul { margin: 6px 0; }
#guide ul { padding-left: 20px; }
#guide code { color: var(--white); }
#guide pre { margin: 8px 0; padding: 10px 12px; overflow-x: auto; background: var(--bg); border: 1px solid var(--edge); border-radius: 3px; line-height: 1.45; }
#guide pre code { color: var(--fg); }
#guide table { border-collapse: collapse; margin: 8px 0; font-size: calc(12px * var(--panel-text)); }
#guide th, #guide td { padding: 4px 10px 4px 0; vertical-align: top; text-align: left; border-bottom: 1px solid var(--edge); }
#guide th { color: var(--dim); font-weight: normal; }
#guide .use-example { font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--cyan); border-radius: 3px; padding: 1px 8px; cursor: pointer; }

/* ---- the script repository, a window over the settings (for the guide readers) ---- */
#settings .scripts-top { display: flex; align-items: flex-start; gap: 10px; }
#settings .scripts-top .hint { flex: 1; }
#settings .scripts-top button[hidden] { display: none; }
#repo { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.6); z-index: 20; }
#repo[hidden] { display: none; }
#repo .repo-sheet { display: flex; flex-direction: column; width: min(1100px, 100%); height: min(92vh, 100%); background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; }
#repo .sheet-head { display: flex; align-items: center; padding: 10px 14px; color: var(--white); border-bottom: 1px solid var(--edge); }
#repo .sheet-head button { margin-left: auto; font: inherit; font-size: calc(18px * var(--panel-text)); line-height: 1; color: var(--dim); background: none; border: 0; cursor: pointer; }
#repo .sheet-head button:hover { color: var(--white); }
#repo .repo-body { flex: 1; min-height: 0; display: flex; }
#repo .repo-list { flex: 0 0 300px; overflow-y: auto; padding: 6px; border-right: 1px solid var(--edge); font-size: calc(12px * var(--panel-text)); }
#repo .repo-row { display: block; width: 100%; text-align: left; font: inherit; color: var(--fg); background: none; border: 1px solid transparent; border-radius: 3px; padding: 6px 8px; margin-bottom: 2px; cursor: pointer; }
#repo .repo-row:hover { background: var(--panel2); }
#repo .repo-row.picked { background: var(--panel2); border-color: var(--edge); }
#repo .repo-row .name { color: var(--white); }
#repo .repo-row .about { display: block; margin-top: 2px; color: var(--dim); line-height: 1.4; }
#repo .standing { margin-left: 6px; font-size: calc(11px * var(--panel-text)); }
#repo .standing.new { color: var(--cyan); }
#repo .standing.same { color: var(--dim); }
#repo .standing.differs { color: var(--yellow); }
#repo .repo-view { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 10px 14px; gap: 8px; font-size: calc(12px * var(--panel-text)); }
#repo .hint { margin: 0; color: var(--dim); }
#repo #repo-open { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
#repo #repo-open[hidden] { display: none; }
#repo .repo-head { color: var(--white); font-size: calc(13px * var(--panel-text)); }
#repo pre { flex: 1; min-height: 0; margin: 0; padding: 10px 12px; overflow: auto; color: var(--fg); background: var(--bg); border: 1px solid var(--edge); border-radius: 3px; line-height: 1.45; }
#repo .repo-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#repo .repo-actions input { flex: 0 1 12em; min-width: 0; font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--fg); background: var(--bg); border: 1px solid var(--edge); border-radius: 3px; padding: 4px 6px; }
#repo .repo-actions button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 10px; cursor: pointer; }
#repo .repo-actions button:hover { border-color: var(--cyan); }
#repo .reply { margin: 0; padding: 6px 8px; color: var(--fg); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; white-space: pre-line; }
#repo .reply[hidden] { display: none; }
#repo .reply.live { color: var(--yellow); border-color: #4a4420; }
@media (max-width: 640px) {
  #repo .repo-body { flex-direction: column; }
  #repo .repo-list { flex: 0 0 auto; max-height: 35%; border-right: 0; border-bottom: 1px solid var(--edge); }
}

/* ---- running scripts, as chips in the status bar ---- */
#script-chips { display: flex; gap: 6px; margin-left: auto; }
#script-chips + .link { margin-left: 0; }
#script-chips .chip { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 6px; font-size: calc(11px * var(--panel-text)); line-height: 16px; background: #1c2230; border: 1px solid #24364a; border-radius: 3px; }
#script-chips .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
#script-chips .chip.waiting .dot { background: var(--cyan); }
#script-chips .chip.paused .dot { background: var(--yellow); }
#script-chips button { font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--fg); background: none; border: 0; padding: 0 2px; cursor: pointer; }
#script-chips button.name { color: var(--white); }
#script-chips button:hover { color: var(--cyan); }
/* the script tree: folders in folders, scripts under them, sorted by dragging */
#settings .scripts-layout { flex: 1; display: grid; grid-template-columns: 17em 1fr; gap: 12px; align-items: stretch; }
#settings .scripts-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
#settings .scripts-tools { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--edge); }
#settings .scripts-tools button { flex: 1 1 auto; padding: 3px 6px; }
#settings .scripts-list { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 2px; border: 1px dashed transparent; border-radius: 3px; font-size: calc(12px * var(--panel-text)); }
#settings .scripts-list.drop-top { border-color: var(--cyan); }
#settings .tree-row { display: flex; align-items: center; gap: 5px; min-height: 22px; padding: 1px 4px; color: var(--fg); border: 1px solid transparent; border-radius: 3px; cursor: pointer; user-select: none; }
#settings .tree-row:hover { background: var(--panel2); }
#settings .tree-row.folder { color: var(--white); }
#settings .tree-row.picked { background: var(--panel2); border-color: var(--edge); }
#settings .tree-row.open { color: var(--white); background: var(--panel2); border-color: var(--cyan); }
#settings .tree-row.drop-here { border-color: var(--cyan); border-style: dashed; background: #1c2230; }
#settings .tree-row.dragging { opacity: 0.4; }
#settings .tree-arrow { flex: 0 0 0.8em; color: var(--dim); font-size: calc(10px * var(--panel-text)); text-align: center; }
#settings .tree-row.script { padding-left: calc(4px + 0.8em + 5px); }
#settings .tree-icon { display: flex; flex: 0 0 14px; color: var(--dim); }
#settings .tree-row.folder .tree-icon { color: var(--yellow); }
#settings .tree-icon svg { width: 14px; height: 14px; }
#settings .tree-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#settings .tree-state { margin-left: auto; padding-left: 6px; font-size: calc(11px * var(--panel-text)); color: var(--cyan); white-space: nowrap; }
#settings .tree-tools { display: none; gap: 2px; margin-left: auto; }
#settings .tree-row.folder:hover .tree-tools, #settings .tree-tools:has(.armed) { display: flex; }
#settings .tree-row.folder:hover .tree-state { display: none; }
#settings .tree-tools button { font: inherit; font-size: calc(11px * var(--panel-text)); line-height: 1; color: var(--dim); background: none; border: 1px solid transparent; border-radius: 3px; padding: 2px 4px; cursor: pointer; }
#settings .tree-tools button:hover { color: var(--white); border-color: var(--edge); }
#settings .tree-tools button.armed { color: var(--yellow); border-color: #4a4420; }
#settings .tree-input { flex: 1; min-width: 0; font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--bg); border: 1px solid var(--cyan); border-radius: 3px; padding: 1px 4px; }
#settings .tree-children { display: flex; flex-direction: column; gap: 1px; margin-left: 10px; padding-left: 4px; border-left: 1px solid var(--edge); }
#settings .tree-empty { padding: 2px 6px; color: var(--dim); font-size: calc(11px * var(--panel-text)); font-style: italic; }
#settings .script-head .state { font-size: calc(11px * var(--panel-text)); color: var(--cyan); }
#settings .script-head .where { font-size: calc(12px * var(--panel-text)); color: var(--dim); }
#settings .script-editor { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#settings .script-editor[hidden] { display: none; }
#settings .script-head { display: flex; align-items: center; gap: 10px; }
#settings .script-head input, #settings .script-actions input, #settings .script-editor textarea { min-width: 0; font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--fg); background: var(--bg); border: 1px solid var(--edge); border-radius: 3px; padding: 4px 6px; }
#settings .script-head input[readonly] { color: var(--white); border-color: transparent; background: none; padding-left: 0; }
#settings .script-head button[hidden] { display: none; }
#settings .script-editor textarea { flex: 1; min-height: 14em; width: 100%; resize: vertical; line-height: 1.4; tab-size: 2; white-space: pre; }
#settings .script-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#settings .script-actions input { flex: 1 1 12em; }
#settings .script-actions button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 10px; cursor: pointer; }
#settings .script-actions button:hover { border-color: var(--cyan); }
#settings .script-actions button[hidden] { display: none; }
#settings .script-help { font-size: calc(12px * var(--panel-text)); color: var(--dim); }
#settings .script-help summary { cursor: pointer; }
#settings .script-help ul { margin: 6px 0 0; padding-left: 18px; }
#settings .script-help code { color: var(--fg); }
@media (max-width: 560px) {
  #settings .scripts-layout { grid-template-columns: 1fr; }
}
#settings h4 { margin: 4px 0 0; font-size: calc(11px * var(--panel-text)); font-weight: bold; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
.keys-list.kinds { grid-template-columns: minmax(10em, auto) minmax(4em, 1fr) auto auto; }
.keys-list.highlights { grid-template-columns: auto minmax(0, 1fr) auto auto auto auto; }
.keys-list .sample { font-size: calc(12px * var(--panel-text)); }
#settings .pick { display: flex; align-items: center; gap: 6px; font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--fg); background: none; border: 1px solid var(--edge); border-radius: 3px; padding: 1px 6px; cursor: pointer; white-space: nowrap; }
#settings .pick:hover { border-color: var(--cyan); }
#settings .pick .chip { width: 12px; height: 12px; border: 1px solid var(--edge); border-radius: 2px; }
#settings .pick .chip.none { background: repeating-linear-gradient(45deg, var(--edge) 0 3px, transparent 3px 6px); }
#settings #highlight-add #highlight-pattern { flex: 1; }
#settings .picker { position: absolute; z-index: 2; padding: 8px; background: var(--panel); border: 1px solid #3a3f4a; border-radius: 4px; box-shadow: 0 4px 16px #000; }
#settings .picker[hidden] { display: none; }
#settings .picker .swatches { display: grid; grid-template-columns: repeat(8, 22px); gap: 4px; }
#settings .picker .swatch { width: 22px; height: 22px; padding: 0; border: 1px solid var(--edge); border-radius: 3px; cursor: pointer; }
#settings .picker .swatch:hover, #settings .picker .swatch:focus-visible { outline: 2px solid var(--white); outline-offset: 1px; }
#settings .picker .swatch.chosen { outline: 2px solid var(--cyan); outline-offset: 1px; }
#settings .picker-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: calc(12px * var(--panel-text)); color: var(--dim); }
#settings .picker-row button { font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--gray); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 1px 6px; cursor: pointer; }
#settings .reply.live { color: var(--yellow); border-color: #4a4420; }
#settings .capture .confirm { display: flex; gap: 6px; margin-top: 6px; }
#settings .capture .confirm button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 2px 10px; cursor: pointer; }
#settings .capture .confirm button:hover { border-color: var(--cyan); }
#settings .add-row .check { display: flex; align-items: center; gap: 4px; color: var(--dim); font-size: calc(12px * var(--panel-text)); white-space: nowrap; }
#settings #trigger-add input[type="text"] { flex: 1; }
.keys-list .empty-note { grid-column: 1 / -1; color: var(--dim); font-style: italic; }
#settings .add-row { display: flex; gap: 6px; }
#settings .add-row input { min-width: 0; font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--fg); background: var(--bg); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 6px; }
#settings .add-row input:first-child { flex: 0 0 9em; }
#settings .add-row input:nth-child(2) { flex: 1; }
#settings .add-row button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 10px; cursor: pointer; }
#settings .add-row button:hover { border-color: var(--cyan); }
/* The Options tab: a setting, its control, and what it does, the description wrapping rather than cut off. */
#settings .pane[data-pane="options"] { padding: 0; overflow: hidden; }
#settings .options-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 9em 1fr; }
#settings .options-side { display: flex; flex-direction: column; gap: 10px; padding: 12px 10px; border-right: 1px solid var(--edge); }
#settings .options-sections { display: flex; flex-direction: column; gap: 2px; }
#settings .options-sections button { font: inherit; font-size: calc(12px * var(--panel-text)); text-align: left; color: var(--dim); background: none; border: 1px solid transparent; border-radius: 3px; padding: 4px 8px; cursor: pointer; }
#settings .options-sections button:hover { color: var(--white); }
#settings .options-sections button.active { color: var(--white); background: var(--panel2); border-color: var(--edge); }
#settings .options-side .hint { font-size: calc(11px * var(--panel-text)); }
#settings .options-main { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
#settings .options-list { display: flex; flex-direction: column; gap: 10px; }
#settings .option-card { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--edge); border-radius: 4px; }
#settings .option-head { display: flex; flex-direction: column; gap: 2px; }
#settings .option-head .title { color: var(--white); font-weight: bold; font-size: calc(13px * var(--panel-text)); }
#settings .option-head .about { color: var(--dim); font-size: calc(11px * var(--panel-text)); }
/* Every card shares its columns' widths, so the settings line up from card to card. */
.keys-list.game-options { grid-template-columns: 9em 12em 1fr; }
/* A part of a card under a heading of its own (the Spells card's mana). */
.keys-list.game-options .part { grid-column: 1 / -1; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--edge); color: var(--gray); font-size: calc(11px * var(--panel-text)); font-weight: bold; }
/* An amount: FLOOR, SAFE, or Custom, and Custom's number beside it. */
.keys-list.game-options .amount { display: flex; gap: 4px; min-width: 0; }
.keys-list.game-options .amount select { flex: 1; width: auto; }
.keys-list.game-options .amount input[type="number"] { width: 4.5em; min-width: 0; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--edge); border-radius: 3px; padding: 1px 4px; }
.keys-list.game-options .amount input[type="number"]:focus { outline: none; border-color: var(--cyan); }
.keys-list.game-options .amount input[hidden] { display: none; }
.keys-list.game-options .text-size { display: flex; align-items: center; gap: 8px; min-width: 0; }
.keys-list.game-options .text-size input[type="range"] { flex: 1; min-width: 0; accent-color: var(--cyan); }
.keys-list.game-options .text-size .percent { flex: none; width: 3.5em; text-align: right; color: var(--white); }
.keys-list.game-options .state { display: flex; align-items: baseline; gap: 8px; }
.keys-list.game-options .clear { margin-left: auto; font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--gray); background: var(--panel); border: 1px solid var(--edge); border-radius: 3px; padding: 0 8px; cursor: pointer; }
.keys-list.game-options .clear:hover { color: var(--white); border-color: var(--cyan); }
.keys-list.game-options input[type="text"] { width: 100%; box-sizing: border-box; }
.keys-list.game-options select { width: 100%; }
.option-add { padding-top: 6px; border-top: 1px dashed var(--edge); }
.option-add .state { display: flex; align-items: center; gap: 8px; }
.option-add button { font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--white); background: var(--panel); border: 1px solid var(--edge); border-radius: 3px; padding: 1px 10px; cursor: pointer; }
.option-add button:hover { border-color: var(--cyan); }
.option-add button:disabled { color: var(--dim); cursor: default; border-color: var(--edge); }
.keys-list.game-options .key { cursor: default; }
.keys-list.game-options .key:hover { border-color: transparent; background: none; }
.keys-list.game-options .state { white-space: normal; }
.keys-list.game-options .check { display: flex; align-items: center; gap: 4px; color: var(--fg); cursor: pointer; }
.keys-list.game-options input[type="text"] { border-color: var(--edge); }
.keys-list.game-options input[type="text"]:focus { border-color: var(--cyan); }
.keys-list select { min-width: 0; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--edge); border-radius: 3px; padding: 1px 4px; }
@media (max-width: 520px) {
  .keys-list { grid-template-columns: minmax(6em, auto) 1fr; }
  .keys-list .state { display: none; }
  .keys-list .row-actions { grid-column: 2; }
  .keys-list.game-options { grid-template-columns: 7em 1fr; }
  #settings .options-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #settings .options-side { padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--edge); }
  #settings .options-sections { flex-direction: row; flex-wrap: wrap; }
  #settings .options-side .hint { display: none; }
  .keys-list.game-options .state { display: block; grid-column: 1 / -1; margin-bottom: 4px; }
  .option-add .state { display: flex; }
}

/* ---- bars, held icons, hands, and spells, two rows ---- */
#bottom {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 12px;
  border-top: 1px solid var(--edge);
  overflow: hidden;
}

/* The bars in a fixed grid, body over mind: Vitality, Stamina, Balance, Food on top; Mana, Acuity, Divinity, Water below. A bar not yet shown leaves its cell empty, so none shifts. */
#vitals { display: grid; grid-template-columns: repeat(3, 127px) 60px; grid-template-rows: 20px 20px; gap: 4px 6px; }
#vitality-bar { grid-area: 1 / 1; }
#stamina-bar { grid-area: 1 / 2; }
#balance-slot { grid-area: 1 / 3; }
#food-bar { grid-area: 1 / 4; }
#mana-bar { grid-area: 2 / 1; }
#acuity-bar { grid-area: 2 / 2; }
#divinity-bar { grid-area: 2 / 3; }
#water-bar { grid-area: 2 / 4; }
/* Each bar is a slot like the hands: a framed cell with a tag, the bar recessed into it. */
#vitals .slot { display: flex; align-items: stretch; height: 20px; background: #0a0b0d; border: 1px solid var(--edge); border-radius: 3px; overflow: hidden; }
#vitals .slot.hidden { display: none; }
/* Food and water change slowly: small bars, their words on hover. */
#vitals .fill.food { background: #b58a3a; }
#vitals .fill.water { background: #3a9ec8; }
#vitals .slot .tag { flex: none; width: 18px; display: flex; align-items: center; justify-content: center; background: #1b1e25; color: var(--dim); font-size: calc(10px * var(--panel-text)); font-weight: bold; border-right: 1px solid var(--edge); }
#dock .blood { position: absolute; right: 5px; bottom: 4px; margin: 0; }
#dock .blood path { fill: #1b1e25; stroke: #3a3f4a; stroke-width: 1.2; transition: fill 300ms; }
#dock .blood.bleeding path { fill: #d01f1f; stroke: #ff6a6a; animation: bleed 1.2s ease-in-out infinite; }
/* Each drop shows only while it's true (Savicki, October 23 2026): hidden, it keeps its place, so nothing moves. */
#dock .blood:not(.bleeding), #dock .venom:not(.poisoned) { visibility: hidden; }
/* Poisoned: a sick green drop above the blood, pulsing slower than a bleed so the two read apart at a glance. The box's right edge is widened for the pair, clear of the wings. */
#dock .venom { position: absolute; right: 5px; bottom: 28px; margin: 0; }
#dock .venom path { fill: #1b1e25; stroke: #3a3f4a; stroke-width: 1.2; transition: fill 300ms; }
#dock .venom circle { fill: transparent; }
#dock .venom.poisoned path { fill: #4f9a2a; stroke: #a8e070; animation: sicken 2.4s ease-in-out infinite; }
#dock .venom.poisoned circle { fill: #c6f08e; }
/* The held icons: what you keep up, in a panel of their own after food and water, framed like the figure's box. It keeps its room when empty, so nothing moves; two sit side by side, and past two they shrink to a square of four. Each draws in currentColor, set per kind or by the Aura's chosen color. */
#held { flex: none; display: flex; align-items: center; justify-content: center; gap: 4px; width: 82px; height: 44px; padding: 0 8px; background: var(--panel2); border: 1px solid var(--edge); border-radius: 4px; box-sizing: border-box; }
#held.many { display: grid; grid-template-columns: repeat(2, 19px); grid-template-rows: repeat(2, 19px); gap: 2px; align-content: center; }
#held .held-icon { position: relative; display: block; width: 30px; height: 30px; }
#held.many .held-icon, #held.many svg { width: 19px; height: 19px; }
#held svg { display: block; width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#held svg .solid { fill: currentColor; stroke: none; }
#held svg .beam { stroke-width: 3; }
#held .count { position: absolute; right: -3px; bottom: -3px; min-width: 11px; height: 11px; padding: 0 1px; border-radius: 6px; background: var(--panel2); border: 1px solid currentColor; font-size: calc(9px * var(--panel-text)); line-height: 10px; text-align: center; color: var(--white); box-sizing: border-box; }
#held .aura svg { filter: drop-shadow(0 0 2.5px currentColor); animation: aura-flare 3.2s ease-in-out infinite; }
#held .aura svg .ray { stroke-width: 1.3; opacity: 0.85; }
/* A black aura: dark steel with a pale rim, since black light on a black panel would vanish. */
#held .aura.black svg { filter: drop-shadow(0 0 1.2px #c9c7c0) drop-shadow(0 0 3px #6b6f78); animation: none; }
#held .song { color: var(--yellow); }
#held .keptThought { color: #b48cff; }
#held .poise { color: #9ad8e8; }
#held .clasping { color: #d0a070; }
#held .waiting { color: var(--green); }
@keyframes aura-flare { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; filter: drop-shadow(0 0 4.5px currentColor); } }
@media (prefers-reduced-motion: reduce) { #held .aura svg { animation: none; } }
/* The light circle beside the hands: white when bright, half dark when dim, dark when dark, as your eyes see it. */
/* Light and the time of day, big enough to read at a glance. */
/* Posture (Char.State): a stick figure standing, kneeling, sitting, or lying; hidden, it fades to a dashed ghost of itself. */
#dock .posture { flex: none; width: 26px; height: 35px; fill: none; stroke: var(--fg); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
#dock .posture.hidden { opacity: 0.45; stroke-dasharray: 2.2 2.2; }
#dock .posture .torso { stroke-width: 4; stroke-linecap: butt; }
/* The waterline across the figure (Char.State's water): at the chest while swimming, over the head under water. */
#dock .posture .waterline { stroke: #3a9ec8; stroke-width: 1.5; }
/* The breath held under water (Char.State's breath): a thin bar along the state box's bottom edge, blue, red for the last of it; hidden while breathing freely. */
#dock .breath { position: absolute; left: 8px; right: 8px; bottom: 3px; height: 4px; background: #0a0b0d; box-shadow: inset 0 1px 2px #000; border-radius: 2px; overflow: hidden; }
#dock .breath .fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(1); background: #3a9ec8; transition: transform 250ms linear, background 300ms; }
#dock .breath.low .fill { background: #c8453a; }
/* The lantern: how lit the room is to your eyes, its flame full, low, or out; seeing through your own Eclipse, the dark lantern with an eye on it. */
#dock .lantern { flex: none; width: 26px; height: 35px; }
#dock .lantern .ring, #dock .lantern .glass { fill: none; stroke: #8a8f9a; stroke-width: 1.4; }
#dock .lantern .cap, #dock .lantern .base { fill: #8a8f9a; }
#dock .lantern .flame { fill: #ffd34d; transform-origin: 12px 20.6px; transition: transform 300ms, fill 300ms; }
#dock .lantern.lit .glass { fill: rgba(255, 196, 90, 0.22); }
#dock .lantern.dim .glass { fill: rgba(255, 190, 80, 0.06); }
#dock .lantern.dim .flame { fill: #c98f2e; transform: scale(0.55); }
#dock .lantern.dark .glass { fill: #0a0b0d; }
#dock .lantern.dark .flame { visibility: hidden; }
#dock .lantern .eye, #dock .lantern .pupil { visibility: hidden; }
#dock .lantern.through .eye { visibility: visible; fill: none; stroke: #c9b8ff; stroke-width: 1.2; }
#dock .lantern.through .pupil { visibility: visible; fill: #c9b8ff; }
/* The hands, L then R, over the spell row: they take the rest of the bar, so a long name reads whole, and give room back if more comes onto the bar. */
#bottom #hands { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#bottom .hands-row { display: flex; gap: 6px; }
#bottom #hands .hand { flex: 1; min-width: 0; display: flex; align-items: center; height: 20px; background: #0a0b0d; border: 1px solid var(--edge); border-radius: 3px; overflow: hidden; font-size: calc(12px * var(--panel-text)); }
#bottom #hands .tag { flex: none; width: 24px; align-self: stretch; display: flex; align-items: center; justify-content: center; background: #1b1e25; border-right: 1px solid var(--edge); }
#bottom #hands .glyph { width: 20px; height: 20px; }
#bottom #hands .glyph rect, #bottom #hands .glyph circle { fill: #3a3f4a; }
#bottom #hands .glyph text { fill: var(--white); font-size: calc(9.5px * var(--panel-text)); font-weight: bold; font-family: inherit; }
#bottom #hands .item { flex: 1; padding: 0 7px; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bottom #hands .item.empty { color: var(--dim); font-style: italic; }
/* The spell row: one bar under both hands; with a Second Pattern it splits, the left hand's spell under L. It fills as the spell is shaped and goes cyan when whole; a Twin Weave's next spell waits after it, dim. */
#bottom #hands .spell.off { display: none; }
#bottom #hands .spell-glyph path { fill: #3a3f4a; }
#bottom #hands .spell-bar { position: relative; flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; }
#bottom #hands .spell-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #1d4a55; }
#bottom #hands .spell .item { position: relative; }
#bottom #hands .spell.ready .spell-fill { width: 100%; background: #163b44; }
#bottom #hands .spell.ready .item { color: var(--cyan); }
#bottom #hands .spell .next { color: var(--dim); }
/* Balance: three zones. Below "a little unsteady" is red-tinted, the steady band round rest is blank, nimble and up is green-tinted. */
#vitals .balance-bar .zone { position: absolute; top: 0; bottom: 0; }
#vitals .balance-bar .zone.low { left: 0; width: 50%; background: #4a2323; }
#vitals .balance-bar .zone.mid { left: 50%; width: 18%; background: #0a0b0d; }
#vitals .balance-bar .zone.high { left: 68%; width: 32%; background: #213a23; }
#vitals .balance-bar .mark { position: absolute; top: 0; bottom: 0; left: 60%; width: 3px; margin-left: -1px; background: var(--white); box-shadow: 0 0 3px #000; transition: left 400ms ease-out; }
#vitals .bar { position: relative; flex: 1; display: block; background: #0a0b0d; box-shadow: inset 0 1px 3px #000; overflow: hidden; }
#vitals .fill { position: absolute; inset: 0; width: 100%; transform-origin: left; transform: scaleX(1); transition: transform 300ms; }
#vitals .fill.vitality { background: var(--vitality); }
#vitals .fill.stamina { background: var(--stamina); }
#vitals .fill.mana { background: var(--mana); }
#vitals .fill.acuity { background: var(--acuity); }
#vitals .fill.divinity { background: var(--divinity); }
#vitals .fill.mount { background: var(--mount); }
/* With a mount out, the Stamina cell is shared: yours on top, the mount's below, S over R in the tag, both numbers on hover. */
#stamina-bar .mount-tag, #stamina-bar .mount-strip { display: none; }
#stamina-bar.with-mount .tag { flex-direction: column; font-size: calc(8px * var(--panel-text)); line-height: 9px; }
#stamina-bar.with-mount .mount-tag { display: block; }
#stamina-bar.with-mount .fill.stamina, #stamina-bar.with-mount .held { bottom: 50%; }
#stamina-bar.with-mount .mount-strip { display: block; position: absolute; left: 0; right: 0; top: 50%; bottom: 0; border-top: 1px solid #000; }
#stamina-bar.with-mount .label { display: none; }
/* Part of a pool held back (a keeping vessel, a cyclic spell's mana): hatched at the bar's end, out of reach of the fill. */
#vitals .held { position: absolute; top: 0; bottom: 0; right: 0; width: 0; background: repeating-linear-gradient(135deg, #2a2d34 0 3px, #15171b 3px 6px); border-left: 1px solid #3a3f4a; transition: width 300ms; }
#vitals .held[style*="width: 0%"] { border-left: none; }
#vitals .label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(11px * var(--panel-text)); color: var(--white); text-shadow: 0 0 3px #000; }

/* ---- the injury figure: one shape per location, colored by wound band ---- */
#figure { align-self: center; width: 76px; height: 76px; margin: 0; }
#figure [data-loc] { fill: #1b1e25; stroke: #3a3f4a; stroke-width: 1; transition: fill 300ms; }
#figure .wings { display: none; }
#figure .feather { fill: none; stroke: #2c3038; stroke-width: 0.8; pointer-events: none; }
#figure.feathered .wings.feathered { display: initial; }
#figure.leathery .wings.leathery { display: initial; }
#figure .w1 { fill: #6b6a2a; }
#figure .w2 { fill: #9a8a2a; }
#figure .w3 { fill: #b8762a; }
#figure .w4 { fill: #c4522a; }
#figure .w5 { fill: #b82a2a; }
#figure .w6 { fill: #6e1a3a; }
#figure .internal { stroke: #d6b04a; stroke-width: 1.5; stroke-dasharray: 2 1.5; }
#figure .bleeding { stroke: #ff3b3b; stroke-width: 1.5; animation: bleed 1.2s ease-in-out infinite; }
@keyframes bleed { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: 0.25; } }
@keyframes sicken { 0%, 100% { fill-opacity: 1; } 50% { fill-opacity: 0.55; } }

#compass {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  grid-auto-rows: 22px;
  gap: 3px;
  height: 82px;
  padding: 6px 8px;
  box-sizing: border-box;
  background: var(--panel2);
  border: 1px solid var(--edge);
  border-radius: 4px;
  align-content: center;
}
#compass button {
  font: inherit;
  font-size: calc(11px * var(--panel-text));
  color: var(--dim);
  background: #0a0b0d;
  border: 1px solid var(--edge);
  border-radius: 3px;
  padding: 0;
  cursor: default;
}
#compass button.open { color: var(--white); background: #1f2a1f; border-color: #35503a; cursor: pointer; }
#compass button.open:hover { background: #2a3a2a; }
#compass button.open.untaken { color: #8cc4f0; background: #1b2a3a; border-color: #3b8fd8; }
#roompanel .exits .untaken { color: #3b8fd8; }
#compass button.hub { border-radius: 50%; }

/* The guides button under the compass, for the few who read them; its menu opens upward. */
.compass-col { display: flex; flex-direction: column; gap: 4px; }
#guides { position: relative; }
#guides-button { width: 100%; font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--dim); background: var(--panel2); border: 1px solid var(--edge); border-radius: 4px; padding: 3px 0; cursor: pointer; }
#guides-button:hover, #guides-button[aria-expanded="true"] { color: var(--white); background: #1f2a1f; border-color: #35503a; }
#guides-menu { position: absolute; right: 0; bottom: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; min-width: 120px; padding: 4px; background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,0.5); }
#guides-menu[hidden] { display: none; }
/* The admin pane's button under it, for Claude and Atrix, and the pane itself: who's online and the tools down the side, the watched screen and the tools' answers beside them, a tab each. */
#admin-button { width: 100%; font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--dim); background: var(--panel2); border: 1px solid var(--edge); border-radius: 4px; padding: 3px 0; cursor: pointer; }
#admin-button[hidden] { display: none; }
#admin-button:hover, #admin-button.watching { color: var(--white); background: #2a1f1f; border-color: #50353a; }
#admin { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.55); z-index: 10; }
#admin[hidden] { display: none; }
#admin .sheet { display: flex; flex-direction: column; width: min(1400px, 100%); height: max(min(640px, 100%), 92vh); background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; }
#admin .sheet-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--white); border-bottom: 1px solid var(--edge); }
#admin .sub { color: var(--dim); font-size: calc(12px * var(--panel-text)); }
#admin-vitals { margin-left: auto; font-variant-numeric: tabular-nums; }
#admin-close { font: inherit; font-size: calc(18px * var(--panel-text)); line-height: 1; color: var(--dim); background: none; border: 0; cursor: pointer; }
#admin-close:hover { color: var(--white); }
#admin .admin-body { flex: 1; min-height: 0; display: flex; }
#admin .admin-side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; overflow-y: auto; border-right: 1px solid var(--edge); font-size: calc(12px * var(--panel-text)); }
#admin .admin-side h4 { display: flex; align-items: center; margin: 4px 0 0; color: var(--white); font-weight: normal; }
#admin .admin-side h4 .plain { margin-left: auto; font: inherit; color: var(--dim); background: none; border: 0; cursor: pointer; }
#admin-who .who { display: flex; flex-direction: column; width: 100%; text-align: left; font: inherit; color: var(--fg); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 4px 8px; margin-bottom: 4px; cursor: pointer; }
#admin-who .who:hover, #admin-who .who.on { color: var(--white); border-color: #50353a; background: #2a1f1f; }
#admin-who .who .where { color: var(--dim); font-size: 0.92em; }
#admin-who .none, #admin-log .none { color: var(--dim); font-style: italic; }
#admin-tool { display: flex; flex-direction: column; gap: 4px; }
#admin-tool select, #admin-tool input[type="text"], #admin-tool input[type="number"], #admin-peek input { font: inherit; color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 4px 6px; }
#admin-tool [hidden] { display: none; }
#admin-tool button, #admin-peek button { font: inherit; color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 12px; cursor: pointer; }
#admin-peek button:disabled { color: var(--dim); cursor: default; }
#admin .admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#admin .admin-tabs { display: flex; gap: 2px; padding: 6px 14px 0; border-bottom: 1px solid var(--edge); }
#admin .admin-tabs button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--dim); background: none; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; padding: 4px 14px; margin-bottom: -1px; cursor: pointer; }
#admin .admin-tabs button:hover { color: var(--white); }
#admin .admin-tabs button.on { color: var(--white); background: var(--panel); border-color: var(--edge); }
#admin .admin-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#admin .admin-view[hidden] { display: none; }
#admin-results-head { display: flex; align-items: baseline; gap: 12px; padding: 8px 14px; color: var(--white); border-bottom: 1px solid var(--edge); }
#admin-results-head .plain { margin-left: auto; font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--dim); background: none; border: 0; cursor: pointer; }
#admin-results-head .plain:hover { color: var(--white); }
#admin-results-head .plain[hidden] { display: none; }
#admin-results { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px; outline: none; font-size: calc(13px * var(--panel-text)); }
#admin-results .none { color: var(--dim); font-style: italic; }
#admin-results .admin-text { white-space: pre-wrap; word-break: break-word; color: var(--fg); }
#admin-results .admin-text.error { color: var(--red); }
#admin-results .card { background: var(--panel2); border: 1px solid var(--edge); border-radius: 4px; padding: 8px 12px; margin-bottom: 8px; }
#admin-results .card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; color: var(--dim); font-size: 0.92em; font-variant-numeric: tabular-nums; }
#admin-results .card-head .first { color: var(--white); }
#admin-results .card-head .tag { color: var(--white); background: #2a1f1f; border: 1px solid #50353a; border-radius: 3px; padding: 0 6px; }
#admin-results .card-text { margin-top: 4px; color: var(--white); white-space: pre-wrap; word-break: break-word; }
#admin-results .card-line { margin-top: 2px; color: var(--dim); }
#admin-results details { margin-top: 6px; }
#admin-results summary { color: var(--dim); cursor: pointer; }
#admin-results summary:hover { color: var(--white); }
#admin-results .card-fold { margin-top: 4px; padding: 6px 10px; white-space: pre-wrap; word-break: break-word; color: var(--fg); background: var(--bg); border-left: 2px solid #50353a; font-size: calc(13px * var(--game-text)); }
#admin-results .card-buttons { display: flex; gap: 8px; margin-top: 8px; }
#admin-results .card-buttons button { font: inherit; font-size: 0.92em; color: var(--white); background: var(--panel); border: 1px solid var(--edge); border-radius: 3px; padding: 2px 10px; cursor: pointer; }
#admin-results .card-buttons button:hover { border-color: #50353a; background: #2a1f1f; }
#admin-room { padding: 6px 14px; border-bottom: 1px solid var(--edge); }
#admin-log { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 14px; white-space: pre-wrap; word-break: break-word; outline: none; font-size: calc(14px * var(--game-text)); }
#admin-log .line { min-height: 1.35em; }
#admin-log .typed { color: var(--dim); }
#admin-log .peek { border-left: 2px solid #50353a; padding-left: 8px; background: rgba(80, 53, 58, 0.15); }
#admin-log .note { color: var(--dim); font-style: italic; }
#admin-peek { display: flex; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--edge); }
#admin-peek input { flex: 1; }
#guides-menu a { color: var(--white); text-decoration: none; font-size: calc(12px * var(--panel-text)); padding: 4px 8px; border-radius: 3px; }
#guides-menu a:hover, #guides-menu a:focus-visible { background: #1f2a1f; outline: none; }

/* ---- input ---- */
#prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-top: 1px solid var(--edge);
}
#prompt .caret { color: var(--dim); }
#prompt .rts { display: inline-flex; gap: 6px; margin: 4px 0; }
#prompt .rtv { display: inline-flex; flex-direction: column; align-items: center; }
#prompt .rtbox { position: relative; display: block; width: 26px; height: 22px; background: #0a0b0d; border: 1px solid var(--edge); border-radius: 3px; overflow: hidden; }
#prompt .rtfill { position: absolute; inset: 0; background: var(--yellow); transform-origin: bottom; transform: scaleY(0); transition: transform 200ms linear; }
#prompt .rtnum { position: relative; display: block; text-align: center; font-size: calc(11px * var(--panel-text)); line-height: 20px; color: var(--white); text-shadow: 0 0 3px #000; }
#prompt .rtlabel { font-size: calc(10px * var(--panel-text)); line-height: 10px; color: var(--dim); }
#in {
  flex: 1;
  margin: 6px 12px 6px 0;
  padding: 5px 10px;
  background: #0a0b0d;
  border: 1px solid var(--edge);
  border-radius: 3px;
  outline: none;
  color: var(--white);
  font: inherit;
  font-size: calc(14px * var(--game-text));
}
#in:focus { border-color: #3a3f4a; }

@media (max-width: 900px) {
  #side, #drawer, #tabs { display: none; }
  #compass { display: none; }
  #sky { display: none; }
  #figure { display: none; }
  #vitals { grid-template-columns: repeat(3, 72px) 40px; }
}

/* ---- the Auto window (AUTO SETUP): general settings, then weapons and magic, a line each ---- */
#status .auto-button { font: inherit; font-size: calc(11px * var(--panel-text)); line-height: 14px; color: var(--dim); background: none; border: 1px solid var(--edge); border-radius: 3px; padding: 0 5px; cursor: pointer; }
#status .auto-button:hover, #status .auto-button:focus-visible { color: var(--white); border-color: var(--cyan); }
#auto { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.55); z-index: 10; }
#auto[hidden] { display: none; }
#auto .sheet { display: flex; flex-direction: column; width: min(1000px, 100%); max-height: min(88vh, 100%); background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; }
#auto .sheet-head { display: flex; align-items: center; padding: 10px 14px; color: var(--white); border-bottom: 1px solid var(--edge); }
#auto .sheet-head button { margin-left: auto; font: inherit; font-size: calc(18px * var(--panel-text)); line-height: 1; color: var(--dim); background: none; border: 0; cursor: pointer; }
#auto .sheet-head button:hover { color: var(--white); }
#auto .auto-tabs { display: flex; gap: 2px; padding: 6px 14px 0; border-bottom: 1px solid var(--edge); }
#auto .auto-tabs button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--dim); background: none; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; padding: 4px 12px; cursor: pointer; }
#auto .auto-tabs button.active { color: var(--white); background: var(--panel2); border-color: var(--edge); }
#auto .auto-body[hidden] { display: none; }
#auto .auto-minds { display: flex; flex-direction: column; gap: 14px; }
#auto .auto-minds .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(22em, 1fr)); gap: 4px 18px; }
#auto .auto-minds .numbers { white-space: nowrap; color: var(--dim); }
#auto .auto-minds .grid label { justify-content: space-between; }
#auto .auto-minds .grid label.set { color: var(--cyan); }
#auto .auto-minds input[type="number"] { width: 5em; }
#auto .auto-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 12px 14px; font-size: calc(12px * var(--panel-text)); }
#auto .hint { margin: 0; color: var(--dim); }
#auto h3 { margin: 0 0 6px; font-size: calc(12px * var(--panel-text)); font-weight: normal; color: var(--white); text-transform: uppercase; letter-spacing: 0.06em; }
#auto .auto-section { padding: 10px 12px; background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; }
#auto .auto-general, #auto .auto-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
#auto .auto-toggles { margin-top: 8px; }
#auto label { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); }
#auto label[hidden] { display: none; }
#auto select, #auto input[type="number"], #auto input[type="text"] { min-width: 0; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--edge); border-radius: 3px; padding: 2px 4px; }
#auto input[type="number"] { width: 6em; }
#auto select:focus, #auto input:focus { outline: none; border-color: var(--cyan); }
#auto .auto-lines { display: flex; flex-direction: column; gap: 4px; }
#auto .auto-line { display: grid; grid-template-columns: auto minmax(10em, 14em) minmax(0, 1fr) auto auto; align-items: center; gap: 6px; }
#auto .auto-line .order { display: flex; align-items: center; gap: 2px; }
#auto .auto-line .order .grab { cursor: grab; color: var(--dim); padding: 0 2px; user-select: none; }
#auto .auto-line .order button { font-size: calc(10px * var(--panel-text)); line-height: 1; padding: 1px 3px; }
#auto .auto-line.dragging { opacity: 0.5; }
#auto .auto-line.drop-here { outline: 1px dashed var(--cyan); outline-offset: 2px; }
#auto .auto-line .what { display: flex; gap: 6px; min-width: 0; }
#auto .auto-line .what select { flex: 1; }
#auto .auto-line .what input.word { flex: 0 1 9em; }
#auto .auto-line .what input.word.missing { border-color: var(--yellow); }
#auto .auto-line .missing { color: var(--yellow); }
#auto .auto-line .fallback { color: var(--dim); font-size: calc(11px * var(--panel-text)); white-space: nowrap; }
#auto .auto-line .fallback.on { color: var(--cyan); }
#auto .auto-line .marks { display: inline-flex; gap: 8px; }
#auto .auto-section .hint { margin: 0 0 6px; }
#auto .auto-line button.remove { font: inherit; font-size: calc(11px * var(--panel-text)); color: var(--gray); background: var(--panel); border: 1px solid var(--edge); border-radius: 3px; padding: 1px 6px; cursor: pointer; }
#auto .auto-line button.remove:hover { color: var(--white); border-color: var(--red); }
#auto .empty { color: var(--dim); font-style: italic; }
#auto .actions { display: flex; gap: 6px; justify-content: flex-end; }
#auto .actions.left { justify-content: flex-start; margin-top: 6px; }
#auto .actions button { font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 3px 10px; cursor: pointer; }
#auto .actions button:hover { border-color: var(--cyan); }
#auto .actions button[hidden] { display: none; }
#auto .auto-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--edge); }
#auto .auto-foot .actions { margin-left: auto; }
#auto .auto-note { color: var(--dim); font-size: calc(12px * var(--panel-text)); }
#script-chips .chip.auto { background: #1f2a1f; border-color: #35503a; }
@media (max-width: 640px) {
  #auto .auto-line { grid-template-columns: 1fr auto; }
  #auto .auto-line .what { grid-column: 1 / -1; grid-row: 2; }
}

/* The quest journal (Design/details/quests.md). */
#drawer .quest { padding: 4px 0 8px; border-bottom: 1px solid var(--edge); line-height: 1.45; }
#drawer .quest.empty { color: var(--dim); border-bottom: 0; }
#drawer .quest-head { display: flex; justify-content: space-between; gap: 8px; font-weight: bold; color: var(--quest); }
#drawer .quest-head .s { font-weight: normal; color: var(--dim); white-space: nowrap; }
#drawer .kind-daily, #drawer .kind-daily .n { color: var(--quest-daily); }
#drawer .kind-weekly, #drawer .kind-weekly .n { color: var(--quest-weekly); }
#drawer .kind-monthly, #drawer .kind-monthly .n { color: var(--quest-monthly); }
#drawer .kind-rare, #drawer .kind-rare .n { color: var(--quest-rare); }
#drawer .quest-for, #drawer .quest-hint { color: var(--dim); }
#drawer .quest-goal { color: var(--white); }
#drawer .quest-obj::before { content: "\25CB  "; color: var(--dim); }
#drawer .quest-obj.done { color: var(--dim); }
#drawer .quest-obj.done::before { content: "\25CF  "; color: var(--green); }
#drawer .quest-ready { color: var(--green); }
#drawer .quest-hint { font-style: italic; }
#drawer .quest-section { margin-top: 10px; font-size: calc(11px * var(--panel-text)); font-weight: bold; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
#drawer .quest-done { display: flex; justify-content: space-between; gap: 8px; line-height: 1.5; }
#drawer .quest-done .n { color: var(--quest); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#drawer .quest-done .w { color: var(--dim); white-space: nowrap; }

/* Quest marks on the map: "!" work open to you, "?" where a quest you've taken goes, dim until it's ready (Design/details/quests.md). */
#map .quest-mark { pointer-events: auto; cursor: default; }
#map .quest-mark circle { fill: var(--quest); stroke: var(--bg); stroke-width: 1.5px; }
#map .quest-mark text { fill: var(--bg); font-weight: bold; }
#map .quest-mark.kind-daily circle { fill: var(--quest-daily); }
#map .quest-mark.kind-weekly circle { fill: var(--quest-weekly); }
#map .quest-mark.kind-monthly circle { fill: var(--quest-monthly); }
#map .quest-mark.kind-rare circle { fill: var(--quest-rare); }
#map .quest-mark.waiting { opacity: 0.5; }
#map .quest-mark text.quest-star { fill: var(--quest); stroke: var(--bg); stroke-width: 1.5px; paint-order: stroke; }

/* The focus tab: an activity's lines, painted as the game window paints them. */
#drawer .focus-body { white-space: pre-wrap; word-break: break-word; font-size: calc(13px * var(--game-text)); }
.focus-body .line { min-height: 1.35em; }
/* Where one activity's lines end and the next one's begin. */
.focus-body .focus-divider { margin: 6px 0 4px; font-size: calc(11px * var(--game-text)); color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; border-top: 1px solid var(--edge); padding-top: 4px; }
/* OPTIONS FOCUS WINDOW MANUAL: lines have come while the tab was shut. */
#tabs button.lit { color: var(--cyan); }

/* ---- choosing a character, after the account's login (Char.List) ---- */
#chars { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; background: var(--bg); z-index: 12; }
#chars[hidden] { display: none; }
#chars .chars-sheet { width: min(980px, 100%); }
#chars .chars-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; color: var(--white); font-size: calc(20px * var(--panel-text)); letter-spacing: 0.04em; }
#chars .chars-head .sub { color: var(--dim); font-size: calc(12px * var(--panel-text)); letter-spacing: 0; }
#chars #chars-quit { margin-left: auto; font: inherit; font-size: calc(12px * var(--panel-text)); color: var(--fg); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 4px 12px; cursor: pointer; }
#chars #chars-quit:hover { border-color: var(--cyan); }
#chars .chars-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 12px; }
#chars .card { display: flex; flex-direction: column; gap: 6px; min-height: 150px; padding: 14px 16px; text-align: left; font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--edge); border-left: 3px solid var(--divinity); border-radius: 4px; cursor: pointer; }
#chars .card:hover, #chars .card:focus-visible { border-color: var(--cyan); outline: none; }
#chars .card .name { color: var(--white); font-size: calc(17px * var(--panel-text)); }
#chars .card .surname { color: var(--gray); }
#chars .card .line { font-size: calc(12px * var(--panel-text)); }
#chars .card .guilds { color: var(--yellow); }
#chars .card .where { margin-top: auto; color: var(--dim); font-size: calc(12px * var(--panel-text)); }
#chars .card.new { align-items: center; justify-content: center; color: var(--dim); border-style: dashed; border-left-width: 1px; }
#chars .card.new .plus { font-size: calc(28px * var(--panel-text)); line-height: 1; color: var(--cyan); }
@media (max-width: 520px) {
  #chars { padding-top: 16px; }
  #chars .card { min-height: 0; }
}

/* ---- the login screen (Login.Ask): over everything until a character is chosen ---- */
#login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; background: var(--bg); z-index: 13; }
#login[hidden] { display: none; }
#login .login-box { display: flex; flex-direction: column; gap: 12px; width: min(380px, 100%); padding: 28px 26px 24px; background: var(--panel); border: 1px solid var(--edge); border-top: 3px solid var(--divinity); border-radius: 4px; }
#login .login-title { color: var(--white); font-size: calc(15px * var(--panel-text)); letter-spacing: 0.08em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#login .login-sub { margin-bottom: 8px; color: var(--dim); font-size: calc(12px * var(--panel-text)); font-style: italic; text-align: center; }
#login .login-say { margin: 0; color: var(--fg); font-size: calc(13px * var(--panel-text)); line-height: 1.45; }
#login label { display: flex; flex-direction: column; gap: 4px; color: var(--dim); font-size: calc(12px * var(--panel-text)); }
#login label[hidden], #login p[hidden], #login button[hidden] { display: none; }
#login input { font: inherit; font-size: calc(15px * var(--panel-text)); color: var(--white); background: var(--bg); border: 1px solid var(--edge); border-radius: 3px; padding: 8px 10px; }
#login input:focus { outline: none; border-color: var(--cyan); }
#login input[readonly] { color: var(--gray); }
#login .login-note { margin: 0; color: var(--red); font-size: calc(12px * var(--panel-text)); }
#login .login-actions { display: flex; gap: 8px; margin-top: 4px; }
#login .login-actions button { flex: 1; font: inherit; font-size: calc(14px * var(--panel-text)); color: var(--white); background: var(--panel2); border: 1px solid var(--edge); border-radius: 3px; padding: 9px 12px; cursor: pointer; }
#login .login-actions button[type="submit"] { border-color: #4a4420; }
#login .login-actions button:hover { border-color: var(--cyan); }
#login .login-actions button:disabled { opacity: 0.5; cursor: default; }
