/* The office uses the host's spacing, colours and type scale. The stage is the page, and each of its
   edges has one job: the head above it sees and hears, the floors on its left say where, the tabs on its
   right show who and what happened, and under it the dock acts. */
.world-wrap { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.world-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); }
.world-head h1 { margin: 0; font-size: var(--fs-h1); }
.world-head > .world-bar { margin-left: auto; }
/* A row of controls: the head's, the dock's rows You and Say, the edit bar. It wraps between
   controls, never inside a button. */
.world-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); min-width: 0; margin: 0; }
.world-bar label { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1); margin: 0; }
.world-bar select, .world-bar input { width: auto; max-width: min(20rem, 100%); margin: 0; }
.world-bar button, .world-bar .btn { white-space: nowrap; }
/* A submit button in a row of controls sizes to its label, as its neighbours do. */
.world-bar [type=submit] { width: auto; margin-bottom: 0; }
/* The places: the stage takes the height the head and the dock leave, and never less than a
   usable view; the floors run down its left, and the tabs down its right. The dock
   keeps one height and scrolls inside it, so a status or a row shown never resizes the view. */
.world-row {
	display: grid;
	grid-template-columns: max-content minmax(0, 3fr) minmax(18rem, 1fr);
	grid-template-rows: minmax(16rem, 1fr) auto;
	grid-template-areas: "floors stage side" "floors dock side";
	gap: var(--s-2) var(--s-3);
}
@media screen and (min-width: 901px) {
	.content.content-fill > .world-wrap { flex: 1 1 auto; min-height: 0; }
	.content.content-fill .world-row { flex: 1 1 auto; min-height: 0; }
	.content.content-fill .world-dock { height: 12rem; overflow-y: auto; }
	.content.content-fill .world-wrap:fullscreen .world-dock { height: auto; }
	.content.content-fill .world-events { min-height: 0; }
}
/* The dock: the rows You and Say, or the edit bar in their place, and last the status line, whose
   hint and result each take no room while they have nothing to say. */
.world-dock { grid-area: dock; display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.world-dock > p { display: flex; flex-wrap: wrap; column-gap: var(--s-3); margin: 0; }
#world-office-size input { width: 7rem; }
/* The edit bar's rows: the selection with its actions, the office's size, the furniture chips. */
#world-office-size > .world-bar { flex-basis: 100%; }
.world-3d-host[data-vr="true"] .w3d-labels,
.world-3d-host[data-vr="true"] .w3d-hud,
.world-3d-host[data-vr="true"] .w3d-eyes,
.world-3d-host[data-vr="true"] .w3d-call-hud { display: none; }
.world-3d-host[data-camera-mode="eyes"] .w3d-canvas,
.world-3d-host[data-camera-mode="free"] .w3d-canvas { cursor: crosshair; }
.world-3d-host[data-camera-mode="call"] .w3d-canvas { cursor: grab; }
.world-3d-host[data-camera-mode="call"] .w3d-hud { display: none; }
.world-3d-host[data-camera-mode="eyes"] .w3d-area,
.world-3d-host[data-camera-mode="free"] .w3d-area,
.world-3d-host[data-camera-mode="call"] .w3d-area,
.world-3d-host[data-camera-mode="eyes"] .w3d-desk,
.world-3d-host[data-camera-mode="free"] .w3d-desk,
.world-3d-host[data-camera-mode="call"] .w3d-desk,
.world-3d-host[data-camera-mode="call"] .w3d-room-status,
.world-3d-host[data-camera-mode="call"] .w3d-name { display: none; }
/* Conference Call mode HUD: sleek video-call frame showing desk webcam status, participant name,
   live emotion readout, quick expression previews and camera switch buttons. */
.w3d-call-hud {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 12px 16px;
	pointer-events: none;
	font-family: var(--ops-mono);
	color: #e6f6ff;
	background: linear-gradient(to bottom, rgba(2, 8, 16, 0.55) 0%, transparent 18%, transparent 78%, rgba(2, 8, 16, 0.72) 100%);
}
.w3d-call-hud[hidden] { display: none; }
.w3d-call-top, .w3d-call-bottom {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: space-between;
}
/* Leave the top-left canvas ☰ MENU tab clear of the webcam status pill. */
.w3d-call-top { padding-left: 112px; }
.w3d-call-source, .w3d-call-emotion {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 9px;
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	background: rgba(2, 8, 16, 0.76);
	border: 1px solid rgba(95, 212, 255, 0.45);
	border-radius: 999px;
}
.w3d-call-source::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #3ddc84;
	box-shadow: 0 0 8px #3ddc84;
}
.w3d-call-emotion { border-color: rgba(245, 199, 107, 0.55); color: #ffe8b8; }
.w3d-call-actions, .w3d-call-emotions {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	pointer-events: auto;
}
.w3d-call-btn, .w3d-call-pill {
	margin: 0;
	padding: 3px 9px;
	font-family: var(--ops-mono);
	font-size: 0.66rem;
	letter-spacing: 0.04em;
	color: #d8f3ff;
	background: rgba(4, 14, 26, 0.8);
	border: 1px solid rgba(95, 212, 255, 0.4);
	border-radius: 4px;
	cursor: pointer;
	width: auto;
}
.w3d-call-btn:hover, .w3d-call-pill:hover { background: rgba(95, 212, 255, 0.2); border-color: var(--ops-cyan); }
.w3d-call-pill[aria-pressed="true"] { background: rgba(95, 212, 255, 0.28); border-color: var(--ops-cyan); color: #ffffff; }
.w3d-call-meta { display: flex; flex-direction: column; gap: 1px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.w3d-call-name { font-size: 0.92rem; letter-spacing: 0.03em; color: #ffffff; }
.w3d-call-role { font-size: 0.68rem; color: rgba(200, 232, 250, 0.82); }
/* A company's hierarchy: the owner on top, then every position as a slot, children below their
   boss with connector lines, as an org chart. Wide hierarchies scroll sideways. */

/* Left of the stage: the World page's building and floor choosers, and the guest view's list of buildings. The
   selectors match Pico's nav rules (nav, nav ol:first-of-type, nav li, nav li a) so they win
   on specificity instead of Pico spreading the list down the column and centring each entry. */
nav.world-floors { grid-area: floors; display: flex; flex-direction: column; justify-content: flex-start; gap: var(--s-2); min-width: 0; }
.world-floors-building { display: flex; flex-direction: column; gap: var(--s-1); margin: 0; }
.world-floors .world-floors-list { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-1); margin: 0; padding: 0; list-style: none; }
.world-floors-list li { display: block; padding: 0; }
.world-floor-link {
	display: grid;
	margin: 0;
	grid-template-columns: 2.5em minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--s-2);
	padding: var(--s-1) var(--s-2);
	border: 1px solid var(--line-2);
	border-radius: var(--r-2);
	color: var(--fg-0);
	text-decoration: none;
}
.world-floor-link:hover { background: var(--bg-2); }
.world-floor-people { color: var(--fg-2); font-size: var(--fs-tiny); white-space: nowrap; }
/* The stage holds the 3D view and what belongs to the scene over it: the EDITING badge and the profile. */
.world-stage { grid-area: stage; min-width: 0; position: relative; display: flex; flex-direction: column; }
/* The view fills the stage; its height is what it takes in a page that scrolls, one column wide. */
.world-3d-host {
	position: relative;
	flex: 1 1 auto;
	width: 100%;
	height: clamp(18rem, calc(100dvh - 26rem), 40rem);
	min-height: 0;
	border: 1px solid #12384a;
	border-radius: var(--r-2);
	background: #02060c;
	overflow: hidden;
	--ops-cyan: #5fd4ff;
	--ops-muted: #94a3b8;
	--ops-ink: rgba(2, 8, 16, 0.78);
	--ops-mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}
/* The guest view (/World/Live): the name and Sign in over the World page's three places, buildings, the outside view and
   the information; one column under 1024 px, the building picker first and the view at 4:3. */
.world-guest-head { justify-content: space-between; padding: var(--s-2) var(--s-3); }
.world-guest-soon { padding: var(--s-3); max-width: 40rem; }
.world-guest-row {
	grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr) minmax(18rem, 22.5rem);
	grid-template-rows: minmax(16rem, auto);
	grid-template-areas: "floors stage side";
	padding: 0 var(--s-3) var(--s-3);
}
.world-guest-row .world-side { overflow: auto; }
.world-guest-building { width: 100%; grid-template-columns: minmax(0, 1fr); gap: 0; text-align: left; }
/* A floor's repositories line up with its other lines: a list without Pico's indent or bullets. */
.world-guest-floor ul { padding-inline-start: 0; list-style: none; }
.world-guest-floor ul li { margin-inline-start: 0; padding-inline-start: 0; list-style: none; }
.world-guest-picker { display: none; }
/* One cue for a state, the dot: bright when a sign is lit or someone works, dark otherwise. */
.world-guest-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #39424e; vertical-align: middle; }
[data-lit="true"] > .world-guest-dot, [data-working="true"] > .world-guest-dot { background: #43d17a; }
@media (max-width: 1023px) {
	.world-guest-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "floors" "stage" "side"; }
	.world-guest-picker { display: flex; flex-direction: column; gap: var(--s-1); }
	.world-guest-row .world-floors-list { display: none; }
	.world-guest-row .world-3d-host { height: auto; aspect-ratio: 4 / 3; }
	.world-guest-row .world-side { overflow: visible; max-height: none; }
}
.world-3d-host:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.w3d-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.w3d-canvas:active { cursor: grabbing; }
.world-editing .w3d-canvas { cursor: crosshair; }
/* Its own stacking layer, so the labels' depth order never lifts a tag over the character panel. */
.w3d-labels { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
/* A tracked person's tag, as on a surveillance display: monospace capitals on dark glass, a cyan bar. */
.w3d-name {
	margin: 0;
	padding: 1px var(--s-2);
	border: 0;
	border-left: 2px solid var(--ops-cyan);
	border-radius: 0;
	background: var(--ops-ink);
	color: #d8f3ff;
	font-family: var(--ops-mono);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.5;
	max-width: 11rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	pointer-events: auto;
	cursor: pointer;
}
.w3d-name[aria-pressed="true"],
.w3d-name[data-speaking] { outline: 1px solid var(--ops-cyan); background: rgba(95, 212, 255, 0.18); }
.w3d-name[data-connected="false"] { color: var(--ops-muted); border-left-color: currentColor; }
/* The name of an area of the floor plan, written on the floor in its corner. */
.w3d-area {
	color: rgba(127, 227, 255, 0.75);
	font-family: var(--ops-mono);
	font-size: 0.62rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	white-space: nowrap;
	pointer-events: none;
}
.w3d-room {
	padding: var(--s-1);
	background: color-mix(in srgb, var(--bg-1) 45%, transparent);
	color: var(--fg-0);
	font-size: var(--fs-tiny);
	border-radius: var(--r-1);
}
/* A meeting room's status over its area: free, or in use with what for and until when. */
.w3d-room-status {
	padding: 1px var(--s-2);
	border: 1px solid rgba(95, 212, 255, 0.45);
	background: var(--ops-ink);
	color: rgba(216, 243, 255, 0.85);
	font-family: var(--ops-mono);
	font-size: 0.6rem;
	letter-spacing: 0.08em;
	white-space: nowrap;
	pointer-events: none;
}
.w3d-room-status.in-use { border-color: #ffb347; color: #ffd9a3; box-shadow: 0 0 8px rgba(255, 179, 71, 0.45); }
/* A desk's code on the floor in front of it, shown when the camera is close. */
.w3d-desk {
	color: rgba(216, 243, 255, 0.7);
	font-family: var(--ops-mono);
	font-size: 0.55rem;
	letter-spacing: 0.08em;
	pointer-events: none;
}
.w3d-far .w3d-desk,
.w3d-distant .w3d-labels { visibility: hidden; }
/* A line said aloud, as an intercepted transmission. */
.w3d-speech {
	max-width: 15rem;
	padding: var(--s-1) var(--s-2);
	border: 1px solid rgba(95, 212, 255, 0.55);
	border-radius: 0;
	background: var(--ops-ink);
	color: #e6f8ff;
	font-family: var(--ops-mono);
	font-size: 0.7rem;
	line-height: 1.35;
}
/* A bubble starts with its speaker's name (data-name), set apart from the line in cyan. */
.w3d-speech::before { content: attr(data-name) ": "; color: var(--ops-cyan); font-weight: 600; }
.w3d-speech[hidden] { display: none; }
/* The display's frame over the 3D view: corner brackets and the readouts (the scan lines are drawn
   in the 3D frame itself, on whole device pixels). */
.w3d-hud {
	position: absolute;
	inset: 0;
	pointer-events: none;
	color: rgba(127, 227, 255, 0.85);
	font-family: var(--ops-mono);
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	background:
		linear-gradient(var(--ops-cyan), var(--ops-cyan)) top 10px left 10px / 18px 1px,
		linear-gradient(var(--ops-cyan), var(--ops-cyan)) top 10px left 10px / 1px 18px,
		linear-gradient(var(--ops-cyan), var(--ops-cyan)) top 10px right 10px / 18px 1px,
		linear-gradient(var(--ops-cyan), var(--ops-cyan)) top 10px right 10px / 1px 18px,
		linear-gradient(var(--ops-cyan), var(--ops-cyan)) bottom 10px left 10px / 18px 1px,
		linear-gradient(var(--ops-cyan), var(--ops-cyan)) bottom 10px left 10px / 1px 18px,
		linear-gradient(var(--ops-cyan), var(--ops-cyan)) bottom 10px right 10px / 18px 1px,
		linear-gradient(var(--ops-cyan), var(--ops-cyan)) bottom 10px right 10px / 1px 18px;
	background-repeat: no-repeat;
}
.w3d-hud > span { position: absolute; text-shadow: 0 0 6px rgba(95, 212, 255, 0.6); }
.w3d-hud-feed { top: 16px; left: 36px; }
.w3d-hud-feed::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #ff4d5e; box-shadow: 0 0 6px #ff4d5e; animation: w3d-rec 2s steps(2, jump-none) infinite; }
.w3d-hud-clock { top: 16px; right: 36px; }
.w3d-hud-tracked { bottom: 16px; left: 36px; }
.w3d-hud-cursor { bottom: 16px; right: 36px; }
@keyframes w3d-rec { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .w3d-hud-feed::before { animation: none; } }
/* The display through an AI employee's eyes (world3d/eyes.js), over the view's frame: the compass along the top with
   the heading and the tile, the employee's own state at the left and what it hears at the right, and the people in
   view in corner brackets. Thin lines and small capitals in the display's cyan, every text on dark glass, the picture
   darkening only at its edges; it catches no click. */
.w3d-eyes {
	--degree: 4px;   /* the compass tape's pixels per degree */
	position: absolute;
	inset: 0;
	pointer-events: none;
	color: rgba(127, 227, 255, 0.85);
	font-family: var(--ops-mono);
	font-size: 0.68rem;
	letter-spacing: 0.06em;
	line-height: 1.45;
	background: radial-gradient(ellipse at center, transparent 62%, rgba(2, 6, 12, 0.5) 100%);
}
.w3d-eyes[hidden] { display: none; }
.w3d-eyes b { font-weight: 600; }
/* The compass: a tape of degrees under the heading's mark, fading out at both ends. */
.w3d-eyes-compass {
	position: absolute;
	top: 10px;
	left: 50%;
	width: clamp(10rem, 34%, 22rem);
	height: 26px;
	translate: -50% 0;
	overflow: hidden;
	border-bottom: 1px solid rgba(95, 212, 255, 0.45);
	background: var(--ops-ink);
	-webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
}
.w3d-eyes-compass::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 1px;
	height: 14px;
	background: #e6f8ff;
	box-shadow: 0 0 6px var(--ops-cyan);
}
.w3d-eyes-tape {
	position: absolute;
	inset: 0 auto 0 50%;
	width: calc(720 * var(--degree) + 1px);
	translate: calc((var(--heading, 0) + 180) * var(--degree) * -1) 0;
	background:
		repeating-linear-gradient(to right, rgba(127, 227, 255, 0.5) 0 1px, transparent 1px calc(5 * var(--degree))) left bottom / 100% 5px no-repeat,
		repeating-linear-gradient(to right, var(--ops-cyan) 0 1px, transparent 1px calc(15 * var(--degree))) left bottom / 100% 9px no-repeat;
}
.w3d-eyes-tape > * {
	position: absolute;
	top: 1px;
	left: calc(var(--at) * var(--degree));
	translate: -50% 0;
	font-size: 0.6rem;
	line-height: 1.2;
}
.w3d-eyes-tape > b { color: #e6f8ff; }
.w3d-eyes-readout {
	position: absolute;
	top: 40px;
	left: 50%;
	display: flex;
	gap: var(--s-2);
	margin: 0;
	padding: 0 var(--s-2);
	translate: -50% 0;
	background: var(--ops-ink);
	text-transform: uppercase;
	white-space: nowrap;
}
.w3d-eyes-readout b { color: #e6f8ff; }
/* A block of values at a side of the view, each label before its value; a line heard runs across it, as the bubble
   over its speaker writes it. */
.w3d-eyes-block {
	position: absolute;
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 1px var(--s-2);
	max-width: min(19rem, 40%);
	padding: var(--s-1) var(--s-2);
	border-left: 2px solid var(--ops-cyan);
	background: var(--ops-ink);
}
.w3d-eyes-self { top: 100px; left: 12px; }
.w3d-eyes-hearing { right: 12px; bottom: 40px; }
.w3d-eyes-block > b { grid-column: 1 / -1; color: var(--ops-cyan); letter-spacing: 0.14em; text-transform: uppercase; }
.w3d-eyes-row { display: contents; }
.w3d-eyes-row > b { color: var(--ops-muted); font-weight: 400; text-transform: uppercase; }
.w3d-eyes-row > span { min-width: 0; overflow: hidden; color: #d8f3ff; text-overflow: ellipsis; white-space: nowrap; }
.w3d-eyes-row > span:only-child {
	display: -webkit-box;
	grid-column: 1 / -1;
	color: #e6f8ff;
	white-space: normal;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
}
.w3d-eyes-row > span:only-child::before { content: "> "; color: var(--ops-cyan); }
/* A person in view: corner brackets that follow them, brighter around the target, with a caption under them (3 pixels
   below, as eyes.js keeps room for it). */
.w3d-eyes-target {
	--line: rgba(95, 212, 255, 0.6);
	position: absolute;
	top: 0;
	left: 0;
	background:
		linear-gradient(var(--line), var(--line)) left top / 10px 1px,
		linear-gradient(var(--line), var(--line)) left top / 1px 10px,
		linear-gradient(var(--line), var(--line)) right top / 10px 1px,
		linear-gradient(var(--line), var(--line)) right top / 1px 10px,
		linear-gradient(var(--line), var(--line)) left bottom / 10px 1px,
		linear-gradient(var(--line), var(--line)) left bottom / 1px 10px,
		linear-gradient(var(--line), var(--line)) right bottom / 10px 1px,
		linear-gradient(var(--line), var(--line)) right bottom / 1px 10px;
	background-repeat: no-repeat;
}
.w3d-eyes-target[hidden] { display: none; }
.w3d-eyes-target[data-target="true"] { --line: #e6f8ff; }
.w3d-eyes-caption {
	position: absolute;
	top: calc(100% + 3px);
	left: 0;
	display: grid;
	margin: 0;
	padding: 0 var(--s-1);
	background: var(--ops-ink);
	color: #d8f3ff;
	font-size: 0.62rem;
	white-space: nowrap;
}
.w3d-eyes-target[data-end="true"] > .w3d-eyes-caption { right: 0; left: auto; }
.w3d-eyes-caption b { color: var(--ops-cyan); text-transform: uppercase; }
.w3d-eyes-caption > span + span { max-width: 18rem; overflow: hidden; color: rgba(216, 243, 255, 0.75); text-overflow: ellipsis; }
/* On a phone the compass stands under the frame's top line, beside the menu tab. */
@media (max-width: 600px) {
	.w3d-eyes-compass { top: 34px; }
	.w3d-eyes-readout { top: 64px; }
}
/* At 900 pixels and narrower each block keeps its most important line; the brackets and the compass stay. */
@media (max-width: 900px) {
	.w3d-eyes-block > b,
	.w3d-eyes-row:not([data-primary]) { display: none; }
}
/* With reduced motion asked for only the brackets move: the heading stays, in figures, without its tape. */
@media (prefers-reduced-motion: reduce) {
	.w3d-eyes-compass { display: none; }
	.w3d-eyes-readout { top: 10px; }
}
@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
	.w3d-eyes-readout { top: 34px; }
}
.w3d-error { position: absolute; inset: auto var(--s-3) var(--s-3); padding: var(--s-2); background: var(--bg-1); color: var(--err); }
/* Fill window keeps every place; fullscreen keeps the head, the stage and the dock's row You (or the
   edit bar while editing) with the status line, at the full width. */
.world-wrap:fullscreen,
.world-wrap.world-fill {
	position: fixed;
	inset: 0;
	z-index: 100;
	width: 100%;
	height: 100dvh;
	padding: var(--s-3);
	background: var(--bg-1);
	overflow: auto;
}
.world-wrap:fullscreen .world-row {
	flex: 1 1 auto;
	min-height: 0;
	grid-template-columns: minmax(0, 1fr);
	grid-template-rows: minmax(16rem, 1fr) auto;
	grid-template-areas: "stage" "dock";
}
.world-wrap:fullscreen :is(.world-floors, .world-side, .world-say-form, #world-fill) { display: none; }
/* The board shown large (world.js, showBoard): the slide letterboxed on black, or the live step's page, over the whole
   screen, with the card's line and controls under it. */
#world-board {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
	padding: var(--s-2);
	background: var(--bg-1);
}
#world-board[hidden] { display: none; }
#world-board > :is(img, iframe) { flex: 1 1 auto; min-height: 0; width: 100%; height: auto; margin: 0; border: 0; }
#world-board > img { object-fit: contain; background: #000; }
/* The presentation's own page, which takes no pointer or focus; while it loads it waits unseen behind the still. */
#world-board-deck { background: #000; pointer-events: none; }
#world-board-deck[data-loading] { position: absolute; inset: 0; height: 100%; visibility: hidden; }
#world-board > p { margin: 0; }
/* A live step's page looks like the site itself, so the board frames it and puts its line and its way out above it, large;
   the page takes no pointer or focus (inert), so Esc and the buttons stay the board's. */
#world-board[data-live-page] > :is(p, #world-board-actions) { order: -1; }
#world-board[data-live-page] > p { font-size: 1.25rem; font-weight: 600; }
#world-board[data-live-page] > iframe { border: 3px solid var(--accent); }
#world-profile { width: min(30rem, calc(100vw - 2rem)); padding: 0; }
/* The character panel: docked over the right of the office, which stays live beside it. The
   selectors outrank Pico's dialog, which would otherwise make it a full-screen dimmed overlay. */
dialog#world-profile[open]:not(:modal) {
	position: absolute;
	inset: var(--s-2) var(--s-2) auto auto;
	width: min(22rem, 48%);
	min-width: 0;
	height: auto;
	min-height: 0;
	max-height: calc(100% - 2 * var(--s-2));
	margin: 0;
	z-index: 6;
	display: flex;
	align-items: stretch;
	background: transparent;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	animation: none;
}
dialog#world-profile[open]:not(:modal) > article {
	max-width: none;
	max-height: none;
	margin: 0;
	overflow-y: auto;
	flex: 1;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
#world-profile article { margin: 0; padding: var(--s-4); max-height: 85dvh; overflow-y: auto; }
.world-profile-portrait {
	display: block;
	width: 100%;
	height: 13rem;
	border-radius: var(--r-2);
	background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
}
#world-profile-card h3 { margin: var(--s-3) 0 var(--s-1); font-size: var(--fs-small, 0.9rem); }
#world-profile-card p { margin: 0 0 var(--s-1); overflow-wrap: anywhere; }
.world-profile-activity { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s-1); font-size: var(--fs-tiny); }
.world-profile-activity i { width: 1.2em; text-align: center; color: var(--accent); }
/* What a person just did outside the World: a small icon over their head that fades. */
.w3d-activity {
	display: grid;
	place-items: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	background: var(--accent);
	color: var(--bg-1);
	font-size: 0.8rem;
	box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent);
	animation: w3d-activity 8s ease-out forwards;
	pointer-events: none;
}
.w3d-activity[data-busy="true"] { animation: none; }
.w3d-activity[hidden] { display: none; }
@keyframes w3d-activity { 0% { opacity: 0; transform: translateY(6px); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
#world-profile header { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); justify-content: space-between; }
.world-profile-picture { display: block; width: 100%; max-width: 13.75rem; aspect-ratio: 1; margin: 0 auto var(--s-2); object-fit: cover; border: 1px solid var(--line-2); border-radius: var(--r-2); }
#world-profile h2 { margin: 0; }
#world-profile .world-invite-btn { position: static; font-size: inherit; }
#world-profile-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); position: sticky; bottom: 0; padding-block: var(--s-2); background: inherit; }
.world-profile-edit { margin-top: var(--s-3); }
.world-profile-edit > summary { cursor: pointer; font-size: var(--fs-small, 0.9rem); color: var(--fg-2); }
.world-name-link { padding: 0; margin: 0; border: 0; background: transparent; color: var(--accent); font-size: inherit; }
.world-name-link[data-connected="false"] { color: var(--fg-2); }
@media (max-width: 600px) {
	dialog#world-profile[open]:not(:modal) { width: min(22rem, calc(100% - 2 * var(--s-2))); }
}
/* One column in the order of the places: head, floors as a row, stage, dock, tabs. */
@media (max-width: 900px) {
	.world-row { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "floors" "stage" "dock" "side"; }
	.world-floors .world-floors-list { flex-flow: row wrap; }
	.world-side { max-height: 28rem; }
}
/* Turn markers divide the feed without adding full-height rows. */
.world-events li.world-turn-divider { padding: 2px 0; border: 0; color: var(--fg-2); font-size: 0.85em; text-align: center; }
/* The EDITING badge pinned to the stage while the office is edited, under the scene's own LIVE line;
   wireEditMode's setEdit() in world.js shows it with the .world-editing class. */
.world-edit-badge {
	position: absolute;
	top: 2.5rem;
	left: var(--s-3);
	z-index: 2;
	padding: 1px var(--s-2);
	border-radius: var(--r-pill);
	background: var(--accent-soft);
	color: var(--accent);
	font-size: var(--fs-tiny);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	pointer-events: none;
}

/* The tabs right of the stage, as tall as the stage and the dock; each pane scrolls. */
.world-side {
	grid-area: side;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
}

.world-net {
	display: flex;
	align-items: center;
	gap: var(--s-2);
	padding: var(--s-1) var(--s-3);
	border: 1px solid var(--line-1);
	border-radius: var(--r-2);
	background: var(--bg-2);
	font-size: var(--fs-tiny);
	font-variant-numeric: tabular-nums;
	color: var(--fg-1);
}

.world-net .led {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #39424e;
	transition: background-color 120ms ease-out;
}

.world-net .led.tx-on { background: #ffb300; }
.world-net .led.rx-on { background: #43d17a; }

.world-legend {
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
	padding: var(--s-2) var(--s-3);
	border: 1px solid var(--line-1);
	border-radius: var(--r-2);
	background: var(--bg-2);
	font-size: var(--fs-tiny);
	color: var(--fg-1);
}

/* One group of the legend (people, departments) under its own small heading. */
.world-legend-group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-1) var(--s-3);
}

.world-legend-group > .meta { flex-basis: 100%; }
.world-legend [data-connected="false"] { color: var(--fg-2); }

/* An edit bar chip that is armed: the next tile clicked places its furniture or turns a chair. */
.world-legend-placeable[aria-pressed="true"] {
	background: var(--accent-soft);
	color: var(--accent);
}

/* A colour key: in the legend, on a furniture chip, on a person's row. */
.swatch {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 2px;
	margin-right: var(--s-1);
	vertical-align: baseline;
}

.swatch.round {
	border-radius: 50%;
}
/* A character's profile picture in the office directory, ringed in their role colour. */
.world-cast-face { width: 1.6rem; height: 1.6rem; margin-right: var(--s-1); border: 2px solid; border-radius: 50%; object-fit: cover; vertical-align: middle; }
/* Who is talking now (world.js, showSpeaker): the office directory's rows over the office's bottom left, above the
   frame's readout and clear of the character panel on the right, the newest on top. The picture spans the name and the
   title; a row fades once its line has ended and comes back at once when the person speaks again. */
#world-speakers {
	position: absolute;
	left: var(--s-3);
	bottom: 2.5rem;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: var(--s-1);
	max-width: min(24rem, calc(100% - 2 * var(--s-3)));
	pointer-events: none;
}
#world-speakers .world-cast-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	column-gap: var(--s-2);
	margin: 0;
	background: var(--bg-1);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
	font-size: var(--fs-small, 0.9rem);
}
#world-speakers :is(.world-cast-face, .swatch) { grid-row: span 2; width: 2.75rem; height: 2.75rem; margin: 0; }
#world-speakers .world-cast-detail { color: var(--fg-2); font-size: var(--fs-tiny); }
#world-speakers .world-cast-row > .meta { grid-column: 2; }
#world-speakers .world-cast-row[data-ended] { opacity: 0; transition: opacity 0.8s ease 0.6s; }
@media (prefers-reduced-motion: reduce) { #world-speakers .world-cast-row[data-ended] { transition: none; } }

.world-events {
	list-style: none;
	margin: 0;
	padding: var(--s-3);
	border: 1px solid var(--line-1);
	border-radius: var(--r-2);
	background: var(--bg-2);
	flex: 1 1 auto;
	min-height: 120px;
	overflow-y: auto;
	font-size: var(--fs-tiny);
	color: var(--fg-1);
	display: flex;
	flex-direction: column;
	gap: var(--s-1);
}

.world-events li {
	padding: var(--s-1) 0;
	border-bottom: 1px solid var(--line-1);
	/* Rows are separated by their border already — any marker the host
	   stylesheet injects just crowds the left wall. */
	list-style: none;
}

.world-events li::marker {
	content: none;
}

.world-events li::before {
	content: none;
}

/* Tiny muted send-time on feed and speech rows. */
.world-time {
	color: var(--fg-2);
	font-size: 0.85em;
	margin-right: var(--s-1);
	font-variant-numeric: tabular-nums;
}

.world-events li:last-child {
	border-bottom: none;
}

/* The dock's row Say: whom to (Send to, or Speak to and Loudness) beside the message, its sending
   controls and the gestures. */
.world-say-form {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-3);
	margin: 0;
}
.world-say-recipients, .world-say-message {
	flex: 1 1 16rem;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
}
.world-say-message { flex-grow: 2; }
#world-local-audience .meta { flex-basis: 100%; margin: 0; }
.world-audience-options:not([hidden]) {
	display: grid;
	gap: var(--s-3);
	max-height: min(24rem, 35dvh);
	overflow-y: auto;
}
.world-audience-options fieldset { min-width: 0; margin: 0; }
.world-audience-options details details { margin-inline-start: var(--s-3); }
.world-audience-options label { overflow-wrap: anywhere; }
.world-audience-options input[type="checkbox"] { margin-inline-end: var(--s-1); }

#world-say {
	flex: 1 1 12rem;
	min-width: 0;
	max-width: none;
}

/* ---- Approval-route progress strip (metro line) ---- */
/* Colour, spacing, type, and radii come from the host tokens (site.css) per
   this file's header contract; only structural dimensions (dot size, stop
   width, bar thickness) are the World's own layout. */
.world-progress {
	padding: var(--s-2) var(--s-3);
	border: 1px solid var(--line-1);
	border-radius: var(--r-2);
	background: var(--bg-2);
}

.world-progress-title {
	font-size: var(--fs-tiny);
	color: var(--fg-2);
	margin-bottom: var(--s-2);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Tube-map "fare zones" (fixes the phase band reading as two rows kept in
   lockstep rather than actual vertically-separated zones): each phase GROUP
   -- one run of consecutive same-phase stations, or a single phase-less
   station -- is its own flex COLUMN (world.js's buildProgressZones), the
   group's own label cell stacked directly above the stops it spans. Nesting
   the label INSIDE the group (rather than keeping two independent label/
   dots rows in sync, as before) is what lets the alternating zone tint and
   the full-height separator between zones fall out of ordinary box
   backgrounds/borders instead of needing a second parallel row. */
/* D6: ONE scroller wraps the whole zones row (built by world.js's
   renderProgress into a shared .world-progress-scroll) so a zone's label can
   never scroll out of alignment with the dots it labels, and so the strip
   reserves space for the overlay's own right edge -- the last stop touched
   (or crossed) it at 1280px otherwise. padding-right gives the LAST zone
   breathing room even when scrolled all the way to the end. */
.world-progress-scroll {
	display: flex;
	flex-direction: column;
	overflow-x: auto;
	padding-right: var(--s-3);
}

.world-progress-zones {
	display: flex;
	align-items: flex-start;
}

/* One phase group (or a phase-less station's own solo group). flex-grow --
   its station count -- is set inline by world.js, the same pattern the old
   per-cell flex-grow used, so a multi-station group's width still lines up
   exactly with the dots it spans. position: relative anchors the
   zone-separator pseudo-element below. */
.world-progress-zone {
	display: flex;
	flex-direction: column;
	flex: 1 1 0;
	position: relative;
}

/* Alternating zone tint (odd zones only; even zones stay transparent) --
   the alternation itself is what reads as separate "fare zones", tube-map
   style, spanning the zone's own full height (label cell + stops). */
.world-progress-zone.zone-tint {
	background: var(--bg-3);
}

/* Full-height separator between two consecutive zones. The adjacent-sibling
   selector matches zone-to-zone only: a divider between two zones (a
   Hybrid-leg boundary) already has its own dashed separator and lives in a
   .world-progress-divider-wrap OUTSIDE the .world-progress-zone chain, so
   the two separators never double up. top/bottom: 0 spans from the label
   row down through the stops row to the station code labels. */
.world-progress-zone + .world-progress-zone::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 1px;
	background: var(--line-2);
}

/* The zone's own label: ONE cell spanning the WHOLE zone width (no longer a
   per-station flex sibling -- there is exactly one label per zone now), so
   it stays centered over the group of stations it names. Also reused,
   left empty, as the blank spacer above a Hybrid-leg divider (below) so the
   divider's own text lines up with where a real zone's stops row begins. */
.world-progress-phase-cell {
	width: 100%;
	height: 14px;
	line-height: 14px;
	text-align: center;
	font-size: var(--fs-tiny);
	color: var(--fg-3);
	white-space: nowrap;
}

.world-progress-phase-cell.has-phase {
	border-top: 1px solid var(--line-2);
	padding-top: 2px;
}

/* D10: uniform dot rhythm -- every stop in a zone claims an EQUAL share of
   that zone's own width (flex: 1 1 0, ignoring each stop's own content width
   when sizing), and every zone's width is itself proportional to its own
   station count -- the net effect is the same steady, predictable
   per-station spacing end to end the old single-row layout had.
   padding-top is headroom for the in-session pulse ring's box-shadow. */
.world-progress-zone-stops {
	display: flex;
	align-items: flex-start;
	padding-top: var(--s-3);
}

.world-progress-stop {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 72px;
	flex: 1 1 0;
	cursor: pointer; /* clicking a stop jumps to the Log tab, pre-filtered to its label */
}

/* The line itself: each stop draws its OWN left/right half-segments,
   from its own edge to its own dot's horizontal centre, instead of one
   full-stop-width bar borrowed from the NEXT stop's box (the old
   `+` combinator below) -- that borrowed width only matched the gap to the
   PREVIOUS stop's dot when both stops happened to be the same width, which
   is what produced the visible gaps whenever neighbouring labels differed
   in length. Two adjacent halves always meet exactly at the shared box
   edge between two flex siblings, regardless of either stop's own width --
   including across a zone boundary, since a zone's flex-grow keeps its
   stops' combined width exactly proportional to the zone's own width.
   top: 10px centres the 3px bar on the 22px dot (dot occupies the stop's
   own y 0-22, so its centre sits at y 11; 11 - 3/2 rounds to 10). */
.world-progress-stop::before,
.world-progress-stop::after {
	content: "";
	position: absolute;
	top: 10px;
	height: 3px;
	background: var(--line-2);
	z-index: 0;
}

.world-progress-stop::before {
	left: 0;
	width: 50%;
}

.world-progress-stop::after {
	right: 0;
	width: 50%;
}

/* No dangling half at either end of the line. Stops now nest inside their
   own zone's .world-progress-zone-stops, so the TRUE first/last stop of the
   whole strip is no longer necessarily :first-child/:last-child of its
   immediate parent (the first stop of the SECOND zone is also a
   :first-child of ITS OWN row) -- world.js's buildProgressZones tags only
   the actual overall first/last stop with these classes instead, so the
   line stays visually continuous across every zone boundary and only the
   two true ends of the whole route are left open. */
.world-progress-stop.line-first::before {
	content: none;
}

.world-progress-stop.line-last::after {
	content: none;
}

.world-progress-stop .dot {
	position: relative;
	z-index: 1;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 3px solid var(--fg-3);
	background: var(--bg-2);
	box-sizing: border-box;
	/* attempt count sits inside the dot */
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--fs-tiny);
	font-weight: 600;
	color: var(--fg-0);
}

.world-progress-stop .code {
	margin-top: var(--s-1);
	font-size: var(--fs-tiny);
	color: var(--fg-1);
	white-space: nowrap;
	/* keeps long adjacent station labels from touching each other */
	padding: 0 var(--s-1);
	/* D10: a station without a short `code` falls back to its (often long)
	   raw id/slug -- clip it to the stop's own width instead of letting it
	   force the stop wider than its neighbours (breaks the uniform rhythm
	   above); world.js sets a matching title="" for the full text on hover. */
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	box-sizing: border-box;
}


.world-progress-stop.status-passed .dot { background: var(--ok); border-color: var(--ok); }
.world-progress-stop.status-conditions .dot { background: var(--warn); border-color: var(--warn); }
.world-progress-stop.status-rejected .dot { background: var(--err); border-color: var(--err); }
.world-progress-stop.status-escalated .dot { background: var(--accent-2); border-color: var(--accent-2); border-radius: var(--r-1); }
.world-progress-stop.status-in-session .dot { border-color: var(--accent); animation: world-progress-pulse 1.6s ease-in-out infinite; }

@keyframes world-progress-pulse {
	0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
	50% { box-shadow: 0 0 0 var(--s-2) transparent; }
}

/* Wraps a Hybrid-leg divider so it sits alongside the .world-progress-zone
   chain (not inside it -- a divider has no station count, no tint, no
   zone-separator) while still matching a real zone's vertical rhythm: a
   blank .world-progress-phase-cell spacer (same class a real zone's label
   uses, left empty) above the dashed divider text itself, so the two stay
   in lockstep if that label height ever changes. */
.world-progress-divider-wrap {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
}

.world-progress-divider {
	position: relative;
	z-index: 1;
	padding: 0 var(--s-2);
	font-size: var(--fs-tiny);
	color: var(--fg-3);
	border-left: 2px dashed var(--line-2);
}

/* ---- Real folder-style tab control: the five panes
   share ONE bordered panel card (.world-panel); the tabs sit flush on the
   panel's top edge as rounded-top rectangles. The active tab shares the
   panel's own background and drops its bottom border (mirrored by the
   panel-colored bottom border below, not `border-bottom: none`, so the tab
   keeps its box height/border-width identical to inactive tabs — only the
   COLOR changes, erasing that one edge) plus a -1px margin so it physically
   overlaps the panel's top border by a hairline: the two together are what
   fuse the active tab into the panel (the classic "open folder" look).
   Driven entirely from markup (data-tab on each button <-> "world-side-
   {tab}" pane id, no hardcoded pair in JS). Every tab shares this exact same
   control: Live, Cast, Documents, Log, Help, and Inbox while the user plays a
   character. */
.world-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	margin-bottom: -1px;
	position: relative;
	z-index: 1;
}

.world-tab {
	flex: 0 0 auto;
	padding: var(--s-1) var(--s-3);
	font-size: var(--fs-tiny);
	border: 1px solid var(--line-1);
	border-bottom-color: var(--line-1);
	border-radius: var(--r-2) var(--r-2) 0 0;
	background: var(--bg-1);
	color: var(--fg-2);
	cursor: pointer;
}

.world-tab:hover {
	color: var(--fg-1);
}

.world-tab.active {
	background: var(--bg-2);
	color: var(--fg-0);
	border-bottom-color: var(--bg-2);
}

/* The panel: one bordered card (bg-2/line-1/r-2) hosting whichever pane is
   currently visible ([hidden] on the rest) — this IS "the pane" now, so the
   individual panes below are padding-only, never their own card.
   Seam fix: square TOP corners (0 0 r-2 r-2), not all four -- a rounded top
   edge showed daylight/radius peeking out from under the active tab, which
   read as the panel being detached from the tab row instead of fused to
   it. margin-top cancels the FLEX GAP .world-side (this panel's parent)
   inserts between EVERY pair of its flex children -- including .world-tabs
   and this panel (.world-side is `gap: var(--s-2)`) -- which is what the
   tabs' own `margin-bottom: -1px` fusion trick (below) could never fully
   close on its own: -1px only ate 1px of that ~8px gap, leaving a visible
   seam between the tab row and the panel no matter how well the active
   tab's border colors matched the panel's. */
.world-panel {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	margin-top: calc(-1 * var(--s-2));
	border: 1px solid var(--line-1);
	border-radius: 0 0 var(--r-2) var(--r-2);
	background: var(--bg-2);
	padding: var(--s-2) var(--s-3);
}

/* Wrapper panes that stack several internal blocks (Live: net + legend +
   feed; Log: filter toolbar + list) need the panel's stacking gap and an
   internal-scroll flex context. Card panes (Cast/Documents/Help) get their
   own layout from .world-cast instead. Pico's [hidden] rule hides a pane
   over the explicit display. */
.world-pane {
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
	flex: 1 1 auto;
	min-height: 0;
}

/* Cast/Documents/Help pane body: padding-only now — the border/
   background moved up to .world-panel, which every pane shares. */
.world-cast {
	flex: 1 1 auto;
	min-height: 120px;
	overflow-y: auto;
	font-size: var(--fs-tiny);
	color: var(--fg-1);
	/* D5: a touch of top padding + a subtle top border keeps scrolled
	   content from reading as sliced flush under the tab row above. */
	padding-top: var(--s-2);
	border-top: 1px solid var(--line-1);
	/* D13: so the LAST row is fully revealable at the bottom of a scroll,
	   not flush against the panel's own bottom edge. */
	padding-bottom: var(--s-3);
}

.world-cast-heading {
	margin: var(--s-2) 0 var(--s-1) 0;
	font-size: 0.85em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-2);
}

.world-cast-heading:first-child {
	margin-top: 0;
}

/* D5: a bordered card per row (not just a bottom rule) so a scroll split
   never orphans a bare paragraph -- each row reads as its own complete unit
   whichever ones happen to be cut off at the top/bottom of the viewport. */
.world-cast-row {
	padding: var(--s-2);
	border: 1px solid var(--line-1);
	border-radius: var(--r-1);
	margin-bottom: var(--s-2);
}

.world-cast-row:last-child {
	margin-bottom: 0;
}

.world-cast-row.kind-chair strong { color: var(--warn); }
.world-cast-row.kind-challenger strong { color: var(--err); }

.world-cast-kind {
	margin-left: var(--s-1);
	padding: 0 var(--s-2);
	font-size: 0.85em;
	border-radius: var(--r-pill);
	background: var(--bg-3);
	color: var(--fg-1);
	text-transform: uppercase;
}

/* Indent detail/bio to clear the 10px swatch + its --s-1 gap. */
.world-cast-detail {
	display: block;
	color: var(--fg-2);
	margin-left: calc(10px + var(--s-1));
}

.world-cast-bio {
	margin: 0 0 var(--s-1) calc(10px + var(--s-1));
	color: var(--fg-3);
	line-height: 1.4;
}

/* Invite button: sits in the top-right corner of an
   office-directory row without disturbing that row's existing name/detail/
   bio stack — the row just reserves right-hand padding for it. */
.world-directory-row {
	position: relative;
	padding-right: 60px;
}

.world-invite-btn {
	position: absolute;
	top: var(--s-1);
	right: 0;
	font-size: var(--fs-tiny);
}

/* ---- Document status badges ("On the table" section) ---- */
.world-doc-status {
	display: inline-block;
	margin-left: var(--s-1);
	padding: 0 var(--s-2);
	border-radius: var(--r-pill);
	background: var(--bg-3);
	font-size: 0.85em;
}

.world-doc-status.status-approved { color: var(--ok); }
.world-doc-status.status-conditions { color: var(--warn); }
.world-doc-status.status-rejected { color: var(--err); }
.world-doc-status.status-presented { color: var(--accent); }
.world-doc-status.status-pending { color: var(--fg-2); }

/* Muted empty-state note, shared by any pane that can legitimately have
   nothing to show yet (e.g. the Documents tab before a route posts). */
.world-empty-note {
	color: var(--fg-2);
	font-style: italic;
}

/* ---- Documents tab: name + status badge, description muted below ---- */
.world-doc-desc {
	margin-top: var(--s-1);
	color: var(--fg-3);
	line-height: 1.4;
}

/* ---- Log tab ---- */
.world-log-toolbar .filter-toggle {
	white-space: nowrap;
	flex: 0 0 auto;
}

.world-log-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-2);
	align-items: center;
}

.world-log-filter {
	flex: 1 1 14rem;
	min-width: 14rem;
}

/* progress events act as section markers in the full history */
.world-log-progress {
	border-left: 2px solid var(--accent);
	padding-left: var(--s-2);
}

/* ---- Help tab: rendered from Defaults/help.md by a minimal
   built-in markdown parser (headings, bold, code, fenced blocks, lists,
   links) -- see renderHelpMarkdown/renderInline in world.js. Heading levels
   reuse the same uppercase/tracked treatment the tab's old hardcoded
   section headings used, so the visual result is unchanged even though the
   markup underneath is now real semantic h1/h2/h3. ---- */
.world-help-heading {
	margin: var(--s-2) 0 var(--s-1) 0;
	font-size: 0.85em;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fg-2);
}

.world-help-heading:first-child {
	margin-top: 0;
}

.world-help-h1 {
	font-size: 0.95em;
	color: var(--fg-0);
}

.world-help-p {
	margin: var(--s-1) 0;
	color: var(--fg-1);
	line-height: 1.4;
}

#world-side-help a {
	color: var(--accent);
}

.world-help-note {
	margin: var(--s-1) 0;
	color: var(--fg-1);
	line-height: 1.4;
}

.world-help-row {
	display: flex;
	align-items: flex-start;
	gap: var(--s-2);
	margin: var(--s-1) 0;
}

.world-help-code {
	display: block;
	flex: 1 1 auto;
	margin: 0;
	padding: var(--s-2);
	border: 1px solid var(--line-1);
	border-radius: var(--r-1);
	background: var(--bg-3);
	color: var(--fg-1);
	font-size: var(--fs-tiny);
	font-family: monospace;
	overflow-x: auto;
	white-space: pre;
}

.world-help-copy {
	flex: 0 0 auto;
	font-size: var(--fs-tiny);
}

.world-help-list {
	margin: var(--s-1) 0 var(--s-2) var(--s-3);
	padding: 0;
	color: var(--fg-2);
}

.world-help-list li {
	margin-bottom: var(--s-1);
}

.world-help-list code {
	color: var(--fg-0);
}

/* ---- Live 3D Character Creator Studio modal ---- */
.world-studio {
	width: min(1040px, 95vw);
	max-height: 92vh;
	padding: 0;
	border: 1px solid rgba(95, 212, 255, 0.4);
	border-radius: var(--r-2);
	background: var(--bg-1, #121a26);
	color: var(--fg-0, #e8f0f8);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
	overflow: hidden;
}
.world-studio::backdrop {
	background: rgba(4, 10, 18, 0.72);
	backdrop-filter: blur(4px);
}
.world-studio-shell {
	display: flex;
	flex-direction: column;
	max-height: 92vh;
}
.world-studio-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3);
	padding: var(--s-2) var(--s-3);
	border-bottom: 1px solid var(--line-1);
	background: var(--bg-2, #182232);
}
.world-studio-head h2 {
	margin: 0;
	font-size: 1.05rem;
}
.world-studio-body {
	display: grid;
	grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
	min-height: 0;
	flex: 1 1 auto;
	overflow: hidden;
}
.world-studio-stage {
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
	padding: var(--s-3);
	border-right: 1px solid var(--line-1);
	background: #0f1724;
}
.world-studio-viewport {
	position: relative;
}
.world-studio-ref {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 96px;
	height: 96px;
	object-fit: cover;
	border: 1px solid rgba(95, 212, 255, 0.55);
	border-radius: var(--r-1);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
	pointer-events: none;
}
.world-studio-canvas {
	width: 100%;
	height: clamp(320px, 56vh, 520px);
	border: 1px solid rgba(95, 212, 255, 0.28);
	border-radius: var(--r-1);
	cursor: grab;
	touch-action: none;
}
.world-studio-canvas:active { cursor: grabbing; }
.world-studio-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.world-studio-bar button {
	padding: 4px 10px;
	font-size: var(--fs-tiny);
	border: 1px solid var(--line-1);
	border-radius: var(--r-1);
	background: var(--bg-2, #1b2738);
	color: var(--fg-1);
	cursor: pointer;
}
.world-studio-bar button.active {
	border-color: var(--ops-cyan, #5fd4ff);
	background: rgba(95, 212, 255, 0.16);
	color: #eef9ff;
}
.world-studio-controls {
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}
.world-studio-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: var(--s-2) var(--s-3);
	border-bottom: 1px solid var(--line-1);
	background: var(--bg-2, #182232);
}
.world-studio-tabs button {
	padding: 5px 10px;
	font-size: var(--fs-tiny);
	border: 1px solid transparent;
	border-radius: var(--r-1);
	background: transparent;
	color: var(--fg-2);
	cursor: pointer;
}
.world-studio-tabs button.active {
	border-color: var(--ops-cyan, #5fd4ff);
	background: rgba(95, 212, 255, 0.14);
	color: var(--fg-0);
}
.world-studio-pane {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: var(--s-3);
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
}
.world-studio-base-toggle {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--s-2);
}
.world-studio-base-toggle button {
	padding: 8px 12px;
	border: 1px solid var(--line-1);
	border-radius: var(--r-1);
	background: var(--bg-2);
	color: var(--fg-1);
	cursor: pointer;
	font-weight: 600;
}
.world-studio-base-toggle button.active {
	border-color: var(--ops-cyan, #5fd4ff);
	background: rgba(95, 212, 255, 0.16);
	color: #fff;
}
.world-studio-preset-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: var(--s-2);
}
.world-studio-preset {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	padding: 10px 12px;
	border: 1px solid var(--line-1);
	border-radius: var(--r-1);
	background: var(--bg-2);
	color: var(--fg-0);
	text-align: left;
	cursor: pointer;
}
.world-studio-preset:hover {
	border-color: var(--ops-cyan, #5fd4ff);
}
.world-studio-preset span {
	font-size: var(--fs-tiny);
	color: var(--fg-2);
}
.world-studio-bulk {
	margin-top: var(--s-2);
	padding: var(--s-2);
	border: 1px solid var(--line-1);
	border-radius: var(--r-1);
	background: var(--bg-2);
	display: flex;
	flex-direction: column;
	gap: var(--s-1);
}
.world-studio-bulk button {
	align-self: flex-start;
}
.world-cast-actions {
	display: inline-flex;
	gap: 6px;
	margin-left: auto;
	align-items: center;
}
.world-cast-studio {
	padding: 2px 8px;
	font-size: var(--fs-tiny);
	border: 1px solid var(--ops-cyan, #5fd4ff);
	border-radius: var(--r-1);
	background: rgba(95, 212, 255, 0.14);
	color: var(--fg-0);
	cursor: pointer;
}
.world-cast-studio:hover {
	background: rgba(95, 212, 255, 0.28);
}
.world-studio-sliders {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: var(--s-2) var(--s-3);
}
.world-studio-sliders h3 {
	grid-column: 1 / -1;
}
.world-studio-slider {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: var(--fs-tiny);
}
.world-studio-slider-head {
	display: flex;
	justify-content: space-between;
	gap: var(--s-2);
	color: var(--fg-1);
}
.world-studio-slider-head input[type="number"] {
	width: 7ch;
	height: auto;
	margin: 0;
	padding: 0 2px;
	font: inherit;
}
.world-studio-slider-head output {
	font-family: var(--ops-mono, monospace);
	color: var(--ops-cyan, #5fd4ff);
}
.world-studio-color-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.world-studio-color-field > label,
.world-studio-select {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-2);
	font-size: var(--fs-small);
}
.world-studio-select select {
	min-width: 190px;
}
.world-studio-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.world-studio-swatch {
	width: 24px;
	height: 24px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	cursor: pointer;
}
.world-studio-json {
	width: 100%;
	font-family: var(--ops-mono, monospace);
	font-size: 0.78rem;
	background: var(--bg-3);
	color: var(--fg-0);
	border: 1px solid var(--line-1);
	border-radius: var(--r-1);
	padding: var(--s-2);
}
.world-studio-json-actions {
	display: flex;
	gap: var(--s-2);
}
.world-studio-foot {
	display: flex;
	align-items: center;
	gap: var(--s-2);
	padding: var(--s-2) var(--s-3);
	border-top: 1px solid var(--line-1);
	background: var(--bg-2, #182232);
}
#world-studio-cancel {
	margin-left: auto;
}
@media (max-width: 820px) {
	.world-studio-body {
		grid-template-columns: 1fr;
		overflow-y: auto;
	}
	.world-studio-stage {
		border-right: none;
		border-bottom: 1px solid var(--line-1);
	}
}

@media print {
	.world-head > .world-bar, .world-side, .world-dock { display: none; }
	.world-row { display: block; }
	.world-3d-host { height: 65vh; }
	/* Org charts print in the light theme under the page's title alone, without the site's chrome and
	   the page's controls. One chart prints landscape; charts drawn a department each print one a
	   portrait page, a page wide. The title takes at most 20mm, and a chart is no taller than its page
	   less that (OrgChart.PageShortSide, PageLongSide and PageTitleHeight): it shrinks rather than
	   splits, and never leaves the title on a page alone. */
	:root:has(.org-chart) { color-scheme: light; background: Canvas; }
	body:has(.org-chart) { page: org-chart; display: block; height: auto; overflow: visible; background: none; }
	body:has(.org-chart + .org-chart) { page: org-chart-departments; }
	body:has(.org-chart) :is(.topbar, .sidebar, .theme-toggle, footer, .content > :not(h1, .org-chart)) { display: none; }
	body:has(.org-chart) > main, body:has(.org-chart) > main > .content { display: block; overflow: visible; padding: 0; }
	body:has(.org-chart) h1 { color: CanvasText; font-size: var(--fs-h1); line-height: 1.25; margin: 0 0 4mm; }
	body:has(.org-chart) .org-chart { background: none; border: none; box-shadow: none; margin: 0; padding: 0; break-inside: avoid; }
	:root .org-chart .d2-light { display: block; }
	:root .org-chart .d2-dark { display: none; }
	.org-chart + .org-chart { break-before: page; }
	body:has(.org-chart) .org-chart svg { display: block; max-height: calc(190mm - 20mm); }
	body:has(.org-chart + .org-chart) .org-chart svg { max-height: calc(259.4mm - 20mm); }
}

@page org-chart { size: landscape; margin: 10mm; }
@page org-chart-departments { size: portrait; margin: 10mm; }
