/* © 2026 MEK.txt. All rights reserved. */
/* Village: this idea's differences from the design system. Always linked last. */

/* ---------- The theme picker (the pause menu) ----------
   Deviation (t82, proposed): the system's Pick in a TUI look, built here first. The trigger in cells, [Name v], as
   wide as the longest name so it never moves; the list in a double-line frame (app.js draws it with the TUI canvas),
   its rows .tui-menu rows: a > in the accent on the current one, its key in the quiet accent. States instant but the
   hover's dissolve. */
.village-theme { color: var(--text-soft); }
.village-theme .pick { display: inline; position: relative; }
.village-theme .pick-btn { display: inline; font: inherit; line-height: inherit; --ink: var(--text-strong); --ink-to: var(--text-strong); }
.village-theme .pick-btn::after { content: none; }
.village-theme [data-pick-value] { display: inline-block; width: 11ch; text-align: left; }
.village-theme .pick-menu { top: 100%; left: 6ch; min-width: 0; gap: 0; padding: var(--tui-line, 1lh) 2ch; background: var(--bg); }
.village-theme .pick-menu.to-end { left: auto; right: 0; }
.village-theme .pick-menu.to-top { top: auto; bottom: 100%; }
.village-theme .pick-menu > .frame { position: absolute; inset: 0; margin: 0; pointer-events: none; color: var(--tui-edge); font: inherit; line-height: inherit; }
.village-theme .pick-menu button { font: inherit; line-height: inherit; padding: 0 0 0 2ch; border: 0; gap: 2ch; }
.village-theme .pick-menu button::before { content: ">"; left: 0; width: 1ch; font: inherit; line-height: inherit; clip-path: none; transition: none;
  visibility: hidden; color: var(--accent); }
.village-theme .pick-menu button:is(:focus-visible, .on, [aria-selected="true"])::before { visibility: visible; }
.village-theme .pick-menu button:focus-visible::before { color: inherit; }
.village-theme .pick-menu .pick-label { padding-right: 0; transition: none; translate: none !important; }
.village-theme .pick-menu kbd { font: inherit; line-height: inherit; color: var(--key, var(--500-accent)); }

/* ---------- The map's palette ----------
   Every tile kind by name, from the system's tokens only (render/textmap.js reads them off the map). Terrain is in
   the ink steps, the fog's map tones and the minimap's water; the accent is the chosen villager and nothing else.
   On :root and [data-theme], so an area in another theme works them out again. The minimap's --hud-map-* match. */
:root, [data-theme] {
  --village-ground: var(--bg);
  /* Deviation (the user's ask, the art library's after t47): the map's grass tone a step under the fog's (45%), mixed
     with the ground so the meadow stays quiet under the people; never --good, a status. */
  --village-grass: color-mix(in srgb, var(--map-grass) 28%, var(--bg));
  --village-tall: var(--village-grass);
  --village-tree: var(--500-accent);
  --village-berry: var(--map-fruit);     /* the map's fruit tone (not --bad: that's for status) */
  --village-bush: var(--line-hover);
  --village-water: var(--map-water);     /* the map's water tone (DOS-AGE's cyan in Miner and DOS Age) */
  /* Tile blocks take raw steps: they aren't lines. */
  --village-deep: var(--600);            /* the water tile's block, under the waves */
  /* The ponds and the swamp (sim/waters.js): the water a green step, the swamp's standing water greener and dimmer, its
     ground a dark green block, its reeds pale, its mud the dirt's. Mixes of the map's own tones, no new colour. */
  --village-pond: color-mix(in srgb, var(--village-water) 60%, var(--village-grass));
  --village-bog: color-mix(in srgb, var(--village-water) 30%, var(--village-grass));
  --village-mire: color-mix(in srgb, var(--village-deep) 50%, var(--village-grass));
  --village-reed: color-mix(in srgb, var(--village-sand) 55%, var(--village-grass));
  --village-mud: var(--village-dirt);
  --village-smoke: color-mix(in srgb, var(--text-soft) 70%, var(--village-water));   /* a pale, flat colour for the bakery's smoke (its puffs' ink) and the dawn mist: */
  --village-ice: color-mix(in srgb, var(--village-water) 35%, var(--text-strong));   /* winter's water: the water's tone washed pale, the block a step darker */
  --village-ice-deep: color-mix(in srgb, var(--village-deep) 55%, var(--text-muted));   /* the bakery's smoke and the swamp's dawn mist */
  --village-rock: var(--line-hover);
  --village-dirt: var(--line);
  --village-sand: var(--map-sand);
  --village-timber: var(--map-wood);      /* DOS-AGE's light timber (#8f563b): the map's wood tone */
  --village-timber-dark: var(--map-earth); /* its dark timber (#663931): the map's earth tone */
  --village-hearth: var(--text-soft);     /* a house's door */
  --village-pile: var(--line-hover);
  --village-wood: var(--text-muted);     /* DOS Age's warm grey: timber */
  --village-stone: var(--fog-tone-3);
  --village-field: var(--line-hover);    /* a field under the plough, or in stubble */
  --village-crop: var(--village-grass);  /* sown and growing */
  --village-ripe: var(--village-sand);   /* ripe for the harvest */
  --village-forge: var(--text-muted);    /* the anvil */
  --village-grave: var(--text-muted);    /* a grave's cross: grey, or grey-violet, light or dark timber (look.js) */
  --village-grave-old: var(--line-hover);
  --village-lit: var(--text-strong);     /* the church door while a service is on */
  /* The priest as DOS-AGE draws him (MEK's ask): his robe in the river's tone; his inside-out figure tells him apart. */
  --village-priest: var(--village-water);
  --village-glow: var(--line);           /* the ground under a home where something's just happened (render/night.js) */
  --village-glow-dim: var(--surface);    /* … fading, and by night; never --accent, which is the followed person's */
  --village-canopy: var(--village-canopy-green); /* the dark under an old tree's leaves (the seasons, below) */
  --village-leaf: var(--village-leaf-green);     /* an old tree's leaves on it: its own ink, so the small trees keep theirs */
  --village-rock-pale: var(--text-muted); /* DOS-AGE's pale boulders, beside --village-rock's dark slabs */
  --village-flame: var(--ambient-firefly); /* a torch's flame: the system's warm light ink, as the lamps' glow */
  /* Under the hill (DOS-AGE's cave-1): */
  --village-wall: var(--map-earth);           /* its dirt walls (#663931): the map's earth tone */
  --village-hard: var(--surface);             /* hard ground's block (#311c17), a step off the ground */
  --village-floor: var(--surface);            /* the floor's grit (#222034) */
  --village-ore: var(--map-ore);
  --village-adversary: var(--bad);       /* what walks at night: danger is --bad's role (as --hud-map-danger) */
  --village-food: var(--fog-tone-1);
  --village-villager: var(--text-strong);
  --village-stranger: var(--text-soft);   /* a trader or pedlar on the road: here, but not ours (never --text-muted: that's the ill's ink on a person) */
  --village-beast: var(--village-timber); /* a pedlar's dog, a step under him: the ill's and the timber's ink, told apart by its shape (never --village-adversary) */
  /* Deviation (a raw mix: MEK's woods): a real danger out of the woods (wolves, a bear, brigands), the armed men's, never
     the priest's (--village-adversary): rust, between --bad and --warn, dulled with the timber, so it isn't --bad's red. */
  --village-wild: color-mix(in srgb, color-mix(in srgb, var(--bad) 50%, var(--warn)) 70%, var(--village-timber));
  --village-asleep: var(--text-muted);
  --village-chosen: var(--accent);       /* one accent a view: the chosen villager (its ☺ and its row's >) */
  --hud-map-grass: var(--village-grass);
  --hud-map-water: var(--village-water);
  --hud-map-wall: var(--village-timber);
}
/* The tile map (the design system's js/tilemap.js) reads its ground and cursor where the canvas is: the cell under
   the cursor, inverse, in the quiet accent, as a key hint is (where a press would land), never the chosen one's
   --accent; not --text-strong (MEK: not white). */
.village { --tilemap-ground: var(--village-ground); --tilemap-cursor: var(--key); }

/* ---------- Households ----------
   One ink a family (a household's mark, sim/households.js): the system's four kin inks, shared by them all and no two
   next door alike. They're told apart by label too (DESIGN.md's kin rule): the cursor's line and the card name whoever
   it is, and Homes names each family in its ink, the map's legend in words. */
:root, [data-theme] {
  --village-house-0: var(--kin-1);
  --village-house-1: var(--kin-2);
  --village-house-2: var(--kin-3);
  --village-house-3: var(--kin-4);
}
[data-house="0"] { color: var(--village-house-0); }
[data-house="1"] { color: var(--village-house-1); }
[data-house="2"] { color: var(--village-house-2); }
[data-house="3"] { color: var(--village-house-3); }

/* ---------- The seasons ----------
   Deviation (MEK's ask, the project's own till a second project wants seasons; then t47): the year in the inks, never
   the ground (it stays dark, and the night's fog works the same). app.js sets data-season on .village (0 spring … 3
   winter) and reads the colours again when it turns. Summer is the palette above. Snow is a figure colour: the grass
   tufts go 700 and the trees bare, so the people and a lit door (1000) stay the brightest things in winter. */
:root, [data-theme] { --village-blossom: var(--text-soft);
  /* turned leaves: a map tone from --warn as the russet (--fog-tone-1) is from --bad, so orange in every theme */
  --village-turned: color-mix(in srgb, var(--warn) 45%, var(--bg)); }
/* An old tree's crown (MEK's ask: its russet leaves were lost on the slate --line; deviation, t47 map tones): a dark
   green block, a step under the grass tufts (28%), mixed as the fog tones are, with leaves light enough to read on it:
   green in spring and summer, turned in autumn, bare grey on a grey block in winter, snow on the branches when it lies. */
:root, [data-theme] {
  --village-canopy-green: color-mix(in srgb, var(--map-grass) 20%, var(--bg));
  --village-leaf-green: color-mix(in srgb, var(--map-grass) 70%, var(--bg));
  --village-leaf-turned: color-mix(in srgb, var(--warn) 85%, var(--bg)); }
.village[data-season="0"] { --village-grass: color-mix(in srgb, var(--map-grass) 45%, var(--bg)); --village-tall: var(--village-grass); }
.village[data-season="2"] { --village-tree: var(--fog-tone-1); --village-bush: var(--fog-tone-1); }
.village[data-season="3"] { --village-grass: var(--text-muted); --village-tall: var(--text-muted);
  --village-tree: var(--line-hover); --village-bush: var(--line); --village-berry: var(--line); }
.village[data-season="2"] { --village-leaf: var(--village-leaf-turned); }
.village[data-season="3"] { --village-canopy: var(--line); --village-leaf: var(--text-muted); }
.village[data-weather="snow"] { --village-canopy: var(--line); --village-leaf: var(--text-soft); }
/* Snow lying: the grass's tufts and the fields go pale, the trees bare (the weather's, any season it falls in). */
.village[data-weather="snow"] { --village-grass: var(--text-soft); --village-tall: var(--text-soft); --village-field: var(--text-soft);
  --village-crop: var(--text-soft); --village-tree: var(--line-hover); }

/* ---------- The map is the window; the village's panel sits over its right edge ----------
   Desk and tablet. The panel is the project's own (a deviation: the system's sidebar part is a page column, and here
   the map runs under it): the sidebar part's toggle, icon and glide, solid and flat over the map. Shut, only
   its head stays, a fixed-width strip at the top right. A tablet starts with it shut (app.js), its rows two lines high for touch. A phone gets a note instead (.small-screen). Space is the page's own key (app.js setSpeed): it goes
   between Pause and the last speed, which no one control's data-key can do. */
html { overflow: hidden; scrollbar-gutter: auto; }
body { background: var(--village-ground); }
.stage { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden; background: var(--village-ground); }
#map, #air, #smoke { grid-area: 1 / 1; }
#air, #smoke { pointer-events: none; image-rendering: pixelated; }
#map { cursor: grab; }   /* (the tile map part: crisp, still, the system's focus ring; dragged to look round) */
#map:focus-visible { outline: none; }   /* (no ring round the map: the keyboard's cursor on it shows where you are; MEK's ask) */

/* The panel is one text-mode screen on the Mono cell grid at the compact size (1ch × 1lh: 7 × 15, Mono 12, crisp):
   41 cells wide, every
   row a whole line, its double frame a <pre class="frame"> drawn behind the live controls (app.js frames()), so the
   controls never sit inside a box the TUI part redraws. A control on a frame row masks the ═ under it (.mask). */
.village-head, .village-panel { position: fixed; right: 0; width: 41ch; box-sizing: border-box; background: var(--bg);
  --tui-edge: var(--text-muted); padding-inline: 2ch; white-space: normal; }
.village-head .row, .village-panel .stores, .village-panel .heads, .village-panel .tab-list { white-space: pre; }
.village-head pre, .village-panel pre { font: inherit; line-height: inherit; margin: 0; }
.village-head .frame, .village-panel .frame { position: absolute; inset: 0; pointer-events: none; color: var(--tui-edge); }
.frame .keys { color: var(--text); }   /* the key list on the foot edge: the text's ink, apart from the frame */
.village-head > :not(.frame), .village-panel > :not(.frame) { position: relative; }
.mask { background: var(--bg); }

/* Head: the title row (the frame's top edge: the name, the toggle), the day, the controls, then the edge under them */
.village-head { top: 0; z-index: 2; height: 5lh; padding-block: 0 1lh; display: grid; grid-template-rows: repeat(4, 1lh); }
/* The Church's day: the feast or the season on the left (a great feast strong), the fast on the right, dim. */
.village-head .day { display: flex; justify-content: space-between; }
.village-head .title { display: flex; justify-content: space-between; margin-inline: -1ch; }
.village-head .title > .mask { padding-inline: 1ch; }
.village-head #panel-toggle { padding: 0; }
.village-head .title > .end { display: flex; gap: 1ch; }
.village-head .controls { display: flex; justify-content: space-between; }
.village-head :is(.controls, .title, .day) kbd.key { display: none; }   /* the keys are in the panel's foot edge */

.village-panel { top: 5lh; z-index: 1; height: round(down, calc(100dvh - 5lh), 1lh); padding-block: 0 1lh;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 3lh 1lh minmax(0, 1fr) 1lh 2lh;
  transition: transform var(--dur-glide) var(--ease-glide); }
body.panel-shut .village-panel { transform: translateX(100%); }
.village-panel[hidden] { display: none; }
.village-panel.no-glide { transition: none; }
@media (prefers-reduced-motion: reduce) { .village-panel { transition: none; } }

.village-panel .skyline { margin: 0; overflow: hidden; }
.sky-roof { color: var(--village-timber-dark); } .sky-wall { color: var(--village-timber); }
.sky-door { color: var(--village-hearth); } .sky-ground { color: var(--village-grass); }
.sky-tree { color: var(--village-tree); } .sky-trunk { color: var(--village-timber-dark); }
/* By night the windows go dark (app.js puts .night on the skyline from 21:00, when the lamps go out, though the map
   dims from 19:00); the church's door isn't a .sky-door, so it keeps its light. */
.skyline.night .sky-door { color: var(--line); }
.sky-church { color: var(--village-timber); } .sky-cross { color: var(--village-timber); } .sky-grave { color: var(--village-grave); }
.village-panel .stores { color: var(--text-muted); }
.village-panel .stores > span { color: var(--text-strong); }
.village-panel .tabs { display: grid; grid-template-rows: 1lh minmax(0, 1fr); min-height: 0; }
/* The tabs sit in a frame row, as text: the chosen one strong, the other dim (a project deviation: tabs in a box edge) */
.village-panel .tab-list { justify-self: start; display: flex; gap: 1ch; border: 0; padding: 0 1ch; margin-inline-start: -1ch; height: 1lh; }
.village-panel .tab-list > .tab { font: inherit; padding: 0; border: 0; height: 1lh; line-height: 1lh; color: var(--text-muted); }
.village-panel .tab-list > .tab[aria-selected="true"] { color: var(--text-strong); }
.village-panel .tab-list > .tab::after { display: none; }
.village-panel .tab-panel { min-height: 0; overflow: auto; }
.village-panel .heads { height: 1lh; }
.readout { white-space: normal; }
.readout .truncate { white-space: pre; }
#people { width: 100%; white-space: normal; }
#people > button, #people > .household { white-space: pre; }
/* One accent a view: the checked speed's (*) is the quiet key-on, not the accent (HQ t46) */
.village-head .tui-check:has(input:checked) > [data-tui-mark] { color: var(--key-on); }


/* A life reads in the text's ink, the years dim, so the eye goes year, then what happened, all the way down. */
.life-list { list-style: none; margin: 0; padding: 0; height: 100%; color: var(--text); white-space: normal; }
/* The chronicle is the system's message log, filling its tab in the panel's own type (a project deviation, CLAUDE.md:
   the part's Mono 24 on 32px rows, --log-rows tall, would break the TUI's one size and grid). Only its list scrolls. */
.village-panel .tab-panel:has(> .log) { overflow: hidden; }
.village-panel .log { height: 100%; }
.village-panel .log-lines { height: 100%; box-sizing: border-box; padding: 0; font: inherit; line-height: inherit; }

/* Tablet: the touch rows two lines (30px) high. */
@media (max-width: 900px /* --bp-tablet */) { #people > button { line-height: 2lh; } }

/* A phone (or one on its side): a note instead of the village. */
.small-screen { display: none; }
@media (max-width: 640px /* --bp-phone */), (max-height: 500px) {
  .village { display: none; }
  .small-screen { display: grid; place-items: center; min-height: 100dvh; padding: var(--space-6); text-align: center; }
  .small-screen .stack { justify-items: center; }
}

/* ---------- The character card ----------
   Deviation (MEK's pick; no TUI window in the system yet, the pause drawer's sibling; promote at two): a fixed
   33 × 9 cells over the map beside the clicked villager, a single-line frame (a step under the panel's double), the
   name notched in its top edge in the strong ink (the villager's figure is the view's accent), the household's name
   in its ink. Open and shut instant; it hops with its villager a cell at a time, never glides. */
.village-card { position: fixed; left: 0; top: 0; z-index: var(--z-menu); width: 33ch; height: 9lh; box-sizing: border-box;
  padding: 0 2ch; margin: 0; background: var(--bg); color: var(--text); --tui-edge: var(--text-muted); white-space: normal;
  display: grid; grid-template-rows: repeat(9, 1lh); }
.village-card[hidden] { display: none; }
.village-card .frame { position: absolute; inset: 0; margin: 0; pointer-events: none; color: var(--tui-edge); font: inherit; line-height: inherit; }
.village-card > :not(.frame) { position: relative; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.village-card .title, .village-card .foot { margin-inline: -1ch; }
.village-card .title > .mask { padding-inline: 1ch; }
.village-card .foot > .mask { padding-inline: 1ch; }

/* ---------- An illuminated page: the Liturgy book and the founding ----------
   Deviation (no TUI window in the system yet: t96 proposes this one, .ill-book with mekIllum.frame, redrawn on
   resize; this and panel/page.js go when it ships): a page 45 cells wide, a double frame like the panel's drawn
   behind it (page.js), its title notched in the top edge; then the arch, two rows between pillars, a rule, and the
   page's text, scrolling inside the frame. Open and shut instant. Its ornament (the studs, the arch, the pillars, the
   drop initial, the dividers, the tailpiece) is the design system's Illumination part, in its --gilt and --rubric
   (Village's five themes share the lamplight gold and cinnabar there); the art is Village's own, from the art library
   (illumination.js). */
.village-page { width: 45ch; box-sizing: border-box; padding: 0 2ch;
  background: var(--bg); color: var(--text); --tui-edge: var(--text-muted); white-space: normal; }
.village-page .frame { position: absolute; inset: 0; margin: 0; pointer-events: none; color: var(--tui-edge); font: inherit; line-height: inherit; }
.village-page > :not(.frame) { position: relative; }
.village-page .row { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.village-page .title { margin-inline: -1ch; }
.village-page .title > .mask { padding-inline: 1ch; }
.village-page .pillared { display: flex; }
.village-page :is(.pillar-l, .pillar-r) { flex: none; }
.village-page .pillared .mid { flex: 1; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; }

/* The Liturgy book (the card's and the pause drawer's sibling): the window's height in whole rows, on the map's left
   edge, under the card; the day and the rite between the pillars, the service's parts under the rule. */
.village-book { position: fixed; inset: 0; margin: auto; z-index: 2; height: round(down, 100dvh, 1lh);   /* (centred: the pages of the book, B and N, sit in the middle of the screen; MEK's ask) */
  display: grid; grid-template-rows: 1lh 3lh 1lh 1lh 1lh minmax(0, 1fr) 1lh; }   /* book.js HEAD: 7 */
.village-book[hidden] { display: none; }
.village-book .book-body { overflow-y: auto; white-space: pre-wrap; outline: none; }
.village-book .rubric .dim { color: var(--text-muted); }   /* who says it, quiet after the part's name */

/* The petition (the Liturgy book's sibling, in its slot and frame): as tall as its rows, over the map's left edge; the arch
   and the title, a rule row, what is asked (two lines), the days left, then the answers a row each. Where the book would be, so
   the book's B opens whichever is asked. The gilt dot on the Book button says someone asks (the part's .notify, in the
   angel's ink, not the status red). */
.village-petition { position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 2;
  display: grid; grid-template-rows: 1lh 3lh 1lh 2lh 1lh 1lh auto 1lh; }   /* petition.js HEAD: 4; the choices' rows, then the foot */
.village-petition[hidden] { display: none; }
/* The weightiest ask (a deathbed): its drop initial is five rows tall, so the ask has five. */
.village-petition.heavy { grid-template-rows: 1lh 3lh 1lh 5lh 1lh 1lh auto 1lh; }
.village-petition .ask { white-space: pre-wrap; overflow: hidden; }
.village-petition .choices .row { line-height: 1lh; }
/* The village's gauges: a small TUI box at the map's top left, 30 cells wide and 6 rows tall, under the book's pages (they cover it
   while open) and the card. A single-line frame like the card's. */
.village-mood { position: fixed; left: 0; top: 0; z-index: 1; width: 30ch; box-sizing: border-box; padding: 0 2ch; background: var(--bg); color: var(--text);
  --tui-edge: var(--text-muted); white-space: pre; display: grid; grid-template-rows: repeat(6, 1lh); }
.village-mood[hidden] { display: none; }
.village-mood .frame { position: absolute; inset: 0; margin: 0; pointer-events: none; color: var(--tui-edge); font: inherit; line-height: inherit; }
.village-mood > :not(.frame) { position: relative; }
.village-mood .title { margin-inline: -1ch; }
.village-mood .title > .mask { padding-inline: 1ch; }
.village-mood .mood { list-style: none; margin: 0; padding: 0; display: contents; }
.village-mood .mood-row { height: 1lh; line-height: 1lh; }
/* Each gauge its own ink, the four of the households' (the system's kin tones, which every theme keeps apart): joy orange, fed green,
   safe blue, faith pink; a low one is --bad, whichever. */
.village-mood .mood-row[data-gauge="joy"] .fill { color: var(--village-house-3); }
.village-mood .mood-row[data-gauge="fed"] .fill { color: var(--village-house-2); }
.village-mood .mood-row[data-gauge="safe"] .fill { color: var(--village-house-0); }
.village-mood .mood-row[data-gauge="faith"] .fill { color: var(--village-house-1); }

/* The prayer (the petition's sibling): the box at the window's foot, in the middle, over a dark map; the head, the panel and the card
   are put away while it is on. */
.village-prayer { position: fixed; left: 50%; bottom: 2lh; transform: translateX(-50%); z-index: 4; display: grid; }
.village-prayer[hidden] { display: none; }
.village-prayer .says, .village-prayer .choices { display: contents; }
.village-prayer .choices[hidden] { display: none; }
.praying :is(.village-mood, .village-head, .village-panel, .village-card, .village-book, .village-petition, .village-year, .village-dead) { visibility: hidden; }
.praying :is(#air, #smoke) { visibility: hidden; }
.village-caption { position: fixed; left: 50%; bottom: 1lh; transform: translateX(-50%); z-index: 4; padding: 0 1ch; background: var(--bg); color: var(--text-muted); white-space: pre; }
.village-caption[hidden] { display: none; }
.watching :is(.village-mood, .village-head, .village-panel, .village-card, .village-book, .village-petition, .village-year, .village-dead) { visibility: hidden; }   /* (no butterfly or leaf in the dark) */
.village-head .book-open.notify.on::after { background: var(--gilt); }

/* The year page (the petition's sibling, in the same slot and frame): as tall as its lines in whole rows, never taller than
   the window; the title, the arch and a rule row, then the tally, which scrolls if the window is short. */
.village-dead .year-body { white-space: pre; }
.village-year { position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 2; max-height: round(down, 100dvh, 1lh);
  display: grid; grid-template-rows: 1lh 3lh 1lh minmax(0, auto) 1lh; }   /* year.js HEAD: 4; the tally, then the foot */
.village-year[hidden] { display: none; }
.village-year .year-body { overflow-y: auto; outline: none; }

/* The founding (the pause's sibling, modal in the middle): as tall as its text in whole rows, never taller than the
   window (then its text scrolls inside the frame); the name notched in the top edge, centred; the founding and the
   date between the pillars (founding.js HEAD: 7), the text, Proceed, a row, the foot with its key. No wash behind it
   (MEK, 2026-11-13: the paused village is the page's background, seen whole; the page stays solid on --bg), as the
   pause's backdrop is clear too. */
.village-founding { max-width: none; height: fit-content; max-height: round(down, 100dvh - 2 * var(--dialog-inset), 1lh);
  margin: auto; border: 0; overflow: hidden; text-align: left; }
.village-founding[open] { display: grid; grid-template-rows: 1lh 3lh 1lh 1lh 1lh minmax(0, 1fr) 1lh 1lh; }
.village-founding::backdrop { background: transparent; }
/* While it's open the village is all there is behind it: the head and the panel (the right side) come back with
   Proceed. Hidden, not taken out, so nothing moves or is measured again. (MEK, 2026-11-13) */
:root:has(.village-founding[open]) :is(.village-head, .village-panel) { visibility: hidden; }
.village-founding .title { text-align: center; }
.village-founding .founding-body { overflow-y: auto; white-space: pre-wrap; outline: none; padding-block: 1lh; }
.village-founding .founding-body > * + * { margin-top: 1lh; }
.village-founding .go { text-align: center; }
.village-founding .go kbd.key { display: none; }   /* the key is on the foot edge, as the book's are */
/* Its opener: the head's day row, the feast's own words. Deviation: underlined on hover and while the book is open,
   not the dissolve: a .tui-btn would draw [ ] round it, and the row has no cells to spare (a bracketless TUI text
   control goes to the system if a second screen wants one). */
.village-head .book-open { all: unset; cursor: pointer; white-space: pre; }
.village-head .book-open:hover, .village-head .book-open[aria-expanded="true"] { text-decoration: underline; }
.village-head .book-open:focus-visible { outline: var(--stroke) dashed var(--focus-ring); outline-offset: var(--focus-offset); }

/* ---------- The pause: a drawer the head grows ----------
   Deviation (no TUI window in the system yet; promote at two): a modal <dialog> in cells, 41 wide like the head, its
   first row on the head's foot so its frame's ╠═ Paused ═╣ joins it, 13 rows: the menu or the confirm (rows 1-7), a
   rule, the credit (9-11), the keys on its foot. The paused village stays in sight behind it. Open and shut instant. */
.village-menu { position: fixed; inset: 4lh 0 auto auto; margin: 0; width: 41ch; height: 13lh; max-height: none; max-width: none;
  box-sizing: border-box; padding: 1lh 2ch; border: 0; overflow: visible; background: var(--bg); color: var(--text); text-align: left;
  --tui-edge: var(--text-muted); white-space: normal; display: grid; grid-template-rows: 7lh 1lh 3lh; }
.village-menu:not([open]) { display: none; }
.village-menu::backdrop { background: transparent; }
.village-menu .frame { position: absolute; inset: 0; margin: 0; pointer-events: none; color: var(--tui-edge); font: inherit; line-height: inherit; }
.village-menu > :not(.frame) { position: relative; }
.village-menu { place-items: stretch; place-content: stretch; }
.village-menu .menu-page { grid-row: 1; padding-top: 1lh; display: block; width: 100%; justify-self: stretch; }
.village-menu .tui-menu { margin: 0; }
.village-menu .menu-page[hidden] { display: none; }
.village-menu .credit-tui { grid-row: 3; display: grid; align-content: start; }
.village-menu .credit-tui :is(a, .dim) { font: inherit; line-height: inherit; }   /* (the link at the cell's size, not the system's 14; the versions wrap to a second row) */
.village-menu :is(.tui-menu > button, .pick-btn, .tui-btn) kbd.key { display: none; }   /* the keys are on the foot edge (the theme list keeps its numbers) */
.village-menu .tui-menu { display: grid; width: 100%; }
.village-menu .tui-menu > button { position: relative; text-align: left; }
/* Sound: a menu row with its mark, [x] on, [ ] off (sound.js keeps aria-pressed); the mark in --key-on, not the
   accent: the menu's > is the one accent here. */
.village-menu .sound-mark { position: absolute; right: 0; color: var(--key-on, var(--text-strong)); }
.village-menu [data-sound-toggle][aria-pressed="false"] .tui-x { visibility: hidden; }
.village-menu .village-theme { margin-top: 1lh; }
.village-menu p { margin: 0; white-space: pre; }
.village-menu p + p { margin-top: 1lh; }
.village-menu p.end { display: flex; justify-content: flex-end; gap: 1ch; }

/* Deviation (MEK's ask, 2026-11-18): on a 2x screen the village's text screens are Mono 18, a cell of 21 × 45 device pixels (10.5 × 22.5
   CSS px), whole, so glyphs still join with no seam: DESIGN.md's grid is 12 and 24 (a cell is whole device pixels only at multiples of
   12 there; at 2x, 18 is too). On a 1x screen they stay at 12. */
@media (min-resolution: 2dppx) {
  .village .tui, .village-menu, .village-founding { --tui-size: 18px; }   /* (the two dialogs sit outside .village) */
  /* and the rest of what is set in Dosage Mono: the log's "new lines" button, the system's 14 → 18 (the tooltips and the
     prose are Dosage Humanist, not the grid's, and stay) */
  .village .log-new { font-size: 18px; }
}
