/*
	Aeon's look on the website's own pages: the account, signing in and organisations (owner, 29 Nov 2026: one modern
	look everywhere people see Aeon, like the app and like an organisation's git). Pages/Shared/_Layout.cshtml links it,
	after site.css and the tokens (aeon-tokens.css, generated from the app's Themes/Tokens.axaml), on every page but the
	back office's, and marks those pages html.aeon.

	The cells' look on the website: the same tokens, the same scales and the same frame as
	deploy/hosting/forgejo/custom/public/assets/css/aeon.css, its twin, so moving between Aeon's pages and an
	organisation's git feels like one product. Plain CSS on the pages' own markup, no framework. site.css still lays the
	pages out; every rule here is under .aeon, so the back office (html.back-office) and the product site (its own
	marketing.css) don't change, and wins over the site.css rule it restyles. Colours come only from the --aeon-*
	tokens: shades are mixed from them, as the cells' are. Sections:
	  1. Scales                    5. Components
	  2. site.css's colours        6. A page of its own: signing in, an invitation, a document
	  3. Base                      7. Pages with tabs: the account, support, an organisation
	  4. The frame                 8. Narrow windows
*/

/* 1. Scales ------------------------------------------------------------------------------------------------------ */

/* The cells' (their aeon.css, section 1), so a page here and a cell's are drawn to the same sizes: change both. */
:root.aeon {
	/* Type: 12 for labels and details, 13 for controls and lists, 14 for reading (the app's sizes); titles above. */
	--aeon-text-xs: 11px;
	--aeon-text-sm: 12px;
	--aeon-text-md: 13px;
	--aeon-text-base: 14px;
	--aeon-text-lg: 16px;
	--aeon-text-xl: 20px;
	--aeon-text-2xl: 24px;
	--aeon-weight-normal: 400;
	--aeon-weight-medium: 500;
	--aeon-weight-semibold: 600;

	/* Spacing: steps of 4 px. */
	--aeon-space-1: 4px;
	--aeon-space-2: 8px;
	--aeon-space-3: 12px;
	--aeon-space-4: 16px;
	--aeon-space-5: 20px;
	--aeon-space-6: 24px;
	--aeon-space-8: 32px;

	/* Radii: the app's 6 px (Aeon.Radius) for boxes, buttons and fields; 4 px for labels (Styles.axaml, badge). */
	--aeon-radius-sm: 4px;
	--aeon-radius-lg: calc(var(--aeon-radius) + 4px);
	--aeon-radius-full: 999px;

	/* Controls: the app's density, a 32 px row; 28 px for small ones. */
	--aeon-control: 32px;
	--aeon-control-sm: 28px;
	--aeon-bar-height: 48px;

	/* Depth: the page is flat, as the app is; only what floats over it (menus, dialogs) casts a shadow. */
	--aeon-shadow-colour: light-dark(color-mix(in srgb, var(--aeon-text) 14%, transparent), color-mix(in srgb, var(--aeon-background) 80%, transparent));
	--aeon-shadow-sm: 0 1px 2px var(--aeon-shadow-colour);
	--aeon-shadow-md: 0 8px 24px var(--aeon-shadow-colour);
	--aeon-shadow-lg: 0 20px 48px var(--aeon-shadow-colour);

	/* States, mixed from the text colour so they read on every surface in both variants. */
	--aeon-hover: color-mix(in srgb, var(--aeon-text) 6%, transparent);
	--aeon-pressed: color-mix(in srgb, var(--aeon-text) 10%, transparent);
	--aeon-border-strong: color-mix(in srgb, var(--aeon-border), var(--aeon-text) 22%);
	--aeon-on-accent: light-dark(var(--aeon-surface), var(--aeon-background));
	--aeon-field: light-dark(var(--aeon-surface), var(--aeon-background));

	/* The website's own: its column (GitHub's medium container: forms and facts stay readable, where a cell's 1280 px
	   suits code), what floats (menus), and messages, a tint of their state on the surface with their text between that
	   colour and the text's (the cells' --color-error-* and the like). */
	--aeon-page-width: 1012px;
	--aeon-menu: light-dark(var(--aeon-surface), var(--aeon-surface-raised));
	--aeon-accent-hover: color-mix(in srgb, var(--aeon-accent), var(--aeon-text) 10%);
	--aeon-accent-pressed: color-mix(in srgb, var(--aeon-accent), var(--aeon-text) 20%);
	--aeon-error-bg: color-mix(in srgb, var(--aeon-diff-removed) 12%, var(--aeon-surface));
	--aeon-error-border: color-mix(in srgb, var(--aeon-diff-removed) 45%, var(--aeon-surface));
	--aeon-error-text: color-mix(in srgb, var(--aeon-diff-removed), var(--aeon-text) 30%);
	--aeon-success-bg: color-mix(in srgb, var(--aeon-diff-added) 12%, var(--aeon-surface));
	--aeon-success-border: color-mix(in srgb, var(--aeon-diff-added) 45%, var(--aeon-surface));
	--aeon-success-text: color-mix(in srgb, var(--aeon-diff-added), var(--aeon-text) 30%);
}

/* 2. site.css's colours ------------------------------------------------------------------------------------------ */

/* site.css draws with its own variables; here they're the app's, so whatever this file doesn't restyle still takes the
   app's colours (as the cells map Forgejo's variables). color-scheme: the browser's own controls and scroll bars follow
   light and dark too, and light-dark() above picks by it. */
:root.aeon {
	color-scheme: light dark;
	--bg: var(--aeon-background);
	--surface: var(--aeon-surface);
	--text: var(--aeon-text);
	--muted: var(--aeon-text-muted);
	--accent: var(--aeon-accent);
	--line: var(--aeon-border);
	--danger: var(--aeon-diff-removed);
	--ok: var(--aeon-diff-added);
	--warn: var(--aeon-warning);
	--info: var(--aeon-info);
	--button-bg: var(--aeon-accent);
	--button-text: var(--aeon-on-accent);
	accent-color: var(--aeon-accent);
}

/* A theme chosen on the website (data-theme on the page, Accounts/WebsiteTheme.cs) holds whatever the system's setting
   is: the tokens follow it (aeon-tokens.css), and so must light-dark() here and the browser's own controls. */
:root.aeon[data-theme="light"] {
	color-scheme: light;
}

:root.aeon[data-theme="dark"] {
	color-scheme: dark;
}

/* 3. Base --------------------------------------------------------------------------------------------------------- */

/* Text as typed: Inter's contextual alternates turn an x between digits into a multiplication sign (the app turns them
   off for the same reason, Styles.axaml). The footer stays at the bottom of a short page. */
.aeon body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	background: var(--aeon-background);
	color: var(--aeon-text);
	font-family: "Inter", -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: var(--aeon-text-base);
	line-height: 1.5;
	font-feature-settings: "calt" 0;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.aeon main {
	flex: 1 0 auto;
	width: 100%;
	max-width: calc(var(--aeon-page-width) + 2 * var(--aeon-space-4));
	padding: 0 var(--aeon-space-4);
}

.aeon a {
	color: var(--aeon-accent);
	text-decoration: none;
}

.aeon a:hover {
	text-decoration: underline;
}

.aeon :focus-visible {
	outline: 2px solid var(--aeon-accent);
	outline-offset: 2px;
}

.aeon ::selection {
	background: var(--aeon-selection);
	color: var(--aeon-selection-text);
}

.aeon * {
	scrollbar-color: var(--aeon-border-strong) transparent;
}

.aeon :is(h1, h2, h3) {
	color: var(--aeon-text);
	font-weight: var(--aeon-weight-semibold);
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.aeon h1 {
	font-size: var(--aeon-text-2xl);
}

.aeon h2 {
	font-size: var(--aeon-text-lg);
}

.aeon h3 {
	font-size: var(--aeon-text-base);
}

/* Code shows exactly what was typed (no ligatures), as a quiet chip in text. */
.aeon :is(code, kbd, pre, samp) {
	font-family: var(--aeon-mono-font);
	font-feature-settings: "liga" 0, "calt" 0;
	font-variant-ligatures: none;
}

.aeon code {
	padding: 0.1em 0.35em;
	border-radius: var(--aeon-radius-sm);
	background: color-mix(in srgb, var(--aeon-text) 8%, transparent);
	font-size: 0.86em;
}

.aeon .hint,
.aeon .aside {
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-sm);
	line-height: 1.5;
}

.aeon p.hint {
	font-size: var(--aeon-text-md);
}

.aeon .aside {
	margin-top: var(--aeon-space-5);
	font-size: var(--aeon-text-md);
}

.aeon .lead {
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-lg);
}

/* 4. The frame ---------------------------------------------------------------------------------------------------- */

/* The bar, as a cell's (its body_inner_pre.tmpl): Aeon's icon and name, the organisation where there is one, and the
   account on the right. */
.aeon .aeon-bar {
	display: flex;
	align-items: center;
	gap: var(--aeon-space-2);
	min-height: var(--aeon-bar-height);
	padding: 0 var(--aeon-space-4);
	background: var(--aeon-header);
	border-bottom: 1px solid var(--aeon-border);
	font-size: var(--aeon-text-md);
	line-height: 1.4;
}

.aeon .aeon-bar a {
	color: inherit;
	text-decoration: none;
}

.aeon .aeon-bar-brand {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: var(--aeon-space-2);
	height: var(--aeon-control);
	padding: 0 var(--aeon-space-2) 0 var(--aeon-space-1);
	border-radius: var(--aeon-radius);
	color: var(--aeon-text);
	font-size: 15px;
	font-weight: var(--aeon-weight-semibold);
	letter-spacing: -0.01em;
}

.aeon .aeon-bar-brand img {
	display: block;
	width: 24px;
	height: 24px;
}

.aeon .aeon-bar-separator {
	flex-shrink: 0;
	width: 1px;
	height: 20px;
	background: var(--aeon-border-strong);
	transform: skewX(-16deg);
}

.aeon .aeon-bar-organisation {
	display: block;
	min-width: 0;
	height: var(--aeon-control);
	padding: 0 var(--aeon-space-2);
	overflow: hidden;
	border-radius: var(--aeon-radius);
	color: var(--aeon-text);
	font-weight: var(--aeon-weight-medium);
	line-height: var(--aeon-control);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aeon .aeon-bar-end {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: var(--aeon-space-1);
	margin-left: auto;
}

.aeon .aeon-bar a.aeon-bar-link {
	display: flex;
	align-items: center;
	height: var(--aeon-control);
	padding: 0 10px;
	border-radius: var(--aeon-radius);
	color: var(--aeon-text-muted);
	font-weight: var(--aeon-weight-medium);
	white-space: nowrap;
}

.aeon .aeon-bar :is(a.aeon-bar-brand, a.aeon-bar-organisation, a.aeon-bar-link):hover {
	background: var(--aeon-hover);
	color: var(--aeon-text);
}

/* Create account, signed out: a small button in the accent (the bar's own links take the bar's colour). */
.aeon .aeon-bar a.button {
	margin-left: var(--aeon-space-1);
	color: var(--aeon-on-accent);
}

/* The account's menu: a <details>, as the cells' menus are (js/menu.js closes it on a click elsewhere and on Escape).
   Its button is the person's initials in a circle, as a cell shows someone without a picture. */
.aeon .aeon-menu {
	position: relative;
}

.aeon .aeon-menu > summary {
	display: flex;
	align-items: center;
	gap: 2px;
	height: var(--aeon-control);
	padding: 0 6px;
	border-radius: var(--aeon-radius);
	color: var(--aeon-text-muted);
	cursor: pointer;
	list-style: none;
}

.aeon .aeon-menu > summary::-webkit-details-marker {
	display: none;
}

.aeon .aeon-menu > summary:hover,
.aeon .aeon-menu[open] > summary {
	background: var(--aeon-hover);
	color: var(--aeon-text);
}

.aeon .aeon-avatar {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: var(--aeon-radius-full);
	background: var(--aeon-accent);
	color: var(--aeon-on-accent);
	font-size: 10px;
	font-weight: var(--aeon-weight-semibold);
	letter-spacing: 0.02em;
	line-height: 1;
}

.aeon .aeon-bar-chevron {
	width: 12px;
	height: 12px;
	opacity: 0.8;
}

.aeon .aeon-menu-content {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 10;
	display: grid;
	width: max-content;
	min-width: 240px;
	max-width: min(320px, calc(100vw - 2 * var(--aeon-space-2)));
	padding: var(--aeon-space-1);
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius-lg);
	background: var(--aeon-menu);
	box-shadow: var(--aeon-shadow-md);
}

.aeon .aeon-menu-person {
	display: grid;
	padding: var(--aeon-space-2) 10px;
	line-height: 1.35;
}

.aeon .aeon-menu-person strong {
	color: var(--aeon-text);
	font-size: var(--aeon-text-base);
	font-weight: var(--aeon-weight-semibold);
}

.aeon .aeon-menu-person span {
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-sm);
	overflow-wrap: anywhere;
}

.aeon .aeon-menu-content hr {
	width: 100%;
	margin: var(--aeon-space-1) 0;
	border: 0;
	border-top: 1px solid var(--aeon-border);
}

.aeon .aeon-menu-content form {
	margin: 0;
}

.aeon .aeon-menu-content :is(a, button) {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	min-height: var(--aeon-control);
	padding: 0 10px;
	border: 0;
	border-radius: var(--aeon-radius-sm);
	background: none;
	color: var(--aeon-text);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-normal);
	text-align: left;
	text-decoration: none;
}

.aeon .aeon-menu-content :is(a, button):hover {
	background: var(--aeon-hover);
	color: var(--aeon-text);
	text-decoration: none;
}

.aeon .aeon-menu-content :is(a, button):active {
	background: var(--aeon-pressed);
}

/* The bar's own links (Download, Back office) again in the menu, for a phone's width (section 8). */
.aeon .aeon-menu-content .aeon-narrow {
	display: none;
}

/* The footer, as a cell's (its body_outer_post.tmpl): Aeon for Git on the left, the site's pages on the right, lined
   up with the page's column. */
.aeon .footer {
	margin-top: var(--aeon-space-8);
	padding: 0 var(--aeon-space-4);
	border-top: 1px solid var(--aeon-border);
	background: var(--aeon-background);
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-sm);
	text-align: left;
}

.aeon .aeon-footer-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--aeon-space-3) var(--aeon-space-6);
	max-width: var(--aeon-page-width);
	margin: 0 auto;
	padding: var(--aeon-space-4) 0;
}

.aeon .footer a {
	color: var(--aeon-text-muted);
	text-decoration: none;
}

.aeon .footer a:hover {
	color: var(--aeon-text);
}

.aeon .aeon-footer-brand {
	display: flex;
	align-items: center;
	gap: var(--aeon-space-2);
	font-weight: var(--aeon-weight-medium);
}

.aeon .aeon-footer-brand img {
	width: 16px;
	height: 16px;
}

.aeon .footer nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aeon-space-1) var(--aeon-space-2);
}

/* 5. Components --------------------------------------------------------------------------------------------------- */

/* Buttons: 32 px, 13 px text, the app's corners. The main action in the accent; .secondary on the raised surface inside
   a hairline, as the cells' everyday button; .danger the same in the error's colours; .link plain text. */
.aeon :is(button, .button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: var(--aeon-control);
	padding: 5px 12px;
	border: 1px solid var(--aeon-accent);
	border-radius: var(--aeon-radius);
	background: var(--aeon-accent);
	box-shadow: none;
	color: var(--aeon-on-accent);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-medium);
	line-height: 20px;
	text-align: center;
	text-decoration: none;
}

.aeon :is(button, .button):hover {
	border-color: var(--aeon-accent-hover);
	background: var(--aeon-accent-hover);
	color: var(--aeon-on-accent);
	text-decoration: none;
}

.aeon :is(button, .button):active {
	background: var(--aeon-accent-pressed);
}

.aeon :is(button, .button).secondary {
	border-color: var(--aeon-border);
	background: var(--aeon-surface-raised);
	color: var(--aeon-text);
}

.aeon :is(button, .button).secondary:hover {
	border-color: var(--aeon-border-strong);
	background: color-mix(in srgb, var(--aeon-surface-raised), var(--aeon-text) 6%);
	color: var(--aeon-text);
}

.aeon :is(button, .button).secondary:active {
	background: color-mix(in srgb, var(--aeon-surface-raised), var(--aeon-text) 11%);
}

.aeon button.danger,
.aeon button.secondary.danger {
	border-color: var(--aeon-error-border);
	background: var(--aeon-surface-raised);
	color: var(--aeon-error-text);
}

.aeon button.danger:hover,
.aeon button.secondary.danger:hover {
	border-color: var(--aeon-diff-removed);
	background: var(--aeon-error-bg);
	color: var(--aeon-error-text);
}

.aeon :is(button, .button).small {
	min-height: var(--aeon-control-sm);
	padding: 3px 10px;
	font-size: var(--aeon-text-md);
}

.aeon button.link {
	min-height: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--aeon-accent);
	font-weight: var(--aeon-weight-normal);
}

.aeon button.link:is(:hover, :active) {
	background: none;
	color: var(--aeon-accent);
	text-decoration: underline;
}

.aeon :is(button, .button):disabled {
	opacity: 0.5;
	cursor: default;
}

/* Fields: the darker well the app's fields are, a hairline border, and the accent ring when focused. */
.aeon :is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]), select, textarea) {
	min-height: var(--aeon-control);
	padding: 5px 10px;
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-field);
	color: var(--aeon-text);
	font-size: var(--aeon-text-base);
	line-height: 20px;
}

.aeon textarea {
	min-height: 6em;
	padding: 8px 10px;
}

.aeon :is(input, select, textarea):hover:not(:focus, :disabled) {
	border-color: var(--aeon-border-strong);
}

.aeon :is(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea):focus {
	border-color: var(--aeon-accent);
	box-shadow: 0 0 0 3px var(--aeon-accent-soft);
	outline: none;
}

.aeon :is(input, select, textarea):disabled {
	opacity: 0.6;
}

.aeon ::placeholder {
	color: var(--aeon-text-muted);
	opacity: 1;
}

.aeon :is(input[type="checkbox"], input[type="radio"]) {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--aeon-accent);
}

.aeon input[type="file"] {
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-md);
}

.aeon :is(.card, .stack) label:not(.check, .limit) {
	margin-top: var(--aeon-space-3);
	color: var(--aeon-text);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-semibold);
}

/* A form's first field starts at its top: under a box's band or a heading, which keep their own space. */
.aeon form > label:first-of-type:not(.check, .limit) {
	margin-top: 0;
}

/* A box and its words: a long label wraps beside its box, the box level with the first line (as the back office has
   it, site.css). */
.aeon label.check {
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: var(--aeon-space-2);
	color: var(--aeon-text);
	font-size: var(--aeon-text-base);
	font-weight: var(--aeon-weight-normal);
}

.aeon label.check > input {
	flex-shrink: 0;
	margin-top: calc((1.5em - 16px) / 2);
}

/* A choice's explanation under its box: in line with the label's words, not the box; inside the label, on a line of
   its own under the choice's name (Policies, Labs features). */
.aeon label.check + .hint {
	margin-left: 24px;
}

.aeon label.check > span > .hint {
	display: block;
}

.aeon .card form {
	gap: var(--aeon-space-1);
}

.aeon .card form button,
.aeon .stack button {
	margin-top: var(--aeon-space-4);
}

.aeon .field-error {
	color: var(--aeon-error-text);
	font-size: var(--aeon-text-sm);
}

.aeon fieldset {
	gap: var(--aeon-space-2);
	padding: var(--aeon-space-3) var(--aeon-space-4);
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
}

.aeon legend {
	padding: 0 var(--aeon-space-1);
	color: var(--aeon-text);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-semibold);
}

/* A group of choices has no box of its own (site.css): its legend reads as the labels do. */
.aeon .card fieldset.choices legend {
	padding: 0;
	font-size: var(--aeon-text-md);
}

.aeon details > summary {
	color: var(--aeon-accent);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-medium);
	cursor: pointer;
}

/* A row of fields and their buttons (find, filter, move to): one line, as tall as its controls. The labels are the
   words before each field. */
.aeon form.row-form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aeon-space-2) var(--aeon-space-3);
	margin: var(--aeon-space-4) 0;
}

.aeon form.row-form label:not(.check, .limit) {
	display: inline-flex;
	align-items: center;
	gap: var(--aeon-space-2);
	margin: 0;
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-medium);
}

.aeon form.row-form button {
	margin: 0;
}

/* A choice of links (a space, a page of results): one joined control, the chosen one lit, as the cells' switches. */
.aeon nav.row-form {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 2px;
	margin: var(--aeon-space-3) 0 0;
	padding: 2px;
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface-raised);
}

.aeon nav.row-form a {
	display: inline-flex;
	align-items: center;
	min-height: calc(var(--aeon-control) - 6px);
	padding: 0 10px;
	border-radius: var(--aeon-radius-sm);
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-medium);
	text-decoration: none;
}

.aeon nav.row-form a:hover {
	color: var(--aeon-text);
}

.aeon nav.row-form a[aria-current="page"] {
	background: var(--aeon-surface);
	box-shadow: 0 0 0 1px var(--aeon-border-strong);
	color: var(--aeon-text);
}

/* The theme switch (Pages/Shared/_ThemeSwitch.cshtml): its name, then System, Light and Dark as one joined control, the
   one in use lit, drawn as the choice of links above. Its buttons are a form's, so the rules start at the form: they
   must win over the buttons', the menu's items' and a box's form's (margins, widths, the accent). */
.aeon form.aeon-theme {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aeon-space-2) var(--aeon-space-3);
	margin: 0;
}

.aeon form.aeon-theme .aeon-theme-label {
	color: var(--aeon-text);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-semibold);
}

.aeon form.aeon-theme .aeon-segmented {
	display: inline-flex;
	gap: 2px;
	padding: 2px;
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface-raised);
}

.aeon form.aeon-theme .aeon-segmented > button {
	display: inline-flex;
	width: auto;
	min-height: calc(var(--aeon-control) - 6px);
	margin: 0;
	padding: 0 10px;
	border: 0;
	border-radius: var(--aeon-radius-sm);
	background: none;
	box-shadow: none;
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-medium);
	line-height: 1;
}

.aeon form.aeon-theme .aeon-segmented > button:is(:hover, :active) {
	background: none;
	color: var(--aeon-text);
	text-decoration: none;
}

.aeon form.aeon-theme .aeon-segmented > button[aria-pressed="true"] {
	background: var(--aeon-surface);
	box-shadow: 0 0 0 1px var(--aeon-border-strong);
	color: var(--aeon-text);
}

/* In the account menu, a row of its own: the name as the menu's items have theirs, the control at the end. */
.aeon .aeon-menu-content form.aeon-theme {
	flex-wrap: nowrap;
	justify-content: space-between;
	min-height: var(--aeon-control);
	padding: 2px 6px 2px 10px;
}

.aeon .aeon-menu-content form.aeon-theme .aeon-theme-label {
	font-weight: var(--aeon-weight-normal);
}

/* Messages: a tint of their state on the surface, the app's corners. */
.aeon :is(.notice, .errors-inline, .error-notice, .errors ul) {
	padding: var(--aeon-space-2) var(--aeon-space-3);
	border: 1px solid;
	border-radius: var(--aeon-radius);
	font-size: var(--aeon-text-md);
}

.aeon .notice {
	border-color: var(--aeon-success-border);
	background: var(--aeon-success-bg);
	color: var(--aeon-success-text);
}

.aeon :is(.errors-inline, .error-notice, .errors ul) {
	border-color: var(--aeon-error-border);
	background: var(--aeon-error-bg);
	color: var(--aeon-error-text);
}

/* Idle seats on an organisation's members page: a name and its Remove on one line, a list without bullets. */
.aeon #idle-seats ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.aeon #idle-seats .idle-seat {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--aeon-space-2);
	padding: var(--aeon-space-2) 0;
	border-top: 1px solid var(--aeon-border);
}

/* The banner on an organisation's pages once its plan has ended: the warning's tint, its Renew beside the words. */
.aeon .plan-banner {
	margin-bottom: var(--aeon-space-3);
	padding: var(--aeon-space-2) var(--aeon-space-3);
	border: 1px solid color-mix(in srgb, var(--aeon-warning) 45%, transparent);
	border-radius: var(--aeon-radius);
	background: color-mix(in srgb, var(--aeon-warning) 12%, transparent);
	color: color-mix(in srgb, var(--aeon-warning), var(--aeon-text) 55%);
	font-size: var(--aeon-text-md);
}

.aeon .plan-banner p {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aeon-space-2);
	margin: 0;
}

.aeon .plan-banner .plan-banner-refused {
	margin-top: var(--aeon-space-2);
	font-weight: var(--aeon-weight-medium);
}

/* Labels: compact, 4 px corners, as the app's badges and the cells' labels; a state on a tint of its colour. */
.aeon .badge {
	display: inline-flex;
	align-items: center;
	min-height: 20px;
	padding: 0 7px;
	border: 0;
	border-radius: var(--aeon-radius-sm);
	background: color-mix(in srgb, var(--aeon-text) 9%, transparent);
	color: var(--aeon-text);
	font-size: var(--aeon-text-sm);
	font-weight: var(--aeon-weight-medium);
	line-height: 16px;
	vertical-align: 1px;
	white-space: nowrap;
}

.aeon :is(.badge.ok, .badge.tone-ok) {
	background: color-mix(in srgb, var(--aeon-diff-added) 14%, transparent);
	color: var(--aeon-success-text);
}

.aeon :is(.badge.bad, .badge.warn, .badge.tone-bad) {
	background: color-mix(in srgb, var(--aeon-diff-removed) 14%, transparent);
	color: var(--aeon-error-text);
}

.aeon .badge.tone-warn {
	background: color-mix(in srgb, var(--aeon-warning) 16%, transparent);
	color: color-mix(in srgb, var(--aeon-warning), var(--aeon-text) 30%);
}

.aeon .badge.tone-info {
	background: var(--aeon-info-soft);
	color: color-mix(in srgb, var(--aeon-info), var(--aeon-text) 30%);
}

.aeon .badge.tone-muted {
	opacity: 1;
	color: var(--aeon-text-muted);
}

/* Facts: the names muted, the values in the text's colour. */
.aeon .facts {
	grid-template-columns: max-content minmax(0, 1fr);
	gap: var(--aeon-space-2) var(--aeon-space-6);
	margin: var(--aeon-space-4) 0;
}

.aeon .facts dt {
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-md);
	line-height: 21px;
}

.aeon .facts dd {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* Tables: a box of their own, the column names on the header colour, rows parted by hairlines, as the cells' tables. */
.aeon :is(table.data, .table-scroll) {
	margin: var(--aeon-space-3) 0;
}

.aeon .table-scroll > table.data {
	margin: 0;
}

.aeon table.data {
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface);
	font-size: var(--aeon-text-md);
}

.aeon table.data th {
	padding: var(--aeon-space-2) var(--aeon-space-3);
	border-bottom: 1px solid var(--aeon-border);
	background: var(--aeon-header);
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-sm);
	font-weight: var(--aeon-weight-semibold);
}

.aeon table.data thead th:first-child {
	border-top-left-radius: calc(var(--aeon-radius) - 1px);
}

.aeon table.data thead th:last-child {
	border-top-right-radius: calc(var(--aeon-radius) - 1px);
}

.aeon table.data td {
	padding: 10px var(--aeon-space-3);
	border-bottom: 1px solid var(--aeon-border);
	vertical-align: middle;
}

.aeon table.data tbody tr:last-child td {
	border-bottom: 0;
}

.aeon table.data tbody tr:last-child td:first-child {
	border-bottom-left-radius: calc(var(--aeon-radius) - 1px);
}

.aeon table.data tbody tr:last-child td:last-child {
	border-bottom-right-radius: calc(var(--aeon-radius) - 1px);
}

.aeon table.data tbody tr:hover {
	background: var(--aeon-row-alternate);
}

.aeon table.data td .hint {
	font-size: var(--aeon-text-sm);
}

.aeon table.data td :is(select, input:not([type="checkbox"], [type="radio"])) {
	min-height: var(--aeon-control-sm);
	padding: 3px 8px;
	font-size: var(--aeon-text-md);
}

.aeon table.data td.actions form + form {
	margin-left: var(--aeon-space-1);
}

/* Lists of things with their actions (computers, people): rows in one box, parted by hairlines. */
.aeon :is(ul.computers, ul.people) {
	gap: 0;
	margin: var(--aeon-space-4) 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface);
}

.aeon :is(ul.computers, ul.people) li {
	padding: var(--aeon-space-3) var(--aeon-space-4);
	border: 0;
	border-radius: 0;
	background: none;
}

.aeon :is(ul.computers, ul.people) li + li {
	border-top: 1px solid var(--aeon-border);
}

/* Dialogs (js/confirm.js): the menu's surface over a dimmed page. */
.aeon dialog.confirm {
	padding: var(--aeon-space-5);
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius-lg);
	background: var(--aeon-surface);
	box-shadow: var(--aeon-shadow-lg);
	color: var(--aeon-text);
}

.aeon dialog.confirm::backdrop {
	background: light-dark(color-mix(in srgb, var(--aeon-text) 40%, transparent), color-mix(in srgb, var(--aeon-background) 78%, transparent));
}

.aeon dialog.confirm h2 {
	font-size: var(--aeon-text-lg);
}

.aeon dialog.confirm p {
	font-size: var(--aeon-text-md);
}

.aeon dialog.confirm .changes {
	border-radius: var(--aeon-radius);
}

/* A six-digit code as six boxes (js/code-input.js): fields, the current one ringed in the accent. */
.aeon .code-boxes span {
	border-color: var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-field);
}

.aeon .code-boxes span.current {
	border-color: var(--aeon-accent);
	box-shadow: 0 0 0 3px var(--aeon-accent-soft);
}

/* Downloads (the account page): a box per system on the page's colour, its checksum small. */
.aeon .platform {
	gap: var(--aeon-space-2);
	padding: var(--aeon-space-4);
	border-color: var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-background);
}

.aeon .platform h3 {
	font-size: var(--aeon-text-base);
}

.aeon .platform .label {
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-sm);
}

.aeon .platform code.hash {
	padding: 0;
	background: none;
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-xs);
}

.aeon details.other-downloads > summary {
	font-weight: var(--aeon-weight-medium);
}

/* Written text (a work item's description and comments): readable paragraphs, code in blocks. */
.aeon .markdown {
	overflow-wrap: anywhere;
}

.aeon .markdown > :first-child {
	margin-top: 0;
}

.aeon .markdown > :last-child {
	margin-bottom: 0;
}

.aeon .markdown pre {
	padding: var(--aeon-space-2) var(--aeon-space-3);
	overflow-x: auto;
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface-raised);
	font-size: var(--aeon-text-md);
}

.aeon .markdown pre code {
	padding: 0;
	background: none;
	font-size: inherit;
}

.aeon .markdown blockquote {
	margin: var(--aeon-space-3) 0;
	padding: 0 var(--aeon-space-3);
	border-left: 3px solid var(--aeon-border-strong);
	color: var(--aeon-text-muted);
}

/* A support ticket's conversation: each message a box, ours in the accent's edge. */
.aeon .ticket-entry {
	padding: var(--aeon-space-3) var(--aeon-space-4);
	border-color: var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface);
}

.aeon .ticket-entry.reply {
	border-color: color-mix(in srgb, var(--aeon-accent) 55%, var(--aeon-border));
	box-shadow: inset 3px 0 0 var(--aeon-accent);
}

.aeon .ticket-entry header {
	font-size: var(--aeon-text-sm);
}

.aeon :is(.image-picker, .picked img, .ticket-images a) {
	border-radius: var(--aeon-radius);
}

/* 6. A page of its own: signing in, an invitation, a document ---------------------------------------------------- */

/* Not under the account's tabs: a narrow column under Aeon's icon and the title, its form in a box and the ways on
   (another way to sign in, a forgotten password) under it, as a cell's sign-in page. A document (the legal pages) is
   the same column, wider, without a box. */
.aeon main > .card {
	width: 100%;
	max-width: 400px;
	margin: 0 auto;
	padding: var(--aeon-space-8) 0 var(--aeon-space-4);
	border: 0;
	border-radius: 0;
	background: none;
}

.aeon main > .card.wide {
	max-width: 680px;
}

.aeon main > .card.legal {
	max-width: 820px;
}

.aeon main > .card:not(.wide) > h1:first-child {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--aeon-space-4);
	margin: 0 0 var(--aeon-space-5);
	font-size: var(--aeon-text-xl);
	text-align: center;
}

/* The icon above the title, as on a cell's sign-in page: the app's icon drawn for larger sizes would be logo.svg; the
   site has only the small one, which reads the same at 48 px. */
.aeon main > .card:not(.wide) > h1:first-child::before {
	content: "";
	width: 48px;
	height: 48px;
	background: url("../favicon.svg") center / contain no-repeat;
}

/* A wider page of its own (deleting the account, an order): a page's title over its text, as under the tabs. */
.aeon main > .card.wide > h1:first-child {
	margin: 0 0 var(--aeon-space-3);
}

.aeon main > .card > form:has(label) {
	padding: var(--aeon-space-5);
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius-lg);
	background: var(--aeon-surface);
}

.aeon main > .card > form:has(label) :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), button) {
	min-height: 36px;
}

.aeon main > .card:not(.wide) > form:has(label) > button[type="submit"] {
	width: 100%;
}

.aeon main > .card:not(.wide) > :is(p, .aside):not(.notice, .errors-inline, .error-notice) {
	text-align: center;
}

.aeon main > .card > :is(.notice, .errors-inline, .error-notice) {
	margin: 0 0 var(--aeon-space-4);
}

.aeon main > .card > .aside {
	margin-top: var(--aeon-space-4);
}

/* The legal pages: a document, its tabs on top. */
.aeon .legal {
	font-size: var(--aeon-text-base);
	line-height: 1.6;
}

.aeon .legal h1 {
	margin: var(--aeon-space-6) 0 var(--aeon-space-2);
	font-size: var(--aeon-text-2xl);
}

.aeon .legal h2 {
	margin: var(--aeon-space-8) 0 var(--aeon-space-2);
	font-size: var(--aeon-text-lg);
}

.aeon .legal :is(th, td) {
	border-color: var(--aeon-border);
}

.aeon .legal-nav {
	gap: 0;
	padding: 0;
	border-bottom: 1px solid var(--aeon-border);
}

.aeon .legal-nav a {
	margin-bottom: -1px;
	padding: 10px 12px;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-medium);
}

.aeon .legal-nav a:hover {
	border-bottom-color: var(--aeon-border-strong);
	background: none;
	color: var(--aeon-text);
	text-decoration: none;
}

.aeon .legal-nav a[aria-current="page"] {
	border-bottom-color: var(--aeon-accent);
	background: none;
	box-shadow: none;
	color: var(--aeon-text);
	font-weight: var(--aeon-weight-semibold);
}

/* Something went wrong (the error page). */
.aeon .hero {
	padding: 64px 0;
}

.aeon .hero h1 {
	margin: 0 0 var(--aeon-space-3);
	font-size: var(--aeon-text-2xl);
}

.aeon .hero .lead {
	margin: 0 0 var(--aeon-space-2);
	font-size: var(--aeon-text-base);
}

/* 7. Pages with tabs: the account, support, an organisation ----------------------------------------------------- */

.aeon .account {
	margin: var(--aeon-space-3) 0 0;
}

/* The tabs: plain text, the open one in full colour on a 2 px accent line, as the cells' tabs and the app's panel tabs
   (Styles.axaml, panelTabs). */
.aeon .tabs {
	gap: 0;
	box-shadow: inset 0 -1px 0 var(--aeon-border);
}

.aeon .tabs a {
	min-height: 40px;
	padding: 0 12px;
	border-bottom: 2px solid transparent;
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-medium);
}

.aeon .tabs a:hover {
	border-bottom-color: var(--aeon-border-strong);
	color: var(--aeon-text);
	text-decoration: none;
}

.aeon .tabs a[aria-current="page"] {
	border-bottom-color: var(--aeon-accent);
	color: var(--aeon-text);
	font-weight: var(--aeon-weight-semibold);
}

/* A count on a tab (support replies not read yet): a small pill in the accent, as the cells' unread count. */
.aeon .tabs .count {
	min-width: 18px;
	padding: 0 5px;
	border-radius: var(--aeon-radius-full);
	background: var(--aeon-accent);
	color: var(--aeon-on-accent);
	font-size: var(--aeon-text-xs);
	font-weight: var(--aeon-weight-semibold);
	line-height: 18px;
}

/* The page itself (the card with its title): on the page, as a cell's pages are, not in a box; its sections parted by
   a line under their headings. */
.aeon .account > .card {
	margin: var(--aeon-space-6) 0 0;
}

.aeon .account > .card:has(> h1) {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
}

.aeon .account > .card > h1 {
	margin: 0 0 var(--aeon-space-3);
}

.aeon .account > .card > .hint:first-child {
	margin: 0 0 var(--aeon-space-1);
}

.aeon .account > .card:has(> h1) > h2,
.aeon .account > .card:has(> h1) > :is(form, section) > h2 {
	margin: var(--aeon-space-8) 0 var(--aeon-space-3);
	padding-bottom: var(--aeon-space-2);
	border-bottom: 1px solid var(--aeon-border);
}

.aeon .account > .card:has(> h1) h3 {
	margin: var(--aeon-space-5) 0 var(--aeon-space-2);
}

.aeon .account > .card > form + p {
	margin-top: var(--aeon-space-4);
}

/* A section of its own (the card that opens with a heading below the title): a box, its heading on a band of the
   header colour on top, as the cells' boxes ("Members", "Teams" on an organisation's page). */
.aeon .account > .card:not(:has(> h1)) {
	padding: var(--aeon-space-4);
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface);
}

.aeon .account > .card > h2:first-child {
	margin: calc(-1 * var(--aeon-space-4)) calc(-1 * var(--aeon-space-4)) var(--aeon-space-4);
	padding: 10px var(--aeon-space-4);
	border-bottom: 1px solid var(--aeon-border);
	border-radius: calc(var(--aeon-radius) - 1px) calc(var(--aeon-radius) - 1px) 0 0;
	background: var(--aeon-header);
	font-size: var(--aeon-text-base);
}

.aeon .account > .card:not(:has(> h1)) h2:not(:first-child) {
	margin: var(--aeon-space-6) 0 var(--aeon-space-3);
	font-size: var(--aeon-text-base);
}

.aeon .account > .card > :last-child {
	margin-bottom: 0;
}

.aeon .account > .card form > button {
	justify-self: start;
}

/* A list in a box runs to its edges under the band: each row parted by a hairline (the account's teams). */
.aeon .account > .card > ul.teams {
	margin: calc(-1 * var(--aeon-space-4)) calc(-1 * var(--aeon-space-4)) calc(-1 * var(--aeon-space-4));
	padding: 0;
	list-style: none;
}

.aeon .account > .card > ul.teams li {
	padding: 10px var(--aeon-space-4);
}

.aeon .account > .card > ul.teams li + li {
	border-top: 1px solid var(--aeon-border);
}

.aeon .labs-features {
	gap: var(--aeon-space-3);
}

.aeon .stack {
	gap: var(--aeon-space-1);
}

/* A work item's history: a line down the side, each change a dot on it with when and who above what happened. */
.aeon ol.history {
	margin: 0 0 0 5px;
	padding: 0;
	border-left: 2px solid var(--aeon-border);
	list-style: none;
}

.aeon ol.history > li {
	position: relative;
	padding: 0 0 var(--aeon-space-4) var(--aeon-space-5);
}

.aeon ol.history > li::before {
	content: "";
	position: absolute;
	top: 6px;
	left: -6px;
	width: 10px;
	height: 10px;
	border: 2px solid var(--aeon-surface);
	border-radius: var(--aeon-radius-full);
	background: var(--aeon-border-strong);
}

.aeon ol.history > li > :first-child {
	margin-top: 0;
}

.aeon ol.history > li > .hint:first-child {
	margin-bottom: 2px;
	font-size: var(--aeon-text-sm);
}

.aeon ol.history > li > :is(p, ul):not(.hint) {
	margin: 0;
}

/* What changed, one line each. */
.aeon ol.history ul {
	padding: 0;
	list-style: none;
}

.aeon .composer textarea {
	width: 100%;
}

/* A work item's page (Pages/Org/WorkItem.cshtml), as a cell's issue page: the title across the top with its Edit, and
   under it the state and who created it; then what it says, its links and its history, beside a column of its details
   (state, assignee, parent, labels, custom fields), each with an Edit of its own. An Edit is a <details>: its form shows
   in place of what it changes. On a phone, one column, the details after what the item says (section 8). */
.aeon .work-item {
	margin: var(--aeon-space-6) 0 0;
}

.aeon .work-item > .hint:first-child {
	margin: 0 0 var(--aeon-space-1);
}

.aeon .work-item-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--aeon-space-2) var(--aeon-space-4);
}

.aeon .work-item-head h1 {
	flex: 1 1 20rem;
	min-width: 0;
	margin: 0;
	overflow-wrap: anywhere;
}

.aeon .work-item-key {
	color: var(--aeon-text-muted);
	font-weight: var(--aeon-weight-normal);
}

/* Editing the title: the field where the title was, Edit gone; without :has(), the field under the title. */
.aeon .work-item-title-edit[open] {
	flex: 1 1 100%;
}

.aeon .work-item-title-edit[open] > summary {
	display: none;
}

.aeon .work-item-head:has(> .work-item-title-edit[open]) > h1 {
	display: none;
}

.aeon .work-item-title-edit > .work-item-form {
	margin: 0;
}

.aeon .work-item-title-edit input {
	font-size: var(--aeon-text-lg);
}

.aeon .work-item-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aeon-space-1) var(--aeon-space-2);
	margin: var(--aeon-space-3) 0 0;
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-md);
}

.aeon .work-item > :is(.notice, .errors-inline) {
	margin: var(--aeon-space-4) 0 0;
}

.aeon .work-item-layout {
	display: grid;
	grid-template-areas:
		"body side"
		"history side";
	grid-template-columns: minmax(0, 1fr) 240px;
	/* The details span both rows; what they need beyond the body's height goes into the history's row, so the history
	   starts right under the body whatever the details' length. */
	grid-template-rows: auto 1fr;
	gap: 0 var(--aeon-space-8);
	margin-top: var(--aeon-space-5);
	padding-top: var(--aeon-space-5);
	border-top: 1px solid var(--aeon-border);
}

.aeon .work-item-body {
	grid-area: body;
	min-width: 0;
}

.aeon .work-item-side {
	grid-area: side;
	align-self: start;
	min-width: 0;
}

.aeon .work-item-history {
	grid-area: history;
	min-width: 0;
	margin-top: var(--aeon-space-8);
}

/* The main column's parts: a heading over a hairline, its Edit at the heading's end. */
.aeon .work-item-section {
	position: relative;
}

.aeon .work-item-section + .work-item-section {
	margin-top: var(--aeon-space-8);
}

.aeon :is(.work-item-section, .work-item-history) > h2 {
	margin: 0 0 var(--aeon-space-3);
	padding: 0 4em var(--aeon-space-2) 0;
	border-bottom: 1px solid var(--aeon-border);
	font-size: var(--aeon-text-lg);
}

.aeon .work-item .hint.empty {
	margin: 0;
	font-style: italic;
}

/* An Edit: a quiet link at the end of its heading, in the accent; while open, its form instead of what it changes. */
.aeon :is(.section-edit, .side-edit) > summary,
.aeon :is(.section-edit, .side-edit).remove-value {
	position: absolute;
	top: var(--aeon-edit-top, 2px);
	right: 0;
	margin: 0;
	font-size: var(--aeon-text-sm);
	line-height: 18px;
	list-style: none;
}

.aeon :is(.section-edit, .side-edit) > summary::-webkit-details-marker {
	display: none;
}

.aeon :is(.section-edit, .side-edit) > summary:hover {
	text-decoration: underline;
}

.aeon .remove-value button.link {
	font-size: var(--aeon-text-sm);
	font-weight: var(--aeon-weight-medium);
}

.aeon .section-edit[open] ~ :is(.markdown, .hint.empty),
.aeon .side-edit[open] ~ .side-value {
	display: none;
}

/* The details: each a heading, its value under it, parted by hairlines, as a cell's issue page has them. */
.aeon .work-item-side > .side-entry {
	--aeon-edit-top: var(--aeon-space-3);
	position: relative;
	padding: var(--aeon-space-3) 0;
	border-bottom: 1px solid var(--aeon-border);
}

.aeon .work-item-side > .side-entry:first-of-type {
	--aeon-edit-top: 0;
	padding-top: 0;
}

.aeon .work-item-side h3 {
	margin: 0;
	padding-right: 4em;
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-sm);
	font-weight: var(--aeon-weight-semibold);
	line-height: 18px;
}

/* A value reads as text: a parent's key and title on one line, labels wrapping as words do. */
.aeon .side-value {
	margin: var(--aeon-space-2) 0 0;
	font-size: var(--aeon-text-md);
	overflow-wrap: anywhere;
}

.aeon .side-value .badge {
	margin: 0 var(--aeon-space-1) var(--aeon-space-1) 0;
}

.aeon .side-value form.inline {
	display: inline-flex;
	align-items: center;
	gap: var(--aeon-space-1);
	margin: 0 0 0 var(--aeon-space-1);
	color: var(--aeon-text-muted);
}

.aeon .side-value button.link {
	font-size: var(--aeon-text-md);
}

/* The forms: fields the column's width, Save and Cancel under them. */
.aeon .work-item-form {
	display: grid;
	gap: var(--aeon-space-2);
	margin: var(--aeon-space-2) 0 0;
}

.aeon .work-item-form :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea) {
	width: 100%;
}

.aeon .work-item-form label:not(.check, .visually-hidden) {
	margin-top: var(--aeon-space-1);
	color: var(--aeon-text);
	font-size: var(--aeon-text-md);
	font-weight: var(--aeon-weight-semibold);
}

.aeon .work-item-form > label:first-child {
	margin-top: 0;
}

.aeon .work-item-form .hint {
	margin: 0;
}

.aeon .work-item-form fieldset.choices {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
}

.aeon .work-item-form label.check {
	display: flex;
	font-size: var(--aeon-text-md);
}

.aeon .form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aeon-space-2);
	margin-top: var(--aeon-space-1);
}

.aeon .form-actions :is(button, .button) {
	margin: 0;
}

/* Children and links: rows in one box, parted by hairlines, each link's Remove at its end. */
.aeon ul.work-item-list {
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface);
	list-style: none;
}

.aeon ul.work-item-list > li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--aeon-space-1) var(--aeon-space-3);
	padding: var(--aeon-space-2) var(--aeon-space-3);
	font-size: var(--aeon-text-md);
}

.aeon ul.work-item-list > li + li {
	border-top: 1px solid var(--aeon-border);
}

.aeon .work-item-list .link-kind {
	flex: 0 0 7.5rem;
	color: var(--aeon-text-muted);
}

.aeon .work-item-list .link-title {
	flex: 1 1 12rem;
	min-width: 0;
	overflow-wrap: anywhere;
}

.aeon .work-item-list .link-remove {
	margin: 0 0 0 auto;
}

.aeon .work-item-list .link-remove button.link {
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-sm);
}

.aeon .work-item-list .link-remove button.link:hover {
	color: var(--aeon-error-text);
}

/* Adding a link: two ways, each opening its form in a box of its own. */
.aeon details.add-link {
	margin-top: var(--aeon-space-3);
}

.aeon details.add-link > .work-item-form {
	max-width: 520px;
	padding: var(--aeon-space-4);
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface);
}

/* A deployment's environment, asked only for a deployment; without :has(), always (the hint says whose it is). */
.aeon .git-link .for-deployment {
	display: contents;
}

.aeon .git-link:not(:has(option[value="deployment"]:checked)) .for-deployment {
	display: none;
}

/* The history: on the page rather than in a box now, so the dots are cut out of the page's colour; comments in boxes. */
.aeon .work-item-history ol.history > li::before {
	border-color: var(--aeon-background);
}

.aeon .work-item-history .comment {
	padding: var(--aeon-space-3) var(--aeon-space-4);
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface);
}

.aeon .work-item-history .composer {
	margin-top: var(--aeon-space-2);
}

.aeon .work-item-history .composer textarea {
	min-height: 8em;
}

/* The organisation's work item settings (Pages/Org/WorkItemSettings.cshtml): its types and fields as rows in one box,
   each opening into its form in place; a type's states and a field's options as rows to fill in, each with its arrows. */
.aeon ul.settings-list {
	margin: var(--aeon-space-3) 0 0;
	padding: 0;
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface);
	list-style: none;
}

.aeon ul.settings-list > li {
	padding: var(--aeon-space-3) var(--aeon-space-4);
	scroll-margin-top: var(--aeon-space-4);
}

.aeon ul.settings-list > li + li {
	border-top: 1px solid var(--aeon-border);
}

.aeon .settings-item-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aeon-space-1) var(--aeon-space-3);
}

.aeon .account > .card .settings-list h3 {
	margin: 0;
	font-size: var(--aeon-text-base);
}

.aeon .settings-actions {
	display: flex;
	gap: var(--aeon-space-2);
	margin-left: auto;
}

.aeon .settings-actions form {
	margin: 0;
}

.aeon .card .settings-actions button {
	margin: 0;
}

.aeon .settings-list li > .hint {
	margin: var(--aeon-space-1) 0 0;
}

.aeon .settings-list .badges {
	display: flex;
	flex-wrap: wrap;
	gap: var(--aeon-space-1);
	margin: var(--aeon-space-2) 0 0;
}

.aeon .card .settings-form {
	max-width: 680px;
	margin-top: var(--aeon-space-3);
}

.aeon .card .settings-form .form-actions {
	margin-top: var(--aeon-space-4);
}

.aeon details:is(.settings-new, .settings-archived) {
	margin: var(--aeon-space-3) 0 0;
}

.aeon details.settings-new > .settings-form {
	padding: var(--aeon-space-4);
	border: 1px solid var(--aeon-border);
	border-radius: var(--aeon-radius);
	background: var(--aeon-surface);
}

/* A list to fill in: a row each, its name, its category (a state's), whether it's archived, and its arrows. */
.aeon .card fieldset.rows {
	display: grid;
	gap: var(--aeon-space-2);
	margin: var(--aeon-space-4) 0 0;
}

/* The arrows' column has their width, so the names over the rows (a grid of their own) line up with the rows'. */
.aeon :is(.edit-row, .row-head) {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 9.5rem 6.5rem calc(2 * var(--aeon-control-sm) + 2px);
	align-items: center;
	gap: var(--aeon-space-2);
}

.aeon .options :is(.edit-row, .row-head) {
	grid-template-columns: minmax(0, 1fr) 6.5rem calc(2 * var(--aeon-control-sm) + 2px);
}

.aeon .row-head {
	color: var(--aeon-text-muted);
	font-size: var(--aeon-text-sm);
	font-weight: var(--aeon-weight-medium);
}

.aeon .edit-row .field-error {
	grid-column: 1 / -1;
}

.aeon .edit-row label.check {
	margin: 0;
	font-size: var(--aeon-text-md);
}

/* Archived, or ticked Delete (struck through as soon as it's ticked; without :has(), once the form is sent back). */
.aeon .edit-row.archived :is(input:not([type="checkbox"]), select),
.aeon .edit-row:has(.row-delete input:checked) :is(input:not([type="checkbox"]), select) {
	color: var(--aeon-text-muted);
	text-decoration: line-through;
}

.aeon .row-move {
	display: inline-flex;
	gap: 2px;
}

.aeon .card form .row-move button {
	width: var(--aeon-control-sm);
	margin: 0;
	padding: 0;
}

.aeon .row-move svg {
	width: 14px;
	height: 14px;
}

.aeon .card form button.add-row {
	justify-self: start;
	margin: var(--aeon-space-1) 0 0;
}

/* A new field's options, asked only for a choice field; without :has(), always (the hint says when they count). */
.aeon .new-field:not(:has(option:is([value="single-choice"], [value="multiple-choice"]):checked)) .options {
	display: none;
}

/* A space's overrides (Pages/Org/WorkItemSpace.cshtml): the organisation's types and fields in two tables, each row a
   name, whether the space uses it, and a field's required there; one the space turns off reads quieter. */
.aeon form.overrides {
	display: grid;
	gap: var(--aeon-space-3);
	margin-top: var(--aeon-space-3);
}

.aeon table.overrides td {
	vertical-align: middle;
}

.aeon table.overrides td:first-child {
	width: 45%;
}

.aeon .card table.overrides td > label:not(.check) {
	margin: 0;
}

.aeon table.overrides td .hint {
	display: block;
}

.aeon table.overrides tr.off td:first-child label {
	color: var(--aeon-text-muted);
	text-decoration: line-through;
}

.aeon table.overrides label.check {
	margin: 0;
}

.aeon table.overrides select {
	max-width: 100%;
}

.aeon .settings-list li > .hint.overrides {
	color: color-mix(in srgb, var(--aeon-warning), var(--aeon-text) 30%);
}

/* Nobody's: "Unassigned", quieter than a name, as a card in the app's Work items panel has it. */
.aeon table.work-items td.unassigned {
	color: var(--aeon-text-muted);
}

/* A new work item's required fields (Pages/Org/WorkItems.cshtml): each its own fieldset, without a box, laid out as the
   form's other fields; hidden until its space and type are chosen (a fieldset's display, site.css, would show it). */
.aeon fieldset.required-field {
	display: grid;
	gap: var(--aeon-space-1);
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.aeon fieldset.required-field[hidden] {
	display: none;
}

/* A page's own actions at its title's end (a space's settings and the organisation's on its work items). */
.aeon .page-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: var(--aeon-space-2);
	float: right;
	margin: 2px 0 var(--aeon-space-2) var(--aeon-space-3);
}

.aeon .card .page-actions .button {
	margin: 0;
}

/* 8. Narrow windows ----------------------------------------------------------------------------------------------- */

@media (max-width: 640px) {
	/* The bar keeps the icon, the organisation and the menu; the links go into the menu. */
	.aeon .aeon-bar {
		gap: var(--aeon-space-1);
		padding: 0 var(--aeon-space-2);
	}

	.aeon .aeon-bar-brand span,
	.aeon .aeon-bar-end > a.aeon-bar-link {
		display: none;
	}

	.aeon .aeon-menu-content .aeon-narrow {
		display: flex;
	}

	.aeon .footer nav {
		width: 100%;
	}

	/* An organisation's members: one block each instead of a table's row (site.css), in its box. */
	.aeon .card table.members tr {
		padding: var(--aeon-space-3) var(--aeon-space-3);
	}

	.aeon .card table.members td {
		padding: 2px 0;
		border: 0;
	}

	.aeon .card table.members tbody tr:last-child {
		border-bottom: 0;
	}

	/* Work items: one block each, as a cell's issue list on a phone: the key and state, the title under them, then its
	   type and who has it. */
	.aeon table.work-items,
	.aeon table.work-items tbody {
		display: block;
	}

	.aeon table.work-items thead {
		display: none;
	}

	.aeon table.work-items tr {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 2px var(--aeon-space-2);
		padding: 10px var(--aeon-space-3);
	}

	.aeon table.work-items tr + tr {
		border-top: 1px solid var(--aeon-border);
	}

	.aeon table.work-items td {
		padding: 0;
		border: 0;
	}

	.aeon table.work-items td:nth-child(2) {
		flex-basis: 100%;
		order: 1;
	}

	.aeon table.work-items td:is(:nth-child(3), :nth-child(5)) {
		order: 2;
		color: var(--aeon-text-muted);
		font-size: var(--aeon-text-sm);
	}
}

/* A work item's page: one column below the width two need, its details after what it says and before its history,
   their first heading over a hairline as the others. */
@media (max-width: 760px) {
	.aeon .work-item-layout {
		grid-template-areas:
			"body"
			"side"
			"history";
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto;
	}

	.aeon .work-item-side {
		margin-top: var(--aeon-space-8);
		border-top: 1px solid var(--aeon-border);
	}

	.aeon .work-item-side > .side-entry:first-of-type {
		--aeon-edit-top: var(--aeon-space-3);
		padding-top: var(--aeon-space-3);
	}
}

/* On a phone, a link's kind on a line of its own over what it links to: the row's width for the title. A list to fill
   in: each row's name across the row, what else it has under it. */
@media (max-width: 640px) {
	.aeon .work-item-list .link-kind {
		flex-basis: 100%;
		font-size: var(--aeon-text-sm);
	}

	.aeon :is(.edit-row, .options .edit-row) {
		grid-template-columns: minmax(0, 1fr) auto auto;
	}

	.aeon .edit-row .row-name {
		grid-column: 1 / -1;
	}

	.aeon .edit-row + .edit-row {
		padding-top: var(--aeon-space-2);
		border-top: 1px solid var(--aeon-border);
	}

	.aeon .row-head {
		display: none;
	}
}
