/* Tandem design system, re-skin in place.
   Tokens mirror project/tokens.json of the design system artifact.
   Old variable -> token: --paper surface-0, --white surface-2, --rail surface-1
   (sidebar) / primary (primary button), --ink ink-1, --muted ink-3, --line line-2,
   --green positive (semantic) / accent (selection), --red negative.
   The old lime --accent is retired; --accent is now iris.

   Fonts: IBM Plex Sans and IBM Plex Mono (SIL Open Font License) are served
   from this origin, because the service's Content-Security-Policy allows only
   same-origin styles and fonts. latin-ext carries the rupee sign. The file
   names are allowlisted as FONTS in harness/store.py. */
@font-face {
	font-family: "IBM Plex Sans";
	font-style: normal;
	font-weight: 400;
	src: url("fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "IBM Plex Sans";
	font-style: normal;
	font-weight: 400;
	src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "IBM Plex Sans";
	font-style: normal;
	font-weight: 500;
	src: url("fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "IBM Plex Sans";
	font-style: normal;
	font-weight: 500;
	src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "IBM Plex Sans";
	font-style: normal;
	font-weight: 600;
	src: url("fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "IBM Plex Sans";
	font-style: normal;
	font-weight: 600;
	src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 400;
	src: url("fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 400;
	src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 500;
	src: url("fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 500;
	src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 600;
	src: url("fonts/ibm-plex-mono-latin-ext-600-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 600;
	src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
	--font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

	--space-half: 2px;
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-5: 20px;
	--space-6: 24px;
	--space-8: 32px;

	--radius-xs: 2px;
	--radius-sm: 4px;
	--radius-md: 6px;
	--radius-lg: 10px;
	--radius-full: 999px;

	--control-sm: 24px;
	--control-md: 28px;
	--control-lg: 36px;
	--row-compact: 28px;
	--row: 32px;
	--rail: 232px;
	--topbar: 44px;

	/* Chart roles, read by chart.js. */
	--chart-grid: var(--line-2);
	--chart-axis: var(--ink-3);
	--chart-cross: var(--ink-3);
	--candle-up: var(--positive);
	--candle-down: var(--negative);
	--chart-marker-fill: var(--ink-1);
	--chart-marker-signal: var(--accent);
}

/* Dark graphite. */
:root[data-theme="dark"] {
	color-scheme: dark;
	--surface-0: #0e1012;
	--surface-1: #14171a;
	--surface-2: #1a1e22;
	--surface-3: #22272c;
	--line-1: #23282d;
	--line-2: #343b42;
	--line-3: #6f7882;
	--ink-1: #e9ecef;
	--ink-2: #b3bac2;
	--ink-3: #8a929c;
	--primary: #e9ecef;
	--on-primary: #0e1012;
	--accent: #98a4f5;
	--accent-soft: #98a4f524;
	--on-accent: #0e1012;
	--focus: #b7c0fa;
	--positive: #83d3ac;
	--positive-soft: #83d3ac1f;
	--negative: #ffa58b;
	--negative-soft: #ffa58b1f;
	--warning: #e6c15a;
	--warning-soft: #e6c15a1f;
	--pending: var(--warning);
	--live: #f7953a;
	--on-live: #1b1004;
	--live-soft: #f7953a1f;
	--series-1: #98a4f5;
	--series-2: #6ec6d9;
	--series-3: #d9bf8f;
	--series-4: #e39ac4;
	--series-5: #9aa3ad;
	--scrim: #000000a8;
	--shadow-pop: 0 0 0 1px #343b42, 0 12px 32px #000000a6;
}

/* Warm light. Also the state before app.js sets data-theme, because app.js
   starts in light unless the user has switched. */
:root,
:root[data-theme="light"] {
	color-scheme: light;
	--surface-0: #f4f4f1;
	--surface-1: #fafaf8;
	--surface-2: #ffffff;
	--surface-3: #ebebe7;
	--line-1: #e4e4df;
	--line-2: #cfcfc8;
	--line-3: #82827a;
	--ink-1: #16191c;
	--ink-2: #454b52;
	--ink-3: #5e656d;
	--primary: #16191c;
	--on-primary: #ffffff;
	--accent: #4050c4;
	--accent-soft: #4050c414;
	--on-accent: #ffffff;
	--focus: #4050c4;
	--positive: #176f52;
	--positive-soft: #176f5214;
	--negative: #a94e3e;
	--negative-soft: #a94e3e0f;
	--warning: #7d5800;
	--warning-soft: #7d580014;
	--pending: var(--warning);
	--live: #a64404;
	--on-live: #ffffff;
	--live-soft: #a644040f;
	--series-1: #4050c4;
	--series-2: #0f7890;
	--series-3: #8a6a35;
	--series-4: #a8427a;
	--series-5: #5e656d;
	--scrim: #16191c66;
	--shadow-pop: 0 0 0 1px #cfcfc8, 0 12px 32px #16191c24;
}

/* Base */
:root {
	font: 400 14px / 21px var(--font-sans);
	color: var(--ink-1);
	background: var(--surface-0);
	-webkit-font-smoothing: antialiased;
}
*,
*::before,
*::after {
	box-sizing: border-box;
}
body {
	margin: 0;
	background: var(--surface-0);
	color: var(--ink-1);
}
button,
input,
textarea,
select {
	font: inherit;
	color: inherit;
}
button {
	cursor: pointer;
	border: 0;
	background: transparent;
}
button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}
:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}
input[type="checkbox"],
input[type="range"] {
	accent-color: var(--accent);
}
h1,
h2,
h4,
p {
	margin: 0;
}

/* Type: display, heading, title, label */
h1 {
	font: 600 24px / 30px var(--font-sans);
	letter-spacing: -0.015em;
}
h2 {
	font: 600 18px / 24px var(--font-sans);
	letter-spacing: -0.01em;
}
h4 {
	font: 600 15px / 20px var(--font-sans);
}
h3,
.eyebrow {
	font: 500 11px / 14px var(--font-sans);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-3);
}
.eyebrow {
	margin-bottom: 4px;
}
.sub,
.quiet {
	color: var(--ink-3);
	font-size: 12px;
	line-height: 16px;
	font-variant-numeric: tabular-nums;
}
.sub {
	margin-top: 4px;
}

/* Figures: everything people compare is mono with tabular numerals. */
.mono,
td,
.metric,
.ticker,
.ticker + span,
.watch .end,
.watch em,
.timeline time,
.chartnote,
pre,
input[type="number"] {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
}
.up {
	color: var(--positive);
}
.down {
	color: var(--negative);
}

/* Sidebar */
aside {
	width: var(--rail);
	position: fixed;
	inset: 0 auto 0 0;
	background: var(--surface-1);
	border-right: 1px solid var(--line-1);
	color: var(--ink-2);
	display: flex;
	flex-direction: column;
	padding: 10px 8px;
	z-index: 4;
}
.brand {
	display: flex;
	align-items: center;
	height: 28px;
	padding: 0 8px;
	margin-bottom: 12px;
	font: 600 18px / 1 var(--font-sans);
	letter-spacing: -0.03em;
	text-transform: lowercase;
	color: var(--ink-1);
}
#brand-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.brand::after {
	content: ".";
	color: var(--accent);
}
/* The environment label sits after the name and its full stop. */
.brand .environment {
	order: 1;
	margin-left: 8px;
	letter-spacing: 0;
}
.mark {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-right: 9px;
	transform: skewY(-15deg);
}
.mark i {
	width: 3px;
	height: 9px;
	background: var(--accent);
}
.mark i:nth-child(2) {
	height: 15px;
}
.mark i:nth-child(3) {
	height: 12px;
}
.mark i:last-child {
	height: 7px;
}
nav {
	display: grid;
	gap: 2px;
}
nav button,
.sessionlink {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	height: var(--row);
	padding: 0 8px;
	border-radius: var(--radius-sm);
	font-size: 13px;
	line-height: 18px;
	text-align: left;
	color: var(--ink-2);
}
nav button:hover,
.sessionlink:hover {
	background: var(--surface-3);
	color: var(--ink-1);
}
nav button:focus-visible,
.sessionlink:focus-visible {
	outline-offset: -2px;
}
nav button.active {
	background: var(--accent-soft);
	color: var(--ink-1);
	font-weight: 500;
}
svg.icon {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.55;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}
#recents {
	border-top: 1px solid var(--line-1);
	margin: 12px 0 0;
	padding: 14px 0 8px;
	overflow: auto;
	min-height: 0;
}
#recents h3 {
	margin: 0;
	padding: 0 8px 4px;
}
.sessionlink {
	display: block;
	line-height: var(--row);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.rail-foot {
	margin-top: auto;
	display: flex;
	gap: 8px;
	align-items: center;
	font-size: 13px;
	line-height: 18px;
	color: var(--ink-1);
	padding: 10px 8px 2px;
	border-top: 1px solid var(--line-1);
}
.rail-foot small {
	display: block;
	font-size: 12px;
	line-height: 16px;
	color: var(--ink-3);
}
.avatar {
	width: 24px;
	height: 24px;
	flex: none;
	display: grid;
	place-items: center;
	border-radius: var(--radius-full);
	background: var(--surface-3);
	color: var(--ink-2);
	font: 600 12px / 1 var(--font-sans);
}

/* Top bar */
main {
	margin-left: var(--rail);
}
header {
	height: var(--topbar);
	border-bottom: 1px solid var(--line-1);
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 clamp(16px, 3vw, 40px);
	font-size: 13px;
	line-height: 18px;
	color: var(--ink-3);
	background: var(--surface-1);
	white-space: nowrap;
}
header strong {
	color: var(--ink-1);
	font-weight: 500;
}
header b {
	margin: 0 6px;
	font-weight: 400;
	color: var(--line-3);
}
#menu {
	display: none;
	width: var(--control-md);
	height: var(--control-md);
	border-radius: var(--radius-sm);
	color: var(--ink-2);
}
#menu:hover {
	background: var(--surface-3);
	color: var(--ink-1);
}

/* Mode: simulated frames are dashed and hatched, never a hue. */
.mode {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 22px;
	padding: 0 8px;
	border: 1px dashed var(--line-3);
	border-radius: var(--radius-sm);
	background: repeating-linear-gradient(
		135deg,
		transparent 0 5px,
		var(--line-1) 5px 6px
	);
	color: var(--ink-2);
	font-size: 11px;
	line-height: 14px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
header > span:first-of-type {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}
#menu,
.mode,
#theme,
#workspace-reopen {
	flex: none;
}
/* The theme switch follows the mode badge; without one (account entry, console) it takes the right edge. */
#theme {
	white-space: nowrap;
}
.mode ~ #theme {
	margin-left: 0;
}
.account-entry .mode ~ #theme,
.admin-console .mode ~ #theme {
	margin-left: auto;
	display: inline-flex;
}
#workspace-reopen {
	margin-left: auto;
}
#workspace-reopen:not([hidden]) + .mode {
	margin-left: 0;
}
.mode i,
.dot {
	width: 6px;
	height: 6px;
	background: currentColor;
	display: inline-block;
	border-radius: var(--radius-full);
}

/* Badges */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 20px;
	padding: 0 6px;
	border-radius: var(--radius-sm);
	background: var(--surface-3);
	color: var(--ink-2);
	font-size: 12px;
	line-height: 16px;
	font-weight: 500;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}
.badge.tone-positive {
	background: var(--positive-soft);
	color: var(--positive);
}
.badge.tone-negative {
	background: var(--negative-soft);
	color: var(--negative);
}
.badge.tone-warning,
.badge.tone-pending {
	background: var(--warning-soft);
	color: var(--warning);
}
.badge.tone-offline {
	background: transparent;
	color: var(--ink-3);
	box-shadow: inset 0 0 0 1px var(--line-3);
}
.badge.tone-sim {
	background: repeating-linear-gradient(
		135deg,
		transparent 0 5px,
		var(--line-1) 5px 6px
	);
	color: var(--ink-2);
	border: 1px dashed var(--line-3);
}

/* Page */
#page {
	max-width: 1580px;
	margin: auto;
	padding: 24px clamp(16px, 3vw, 40px) 56px;
}
.titlebar,
.row,
.sectionhead,
.spread {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.titlebar {
	margin-bottom: 20px;
}
.sectionhead {
	margin: 24px 0 12px;
}
.sectionhead:first-child {
	margin-top: 0;
}

/* Buttons, chips, segmented */
.btn,
.chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: var(--control-md);
	padding: 0 10px;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	color: var(--ink-1);
	font-size: 13px;
	line-height: 18px;
	font-weight: 500;
	white-space: nowrap;
}
.btn:hover {
	background: var(--surface-3);
}
.primary {
	background: var(--primary);
	border-color: var(--primary);
	color: var(--on-primary);
}
.primary:hover {
	background: var(--ink-2);
	border-color: var(--ink-2);
	color: var(--on-primary);
}
.danger {
	color: var(--negative);
	border-color: var(--negative);
	background: transparent;
}
.danger:hover {
	background: var(--negative-soft);
}
.chip {
	background: transparent;
	color: var(--ink-2);
	font-weight: 400;
}
.chip:hover {
	background: var(--surface-3);
	color: var(--ink-1);
}
.segment {
	display: inline-flex;
	gap: 2px;
	padding: 2px;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-sm);
	background: var(--surface-1);
}
.segment button {
	height: 22px;
	padding: 0 8px;
	border-radius: var(--radius-xs);
	color: var(--ink-3);
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
}
.segment button:hover {
	color: var(--ink-1);
}
.segment button.active {
	background: var(--surface-3);
	color: var(--ink-1);
	box-shadow: inset 0 0 0 1px var(--line-2);
}

/* Composer */
.composer {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px 10px 8px 12px;
	border: 1px solid var(--line-3);
	border-radius: var(--radius-lg);
	background: var(--surface-2);
}
.composer:focus-within {
	border-color: var(--focus);
	outline: 1px solid var(--focus);
}
.composer textarea {
	width: 100%;
	min-height: 42px;
	padding: 0;
	border: 0;
	outline: 0;
	resize: none;
	background: transparent;
	color: var(--ink-1);
	font-size: 14px;
	line-height: 21px;
}
.composer textarea::placeholder {
	color: var(--ink-3);
}
.composer .quiet {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
}
.composer .btn {
	flex: none;
}
.composer .quiet svg.icon {
	color: var(--accent);
}
.model-picker {
	font: inherit;
	background: transparent;
	color: var(--ink-2);
	border: 0;
	border-radius: var(--radius-sm);
	padding: 3px 4px;
	min-width: 0;
	max-width: min(220px, 100%);
	text-overflow: ellipsis;
}
.chips {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin: 10px 0 24px;
}

/* Panels and cards: hairlines, no shadows. */
.grid {
	display: grid;
	grid-template-columns: minmax(0, 1.85fr) minmax(240px, 1fr);
	gap: 12px;
}
.panel,
.card {
	background: var(--surface-2);
	border: 1px solid var(--line-2);
	border-radius: var(--radius-md);
	min-width: 0;
}
.card {
	overflow: hidden;
}
.panel {
	padding: 16px;
}
.panel.sim {
	border: 1px dashed var(--line-3);
}
.panel h3 {
	margin: 0 0 8px;
}
.panel > p {
	margin-top: 6px;
}
.panel > p:empty {
	display: none;
}
.panel > h2 {
	margin-bottom: 10px;
}
.panel > h4:first-child {
	margin-bottom: 10px;
}
/* Blocks appended straight into a host: the page, or an artifact tab in the workspace panel. */
:is(#page, .tabpanel) > .panel + .panel,
:is(#page, .tabpanel) > .panel + .cards,
:is(#page, .tabpanel) > .cards + .panel {
	margin-top: 12px;
}
:is(#page, .tabpanel) > .actions {
	margin-bottom: 12px;
}
#page > .btn:first-child {
	margin-bottom: 16px;
}
:is(#page, .tabpanel) > p.wrap {
	margin-top: 8px;
	color: var(--ink-2);
}
.panel > .btn {
	margin: 12px 6px 0 0;
}
.panel > .actions {
	margin-top: 12px;
}
.listbox,
.stack {
	display: grid;
	gap: 12px;
}
.listbox .panel .row {
	flex-wrap: wrap;
}
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
	gap: 12px;
}
.cards .panel {
	padding: 12px;
}
.cards .panel h3 {
	margin: 0 0 4px;
	font-size: 12px;
	line-height: 16px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}
.metric {
	font-size: 20px;
	line-height: 24px;
	font-weight: 500;
	letter-spacing: -0.01em;
	white-space: nowrap;
}
.ticker {
	font-size: 28px;
	line-height: 32px;
	font-weight: 500;
	letter-spacing: -0.02em;
}
.ticker + span {
	font-size: 13px;
	line-height: 18px;
}
.actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}
.actions:has(label.quiet) {
	align-items: flex-end;
}
.actions label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	line-height: 18px;
}
.actions label.quiet {
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
	font-size: 12px;
	line-height: 16px;
}
.actions label input {
	max-width: 170px;
}
.actions > input.input:not([type="checkbox"]):not([type="range"]) {
	flex: 1 1 240px;
	max-width: 420px;
}

/* Charts */
canvas {
	display: block;
	width: 100%;
	height: 190px;
	margin-top: 10px;
}
.chartnote {
	min-height: 16px;
	font-size: 11px;
	line-height: 16px;
	color: var(--ink-2);
}
.legend {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 12px;
	line-height: 16px;
	color: var(--ink-2);
}
.footnote {
	margin: 12px 0 0;
	font-size: 12px;
	line-height: 16px;
	color: var(--ink-3);
	font-variant-numeric: tabular-nums;
}
.spacer {
	height: 12px;
}

/* Watchlist */
.watch {
	width: calc(100% + 16px);
	margin: 0 -8px;
	height: var(--row);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 8px;
	border-top: 1px solid var(--line-1);
	text-align: left;
	font-size: 13px;
	line-height: 18px;
	color: var(--ink-2);
}
.watch:hover {
	background: var(--surface-3);
}
.watch.selected {
	background: var(--accent-soft);
	color: var(--ink-1);
}
.watch strong {
	font-weight: 500;
	color: var(--ink-1);
}
.watch .end {
	margin-left: auto;
	color: var(--ink-1);
}
.watch em {
	display: inline-block;
	min-width: 68px;
	text-align: right;
	font-style: normal;
}

/* Records (artifact rows) */
.records {
	display: grid;
	gap: 8px;
}
.record {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 8px 12px;
	text-align: left;
	border-bottom: 1px solid var(--line-1);
	border-radius: 0;
	font-size: 13px;
	line-height: 18px;
	color: var(--ink-1);
}
.record:last-child {
	border-bottom: 0;
}
button.record:hover {
	background: var(--surface-3);
}
button.record:focus-visible {
	outline-offset: -2px;
}
.record .end {
	margin-left: auto;
	color: var(--ink-3);
	font-size: 12px;
	white-space: nowrap;
}
.record strong {
	display: block;
	font-weight: 600;
	overflow-wrap: anywhere;
}
.record small {
	display: block;
	font-size: 12px;
	line-height: 16px;
	color: var(--ink-3);
}
.record > svg.icon {
	color: var(--ink-3);
}
#page > .record {
	background: var(--surface-2);
	border: 1px solid var(--line-2);
	border-radius: var(--radius-md);
	margin-bottom: 8px;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--ink-2);
}
.iconbox {
	width: 24px;
	height: 24px;
	flex: none;
	display: grid;
	place-items: center;
	border-radius: var(--radius-sm);
	background: var(--surface-3);
	color: var(--ink-2);
}
.empty {
	color: var(--ink-3);
	padding: 16px;
	font-size: 13px;
	line-height: 18px;
}

/* Conversation: the user's message is a surface-3 bubble, the agent's prose
   sits on the ground, activity and artifacts are outlined objects. */
.transcript {
	margin: 0 0 20px;
	display: grid;
	gap: 20px;
}
.turn.card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}
.turn > h4 {
	align-self: flex-end;
	max-width: min(520px, 100%);
	margin: 0;
	padding: 8px 12px;
	border-radius: var(--radius-lg);
	background: var(--surface-3);
	color: var(--ink-1);
	font: 400 14px / 21px var(--font-sans);
	overflow-wrap: anywhere;
}
.turn p,
.wrap {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.reply {
	max-width: 100%;
	min-width: 0;
	color: var(--ink-2);
	overflow-wrap: anywhere;
}
.reply > * { margin: 0; }
.reply > * + * { margin-top: 12px; }
.reply :is(strong, h1, h2, h3, h4, h5, h6) { color: var(--ink-1); }
.reply pre { overflow-x: auto; }
.reply td { white-space: normal; padding-block: 5px; }
.turn > p {
	color: var(--ink-2);
	max-width: 100%;
}
.turn > details {
	align-self: stretch;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-md);
	background: var(--surface-1);
	overflow: hidden;
}
.turn > details > summary {
	padding: 7px 10px;
	font-size: 13px;
	line-height: 18px;
	color: var(--ink-1);
}
.turn > details > .timeline {
	margin: 0;
	padding: 4px 10px 8px;
	border-top: 1px solid var(--line-1);
}
.turn > .research-progress {
	border: 0;
	background: transparent;
	overflow: visible;
}
.turn > .research-progress > summary {
	display: flex;
	align-items: center;
	gap: 8px;
	width: fit-content;
	padding: 5px 0;
	color: var(--ink-2);
	list-style: none;
}
.research-progress > summary::-webkit-details-marker { display: none; }
.research-progress > summary::after {
	content: "";
	width: 5px;
	height: 5px;
	border: solid currentColor;
	border-width: 0 1px 1px 0;
	transform: rotate(-45deg);
}
.research-progress[open] > summary::after { transform: rotate(45deg); }
.research-progress .mark { margin: 0; }
.turn > .research-progress > .timeline { border: 0; }
@media (prefers-reduced-motion: no-preference) {
	.research-progress .mark i {
		animation: research-pulse 1.15s ease-in-out infinite alternate;
	}
	.research-progress .mark i:nth-child(2) { animation-delay: -.3s; }
	.research-progress .mark i:nth-child(3) { animation-delay: -.6s; }
	.research-progress .mark i:nth-child(4) { animation-delay: -.9s; }
}
@keyframes research-pulse {
	from { transform: scaleY(.55); }
	to { transform: scaleY(1); }
}
.turn .record {
	align-self: stretch;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-md);
	background: var(--surface-2);
}
.turn .record:last-child {
	border-bottom: 1px solid var(--line-2);
}
.chat-chart {
	align-self: stretch;
	min-width: 0;
	margin: 0;
}
.chat-chart > .record { width: 100%; }
details,
summary {
	color: var(--ink-3);
	font-size: 12px;
	line-height: 16px;
}
summary {
	cursor: pointer;
}
summary:hover {
	color: var(--ink-1);
}
details.panel > summary {
	font-size: 13px;
	line-height: 18px;
	color: var(--ink-1);
}
details.panel[open] > summary {
	margin-bottom: 4px;
}
details.panel > p,
.panel > p:not(.quiet):not(.footnote) {
	font-size: 14px;
	line-height: 21px;
	color: var(--ink-2);
}
.panel details {
	margin-top: 8px;
}
.panel details[open] > summary {
	margin-bottom: 8px;
}
.timeline {
	list-style: none;
	padding: 0;
	margin: 4px 0;
}
.timeline li {
	padding: 4px 0;
	font-size: 13px;
	line-height: 18px;
	color: var(--ink-2);
	overflow-wrap: anywhere;
}
.timeline time {
	font-size: 12px;
	margin-right: 8px;
	color: var(--ink-3);
}
.timeline details {
	margin-top: 2px;
}
pre {
	max-height: 320px;
	overflow: auto;
	margin: 8px 0;
	padding: 8px 10px;
	border-radius: var(--radius-sm);
	background: var(--surface-1);
	color: var(--ink-2);
	font-size: 12px;
	line-height: 18px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.turn pre {
	background: var(--surface-2);
}

/* Tables */
.tablewrap {
	overflow: auto;
	max-height: 440px;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-md);
	background: var(--surface-1);
}
table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	line-height: 18px;
}
th,
td {
	text-align: left;
	white-space: nowrap;
}
th {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: 7px 10px;
	background: var(--surface-2);
	border-bottom: 1px solid var(--line-2);
	color: var(--ink-3);
	font: 500 11px / 14px var(--font-sans);
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
td {
	height: var(--row);
	padding: 0 10px;
	border-bottom: 1px solid var(--line-1);
	color: var(--ink-2);
}
tbody tr:last-child td {
	border-bottom: 0;
}
tbody tr:hover td {
	background: var(--surface-3);
}
th.num,
td.num {
	text-align: right;
}
td.num {
	color: var(--ink-1);
}
td.up {
	color: var(--positive);
}
td.down {
	color: var(--negative);
}
th button {
	padding: 0;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	text-align: inherit;
	color: inherit;
}
th button:hover {
	color: var(--ink-1);
}

/* Inputs */
.input {
	height: var(--control-md);
	padding: 0 8px;
	min-width: 0;
	border: 1px solid var(--line-3);
	border-radius: var(--radius-sm);
	background: var(--surface-1);
	color: var(--ink-1);
	font-size: 13px;
}
.input::placeholder {
	color: var(--ink-3);
}
.input:focus-visible {
	border-color: var(--focus);
	outline: 1px solid var(--focus);
	outline-offset: 0;
}
input[type="range"].input {
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
}
input[type="range"].input:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}
input[type="checkbox"].input {
	width: 14px;
	height: 14px;
	padding: 0;
}

/* Toast: the one floating surface. */
#notice {
	position: fixed;
	bottom: 16px;
	right: 16px;
	z-index: 10;
	max-width: min(80vw, 420px);
	padding: 10px 12px;
	border-radius: var(--radius-md);
	background: var(--surface-3);
	color: var(--ink-1);
	box-shadow: var(--shadow-pop);
	font-size: 13px;
	line-height: 18px;
}

/* A paper fill's recorded figures under its proposal. */
.fill-detail {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 2px 16px;
	margin: 8px 0 0;
	font-size: 13px;
}
.fill-detail dt {
	color: var(--ink-3);
}
.fill-detail dd {
	margin: 0;
	font-variant-numeric: tabular-nums;
}

/* Banner: a failure that stays until it is retried or resolved (a lost connection, an out-of-date page). */
#banner {
	position: fixed;
	top: 8px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 11;
	max-width: min(92vw, 640px);
	display: flex;
	flex-direction: column;
	gap: 6px;
}
#banner[hidden] {
	display: none;
}
.banner-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid var(--negative);
	border-radius: var(--radius-md);
	background: var(--surface-2);
	color: var(--ink-1);
	box-shadow: var(--shadow-pop);
	font-size: 13px;
	line-height: 18px;
}
.banner-item p {
	margin: 0;
	flex: 1;
}
.failure {
	border-color: var(--negative);
}
.more-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
}
:focus-visible:is(h1, h2)[tabindex="-1"],
h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus {
	outline: none;
}

/* Artifact viewer and trade audit */
.artifact-columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

/* Artifact workspace: a tabbed panel beside the conversation, a sheet on narrow viewports. */
#splitter[hidden],
#workspace[hidden],
#workspace-reopen[hidden] {
	display: none;
}
#workspace {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--surface-0);
}
.workspace-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
	min-height: var(--topbar);
	padding: 0 12px;
	border-bottom: 1px solid var(--line-1);
	background: var(--surface-1);
}
#workspace-tabs {
	display: flex;
	align-self: stretch;
	flex: 1 1 auto;
	min-width: 0;
	overflow-x: auto;
}
.tabitem {
	display: flex;
	align-items: center;
	flex: none;
	max-width: 260px;
	padding: 0 2px 0 4px;
	/* The selected tab is marked by weight and a rule under it, not by colour. */
	border-bottom: 2px solid transparent;
	color: var(--ink-3);
}
.tabitem.selected {
	border-bottom-color: var(--ink-1);
	color: var(--ink-1);
}
.tab {
	min-width: 0;
	height: var(--control-md);
	padding: 0 6px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	border-radius: var(--radius-sm);
	font-size: 13px;
	line-height: 18px;
	color: inherit;
}
.tabitem.selected .tab {
	font-weight: 600;
}
.tabclose {
	flex: none;
	width: var(--control-sm);
	height: var(--control-sm);
	border-radius: var(--radius-sm);
	font-size: 16px;
	line-height: 1;
	color: var(--ink-3);
}
.tab:hover,
.tabclose:hover {
	background: var(--surface-3);
	color: var(--ink-1);
}
.tab:focus-visible,
.tabclose:focus-visible,
.tabpanel:focus-visible,
#splitter:focus-visible {
	outline-offset: -2px;
}
#workspace-panels {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
}
.tabpanel {
	flex: 1 1 auto;
	min-width: 0;
	overflow: auto;
	overscroll-behavior: contain;
	padding: 20px 16px 40px;
	container-type: inline-size;
}
.tabpanel .titlebar {
	flex-wrap: wrap;
}
@container (max-width: 720px) {
	.artifact-columns {
		grid-template-columns: 1fr;
	}
}
#splitter {
	flex: none;
	width: 9px;
	cursor: col-resize;
	touch-action: none;
	background: linear-gradient(var(--line-2), var(--line-2)) center / 1px 100%
		no-repeat;
}
#splitter:hover,
#splitter:focus-visible,
body.resizing #splitter {
	background-size: 3px 100%;
}
body.resizing {
	cursor: col-resize;
	user-select: none;
}
#workspace-back {
	display: none;
}
/* Beside the conversation: the page and the panel scroll separately under a fixed top bar. */
@media (min-width: 901px) {
	body.workspace-open main {
		display: flex;
		flex-direction: column;
		height: 100vh;
		height: 100dvh;
	}
	body.workspace-open header {
		flex: none;
	}
	body.workspace-open #shell {
		display: flex;
		flex: 1 1 auto;
		min-height: 0;
	}
	body.workspace-open #page {
		flex: 1 1 0;
		min-width: 0;
		max-width: none;
		margin: 0;
		overflow: auto;
		container-type: inline-size;
	}
	#workspace {
		flex: none;
		width: clamp(320px, var(--workspace-width, 46%), calc(100% - 329px));
	}
	@container (max-width: 640px) {
		.grid {
			grid-template-columns: 1fr;
		}
	}
}
/* Full screen, and the sheet on narrow viewports, cover the whole app. */
body.workspace-full #workspace {
	position: fixed;
	inset: 0;
	z-index: 6;
	width: auto;
}
body.workspace-full #splitter {
	display: none;
}
@media (max-width: 900px) {
	body.workspace-open {
		overflow: hidden;
	}
	body.workspace-open #workspace {
		position: fixed;
		inset: 0;
		z-index: 6;
	}
	#splitter,
	#workspace-full {
		display: none;
	}
	#workspace-back {
		display: inline-flex;
		flex: none;
	}
}
.audit-chart {
	min-width: 0;
	width: 100%;
}
.audit-chart canvas {
	height: 165px;
	width: 100%;
}
.audit .actions {
	margin-block: 12px;
}
.audit .input {
	width: auto;
	max-width: 100%;
}
.audit .stack > h4:first-child {
	font: 600 18px / 24px var(--font-sans);
	letter-spacing: -0.01em;
}

@media (min-width: 1500px) {
	#page {
		padding-top: 32px;
	}
	canvas {
		height: 235px;
	}
}
@media (max-width: 1000px) {
	aside {
		width: 200px;
	}
	main {
		margin-left: 200px;
	}
	.grid {
		grid-template-columns: minmax(0, 1.45fr) minmax(200px, 1fr);
	}
	.panel {
		padding: 12px;
	}
	#page {
		padding: 20px 16px 48px;
	}
	.artifact-columns {
		grid-template-columns: 1fr;
	}
}
@media (max-width: 760px) {
	aside {
		transform: translateX(-100%);
		width: var(--rail);
	}
	body.nav-open aside {
		transform: translateX(0);
		box-shadow: var(--shadow-pop);
	}
	body.nav-open main {
		margin-left: var(--rail);
		min-width: 72vw;
	}
	main {
		margin: 0;
	}
	.grid {
		grid-template-columns: 1fr;
	}
	#menu {
		display: block;
	}
	header {
		padding: 0 12px;
		gap: 8px;
	}
	.mode {
		font-size: 10px;
		padding: 0 6px;
		flex: 0 1 auto;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	#theme {
		padding: 0 8px;
	}
	#page {
		padding: 16px 12px 40px;
	}
	.chips {
		margin-bottom: 16px;
	}
	.titlebar {
		flex-wrap: wrap;
	}
}
@media (prefers-reduced-motion: no-preference) {
	.btn,
	.chip,
	nav button,
	.sessionlink,
	.record,
	.watch,
	.tab,
	.tabclose {
		transition:
			background-color 120ms ease-out,
			color 120ms ease-out;
	}
}
.avatar-bar {
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}
.avatar-body {
	min-width: 0;
}
.avatar-studio {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
	gap: 16px;
	align-items: start;
}
/* Sized by the space the studio gets, so it also stacks inside the narrow artifact panel. */
.avatar-studio-root {
	container-type: inline-size;
}
@container (max-width: 720px) {
	.avatar-studio {
		grid-template-columns: 1fr;
	}
	.avatar-brain {
		position: static;
	}
}
.avatar-col-main {
	min-width: 0;
	gap: 12px;
}
.avatar-feed {
	gap: 10px;
}
.avatar-welcome {
	gap: 10px;
}
.avatar-msg {
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid var(--line-2);
	background: var(--surface-2);
}
.avatar-msg-user {
	background: var(--surface-2);
}
.avatar-msg-ai {
	background: var(--surface-0);
}
.avatar-msg-meta {
	font-size: 11px;
	font-weight: 500;
	color: var(--ink-3);
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.avatar-msg p {
	margin: 0;
}
.avatar-brain {
	gap: 10px;
	position: sticky;
	top: 12px;
}
.avatar-section-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--ink-3);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-top: 4px;
}
.avatar-teaching-item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 10px;
	border: 1px solid var(--line-2);
	border-radius: 8px;
	background: var(--surface-0);
	font-size: 13px;
}
.avatar-compact-list {
	margin: 0;
	padding-left: 18px;
	font-size: 13px;
}
.avatar-meta-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding-top: 4px;
}
.avatar-drawer {
	margin-top: 6px;
	padding-top: 8px;
	border-top: 1px solid var(--line-2);
}
.avatar-drawer summary {
	cursor: pointer;
	font-size: 12px;
}
.avatar-inline-form {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}
.avatar-inline-input {
	flex: 1 1 240px;
	min-width: 0;
}
.avatar-focus-input {
	width: 100%;
	max-width: 420px;
}
.avatar-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	cursor: pointer;
	width: fit-content;
}
.avatar-check input[type="checkbox"] {
	width: auto;
	margin: 0;
}
.skill-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.skill-chip {
	appearance: none;
	font: inherit;
	font-size: 12px;
	padding: 6px 11px;
	border-radius: 999px;
	border: 1px solid var(--line-2);
	background: var(--surface-0);
	color: var(--ink-1);
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.skill-chip:hover {
	border-color: var(--accent);
}
.skill-chip.active {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--ink-1);
}
.btn-icon {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--ink-3);
	font-size: 16px;
	line-height: 1;
	padding: 2px 6px;
	border-radius: 4px;
	cursor: pointer;
	flex: 0 0 auto;
}
.btn-icon:hover {
	color: var(--negative);
	background: var(--surface-2);
}
.diff-box {
	gap: 6px;
	font-size: 13px;
}
.diff-entry {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid var(--line-2);
	background: var(--surface-0);
}
.diff-entry.diff-add {
	border-left: 3px solid var(--positive);
}
.diff-entry.diff-del {
	border-left: 3px solid var(--negative);
}
.diff-entry.diff-mod {
	border-left: 3px solid var(--warning);
}
.diff-tag {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--surface-2);
	border: 1px solid var(--line-2);
}
.diff-add .diff-tag {
	color: var(--positive);
}
.diff-del .diff-tag {
	color: var(--negative);
}
.diff-mod .diff-tag {
	color: var(--warning);
}
.diff-text {
	color: var(--ink-1);
	white-space: pre-wrap;
	word-break: break-word;
	line-height: 1.45;
}
.skill-chip:disabled {
	cursor: default;
	opacity: 0.7;
}
.skill-chip:disabled:hover {
	border-color: var(--line-2);
}
.skill-chip:focus-visible,
.btn-icon:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 1px;
}
.btn-icon:disabled {
	opacity: 0.4;
	cursor: progress;
}
.avatar-panel[hidden] {
	display: none;
}
.avatar-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--space-3);
	padding: var(--space-3) var(--space-4);
	margin-bottom: var(--space-4);
	border: 1px solid var(--warning);
	border-radius: var(--radius-lg);
	background: var(--warning-soft);
	color: var(--ink-1);
	font-size: 13px;
}
.avatar-thread {
	gap: var(--space-3);
}
.avatar-thread:empty {
	display: none;
}
.avatar-turn {
	gap: var(--space-2);
}
.avatar-msg {
	min-width: 0;
	overflow-wrap: anywhere;
}
.avatar-msg-user {
	margin-left: min(48px, 8%);
	background: var(--surface-3);
}
.avatar-msg-ai {
	margin-right: min(48px, 8%);
}
.avatar-msg-error {
	border-color: var(--negative);
	background: var(--negative-soft);
}
.avatar-msg .actions {
	margin-top: var(--space-2);
}
.avatar-thinking {
	display: flex;
	align-items: center;
	gap: var(--space-2);
}
.avatar-dots {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
	flex: none;
}
@media (prefers-reduced-motion: no-preference) {
	.avatar-dots {
		animation: avatar-pulse 1.2s ease-in-out infinite alternate;
	}
}
@keyframes avatar-pulse {
	from { opacity: 0.3; }
	to { opacity: 1; }
}
.avatar-draft {
	gap: var(--space-2);
	border-color: var(--accent);
	margin-right: min(48px, 8%);
}
.avatar-warning {
	padding: var(--space-2) var(--space-3);
	border-radius: var(--radius-md);
	background: var(--warning-soft);
	font-size: 13px;
}
.avatar-reviewed {
	font-size: 12px;
	margin: 0;
}
.avatar-conn {
	color: var(--warning);
}
.avatar-composer[aria-busy="true"] textarea {
	color: var(--ink-2);
}
.avatar-hint {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}
.avatar-current {
	border-color: var(--accent);
}
.stack.tight {
	gap: var(--space-1);
}

.avatar-origin {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin-bottom: var(--space-3);
	font-size: 13px;
}
.avatar-limits {
	display: grid;
	grid-template-columns: minmax(140px, max-content) minmax(0, 220px);
	align-items: center;
	gap: var(--space-2) var(--space-3);
}
.avatar-agent-row {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr);
	align-items: baseline;
	gap: var(--space-3);
	padding: var(--space-2) 0;
	border-top: 1px solid var(--line-1);
	font-size: 13px;
}
.avatar-agent-row .avatar-section-label {
	margin: 0;
}
.avatar-prompt {
	max-height: 420px;
	overflow: auto;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	font-family: var(--font-mono);
	font-size: 12px;
	line-height: 1.5;
	margin: var(--space-2) 0 0;
}
/* Avatar studio: approval, teaching provenance, memory, comparison, evaluations */
.avatar-bar .segment {
	flex-wrap: wrap;
	max-width: 100%;
}
.avatar-confirm {
	align-items: center;
}
.avatar-classify,
.avatar-rebase:empty {
	margin: 0;
}
.avatar-classify {
	padding: var(--space-2) var(--space-3);
	border-radius: var(--radius-md);
	background: var(--surface-2);
	font-size: 13px;
}
.avatar-taught,
.avatar-note,
.avatar-position,
.avatar-eval {
	font-size: 13px;
}
.avatar-taught.is-removed,
.avatar-note.is-superseded {
	opacity: 0.7;
}
.avatar-disclosure {
	border: 1px solid var(--warning);
}
.avatar-pair {
	padding: var(--space-2) 0;
	border-top: 1px solid var(--line-1);
}
.avatar-position .badge {
	max-width: 100%;
	white-space: normal;
}
@container (max-width: 520px) {
	.avatar-limits,
	.avatar-agent-row {
		grid-template-columns: 1fr;
		gap: var(--space-1);
	}
}

/* Version-2 artifact views (harness/static/view.js). Tokens only, so both themes follow. */
.view {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	container-type: inline-size;
	min-width: 0;
}
.view-columns {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
	align-items: start;
}
.view-columns > .view-stats-wrap,
.view-columns > .view-callout {
	grid-column: 1 / -1;
}
.view-block {
	min-width: 0;
}
.view-stats-wrap h4,
.view-note h4 {
	margin: 0 0 var(--space-2);
}
.view-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: var(--space-2);
	margin: 0;
}
.view-stat {
	padding: var(--space-3);
	border: 1px solid var(--line-2);
	border-radius: var(--radius-lg);
	background: var(--surface-2);
	min-width: 0;
}
.view-stat dt {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink-3);
}
.view-stat dd {
	margin: 0;
}
.view-stat-value {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
	font-size: 20px;
	line-height: 28px;
	color: var(--ink-1);
	overflow-wrap: anywhere;
}
.view-stat-value.tone-positive {
	color: var(--positive);
}
.view-stat-value.tone-negative {
	color: var(--negative);
}
.view-stat-value.tone-warning {
	color: var(--warning);
}
.view-stat-hint {
	font-size: 12px;
	color: var(--ink-3);
}
.view-canvas {
	height: 240px;
}
.view-canvas canvas {
	width: 100%;
	height: 100%;
	display: block;
}
@container (max-width: 480px) {
	.view-canvas {
		height: 180px;
	}
	.view-stat-value {
		font-size: 17px;
	}
}
.view-legend {
	margin-top: var(--space-1);
}
.view-key {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.view-swatch {
	width: 10px;
	height: 10px;
	border-radius: 2px;
	background: var(--swatch);
	flex: none;
}
.view-callout {
	padding: var(--space-3) var(--space-4);
	border: 1px solid var(--line-2);
	border-left-width: 3px;
	border-radius: var(--radius-md);
	background: var(--surface-2);
	font-size: 13px;
}
.view-callout p {
	margin: var(--space-1) 0 0;
}
.view-callout.tone-info {
	border-left-color: var(--accent);
	background: var(--accent-soft);
}
.view-callout.tone-success {
	border-left-color: var(--positive);
	background: var(--positive-soft);
}
.view-callout.tone-warning {
	border-left-color: var(--warning);
	background: var(--warning-soft);
}
.view-callout.tone-danger {
	border-left-color: var(--negative);
	background: var(--negative-soft);
}
.view-note {
	padding: 0 var(--space-1);
	color: var(--ink-2);
}
.view-compare {
	width: 100%;
}
.view-compare th[scope="row"] {
	text-align: left;
	font-weight: 500;
}
.view th[aria-sort="ascending"] button::after {
	content: " ↑";
}
.view th[aria-sort="descending"] button::after {
	content: " ↓";
}

/* Forward-book risk envelope on the Execution screen. */
.envelope {
	margin: var(--space-3) 0;
}
.envelope summary {
	cursor: pointer;
	font-weight: 500;
}
.envelope-grid {
	display: grid;
	grid-template-columns: minmax(160px, 1.4fr) minmax(90px, 1fr) minmax(120px, 1.2fr) minmax(100px, 1fr);
	align-items: center;
	gap: var(--space-2) var(--space-3);
	margin: var(--space-2) 0 var(--space-3);
	font-size: 13px;
}
.envelope-head {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink-3);
}
.envelope-grid .num {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
	.envelope-grid {
		grid-template-columns: 1fr 1fr;
	}
	.envelope-head:nth-child(n + 3) {
		display: none;
	}
}

/* Flow inputs form. */
.flow-inputs {
	gap: var(--space-2);
	margin-bottom: var(--space-3);
}
.flow-input {
	display: grid;
	grid-template-columns: minmax(120px, 200px) minmax(0, 320px);
	align-items: center;
	gap: var(--space-1) var(--space-3);
}
.flow-input small {
	grid-column: 2;
}
@media (max-width: 640px) {
	.flow-input {
		grid-template-columns: 1fr;
	}
	.flow-input small {
		grid-column: 1;
	}
}

/* Usage line in the run inspector. */
.usage-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin: var(--space-2) 0;
	font-size: 12px;
	color: var(--ink-2);
	font-variant-numeric: tabular-nums;
}

/* Trace id and run timeline in the run inspector. */
.trace-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin: var(--space-2) 0;
	font-size: 12px;
	color: var(--ink-2);
}
.trace-line code {
	font-family: var(--font-mono, ui-monospace, monospace);
	user-select: all;
	overflow-wrap: anywhere;
}
.trace-line .trace-copy {
	min-height: 0;
	padding: 2px var(--space-2);
	font-size: 12px;
}
.run-timeline {
	margin: var(--space-2) 0 var(--space-3);
}

/* Jobs view (Workflows screen). */
.jobs-table td.wrap {
	min-width: 240px;
	max-width: 420px;
	white-space: normal;
}
.jobs-table td .actions {
	flex-wrap: nowrap;
}

/* Chart tooltip, shown on hover and keyboard focus beside the crosshair. */
.chart-tip {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	pointer-events: none;
	max-width: 240px;
	padding: 6px 8px;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-md);
	background: var(--surface-1);
	box-shadow: var(--shadow-pop);
	font-family: var(--font-mono);
	font-size: 11px;
	line-height: 16px;
	font-variant-numeric: tabular-nums;
	color: var(--ink-2);
	white-space: nowrap;
}
.chart-tip strong {
	display: block;
	color: var(--ink-1);
	font-weight: 600;
}
.chart-tip[hidden] {
	display: none;
}
canvas[tabindex]:focus-visible {
	outline: 2px solid var(--focus, var(--series-1));
	outline-offset: 2px;
	border-radius: var(--radius-md);
}

/* Table toolbar: column picker and CSV export. */
.table-tools {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: flex-start;
	gap: var(--space-2);
	margin-bottom: var(--space-2);
}
.table-tools .btn,
.column-picker > summary {
	min-height: 0;
	height: auto;
	padding: 3px 10px;
	font-size: 12px;
}
.column-picker {
	position: relative;
}
.column-picker > summary {
	cursor: pointer;
	list-style: none;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-md);
	background: var(--surface-1);
	color: var(--ink-2);
}
.column-picker > summary::-webkit-details-marker {
	display: none;
}
.column-list {
	position: absolute;
	right: 0;
	z-index: 3;
	display: grid;
	gap: 4px;
	min-width: 180px;
	max-height: 280px;
	overflow: auto;
	margin-top: 4px;
	padding: 8px 10px;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-md);
	background: var(--surface-1);
	box-shadow: var(--shadow-pop);
}
.column-option {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	white-space: nowrap;
}
th[hidden] {
	display: none;
}

/* Missed-minute policy on a forward book card. */
.gap-policy-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin-top: var(--space-2);
	font-size: 12px;
	color: var(--ink-2);
}
.gap-policy-form .input {
	width: auto;
	min-width: 0;
}
.gap-policy-form input[type="number"] {
	width: 72px;
}
.gap-policy td:last-child {
	min-width: 280px;
	white-space: normal;
}

/* Avatar training chat */
.link-btn {
	padding: 0;
	border: 0;
	background: none;
	color: var(--accent);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}
.link-btn:hover {
	text-decoration: underline;
}
.link-btn:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
	border-radius: 2px;
}
.clamp-box {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	min-width: 0;
}
.clamped {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 6;
	line-clamp: 6;
	overflow: hidden;
}
.avatar-steps {
	display: grid;
	gap: var(--space-3);
}
.avatar-step {
	display: flex;
	gap: var(--space-3);
	align-items: flex-start;
	font-size: 13px;
}
.avatar-step-num {
	flex: none;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 12px;
	font-weight: 600;
}
/* The message box stays in view at the bottom while the conversation scrolls. */
.avatar-composer {
	gap: var(--space-2);
	box-shadow: var(--shadow-pop);
}
.avatar-composer textarea {
	resize: none;
	min-height: 48px;
	max-height: 220px;
	overflow-y: auto;
}
.avatar-suggestions {
	gap: 6px;
	margin: 0;
}
.avatar-suggestions[hidden],
.avatar-pending-note[hidden] {
	display: none;
}
.avatar-pending-note {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
	padding: 6px 10px;
	border-radius: var(--radius-md);
	background: var(--accent-soft);
	color: var(--ink-1);
	font-size: 12px;
}
.avatar-turn {
	scroll-margin-bottom: 220px;
}
.avatar-msg-ai {
	scroll-margin-top: 72px;
}
.avatar-draft {
	border-width: 1px;
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.avatar-rationale {
	margin: 0;
	color: var(--ink-2);
	font-size: 13px;
}
.avatar-refine {
	margin: 0;
	font-size: 12px;
}
.avatar-reviewed {
	display: flex;
	align-items: center;
	gap: 6px;
}
.avatar-reviewed.is-approved {
	color: var(--positive);
}
.avatar-reviewed.is-dismissed {
	color: var(--ink-3);
}
.avatar-changed {
	padding: var(--space-2) var(--space-3);
	border-radius: var(--radius-md);
	background: var(--positive-soft);
	font-size: 13px;
}
.avatar-hint .avatar-dots {
	margin-right: 2px;
}
.avatar-teaching-item.is-new {
	border-color: var(--positive);
	background: var(--positive-soft);
}
.avatar-new {
	flex: none;
	order: -1;
}
.avatar-name {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: var(--space-3);
}
.avatar-rename {
	font-size: 13px;
	font-weight: 500;
}
.avatar-rename-form {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-2);
}
.avatar-rename-input {
	min-width: min(360px, 100%);
	font-size: 20px;
	font-weight: 600;
}

/* Avatars page */
.avatar-create {
	gap: var(--space-2);
}
.avatar-create h3 {
	margin: 0;
}
.avatar-create p {
	margin: 0;
	max-width: 70ch;
}
.avatar-ideas {
	margin: var(--space-1) 0 0;
}
.avatar-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--space-3);
}
.avatar-card {
	gap: var(--space-3);
	transition: border-color 120ms ease-out;
}
.avatar-card:hover,
.avatar-card:focus-within {
	border-color: var(--line-3);
}
.avatar-card-main {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	min-width: 0;
}
.avatar-card-main strong {
	font-size: 15px;
	overflow-wrap: anywhere;
}
.avatar-card-main:hover strong {
	text-decoration: underline;
}
.avatar-card-main:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 4px;
	border-radius: var(--radius-md);
}
.avatar-card-head {
	min-width: 0;
}
.avatar-mark {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: hsl(var(--mark-hue) 45% 92%);
	color: hsl(var(--mark-hue) 45% 30%);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.02em;
}
.avatar-card-about {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--ink-2);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	min-height: 3em;
}
.avatar-card .spread {
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-2);
}
.avatar-card .avatar-meta-pills {
	padding-top: 0;
}
.avatar-import {
	margin-top: var(--space-5);
	background: transparent;
	border-style: dashed;
}
.avatar-import summary {
	font-size: 13px;
	color: var(--ink-3);
	cursor: pointer;
}
:root[data-theme="dark"] .avatar-mark {
	background: hsl(var(--mark-hue) 35% 24%);
	color: hsl(var(--mark-hue) 60% 82%);
}

/* Chat screens (Research desk, Avatar training): the message box is docked at the bottom of the
   view, like a chat app, even when the conversation is short. The page fills the view and the
   conversation column stretches, so the box sits at the bottom and sticks there on scroll. */
#page:has(> .chat-dock),
#page:has(.avatar-panel:not([hidden]) .avatar-composer),
.tabpanel:has(.avatar-panel:not([hidden]) .avatar-composer) {
	display: flex;
	flex-direction: column;
	padding-bottom: 0;
}
#page:has(> .chat-dock),
#page:has(.avatar-panel:not([hidden]) .avatar-composer) {
	min-height: calc(100vh - var(--topbar));
	min-height: calc(100dvh - var(--topbar));
}
body.workspace-open #page:has(> .chat-dock),
body.workspace-open #page:has(.avatar-panel:not([hidden]) .avatar-composer) {
	min-height: 0;
}
.chat-dock {
	position: sticky;
	bottom: 0;
	z-index: 3;
	margin-top: auto;
	padding: 12px 0 16px;
	background: linear-gradient(transparent, var(--surface-0) 12px);
}
.chat-dock .composer {
	box-shadow: var(--shadow-pop);
}
/* Shortcuts stay on one line so the dock stays short; extra ones scroll sideways. */
.chat-dock .chips {
	flex-wrap: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
	margin: 0 0 10px;
}
.chat-dock .chip {
	flex: none;
}
:is(#page, .tabpanel):has(.avatar-panel:not([hidden]) .avatar-composer)
	> .avatar-studio-root,
.avatar-studio-root:has(.avatar-panel:not([hidden]) .avatar-composer) > .avatar-body,
.avatar-body > .avatar-panel:not([hidden]):has(.avatar-composer) {
	flex: 1 0 auto;
	display: flex;
	flex-direction: column;
}
.avatar-panel:not([hidden]) > .avatar-studio:has(.avatar-composer) {
	flex: 1 0 auto;
}
.avatar-col-main {
	display: flex;
	flex-direction: column;
	align-self: stretch;
}
/* Stacked in one column, the profile follows the conversation, so the column isn't stretched. */
@container (max-width: 720px) {
	.avatar-panel:not([hidden]) > .avatar-studio:has(.avatar-composer) {
		flex: none;
	}
}
/* Scrolling a message into view leaves it clear of the docked box. */
.avatar-thread > *,
.transcript > * {
	scroll-margin-bottom: 160px;
}
/* Menu pickers in the app's own style (the composer's effort and Avatar choices). */
.composer-tools {
	gap: 2px;
}
.dropdown {
	position: relative;
	min-width: 0;
}
.dropdown-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 240px;
	height: 28px;
	padding: 0 6px 0 8px;
	border-radius: var(--radius-sm);
	color: var(--ink-2);
	font-size: 13px;
}
.dropdown-trigger:hover:not(:disabled),
.dropdown-trigger[aria-expanded="true"] {
	background: var(--surface-3);
	color: var(--ink-1);
}
.dropdown-trigger:disabled {
	opacity: 0.55;
	cursor: default;
}
.dropdown-trigger:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 0;
}
.dropdown-text {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.composer .dropdown-trigger > svg.icon:first-child {
	color: var(--accent);
}
.dropdown-trigger > svg.icon:last-child {
	width: 14px;
	height: 14px;
	color: var(--ink-3);
	transition: transform 120ms ease-out;
}
.dropdown-trigger[aria-expanded="true"] > svg.icon:last-child {
	transform: rotate(180deg);
}
/* The composer sits at the bottom of the view, so its menus open upward. */
.dropdown-menu {
	position: absolute;
	left: 0;
	bottom: calc(100% + 6px);
	z-index: 20;
	min-width: 240px;
	max-width: min(340px, 80vw);
	padding: 4px;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-lg);
	background: var(--surface-2);
	box-shadow: var(--shadow-pop);
}
.dropdown-menu[hidden] {
	display: none;
}
.dropdown-heading {
	padding: 6px 8px 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink-3);
}
.dropdown-list {
	max-height: 280px;
	overflow-y: auto;
}
.dropdown-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 8px;
	border-radius: var(--radius-sm);
	color: var(--ink-1);
	font-size: 13px;
	line-height: 18px;
	cursor: pointer;
}
.dropdown-option.is-active {
	background: var(--surface-3);
}
.dropdown-words {
	display: grid;
	flex: 1 1 auto;
	min-width: 0;
}
.dropdown-words > span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.dropdown-words small {
	color: var(--ink-3);
	font-size: 12px;
	line-height: 16px;
}
.dropdown-option > svg.icon {
	color: var(--accent);
	visibility: hidden;
}
.dropdown-option[aria-selected="true"] > svg.icon {
	visibility: visible;
}
.dropdown-option[aria-selected="true"] .dropdown-words > span {
	font-weight: 600;
}
/* Send is a round icon button, like a chat app. */
.composer .send-btn {
	width: 32px;
	height: 32px;
	padding: 0;
	border-radius: 50%;
	gap: 0;
}
.composer .send-btn:disabled {
	opacity: 0.45;
	cursor: default;
}
.composer .send-btn svg.icon {
	color: inherit;
	stroke-width: 2;
}

.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1rem; align-items: start; }
.account-form, .account-field, .account-links { display: grid; gap: .5rem; }
.account-form { max-width: 34rem; gap: 1rem; margin: 1rem 0; }
.account-field { max-width: 34rem; font-weight: 500; }
.account-field[hidden], .form-error:empty { display: none; }
.account-form button { justify-self: start; }
.form-error { color: var(--negative); }
.rail-foot:has(.account-links) { flex-direction: column; align-items: flex-start; }
.account-links { grid-template-columns: repeat(2, auto); align-items: center; font-size: .85rem; }
.account-links a { color: inherit; }
/* Account entry (sign in). No workspace chrome: nobody is signed in, so there is no sidebar, breadcrumb or
   mode to show. Two halves on a wide screen, after the design system's ScreenLogin: what the product is on
   surface-1, the form on surface-0. The one display-lg of the screen is the greeting. */
.account-entry #rail,
.account-entry #menu,
.account-entry header > span,
.account-entry #workspace-reopen,
.account-entry .mode {
	display: none;
}
.account-entry main,
body.account-entry.nav-open main {
	margin-left: 0;
	min-width: 0;
}
.account-entry header {
	position: absolute;
	inset: 0 0 auto auto;
	height: auto;
	padding: var(--space-4) clamp(16px, 3vw, 40px);
	border: 0;
	background: transparent;
	z-index: 2;
}
.account-entry #page {
	max-width: none;
	width: 100%;
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.entry-about,
.entry-main {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 64px clamp(24px, 5vw, 72px);
}
.entry-about {
	gap: var(--space-4);
	background: var(--surface-1);
	border-right: 1px solid var(--line-1);
}
.entry-about > * {
	max-width: 440px;
}
.entry-wordmark {
	margin-bottom: var(--space-6);
	font: 600 22px / 1 var(--font-sans);
	letter-spacing: -0.03em;
	text-transform: lowercase;
	color: var(--ink-1);
}
.entry-wordmark::after {
	content: ".";
	color: var(--accent);
}
.entry-about h1 {
	font: 600 32px / 36px var(--font-sans);
	letter-spacing: -0.02em;
}
.entry-lede {
	color: var(--ink-2);
}
.entry-points {
	display: grid;
	gap: var(--space-3);
	margin: var(--space-2) 0 0;
	padding: var(--space-4) 0 0;
	border-top: 1px solid var(--line-1);
	list-style: none;
}
.entry-point {
	display: grid;
	grid-template-columns: 16px minmax(0, 1fr);
	gap: var(--space-2);
	align-items: start;
}
.entry-icon {
	width: 16px;
	height: 16px;
	margin-top: 2px;
	fill: none;
	stroke: var(--positive);
	stroke-width: 1.55;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.entry-point strong {
	display: block;
	font-weight: 600;
	color: var(--ink-1);
}
.entry-point span {
	display: block;
	font-size: 13px;
	line-height: 18px;
	color: var(--ink-3);
}
.entry-main {
	align-items: center;
}
.entry-column {
	display: grid;
	gap: var(--space-6);
	width: 100%;
	max-width: 360px;
}
.entry-form {
	display: grid;
	gap: var(--space-4);
}
.entry-form h2 {
	font: 600 18px / 24px var(--font-sans);
	letter-spacing: -0.01em;
}
.entry-sub {
	margin-top: calc(var(--space-3) * -1);
	color: var(--ink-2);
}
.entry-field {
	display: grid;
	gap: 6px;
}
.entry-field label {
	font-size: 13px;
	line-height: 18px;
	font-weight: 500;
	color: var(--ink-2);
}
.entry-control {
	position: relative;
	display: flex;
}
.input.entry-input {
	flex: 1 1 auto;
	width: 100%;
	height: var(--control-lg);
	padding: 0 10px;
	background: var(--surface-2);
	font-size: 14px;
}
.entry-control:has(.entry-reveal) .entry-input {
	padding-right: 56px;
}
.input.entry-input:focus-visible {
	border-color: var(--focus);
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}
.entry-reveal {
	position: absolute;
	inset: 4px 4px 4px auto;
	padding: 0 8px;
	border-radius: var(--radius-xs);
	color: var(--ink-3);
	font-size: 12px;
	font-weight: 500;
}
.entry-reveal:hover {
	background: var(--surface-3);
	color: var(--ink-1);
}
/* Colour is never the only signal: each notice carries a glyph and says what it is in words. */
.entry-caps,
.entry-error {
	display: grid;
	grid-template-columns: 14px minmax(0, 1fr);
	gap: 6px;
	align-items: baseline;
	font-size: 13px;
	line-height: 18px;
}
.entry-caps[hidden],
.entry-error:empty {
	display: none;
}
.entry-caps {
	color: var(--warning);
}
.entry-caps::before {
	content: "▲";
	font-size: 9px;
}
.entry-error {
	padding: var(--space-2) var(--space-3);
	border: 1px solid var(--negative);
	border-radius: var(--radius-sm);
	background: var(--negative-soft);
	color: var(--ink-1);
}
.entry-error::before {
	content: "✕";
	color: var(--negative);
	font-size: 11px;
	font-weight: 600;
}
.btn.entry-submit {
	width: 100%;
	height: var(--control-lg);
	margin-top: var(--space-1);
	font-size: 14px;
}
.entry-help,
.entry-legal {
	font-size: 12px;
	line-height: 16px;
	color: var(--ink-3);
}
.entry-help {
	font-size: 13px;
	line-height: 18px;
}
.entry-legal {
	padding-top: var(--space-4);
	border-top: 1px solid var(--line-1);
}
/* A narrow window stacks the halves; a short phone drops the three points so the form stays on screen. */
@media (max-width: 860px) {
	.account-entry #page {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto 1fr;
	}
	.entry-about,
	.entry-main {
		justify-content: flex-start;
		padding: var(--space-8) var(--space-5);
	}
	.entry-about {
		gap: var(--space-3);
		padding-top: 56px;
		border-right: 0;
		border-bottom: 1px solid var(--line-1);
	}
	.entry-wordmark {
		margin-bottom: var(--space-3);
		font-size: 18px;
	}
	.entry-about h1 {
		font: 600 28px / 34px var(--font-sans);
	}
	.entry-points {
		display: none;
	}
	.input.entry-input,
	.btn.entry-submit {
		height: 44px;
		font-size: 16px;
	}
	.entry-reveal {
		font-size: 13px;
	}
}

/* Super-admin console (/admin): its own shell state, no workspace chrome. */
.admin-console #recents, .admin-console .mode, .admin-console #workspace-reopen { display: none; }
.admin-console nav button { justify-content: space-between; }
.admin-count { font: 500 11px / 16px var(--font-mono); color: var(--ink-3); background: var(--surface-3); border-radius: var(--radius-full); padding: 0 7px; }
.admin-status { position: sticky; top: var(--space-2); z-index: 3; width: fit-content; margin: 0 0 var(--space-3) auto; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--positive-soft); box-shadow: inset 0 0 0 1px var(--positive); color: var(--positive); font-size: 13px; backdrop-filter: blur(6px); }
.admin-status:empty { display: none; }
.admin-status.error { color: var(--negative); background: var(--negative-soft); box-shadow: inset 0 0 0 1px var(--negative); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: var(--space-2); margin-bottom: var(--space-5); }
.admin-stat { display: grid; gap: 2px; padding: var(--space-3) var(--space-4); border: 1px solid var(--line-1); border-radius: var(--radius-md); background: var(--surface-2); }
.admin-stat span { font-size: 12px; color: var(--ink-3); }
.admin-stat strong { font: 600 20px / 26px var(--font-mono); font-variant-numeric: tabular-nums; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2); margin-bottom: var(--space-3); }
.admin-toolbar input[type="search"] { width: min(100%, 18rem); }
.admin-field { display: grid; gap: 4px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.admin-field[hidden] { display: none; }
.admin-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.admin-split:has(.admin-panel) { grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem); }
.admin-tablewrap { max-height: none; }
.admin-table tbody tr { cursor: pointer; }
.admin-table tbody tr.selected td { background: var(--accent-soft); }
.admin-table td { font-family: var(--font-sans); }
.admin-table td.admin-time { font-family: var(--font-mono); }
.admin-table td.admin-login { font-family: var(--font-sans); font-weight: 500; color: var(--ink-1); }
.admin-table td.admin-empty { cursor: default; color: var(--ink-3); font-family: var(--font-sans); padding: var(--space-6) 10px; text-align: center; }
.admin-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-table .badge, .admin-panel .badge { font-family: var(--font-sans); }
.admin-open { color: var(--ink-3); font-family: var(--font-sans); font-size: 12px; }
tr:hover .admin-open, tr.selected .admin-open { color: var(--accent); }
.admin-panel { display: grid; gap: var(--space-4); position: sticky; top: var(--space-4); }
.admin-panel h2 { overflow-wrap: anywhere; }
.admin-panel .admin-field { max-width: none; }
.admin-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--space-4); margin: 0; font-size: 13px; }
.admin-facts dt { color: var(--ink-3); }
.admin-facts dd { margin: 0; color: var(--ink-1); }
.admin-group { display: grid; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--line-1); justify-items: start; }
.admin-group > h3 { margin: 0; }
.admin-row { display: flex; gap: var(--space-2); align-items: end; width: 100%; }
.admin-row .admin-field { flex: 1; }
.admin-row .admin-field .input { width: 100%; }
.admin-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.admin-danger > h3 { color: var(--negative); }
.admin-members { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; width: 100%; }
.admin-members li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.admin-link { color: var(--accent); font-weight: 500; padding: 0; }
.admin-link:hover { text-decoration: underline; }
.admin-features { display: grid; gap: 2px; width: 100%; }
.admin-feature { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); min-height: var(--row); font-size: 13px; }
.admin-segment { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; flex: none; }
.admin-segment button { height: var(--control-sm); padding: 0 9px; font-size: 12px; color: var(--ink-2); border-left: 1px solid var(--line-2); }
.admin-segment button:first-child { border-left: 0; }
.admin-segment button:hover { background: var(--surface-3); }
.admin-segment button.on { background: var(--primary); color: var(--on-primary); font-weight: 500; }
.admin-segment button.on[data-state="enabled"] { background: var(--positive); color: var(--on-primary); }
.admin-segment button.on[data-state="disabled"] { background: var(--negative); color: var(--on-primary); }
@media (max-width: 1100px) { .admin-split:has(.admin-panel) { grid-template-columns: minmax(0, 1fr); } .admin-panel { position: static; } }
.admin-panel.admin-wide { position: static; max-width: 46rem; }
.admin-json { height: auto; min-height: 9rem; padding: 8px; font-family: var(--font-mono); font-size: 12px; width: 100%; resize: vertical; }
.admin-panel .admin-field:has(.admin-json) { width: 100%; }
.admin-heading { margin: var(--space-6) 0 var(--space-3); }
.admin-static tbody tr { cursor: default; }
.admin-how code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: var(--radius-xs); }
.admin-how { margin-top: var(--space-3); }
.admin-review { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); max-width: 60rem; }
.admin-review-title { margin: 0; font: 600 14px / 20px var(--font-sans); text-transform: none; letter-spacing: 0; color: var(--ink-1); }
.admin-review-value { font: 600 16px / 22px var(--font-mono); font-variant-numeric: tabular-nums; }
.admin-review-fail { color: var(--warning); font-size: 13px; }
.admin-rights { display: flex; flex-wrap: wrap; gap: var(--space-3); border: 0; padding: 0; margin: 0; font-size: 13px; }
.admin-rights legend { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; padding: 0; }

.navitem .nav-label {
	margin-left: auto;
}
