/* Thornveld - national-park signage: enamel green panels, bone-white type, signal yellow for
   what is active, pencil red for trouble. Type is Barlow, a grotesk drawn from road and park
   signs, embedded in css/fonts.css so every platform sees the same letters; Barlow Condensed
   sets the name, titles and big numbers.
   One type scale, one 4px spacing scale and one depth scale. Corners stay square, like enamel plates;
   headings are a label followed by a hairline, like a trail sign; everything that floats over the
   map is the same plate with the same soft, green-tinted shadow.
   The map fills the screen. Around its edge sit a few small plates (logbook buttons on the left,
   overlays and notices on the right, the build dock at the foot) and the readings run along a bar
   underneath. Logbook pages and tool palettes come out as windows only when asked for. */
:root {
  --sign: #1f3b2c; --sign-hi: #284a39; --sign-lo: #16301f; --line: #3a5c49;
  --bone: #ece4cf; --dim: #b4b09a; --faint: #a3a996;
  --signal: #f2c230; --pencil: #f0806a; --sky: #6fb3dc; --leaf: #9ccc72;
  /* the fire-danger bands, Low to Extreme: printed-sign colours, each dark enough to edge the cream
     plate and light enough for dark lettering (bone lettering on Extreme) */
  --fd0: #6aa84f; --fd1: #5b9ad4; --fd2: #e8b422; --fd3: #e07a2e; --fd4: #b8302a;
  --font: Barlow, Bahnschrift, "Segoe UI", system-ui, sans-serif;
  --font-cond: "Barlow Condensed", Bahnschrift, "Arial Narrow", sans-serif; /* with font-stretch: condensed, so Bahnschrift narrows too if it is ever the one used */
  /* type: key caps and fine print, labels, body, values and section heads, titles, brand, display */
  --t-xs: 11px; --t-sm: 12px; --t-md: 13px; --t-lg: 15px; --t-xl: 18px; --t-2xl: 22px; --t-3xl: 30px;
  /* spacing on a 4px grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  /* plates over the map, and depth: shadows are tinted with the deepest green, never plain black */
  --plate: rgba(20, 44, 29, 0.94); --plate-edge: rgba(236, 228, 207, 0.08);
  --lift-1: 0 1px 0 rgba(5, 14, 9, 0.45), 0 4px 14px rgba(5, 14, 9, 0.35);
  --lift-2: 0 2px 0 rgba(5, 14, 9, 0.45), 0 14px 36px rgba(5, 14, 9, 0.55);
  --ease: 150ms ease-out;
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
[hidden] { display: none !important; } /* an element given its own display (grid, flex) must still hide */
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sign-lo); color: var(--bone); font: var(--t-md)/1.45 var(--font); } /* a full-screen game: the page itself never scrolls, only the windows and dialogs in it */
::selection { background: var(--signal); color: var(--sign-lo); }
b, strong { font-weight: 600; } /* the weight that is embedded; 700 is kept for the condensed display face */
/* pictograms (js/icons.js): one stroke weight for the whole family, in the colour of the text */
.ic { width: 18px; height: 18px; flex: none; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
button { font: inherit; color: inherit; cursor: pointer; transition: background-color var(--ease), border-color var(--ease), color var(--ease); }
button:focus-visible, canvas:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
#map:focus-visible { outline-offset: -3px; } /* the map fills its frame, so an outside ring would be cut off */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* for screen readers only */
kbd { display: inline-block; min-width: 16px; margin-left: 6px; padding: 0 3px; font: inherit; font-size: var(--t-xs); line-height: 14px; text-align: center; color: var(--faint); border: 1px solid var(--line); border-bottom-width: 2px; vertical-align: 1px; } /* a key cap, not a stray letter */

#app { position: relative; overflow: hidden; display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; } /* never wider than the screen, whatever the bar holds */

/* ---- the bar along the foot: the readings, parted by hairlines, then the date, speed and menu ---- */
#bar { position: relative; z-index: 20; display: flex; align-items: center; gap: var(--s4); min-height: 50px; padding: 0 var(--s4); background: var(--sign); border-top: 3px solid var(--sign-lo); }
#brand { display: flex; align-items: center; gap: var(--s2); font: 700 var(--t-2xl)/1 var(--font-cond); font-stretch: condensed; letter-spacing: 0.01em; color: var(--signal); margin-right: var(--s1); }
#brand img { width: 26px; height: 26px; display: block; }
.read { position: relative; display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.read + .read::before { content: ''; position: absolute; left: calc(var(--s4) / -2); top: 20%; bottom: 20%; border-left: 1px solid var(--line); }
.read b { font: 600 var(--t-xl)/1.05 var(--font-cond); font-stretch: condensed; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; } /* the readings, large in the narrow cut so they fit */
.read small { font-size: var(--t-xs); color: var(--dim); letter-spacing: 0.01em; margin-top: 2px; }
.read .neg { color: var(--pencil); }
.read .inl { display: none; } /* words that name a reading where its label below is hidden (narrower screens) */
button.read { background: transparent; border: 0; padding: var(--s1) 6px; margin: 0 -6px; text-align: left; justify-content: center; } /* readouts that open their logbook page */
button.read:hover { background: var(--sign-hi); }
button.read + .read::before, .read + button.read::before { left: calc(var(--s4) / -2 + 6px); } /* buttons carry 6px of hover padding */
.wx-short { display: none; } /* "Drought" in place of "Hot and dry, drought" on the compact bar (below) */
#r-date { margin-left: auto; } /* the clock and its controls keep to the right, as in most builders */
#r-date::before { display: none; }
.gauge { display: inline-block; width: 46px; height: 5px; background: var(--sign-lo); margin-left: 6px; vertical-align: middle; }
.gauge i { display: block; height: 100%; background: var(--sky); }
#speed { display: flex; border: 1px solid var(--line); }
#speed button, #b-menu { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; background: transparent; border: 0; padding: 6px var(--s3); font-size: var(--t-md); white-space: nowrap; }
#speed .ic { width: 16px; height: 16px; }
#speed button + button { border-left: 1px solid var(--line); }
#speed button[aria-pressed="true"] { background: var(--signal); color: var(--sign-lo); font-weight: 600; }
#menu { position: relative; }
#b-menu { border: 1px solid var(--line); }
#menu-items { position: absolute; right: 0; bottom: calc(100% + var(--s2) + 3px); z-index: 1; min-width: 170px; display: flex; flex-direction: column; padding: var(--s1) 0; background: var(--sign); border-bottom: 3px solid var(--signal); box-shadow: var(--lift-2); }
#menu-items button { background: transparent; border: 0; text-align: left; padding: 10px var(--s4); font-size: var(--t-md); }
#menu-items button:hover, #speed button:hover:not([aria-pressed="true"]), #b-menu:hover, #b-menu[aria-expanded="true"] { background: var(--sign-hi); }
/* the screen options below a rule, each with a box on the right that is filled while it is on (js/ui.js bindView) */
#menu-items .opt { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }
#menu-items .opt::after { content: ''; flex: none; width: 14px; height: 14px; box-sizing: border-box; border: 2px solid var(--dim); }
#menu-items .opt[aria-pressed="true"]::after { border-color: var(--signal); background: var(--signal); box-shadow: inset 0 0 0 2px var(--sign); }
#menu-items .opt.first { margin-top: var(--s1); border-top: 1px solid var(--line); }
/* the grid letters put away: the top and left margins narrow to the bottom and right ones, which hold only the ticks */
#view.no-grid { --pad-t: var(--pad-b); --pad-l: var(--pad-r); }

/* ---- map, and the plates that float over it ---- */
/* The map is drawn like a printed park map: a margin for the grid letters and numbers (top and left),
   a narrow one on the other sides, and a neatline between. render.js reads these widths; the plates
   below use them to sit inside the neatline. Multiples of 4px stay whole device pixels at 125%.
   --dock-h and --ov-h are measured by ui.js, for the plates that sit above the dock or below the
   overlays. Layers, bottom to top: minimap, inspector, logbook buttons, windows, dock, palette and
   overlays, notices, the map tooltip. */
#view { --pad-t: 24px; --pad-r: 8px; --pad-b: 8px; --pad-l: 24px; --launch-w: 64px; --above-dock: calc(var(--pad-b) + var(--s2) + var(--dock-h, 62px) + var(--s2));
  position: relative; overflow: hidden; min-height: 0; background: #16301f; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.toast, #inspect, #launch, #dock, #hand, #b-ov, #overlays, #legend, #tip { background: var(--plate); border: 1px solid var(--plate-edge); box-shadow: var(--lift-1); }
#mini { position: absolute; z-index: 2; right: calc(var(--pad-r) + var(--s2)); bottom: calc(var(--pad-b) + var(--s2)); border: 2px solid var(--sign); background: var(--sign-lo); cursor: pointer; touch-action: none; box-shadow: var(--lift-1); }

/* the logbook buttons: a column down the left, a pictogram over its name, lit while its page is open */
#launch { position: absolute; z-index: 4; top: calc(var(--pad-t) + var(--s2)); left: calc(var(--pad-l) + var(--s2)); display: flex; flex-direction: column; gap: 1px; padding: 3px; }
.launch-b { position: relative; width: var(--launch-w); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: var(--s2) 2px 6px; background: transparent; border: 0; border-left: 3px solid transparent; font-size: var(--t-xs); line-height: 1.1; color: var(--dim); }
.launch-b .ic { width: 22px; height: 22px; color: var(--bone); }
.launch-b:hover { background: var(--sign-hi); color: var(--bone); }
.launch-b[aria-pressed="true"] { background: var(--sign-hi); color: var(--bone); border-left-color: var(--signal); }
.launch-b[aria-pressed="true"] .ic { color: var(--signal); }
.badge { position: absolute; top: 3px; right: 7px; min-width: 17px; padding: 0 4px; background: var(--signal); color: var(--sign-lo); font: 600 var(--t-xs)/16px var(--font); font-variant-numeric: tabular-nums; text-align: center; box-shadow: 0 0 0 2px var(--plate); } /* raise requests waiting, or news since the journal was read */

/* overlays: one button naming the overlay showing; the choices drop below it, and the key below them */
#ov-box { position: absolute; z-index: 8; top: calc(var(--pad-t) + var(--s2)); right: calc(var(--pad-r) + var(--s2)); display: flex; flex-direction: column; align-items: flex-end; gap: var(--s1); }
#b-ov { display: flex; align-items: center; gap: 6px; padding: 6px var(--s3) 6px 10px; font-size: var(--t-sm); white-space: nowrap; }
#b-ov .ic { width: 16px; height: 16px; }
#b-ov b { margin-left: 2px; padding-left: var(--s2); border-left: 1px solid var(--line); color: var(--signal); font-weight: 600; }
#b-ov:hover, #b-ov[aria-expanded="true"] { background: var(--sign-hi); }
#b-ov.on .ic { color: var(--signal); } /* an overlay is showing */
#overlays { display: flex; }
#overlays button { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 5px; background: transparent; border: 0; padding: 6px 10px 6px var(--s2); font-size: var(--t-sm); white-space: nowrap; }
#overlays .ic { width: 16px; height: 16px; }
#overlays button + button { border-left: 1px solid var(--line); }
#overlays button:hover:not([aria-pressed="true"]) { background: var(--sign-hi); }
#overlays button[aria-pressed="true"] { background: var(--signal); color: var(--sign-lo); font-weight: 600; }
#legend { width: 240px; padding: var(--s2) var(--s3) var(--s3); font-size: var(--t-sm); }
#legend b { font-weight: 600; }
#legend .ramp { height: 8px; margin: 6px 0 var(--s1); }
#legend .ends { display: flex; justify-content: space-between; color: var(--dim); }
#legend .key { display: flex; align-items: center; gap: var(--s2); padding: 2px 0; }
#legend .key i { flex: none; width: 16px; height: 10px; }

/* notices: down the right, under the overlays */
#toasts { position: absolute; z-index: 9; top: calc(var(--pad-t) + var(--s2) + var(--ov-h, 32px) + var(--s2)); right: calc(var(--pad-r) + var(--s2)); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; width: min(400px, calc(100% - var(--launch-w) - 80px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: var(--s2); border-left: 5px solid var(--kind, var(--bone)); padding: var(--s2) var(--s3); font-size: var(--t-md); cursor: default; }
.toast[data-tile] { cursor: pointer; } /* a notice that opens something (a place on the map, a worker, the staff office) can be clicked */
.toast[data-tile]:hover { background: rgba(31, 59, 44, 0.97); }
.toast em, .log em { font-style: normal; color: var(--dim); font-size: var(--t-sm); margin-left: 6px; }
.toast .ic, .log .ic { width: 16px; height: 16px; margin-top: 1px; color: var(--kind, var(--bone)); }
/* what a notice is about sets its colour, used by the edge and the pictogram alike */
.k-fire, .k-poach { --kind: var(--pencil); }
.k-warn { --kind: var(--signal); }
.k-good { --kind: var(--leaf); }
.k-milestone { --kind: var(--signal); background: rgba(45, 74, 48, 0.96) !important; }
.k-report { --kind: var(--faint); }
.k-staff { --kind: var(--sky); }

/* the inspector card: bottom left, beside the logbook buttons and above the dock's row */
#inspect { position: absolute; z-index: 3; left: calc(var(--pad-l) + var(--launch-w) + var(--s6)); bottom: var(--above-dock); width: 288px; max-height: calc(100% - var(--pad-t) - var(--above-dock) - var(--s2)); overflow-y: auto; border-top: 4px solid var(--signal); padding: var(--s3) var(--s4) var(--s4); font-size: var(--t-md); box-shadow: var(--lift-2); }
#inspect h3 { margin: 0 32px 0 0; font-size: var(--t-xl); font-weight: 600; line-height: 1.2; }
#inspect .sub { margin: 2px 0 var(--s3); color: var(--dim); font-size: var(--t-sm); }
#inspect .state { margin: 0 0 var(--s2); }
#inspect p { color: var(--dim); margin: var(--s2) 0 0; }
#inspect .actions { display: flex; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; }
#inspect .close { position: absolute; top: var(--s1); right: var(--s1); background: transparent; border: 0; color: var(--dim); font-size: 22px; line-height: 1; padding: 6px var(--s2); }
#inspect .close:hover { color: var(--bone); }
#inspect .bad { color: var(--pencil); }
#inspect h4 { margin: var(--s3) 0 var(--s1); font-size: var(--t-sm); font-weight: 600; color: var(--dim); }
/* a guest's last few thoughts: a green dot for the good, a red one for the bad (the words say which too) */
#inspect .parts { display: flex; flex-wrap: wrap; gap: 2px var(--s3); margin: 2px 0 var(--s2); font-size: var(--t-sm); color: var(--dim); } /* an animal's well-being, part by part */
#inspect .parts .mid { color: var(--signal); }
#inspect .parts .low { color: var(--pencil); }
#inspect .story li::before { background: var(--faint); } /* a life's events: neither good nor bad */
#inspect .says { margin: 1px 0 var(--s2); color: var(--bone); font-size: var(--t-sm); font-style: italic; } /* a guest's own words under their stars */
#inspect .thoughts { list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); }
#inspect .thoughts li { position: relative; padding: 2px 0 2px 14px; }
#inspect .thoughts li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--leaf); }
#inspect .thoughts li.bad::before { background: var(--pencil); }
#tip { position: absolute; left: 16px; top: 14px; z-index: 10; pointer-events: none; padding: var(--s1) var(--s2); font-size: var(--t-sm); white-space: nowrap; } /* 16 px right of the pointer and 14 below it: ui.js moves it to the pointer with a transform */
#tip .bad { color: var(--pencil); }

/* ---- the build dock: Inspect, the sets of tools, Demolish ---- */
#dock { position: absolute; z-index: 7; left: 50%; bottom: calc(var(--pad-b) + var(--s2)); transform: translateX(-50%); display: flex; align-items: stretch; gap: 1px; padding: 3px; box-shadow: var(--lift-2); }
.dock-b { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 64px; padding: 7px var(--s2) 5px; background: transparent; border: 0; border-bottom: 3px solid transparent; font-size: var(--t-xs); line-height: 1.1; color: var(--dim); white-space: nowrap; }
.dock-b .ic { width: 22px; height: 22px; color: var(--bone); }
.dock-b:hover, .dock-b[aria-expanded="true"] { background: var(--sign-hi); color: var(--bone); }
.dock-b[aria-pressed="true"], .dock-b.on { color: var(--bone); border-bottom-color: var(--signal); } /* the tool in hand, or the set it came from */
.dock-b[aria-pressed="true"] .ic, .dock-b.on .ic { color: var(--signal); }
#dock .sep { flex: none; width: 1px; margin: var(--s2) 3px; background: var(--line); }
/* the tool in hand, named over the dock; clicking it puts the tool down */
#hand { position: absolute; z-index: 7; left: 50%; bottom: var(--above-dock); transform: translateX(-50%); display: flex; align-items: center; gap: var(--s2); padding: 5px var(--s2) 5px var(--s3); border-left: 4px solid var(--signal); font-size: var(--t-md); white-space: nowrap; }
#hand .ic { width: 16px; height: 16px; color: var(--signal); }
#hand small { color: var(--dim); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
#hand kbd { margin-left: 0; }
#hand:hover { background: rgba(31, 59, 44, 0.97); }
/* a set's palette, over its dock button */
#palette { position: absolute; z-index: 8; bottom: var(--above-dock); width: 290px; max-height: calc(100% - var(--pad-t) - var(--above-dock) - var(--s2)); overflow-y: auto; background: var(--sign); border: 1px solid var(--plate-edge); border-bottom: 3px solid var(--signal); box-shadow: var(--lift-2); }
#palette.wide { width: 390px; }
.pal-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s4); border-bottom: 1px solid var(--line); }
.pal-bar h2 { margin: 0; font: 600 var(--t-lg)/1.1 var(--font-cond); font-stretch: condensed; letter-spacing: 0.01em; }
.pal-pop { display: flex; align-items: center; gap: 5px; background: transparent; border: 1px solid var(--line); padding: 3px var(--s2); font-size: var(--t-sm); color: var(--dim); }
.pal-pop:hover { color: var(--bone); border-color: var(--dim); }
.pal-pop .ic { width: 14px; height: 14px; }
.pal-list { padding: var(--s1) 0; }
.pal-list.species { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: var(--s1); }
.pal-note { margin: var(--s2) var(--s4) 0; color: var(--dim); font-size: var(--t-sm); }
/* a tool: a pictogram, the name and its key, the price */
.tool { position: relative; display: flex; align-items: center; gap: var(--s2); width: 100%; background: transparent; border: 0; border-left: 4px solid transparent; padding: 7px var(--s4) 7px var(--s3); text-align: left; font-size: var(--t-md); }
.tool:hover { background: var(--sign-hi); }
.tool:active { background: var(--sign-lo); }
.tool[aria-pressed="true"] { background: var(--sign-hi); border-left-color: var(--signal); }
.tool .ic { color: var(--dim); } /* quieter than the name beside it; lit when the tool is in hand */
.tool:hover .ic { color: var(--bone); }
.tool[aria-pressed="true"] .ic { color: var(--signal); }
.tool .name { flex: 1; min-width: 0; white-space: nowrap; }
.tool > small { color: var(--dim); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.tool[aria-pressed="true"] kbd { color: var(--dim); }
.tool.sp { gap: 6px; padding: 5px var(--s2) 5px 6px; }
.tool.sp .pic { flex: none; width: 38px; display: flex; justify-content: center; }
.tool.sp .name small { display: block; color: var(--dim); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
/* a tool's row in a menu: a round "?" that opens the pop-up about the tool (js/about.js), then the tool itself.
   The "?" button is the whole left end of the row, bigger than the ring drawn in it, so it is easy to hit; the
   tool gives up a little padding for it, and a name too long for a narrowed window is cut short, not pushed out. */
.tool-row { display: flex; align-items: stretch; }
.tool-row .tool { flex: 1 1 0; width: auto; min-width: 0; padding-left: var(--s2); padding-right: var(--s3); }
.tool-row .name { overflow: hidden; text-overflow: ellipsis; }
.tool-row .tool > small { flex: none; white-space: nowrap; }
.tool-q { flex: none; display: flex; align-items: center; justify-content: flex-end; width: 30px; padding: 0 var(--s1) 0 0; background: transparent; border: 0; color: var(--dim); }
.tool-q span { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 1px solid currentColor; border-radius: 50%; font-size: var(--t-sm); font-weight: 600; line-height: 1; }
.tool-q:hover { color: var(--bone); }
.tool-q:hover span { background: var(--sign-hi); }
.tool-q:active span { background: var(--sign-lo); }
.tool-q:focus-visible { outline-offset: -2px; } /* inside the list, which clips what hangs over its edge */

/* ---- windows: logbook pages, and tools popped out of the dock ---- */
#windows { position: absolute; inset: 0; z-index: 6; pointer-events: none; } /* its own layer, so a window brought forward never climbs over the dock or the notices */
.win { position: absolute; pointer-events: auto; display: flex; flex-direction: column; min-width: 240px; min-height: 140px; max-width: calc(100% - var(--s4)); background: var(--sign); border: 1px solid var(--plate-edge); border-top: 3px solid var(--line); box-shadow: var(--lift-2); overflow: hidden; resize: both; }
.win:focus-within { border-top-color: var(--signal); } /* the window the keyboard is in */
.win-bar { flex: none; display: flex; align-items: stretch; background: var(--sign-hi); border-bottom: 1px solid var(--sign-lo); }
.win-grip { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); padding: 7px var(--s3); background: transparent; border: 0; text-align: left; cursor: grab; touch-action: none; user-select: none; }
.win-grip .ic { width: 16px; height: 16px; color: var(--dim); }
.win-grip h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 var(--t-lg)/1.15 var(--font-cond); font-stretch: condensed; letter-spacing: 0.01em; }
.win.dragging { box-shadow: 0 2px 0 rgba(5, 14, 9, 0.45), 0 22px 48px rgba(5, 14, 9, 0.6); }
.win.dragging .win-grip { cursor: grabbing; }
.win-x { flex: none; background: transparent; border: 0; padding: 0 var(--s3); font-size: 22px; line-height: 1; color: var(--dim); }
.win-x:hover { color: var(--bone); background: var(--sign); }
.win-body { flex: 1; min-height: 0; overflow-y: auto; }
.win-body:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; } /* a page takes focus, so the keyboard can scroll it */
.tools .win-body .pal-list { padding: var(--s1) 0 var(--s2); }
.tools .win-body .pal-list.species { padding: var(--s1); }

/* ---- logbook pages ---- */
.page .win-body { padding: var(--s4) var(--s4) var(--s6); }
.page .win-body h3 { font: 600 var(--t-xl)/1.2 var(--font-cond); font-stretch: condensed; letter-spacing: 0.01em; margin: var(--s8) 0 var(--s2); } /* a bold sign-board label with room above it, no rule */
.page .win-body h3:first-child { margin-top: 0; }
.page .win-body p { margin: var(--s1) 0 var(--s2); color: var(--dim); font-size: var(--t-md); max-width: 60ch; }
.page .win-body h3 small { margin-left: var(--s1); font: 400 var(--t-sm)/1 var(--font); color: var(--dim); letter-spacing: 0; } /* the comparison or count beside a heading */
.page .win-body .bad { color: var(--pencil); }
.row { display: flex; justify-content: space-between; gap: var(--s3); padding: 2px 0; font-size: var(--t-md); }
.row span:last-child { font-variant-numeric: tabular-nums; }
.row small { color: var(--dim); font-size: var(--t-sm); }
.row small.need { display: block; margin-top: 1px; } /* a staff row's second line: enough for today's guests, or how many short */
.sub { margin: var(--s4) 0 var(--s1); font-size: var(--t-sm); color: var(--dim); } /* a chart's title */
/* net income by month: bars from a zero line, profit up in green, loss down in red */
svg.net { display: block; width: 100%; height: auto; }
svg.net .gain { fill: var(--leaf); }
svg.net .loss { fill: var(--pencil); }
svg.net line { stroke: var(--faint); stroke-width: 1; }
.net-ends { display: flex; justify-content: space-between; margin-top: 2px; font-size: var(--t-xs); color: var(--dim); }
.meter { height: 6px; background: var(--sign-lo); margin: 3px 0 var(--s2); }
.meter i { display: block; height: 100%; background: var(--leaf); }
.meter.low i { background: var(--pencil); } .meter.mid i { background: var(--signal); }
.btn { min-height: 28px; background: var(--sign-hi); border: 1px solid var(--line); padding: var(--s1) var(--s3); font-size: var(--t-md); line-height: 1.2; }
.btn:hover { border-color: var(--bone); }
.btn:active { background: var(--sign-lo); }
.btn.primary { background: var(--signal); color: var(--sign-lo); border-color: var(--signal); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--pencil); color: var(--sign-lo); border-color: var(--pencil); font-weight: 600; } /* second click needed: selling or demolishing can't be undone */
.btn:disabled { opacity: 0.45; cursor: default; border-color: var(--line); filter: none; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .btn { min-width: 28px; padding: var(--s1) var(--s2); }
.stepper b { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
table.wild { width: 100%; border-collapse: collapse; font-size: var(--t-md); }
table.wild td { padding: 6px 2px; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* the census board: each species' own sprite, its name and condition, the count large in the narrow
   cut beside its trend line, then Buy and Sell */
table.wild td.pic { width: 40px; padding: var(--s1) var(--s1) var(--s1) 0; }
.sp-pic { display: block; margin: 0 auto; }
table.wild tr.none .sp-pic { opacity: 0.4; }
table.wild td.n { font: 600 var(--t-2xl)/1 var(--font-cond); font-stretch: condensed; text-align: right; font-variant-numeric: tabular-nums; width: 36px; padding-right: 6px; }
table.wild td.act { text-align: right; white-space: nowrap; }
table.wild td.act .btn + .btn { margin-left: var(--s1); }
table.wild .btn { background: transparent; padding: var(--s1) var(--s2); } /* quiet outlines, so the counts lead */
table.wild .btn:hover { background: var(--sign-hi); }
table.wild .btn.danger { background: var(--pencil); }
table.wild tr.none td { color: var(--faint); }
table.wild tr.none .btn { color: var(--bone); } /* a species you don't have is dimmed, but buying it is not */
table.wild .cond { font-size: var(--t-sm); color: var(--dim); }
table.wild .cond.bad { color: var(--pencil); }
table.wild th { padding: 0 2px var(--s1); border-bottom: 1px solid var(--line); font-size: var(--t-xs); font-weight: 400; color: var(--dim); text-align: left; white-space: nowrap; }
table.wild th.n, table.wild th.trend { text-align: right; }
table.wild th.n { padding-right: var(--s2); }
table.wild td.trend { text-align: right; white-space: nowrap; }
.chg { display: inline-block; min-width: 22px; margin-left: 3px; font-size: var(--t-sm); color: var(--dim); font-variant-numeric: tabular-nums; vertical-align: middle; } /* the change in a year: neutral, since more animals is not always better */
svg.spark { width: 44px; height: 16px; display: inline-block; vertical-align: middle; overflow: visible; }
.page p.sum { color: var(--bone); }
/* a species' name on the census board, in a hunter or prey table, opens its page: plain words that
   underline on hover, like a link, and take focus like a button */
.sp-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.sp-link:hover { text-decoration-color: var(--signal); }
table.wild td.pic[data-act] { cursor: pointer; }

/* ---- a species page ---- */
.sp-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s2); }
.sp-big { flex: none; width: 120px; height: 72px; display: flex; align-items: center; justify-content: center; background: var(--sign-lo); }
.sp-n { font-size: var(--t-lg); }
.sp-n b { font: 600 var(--t-3xl)/1 var(--font-cond); font-stretch: condensed; font-variant-numeric: tabular-nums; }
.sp-st { margin-top: var(--s1); font: 600 var(--t-xl)/1.1 var(--font-cond); font-stretch: condensed; letter-spacing: 0.01em; }
.sp-sum small { color: var(--dim); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.st-up, .st-steady { color: var(--leaf); } .st-down, .st-over { color: var(--signal); } .st-few, .st-none { color: var(--pencil); } /* the word says it; the colour underlines it */
.tags { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s2) 0 var(--s3); }
.tag { padding: 0 6px; border: 1px solid var(--line); font-size: var(--t-xs); line-height: 18px; color: var(--dim); }
.tag.warn { color: var(--pencil); border-color: var(--pencil); }
.sp-acts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); }
.sp-acts .hold { visibility: hidden; } /* Buy keeps its place while Sell waits for its second click */
/* the population over the year: a line over a zero baseline, today marked */
svg.trend-chart { display: block; width: 100%; height: auto; margin-top: var(--s1); }
.trend-chart .grid { stroke: var(--line); stroke-width: 1; }
.trend-chart .area { fill: rgba(156, 204, 114, 0.14); }
.trend-chart .line { fill: none; stroke: var(--leaf); stroke-width: 2; stroke-linejoin: round; }
.trend-chart .now { fill: var(--bone); stroke: var(--sign); stroke-width: 1.5; }
.trend-chart text { font: 400 11px var(--font); fill: var(--dim); font-variant-numeric: tabular-nums; }
.trend-chart .yl { text-anchor: end; }
.page p.minor { margin: 0 0 var(--s1); font-size: var(--t-sm); }
table.sp-table { width: 100%; border-collapse: collapse; margin: var(--s1) 0 var(--s2); font-size: var(--t-md); }
table.sp-table th { padding: 0 var(--s1) var(--s1) 0; border-bottom: 1px solid var(--line); font-size: var(--t-xs); font-weight: 400; color: var(--dim); text-align: left; white-space: nowrap; }
table.sp-table td { padding: 5px var(--s1) 5px 0; border-bottom: 1px solid var(--line); }
table.sp-table .n { text-align: right; font-variant-numeric: tabular-nums; }
table.sp-table th + th, table.sp-table td + td { padding-left: var(--s3); } /* a right-aligned count never runs into the word beside it */
table.sp-table small { color: var(--dim); font-size: var(--t-xs); }
ul.notes { margin: var(--s1) 0 var(--s2); padding-left: var(--s4); color: var(--dim); }
ul.notes li { margin-bottom: var(--s1); max-width: 60ch; }
.page p.facts { color: var(--bone); line-height: 1.55; }
/* milestones: those still to reach, each with its progress; then the ones reached, said in words */
.ms { padding: var(--s2) 0 var(--s3); border-bottom: 1px solid var(--line); }
.ms .row { padding: 0; }
.page .ms p { margin: 2px 0 6px; }
.ms-prog { font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.ms .meter { margin: var(--s1) 0 0; }
.ms.done { display: flex; align-items: flex-start; gap: var(--s2); padding: 6px 0; border: 0; color: var(--dim); }
.ms.done .ic { width: 16px; height: 16px; margin-top: 1px; color: var(--leaf); }
.ms.done b { color: var(--bone); font-weight: 600; }
/* journal filters */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s3); }
.chip { background: transparent; border: 1px solid var(--line); padding: 3px 10px; font-size: var(--t-sm); }
.chip span { margin-left: 2px; color: var(--dim); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--dim); }
.chip[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); color: var(--sign-lo); font-weight: 600; }
.chip[aria-pressed="true"] span { color: var(--sign-lo); }
.log { display: flex; align-items: flex-start; gap: var(--s2); padding: 6px 0 6px 10px; border-left: 4px solid var(--kind, var(--faint)); margin-bottom: var(--s2); font-size: var(--t-md); cursor: default; }
.log small { color: var(--dim); font-size: var(--t-xs); letter-spacing: 0.01em; }
.log[data-tile], .log[data-act] { cursor: pointer; }
.log:hover[data-tile], .log:hover[data-act] { background: var(--sign-hi); }
/* the fire-danger sign: a cream enamel plate with a keyline, the page's one light surface */
.fire-sign { margin: 0 0 var(--s3); padding: var(--s3) var(--s3) var(--s4); background: var(--bone); color: var(--sign-lo); text-align: center; box-shadow: inset 0 0 0 4px var(--bone), inset 0 0 0 6px var(--sign-lo), var(--lift-1); }
.page .fire-sign h3 { margin: var(--s1) 0 var(--s2); font: 700 var(--t-xl)/1.1 var(--font-cond); font-stretch: condensed; color: var(--sign-lo); }
.fire-sign svg { display: block; width: 100%; max-width: 300px; margin: 0 auto; }
.fire-sign [class^="fd-b"] { stroke: var(--sign-lo); stroke-width: 1.5; stroke-linejoin: round; }
.fd-b0 { fill: var(--fd0); } .fd-b1 { fill: var(--fd1); } .fd-b2 { fill: var(--fd2); } .fd-b3 { fill: var(--fd3); } .fd-b4 { fill: var(--fd4); }
.fire-sign text { font: 600 13px var(--font-cond); fill: var(--sign-lo); }
.fire-sign .fd-t4 { fill: var(--bone); }
.fd-needle, .fd-hub { fill: var(--sign-lo); }
.fd-hub { stroke: var(--bone); stroke-width: 2; }
.fd-word { display: inline-block; margin-top: var(--s2); padding: 1px var(--s4) 2px; font: 700 var(--t-3xl)/1.05 var(--font-cond); font-stretch: condensed; color: var(--sign-lo); border: 2px solid var(--sign-lo); }
.fd-w0 { background: var(--fd0); } .fd-w1 { background: var(--fd1); } .fd-w2 { background: var(--fd2); } .fd-w3 { background: var(--fd3); } .fd-w4 { background: var(--fd4); color: var(--bone); }
/* and its reading in the bar, from Moderate up: a flame in the band's colour, lifted for the dark bar */
#r-fire b { display: flex; align-items: center; gap: 5px; }
#r-fire .ic { width: 15px; height: 15px; color: var(--fdc); }
.fd-l1 { --fdc: var(--sky); } .fd-l2 { --fdc: var(--signal); } .fd-l3 { --fdc: #f39a52; } .fd-l4 { --fdc: #ff6b5c; }
input[type="range"] { width: 100%; accent-color: var(--signal); }
select { background: var(--sign-lo); color: var(--bone); border: 1px solid var(--line); font: inherit; padding: 2px var(--s1); }

/* ---- modal ---- */
#modal { position: fixed; inset: 0; background: rgba(10, 20, 14, 0.66); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 30; }
#modal[hidden] { display: none; }
#modal-card { width: min(760px, 92vw); max-height: 88vh; overflow-y: auto; background: var(--sign); border-top: 6px solid var(--signal); padding: var(--s6) var(--s8) var(--s8); box-shadow: var(--lift-2); }
#modal-card h1 { margin: 0 0 var(--s2); font: 700 var(--t-3xl)/1.1 var(--font-cond); font-stretch: condensed; letter-spacing: 0; color: var(--signal); }
#modal-card h2 { margin: var(--s6) 0 var(--s2); font-size: var(--t-lg); font-weight: 600; }
#modal-card p { color: var(--dim); max-width: 66ch; margin: var(--s2) 0; font-size: var(--t-lg); line-height: 1.5; }
#modal-card p.warn { color: var(--bone); border-left: 4px solid var(--pencil); padding-left: var(--s3); font-size: var(--t-md); }
.choices { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s4) !important; }
.scenarios { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s3); }
.scenarios button { text-align: left; background: var(--sign-lo); border: 1px solid var(--line); padding: var(--s3) var(--s4) var(--s4); }
.scenarios button:hover, .scenarios button[aria-pressed="true"] { border-color: var(--signal); }
.scenarios button[aria-pressed="true"] { background: var(--sign-hi); }
.scenarios b { display: block; font-size: var(--t-xl); font-weight: 600; margin-bottom: var(--s1); }
.scenarios span { color: var(--dim); font-size: var(--t-md); }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); font-size: var(--t-md); }
.keys span:nth-child(odd) { color: var(--signal); }

/* ---- the staff (office.js): the staff office window (your staff, villagers looking for work) and a window for each worker ---- */
.page .win-body .warn { color: var(--signal); } .page .win-body .good { color: var(--leaf); }
.page .win-body p.none { color: var(--bone); }
.otabs { display: flex; margin: 0 0 var(--s4); border-bottom: 1px solid var(--line); }
.otabs button { background: transparent; border: 0; border-bottom: 3px solid transparent; padding: var(--s2) var(--s4); font-size: var(--t-lg); color: var(--dim); }
.otabs button:hover { color: var(--bone); }
.otabs button[aria-pressed="true"] { color: var(--bone); border-bottom-color: var(--signal); font-weight: 600; }
.otabs span { margin-left: 2px; font-variant-numeric: tabular-nums; color: var(--dim); font-weight: 400; }
.ask { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s2); padding: var(--s2) var(--s3); background: var(--sign-lo); border-left: 4px solid var(--signal); font-size: var(--t-md); }
.ask > span:first-child { flex: 1 1 220px; }
.ask .sp-link { font-weight: 600; }
.ask small { display: block; color: var(--dim); font-size: var(--t-sm); }
.acts { white-space: nowrap; text-align: right; }
.acts .btn + .btn { margin-left: var(--s1); }
.roster-wrap { overflow-x: auto; } /* on a narrow screen the table scrolls in its own box */
table.roster { width: 100%; border-collapse: collapse; font-size: var(--t-md); }
table.roster th { padding: 0 var(--s2) var(--s1); border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; font-size: var(--t-xs); color: var(--dim); }
table.roster td { padding: var(--s2); border-bottom: 1px solid var(--line); vertical-align: top; }
table.roster .num { text-align: right; font-variant-numeric: tabular-nums; }
table.roster small { display: block; margin-top: 2px; font-size: var(--t-sm); color: var(--dim); }
table.roster small.bad { color: var(--pencil); } table.roster small.warn { color: var(--signal); }
table.roster td { white-space: nowrap; padding: 6px var(--s2); vertical-align: baseline; } table.roster td:first-child { white-space: normal; min-width: 110px; }
table.roster td.feel small { display: inline; margin-left: 6px; } /* the mood and its reason on one line: a long staff fits more rows */
table.roster .sp-link { font-weight: 600; }
table.roster tbody tr:hover { background: var(--sign-lo); }
/* a heading that sorts: the whole heading is the button, with an arrow on the column in use */
button.sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
button.sort:hover { color: var(--bone); }
button.sort i { display: inline-block; width: 1em; margin-left: 2px; font-style: normal; color: var(--signal); }
th[aria-sort="ascending"] button.sort, th[aria-sort="descending"] button.sort { color: var(--bone); }
.staffwin .filters { margin-bottom: var(--s2); } .staffwin .filters + .roster-wrap, .staffwin .filters + p { margin-top: var(--s3); }
/* a worker's own window */
.wk-job { font: 600 var(--t-xl)/1.2 var(--font-cond); font-stretch: condensed; }
.wk-job small { margin-left: var(--s1); font: 400 var(--t-sm)/1 var(--font); color: var(--dim); }
.page .win-body .wk-head p.wants, .page .win-body .cand p.wants { margin: var(--s2) 0; color: var(--bone); }
.worker .ask { margin-top: var(--s3); }
.worker h3 small.mood { font-weight: 600; }
.worker .row > span:last-child { white-space: nowrap; text-align: right; } /* stars and their word, or a figure, stay on one line beside a label that wraps */
.worker .row.total { margin-top: 2px; padding-top: 3px; border-top: 1px solid var(--line); font-weight: 600; } /* what the reasons above it add up to */
/* the pay buttons, one to a line and all one width: a button that asks "Cut to $1,430?" keeps its box, so the second click lands on it */
.worker .sp-acts { flex-direction: column; flex-wrap: nowrap; align-items: stretch; max-width: 300px; }
.worker .sp-acts .btn { text-align: left; }
/* a button that changes pay or job, with what it would do to their mood at its right-hand end */
.btn.fig { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); text-align: left; }
.btn.fig small { font-size: var(--t-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.btn.fig .figs { display: inline-flex; align-items: baseline; gap: 6px; }
b.risk { color: var(--signal); font-weight: 700; } /* "!": the click may make them walk out at once */
.page .win-body .btn.fig.danger b.risk { color: inherit; }
.page .win-body .btn.fig small.bad { color: #ffa08c; } /* the warning colour, lightened to read at this size on a button's own green (5:1) */
.page .win-body .btn.fig.danger small { color: inherit; } /* (the button is the warning colour itself while it asks) */
table.jobs td.acts .btn.fig { width: 100%; margin: 2px 0; } /* Move at their rate over Keep their pay, the figures in a column */
/* the worker a notice or a journal entry opens: the whole line is clickable, and the name says so */
u.who { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.toast:hover u.who, .log:hover u.who { text-decoration-color: var(--signal); }
table.jobs td { vertical-align: middle; }
table.jobs td.acts { white-space: nowrap; text-align: right; } table.jobs td.acts .btn { margin: 2px 0 2px var(--s1); white-space: nowrap; } /* the two buttons side by side (the worker's window is wide enough for them beside a scrollbar: office.js WK_W); on a phone they wrap, below */
table.jobs th:last-child { text-align: right; white-space: normal; }
table.jobs tr.now td { color: var(--dim); } table.jobs tr.now td:first-child { color: var(--bone); font-weight: 600; }
table.jobs td small { display: block; }
.traits { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s1); }
.trait { padding: 0 6px; border: 1px solid var(--line); font-size: var(--t-xs); line-height: 18px; white-space: nowrap; }
.trait.pro { color: var(--leaf); }
.trait.con { color: var(--pencil); }
.trait.neutral { color: var(--dim); }
.stars { color: var(--signal); letter-spacing: 1px; white-space: nowrap; }
.stars i { font-style: normal; color: var(--line); }
.mood.happy { color: var(--leaf); } .mood.unhappy { color: var(--signal); } .mood.miserable { color: var(--pencil); } /* the word says it; the colour only underlines it */
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s3); } /* one to a row until the window is widened: each card's jobs table needs its width */
.cand { padding: var(--s3) var(--s4) var(--s4); background: var(--sign-lo); border: 1px solid var(--line); }
@media (max-width: 640px) { /* a phone: the table scrolls sideways in its box, the names staying put; the reason for a mood waits for the worker's window */
  table.roster th:first-child, table.roster td:first-child { position: sticky; left: 0; z-index: 1; background: var(--sign); }
  table.roster td.feel small { display: none; }
  table.roster td, table.roster th { padding-left: 6px; padding-right: 6px; }
  table.jobs td.acts { white-space: normal; }
}
.cand h4 { margin: 0; font: 600 var(--t-xl)/1.2 var(--font-cond); font-stretch: condensed; }
.cand table.jobs { margin-bottom: 0; } .cand table.jobs tr:last-child td { border-bottom: 0; }

/* Narrower screens. The bar sheds labels first, then the weather and the brand's name, then the
   rating and health (each one click away in its window), until the compact bar further down takes over
   at 900px (or on a short screen) and brings them back; on tablets
   the logbook buttons and the dock keep their pictograms and say their names on hover (and to
   screen readers); on phones a window is a sheet above the dock and the bar may take two rows. */
@media (max-width: 1180px) {
  .read small { display: none; } .read .inl { display: inline; } /* "Health 89", "6 of 6 guests": the reading names itself */
  #bar { min-height: 44px; }
}
@media (max-width: 1100px) {
  #brand { font-size: 0; gap: 0; }
  #r-weather { display: none; }
  #bar { gap: var(--s3); }
  .read + .read::before { left: calc(var(--s3) / -2); }
  button.read + .read::before, .read + button.read::before { left: calc(var(--s3) / -2 + 6px); }
}
@media (max-width: 900px) {
  #r-rating { display: none; } /* on the Lodge page, beside the guests */
  #speed button { min-width: 34px; padding: 6px var(--s2); }
  #view { --launch-w: 48px; }
  .launch-b span, .dock-b span, #b-menu span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .launch-b { padding: 10px 2px 9px; }
  .dock-b { min-width: 46px; padding: 9px 6px 7px; }
  #mini { width: 160px; height: 112px; }
}
@media (max-width: 820px) {
  #r-health { display: none; } /* on the Overview page */
}
@media (max-width: 760px) {
  #mini { bottom: var(--above-dock); } /* the dock reaches the corner, so the minimap stands above its row */
}
@media (max-width: 640px) {
  #view { --pad-t: 20px; --pad-r: 4px; --pad-b: 4px; --pad-l: 20px; --launch-w: 44px; --above-dock: calc(var(--pad-b) + var(--s1) + var(--dock-h, 52px) + var(--s1)); }
  #bar { flex-wrap: wrap; row-gap: var(--s1); column-gap: 10px; padding: 6px var(--s2); }
  .read + .read::before { display: none; } /* rows wrap, and a divider would start a row */
  #brand, #r-rating, #r-health { display: none; } /* both are a tap away, on the Lodge and Overview pages */
  .read b { font-size: var(--t-lg); }
  #speed { margin-left: auto; }
  #speed button, #b-menu { min-width: 36px; padding: 6px var(--s2); }
  #launch { top: calc(var(--pad-t) + var(--s1)); left: calc(var(--pad-l) + var(--s1)); flex-direction: row; } /* a row across the top, clear of the sheets that rise from the dock */
  .launch-b { padding: 10px 2px; border-left: 0; border-bottom: 3px solid transparent; }
  .launch-b[aria-pressed="true"] { border-bottom-color: var(--signal); }
  .badge { right: 3px; }
  #dock { left: calc(var(--pad-l) + var(--s1)); right: calc(var(--pad-r) + var(--s1)); bottom: calc(var(--pad-b) + var(--s1)); transform: none; }
  .dock-b { flex: 1 1 0; min-width: 0; padding: var(--s2) 2px 6px; }
  #dock .sep { margin: var(--s2) 1px; }
  #ov-box { top: calc(var(--pad-t) + var(--s1)); right: calc(var(--pad-r) + var(--s1)); }
  #b-ov span, #b-ov b, #overlays button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* pictograms; the key below names the overlay that is on */
  #b-ov { padding: 6px 10px; }
  #overlays button { padding: 6px 10px; }
  #overlays .ic { width: 18px; height: 18px; }
  #toasts { z-index: 5; left: calc(var(--pad-l) + var(--s1)); right: calc(var(--pad-r) + var(--s1)); top: calc(var(--pad-t) + var(--s1) + max(50px, var(--ov-h, 32px)) + var(--s2)); width: auto; align-items: stretch; } /* full width under the button row; an open sheet covers them, and the journal keeps them */
  #inspect { left: calc(var(--pad-l) + var(--s1)); right: calc(var(--pad-r) + var(--s1)); width: auto; max-height: 48%; }
  #mini { width: 120px; height: 84px; right: calc(var(--pad-r) + var(--s1)); bottom: var(--above-dock); }
  #hand { max-width: calc(100% - var(--s4)); overflow: hidden; }
  /* a window is a sheet over the lower part of the map, one at a time */
  .win { left: calc(var(--pad-l) + var(--s1)) !important; right: calc(var(--pad-r) + var(--s1)); top: auto !important; bottom: var(--above-dock); width: auto !important; height: auto !important; max-height: 62% !important; max-width: none; resize: none; }
  .win-grip { cursor: default; }
  #palette, #palette.wide { left: calc(var(--pad-l) + var(--s1)) !important; right: calc(var(--pad-r) + var(--s1)); width: auto; max-height: 58%; }
}
@media (pointer: coarse) { /* fingers need bigger targets than a mouse pointer */
  .tool, #speed button, #b-menu, #menu-items button, button.read, #b-ov, #overlays button, .win-x { min-height: 44px; }
  .btn { min-height: 40px; padding: 6px var(--s3); }
  .chip { min-height: 40px; }
  .tool kbd, #hand kbd { display: none; } /* no keyboard to press them on */
  .tool-q { min-height: 44px; width: 44px; justify-content: center; padding: 0; }
  .win { resize: none; }
}
/* The compact bar, on phones and tablets and on any short screen (a phone on its side): smaller figures, no labels
   under them, tight padding, the month cut to three letters, and every reading back, each named in a word where it
   needs one ("Health 88", "2.0 stars"). The speed buttons, the Menu and the readings that open a page look 30px tall
   but answer a finger over 44px: a clear ::after reaches past them (and past the bar's own edges) up and down. */
@media (max-width: 900px), (max-height: 500px) {
  #bar { min-height: 0; flex-wrap: wrap; row-gap: 0; column-gap: 10px; padding: 3px var(--s2); border-top-width: 2px; }
  #brand { display: none; } /* the readings need its room more */
  #r-rating, #r-health, #r-weather { display: flex; }
  .read small { display: none; } .read .inl { display: inline; }
  .read b { font-size: var(--t-lg); line-height: 1.1; }
  #r-date .mo, .wx-full { display: none; }
  .wx-short { display: inline; }
  .read + .read::before { left: -5px; }
  button.read + .read::before, .read + button.read::before { left: 1px; }
  button.read { padding: 3px 6px; }
  #speed button, #b-menu, button.read { min-height: 30px; }
  #speed button { min-width: 32px; padding: 4px 6px; }
  #b-menu { min-width: 36px; padding: 4px var(--s2); }
  #speed button::after, #b-menu::after, button.read::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 44px; margin-top: -22px; }
  #speed button, #b-menu { position: relative; }
}
/* One row from 641px up has no room for every reading at its longest ("−$123,456", "24 of 24 guests", "Very high",
   "30 Sep, year 10"): the rating gives way first (it is on the Lodge page), then health (on the Overview). */
@media (min-width: 641px) and (max-width: 730px) { #r-rating { display: none; } }
@media (min-width: 641px) and (max-width: 660px) { #r-health { display: none; } }
/* a phone upright: two rows, the readings above and the date, weather and controls below, 6px apart, so that each
   row's 44px of touch overlaps the other's as little as can be (the controls, drawn later, keep theirs whole) */
@media (max-width: 640px) {
  #bar { row-gap: 6px; padding-bottom: 4px; }
  #r-date { margin-left: 0; }
}
/* the smallest phones (320px) keep to two rows without the rating and health; from 360px every reading fits two rows
   as a reserve usually reads, and only figures at their longest all at once take a third */
@media (max-width: 340px) { #r-rating, #r-health { display: none; } }
/* The rest of the interface shrinks with the bar, by about the same quarter: the logbook buttons, the build dock and the
   overlay button take 18px pictograms and tighter padding, and what they open (the palettes, the logbook windows and
   phone sheets, the overlay list and its key, the Menu) has tighter rows, title bars and headings. The text stays its
   size. Buttons side by side answer a finger over 44px, as the bar's do; rows stacked in a list are 34-36px, since
   one row's reach could only come out of its neighbour's. */
@media (max-width: 900px), (max-height: 500px) {
  #view { --launch-w: 38px; }
  .launch-b { gap: 2px; padding: 6px 2px 5px; }
  .launch-b .ic, .dock-b .ic { width: 18px; height: 18px; }
  .launch-b::after { content: ''; position: absolute; top: 0; bottom: 0; left: -3px; right: -3px; } /* a column: wider, not taller */
  .badge { top: 1px; right: 1px; min-width: 15px; padding: 0 3px; line-height: 14px; }
  .dock-b { position: relative; min-width: 38px; gap: 2px; padding: 5px 6px 3px; }
  #dock .sep { margin: 6px 2px; }
  #hand { padding: 3px var(--s2) 3px 10px; }
  #b-ov, #overlays button { position: relative; min-height: 30px; padding: 4px 8px; }
  #b-ov { gap: 5px; }
  .dock-b::after, #b-ov::after, #overlays button::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 44px; margin-top: -22px; }
  #legend { width: 200px; padding: 6px 10px var(--s2); }
  #menu-items { min-width: 150px; }
  #menu-items button { min-height: 36px; padding: 6px var(--s3); }
  /* the palettes */
  .pal-bar { padding: var(--s1) var(--s1) var(--s1) var(--s3); }
  .pal-pop { padding: 2px 6px; }
  .pal-note { margin: 6px var(--s3) 0; }
  .tool { min-height: 36px; padding: 5px var(--s3) 5px 10px; }
  .tool.sp { min-height: 34px; padding: 3px 6px 3px 4px; }
  .tool.sp .pic { width: 32px; }
  .tool-q { min-height: 36px; width: 30px; }
  /* windows, and the sheets they are on a phone */
  .win-grip { padding: 4px 10px; }
  .win-grip h2 { font-size: var(--t-md); }
  .win-grip .ic { width: 14px; height: 14px; }
  .win-x { position: relative; min-height: 30px; min-width: 40px; padding: 0 10px; font-size: 20px; } /* the window clips its reach above, so it is wider */
  .win-x::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 44px; margin-top: -22px; }
  .page .win-body { padding: 10px var(--s3) var(--s4); }
  .page .win-body h3 { font-size: var(--t-lg); margin-top: 18px; }
  .btn { min-height: 32px; padding: 3px 10px; }
  .chip { min-height: 30px; padding: 2px var(--s2); }
  .fire-sign { padding: var(--s2) var(--s2) 10px; }
  .page .fire-sign h3 { font-size: var(--t-lg); margin-top: 2px; }
  .fire-sign svg { max-width: 220px; }
  .fd-word { font-size: var(--t-2xl); margin-top: 6px; }
}
/* The notices on the map, and the same news as rows on the Journal page, are tighter too: less padding, a smaller
   pictogram and less room between them, the text its own size. A notice that opens something answers a tap over the
   gaps either side of it as well. */
@media (max-width: 900px), (max-height: 500px) {
  #toasts { gap: 4px; }
  .toast { position: relative; gap: 6px; padding: 6px 10px 6px 8px; border-left-width: 4px; line-height: 1.35; }
  .toast[data-tile]::after { content: ''; position: absolute; left: 0; right: 0; top: -2px; bottom: -2px; }
  .toast .ic, .log .ic { width: 14px; height: 14px; margin-top: 2px; }
  .log { gap: 6px; padding: 4px 0 4px 8px; margin-bottom: 4px; border-left-width: 3px; }
}
/* on a phone upright they start just under the logbook row (now 32px), not a 50px row's height down */
@media (max-width: 640px) {
  #toasts { top: calc(var(--pad-t) + var(--s1) + max(32px, var(--ov-h, 30px)) + 6px); }
}
/* a phone upright: the logbook buttons are a row across the top, so they reach up and down instead */
@media (max-width: 640px) {
  .launch-b { padding: 6px 2px 4px; }
  .launch-b::after { left: 0; right: 0; top: 50%; bottom: auto; height: 44px; margin-top: -22px; }
  .dock-b { padding: 5px 2px 3px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

/* ---- the Demand page (js/panel.js demand): each row is a name with its lines under it and, on the right, how many
   the camp has. The lines wrap in whatever width the window has; the figure keeps to one line. ---- */
.row.dm { padding: var(--s2) 0 6px; border-top: 1px solid var(--line); }
.row.dm > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.row.dm > span:last-child { flex: none; white-space: nowrap; text-align: right; }
.row.dm small.need { margin-top: 2px; line-height: 1.4; }
.page .win-body .row.dm + p { margin-top: var(--s2); }
/* the Demand page's staff table: job names read as words, not as column headings; a shortfall sits under its number */
table.sp-table.need thead th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
table.sp-table.need tbody th { font-size: var(--t-md); font-weight: 600; color: inherit; white-space: normal; padding: 5px var(--s1) 5px 0; vertical-align: top; }
table.sp-table.need td { vertical-align: top; font-weight: 600; }
table.sp-table.need td span { display: block; font-size: var(--t-xs); font-weight: 400; white-space: nowrap; }
table.sp-table.need td small { font-weight: 400; }
/* A seventh logbook button (Demand): on a phone the row of buttons stops short of the overlays button at its right
   (38px wide, 8px from the edge of the map) and the buttons narrow a little to fit, to 40px each on a 360px screen. */
@media (max-width: 640px) {
  #launch { padding: 0; gap: 0; max-width: calc(100% - var(--pad-l) - var(--s1) - var(--pad-r) - var(--s1) - 46px); }
  .launch-b { flex: 0 1 var(--launch-w); min-width: 0; }
}

/* ---- the landing page, a scenario's own page and its result (js/main.js), in the dialog ---- */
#modal-card.landing { width: min(1000px, 96vw); }
.land-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); }
.land-stars { text-align: right; line-height: 1.1; white-space: nowrap; }
.land-stars b { display: block; font: 700 var(--t-3xl)/1 var(--font-cond); font-stretch: condensed; color: var(--signal); }
.land-stars small { color: var(--dim); font-size: var(--t-sm); }
#modal-card h2 small { display: block; font-weight: 400; color: var(--dim); font-size: var(--t-md); margin-top: 2px; }
.scenarios button { position: relative; display: block; min-width: 0; }
.scenarios .pips { position: absolute; top: var(--s3); right: var(--s4); }
.scenarios button b { padding-right: 72px; }
.scenarios em { display: block; margin-top: var(--s2); font-style: normal; font-size: var(--t-sm); color: var(--bone); }
.scenarios button.locked { cursor: default; border-style: dashed; }
.scenarios button.locked b, .scenarios button.locked span { opacity: 0.6; }
.scenarios button.locked:hover { border-color: var(--line); }
.scenarios button.locked em { color: var(--pencil); }
/* stars: won in the signal yellow, not yet won an outline in the faint ink */
.pips { display: inline-flex; gap: 2px; font-size: var(--t-xl); line-height: 1; color: var(--faint); }
.pips i { font-style: normal; }
.pips i.got { color: var(--signal); }
ul.rules { margin: var(--s2) 0; padding-left: var(--s5); color: var(--bone); font-size: var(--t-lg); line-height: 1.5; }
ol.goals { list-style: none; margin: var(--s2) 0; padding: 0; }
ol.goals li { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s2) 0; border-top: 1px solid var(--line); }
ol.goals li > i { flex: none; font-style: normal; font-size: var(--t-2xl); line-height: 1; color: var(--faint); }
ol.goals li.got > i { color: var(--signal); }
ol.goals li.lost b { color: var(--dim); }
ol.goals li span { min-width: 0; }
ol.goals b { display: block; font-size: var(--t-lg); }
ol.goals small { display: block; color: var(--dim); font-size: var(--t-md); font-variant-numeric: tabular-nums; }
.result { display: flex; align-items: center; gap: var(--s4); margin: var(--s2) 0 var(--s3); }
.result .pips { font-size: 44px; }
.result b { font: 700 var(--t-2xl)/1 var(--font-cond); font-stretch: condensed; }
#modal-card p.unlocked { color: var(--signal); }
/* ---- the objectives plate at the head of the map, which is the tutorial's too (js/ui.js updateBrief) ---- */
#brief { position: absolute; z-index: 3; top: calc(var(--pad-t) + var(--s2)); left: calc(var(--pad-l) + var(--launch-w) + var(--s6)); width: 300px;
  max-height: calc(100% - var(--pad-t) - var(--above-dock) - var(--s4)); overflow-y: auto; background: var(--plate); border: 1px solid var(--plate-edge); border-top: 3px solid var(--signal); box-shadow: var(--lift-1); }
.brief-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px var(--s2); width: 100%; background: none; border: 0; padding: 6px var(--s3); text-align: left; }
.brief-h:hover { background: var(--sign-hi); }
.brief-h b { font-size: var(--t-lg); }
.brief-h small { color: var(--dim); font-size: var(--t-sm); margin-left: auto; }
.brief-h .pips { font-size: var(--t-lg); align-self: center; }
#brief ol.goals { margin: 0; padding: 0 var(--s3) var(--s1); }
#brief ol.goals li { padding: 6px 0; gap: var(--s2); }
#brief ol.goals li > i { font-size: var(--t-xl); }
#brief ol.goals b { font-size: var(--t-md); }
#brief ol.goals small { font-size: var(--t-sm); }
.brief-b { padding: 0 var(--s3) var(--s3); }
.brief-b p { margin: var(--s1) 0 var(--s2); color: var(--dim); }
.brief-b p.how { color: var(--bone); border-left: 3px solid var(--signal); padding-left: var(--s2); }
.brief-b .choices { margin-top: var(--s2) !important; }
/* a kind of animal this scenario will not sell */
.tool.nobuy { opacity: 0.5; }
.tool.nobuy .name { text-decoration: line-through; }
/* a phone upright: the dialog takes nearly the whole screen and its cards one column; the plate is a strip under the
   logbook row, folded to its heading until asked for, and the notices start below it (--brief-h: js/ui.js) */
@media (max-width: 640px) {
  #modal-card { width: 96vw; max-height: 94vh; padding: var(--s4) var(--s4) var(--s5); }
  #modal-card h1 { font-size: var(--t-2xl); }
  #modal-card p, ul.rules, ol.goals b { font-size: var(--t-md); }
  .scenarios { grid-template-columns: 1fr; gap: var(--s2); }
  .scenarios button { padding: var(--s2) var(--s3) var(--s3); }
  .scenarios .pips { top: var(--s2); right: var(--s3); }
  .scenarios b { font-size: var(--t-lg); }
  .choices .btn { flex: 1 1 auto; }
  /* the ways on are pressed with a thumb */
  #modal-card .choices .btn, #brief .choices .btn { min-height: 44px; }
  #brief { z-index: 5; left: calc(var(--pad-l) + var(--s1)); right: calc(var(--pad-r) + var(--s1)); width: auto; top: calc(var(--pad-t) + var(--s1) + 32px + 6px); max-height: 52%; }
  #toasts { top: calc(var(--pad-t) + var(--s1) + max(32px, var(--ov-h, 30px)) + 6px + var(--brief-h, 0px)); }
}
/* a phone on its side: the dialog uses the height there is */
@media (max-height: 500px) {
  #modal-card { max-height: 94vh; padding: var(--s3) var(--s5) var(--s4); }
  #modal-card h2 { margin-top: var(--s3); }
  #modal-card .choices .btn, #brief .choices .btn { min-height: 40px; }
  #brief { width: 270px; }
}
