/* Copied from ruori-app's server/static/public/style.css by tools/make-demo.py. */
/* mcp-rooms
 *
 * Source Sans 3, the colours below and 2 px corners. The font is served from this host, so
 * pages load nothing from third parties.
 *
 * Sizes (#32112): for new CSS, prefer @container queries over @media for anything that depends
 * on size, so a component folds into the space it is given (a workspace pane, a panel), not
 * the window. The @media rules below predate that; convert them as their parts are reworked.
 */

@font-face {
	font-family: 'Source Sans 3';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('/fonts/source-sans-3-latin-400-normal.woff2') format('woff2');
}

@font-face {
	font-family: 'Source Sans 3';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('/fonts/source-sans-3-latin-600-normal.woff2') format('woff2');
}

/* Material icons (#40445): Google's Material Symbols, served from here (icons/material), each
   an SVG drawn in the text's colour through a mask. A <span class="icon i-NAME"> (ruoriIcon() in
   common.js makes one), or a ::before or ::after listed here and given --i. */
.icon,
.message::before, .todo > summary::after, .msgid-md.is-copied::before, .claim.is-claimed .claim-state::before,
.claim.is-done .claim-state::before, .option-md.is-chosen::before, .attachments .is-video .file-name::before,
.roadmap-item.is-done .roadmap-text > :first-child::before {
	display: inline-block; flex: none; width: 1.15em; height: 1.15em; vertical-align: -0.22em; background-color: currentColor;
	-webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.claim-state::before, .option-md.is-chosen::before, .attachments .is-video .file-name::before,
.roadmap-text > :first-child::before { margin-inline-end: 0.2em; }
/* An icon alone in a button: the button's own size, centred. */
button > .icon:only-child { vertical-align: middle; }
.i-add { --i: url("icons/material/add.svg"); }
.i-attach-file { --i: url("icons/material/attach-file.svg"); }
.i-chat-bubble { --i: url("icons/material/chat-bubble.svg"); }
.i-check { --i: url("icons/material/check.svg"); }
.i-check-circle { --i: url("icons/material/check-circle.svg"); }
.i-close { --i: url("icons/material/close.svg"); }
.i-close-fullscreen { --i: url("icons/material/close-fullscreen.svg"); }
.i-code { --i: url("icons/material/code.svg"); }
.i-description { --i: url("icons/material/description.svg"); }
.i-edit { --i: url("icons/material/edit.svg"); }
.i-edit-note { --i: url("icons/material/edit-note.svg"); }
.i-expand-less { --i: url("icons/material/expand-less.svg"); }
.i-expand-more { --i: url("icons/material/expand-more.svg"); }
.i-horizontal-split { --i: url("icons/material/horizontal-split.svg"); }
.i-link { --i: url("icons/material/link.svg"); }
.i-list { --i: url("icons/material/list.svg"); }
.i-more-horiz { --i: url("icons/material/more-horiz.svg"); }
.i-mark-chat-read { --i: url("icons/material/mark-chat-read.svg"); }
.i-north-east { --i: url("icons/material/north-east.svg"); }
.i-open-in-full { --i: url("icons/material/open-in-full.svg"); }
.i-pause { --i: url("icons/material/pause.svg"); }
.i-pending { --i: url("icons/material/pending.svg"); }
.i-play-arrow { --i: url("icons/material/play-arrow.svg"); }
.i-remove { --i: url("icons/material/remove.svg"); }
.i-reply { --i: url("icons/material/reply.svg"); }
.i-comment { --i: url("icons/material/comment.svg"); }
.i-warning { --i: url("icons/material/warning.svg"); }

:root {
	/* Design tokens */
	--brand: var(--deep-turquoise);
	--brand-hover: var(--deep-turquoise-active);
	--highlight: var(--turquoise);
	--highlight-dark: var(--deep-turquoise);
	/* Turquoise as TEXT (#35159): darker than the brand's, which is 4.1:1 on white where WCAG AA
	   asks 4.5:1. This is 5.1:1 on white and 4.8:1 on the page's grey. Lines, bars and the
	   header's gradient keep --highlight. */
	--link: #027a82;
	--orange: #c2540d;
	--accent: var(--orange);
	/* The accent as TEXT, or behind white text (#35166): the brand's orange is 3.3:1 with
	   white, where WCAG AA asks 4.5:1. Nippon red (#35211) is 6.6:1. Focus rings, borders,
	   bars and dots keep --accent. */
	--accent-text: var(--nippon-red);
	--ink: #212121;
	--ink-soft: #5f686d;
	--line: #c8cdd0;
	--line-light: #ecedee;
	--pale: #edf6f7;   /* #35205, #35209 */
	--pale-soft: #f4fafa;
	--grey-soft: #f7f7f8;
	--white: #ffffff;
	--alert: var(--nippon-red);   /* #35187 */
	--success: var(--deep-turquoise);
	/* Ruori's palette (#34995) */
	--turquoise: #038B94;
	--deep-turquoise: #114B59;
	--deep-turquoise-active: #35626f;
	--light-antique-blue: #8C9FAE;
	--light-driftwood: #C6B8AF;
	--light-desert-sand: #DBB198;
	--desert-sand: #B38061;
	--dark-mocha-beige: #7B5330;
	--nippon-red: #bc002d;
	--light-sand: #f5efdd;   /* #35189 */
	--sand: #ffdcb6;
	--ultra-light-sand: #fff9f2;   /* #35223 */

	--radius: 2px;
	--sans: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
	--mono: ui-monospace, 'SF Mono', 'DejaVu Sans Mono', Menlo, Consolas, monospace;
	--measure: 48rem;   /* a readable line of prose */
	--page: 75rem;      /* the page: 1200 px (#22971) */

	/* ---- Dark mode (#36105) ----
	   The tokens above are the light scheme and stay as they are. Each one that changes in the
	   dark has a dark variant here, the same name with -dark. The rules don't use either
	   directly: they use the intermediate colours below, which pick one of the two with
	   light-dark(), by the page's color-scheme. So a new rule takes --surface, --text, --border…
	   and is right in both schemes; a colour that must stay the same in both (the brand behind
	   buttons and headers, white text on it) takes the token itself.
	   Contrast, dark scheme, against --white-dark (cards): --ink-dark 14.1:1, --ink-soft-dark
	   7.6:1, --link-dark 8.9:1, --brand-text-dark 9.6:1, --alert-dark 7.3:1; on --light-sand-dark
	   (the page) each is higher. Borders of fields use --text-soft (7.6:1). */
	--ink-dark: #e8eef0;
	--ink-soft-dark: #a7b5ba;
	--line-dark: #43575e;
	--line-light-dark: #2a3c42;
	--pale-dark: #1c343b;
	--pale-soft-dark: #182b31;
	--grey-soft-dark: #1a272b;
	--white-dark: #142227;             /* cards, fields, panels */
	--light-sand-dark: #0b1316;        /* the page under them */
	--sand-dark: #0f1d21;              /* …deepening at its edges */
	--ultra-light-sand-dark: #23291f;
	--link-dark: #62cfd7;
	--brand-text-dark: #7ed6dc;        /* the brand as text or a line: deep turquoise is 1.7:1 on a dark card */
	--alert-dark: #ff8fa0;             /* nippon red as text or a line */
	--footer-ink: #50585c;
	--footer-ink-dark: #a7b5ba;

	/* The intermediate colours: what the rules use. */
	--text: light-dark(var(--ink), var(--ink-dark));
	--text-soft: light-dark(var(--ink-soft), var(--ink-soft-dark));
	--footer-text: light-dark(var(--footer-ink), var(--footer-ink-dark));
	--border: light-dark(var(--line), var(--line-dark));
	--border-light: light-dark(var(--line-light), var(--line-light-dark));
	--surface: light-dark(var(--white), var(--white-dark));
	--surface-pale: light-dark(var(--pale), var(--pale-dark));
	--surface-pale-soft: light-dark(var(--pale-soft), var(--pale-soft-dark));
	--surface-grey: light-dark(var(--grey-soft), var(--grey-soft-dark));
	--surface-own: light-dark(var(--ultra-light-sand), var(--ultra-light-sand-dark));
	--ground: light-dark(var(--light-sand), var(--light-sand-dark));
	--ground-edge: light-dark(var(--sand), var(--sand-dark));
	--link-text: light-dark(var(--link), var(--link-dark));
	--brand-text: light-dark(var(--brand), var(--brand-text-dark));
	--brand-line: light-dark(var(--brand), var(--brand-text-dark));
	--success-text: light-dark(var(--success), var(--brand-text-dark));
	--success-line: light-dark(var(--success), var(--brand-text-dark));
	--alert-text: light-dark(var(--alert), var(--alert-dark));
	--alert-line: light-dark(var(--alert), var(--alert-dark));
	--accent-ink: light-dark(var(--accent-text), var(--alert-dark));
	--on-brand: var(--white);          /* text on the brand colours: buttons, headers, badges */
}
/* A browser without light-dark() (Safari before 17.5, Chrome before 123) gets the light scheme:
   there, a colour made with it would be no colour at all. */
@supports not (color: light-dark(#000, #fff)) {
	:root {
		--text: var(--ink); --text-soft: var(--ink-soft); --footer-text: var(--footer-ink);
		--border: var(--line); --border-light: var(--line-light);
		--surface: var(--white); --surface-pale: var(--pale); --surface-pale-soft: var(--pale-soft);
		--surface-grey: var(--grey-soft); --surface-own: var(--ultra-light-sand);
		--ground: var(--light-sand); --ground-edge: var(--sand);
		--link-text: var(--link); --brand-text: var(--brand); --brand-line: var(--brand);
		--success-text: var(--success); --success-line: var(--success);
		--alert-text: var(--alert); --alert-line: var(--alert); --accent-ink: var(--accent-text);
	}
}

* { box-sizing: border-box; }

/* Light unless the person chose dark in Settings (#36105): theme.js puts their choice, kept in
   the browser, on <html> before the page is drawn. light-dark() in :root follows it. */
html { color-scheme: light; }
/* The page itself never scrolls sideways (#37857): anything too wide is cut at the window's
   edge, so it can't make a phone's page wider than its screen. Wide content (code, tables)
   scrolls inside its own box. */
html { overflow-x: clip; }
html[data-theme="dark"] { color-scheme: dark; }

body {
	margin: 0;
	background: var(--surface);
	color: var(--text);
	font: 400 18px/1.6 var(--sans);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-text-size-adjust: 100%;
	/* The page reaches under the phone's rounded corners (viewport-fit=cover, #37437): on its
	   side, keep clear of the notch. */
	padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
	/* Footer sits at the bottom even on a short page. */
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

h1, h2, h3 {
	font-weight: 600;
	line-height: 1.25;
	margin: 0;
}

a { color: var(--link-text); text-underline-offset: 2px; }
a:hover { color: var(--brand-text); }
a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
}

/* ---- header ---- */

.site-header {
	background: var(--deep-turquoise);
	border-bottom: 1px solid var(--deep-turquoise);
	color: var(--on-brand);
	padding-inline: 1.5rem;
}

/* "The site was updated: reload" (#37510): its own line under the menu, across the window
   (the header's side padding is painted over), the accent colour with white bold text (#38635). */
.update-bar {
	display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.2rem 0.9rem;
	padding: 0.35rem 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 700; color: #fff; background: var(--accent);
	box-shadow: 0 0 0 100vmax var(--accent); clip-path: inset(0 -100vmax);
}
.update-bar[hidden] { display: none; }
.update-reload, .update-close { appearance: none; background: none; color: #fff; cursor: pointer; font: inherit; }
.update-reload { font-weight: 700; border: 1px solid #fff; border-radius: var(--radius); padding: 0.05rem 0.7rem; }
.update-reload:hover { background: #fff; color: var(--accent); }
.update-close { border: 0; font-size: 1.3rem; line-height: 1; padding: 0 0.3rem; }
.update-bar :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* "Allow notifications" (#42687): the note is quieter than the ask. */
.push-bar-note { font-weight: 400; }
.push-bar a { color: #fff; text-decoration: underline; }
.update-reload[hidden] { display: none; }

.bar {
	/* The header spans the browser's width on every page (#34158, #34324). */
	max-width: none;
	margin-inline: auto;
	padding-block: 0.9rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
}

/* Main menu. The current page is underlined. */
.site-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 1.4rem;
}

.site-nav a,
.link-button {
	font: 600 1rem var(--sans);
	color: var(--link-text);
	text-decoration: none;
	padding: 0.2rem 0;
	border: 0;
	border-bottom: 3px solid transparent;
	background: none;
	cursor: pointer;
}
.site-nav a:hover,
.link-button:hover { color: var(--brand-text); border-bottom-color: var(--border); }
.site-nav a.is-current { color: var(--text); border-bottom-color: var(--highlight); }

.signout { margin: 0; }
/* Every item of the menu the same box, links and buttons alike, centred: browsers (Safari
   above all) otherwise give a <button> its own line box and baseline (#8167). */
.site-nav > * { display: flex; align-items: center; }
.site-nav a, .site-nav .link-button {
	display: inline-flex; align-items: center; gap: 0.35rem;
	line-height: 1.5; margin: 0; -webkit-appearance: none; appearance: none; white-space: nowrap;
}

/* Usage (admins) and Notifications in the menu: a button, and the panel it opens. */
.notif-menu, .rooms-menu { position: relative; }
.site-nav .rooms-toggle.is-current { color: var(--text); border-bottom-color: var(--highlight); }
.notif-toggle { display: inline-flex; align-items: center; gap: 0.35rem; }
.notif-count { font-size: 0.75rem; padding: 0 0.4rem; line-height: 1.4; }
/* Every dropdown of the menu: as wide as its content needs, from 22rem up to 35rem. */
.menu-pop {
	position: absolute; right: 0; top: calc(100% + 0.6rem); z-index: 20;
	width: max-content; min-width: 22rem; max-width: min(35rem, calc(100vw - 2rem));
	max-height: calc(100vh - 6rem); overflow-y: auto;
	color: var(--text);   /* not the header's white it sits in (#35191) */
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: 0 8px 24px rgb(0 53 122 / 0.18);
	padding: 0.9rem 1rem 0.8rem; font-size: 0.9375rem; text-align: left;
}
.menu-pop[hidden] { display: none; }
.menu-pop:focus { outline: none; }
/* Rooms is first in the menu: its panel opens to the right. */
.rooms-pop { right: auto; left: 0; }
.rooms-menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.rooms-menu-list a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.5rem; padding: 0.4rem 0.6rem;
	border-left: 3px solid var(--border-light); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.rooms-menu-list a:hover { background: var(--surface-grey); border-left-color: var(--highlight); }
.rooms-menu-list .is-here a { background: var(--surface-pale); border-left-color: var(--brand-line); }
.rooms-menu-name { font-weight: 600; color: var(--link-text); }
/* Mark as read (#37611): beside the room's link, on the line of its name. */
.rooms-menu-list .has-unread { display: flex; align-items: flex-start; gap: 0.5rem; }
.rooms-menu-list .has-unread a { flex: 1 1 auto; min-width: 0; }
/* The whole row changes colour, with its count and Mark as read, not the link's part of it (#38350). */
/* The line under a pointed-at link (the menu's own, .site-nav a:hover) is the row's here too (#38381). */
.rooms-menu-list .has-unread { border-left: 3px solid var(--border-light); border-bottom: 3px solid transparent; border-radius: var(--radius); }
.rooms-menu-list .has-unread a, .rooms-menu-list .has-unread a:hover, .rooms-menu-list .has-unread.is-here a { border-left: 0; border-bottom: 0; background: none; }
.rooms-menu-list .has-unread:hover, .rooms-menu-list .has-unread:has(a:focus-visible) { background: var(--surface-grey); border-left-color: var(--highlight); border-bottom-color: var(--border); }
.rooms-menu-list .has-unread.is-here { background: var(--surface-pale); border-left-color: var(--brand-line); }
/* A link straight to the agent's console (#40241), at the row's end. */
.rooms-menu-list .has-console { display: flex; align-items: center; gap: 0.5rem; }
.rooms-menu-list .has-console > a:first-child { flex: 1 1 auto; min-width: 0; }
.rooms-menu-list a.rooms-menu-console, .rooms-menu-list .is-here a.rooms-menu-console { flex: none; padding: 0.2rem 0.4rem; border-left: 0; background: none; font-size: 0.8125rem; color: var(--link-text); text-decoration: underline; }
/* The count and, beside it, Mark as read as an icon (#41688): one row. */
.rooms-menu-side { flex: none; display: flex; align-items: center; gap: 0.3rem; padding: 0.4rem 0.4rem 0 0; }
.rooms-menu-read { display: inline-flex; padding: 0.15rem; font-size: 1.25rem; line-height: 1; }
.rooms-menu-slug { flex-basis: 100%; font-size: 0.8125rem; color: var(--text-soft); font-family: var(--mono); }
/* Search in the menu (#35496): the box, then what it found, an excerpt each with who, where and when. */
.search-pop { width: 30rem; }
.search-menu-form input { box-sizing: border-box; width: 100%; font: inherit; color: var(--text); padding: 0.45rem 0.6rem;
	border: 1px solid var(--text-soft); border-radius: var(--radius); background: var(--surface); }
.search-pop .hint { margin: 0.4rem 0 0.5rem; }
.search-menu-list .rooms-menu-name { flex: 1 1 100%; min-width: 0; white-space: normal; font-weight: 400; color: var(--text); overflow-wrap: anywhere;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.search-menu-list .rooms-menu-slug { font-family: inherit; }
.menu-pop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.5rem; }
.menu-pop-title { font-weight: 600; }
.menu-pop-foot { margin: 0.6rem 0 0; font-size: 0.875rem; text-align: right; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.notif-list a { display: grid; gap: 0.1rem; padding: 0.4rem 0.6rem; border-left: 3px solid var(--border-light);
	border-radius: var(--radius); text-decoration: none; color: var(--text); }
.notif-list a:hover { background: var(--surface-grey); }
.notif-list .is-unread a { background: var(--surface-pale); border-left-color: var(--highlight); }
.notif-list .is-unread .notif-excerpt { color: var(--text); font-weight: 600; }
.needs-menu-list a { border-left-color: var(--accent); }   /* waits on you (#35258) */
/* A long question mustn't widen the panel past the screen (#35264): a fixed width, the excerpt
   wrapped to two lines. */
#needs-pop { width: min(30rem, calc(100vw - 2rem)); overflow-x: hidden; }
.needs-menu-list a { min-width: 0; }
.needs-menu-list .notif-excerpt { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-meta { font-size: 0.8125rem; color: var(--text-soft); }
.notif-excerpt { font-size: 0.875rem; color: var(--text-soft); overflow-wrap: anywhere; }
/* On the room list: the heading, with Mark all read beside it. */
.mentions-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.6rem; }
.mentions-head h2 { margin: 0; }
.primary.small { font-size: 0.9375rem; padding: 0.3rem 0.9rem; }
.limits-compact .limit-percent { font-size: 1.05rem; }
.limits-compact .meter-track { height: 0.5rem; }
.limits-compact .limit { padding: 0.45rem 0.75rem; }
.limits-compact .limit-name { font-size: 0.9375rem; }
.limits-compact .limit-reset { font-size: 0.8125rem; margin: 0.15rem 0 0; }

.wordmark {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--text);
	text-decoration: none;
}
.wordmark .mark { display: block; flex: none; }
.wordmark .name { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.005em; }
.wordmark .tld { color: var(--text-soft); font-weight: 400; }
.wordmark:hover .name { color: var(--brand-text); }

/* On the deep turquoise header (#34995) its texts and links are white: the wordmark and the
   menu's own items. The panels the menu opens stay white, with their own colours. */
.site-header .wordmark, .site-header .wordmark .tld, .site-header .wordmark:hover .name { color: var(--on-brand); }
.site-header .wordmark:hover .name { text-decoration: underline; }
.site-nav > a, .site-nav > * > .link-button { color: var(--on-brand); }
.site-nav > a:hover, .site-nav > * > .link-button:hover { color: var(--on-brand); border-bottom-color: var(--light-antique-blue); }
.site-nav > a.is-current, .site-nav > * > .link-button.is-current { color: var(--on-brand); border-bottom-color: var(--on-brand); }
/* The item whose menu is open (#38350): white, in the link colour, so it is plain which one opened.
   The margin takes back the padding, so the items beside it don't move. */
.site-nav > * > .link-button[aria-expanded="true"], .site-nav > * > .link-button[aria-expanded="true"]:hover {
	background: var(--surface); color: var(--link-text); border-bottom-color: transparent;
	border-radius: var(--radius); padding-inline: 0.5rem; margin-inline: -0.5rem;
}

/* ---- hero bar ---- */

.hero {
	background: var(--highlight);
	background: linear-gradient(to right, var(--brand) 0%, var(--highlight) 100%);
	color: var(--on-brand);
	padding-inline: 1.5rem;
}

.hero-inner {
	max-width: var(--page);
	margin-inline: auto;
	padding-block: 2.75rem 5.5rem;
}

.hero-title {
	font-size: 2.25rem;
	letter-spacing: -0.01em;
	margin: 0 0 0.6rem;
	max-width: 22ch;
}

.hero-lead {
	margin: 0;
	max-width: 46ch;
	font-size: 1.125rem;
	color: #e4eefa;
}

/* ---- main ---- */

main {
	flex: 1;
	/* Light sand, deepening to sand at the edges (#35189). */
	background-color: var(--ground);
	box-shadow: inset 0 0 10vw var(--ground-edge);
	border-top: 10px solid var(--surface-pale-soft);
	padding-inline: 1.5rem;
	padding-block: 0 3.5rem;
}

main > * {
	max-width: var(--page);
	margin-inline: auto;
}

/* The white panel that overlaps the hero bar, as the generator does on salasanasi.fi. */
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.75rem;
	margin-top: -3rem;
	box-shadow: 0 2px 6px rgb(0 53 122 / 0.08);
}
.card-narrow { max-width: 28rem; margin-inline: auto; }

/* ---- sign-in with Authentik ---- */

.sso { display: block; text-align: center; text-decoration: none; }
.sso:hover { color: var(--on-brand); }
.sso + .sso { margin-top: 0.625rem; }
.secondary.sso { box-sizing: border-box; width: 100%; }
.secondary.sso:hover { color: var(--brand-text); }
.or { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0; color: var(--text-soft); font-size: 0.9375rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

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

.field { margin-bottom: 1.1rem; }

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

.field input {
	width: 100%;
	font: 400 1.0625rem var(--sans);
	color: var(--text);
	padding: 0.6rem 0.7rem;
	background: var(--surface);
	border: 1px solid var(--text-soft);
	border-radius: var(--radius);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.85rem 1.25rem;
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--border-light);
}

.primary {
	appearance: none;
	background: var(--brand);
	border: 1px solid var(--brand-line);
	color: var(--on-brand);
	font: 600 1.0625rem var(--sans);
	padding: 0.6rem 1.5rem;
	border-radius: var(--radius);
	cursor: pointer;
}
.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

.status { margin: 0.85rem 0 0; font-size: 1rem; color: var(--text-soft); }
.status.is-error { color: var(--alert-text); font-weight: 600; }

/* ---- room list ---- */

.rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }

.rooms li {
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 4px solid var(--highlight);
	border-radius: var(--radius);
	padding: 0.9rem 1.1rem;
}
.rooms h2 { font-size: 1.25rem; margin: 0 0 0.15rem; }
.rooms h2 a { text-decoration: none; }
.rooms h2 a:hover { text-decoration: underline; }
.room-slug { margin: 0; font: 0.9375rem var(--mono); color: var(--text-soft); }
.room-description { margin: 0.35rem 0 0; font-size: 1rem; line-height: 1.55; max-width: 44rem; }

/* ---- connection indicator (rooms) ---- */

.connection {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 1rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-soft);
}
.connection .dot {
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 50%;
	background: var(--border);
	flex: none;
}
.connection[data-state="live"] { color: var(--success-text); }
.connection[data-state="live"] .dot { background: var(--success); }
.connection[data-state="connecting"] .dot { background: var(--accent); }
.connection[data-state="down"] { color: var(--alert-text); }
.connection[data-state="down"] .dot { background: var(--alert); }

.notice {
	margin: 0;
	padding: 0.9rem 1.1rem;
	background: var(--surface-pale);
	border-left: 4px solid var(--highlight);
	border-radius: var(--radius);
	font-size: 1rem;
	line-height: 1.55;
}

/* ---- unread mentions (room list page) ---- */

.unread-mentions { margin-bottom: 1.75rem; }
.unread-mentions h2, .rooms-title { font-size: 1.25rem; margin: 0 0 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.mention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.mention-list a {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.55rem 0.85rem;
	border: 1px solid var(--border);
	border-left: 4px solid var(--accent);
	box-shadow: 0 0 0 1px var(--accent) inset;
	border-radius: var(--radius);
	background: light-dark(#fff8f2, #33271c);
	color: var(--text);
	text-decoration: none;
}
.mention-list a:hover .mention-meta b { text-decoration: underline; color: var(--brand-text); }
.mention-meta { font-size: 0.9375rem; color: var(--text-soft); }
.mention-meta b { color: var(--text); }
.mention-excerpt { font-size: 1rem; overflow-wrap: anywhere; }
.unread-mentions .status { margin: 0; }
/* Needs you above the unread mentions (#35359), spaced as one list. */
#needs-home:has(li:not([hidden])) { margin-bottom: 0.5rem; }

/* ---- room list: unread badge, new-room form ---- */

.room-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; }
.badge {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--on-brand);
	background: var(--link);   /* white on --highlight is 4.1:1; on --link 5.1:1 */
	border-radius: 999px;
	padding: 0.05rem 0.6rem;
	white-space: nowrap;
}
.badge[hidden] { display: none; }
/* The menu's number badges: a light inner rim sets their shape off the dark header, for
   eyes that can't tell the red from it (#35215). */
.site-nav .badge { box-shadow: inset 0 0 3px #ffe1e0; }
/* Orange is for what is addressed to you. */
.badge.is-mentions { background: var(--accent-text); }
/* A room's label on the room list: what waits for you there, leading to the oldest (#36951). */
a.room-waiting, a.room-waiting:hover { color: var(--on-brand); text-decoration: none; }
a.room-waiting:hover, a.room-waiting:focus-visible { text-decoration: underline; }

.new-room { margin-top: 1.5rem; border-top: 1px solid var(--border-light); padding-top: 1rem; }
.new-room summary { cursor: pointer; color: var(--link-text); font-weight: 600; }
.new-room summary:hover { color: var(--brand-text); }
.new-room form { margin-top: 1rem; }
.hint { margin: 0 0 0.4rem; font-size: 0.9375rem; color: var(--text-soft); }

code {
	font: 0.9em var(--mono);
	background: var(--surface-grey);
	border: 1px solid var(--border-light);
	padding: 0.08em 0.32em;
	border-radius: var(--radius);
}

.visually-hidden {
	position: absolute; width: 1px; height: 1px;
	margin: -1px; padding: 0; overflow: hidden;
	clip-path: inset(50%); white-space: nowrap;
}

/* ---- chat layout: the page never scrolls, the message pane does ---- */

.layout-chat { height: 100vh; height: 100dvh; min-height: 0; }
.layout-chat .hero-inner { padding-block: 1.1rem 3.2rem; }
.layout-chat .hero-title { font-size: 1.6rem; margin-bottom: 0.1rem; max-width: none; }
.layout-chat .hero-lead { font-size: 1rem; max-width: none; }
.layout-chat main { display: flex; flex-direction: column; min-height: 0; padding-bottom: 1rem; }
.layout-chat main > .chat { flex: 1; min-height: 0; width: 100%; }

.chat {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	position: relative;
	padding: 1rem 1.25rem 1.1rem;
	margin-top: -2.5rem;
}
/* A file dragged over the page (#14597): the whole window says where it goes. */
.chat.is-dropping::after {
	content: "Drop files to attach them to your message";
	position: fixed; inset: 0.75rem; z-index: 50; pointer-events: none;
	display: flex; align-items: center; justify-content: center;
	background: light-dark(rgb(234 242 250 / 0.88), rgb(11 19 22 / 0.88)); border: 3px dashed var(--highlight); border-radius: 8px;
	font: 600 1.375rem var(--sans); color: var(--brand-text);
}

.chat-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; }
.chat-bar .connection { margin: 0; }
.chat-bar { position: relative; }
/* The dot stays; "Live" itself is for screen readers only, and the TODO list takes its place. */
.bar-start { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.bar-fold { display: none; }   /* only on a phone (#28488) */
/* Live (#39525): no dot either; connecting and down still show, with their words. */
.chat-bar .connection[data-state="live"] {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.connection[data-state="live"] #connection-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.todo > summary {
	cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 0.35rem;
	font-weight: 600; font-size: 0.9375rem; color: var(--link-text); padding: 0.1rem 0.5rem;
	border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.todo > summary::-webkit-details-marker { display: none; }
.todo > summary::after { content: ""; --i: url("icons/material/expand-more.svg"); }
.todo[open] > summary::after { --i: url("icons/material/expand-less.svg"); }
.todo-count { background: var(--brand); color: var(--on-brand); border-radius: 999px; font-size: 0.75rem; padding: 0 0.45rem; line-height: 1.5; }
.todo-count[hidden] { display: none; }
/* The list opens over the conversation, under the bar, rather than pushing it down. */
.todo-pop {
	position: absolute; left: 0; top: calc(100% + 0.35rem); z-index: 5;
	width: min(35rem, 100%); max-height: 60vh; overflow-y: auto;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: 0 8px 24px rgb(0 53 122 / 0.18); padding: 0.6rem 0.8rem;
}
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.todo-item { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.3rem 0.2rem; border-bottom: 1px solid var(--border-light); }
.todo-item:last-child { border-bottom: 0; }
.todo-item > input { accent-color: var(--success-line); flex: none; }
.todo-item > details { flex: 1; min-width: 0; }
.todo-item summary { cursor: pointer; overflow-wrap: anywhere; }
.todo-title { font-weight: 600; }
.todo-number { font-variant-numeric: tabular-nums; color: var(--text-soft); font-size: 0.875rem; }
.todo-item.is-target { animation: target 2.4s ease-out; }
/* !3: a link to item 3 of this room's TODO list. */
.markdown a.todoref { font-weight: 600; text-decoration: none; border-bottom: 1px dotted currentColor; color: var(--success-text); }
.markdown a.todoref:hover { border-bottom-style: solid; }
.todo-meta { font-size: 0.8125rem; color: var(--text-soft); }
.todo-item.is-done .todo-title { text-decoration: line-through; color: var(--text-soft); font-weight: 400; }
.todo-description { margin: 0.35rem 0 0.2rem; font-size: 0.9375rem; }
.todo-from { font-size: 0.8125rem; margin-right: 0.75rem; }
.todo-remove { font-size: 0.8125rem; }
.todo-pop .hint { margin: 0; }

/* min-width: 0 all the way down: a chip with a long status shrinks to the screen, its status
   cut with an ellipsis, instead of pushing the page sideways on a phone. */
.members { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; min-width: 0; max-width: 100%; }
.member {
	max-width: 100%;
	min-width: 0;
	display: inline-flex;
	align-items: baseline;
	gap: 0.35rem;
	font-size: 0.875rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.05rem 0.65rem;
	background: var(--surface);
	font-family: inherit;
	line-height: inherit;
	color: inherit;
	text-align: start;
}
/* When a chip must shrink, the status gives way first (its much larger flex-shrink); the
   name shrinks only if it alone is wider than the screen. */
/* Profile images (#38928): 20 × 20 in front of the author's name; stored 128 × 128. */
.avatar { display: inline-block; flex: none; width: 20px; height: 20px; border-radius: 50%;
	vertical-align: -0.3em; margin-right: 0.3rem; object-fit: cover; }
.avatar.is-letter { display: inline-grid; place-items: center; font-size: 0.7rem; font-weight: 700; line-height: 1;
	background: var(--surface-grey); color: var(--text-soft); border: 1px solid var(--border); box-sizing: border-box; }
.is-agent .message-head .avatar { border-radius: 4px; }   /* an agent's square, a person's round */
.msg-who .avatar { margin-right: -0.2rem; align-self: center; }
.avatar.is-agent { border-radius: 4px; }
.agent-who .avatar { margin-right: 0.4rem; }
.avatar-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 0.25rem 0; }
.avatar.is-room, .avatar.is-room-icon { border-radius: 6px; }   /* rooms (#38950): a rounded square */
.avatar.is-person { border-radius: 50%; }
.avatar.is-room-icon { width: 32px; height: 32px; font-size: 1rem; margin-right: 0.5rem; vertical-align: -0.15em; }
.rooms-menu-list .avatar { align-self: center; }
.avatar.is-large { width: 64px; height: 64px; font-size: 1.6rem; vertical-align: middle; }
/* An agent's icon (#40447): the preview before it's saved; the saved one is an SVG image. */
.avatar.is-icon { display: inline-grid; place-items: center; }
.avatar.is-icon .icon { width: 62.5%; height: 62.5%; vertical-align: 0; }
.icon-pick { margin: 0.75rem 0 0.5rem; container-type: inline-size; }
.icon-pick-body { display: flex; flex-direction: column; gap: 0.75rem; }
@container (min-width: 40rem) {   /* beside the grid when there's room (#40452) */
	.icon-pick-body { flex-direction: row; align-items: flex-start; }
	.icon-pick-body .icon-pick-colours { flex-direction: column; align-items: flex-start; flex-grow: 1; }
}
.icon-pick-label { margin: 0 0 0.25rem; font-weight: 600; }
.icon-pick-label .hint { font-weight: 400; }
.icon-pick-colours { display: flex; align-items: center; gap: 0.5rem 0.75rem; flex-wrap: wrap; }
.icon-pick-colours label { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; }
.icon-pick-colours .icon-pick-auto-label { font-weight: 400; }
.icon-pick-colours input[type="checkbox"] { width: auto; margin: 0; flex: none; }
.icon-pick-colours input[type="color"] { width: 2.5rem; height: 2rem; padding: 0.1rem; vertical-align: middle; }
.icon-pick-colours input[type="color"]:disabled { opacity: 0.5; }
/* The icon grid (#40449): ten across, ten rows showing, each cell at least the 24 × 24 px
   minimum target size (WCAG 2.5.8). */
.icon-grid { width: max-content; max-width: 100%; max-height: calc(10 * 2.25rem + 3rem); overflow-y: auto; box-sizing: border-box;
	padding: 0.25rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.icon-grid:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.icon-grid-head { position: sticky; z-index: 1; top: -0.25rem; padding: 0.3rem 0.2rem 0.15rem; font-size: 0.8rem; color: var(--text-soft); background: var(--surface); }
.icon-grid-cells { display: grid; grid-template-columns: repeat(10, minmax(24px, 2.25rem)); }
.icon-grid [role="option"] { display: grid; place-items: center; aspect-ratio: 1; min-width: 24px; min-height: 24px;
	border-radius: 4px; cursor: pointer; color: var(--text); }
.icon-grid [role="option"] .icon { width: 1.5rem; height: 1.5rem; max-width: 75%; vertical-align: 0; }
.icon-grid [role="option"]:hover { background: var(--surface-grey); }
.icon-grid [role="option"][aria-selected="true"] { background: var(--text); color: var(--surface); }
.icon-grid:focus-visible [role="option"][aria-selected="true"] { outline: 3px solid var(--accent); outline-offset: -1px; }
/* Its profile image (#39525), in the chip's line. */
.member-avatar { width: 18px; height: 18px; margin: 0 -0.1rem 0 -0.45rem; align-self: center; }
.member-name { font-weight: 600; flex: 0 1 auto; min-width: 2.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-state { color: var(--text-soft); flex: 0 1000 auto; min-width: 0; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A name is a switch (#38069): picked, only that one's messages show. */
.member { cursor: pointer; }
.member:hover { border-color: var(--link-text); }
.member[aria-pressed="true"] { background: var(--link-text); border-color: var(--link-text); border-style: solid; }
.member[aria-pressed="true"] .member-name, .member[aria-pressed="true"] .member-state { color: var(--surface); }
.message.is-filtered-out { display: none; }
.filter-note {
	margin: 0; padding: 0.35rem 0.85rem; display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline;
	font-size: 0.9375rem; background: var(--surface-pale); border-bottom: 1px solid var(--border);
}
.filter-note[hidden] { display: none; }
/* by, to, naming (#38428): three switches, read as part of the sentence. */
.filter-fields { display: inline-flex; gap: 0.25rem; }
.filter-field {
	font: inherit; line-height: 1.3; padding: 0.05rem 0.55rem; cursor: pointer;
	background: var(--surface); color: var(--link-text); border: 1px solid var(--border); border-radius: 999px;
}
.filter-field:hover { border-color: var(--link-text); }
.filter-field[aria-pressed="true"] { background: var(--link-text); border-color: var(--link-text); color: var(--surface); }
.member.is-listening { border-color: var(--success-line); }
.member.is-working { border-color: var(--accent); }
.member.is-working .member-state { color: var(--accent-ink); }
/* Not here now: last seen, quietly (#9029). */
.member.is-away { border-style: dashed; background: var(--surface-grey); }
.member.is-away .member-name { font-weight: 400; color: var(--text-soft); }
.member.is-away .member-state { font-size: 0.8125rem; }

.messages {
	flex: 1;
	min-height: 12rem;
	overflow-y: auto;
	/* No frame of its own: the messages sit on the card, as on a phone (#35207). */
	/* preserve() in chat.js does the anchoring, the same in every browser. */
	overflow-anchor: none;
	overscroll-behavior: contain;
}
.messages:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.load-earlier { text-align: center; margin: 0.25rem 0 0.5rem; }
.load-earlier button {
	border: 1px solid var(--border) !important; border-radius: 999px; background: var(--surface);
	padding: 0.25rem 0.9rem !important; font-size: 0.9375rem;
}
.load-earlier button:disabled { color: var(--text-soft); cursor: default; }
.load-earlier[hidden] { display: none; }

.message-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }

.day-divider { display: flex; align-items: center; gap: 0.75rem; color: var(--text-soft); font-size: 0.875rem; margin: 0.5rem 0; }
.day-divider::before, .day-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.message {
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 4px solid var(--border);
	border-radius: var(--radius);
	padding: 0.5rem 0.85rem 0.6rem;
	max-width: 100%;
	scroll-margin: 0.75rem;
	transition: border-color 1.2s ease, background-color 1.2s ease;
	position: relative;
	/* Vertical panning and zoom stay the browser's; a sideways swipe is ours (reply). */
	touch-action: pan-y pinch-zoom;
}
/* Swiping right to reply: an arrow shows behind the message, and it snaps back on release. */
.message::before {
	content: ""; --i: url("icons/material/reply.svg");
	position: absolute; left: -2.1rem; top: 50%;
	transform: translateY(-50%) scale(0.6); opacity: 0;
	color: var(--link-text); font-size: 1.4rem; font-weight: 600;
	transition: opacity 0.1s, transform 0.1s;
	pointer-events: none;
}
.message.is-swiped::before { opacity: 1; transform: translateY(-50%) scale(1); }
.message.is-settling { transition: transform 0.2s ease-out; }
/* Mine lean right, everyone else's left, so the two sides of a conversation separate. */
.message { margin-right: 2rem; }
.message.is-mine { margin-right: 0; margin-left: 2rem; }
.message.is-mine { border-left-color: var(--highlight); background: var(--surface-pale); }
.message.is-agent { border-left-color: var(--brand-line); }
/* On its way (#37763): what was just sent, as the last row under the messages, with a bar until
   the server has it. */
.message.is-sending { margin-top: 0.5rem; border-style: dashed; border-left-style: solid; }
.message.is-sending::before { content: none; }
.sending-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-soft);
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.sending-files { margin: 0.25rem 0 0; color: var(--text-soft); font-size: 0.875rem; }
.sending-foot { margin: 0.4rem 0 0; display: flex; align-items: center; gap: 0.6rem; font-size: 0.875rem; color: var(--text-soft); }
.sending-bar { flex: 1; min-width: 0; height: 0.5rem; accent-color: var(--highlight); }
.drop-bar { width: 100%; height: 0.5rem; margin-top: 0.75rem; accent-color: var(--highlight); }
.message.is-notification { border-left-color: var(--brand-line); background: var(--surface-pale); }
/* Unread is blue; orange is reserved for what is addressed to you (.mentions-me, below). */
.message.is-unread { border-left-color: var(--highlight); box-shadow: 0 0 0 1px var(--highlight) inset; }
.message.is-target { animation: target 2.4s ease-out; }
@keyframes target { from { background-color: light-dark(#ffe7d4, #4a3320); } }

.message-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.5rem; margin: 0 0 0.15rem; font-size: 0.9375rem; }
.author { font-weight: 600; }
a.author { color: inherit; text-decoration: none; }   /* an agent's name, to its page (#39420) */
a.author:hover, a.author:focus-visible { text-decoration: underline; }
.tag {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--brand-text);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0 0.35rem;
}
.tag-notification { color: var(--on-brand); background: var(--brand); border-color: var(--brand-line); }
/* The operations on a message look like Send, only smaller (0.18.0). */
.copy-md, .reply-md, .task-md, .edit-md, .escalate-md, .delete-md, .save-md, .claim .claim-action {
	margin-left: auto;
	appearance: none;
	border: 1px solid var(--brand-line);
	border-radius: var(--radius);
	background: var(--brand);
	color: var(--on-brand);
	padding: 0.1rem 0.55rem;
	font: 600 0.8125rem/1.5 var(--sans);
	cursor: pointer;
}
.copy-md:hover, .copy-md:focus-visible, .reply-md:hover, .reply-md:focus-visible,
.task-md:hover, .task-md:focus-visible, .edit-md:hover, .edit-md:focus-visible,
.escalate-md:hover, .escalate-md:focus-visible, .claim .claim-action:hover {
	background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); text-decoration: none;
}
.escalate-md:disabled { opacity: 0.6; cursor: default; }
.message-foot .escalate-md { margin-left: 0; }
/* Escalate with its close icon joined on (#40022), as an option with its pen. */
.escalate-pair { display: inline-flex; }
.escalate-pair .escalate-md { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.escalate-decline { appearance: none; cursor: pointer; margin-left: 1px; padding: 0.1rem 0.5rem;
	font: 600 0.8125rem/1.5 var(--sans); color: var(--on-brand); background: color-mix(in srgb, var(--brand) 55%, var(--surface));
	border: 1px solid var(--brand-line); border-radius: 0 var(--radius) var(--radius) 0; }
.escalate-decline:hover, .escalate-decline:focus-visible { background: var(--brand-hover); border-color: var(--brand-hover); }
.escalate-decline:disabled { opacity: 0.6; cursor: default; }
.escalation-undo { appearance: none; padding: 0; border: 0; background: none; color: var(--link, var(--brand));
	font: inherit; font-style: normal; text-decoration: underline; cursor: pointer; }
.escalation { font-size: 0.8125rem; color: var(--text-soft); font-style: italic; }
.escalation.is-done { color: var(--brand-text); font-style: normal; font-weight: 600; }
/* The header's buttons stay together on one row, pushed right, with the time after them. */
.msg-ops { order: 1; margin-left: auto; display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 0.3rem; }
/* Who, when and what: the author, the time, the tags (#10253). First on a wide screen. */
.msg-who { order: 0; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.5rem; min-width: 0; }
.msg-who .permalink { margin-left: 0; }
.agent-tools { display: inline-flex; align-items: baseline; gap: 0.5rem; font-size: 0.85em; }   /* · Console Usage (#41541) */
.agent-tools a { color: var(--ink-soft); text-decoration: none; }
.agent-tools a:hover, .agent-tools a:focus-visible { text-decoration: underline; }
.agent-tools-sep { color: var(--ink-soft); }
.msg-ops > * { margin-left: 0; }

/* The #id before the time: copies "#123". Black on white, apart from the blue buttons. */
.msgid-md {
	appearance: none; display: inline-flex; align-items: center; gap: 0.25rem;
	background: var(--surface); color: var(--text); border: 1px solid var(--text); border-radius: var(--radius);
	padding: 0.1rem 0.45rem; font: 600 0.8125rem/1.5 var(--sans); font-variant-numeric: tabular-nums; cursor: pointer;
}
.msgid-md:hover { background: var(--surface-grey); }
.msgid-icon { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.4; }
.msgid-icon rect:last-child { fill: var(--surface); }
.msgid-md.is-copied { border-color: var(--success-line); color: var(--success-text); }
.msgid-md.is-copied .msgid-icon { display: none; }
.msgid-md.is-copied::before { content: ""; --i: url("icons/material/check.svg"); }

.copy-md.is-done { background: var(--success); border-color: var(--success-line); }
/* #123: a link to that message. */
.markdown a.msgref { font-weight: 600; text-decoration: none; border-bottom: 1px dotted currentColor; font-variant-numeric: tabular-nums; }
.markdown a.msgref:hover { border-bottom-style: solid; }
/* #hashtag (#25512): a link to the messages tagged with it. */
.markdown a.hashtag { font-weight: 600; text-decoration: none; color: var(--brand-text); }
.markdown a.hashtag:hover { text-decoration: underline; }
.edited-mark { font-size: 0.8125rem; color: var(--text-soft); font-style: italic; text-decoration: none; }
.edited-mark:hover { text-decoration: underline; }
.permalink { margin-left: auto; color: var(--text-soft); text-decoration: none; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.permalink:hover { color: var(--link-text); text-decoration: underline; }
.mention { color: var(--brand-text); font-weight: 600; background: var(--surface-pale); border-radius: var(--radius); padding: 0 0.15em; }
.mention.is-me { color: var(--on-brand); background: var(--accent-text); }
/* Addressed to you (@you or @everyone): orange, and it stays after reading. Declared after
   the unread, mine, agent and notification styles so it wins over all of them. */
.message.mentions-me {
	border-left-color: var(--accent);
	box-shadow: 0 0 0 2px var(--accent) inset;
	/* The light theme keeps its own (#35223); the dark theme's is the brand (#40238), where its
	   text is 8.2:1, soft text 4.6:1 and links 5.3:1 (#40211). */
	background: light-dark(var(--surface-own), var(--brand));
}
.claim { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.75rem; margin: 0 0 0.25rem; font-size: 0.875rem; color: var(--text-soft); }
/* A box of its own (#36268). */
.claim { border: solid 1px var(--text-soft); padding: 0.5rem; margin-bottom: 1rem; border-radius: 0.5rem; }
.claim:empty, .claim[hidden] { display: none; }
/* Accept and Reopen side by side, together at the row's end (#30343). */
.claim-decide { margin-left: auto; display: inline-flex; gap: 0.4rem; align-items: baseline; }
.claim .claim-decide .claim-action { margin-left: 0; }
.claim.is-claimed .claim-state { color: var(--brand-text); font-weight: 600; }
/* Consensus (#10554): the final synthesis stands out in green; an agreed thread folds up. */
.tag-consensus { border-color: var(--success-line); color: var(--success-text); }
.tag-consensus.is-synthesis { border-color: var(--brand-line); color: var(--brand-text); }
/* Only the consensus's current final is green: a reopened one's earlier final is not. */
.message.is-consensus-final.is-current-final { border: 2px solid var(--success-line); border-left-width: 6px; background: light-dark(#f1faf3, #16332b); }
.consensus-more { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.option-md.is-secondary { background: var(--surface); color: var(--brand-text); }
.option-md.is-secondary:hover:not(:disabled) { background: var(--surface-pale); color: var(--brand-text); }
.message.is-folded { display: none; }
.consensus-state { margin: 0 0 0.3rem; font-size: 0.875rem; color: var(--text-soft); }
.message.is-consensus-start .consensus-state { color: var(--success-text); font-weight: 600; }
.consensus-toggle { font-size: 0.875rem; }
.consensus-foot { margin: 0.5rem 0 0; }
/* The discussion inside the green final (#11313): compact, in order, each part tagged. */
.consensus-thread { list-style: none; margin: 0.6rem 0 0.2rem; padding: 0.5rem 0 0.5rem 0.9rem;
	border-left: 3px solid var(--success-line); display: grid; gap: 0.55rem; }
.ct-item { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 0.45rem 0.7rem; }
.ct-item.is-synthesis { border-color: var(--brand-line); }
.ct-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.5rem; margin: 0 0 0.2rem; font-size: 0.875rem; }
.ct-time { color: var(--text-soft); }
.ct-id { margin-left: auto; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.ct-body { font-size: 0.9375rem; }
.ct-files { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--text-soft); }
/* Edited and resent: the old one stays, faded, pointing at the new one. */
.message.is-replaced > :not(.message-head):not(.claim) { opacity: 0.55; }
.claim.is-replaced { font-style: italic; }
.claim.is-claimed .claim-state::before { content: ""; --i: url("icons/material/pending.svg"); }
.claim.is-done .claim-state { color: var(--success-text); font-weight: 600; }
.claim.is-done .claim-state::before { content: ""; --i: url("icons/material/check.svg"); }
.reply-quote {
	display: flex; flex-direction: column; gap: 0.05rem;
	margin: 0.1rem 0 0.4rem; padding: 0.3rem 0.6rem;
	border-left: 3px solid var(--border); background: var(--surface-grey); border-radius: var(--radius);
	text-decoration: none; color: var(--text-soft); font-size: 0.875rem;
}
.reply-quote:hover { border-left-color: var(--highlight); }
.reply-author { font-weight: 600; color: var(--text); }
.reply-excerpt { overflow-wrap: anywhere; }
.replying {
	display: flex; align-items: center; gap: 0.5rem;
	padding: 0.35rem 0.6rem; border-left: 3px solid var(--highlight);
	background: var(--surface-pale); border-radius: var(--radius); font-size: 0.9375rem;
}
.replying[hidden] { display: none; }
.replying.editing { border-left-color: var(--accent); background: light-dark(#fdf1e8, #33271c); }
.replying-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replying-cancel { appearance: none; border: 0; background: none; font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--text-soft); }
/* The foot: Reply on the left, "Seen by" on the right. */
/* Reply options: an agent's suggested answers, as buttons under the message (0.20.0). */
.options { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.75rem 0 0.6rem; }
.option-md {
	appearance: none; border: 1px solid var(--brand-line); border-radius: var(--radius);
	background: var(--brand); color: var(--on-brand);
	font: 600 0.9375rem/1.4 var(--sans); padding: 0.35rem 1rem; cursor: pointer;
}
.option-md:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.option-md:disabled { opacity: 0.45; cursor: default; }
.option-md.is-chosen { opacity: 1; background: var(--success); border-color: var(--success-line); }
.option-md.is-chosen::before { content: ""; --i: url("icons/material/check.svg"); }
.option-md.is-failed { background: var(--alert); border-color: var(--alert-line); }
.options-chosen { font-size: 0.8125rem; color: var(--text-soft); }
/* Multiple choice: one checkbox per option, a column of them, and Send answer. */
.options.is-multi { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.option-check { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.8rem;
	border: 1px solid var(--brand-line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 600; }
.option-check input { accent-color: var(--brand-line); width: 1.05rem; height: 1.05rem; }
.option-check:has(input:checked) { background: var(--surface-pale); }
.option-check.is-chosen { border-color: var(--success-line); background: light-dark(#e8f5ec, #16332b); }
.option-check:has(input:disabled) { cursor: default; }
.option-check:not(.is-chosen):has(input:disabled) { opacity: 0.5; }
.option-send { margin-top: 0.3rem; }
.message-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.75rem; margin: 0.3rem 0 0; }
.message-foot:empty { display: none; }
.message-foot .reply-md { margin-left: 0; }
.receipt { margin-left: auto; font-size: 0.8125rem; color: var(--text-soft); text-align: right; }
.receipt-reply { white-space: nowrap; }

/* Markdown from the server */
.markdown { font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown p, .markdown ul, .markdown ol, .markdown pre, .markdown blockquote, .markdown table { margin: 0 0 0.6rem; }
.markdown ul, .markdown ol { padding-left: 1.4rem; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { font-size: 1.0625rem; margin: 0.8rem 0 0.35rem; }
.markdown h1 { font-size: 1.25rem; }
.markdown h2 { font-size: 1.125rem; }
.markdown blockquote { border-left: 3px solid var(--border); margin-left: 0; padding-left: 0.8rem; color: var(--text-soft); }
.markdown pre {
	background: var(--surface-grey);
	border: 1px solid var(--border-light);
	border-left: 3px solid var(--highlight);
	border-radius: var(--radius);
	padding: 0.6rem 0.8rem;
	overflow-x: auto;
	overflow-wrap: normal;
}
.markdown pre code { background: none; border: 0; padding: 0; font-size: 0.875rem; line-height: 1.6; }
/* Code in a message: a copy button at its top right, on hover or after a tap (#25866, #27918);
   a tick once copied. */
#message-list .markdown code, #message-list .markdown pre { position: relative; }
#message-list .markdown pre code { position: static; }
.code-copy {
	appearance: none; position: absolute; top: -0.6rem; right: -0.6rem; z-index: 2;
	width: 1.5rem; height: 1.5rem; padding: 0; cursor: pointer;
	background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2300357a' stroke-width='1.4'%3E%3Crect x='5.5' y='5.5' width='8' height='8' rx='1.5'/%3E%3Cpath d='M10.5 3.5v-1a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h1'/%3E%3C/svg%3E") center / 0.95rem no-repeat;
	border: 1px solid var(--border); border-radius: var(--radius);
}
.code-copy:hover { border-color: var(--brand-line); background-color: var(--surface-pale); }
pre > .code-copy { top: 0.35rem; right: 0.35rem; }
.code-copy.is-copied {
	border-color: var(--success-line);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23114B59' stroke-width='2'%3E%3Cpath d='M3 8.5l3 3 7-7'/%3E%3C/svg%3E");
}
.markdown table { border-collapse: collapse; font-size: 0.9375rem; display: block; overflow-x: auto; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 0.25rem 0.55rem; text-align: left; }
.markdown th { background: var(--surface-pale); }
.markdown hr { border: 0; border-top: 1px solid var(--border); margin: 0.8rem 0; }

/* A long document in Markdown: the privacy policy. Headings as on a page, not in a message. */
.prose { font-size: 1.0625rem; }
.prose h1 { font-size: 1.5rem; margin-bottom: 0.6rem; }
.prose h2 { font-size: 1.25rem; margin-top: 1.6rem; }
.prose p, .prose ul { max-width: var(--measure); }
.prose td { vertical-align: top; }
/* Words whole in the tables: they scroll sideways on a phone rather than break mid-word. */
.prose table { overflow-wrap: normal; }

/* The attachment viewer (#10561). */
.viewer { width: min(62rem, 95vw); max-height: 90vh; padding: 0; border: 1px solid var(--border);
	border-radius: var(--radius); box-shadow: 0 12px 40px rgb(0 0 0 / 0.3); }
.viewer::backdrop { background: rgb(0 20 50 / 0.55); }
.viewer-head { position: sticky; top: 0; display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.9rem;
	background: var(--surface); border-bottom: 1px solid var(--border); }
.viewer-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-tools { display: inline-flex; gap: 0.9rem; }
/* Previous / next file of the same message (#35267). */
.viewer-step { display: inline-flex; align-items: center; gap: 0.35rem; flex: none; }
.viewer-step[hidden] { display: none; }
.viewer-nav { appearance: none; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius);
	font-size: 1.25rem; line-height: 1; width: 2rem; height: 2rem; cursor: pointer; color: var(--text); }
.viewer-nav:hover { border-color: var(--brand-line); background: var(--surface-pale); }
.viewer-count { font-size: 0.875rem; color: var(--text-soft); white-space: nowrap; }
.viewer-tools .link-button, .viewer-head > .link-button { font-size: 0.9375rem; }
.viewer-close { appearance: none; border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--text-soft); }
.viewer-body { max-height: calc(90vh - 3rem); overflow: auto; }
.viewer-body img, .viewer-body video { display: block; max-width: 100%; max-height: calc(90vh - 3.2rem); margin: 0 auto; }
.viewer-code { margin: 0; padding: 0.9rem 1rem; font: 400 0.875rem/1.55 var(--mono); white-space: pre; tab-size: 4; background: light-dark(#f6f8fa, #0f191c); }
.viewer-code code { font: inherit; background: none; padding: 0; }
.viewer-note { padding: 0.9rem 1rem; margin: 0; }
.viewer-note + .viewer-actions { padding-top: 0; }
.attachments .is-video .file-name::before { content: ""; --i: url("icons/material/play-arrow.svg"); }
.attachments { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* No width: auto here: that overrides the width attribute, and an image not loaded yet then
   takes no room and pushes everything below it down when it arrives. The attributes give the
   width, height: auto derives the height from their ratio, and object-fit keeps a capped one
   undistorted. */
.attachments img {
	display: block;
	max-width: min(100%, 28rem);
	max-height: 22rem;
	height: auto;
	object-fit: contain;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface-grey);
}
.attachments .is-image { max-width: 100%; }
.attachments .is-file a,
.pending li {
	display: inline-flex;
	align-items: baseline;
	gap: 0.5rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	padding: 0.3rem 0.6rem;
	font-size: 0.9375rem;
	text-decoration: none;
}
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-size { color: var(--text-soft); font-size: 0.875rem; white-space: nowrap; }

/* Sticky inside the pane: stays at the bottom of what is visible, whatever the layout. */
.new-pill {
	position: sticky;
	bottom: 0.5rem;
	display: block;
	margin: 0.5rem auto 0;
	appearance: none;
	background: var(--brand);
	color: var(--on-brand);
	border: 0;
	border-radius: 999px;
	font: 600 0.9375rem var(--sans);
	padding: 0.4rem 1rem;
	box-shadow: 0 2px 8px rgb(0 53 122 / 0.3);
	cursor: pointer;
	z-index: 2;
}
.new-pill[hidden] { display: none; }

/* The round "to the end" button: bottom right of the conversation, above the composer. */
.to-end-holder {
	position: sticky;
	bottom: 0.75rem;
	height: 0;
	display: flex;
	justify-content: flex-end;
	overflow: visible;
	z-index: 2;
	pointer-events: none;
}
.to-end {
	pointer-events: auto;
	transform: translateY(-100%);
	width: 2.5rem;
	height: 2.5rem;
	margin-right: 0.25rem;
	border-radius: 50%;
	border: 1px solid var(--on-brand);
	background: var(--brand);
	color: var(--on-brand);
	font: 600 1.25rem/1 var(--sans);
	box-shadow: 0 2px 8px rgb(0 53 122 / 0.35);
	cursor: pointer;
	appearance: none;
}
.to-end:hover { background: var(--brand-hover); }
/* "… is typing": bottom left of the conversation, at the height of the ↓ (#8702). */
.typing-holder {
	position: sticky; bottom: 0.75rem; height: 0; display: flex; justify-content: flex-start;
	overflow: visible; z-index: 2; pointer-events: none;
}
.typing {
	transform: translateY(-100%); margin: 0 0 0 0.25rem; max-width: 70%;
	padding: 0.2rem 0.7rem; border-radius: 999px; background: var(--surface);
	border: 1px solid var(--border); box-shadow: 0 2px 8px rgb(0 53 122 / 0.15);
	font-size: 0.875rem; font-style: italic; color: var(--text-soft);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.typing[hidden] { display: none; }
.to-end[hidden] { display: none; }

.composer { display: flex; flex-direction: column; gap: 0.5rem; position: relative; }
/* Distraction-free writing (#27734): the composer over the whole window, the box as tall as it
   can be, a readable line; toasts wait until it's closed. */
.write-toggle { font-size: 1.1rem; line-height: 1; padding: 0.35rem 0.6rem; }
.write-toggle[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
body.is-writing .composer {
	position: fixed; inset: 0; z-index: 50; background: var(--surface);
	padding: 1.25rem max(1rem, calc((100vw - 52rem) / 2));
}
body.is-writing .composer textarea { flex: 1; height: auto !important; font-size: 1.125rem; line-height: 1.65; padding: 1rem 1.1rem; }
body.is-writing .mention-suggest { bottom: auto; top: 3.5rem; }
body.is-writing .toasts { display: none; }
/* @mention suggestions, above the message box. */
.mention-suggest {
	position: absolute; left: 0; bottom: calc(100% - 0.25rem); z-index: 6;
	list-style: none; margin: 0; padding: 0.3rem; min-width: 16rem; max-width: min(28rem, 100%);
	max-height: 16rem; overflow-y: auto;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: 0 6px 18px rgb(0 53 122 / 0.18);
}
.mention-suggest[hidden] { display: none; }
.mention-option { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.3rem 0.55rem; border-radius: var(--radius); cursor: pointer; }
.mention-option.is-active { background: var(--brand); color: var(--on-brand); }
.mention-option-name { font-weight: 600; }
.mention-option-note { font-size: 0.8125rem; color: var(--text-soft); }
.mention-option-online { margin-left: auto; font-size: 0.75rem; color: var(--success-text); font-weight: 600; }
.mention-option.is-active .mention-option-note, .mention-option.is-active .mention-option-online { color: var(--on-brand); }
.composer textarea {
	width: 100%;
	resize: none;
	font: 400 1.0625rem/1.45 var(--sans);
	color: var(--text);
	padding: 0.55rem 0.7rem;
	background: var(--surface);
	border: 1px solid var(--text-soft);
	border-radius: var(--radius);
	min-height: 3.2rem;
	height: 3.2rem;   /* empty; typing grows it (autosize) */
}
.composer-actions { display: flex; align-items: center; gap: 0.75rem; }
.composer-actions .status { margin: 0; flex: 1; }
.composer-actions .primary { padding: 0.45rem 1.4rem; }

.attach { position: relative; cursor: pointer; color: var(--link-text); font-weight: 600; font-size: 1rem; }
.attach:hover { color: var(--brand-text); text-decoration: underline; }
.attach input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.attach:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

.pending { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pending[hidden] { display: none; }
.pending li { align-items: center; }
.pending img { width: 2.5rem; height: 2.5rem; object-fit: cover; border-radius: var(--radius); }
.pending .marker { font: 600 0.8125rem var(--mono); color: var(--brand-text); background: var(--surface-pale); border-radius: var(--radius); padding: 0 0.3rem; }
.pending li.is-dropped { opacity: 0.55; }
.pending li.is-dropped img { filter: grayscale(1); }
.dropped-note { font-size: 0.8125rem; color: var(--alert-text); }
.attachments .is-image { display: flex; flex-direction: column; gap: 0.2rem; }
.image-caption { font: 600 0.8125rem var(--mono); color: var(--text-soft); }
.pending .remove {
	appearance: none; border: 0; background: none; color: var(--text-soft);
	font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 0.15rem;
}
.pending .remove:hover { color: var(--alert-text); }

.send-failed {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 0.8rem;
	background: light-dark(#fdf0f0, #3b1d24);
	border: 1px solid var(--alert-line);
	border-left: 4px solid var(--alert-line);
	border-radius: var(--radius);
	color: var(--alert-text);
	font-size: 0.9375rem;
	font-weight: 600;
}
.send-failed[hidden] { display: none; }
.send-failed span { flex: 1; }
.retry {
	flex: none;
	appearance: none;
	background: var(--alert);
	border: 1px solid var(--alert-line);
	color: var(--on-brand);
	font: 600 0.9375rem var(--sans);
	padding: 0.35rem 1rem;
	border-radius: var(--radius);
	cursor: pointer;
}
.retry:hover { background: #9e1f1f; }

/* ---- notifications page ---- */

.notify-card { max-width: 36rem; }
/* Settings in two columns (#34334): the contents, sticky, 30%; the settings, 70%. Narrower
   than an iPad, one column, the contents first, scrolling away with the page. */
.settings { container-type: inline-size; max-width: var(--page); margin-inline: auto; margin-top: -3rem; }   /* both columns overlap the hero, as a card does (#34336) */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: start; }
.settings .notify-card { max-width: none; margin: 0; }
.settings-toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1.1rem;
	box-shadow: 0 2px 6px rgb(0 53 122 / 0.08); }
.settings-toc-title { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-soft); margin: 0 0 0.4rem; }
.settings-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.9375rem; }
.settings-toc a { text-decoration: none; }
.settings-toc a:hover, .settings-toc a:focus-visible { text-decoration: underline; }
.settings-toc a.is-current { font-weight: 700; color: var(--text); }
.settings fieldset[id] { scroll-margin-top: calc(var(--header-stick, 0px) + 1rem); }
@container (min-width: 42rem) {
	.settings-grid { grid-template-columns: 3fr 7fr; }
	.settings-toc { position: sticky; top: 1rem; }
}
.features-form { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
/* Each section a card of its own (#35470): consecutive boxes, the notification form's three among them. */
.settings-cards { display: grid; gap: 1.25rem; min-width: 0; }
.settings-cards .card { margin: 0; padding: 1.5rem 1.75rem; border-top: 1px solid var(--border); }
.settings-cards .choice { margin-bottom: 0; }
.settings-cards .choice > legend { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.75rem; }
/* A card with parts (#35519, Notifications): its title as the other cards' legends, each part's
   legend a step smaller, a line between the parts. */
.settings-title { font-size: 1.125rem; font-weight: 700; margin: 0 0 0.9rem; scroll-margin-top: calc(var(--header-stick, 0px) + 1rem); }
.settings-cards .settings-part > legend { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem;
	float: left; width: 100%; }   /* floated: a fieldset's top border would run through its legend */
.settings-cards .settings-part > legend + * { clear: both; }
.settings-cards .settings-part + .settings-part { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
/* Agents (#35519): the name and when it was last seen, then its protection and its token. */
.agent-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--border-light); }
.agent-who { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.agent-list select { font: inherit; padding: 0.3rem 0.5rem; border: 1px solid var(--text-soft); border-radius: var(--radius); background: var(--surface); }
#agent-token { overflow-wrap: anywhere; user-select: all; }
.settings-cards .card > .actions:last-child, .settings-cards .card > :last-child { margin-bottom: 0; }
.settings-cards .card > .actions { margin-top: 1rem; }
@container (max-width: 40rem) {
	.settings-cards .card { padding: 1.25rem; }
	/* A phone (#39506): fields line up with their headings and text, not indented under a
	   checkbox; the checkboxes' own labels stay as they are. */
	.settings-cards .choice .field { margin-left: 0; }
}
.site-group h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.site-field { margin-bottom: 0.6rem; }
.site-field label { font-weight: 400; font-size: 0.9375rem; }
.site-state { font-size: 0.8125rem; font-weight: 600; margin-left: 0.3rem; }
.site-state.is-here { color: var(--success-text); }
.site-state.is-env { color: var(--text-soft); }
.site-state.is-unset { color: var(--accent-ink); }
.protected-list { list-style: none; margin: 0 0 0.6rem; padding: 0; display: grid; gap: 0.4rem; }
.protected-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.protected-list b { min-width: 7rem; }
/* Invitation codes (#35037): on the waiting page, and the administrators' lists in Settings. */
.invite-code { font-family: var(--mono, monospace); letter-spacing: 0.08em; text-transform: uppercase; }
.invite-form { margin-top: 1rem; }
/* The welcome (#35360): numbered steps on the waiting page. */
.welcome-step + .welcome-step { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.welcome-step h2 { font-size: 1.125rem; margin: 0 0 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.welcome-n { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: 0.875rem; }
.welcome > form:last-child { margin-top: 1.75rem; }
/* An organisation asked for (#35441): its own card above the welcome; only the first overlaps the hero. */
.org-status + .card { margin-top: 1rem; }
.org-status h2 { font-size: 1.125rem; margin: 0 0 0.75rem; }
.org-status .status { margin: 0; }
.org-status .status + p { margin: 1rem 0 0; }
.status.is-ok { color: var(--success-text); font-weight: 600; }
/* Two-step sign-in (#35403): the code, and its QR code in Settings. */
.otp-code { font-family: var(--mono, monospace); font-size: 1.25rem; letter-spacing: 0.2em; }
.totp-qr { display: block; width: 12rem; height: 12rem; background: #fff; padding: 0.5rem; border-radius: var(--radius); }
/* Two-step sign-in's own page (#35457): one step at a time, in a narrow card. */
.two-step-page h2 { font-size: 1.125rem; margin: 0 0 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.two-step-page > p:first-of-type { margin-top: 0; }
.two-step-page #tss-confirm { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.two-step-page .totp-qr { margin-inline: auto; }
.tss-key { margin-top: 0.75rem; }
.tss-key summary { cursor: pointer; color: var(--brand-text); }
.tss-cancel { margin: 1.25rem 0 0; text-align: center; }
.totp-qr svg { display: block; width: 100%; height: 100%; shape-rendering: crispEdges; }
.passkey-list { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.35rem; }
.passkey-list li { display: flex; align-items: center; gap: 0.5rem; }
.totp-secret { font-family: var(--mono, monospace); letter-spacing: 0.08em; overflow-wrap: anywhere; user-select: all; }
.org-address { display: flex; align-items: center; gap: 0.35rem; }
.org-address input { flex: 1; min-width: 0; }
.org-address span { color: var(--text-soft); white-space: nowrap; }
/* A new agent's token as .env lines (#37577), with a message's copy button at its corner. */
.agent-made[hidden] { display: none; }
.agent-made p { margin: 0.6rem 0 0.3rem; }
.agent-env {
	position: relative; margin: 0 0 0.9rem; padding: 0.6rem 2.4rem 0.6rem 0.75rem; overflow-x: auto;
	background: var(--surface-pale); border: 1px solid var(--border); border-radius: var(--radius);
	font: 400 0.875rem/1.6 var(--mono, ui-monospace, monospace);   /* a line or a part of one can be selected; its copy button takes it all (#40984) */
}
.agent-env code { font: inherit; background: none; padding: 0; white-space: pre; }
.invite-made code { font-size: 1.125rem; letter-spacing: 0.08em; padding: 0.15rem 0.4rem; user-select: all; }
.invite-heading { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
.invite-list b { min-width: 4rem; }
.invite-list li > span:not(.tag) { flex: 1; min-width: 12rem; color: var(--text-soft); font-size: 0.9375rem; }
.invite-state.is-used, .invite-state.is-revoked, .invite-state.is-expired { opacity: 0.7; }
.protected-list select { font: inherit; padding: 0.3rem 0.4rem; border: 1px solid var(--text-soft); border-radius: var(--radius); background: var(--surface); }
.choice { border: 0; margin: 0 0 1.25rem; padding: 0; }
.choice legend { font-weight: 600; margin-bottom: 0.4rem; padding: 0; }
.choice > label { display: flex; align-items: baseline; gap: 0.5rem; margin: 0.35rem 0; }
.choice input[type="radio"], .choice input[type="checkbox"] { accent-color: var(--highlight); }
.choice .field { margin: 0.2rem 0 0.8rem 1.6rem; }
/* Light or dark as two pictures side by side, each half the width less the gap (#40203). */
.theme-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0.35rem 0 0.75rem; }
.theme-pick { display: grid; gap: 0.4rem; cursor: pointer; min-width: 0; }
.theme-pick img { display: block; width: 100%; height: auto; border-radius: var(--radius);
	border: 2px solid var(--border); box-sizing: border-box; }
.theme-pick:has(input:checked) img { border-color: var(--highlight); box-shadow: 0 0 0 2px var(--highlight); }
.theme-pick:has(input:focus-visible) img { outline: 2px solid var(--focus, var(--highlight)); outline-offset: 3px; }
.theme-pick > span { display: flex; align-items: baseline; gap: 0.5rem; font-weight: 600; }
.actions .link-button { font-size: 1rem; }
/* When (#26392): the away delay, the weekdays in a row, and the hours from–to. */
.when .field { margin: 0.2rem 0 0.9rem; }
.field-label { display: block; font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.when #away_minutes { max-width: 7rem; }
.days { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.days label { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 400; margin: 0; }
.days input { accent-color: var(--highlight); width: auto; margin: 0; }   /* not .field input's 100% (Safari honours it, #29765) */
.hours { display: flex; align-items: center; gap: 0.5rem; max-width: 24rem; }
.hours input { flex: 1 1 0; width: auto; min-width: 0; min-height: 2.6rem;   /* the two share the row (#29925) */ font: 400 1.0625rem var(--sans); color: var(--text); padding: 0.5rem 0.6rem;
	border: 1px solid var(--text-soft); border-radius: var(--radius); background: var(--surface); }
/* Signal: a phone number and its code, each with its button beside it. */
.inline-field { display: flex; gap: 0.5rem; align-items: stretch; margin-bottom: 0.4rem; }
.inline-field input { flex: 1; min-width: 0; }
.inline-field[hidden], .signal-field [hidden] { display: none; }
.secondary {
	appearance: none; flex: none;
	background: var(--surface); color: var(--brand-text);
	border: 1px solid var(--brand-line); border-radius: var(--radius);
	font: 600 0.9375rem var(--sans); padding: 0.4rem 0.9rem; cursor: pointer;
}
.secondary:hover { background: var(--surface-pale); }
a.secondary { display: inline-block; text-decoration: none; }
/* Sign in again (#35453): asked before adding a way to sign in. */
.signin-again { margin: 0.75rem 0; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-pale); }
.signin-again[hidden] { display: none; }
.signin-again p { margin: 0 0 0.6rem; }
.signal-number { margin: 0 0 0.4rem; display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; }

/* ---- recap ---- */

/* The room's tools (#37323): chips at the start of the pins bar; the open one shows in a
   dialog over the page. The row that holds the closed ones is never shown. */
.room-tools { display: none; }
/* The dialog itself scrolls and its title sticks (#37437): as a flex column with a shrinking
   body, WebKit made it only as tall as the title. */
.tool-dialog {
	width: min(46rem, 94vw); max-height: 85vh; max-height: 85dvh; padding: 0; overflow-y: auto; overscroll-behavior: contain;
	color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: 0 8px 24px rgb(0 53 122 / 0.18);
}
.tool-dialog::backdrop { background: rgb(0 20 50 / 0.55); }
.tool-dialog-head {
	position: sticky; top: 0; z-index: 1; background: var(--surface);
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	padding: 0.5rem 0.6rem 0.5rem 0.9rem; border-bottom: 1px solid var(--border-light);
}
.tool-dialog-head h2 { font-size: 1.125rem; margin: 0; }
.tool-dialog-close {
	appearance: none; border: 0; background: none; cursor: pointer; color: var(--text-soft);
	font: 400 1.5rem/1 var(--sans); min-width: 2rem; min-height: 2rem; border-radius: var(--radius);
}
.tool-dialog-close:hover { color: var(--text); background: var(--border-light); }
.tool-dialog-body { padding: 0.6rem 0.9rem 0.9rem; }
.tool-dialog-body > details { border: 0; padding: 0; }
.tool-dialog-body > details > summary { display: none; }
/* A !3's item (0.173.0, #40099): its page in a frame as tall as the item (chat.js), up to the
   dialog's own limit; past it, the frame scrolls. */
.todo-dialog { overflow: hidden; }
.todo-dialog[open] { display: flex; flex-direction: column; }
.todo-dialog-frame { flex: 0 1 auto; width: 100%; height: 12rem; min-height: 0; border: 0; background: var(--surface); }
.room-edit { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 0.4rem 0.75rem; }
.room-edit summary { cursor: pointer; color: var(--link-text); font-weight: 600; font-size: 0.9375rem; }
.room-edit[open] { padding-bottom: 0.4rem; }
.room-edit-form { margin-top: 0.6rem; font-size: 0.9375rem; }
.room-edit-form .field { margin-bottom: 0.7rem; }
.room-edit-form textarea { width: 100%; font: 400 1rem/1.45 var(--sans); padding: 0.45rem 0.6rem;
	border: 1px solid var(--text-soft); border-radius: var(--radius); resize: vertical; }
.room-edit-form .check { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 0.7rem; }
.room-edit-form .actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; }
.room-recap { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 0.4rem 0.75rem; }
.room-recap summary { cursor: pointer; color: var(--link-text); font-weight: 600; font-size: 0.9375rem; }
.room-recap[open] { padding-bottom: 0.4rem; }
.recap-periods { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }
.recap-periods [aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.recap { font-size: 0.9375rem; }
.recap-summary { margin: 0 0 0.5rem; }
.recap-section h3 { font-size: 0.9375rem; margin: 0.6rem 0 0.2rem; }
.recap-section ul { margin: 0; padding-left: 1.1rem; }
.recap-section li { margin: 0.15rem 0; overflow-wrap: anywhere; }
.recap-link { font-variant-numeric: tabular-nums; }
.recap-meta { color: var(--text-soft); }
.recap-ask { margin: 0.6rem 0 0; }

/* ---- access lists ---- */

.room-tags { display: inline-flex; align-items: baseline; gap: 0.4rem; }
.room-access { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 0.4rem 0.75rem; }
.room-access summary { cursor: pointer; color: var(--link-text); font-weight: 600; font-size: 0.9375rem; }
.room-access[open] { padding-bottom: 0.4rem; }
.grants { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin: 0.5rem 0; }
/* One line a row, on a phone too (#37456): tight cells, a long name breaks, a cross removes. */
.grants th, .grants td { text-align: left; padding: 0.3rem 0.3rem; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.grants td:first-child { white-space: normal; overflow-wrap: anywhere; }
.grants td:last-child { text-align: right; width: 1%; }
.grants th { font-weight: 600; color: var(--text-soft); }
.grants select { font: inherit; max-width: 100%; }
.grants-empty { color: var(--text-soft); }
.grants .grants-group { padding-top: .75rem; text-align: left; font-weight: 600; color: var(--text-soft); }   /* Service accounts, last (#42624) */
.grant-remove {
	appearance: none; border: 0; background: none; cursor: pointer; color: var(--link-text);
	font: 400 1.35rem/1 var(--sans); min-width: 1.75rem; min-height: 1.75rem; border-radius: var(--radius);
}
.grant-remove:hover { color: var(--text); background: var(--border-light); }
/* …and the form to grant: the name takes what is left of the line. */
.grant-form { display: flex; flex-wrap: nowrap; gap: 0.4rem; align-items: center; }
/* A new room's access (#41697): a field like the others, its list as the Access tool's. */
.new-room-access { border: 0; padding: 0; min-inline-size: 0; }
.new-room-access > legend { padding: 0; font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.new-room-access .grant-form { flex-wrap: wrap; }
fieldset.new-room-access select { width: auto; min-inline-size: 0; max-inline-size: 100%; }
fieldset.new-room-access .grant-form input { width: auto; flex: 1 1 8rem; }
.grant-form select, .grant-form input {
	font: 400 1rem var(--sans);
	padding: 0.35rem 0.4rem;
	border: 1px solid var(--text-soft);
	border-radius: var(--radius);
	background: var(--surface);
	min-width: 0;
}
.grant-form #grant-principal-list { flex: 1 1 8rem; }
/* An agent's console hosts (#41725). */
#console-host-form input { flex: 1 1 8rem; }
.console-host-new { margin-top: 0.6rem; }
.console-host-token { width: 100%; font-family: var(--mono, monospace); }
/* An agent's listener health (#41650): what is wrong, and what to do, in the alert colour. */
#agent-health-state.is-error, .agent-health-problems { color: var(--alert-text); }
#agent-health-state.is-error { font-weight: 600; }
.agent-health-problems { margin: 0.25rem 0 0.75rem; padding-left: 1.25rem; }
.agent-health-problems li + li { margin-top: 0.25rem; }
#agent-health-refresh { margin-top: 0.5rem; }
.grant-form input { flex: 1 1 6rem; }
.grant-form .primary, .grant-form #grant-permission { flex: none; }
.grant-form .primary { padding: 0.35rem 1rem; }
.read-only { margin: 0; }

/* ---- usage room ---- */

.usage-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.usage-plan { margin: 0; font-weight: 600; }
.limits { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1rem; }
.limit {
	border: 1px solid var(--border);
	border-left: 4px solid var(--highlight);
	border-radius: var(--radius);
	padding: 0.8rem 1rem;
	background: var(--surface);
}
.limit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.45rem; }
.limit-name { font-weight: 600; }
.limit-percent { font-size: 1.375rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-track { display: block; height: 0.75rem; background: var(--border-light); border-radius: var(--radius); overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--highlight); }
.limit.is-warning { border-left-color: var(--accent); }
.limit.is-warning .meter-fill { background: var(--accent); }
.limit.is-critical, .limit.is-exceeded, .limit.is-blocked { border-left-color: var(--alert-line); }
.limit.is-critical .meter-fill, .limit.is-exceeded .meter-fill, .limit.is-blocked .meter-fill { background: var(--alert); }
.limit-reset { margin: 0.45rem 0 0; font-size: 0.9375rem; color: var(--text-soft); }
.limit-until { font-weight: 600; color: var(--text); }
.usage-subhead { font-size: 1.0625rem; margin: 0 0 0.5rem; }
.breakdown { list-style: none; margin: 0 0 1.25rem; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.breakdown li { display: flex; justify-content: space-between; padding: 0.4rem 0.8rem; border-bottom: 1px solid var(--border-light); font-size: 1rem; }
.breakdown li:last-child { border-bottom: 0; }
.breakdown-percent { font-variant-numeric: tabular-nums; color: var(--text-soft); }
.usage-meta { margin: 0 0 1rem; font-size: 0.9375rem; color: var(--text-soft); }
.usage-section { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border-light); }
.signin { margin: 0 0 1rem; font-size: 1rem; }
.signin.is-soon { color: var(--accent-ink); font-weight: 600; }
.primary:disabled { background: var(--text-soft); border-color: var(--text-soft); cursor: default; }

/* ---- pop-up notices ---- */

.toasts {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	z-index: 10;
	max-width: min(24rem, calc(100vw - 2rem));
}
.toast {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding-right: 2.2rem !important;   /* room for the close button, on every toast (#8297) */
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 4px solid var(--highlight);
	border-radius: var(--radius);
	box-shadow: 0 4px 14px rgb(0 53 122 / 0.18);
	padding: 0.6rem 0.9rem;
	color: var(--text);
	text-decoration: none;
	animation: toast-in 0.25s ease-out;
	transition: opacity 0.5s ease, transform 0.5s ease;
}
.toast.is-notification { border-left-color: var(--accent); }
.toast.is-leaving { opacity: 0; transform: translateY(0.5rem); }
.toast-link { display: flex; flex-direction: column; gap: 0.1rem; color: inherit; text-decoration: none; }
.toast:hover .toast-head { color: var(--brand-text); text-decoration: underline; }
.toast-head { font-weight: 600; font-size: 0.9375rem; color: var(--link-text); }
.toast-body { font-size: 0.9375rem; color: var(--text-soft); overflow-wrap: anywhere; }
.toast.is-sticky { position: relative; border-left-color: var(--brand-line); padding-right: 2.2rem; }
/* An alert (#40666): red, and it stays until closed. */
.toast.is-sticky.is-alert { border-color: var(--alert); border-left-width: 6px; }
.toast.is-alert .toast-head { color: var(--alert); }
.toast.is-alert.is-cleared { border-color: var(--border); border-left-color: var(--highlight); }
.toast.is-alert.is-cleared .toast-head { color: var(--link-text); }
.toast-actions { display: flex; gap: 0.5rem; margin-top: 0.35rem; }
.toast-actions:empty { display: none; }
.toast-reload {
	appearance: none; border: 0; border-radius: var(--radius);
	background: var(--brand); color: var(--on-brand);
	font: 600 0.9375rem var(--sans); padding: 0.3rem 0.9rem; cursor: pointer;
}
.toast-reload:hover { background: var(--brand-hover); }
.toast-close {
	position: absolute; top: 0.3rem; right: 0.4rem;
	appearance: none; border: 0; background: none; cursor: pointer;
	font-size: 1.25rem; line-height: 1; color: var(--text-soft); padding: 0.1rem 0.3rem;
}
.toast-close:hover { color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(0.5rem); } }

/* ---- footer ---- */

.site-footer {
	/* As main, without its top band (#35195). */
	background-color: var(--ground);
	box-shadow: inset 0 0 10vw var(--ground-edge);
	/* Darker than --ink-soft, which is 4.4:1 on sand: this is 5.6:1 (#35198). */
	color: var(--footer-text);
	font-size: 1rem;
	padding-inline: 1.5rem;
}

.footer-inner {
	max-width: var(--page);
	margin-inline: auto;
	padding-block: 2rem 2.5rem;
}
.footer-inner p { margin: 0; }
.site-footer a { color: var(--text); }   /* #35198 */
.footer-inner .fine { margin-top: 0.4rem; font-size: 0.9375rem; }

/* ---- narrow screens ---- */

@media (max-width: 40rem) {
	body { font-size: 17px; }
	.hero-title { font-size: 1.75rem; }
	.site-header, .hero, main, .site-footer { padding-inline: 1.25rem; }
	.hero-inner { padding-block: 2rem 4.5rem; }
	.bar { padding-block: 0.8rem; gap: 0.35rem 1rem; }
	/* The menu stays at the top: the whole header is sticky, pulled up by the logo row
	   (--header-stick, measured by common.js), so only the menu remains on screen. */
	.site-header:has(.site-nav) { position: sticky; top: var(--header-stick, 0px); z-index: 10; }
	/* The menu on one line, a notification count included (#7890): less padding at the sides
	   and between items, and the items spread over the whole width. */
	.site-header { padding-inline: 0.6rem; }
	.site-nav { width: 100%; justify-content: space-between; gap: 0 0.3rem; }
	/* Too narrow for all of it (#8297): one line that scrolls sideways, no scrollbar shown.
	   The panels are position: fixed on a phone, so the scrolling doesn't clip them. */
	.site-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	.site-nav::-webkit-scrollbar { display: none; }
	.site-nav > * { flex: none; }
	/* The composer's buttons (Attach, Priority…, Later…, Send) wrap instead of overflowing
	   (#19281); the status line gets a line of its own. */
	.composer-actions { flex-wrap: wrap; gap: 0.5rem; }
	.composer-actions .status { order: 10; flex-basis: 100%; }
	.composer-actions .attach { margin-right: auto; }
	.composer-actions .attach:has(~ .drop-button:not([hidden])) { margin-right: 0; }
	.composer-actions .drop-button { margin-right: auto; }
	.composer-actions .options-toggle { padding: 0.35rem 0.55rem; font-size: 0.875rem; }
	/* ⤢, Options… and Send together at the right, one height, Options…'s (#29926). */
	.composer-actions { gap: 0.4rem; }
	.composer-actions #send { margin-left: 0; padding: 0 1rem; }
	.composer-actions .write-toggle, .composer-actions .options-toggle, .composer-actions #send, .composer-actions .cancel-send {
		height: 2rem; padding-block: 0; display: inline-flex; align-items: center; justify-content: center;
	}
	/* Since the ⋯ menu (#17061) the #id and ⋯ fit beside the author: on the same row, at the
	   right (#17804), so the menu opens inwards. */
	.msg-who { flex: 1 1 auto; }
	/* The logo on the menu's line (#9308): the way to the main page on a phone. Just the mark;
	   the menu takes the rest of the line and scrolls sideways where it doesn't fit. */
	.bar { flex-wrap: nowrap; gap: 0 0.6rem; }
	.wordmark { flex: none; }
	.wordmark .name { display: none; }
	.site-nav { width: auto; flex: 1; min-width: 0; gap: 0 0.75rem; }
	.site-nav a, .site-nav .link-button { font-size: 0.9375rem; }
	/* A menu's panel spans the screen under the menu. */
	.menu-pop { position: fixed; left: 0.75rem; right: 0.75rem; width: auto; min-width: 0; max-width: none; max-height: 70vh; }
	.card { padding: 1.25rem; }
	.layout-chat main { padding-inline: 0.5rem; padding-bottom: 0; }
	.layout-chat .hero-inner { padding-block: 0.8rem 3rem; }

	/* On a phone the page scrolls, not the pane: the header scrolls away and the
	   conversation gets the whole screen, with the composer pinned to the bottom. */
	.layout-chat { height: auto; }
	.layout-chat main > .chat { flex: none; }
	.chat { padding: 0.75rem 0.75rem 0; gap: 0.5rem; }
	.messages {
		flex: none;
		overflow: visible;
		min-height: 0;
	}
	.composer {
		position: sticky;
		bottom: 0;
		z-index: 3;
		margin-inline: -0.75rem;
		/* The phone's safe area under the bar (#37437): the space its rounded corners and home
		   bar take (the page asks for it with viewport-fit=cover), so Send stays whole. With
		   the box in focus the keyboard is there instead, and the space goes; 200 ms either way. */
		padding: 0.35rem 0.75rem calc(2px + env(safe-area-inset-bottom, 0px));
		transition: padding-bottom 200ms ease;
		background: var(--surface);
		border-top: 1px solid var(--border);
		box-shadow: 0 -2px 6px rgb(0 53 122 / 0.06);
	}
	body:not(.is-writing) .composer:has(#body:focus):not(:has(.cancel-send:not([hidden]))) { padding-bottom: 2px; }
	/* A written message waiting, keyboard closed (#35610): lifted at least 10px, for a phone
	   that reports no safe area. The same while Cancel counts down after sending (#37668): the
	   box keeps the focus then, often with no keyboard, and Cancel must stay whole. */
	.composer:has(.cancel-send:not([hidden])),
	.composer:has(#body:not(:placeholder-shown):not(:focus)) {
		padding-bottom: calc(2px + max(10px, env(safe-area-inset-bottom, 0px)));
	}
	@media (prefers-reduced-motion: reduce) { .composer { transition: none; } }
	/* Only as tall as it needs to be (#28648), so more of the conversation shows: the box one
	   line until you write more, 2 px around the buttons, slimmer buttons, and no empty
	   status line. */
	.composer { gap: 2px; }
	.composer textarea { min-height: 2.5rem; height: 2.5rem; padding-block: 0.4rem; }
	.composer-actions { row-gap: 2px; padding-block: 2px; }
	.composer-actions .primary, .composer-actions .secondary { padding-block: 0.3rem; }
	.composer-actions .status:empty { display: none; }
	/* One flowing line on a phone (#8565): the dot, TODO and every participant are inline and
	   wrap only where they must, instead of the member list starting a block of its own. */
	.chat-bar { display: block; }
	.chat-bar .bar-start { display: inline-flex; vertical-align: middle; margin: 0.15rem 0.45rem 0.15rem 0; }
	.chat-bar .members { display: inline; }
	.chat-bar .member { display: inline-flex; vertical-align: middle; margin: 0.15rem 0.3rem 0.15rem 0; }
	/* A working agent's status, shortened: the list opens it in full on a wider screen. */
	.member-state { max-width: 8rem; }
	.member-name { max-width: 9rem; }
	/* Foldable (#28488): folded, only its toggle and the connection dot stay, on the left. */
	.bar-fold {
		display: inline-flex; align-items: center; justify-content: center; appearance: none;
		width: 1.6rem; height: 1.6rem; padding: 0; cursor: pointer; font: 600 1.1rem/1 var(--sans);
		color: var(--brand-text); background: var(--surface); border: 1px solid var(--brand-line); border-radius: var(--radius);
	}
	.chat-bar.is-folded .todo, .chat-bar.is-folded .members { display: none; }
	/* …and then only as wide as that (#29447): a small tab at the top left, still stuck under
	   the menu, taking no row of its own; the conversation runs on beneath it. */
	.chat-bar.is-folded {
		width: max-content; height: 2.4rem; margin-bottom: -2.4rem; margin-right: 0;
		padding: 0.35rem 0.6rem 0.35rem 0.75rem;
		border: 1px solid var(--border); border-top: 0; border-left: 0; border-radius: 0 0 var(--radius) 0;
	}
	/* The status and member list stay stuck to the top, as the composer does to the bottom. */
	.chat-bar {
		position: sticky;
		top: var(--nav-height, 0px);
		z-index: 3;
		margin-inline: -0.75rem;
		padding: 0.45rem 0.75rem;
		background: var(--surface);
		border-bottom: 1px solid var(--border);
		box-shadow: 0 2px 6px rgb(0 53 122 / 0.06);
	}
	/* A #id jump lands below the stuck bar, not under it. */
	.message { scroll-margin-top: calc(var(--bar-height, 3rem) + 0.5rem); }
	/* …and a reading position restored at the bottom stays above the composer (#35185). */
	.message { scroll-margin-bottom: calc(var(--composer-height, 7rem) + 0.5rem); }
	/* Clear of the pinned composer (its height is kept in --composer-height by chat.js). */
	.new-pill { bottom: calc(var(--composer-height, 7rem) + 0.5rem); }
	.to-end-holder { bottom: calc(var(--composer-height, 7rem) + 0.75rem); }
	.typing-holder { bottom: calc(var(--composer-height, 7rem) + 0.75rem); }
	.footer-inner { padding-block: 1.75rem 2rem; }
}

/* The narrowest phones (360 px): the menu still on one line. */
@media (max-width: 23rem) {
	.site-header { padding-inline: 0.45rem; }
	.site-nav { gap: 0 0.2rem; }
	.site-nav a, .site-nav .link-button { font-size: 0.8125rem; }
	.notif-toggle { gap: 0.2rem; }
	.notif-count { padding: 0 0.3rem; font-size: 0.6875rem; }
}

/* A long paste as a file (#11466): an editable suffix, and a warning if it looks secret. */
/* Green and as wide as the box, sitting on it (#11851). */
.pending li.is-paste {
	flex-basis: 100%; flex-wrap: wrap; row-gap: 0.25rem;
	background: light-dark(#e8f4eb, #16332b); border-color: var(--success-line); border-bottom: none;
	border-radius: var(--radius) var(--radius) 0 0;
}
.pending li.is-paste + li.is-paste { margin-top: -0.4rem; border-top: 1px dashed var(--success-line); border-radius: 0; }
.composer .pending:has(li.is-paste) { margin-bottom: -0.5rem; }
.composer .pending:has(li.is-paste) ~ textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.pending li.is-paste .file-name { margin-right: -0.5rem; }
.paste-suffix { font: 600 0.9375rem var(--mono); width: 5ch; padding: 0 0.2rem; border: 1px solid var(--border); border-radius: var(--radius); }
.paste-as-text { font-size: 0.8125rem; padding: 0.05rem 0.4rem; }
.pending li.is-secret { border-color: var(--alert-line); background: light-dark(#fbeaea, #3b1d24); }
.secret-note { flex-basis: 100%; color: var(--alert-text); font-size: 0.875rem; font-weight: 600; }
/* The × at the row's right end, on its first line, above any warning (#11995). */
.pending li.is-paste .remove { margin-left: auto; }
.pending li.is-paste .secret-note { order: 1; }
/* The message box looks like it holds a secret (#12293). */
.secret-warning { padding: 0.45rem 0.7rem; background: light-dark(#fbeaea, #3b1d24); border: 1px solid var(--alert-line); border-left: 4px solid var(--alert-line); border-radius: var(--radius); color: var(--alert-text); font-weight: 600; font-size: 0.9375rem; }
.secret-warning[hidden] { display: none; }

/* Usage per agent (#12860). */
.usage-host { margin: -0.5rem 0 1rem; color: var(--text-soft); }
.usage-host.is-stale, .agent-usage-when.is-stale { color: var(--accent-ink); font-weight: 600; }
.usage-history-wrap { overflow-x: auto; margin-bottom: 1.25rem; }
.usage-history { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
.usage-history th, .usage-history td { text-align: left; padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.usage-history th { font-weight: 600; color: var(--text-soft); }
.usage-history .num { text-align: right; font-variant-numeric: tabular-nums; }
.usage-history-empty { color: var(--text-soft); }
/* The last 7 days as a graph (#39242) */
.usage-graph { margin: 0.5rem 0 0.75rem; container-type: inline-size; }
.usage-graph-plot { block-size: 13.75rem; }
.usage-graph-plot svg { display: block; inline-size: 100%; block-size: 100%; }
.usage-graph .grid { stroke: var(--border-light); stroke-width: 1; }
.usage-graph .grid.is-day { stroke: var(--text-soft); stroke-opacity: 0.3; stroke-dasharray: 2 3; }
.usage-graph .axis { fill: var(--text-soft); font-size: 12px; }
.usage-graph .alert { stroke: var(--alert-text); stroke-width: 1.5; stroke-dasharray: 6 4; }
.usage-graph .line { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.usage-graph .line.is-session { stroke: var(--accent); }
.usage-graph .line.is-week { stroke: var(--highlight); }
.usage-graph-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.875rem; color: var(--text-soft); margin-top: 0.4rem; }
.usage-graph-legend span::before { content: ''; display: inline-block; inline-size: 1.1rem; block-size: 0; border-top: 3px solid; vertical-align: middle; margin-inline-end: 0.35rem; }
.usage-graph-legend .is-session::before { border-color: var(--accent); }
.usage-graph-legend .is-week::before { border-color: var(--highlight); }
.usage-graph-legend .is-alert::before { border-top: 2px dashed var(--alert-text); }
@container (max-width: 30rem) { .usage-graph-plot { block-size: 11rem; } }
.usage-history-table { margin-bottom: 1.25rem; }
.usage-history-table > summary { cursor: pointer; color: var(--text-soft); font-size: 0.9375rem; }
.usage-history-table .usage-history-wrap { margin: 0.5rem 0 0; }
.agent-usage-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.5rem;
	container: agent-usage / inline-size; }
.agent-usage { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.8rem; }
.agent-usage.is-silent { background: var(--surface-grey); }
.agent-usage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.15rem; }
.agent-usage-head .avatar { margin-right: -0.2rem; }
.agent-usage-lines { padding-left: calc(20px + 0.3rem); }   /* under the name, past its icon */
/* A wide list: what is under the name on one row, between dots (#40140). */
@container agent-usage (min-width: 36rem) {
	.agent-usage-lines { display: flex; flex-wrap: wrap; column-gap: 0.45rem; }
	.agent-usage-lines > .agent-usage-line + .agent-usage-line::before { content: "·"; margin-right: 0.45rem;
		color: var(--text-soft); font-weight: 400; }
}
.agent-usage-name { font-weight: 700; font-size: 1.0625rem; }
.agent-usage-console { font-size: 0.875rem; }
.agent-usage-host { color: var(--text-soft); font-size: 0.9375rem; }
.agent-usage-line { margin: 0.1rem 0; font-size: 0.9375rem; }
.agent-usage-line .is-over { color: var(--alert-text); }
.agent-usage-line.is-soon { color: var(--accent-ink); font-weight: 600; }
/* An agent's usage in a few lines (#38162): the menu's panel and a room's Usage. */
.usage-briefs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.usage-brief { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.45rem 0.7rem; font-size: 0.875rem; }
.usage-brief-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.usage-brief-name { font-weight: 700; font-size: 0.9375rem; }
.usage-brief-host { color: var(--text-soft); }
.usage-brief-limits { list-style: none; margin: 0.15rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.1rem 1rem; }
.usage-brief-limits li { font-variant-numeric: tabular-nums; }
.usage-brief-limits .is-over { color: var(--alert-text); }
.usage-brief-line { margin: 0.15rem 0 0; color: var(--text-soft); }
.usage-brief-line.is-soon { color: var(--accent-ink); font-weight: 600; }
/* A destructive action (#13949): the Send-style button, in red. */
/* The danger zone of a room's settings (#37667): what closes or removes the room, set apart. */
.danger-zone { margin-top: 1.25rem; padding: 0.75rem 0.9rem; border: 1px solid var(--alert-line); border-radius: var(--radius); display: grid; gap: 0.75rem; }
.danger-zone h3 { margin: 0; font-size: 1rem; color: var(--alert-text); }
.danger-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.danger-row p { flex: 1 1 16rem; margin: 0; }
.danger-button { color: var(--alert-text); border-color: var(--alert-line); }
.danger-button:hover { background: var(--alert); border-color: var(--alert-line); color: #fff; }
.danger-confirm { display: grid; gap: 0.6rem; }
.danger-confirm[hidden] { display: none; }
.danger-confirm .field { margin: 0; }
.danger-confirm input { width: 100%; }
.danger-zone .status { margin: 0; }
.danger-zone .status:empty { display: none; }
.rooms-archived-link { margin: 1rem 0 0; }
.primary.danger { background: var(--alert); border-color: var(--alert-line); }
.primary.danger:hover { background: #9e1f1f; border-color: #9e1f1f; }
.usage-remove[hidden] { display: none; }
.usage-stale { color: var(--accent-ink); font-weight: 600; margin: 0 0 1rem; }
.usage-stale[hidden] { display: none; }
/* "[report.pdf]" in a message: a link that opens the attachment in the viewer (#14595). */
.markdown a.file-ref { font-family: var(--mono); font-size: 0.9em; background: var(--surface-pale); border-radius: var(--radius); padding: 0 0.25rem; text-decoration: none; }
.markdown a.file-ref:hover { text-decoration: underline; }

/* The Roadmap page (#14789). */
.roadmap { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.75rem; counter-reset: roadmap; }
.roadmap-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 0.9rem; display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; }
.roadmap-text { flex: 1; min-width: 0; }
.roadmap-text > :first-child { margin-top: 0; }
.roadmap-text > :last-child { margin-bottom: 0; }
.roadmap-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; flex-shrink: 0; }
.roadmap-status { margin: 0; font-size: 0.875rem; }
@media (max-width: 40rem) { .roadmap-item { flex-direction: column; } .roadmap-actions { align-items: flex-start; } }
/* Cancel a just-sent message (#14795): red, next to Send, counting down. */
.composer-actions .cancel-send { padding: 0.45rem 1rem; font-variant-numeric: tabular-nums; gap: 0.35em; }   /* (the gap: on a phone it is a flex row, where the space before the count is lost, #37668) */
.composer-actions .cancel-send[hidden] { display: none; }
/* Cancel is Nippon red (#35009). */
.composer-actions .cancel-send { background: var(--nippon-red); border-color: var(--nippon-red); }
.composer-actions .cancel-send:hover { background: #99001f; border-color: #99001f; }
/* Deleting your own message (#15260): the same button, red on hover. */
.delete-md:hover, .delete-md:focus-visible { color: var(--alert-text); border-color: var(--alert-line); }
/* Timed tasks (#15892): Later… next to Send, and your scheduled messages above the box. */
.later { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-pale-soft); }
.later[hidden] { display: none; }
.later .hint { font-size: 0.875rem; color: var(--text-soft); }
.later input { font: inherit; padding: 0.25rem 0.4rem; border: 1px solid var(--text-soft); border-radius: var(--radius); }
.scheduled-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.scheduled-list[hidden] { display: none; }
.scheduled-list li { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.3rem 0.6rem; border: 1px dashed var(--highlight); border-radius: var(--radius); background: var(--surface-pale); font-size: 0.9375rem; }
.scheduled-label { font-weight: 700; color: var(--brand-text); }
.scheduled-when { font-weight: 600; white-space: nowrap; }
.scheduled-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.scheduled-list .remove { appearance: none; border: 0; background: none; color: var(--text-soft); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 0.15rem; margin-left: auto; }
.scheduled-list .remove:hover { color: var(--alert-text); }
/* Routing (#16192): whom a message to @role went to; each agent's profile and roles. */
.tag-routed { background: var(--surface-pale); color: var(--brand-text); }
.agent-profile { display: grid; gap: 0.5rem; max-width: 40rem; margin-bottom: 1rem; }
.agent-profile label { display: grid; gap: 0.2rem; font-weight: 600; font-size: 0.9375rem; }
.agent-profile input { font: inherit; font-weight: 400; padding: 0.35rem 0.5rem; border: 1px solid var(--text-soft); border-radius: var(--radius); }
.tag-delegated { background: light-dark(#eef6ea, #16332b); color: var(--success-text); text-decoration: none; }
/* Saved messages (#16633). */
.save-md.is-saved { color: var(--brand-text); border-color: var(--brand-line); font-weight: 600; }
.saved-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.saved-filters select, .saved-filters input { font: inherit; padding: 0.4rem 0.55rem; border: 1px solid var(--text-soft); border-radius: var(--radius); background: var(--surface); }
.saved-filters input { flex: 1; min-width: 12rem; }
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.saved-list li { display: flex; align-items: flex-start; gap: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.75rem; }
.saved-list a { flex: 1; min-width: 0; display: grid; gap: 0.2rem; text-decoration: none; color: inherit; }
.saved-meta { font-size: 0.875rem; color: var(--text-soft); }
.saved-excerpt { overflow-wrap: anywhere; }
.saved-list .remove { appearance: none; border: 0; background: none; color: var(--text-soft); font-size: 1.25rem; line-height: 1; cursor: pointer; }
.saved-list .remove:hover { color: var(--alert-text); }

/* The message's actions in a ⋯ menu at the row's end (#17061). */
.msg-menu { position: relative; display: inline-flex; }
.msg-menu-toggle {
	appearance: none; cursor: pointer; font: 700 0.8125rem/1.5 var(--sans); letter-spacing: 0.08em;
	padding: 0.1rem 0.5rem; border: 1px solid var(--text); border-radius: var(--radius);
	background: var(--surface); color: var(--text);
}
.msg-menu-toggle:hover, .msg-menu-toggle:focus-visible, .msg-menu-toggle[aria-expanded="true"] { border-color: var(--brand-line); color: var(--brand-text); }
.msg-menu-list {
	position: absolute; right: 0; top: calc(100% + 0.25rem); z-index: 20; min-width: 11rem;
	display: flex; flex-direction: column; padding: 0.3rem;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: 0 6px 18px rgb(0 53 122 / 0.18);
}
.msg-menu-list[hidden] { display: none; }
.msg-menu-list button {
	display: block; width: 100%; text-align: left; margin: 0;
	background: none; color: var(--text); border: 0; border-radius: var(--radius);
	padding: 0.45rem 0.6rem; font: 400 0.9375rem var(--sans); white-space: nowrap;
}
.msg-menu-list button:hover, .msg-menu-list button:focus-visible { background: var(--surface-pale); color: var(--brand-text); }
.msg-menu-list .delete-md:hover, .msg-menu-list .delete-md:focus-visible { background: light-dark(#fbeaea, #3b1d24); color: var(--alert-text); }
.msg-menu-list .save-md.is-saved { font-weight: 600; color: var(--brand-text); }
.message.has-menu-open { z-index: 5; position: relative; }
.msg-menu-list.opens-up { top: auto; bottom: calc(100% + 0.25rem); }
/* An agent's menu from its pill (#41676): fixed under the pill, placed by chat.js. */
.member-menu { position: fixed; right: auto; max-width: calc(100vw - 1rem); }
.member-menu-link { display: block; padding: 0.45rem 0.6rem; border-radius: var(--radius); color: var(--text); text-decoration: none; font: 400 0.9375rem var(--sans); }
.member-menu-link:hover, .member-menu-link:focus-visible { background: var(--surface-pale); color: var(--brand-text); }
.member-menu-limits { list-style: none; margin: 0 0 0.25rem; padding: 0 0.6rem 0.25rem 1.2rem; font-size: 0.8125rem; color: var(--text-soft); }
.member-menu-limits .is-over b { color: var(--alert-text); }
.member-menu-limits .is-none { font-style: italic; }
.member-menu-group { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0.2rem 0; padding: 0.2rem 0; }
.member-menu-label { display: block; padding: 0.2rem 0.6rem 0; font-size: 0.75rem; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.member-menu [aria-checked="true"] { font-weight: 600; color: var(--brand-text); }
.member-menu [aria-checked="true"]::before { content: "\2713\00a0"; }
/* While Cancel counts down and the box is empty, it stands in for Send (#16781). */
.composer.cancel-replaces-send #send { display: none; }
/* Needs you (#18100): what waits on a person, in the menu, on its page and on the message. */
.badge.is-needs { background: var(--accent-text); color: var(--on-brand); }
.tag-needs { background: var(--accent-text); color: var(--on-brand); font-weight: 700; }
.tag-needs.is-alert { background: var(--alert); color: #fff; }   /* a service's alert (#40616) */
.needs-item.is-alert { border-left-color: var(--alert); }
.tag-needs.is-resolved { background: var(--surface-pale); color: var(--success-text); font-weight: 600; }
/* Dismiss a question waiting on you, inside its tag (#30181). */
.tag-dismiss {
	appearance: none; border: 0; background: none; color: inherit; cursor: pointer;
	font: 700 0.95rem/1 var(--sans); padding: 0 0.1rem; margin-left: 0.1rem; vertical-align: baseline;
}
.tag-dismiss:hover, .tag-dismiss:focus-visible { text-decoration: underline; }
.message.needs-open { box-shadow: inset 4px 0 0 var(--accent); }
.needs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.needs-item { display: flex; align-items: flex-start; gap: 0.75rem; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 0.55rem 0.8rem; }
.needs-item a { flex: 1; min-width: 0; display: grid; gap: 0.25rem; color: inherit; text-decoration: none; }
.needs-meta { font-size: 0.875rem; color: var(--text-soft); }
.needs-waited { font-weight: 700; color: var(--accent-ink); }
.needs-excerpt { overflow-wrap: anywhere; }
/* Approvals and the audit log (#18101). */
.approval-actions { display: flex; gap: 0.5rem; margin: 0.4rem 0; }
.tag-needs.is-denied { background: light-dark(#fbeaea, #3b1d24); color: var(--alert-text); }
.room-audit { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 0.4rem 0.75rem; }
.room-audit summary { cursor: pointer; color: var(--link-text); font-weight: 600; font-size: 0.9375rem; }
.audit-log { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.3rem; font-size: 0.9375rem; }
.audit-entry { border-bottom: 1px solid var(--border-light); padding-bottom: 0.25rem; overflow-wrap: anywhere; }
.audit-at { color: var(--text-soft); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.audit-action { font-weight: 600; color: var(--brand-text); }
.audit-details { color: var(--text-soft); }
/* A room's webhooks for guarded actions (TODO !11), under the audit log, for administrators. */
.tool-sub { font-size: 1rem; margin: 1rem 0 0.25rem; }
.hook-list { list-style: none; margin: 0.25rem 0; padding: 0; display: grid; gap: 0.3rem; overflow-wrap: anywhere; }
.hook-form { display: grid; gap: 0.25rem; }
.hook-form input { width: 100%; box-sizing: border-box; }
/* A consensus set up by hand (#27277): theme, participant rows (who, and from which point of
   view), blind first round. */
.room-consensus { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 0.4rem 0.75rem; }
.room-consensus summary { cursor: pointer; color: var(--link-text); font-weight: 600; font-size: 0.9375rem; }
.consensus-form { font-size: 0.9375rem; }
.consensus-form .field { margin-bottom: 0.7rem; }
.consensus-form textarea { width: 100%; font: 400 1rem/1.45 var(--sans); padding: 0.45rem 0.6rem;
	border: 1px solid var(--text-soft); border-radius: var(--radius); resize: vertical; }
.consensus-people { border: 0; margin: 0 0 0.7rem; padding: 0; }
.consensus-people legend { font-weight: 600; padding: 0; margin-bottom: 0.35rem; }
.consensus-rows { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.4rem; }
.consensus-row { display: grid; grid-template-columns: minmax(10rem, 18rem) 1fr auto; gap: 0.4rem; align-items: center; }
.consensus-row select, .consensus-row input { font: inherit; padding: 0.4rem 0.5rem; border: 1px solid var(--text-soft);
	border-radius: var(--radius); background: var(--surface); min-width: 0; }
.consensus-row .remove { appearance: none; border: 0; background: none; color: var(--alert-text); font-size: 1.2rem; cursor: pointer; padding: 0 0.3rem; }
.service-field .check { display: flex; gap: 0.5rem; align-items: baseline; }   /* an agent's Service account (#40616) */
.service-field .check input { width: auto; }
.consensus-form .check { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 0.5rem; }
@media (max-width: 40rem) {
	.consensus-row { grid-template-columns: 1fr auto; }
	.consensus-row input { grid-column: 1 / -1; grid-row: 2; }
}
/* The task board (#18102). */
.task-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.task-col h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.task-n { color: var(--text-soft); font-weight: 400; }
.task-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.task-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.65rem; display: grid; gap: 0.35rem; background: var(--surface); }
.task-card.is-stale { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.task-card a { display: grid; gap: 0.2rem; color: inherit; text-decoration: none; }
.task-meta, .task-foot { font-size: 0.8125rem; color: var(--text-soft); }
.task-text { font-size: 0.9375rem; overflow-wrap: anywhere; }
.task-stale { font-size: 0.8125rem; font-weight: 600; color: var(--accent-ink); }
.badge.is-stale { background: var(--accent-text); color: var(--on-brand); }
/* Done with evidence, then Accept or Reopen (#18103). */
.claim-evidence { display: inline-flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; }
.claim-evidence a { font-family: var(--mono); font-size: 0.8125rem; }
.claim-tests { color: var(--text); }
.claim-noevidence { font-style: italic; color: var(--accent-ink); }
.claim-reopened { color: var(--accent-ink); font-weight: 600; }
.claim-accepted { color: var(--success-text); font-weight: 700; }
/* The room brief and handoff notes (#18105). */
.room-brief { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 0.4rem 0.75rem; }
.room-brief summary { cursor: pointer; color: var(--link-text); font-weight: 600; font-size: 0.9375rem; }
.brief-text { margin: 0.5rem 0; }
.brief-form textarea { width: 100%; font: 400 0.9375rem/1.45 var(--mono); padding: 0.5rem; border: 1px solid var(--text-soft); border-radius: var(--radius); }
.brief-form .actions { margin-top: 0.4rem; }
.claim-handoff { color: var(--text); font-style: italic; }
/* Search (#19280). */
.search-form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.search-form input, .search-form select { font: inherit; padding: 0.4rem 0.55rem; border: 1px solid var(--text-soft); border-radius: var(--radius); background: var(--surface); }
.search-form input[type=search] { flex: 2 1 14rem; }
.search-form input[type=text] { flex: 1 1 8rem; }
.search-results { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; }
.search-results a { display: grid; gap: 0.2rem; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; }
.search-results a:hover { border-color: var(--brand-line); }
.search-meta { font-size: 0.875rem; color: var(--text-soft); }
.search-excerpt { overflow-wrap: anywhere; }
.search-results mark { background: light-dark(#fff1a8, #5c4a00); color: inherit; padding: 0 0.05em; }
/* Priorities and deadlines (#19281). */
.tag-priority.is-urgent { background: var(--alert); color: var(--on-brand); font-weight: 700; }
.tag-priority.is-later { background: var(--surface-grey); color: var(--text-soft); }
.tag-due { background: var(--surface-pale); color: var(--brand-text); }
.tag-due.is-overdue { background: light-dark(#fbeaea, #3b1d24); color: var(--alert-text); font-weight: 700; }
.task-due.is-overdue { color: var(--alert-text); font-weight: 700; }
/* Off the task list (#20099). */
.task-card { position: relative; }
.task-remove { position: absolute; top: 0.2rem; right: 0.3rem; appearance: none; border: 0; background: none; color: var(--text-soft); font-size: 1.15rem; line-height: 1; cursor: pointer; }
.task-remove:hover { color: var(--alert-text); }
.task-card a { padding-right: 1.2rem; }
/* Colours (#21106): scheduling is green, priority orange (in Options…, and what they made). */
.scheduled-list li { border-color: var(--success-line); background: light-dark(#eef7f0, #16332b); }
.scheduled-label { color: var(--success-text); }
/* Priority… and Later… float above their buttons (#20174): opening them moves nothing. */
.pop-anchor { position: relative; display: inline-flex; }
.pop-anchor > .later {
	position: absolute; bottom: calc(100% + 0.5rem); right: 0; z-index: 30;
	width: max-content; max-width: min(24rem, calc(100vw - 2rem));
	flex-direction: column; align-items: stretch; gap: 0.4rem;
	box-shadow: 0 6px 18px rgb(0 53 122 / 0.18);
}
.pop-anchor > .later[hidden] { display: none; }
.pop-anchor > .later .hint { max-width: 20rem; }
.composer-actions:has(.cancel-send:not([hidden])) .pop-anchor { display: none; }
/* …anchored to the button row's right edge, not the button's: on a phone a panel as wide as
   the screen would otherwise run off its left side. */
.composer-actions { position: relative; }
.pop-anchor { position: static; }
/* The floating panels on white (#21567): the colour stays on the buttons and borders. */
.pop-anchor > .later { background: var(--surface); }
/* Options… (#28077): one panel, two sections; the button filled orange once a priority or a
   deadline is set. (While Cancel counts down, it makes room, #16044: see .pop-anchor above.) */
.options-toggle.is-set { border-color: var(--alert-line); color: var(--on-brand); background: var(--accent-text); }
.options-pop { border-color: var(--brand-line); }
.options-pop .opt-section { border: 0; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.options-pop .opt-section + .opt-section { border-top: 1px solid var(--border-light); padding-top: 0.55rem; }
.options-pop legend { font-weight: 600; padding: 0; margin-bottom: 0.15rem; }
.options-pop .opt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.options-pop .opt-row label { min-width: 4.5rem; }
.options-pop .opt-section:first-child legend { color: var(--accent-ink); }
.options-pop .opt-section:last-child legend { color: var(--success-text); }

/* Tasks: all four columns side by side where the page is wide enough (#22971). */
@media (min-width: 60rem) {
	.task-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Narrower, the columns stack: a bar of them stays at the top while scrolling, each one tap
   away, with its count (#21258). */
.task-nav {
	grid-column: 1 / -1; position: sticky; top: var(--nav-height, 0px); z-index: 5;   /* under the phone's sticky menu */
	display: flex; gap: 0.35rem; overflow-x: auto; margin: -0.5rem -0.25rem 0; padding: 0.5rem 0.25rem;
	background: var(--surface); border-bottom: 1px solid var(--border-light);
}
.task-nav a {
	flex: 1 0 auto; text-align: center; white-space: nowrap; text-decoration: none; font-weight: 600; font-size: 0.9375rem;
	color: var(--brand-text); border: 1px solid var(--brand-line); border-radius: var(--radius); padding: 0.3rem 0.6rem;
}
.task-nav a:hover { background: var(--surface-pale); }
.task-nav-n { font-weight: 400; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.task-col { scroll-margin-top: calc(var(--nav-height, 0px) + 3.5rem); }
@media (min-width: 60rem) { .task-nav { display: none; } }

/* Small screens: the main card runs edge to edge, no margin around it (#23887); its own
   padding stays. */
@media (max-width: 40rem) {
	main, .layout-chat main { padding-inline: 0; }
	main > .card, main > * > .card { border-inline: 0; border-radius: 0; }
}
/* Links in the blue hero bar are white, underlined (#24217): blue on blue failed contrast. */
.hero a, .hero a:visited { color: var(--on-brand); text-decoration: underline; text-underline-offset: 0.15em; }
.hero a:hover, .hero a:focus-visible { color: var(--on-brand); text-decoration-thickness: 2px; }
/* With extra context (#24692): a green pen beside an answer; "Your own answer…" on multiple choice. */
.option-pair { display: inline-flex; align-items: stretch; gap: 0; }
.option-pair .option-md:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.option-pen {
	appearance: none; cursor: pointer; font: 600 0.9375rem var(--sans);
	padding: 0.3rem 0.55rem; border: 1px solid var(--success-line); border-radius: var(--radius);
	background: var(--success); color: var(--on-brand);
}
.option-pair .option-pen { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 1px; }
.option-pen:hover, .option-pen:focus-visible { background: #0e5f22; border-color: #0e5f22; }
.option-pen:disabled { opacity: 0.5; cursor: default; }

/* ---- the style guide (#25479): the frame around the samples; the samples use the rules above ---- */

.sg section { margin-top: 2.25rem; }
.sg section:first-of-type { margin-top: 0; }
.sg h2 { font-size: 1.375rem; margin-bottom: 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border-light); }
.sg h3 { font-size: 1.0625rem; margin: 1.25rem 0 0.5rem; }
.sg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.sg-note { font-size: 0.9375rem; color: var(--text-soft); margin: 0.5rem 0 0; }
.sg-swatches { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
.sg-swatches li { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 0.875rem; }
.sg-swatches span { display: block; height: 3rem; border-bottom: 1px solid var(--border-light); }
.sg-swatches b, .sg-swatches code { display: block; margin: 0.35rem 0.6rem; }
.sg-swatches code { background: none; border: 0; padding: 0; color: var(--text-soft); }
.sg-type p { margin: 0.25rem 0; }
.sg-hero { margin: 0; }
.sg-hero .hero-inner { padding-block: 1.5rem; }
.sg-demo-card { margin-top: 0; }
.sg-messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.sg textarea { width: 100%; min-height: 5rem; font: 400 1.0625rem/1.5 var(--sans); color: var(--text); padding: 0.6rem 0.7rem;
	border: 1px solid var(--text-soft); border-radius: var(--radius); }
.sg select { font: 400 1.0625rem var(--sans); color: var(--text); padding: 0.55rem 0.7rem; border: 1px solid var(--text-soft);
	border-radius: var(--radius); background: var(--surface); }
.sg-c-brand { background: var(--brand); }
.sg-c-brand-hover { background: var(--brand-hover); }
.sg-c-highlight { background: var(--highlight); }
.sg-c-highlight-dark { background: var(--highlight-dark); }
.sg-c-accent { background: var(--accent); }
.sg-c-orange { background: var(--orange); }
.sg-c-accent-text { background: var(--accent-text); }
.sg-c-success { background: var(--success); }
.sg-c-alert { background: var(--alert); }
.sg-c-ink { background: var(--ink); }
.sg-c-ink-soft { background: var(--ink-soft); }
.sg-c-line { background: var(--line); }
.sg-c-line-light { background: var(--line-light); }
.sg-c-pale { background: var(--pale); }
.sg-c-turquoise { background: var(--turquoise); }
.sg-c-deep-turquoise { background: var(--deep-turquoise); }
.sg-c-deep-turquoise-active { background: var(--deep-turquoise-active); }
.sg-c-light-antique-blue { background: var(--light-antique-blue); }
.sg-c-light-driftwood { background: var(--light-driftwood); }
.sg-c-light-desert-sand { background: var(--light-desert-sand); }
.sg-c-desert-sand { background: var(--desert-sand); }
.sg-c-dark-mocha-beige { background: var(--dark-mocha-beige); }
.sg-c-grey-soft { background: var(--grey-soft); }
.sg-c-nippon-red { background: var(--nippon-red); }

/* ---- the test page, /_test/ (#35009): each element in a cell of its own, named below it ---- */
.tp section { margin-top: 2.25rem; }
.tp section:first-of-type { margin-top: 0; }
.tp h2 { font-size: 1.375rem; margin-bottom: 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border-light); }
.tp h3 { font-size: 1.0625rem; margin: 1.25rem 0 0.5rem; }
.tp-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
/* Colour cards (#35182): the swatch is painted by test-page.js (no inline styles under the CSP). */
.tp-grid.is-colours { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.tp-swatch { height: 4.5rem; border-bottom: 1px solid var(--border-light); }
.tp-colour figcaption code.tp-copy { position: relative; justify-self: start; font-size: 0.875rem; color: var(--text); }
.tp-colour figcaption > code.tp-copy { font-weight: 600; }
.tp-var { display: block; }
.tp-var + .tp-var code.tp-copy { color: var(--text-soft); }
.tp-alias { font-size: 0.8125rem; color: var(--text-soft); }
.tp-alias code.tp-copy { font-size: 0.8125rem; }
.tp-grid.is-messages { grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
.tp-cell { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.tp-cell.is-wide { grid-column: 1 / -1; }
.tp-sample { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.9rem; min-width: 0; }
.tp-sample > * { margin-block: 0; }
.tp-sample > .message-list, .tp-sample > .notice { flex: 1 1 100%; min-width: 0; }
.tp-cell figcaption { display: grid; gap: 0.1rem; padding: 0.4rem 0.9rem 0.5rem; border-top: 1px solid var(--border-light); background: var(--surface-grey); font-size: 0.875rem; }
.tp-cell figcaption code { background: none; border: 0; padding: 0; font-size: 0.75rem; color: var(--text-soft); overflow-wrap: anywhere; }
.sg-t1 { font-size: 2rem; font-weight: 600; line-height: 1.25; }
.sg-t2 { font-size: 1.375rem; font-weight: 600; }
.sg-t3 { font-size: 1.0625rem; font-weight: 600; }
.sg-form { margin-inline: 0; }
.sg-w38 { width: 38%; } .sg-w82 { width: 82%; } .sg-w100 { width: 100%; }

/* The roadmap's checked-off items (#30549): folded under Done, each with a tick. */
.roadmap-done { margin-top: 1.25rem; border-top: 1px solid var(--border-light); padding-top: 0.75rem; }
.roadmap-done summary { cursor: pointer; color: var(--success-text); font-weight: 600; }
.roadmap-item.is-done .roadmap-text { color: var(--text-soft); }
.roadmap-item.is-done .roadmap-text > :first-child::before { content: ""; --i: url("icons/material/check.svg"); color: var(--success-text); }

/* /help and /who (commands): a small box above the message box. */
.command-help { position: relative; border: 1px solid var(--border); border-left: 4px solid var(--brand-line); border-radius: var(--radius);
	background: var(--surface); padding: 0.5rem 2rem 0.5rem 0.8rem; font-size: 0.9375rem; max-height: 40vh; overflow-y: auto; }
.command-help[hidden] { display: none; }
.command-list { list-style: none; margin: 0.35rem 0 0; padding: 0; }
.command-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.75rem; padding: 0.35rem 0;
	border-top: 1px solid var(--border-light); }
.command-row:first-child { border-top: 0; }
.command-name { background: var(--surface-pale); border: 0; padding: 0.05rem 0.4rem; white-space: nowrap; font-size: 0.875rem; }
.command-note { color: var(--text-soft); flex: 1 1 14rem; }
.command-help-close { position: absolute; top: 0.2rem; right: 0.4rem; appearance: none; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--text-soft); }
.member.is-busy .member-state { color: var(--accent-ink); }
/* On a phone, each command above what it does, top to bottom (#31300). */
@media (max-width: 40rem) {
	.command-row { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
	.command-name { white-space: normal; }
	.command-note { flex: none; }
}

/* ---- workspaces (#31870) ---------------------------------------------------------------- */

/* A page in a workspace pane (?embed=1): no header, hero or footer; the page itself to the
   pane's edges. The pane is its viewport, so the rest of this sheet fits it as it fits a phone
   or a desktop. */
.is-embed main { padding: 0; border: 0; }
.is-embed main > * { max-width: none; }
.is-embed .card { margin-top: 0; border: 0; box-shadow: none; border-radius: 0; }
.is-embed.layout-chat main { padding-bottom: 0; }

/* A workspace: the whole width and the height under the menu, the panes in a grid. */
.layout-workspace { height: 100vh; height: 100dvh; }
.layout-workspace .hero { display: none; }
.layout-workspace main { display: flex; flex-direction: column; min-height: 0; padding: 0.5rem; }
.layout-workspace main > .ws { max-width: none; width: 100%; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.5rem; }
/* A card like everything on main (#35193), slimmer: it is a toolbar. */
.ws-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.5rem 0.9rem; margin-top: 0; }
.ws-name { font-size: 1.125rem; margin: 0; overflow-wrap: anywhere; }
/* An editable title, in place (the scratchpad's). */
.ws-title { font: 600 1.125rem var(--sans); color: var(--text); border: 1px solid transparent; border-radius: var(--radius);
	padding: 0.2rem 0.4rem; background: none; min-width: 12rem; }
.ws-title:hover, .ws-title:focus { border-color: var(--border); background: var(--surface); }
.ws-icon { appearance: none; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius);
	cursor: pointer; color: var(--brand-text); font-size: 0.95rem; line-height: 1; padding: 0.25rem 0.4rem; }
.ws-icon:hover { border-color: var(--brand-line); background: var(--surface-pale); }
.ws-picker input[type=text] { width: 100%; font: inherit; padding: 0.4rem 0.5rem; border: 1px solid var(--text-soft); border-radius: var(--radius); }
.ws-pane-change { appearance: none; border: 0; background: none; font-size: 0.95rem; line-height: 1; cursor: pointer;
	color: var(--on-brand); padding: 0 0.2rem; }
.ws-pane-change:hover { color: var(--sand); }
.ws-bar .status { margin: 0; }
.ws-delete { margin-left: auto; font-size: 0.9375rem; }
/* The grid (#36103): columns, each with its own rows. workspace.js gives every pane and gutter
   its place as shares of the grid (--x, --y, --w, --h), so a pane moves and resizes without its
   page loading again. Half the gap is taken off each side of a pane. */
.ws-grid { flex: 1; min-height: 0; position: relative; --gap: 0.5rem; margin: calc(var(--gap) / -2); }
.ws-grid > .ws-pane {
	position: absolute;
	left: calc(var(--x) * 100% + var(--gap) / 2); top: calc(var(--y) * 100% + var(--gap) / 2);
	width: calc(var(--w) * 100% - var(--gap)); height: calc(var(--h) * 100% - var(--gap));
}
/* The lines between panes: drag them (or focus one and use the arrow keys) to resize. */
.ws-gutter { position: absolute; z-index: 2; touch-action: none; border-radius: 2px; }
.ws-gutter.is-col { left: calc(var(--x) * 100% - var(--gap) / 2); top: var(--gap); bottom: var(--gap); width: var(--gap); cursor: col-resize; }
.ws-gutter.is-row { left: calc(var(--x) * 100% + var(--gap)); top: calc(var(--y) * 100% - var(--gap) / 2);
	width: calc(var(--w) * 100% - 2 * var(--gap)); height: var(--gap); cursor: row-resize; }
.ws-gutter:hover, .ws-gutter:focus-visible, .ws-gutter:active { background: var(--highlight); outline: 0; }
.ws-pane.is-empty { flex-direction: column; gap: 0.5rem; }
.ws-pane.is-empty .link-button { font-size: 0.875rem; }
.ws-pane-below[hidden] { display: none; }
/* Too narrow for a grid (a phone): the panes one under another, the page scrolling. */
.ws-grid.is-stacked { display: flex; flex-direction: column; gap: var(--gap); margin: 0; overflow-y: auto; }
.ws-grid.is-stacked > .ws-pane { position: static; width: auto; height: 80dvh; flex: none; }
.ws-grid.is-stacked > .ws-pane.is-empty { height: 8rem; }
.ws-grid.is-stacked > .ws-gutter { display: none; }
.ws-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface);
	border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ws-pane.is-empty { align-items: center; justify-content: center; border-style: dashed; background: var(--surface-pale-soft); }
.ws-pane-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.4rem 0.2rem 0.6rem;
	background: var(--brand); color: var(--on-brand); font-size: 0.875rem; }   /* white on --brand (#35201) */
.ws-pane-title { color: var(--on-brand); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ws-pane-close { appearance: none; border: 0; background: none; font-size: 1.15rem; line-height: 1; cursor: pointer; color: var(--on-brand); padding: 0 0.2rem; }
.ws-pane-close:hover { color: var(--sand); }
.ws-pane-title:hover, .ws-pane-title:focus-visible { color: var(--on-brand); text-decoration: underline; }   /* not a:hover's deep turquoise (#35203) */
.ws-frame { flex: 1; width: 100%; border: 0; display: block; }
.ws-picker { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; min-width: min(26rem, 90vw); }
.ws-picker::backdrop { background: rgb(0 0 0 / 0.3); }
.ws-picker h2 { font-size: 1.125rem; margin-bottom: 0.75rem; }
.ws-picker select { font: inherit; padding: 0.4rem 0.5rem; border: 1px solid var(--text-soft); border-radius: var(--radius); width: 100%; }

/* New workspace: the split picked from little drawings of it. */
.new-ws { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border-light); max-width: 40rem; }
.ws-pick { border: 0; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.ws-pick legend { font-weight: 600; margin-bottom: 0.4rem; padding: 0; }
.ws-tile { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; cursor: pointer; padding: 0.5rem;
	border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ws-tile:has(input:checked) { border-color: var(--brand-line); background: var(--surface-pale); }
.ws-tile input { position: absolute; opacity: 0; pointer-events: none; }
.ws-tile:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.ws-mini { display: grid; gap: 2px; width: 4.5rem; height: 2.8rem; }
.ws-mini i { background: var(--highlight); border-radius: 1px; }
.ws-mini.slots-1 { grid-template-columns: 1fr; }
.ws-mini.slots-2 { grid-template-columns: repeat(2, 1fr); }
.ws-mini.slots-3 { grid-template-columns: repeat(3, 1fr); }
.ws-mini.slots-4 { grid-template-columns: repeat(2, 1fr); }
.ws-mini.slots-6 { grid-template-columns: repeat(3, 1fr); }
.ws-mini.slots-8 { grid-template-columns: repeat(4, 1fr); }
.ws-tile-label { font-size: 0.8125rem; color: var(--text-soft); }

/* A scratchpad (#31870): the notes take the height there is. */
.layout-scratch { height: 100vh; height: 100dvh; }
.layout-scratch main { display: flex; flex-direction: column; min-height: 0; padding-bottom: 1rem; }
.layout-scratch main > .scratch { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
.scratch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.scratch-bar .status { margin: 0; }
.scratch-bar #scratch-status { margin-left: auto; }   /* the status, then Preview, on the right; private beside the title (#34326, #34327, #34329) */
.scratch-bar .ws-title { field-sizing: content; min-width: 4rem; max-width: 100%; }   /* private right after the title */
.scratch-unlock { max-width: 24rem; margin: 1rem 0; }   /* a protected pad, locked (#41049) */
.scratch-list-new { margin: 0 0 1.25rem; }   /* /scratch (#41049) */
.scratch-group + .scratch-group { margin-top: 1.75rem; }
.scratch-group > h2 { margin: 0 0 0.6rem; }
/* Private drops (#41055): the lists on /drops, one on /drops/ID, the composer's button. */
.drops-list { list-style: none; margin: 0; padding: 0; }
.drops-list > li { padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.drops-list > li:last-child { border-bottom: 0; }
.drop-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; }
.drop-facts dt { font-weight: 600; }
.drop-facts dd { margin: 0; overflow-wrap: anywhere; }
#new-drop-text { width: 100%; box-sizing: border-box; font-family: var(--mono, monospace); }
.drop-content textarea { width: 100%; font-family: var(--mono, monospace); }
/* Level with Attach files beside it (#41088): a label's plain line, no button padding or border. */
.composer-actions .drop-button { padding: 0; border: 0; line-height: inherit; }
.composer-actions .drop-button:hover { text-decoration: underline; }
/* Where the row is too narrow for all its buttons on one line, just "Drop", so Send keeps its
   place beside Options… */
.composer-actions { container-type: inline-size; }
.drop-narrow { display: none; }
@container (max-width: 26rem) {
	.drop-wide { display: none; }
	.drop-narrow { display: inline; }
}
.scratch-body { flex: 1; min-height: 8rem; width: 100%; resize: none; font: 400 1rem/1.55 var(--mono); color: var(--text);
	padding: 0.7rem 0.8rem; border: 1px solid var(--text-soft); border-radius: var(--radius); }
.scratch-view { flex: 1; overflow-y: auto; padding: 0.2rem 0.2rem 1rem; }
.is-embed.layout-scratch main { padding: 0; }   /* wraps closer in a workspace pane (#35197) */

/* Notifications as a page (#31870). */
.mentions-page { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.mentions-head { display: flex; align-items: center; gap: 0.75rem; justify-content: space-between; }

/* A room's documentation from its repository (#32685): the list beside, the document. */
/* A size container (#32112): it folds to the space it's given, a workspace pane included. */
.repo-docs { container-type: inline-size; }
.repo-docs-grid { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: 1.25rem; }
.repo-docs-grid > .notice { grid-column: 1 / -1; }
/* The file list on light grey, apart from the document (#33178). */
.repo-docs-nav { background: var(--surface-grey); border: 1px solid var(--border-light); border-radius: var(--radius);
	padding: 0.6rem 0.75rem; align-self: start; }
.repo-docs-nav ul { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.2rem; font-size: 0.9375rem; }
.repo-docs-fold { font-size: 0.875rem; font-weight: 600; }
/* Folded (#33179): a slim strip with the button above the document (#33344), which has the
   whole width, its lines no longer held to the usual reading width. (On a phone the list is
   above the document anyway, folded or not.) */
.repo-docs-grid.is-folded { grid-template-columns: 1fr; }
.repo-docs-grid.is-folded .repo-docs-nav { justify-self: start; }
.repo-docs-grid.is-folded .repo-docs-nav ul { display: none; }
.repo-docs-grid.is-folded .repo-docs-text p, .repo-docs-grid.is-folded .repo-docs-text ul { max-width: none; }
.repo-docs-nav a { text-decoration: none; overflow-wrap: anywhere; }
.repo-docs-nav .is-current a { font-weight: 700; color: var(--text); }
.repo-docs-text { min-width: 0; }
@container (max-width: 40rem) { .repo-docs-grid { grid-template-columns: 1fr; } }
.repo-docs-fix { grid-column: 1 / -1; max-width: 36rem; }
.repo-docs-form { margin-top: 1rem; }
/* Code on the blue hero bar: light on a translucent ground, readable (seen on /room/docs). */
.hero-lead code { color: var(--on-brand); background: rgb(255 255 255 / 0.16); border-color: rgb(255 255 255 / 0.25); overflow-wrap: anywhere; }
/* Loading another document: the one shown fades while the next comes, no blank page (#33236). */
.repo-docs-text.is-loading { opacity: 0.45; transition: opacity 0.15s; }
.repo-docs-text { transition: opacity 0.15s; }
/* Project code (#33582): the tree, folders folding, and a file in full. */
.code-tree ul { list-style: none; margin: 0.2rem 0 0; padding: 0; display: grid; gap: 0.15rem; font-size: 0.9rem; }
.code-tree ul ul { padding-left: 0.9rem; border-left: 1px solid var(--border-light); margin-left: 0.25rem; }
.code-tree summary { cursor: pointer; overflow-wrap: anywhere; }
.code-tree a { text-decoration: none; overflow-wrap: anywhere; }
.code-tree .is-current > a { font-weight: 700; color: var(--text); }
.code-tree { max-height: 70vh; overflow: auto; }
.repo-docs-grid.is-folded .code-tree { display: none; }
.code-path { font-family: var(--mono); font-size: 0.875rem; color: var(--text-soft); margin: 0 0 0.5rem; overflow-wrap: anywhere; }
.code-file { margin: 0; font-size: 0.8125rem; line-height: 1.45; overflow: auto; border: 1px solid var(--border-light); border-radius: var(--radius); }
.code-file code { display: block; padding: 0.75rem; white-space: pre; tab-size: 4; }

/* Moving a pane (#33656): by its title bar; while dragging, the panes' pages don't take the
   pointer (an iframe would swallow the drop), and the pane it would land on is outlined. */
.ws-pane-bar[draggable="true"] { cursor: grab; }
.ws-grid.is-dragging .ws-frame { pointer-events: none; }
.ws-pane.is-dragged { opacity: 0.5; }
.ws-pane.is-drop { outline: 3px dashed var(--highlight); outline-offset: -3px; }
.ws-code-new { border: 0; margin: 0; padding: 0; min-width: 0; }
/* Asking for one's own single sign-on (#35483): room to describe it. */
.sso-request textarea { display: block; box-sizing: border-box; width: 100%; height: 20rem; resize: vertical;
	font: 400 1.0625rem/1.5 var(--sans); color: var(--text); padding: 0.6rem 0.7rem; border: 1px solid var(--text-soft); border-radius: var(--radius); background: var(--surface); }

/* ---- pinned items (#35637): what belongs to the room. A row of chips in the room's bar; an
   item opens in a dock beside the messages, left or right (pins.js adds has-docks to main), or
   as one sheet over them when the page is too narrow for that. ---- */

.pins {
	list-style: none; margin: 0; padding: 0 0 2px; display: flex; gap: 0.4rem;
	flex-basis: 100%; min-width: 0; overflow-x: auto; scrollbar-width: thin;   /* one line, however many */
}
.pins[hidden] { display: none; }
.pins li { flex: none; }
/* The room's tools come first (#37323); a line parts them from what is pinned. */
.pins .pin-tool + li:not(.pin-tool) { padding-left: 0.4rem; border-left: 1px solid var(--border); }
.pin-chip[aria-expanded="true"] { background: var(--brand); border-color: var(--brand-line); color: var(--on-brand); }
.chat-bar.is-folded .pins { display: none; }   /* (a phone's folded bar, #28488) */
.pin-chip {
	position: relative; display: inline-flex; align-items: center; gap: 0.35rem; max-width: 16rem;
	font: 600 0.875rem/1.5 var(--sans); color: var(--link-text); text-decoration: none; white-space: nowrap; cursor: pointer;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.1rem 0.55rem;
}
.pin-chip:hover { border-color: var(--highlight); color: var(--brand-text); }
.pin-chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand-line); color: var(--on-brand); }
.pin-chip.is-private { border-style: dashed; }   /* only yours */
.pin-name { overflow: hidden; text-overflow: ellipsis; }
.pin-icon { font-weight: 400; }
.pin-chip.has-news::after {
	content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent);
}

/* The Pinned panel: the list, then the form. It borrows the TODO list's pill and popover. */
.pin-list { list-style: none; margin: 0; padding: 0; }
.pin-row { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.3rem 0.2rem; border-bottom: 1px solid var(--border-light); }
.pin-row-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; text-align: left; }
.pin-row-title.link-button { font-size: inherit; padding-block: 0.3rem; }
.pin-row .link-button { font-size: 0.875rem; }
.pin-add { margin-top: 0.75rem; display: grid; gap: 0.6rem; }
.pin-add .field { margin: 0; }
.pin-add .field[hidden], .pin-add .check[hidden] { display: none; }
.pin-add select, .pin-add input[type="text"], .pin-add input[type="url"] { width: 100%; }
.pin-add-actions { display: flex; align-items: center; gap: 0.75rem; }
.pin-add-actions .status { margin: 0; }

.layout-chat main.has-docks { flex-direction: row; gap: 0.75rem; }
.layout-chat main.has-docks > :not(dialog) { max-width: none; margin-inline: 0; }   /* not its dialogs: they keep margin auto, centred (#41175) */
.layout-chat main.has-docks > .chat { flex: 1; min-width: 0; width: auto; }
.dock { position: relative; display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.dock[hidden] { display: none; }
.dock[data-side="left"], .dock[data-side="right"] { flex: none; width: var(--dock-width, 30rem); max-width: 60%; margin-top: -2.5rem; }
.is-embed .dock[data-side] { margin-top: 0; }
.dock-bar { display: flex; align-items: flex-end; gap: 0.25rem; background: var(--brand); padding: 0.25rem 0.3rem 0; }
.dock-tabs { flex: 1; min-width: 0; display: flex; gap: 0.2rem; overflow-x: auto; scrollbar-width: none; }
.dock-tab { flex: none; display: inline-flex; align-items: center; max-width: 14rem; color: var(--on-brand); border-radius: var(--radius) var(--radius) 0 0; }
.dock-tab.is-on { background: var(--surface); color: var(--text); }
.dock-tab-open, .dock-tab-close, .dock-move {
	appearance: none; border: 0; background: none; color: inherit; cursor: pointer;
	font: 600 0.875rem/1.5 var(--sans); padding: 0.3rem 0.5rem;
}
.dock-tab-open { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-tab-close { padding-inline: 0.1rem 0.45rem; font-size: 1.05rem; line-height: 1; }
.dock-tab-open:hover, .dock-tab-close:hover, .dock-move:hover { text-decoration: underline; }
.dock-tab-open:focus-visible, .dock-tab-close:focus-visible, .dock-move:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.dock-move { color: var(--on-brand); align-self: center; }
/* "+" after the tabs (#38162), and its menu under the bar. */
.dock-bar { position: relative; }
.dock-add {
	flex: none; align-self: center; border: 0; background: none; color: var(--on-brand); cursor: pointer;
	font: inherit; font-size: 1.25rem; line-height: 1; padding: 0.15rem 0.5rem;
}
.dock-add:hover { text-decoration: underline; }
.dock-add:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.dock-add-menu {
	position: absolute; top: 100%; right: 0.3rem; z-index: 5; min-width: 14rem; max-width: min(22rem, 100%);
	display: flex; flex-direction: column; padding: 0.3rem; background: var(--surface);
	border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 18px rgb(0 0 0 / 0.18);
}
.dock-add-menu[hidden] { display: none; }
.dock-add-item {
	border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer;
	padding: 0.4rem 0.6rem; border-radius: var(--radius); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dock-add-item:hover, .dock-add-item:focus-visible { background: var(--surface-pale); }
.dock-add-item.is-new { border-top: 1px solid var(--border); border-radius: 0; margin-top: 0.2rem; color: var(--link-text); }
.dock-add-none { margin: 0; padding: 0.4rem 0.6rem; }
.dock-hide { flex: none; align-self: center; margin: 0 0.15rem 0.25rem; }
.dock-body { flex: 1; min-height: 0; display: flex; }
.dock-frame { flex: 1; width: 100%; border: 0; display: block; }
.dock-frame[hidden] { display: none; }
/* The inner edge resizes a dock. */
.dock-grip { position: absolute; top: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; }
.dock[data-side="left"] .dock-grip { right: 0; }
.dock[data-side="right"] .dock-grip { left: 0; }
.dock-grip:hover, .dock-grip:focus-visible, main.is-resizing .dock-grip { background: rgb(3 139 148 / 0.35); outline: 0; }
main.is-resizing { user-select: none; cursor: col-resize; }
main.is-resizing .dock-frame { pointer-events: none; }
/* Too narrow for docks (a phone, a workspace pane): one sheet over everything, its items as tabs. */
.dock[data-side="sheet"] { position: fixed; inset: 0; z-index: 60; margin: 0; border: 0; border-radius: 0; max-width: none; }
body.has-sheet { overflow: hidden; }

/* A key (#36133), as in Settings › Keyboard shortcuts. */
kbd {
	display: inline-block; min-width: 1.4em; padding: 0 0.35em; text-align: center;
	font: 600 0.8125rem/1.5 var(--sans); color: var(--text);
	background: var(--surface-grey); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 3px;
}

/* The keymap (#36146): Settings lists the keys, /settings/keymap changes them. */
.keys { white-space: nowrap; }
.keys-none { color: var(--text-soft); font-style: italic; }
.keymap-summary, .keymap-fixed { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.4rem; }
.keymap-summary li, .keymap-fixed li { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: 0.25rem 1rem; align-items: baseline; }
.keymap { display: grid; gap: 1.25rem; margin: 1.25rem 0; }
.keymap-row { border-top: 1px solid var(--border-light); padding-top: 1rem; }
.keymap-name { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.keymap-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.keymap-input {
	font: 600 1rem var(--sans); width: 16rem; max-width: 100%; padding: 0.45rem 0.6rem; cursor: pointer;
	color: var(--text); background: var(--surface); border: 1px solid var(--text-soft); border-radius: var(--radius);
}
.keymap-input:focus { outline: 3px solid var(--accent); outline-offset: 1px; background: var(--surface-pale); }
.keymap-row .hint, .keymap-row .status { margin: 0.35rem 0 0; }
.keymap-fixed-title { font-size: 1.125rem; margin: 2rem 0 0.75rem; }

/* The guide, laid out as Settings (#36180): a section's heading as a card's title. */
.guide-section > h2.settings-title { margin-top: 0; }
.guide-section > :last-child { margin-bottom: 0; }
/* Its tables and code are wider than a phone: the columns may shrink below them, and a section
   scrolls sideways on its own instead of the page. */
.guide .settings-grid { grid-template-columns: minmax(0, 1fr); }
@container (min-width: 42rem) { .guide .settings-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); } }
.guide-section { overflow-x: auto; }

/* New room and New workspace from the menus (#36182): at the left of the menu's foot; the form
   in a dialog, as wide as the form it borrows. */
.menu-pop-foot:has(.menu-pop-new) { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-align: left; }
.menu-pop-new { font-weight: 600; }
.menu-dialog { width: min(34rem, 92vw); color: var(--text); background: var(--surface); }
.menu-dialog .ws-pick { margin-top: 0.25rem; }

/* Things to do (#36177): the plan's tags and fields, on a room's list and on a person's own;
   the To do page. */
.todo-plan { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; vertical-align: baseline; }
.todo-plan:empty { display: none; }
.tag-repeat { background: var(--surface-grey); color: var(--text-soft); }
.todo-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; margin: 0.5rem 0; }
.todo-fields .field { margin: 0; }
.todo-fields .field[hidden] { display: none; }
.todo-fields label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.15rem; }
.todo-fields input, .todo-fields select { font: inherit; font-size: 0.9375rem; padding: 0.25rem 0.4rem; width: auto;
	color: var(--text); background: var(--surface); border: 1px solid var(--text-soft); border-radius: var(--radius); }
.todo-fields input[type="number"] { width: 4.5rem; }
.todo-add { margin-top: 0.6rem; }
.todo-add[hidden] { display: none; }
.todo-add details > summary { cursor: pointer; font-size: 0.875rem; color: var(--link-text); }
.todo-add .status { margin: 0.25rem 0 0; }
.todo-page { max-width: 52rem; }
.todo-page .todo-item { align-items: flex-start; }
.todo-page .todo-item > input { margin-top: 0.35rem; }
/* A card that folds from its title (#37530): the title is a button with a mark that turns. */
.card-fold {
	appearance: none; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; text-align: left;
	font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 0.45rem;
}
.card-fold::before { content: "\25BE"; font-size: 0.9em; color: var(--link-text); transition: transform 150ms; }
.card-fold[aria-expanded="false"]::before { transform: rotate(-90deg); }
.card-fold:hover { color: var(--brand-text); }
.card-fold-body[hidden] { display: none; }
.card.is-folded .settings-title, .card.is-folded .todo-head { margin-bottom: 0; }
.card.is-folded .todo-sort { display: none; }
@media (prefers-reduced-motion: reduce) { .card-fold::before { transition: none; } }
/* The list's order (#37511), on the line of the card's title (#37519). */
.todo-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.25rem 1rem; margin-bottom: 0.9rem; }
.todo-head .settings-title { margin: 0; }
.todo-sort { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; }
.todo-sort label { font-weight: 600; }
.todo-sort select { font: inherit; padding: 0.15rem 0.3rem; color: var(--text); background: var(--surface); border: 1px solid var(--text-soft); border-radius: var(--radius); }
.todo-edit { display: grid; gap: 0.5rem; margin: 0.5rem 0 0.25rem; }
.todo-edit input[type="text"], .todo-edit textarea { width: 100%; font: inherit; padding: 0.35rem 0.5rem;
	color: var(--text); background: var(--surface); border: 1px solid var(--text-soft); border-radius: var(--radius); }
.todo-edit .actions { margin: 0; }
/* Assign to (#37456): its label, the list and the button keep together when the row wraps. */
.todo-assign { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; }
.todo-assign[hidden], .todo-assigned[hidden] { display: none; }
.todo-assigned { font-size: 0.9375rem; }
.todo-assign label { font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.todo-assign select { font: inherit; font-size: 0.9375rem; padding: 0.2rem 0.3rem; min-width: 0; max-width: 12rem;
	color: var(--text); background: var(--surface); border: 1px solid var(--text-soft); border-radius: var(--radius); }
.todo-line { flex: 1; min-width: 0; }
.todo-room-item { text-decoration: none; }
.todo-room-item:hover .todo-title { text-decoration: underline; }
.todo-room h3 { font-size: 1rem; margin: 1rem 0 0.25rem; }
.my-done { margin-top: 1rem; }
/* The picked items' actions (#40146): kept in sight at the bottom while the list scrolls. */
.todo-batch { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center;
	gap: 0.4rem 0.75rem; margin-top: 0.5rem; padding: 0.5rem 0.7rem; background: var(--surface);
	border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -2px 8px rgb(0 0 0 / 0.08); }
.todo-batch[hidden] { display: none; }
.todo-batch-count { font-weight: 600; flex: 1 1 100%; }   /* its own row; breaks between items only */
.todo-batch-actions { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 0.4rem 0.75rem; }   /* Assign to and whom on the left, Clear and Mark as Done on the right (#40183) */
.todo-batch-end { display: inline-flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.todo-batch-assign { display: inline-flex; gap: 0.4rem; align-items: center; min-width: 0; }
.todo-batch-assign select { min-width: 0; max-width: 12rem; }
.todo-item.is-picked { background: var(--surface-grey); }
/* Whom an item is assigned to (#40196): a name, so not in capitals; with their image. */
.tag-assignee { display: inline-flex; align-items: center; gap: 0.25rem; text-transform: none; letter-spacing: 0;
	font-weight: 600; padding: 0.05rem 0.4rem 0.05rem 0.15rem; vertical-align: 0.05em; white-space: nowrap; }
.tag-assignee.is-anyone { padding-left: 0.4rem; }
.tag-assignee .avatar { width: 16px; height: 16px; margin: 0; font-size: 0.6rem; }
.my-done > summary { cursor: pointer; font-weight: 600; color: var(--link-text); }
.todo-digest-note { margin: 0; }

/* A room's TODO list as a page (#36277). */
.todo-page-link { margin: 0.6rem 0 0; font-size: 0.875rem; }
#rt-add-more textarea { width: 100%; margin-top: 0.4rem; font: inherit; padding: 0.35rem 0.5rem;
	color: var(--text); background: var(--surface); border: 1px solid var(--text-soft); border-radius: var(--radius); }

.pin-code-new { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 0.6rem; }
.pin-code-new[hidden] { display: none; }
.pin-code-new input { width: 100%; }

/* A room's Needs you beside its TODO list (#36425). Its own class names: the Needs you page's
   (.needs-list and the rest) lay an item out for a wide page, and overlapped here (#36441). */
.rn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.rn-item { min-width: 0; }
/* The whole card is the link to the message (#36447). */
.rn-link { display: block; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius);
	padding: 0.5rem 0.75rem; color: inherit; text-decoration: none; }
.rn-link:hover, .rn-link:focus-visible { background: var(--surface-pale); border-color: var(--highlight); border-left-color: var(--accent); color: inherit; }
.rn-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.5rem; }
.rn-head .todo-meta { white-space: normal; }
.rn-excerpt { display: block; margin-top: 0.3rem; overflow-wrap: anywhere; }

/* The TODO pages in a dock or a pane (#36442): one sheet. No line under them that leads back to
   the room one is already in, and no strip of the page's ground between Needs you and To do. */
.is-embed .todo-page { margin-top: 0; max-width: none; }
.is-embed .todo-page .settings-cards { gap: 0; }
.is-embed .todo-page .card { padding: 1rem 1.1rem; border-top: 0; }
/* One item only (?item=3, a !3's dialog, #40099): the item, nothing else of the page. */
.todo-one #room-needs, .todo-one .todo-head, .todo-one #rt-add, .todo-one #rt-done, .todo-one .todo-digest-note { display: none; }
.todo-one .todo-list { margin: 0; }
.is-embed .todo-page .card + .card { border-top: 1px solid var(--border-light); }
.is-embed .todo-page .todo-digest-note { display: none; }
.is-embed:has(.todo-page) main { background: var(--surface); box-shadow: none; }   /* (no ground under a short list either) */

/* The screen's measurements (/viewport, #36453): a small box in the corner, over everything. */
.viewport-box {
	position: fixed; left: 0.25rem; top: 30%; z-index: 1000; margin: 0; padding: 0.3rem 0.4rem; pointer-events: none;
	font: 11px/1.35 var(--mono); color: #fff; background: rgb(0 0 0 / 0.78); border-radius: 3px; white-space: pre;
}
.viewport-box[hidden] { display: none; }
/* Takes focus for a moment to make an iPhone work out its visible area again (#36583): out of
   sight, and 16 px so the phone doesn't zoom in on it. */
.viewport-reset {
	position: fixed; top: 0; left: 0; width: 1px; height: 1px; padding: 0; border: 0;
	opacity: 0; pointer-events: none; font-size: 16px;
}

/* Agents (#39183): one agent's page, our private chat beside its usage; side by side where
   there is room for both, the chat first. The chat's pane can show the agent's console instead. */
/* As in a room (.layout-chat): the page never scrolls, so the header stays in view; the tab
   in the pane scrolls, its terminal and its chat on their own. On a phone too, unlike a room. */
.layout-agent { height: 100vh; height: 100dvh; min-height: 0; }
.layout-agent .hero-inner { padding-block: 1.1rem 3.2rem; }
.layout-agent .hero-title { font-size: 1.6rem; margin-bottom: 0.1rem; max-width: none; }
.layout-agent .hero-lead { font-size: 1rem; max-width: none; }
.layout-agent main { display: flex; flex-direction: column; min-height: 0; padding-bottom: 1rem; }
.layout-agent main > .agent-page { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; }
.layout-agent .agent-page-grid { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.layout-agent .agent-pane { min-height: 0; }
.layout-agent .agent-pane-body { flex: 1 1 0; min-height: 0; height: auto; }
.layout-agent .agent-pane-body[hidden] { display: none; }
.agent-page { container-type: inline-size; }
.agent-page-grid { display: grid; gap: 1.25rem; margin-top: -3rem; }
.agent-page-grid > .card { margin-top: 0; }   /* the grid overlaps the hero, as a card does */
@container (max-width: 40rem) { .agent-page-grid > .card { border-inline: 0; border-radius: 0; } }
/* One card the page's width (#39441), in tabs (#39431), so a terminal fits without scrolling sideways. */
.agent-pane { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.agent-pane-tabs { display: flex; gap: 0.25rem; padding: 0.5rem 0.75rem 0; border-bottom: 1px solid var(--border); }
.agent-pane-tabs [role="tab"] { border: 0; background: none; padding: 0.4rem 0.75rem; font: inherit; color: var(--text-soft); border-bottom: 2px solid transparent; cursor: pointer; }
.agent-pane-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--highlight); }
.agent-pane-body { height: min(78vh, 52rem); }
.agent-pane-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.agent-pane-empty { padding: 1.5rem; }
.agent-pane-body.agent-tab-page { height: auto; padding: 1.25rem 1.5rem 1.5rem; overflow-y: auto; overscroll-behavior: contain;
	position: relative; }   /* what is placed in it (the graph's tip, hidden labels) scrolls in it, not past the page */
.agent-tab-page > #usage { max-width: 52rem; }
.agent-protection select { max-width: 16rem; }
@container (max-width: 40rem) { .agent-pane-body.agent-tab-page { padding: 1rem; } }
.agent-pane-body[hidden] { display: none; }
/* The console (#39183): a terminal, dark in either theme; its whole width fits when the pane allows
   (down to 9px type), else it scrolls sideways. */
.agent-console { --console-bg: #14161a; --console-fg: #d6d9de; container-type: inline-size;
	display: flex; flex-direction: column; background: var(--console-bg); color: var(--console-fg); }
.agent-console-screen { flex: 1 1 auto; min-height: 0; margin: 0; padding: 0.6rem 0.75rem; overflow: auto;
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; line-height: 1.25;
	font-size: clamp(0.5625rem, calc((100cqi - 1.5rem) / (var(--cols, 120) * 0.61)), 0.875rem);
	white-space: pre; tab-size: 8; color: var(--console-fg); background: var(--console-bg); }
.agent-console-screen:focus-visible { outline: 2px solid var(--highlight); outline-offset: -2px; }
/* Until it has a console (#40011): how to link one, on the page's colours, in place of the terminal. */
.agent-console.is-setup { overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem 1.5rem 1.5rem;
	background: var(--surface); color: var(--text); }
.agent-console.is-setup > :not(.agent-console-setup), .agent-console:not(.is-setup) > .agent-console-setup { display: none; }
.agent-console-setup .agent-link-steps { margin: 1rem 0 0; padding-inline-start: 1.5rem; }
.agent-link-steps h3 { margin: 1.1rem 0 0.25rem; font-size: 1rem; }
/* Linux or macOS (#40246): tabs on the steps that differ, all switched together. */
.os-tabs { display: flex; gap: 0.25rem; margin: 0 0 0.5rem; border-bottom: 1px solid var(--border); }
.os-tabs [role="tab"] { border: 0; background: none; padding: 0.25rem 0.6rem; font: inherit; font-size: 0.875rem; color: var(--text-soft); border-bottom: 2px solid transparent; cursor: pointer; }
.os-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--highlight); }
.agent-console-setup[data-os="linux"] .os-pane[data-os="macos"], .agent-console-setup[data-os="macos"] .os-pane[data-os="linux"] { display: none; }
.agent-console-setup[data-cli] .os-pane[data-cli] { display: none; }   /* only the chosen program's steps (#41546) */
.agent-console-setup[data-cli="claude"] .os-pane[data-cli="claude"], .agent-console-setup[data-cli="vibe"] .os-pane[data-cli="vibe"],
.agent-console-setup[data-cli="codex"] .os-pane[data-cli="codex"], .agent-console-setup[data-cli="agy"] .os-pane[data-cli="agy"] { display: block; }
.agent-link-steps .hint { margin: 0 0 0.4rem; }
@container (max-width: 40rem) { .agent-console.is-setup { padding: 1rem; } }
.agent-console-bar { display: flex; align-items: center; gap: 0.5rem; border-top: 1px solid #2a2e35; }
.agent-console-bar .agent-console-status { flex: 1 1 auto; min-inline-size: 0; border-top: 0; }
.agent-console-fit { flex: none; margin-inline-end: 0.5rem; padding: 0.15rem 0.6rem; font: 600 0.8125rem var(--sans);
	color: #d6d9de; background: transparent; border: 1px solid #4a505a; border-radius: var(--radius); cursor: pointer; }
.agent-console-fit:hover { background: #2a2e35; }
.agent-console-fit[hidden] { display: none; }
/* Fitted (#39522): as wide as the screen, so it only scrolls up and down. */
.agent-console-screen.is-fitted { overflow-x: hidden; }
/* Full screen (#39522): only the terminal and what is typed into it, clear of a phone's notch,
   rounded corners and home bar (the page has viewport-fit=cover). */
.agent-console.is-full {
	position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column;
	background: var(--console-bg);
	padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.agent-console.is-full .agent-console-screen { flex: 1 1 0; }
html.console-full, html.console-full body { overflow: hidden; }
.agent-console-status { margin: 0; padding: 0.35rem 0.75rem; font-size: 0.8125rem; color: #9aa0a8; border-top: 1px solid #2a2e35; }
.agent-console-status.is-stale { color: #e5c07b; }
.agent-console-asking { margin: 0; padding: 0.5rem 0.75rem; background: var(--alert-text); color: #fff; font-weight: 600; }
/* Typing into it (#39412): keys in a row that wraps, then the box, in the page's own colours. */
/* Read-only until unlocked (#39470): the line under the screen, and the code to unlock. */
.agent-console-lock { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.6rem 0.75rem 0.75rem;
	background: var(--surface); border-top: 1px solid var(--border); }
.agent-console-lock[hidden], .agent-console-unlock[hidden] { display: none; }
.agent-console-lock-text { margin: 0; flex: 1 1 16rem; font-size: 0.9375rem; }
/* Unlocking (#39483): a dialog, top to bottom: why, the passkey, the code or password, then the buttons. */
.agent-console-unlock-dialog { width: min(24rem, 94vw); }
.agent-console-unlock { display: flex; flex-direction: column; align-items: stretch; gap: 0.75rem; }
.agent-console-unlock > p { margin: 0; }
.agent-console-unlock-buttons { display: flex; gap: 0.5rem; }
.agent-console-unlock-buttons > button { flex: 1 1 0; }
.agent-console-unlock-help { font-size: 0.875rem; color: var(--text-soft); }
.agent-console-unlock .status:empty { display: none; }
.agent-console-unlock label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 1rem; }
.agent-console-unlock label[hidden], .agent-console-unlock button[hidden] { display: none; }
.agent-console-unlock input { font: 400 1rem var(--mono); inline-size: 100%; box-sizing: border-box; }
.agent-console-input { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.6rem 0.75rem 0.75rem;
	background: var(--surface); color: var(--text); border-top: 1px solid var(--border); }
.agent-console-input[hidden] { display: none; }
/* One row, scrolled sideways where it doesn't fit (#39505). */
.agent-console-keys { display: flex; flex-wrap: nowrap; gap: 0.35rem; min-inline-size: 0; overflow-x: scroll; overscroll-behavior-x: contain;
	padding-bottom: 0.25rem; scrollbar-width: thin; }
.agent-console-keys button { flex: none; white-space: nowrap; min-inline-size: 2.6rem; padding: 0.3rem 0.55rem; font: 600 0.875rem var(--mono); }
.agent-console-input textarea { width: 100%; resize: none; font: 400 1rem/1.45 var(--mono); color: var(--text);
	padding: 0.5rem 0.65rem; background: var(--surface); border: 1px solid var(--text-soft); border-radius: var(--radius); min-height: 3rem; }
.agent-console-input.is-off textarea, .agent-console-input.is-off .agent-console-keys { opacity: 0.5; }
@container (max-width: 30rem) {
	.agent-console-keys button { min-inline-size: 2.2rem; padding: 0.25rem 0.4rem; }
}
.agent-pane-tabs [role="tab"].is-asking::after { content: ''; display: inline-block; inline-size: 0.5rem; block-size: 0.5rem;
	margin-inline-start: 0.35rem; border-radius: 50%; background: var(--alert-text); vertical-align: middle; }
.agent-chats { margin-top: 1.25rem; }
