/* ==========================================================================
   Theme and global configuration
   ========================================================================== */

:root {
	/* Backgrounds */
	--bg-body: transparent;
	--bg-surface: #ffffff;
	--bg-surface-muted: #ffffff;
	--bg-error: #f5d6d6;
	--bg-success: #d8f0d8;
	--bg-alert: #ff0000;

	/* Text */
	--text-color: #000000;
	--text-muted: rgba(0, 0, 0, 0.85);
	--text-inverse: #ffffff;

	/* Borders and outlines */
	--border-color: #000000;
	--border-subtle: #cccccc;
	--outline-strong: #000000;
	--link-color: inherit;
	--toolbar-bg: #ffffff;
	--toolbar-border: #000000;
	--surface-raised-bg: var(--bg-surface);
	--surface-raised-bg-hover: var(--bg-surface-muted);
	--surface-muted-bg: var(--bg-surface-muted);
	--surface-border: var(--border-color);
	--surface-shadow: none;
	--surface-strong-shadow: var(--surface-shadow);
	--surface-radius: 0;
	--surface-highlight: transparent;
	--control-bg: var(--bg-surface);
	--control-bg-hover: var(--bg-surface-muted);
	--control-border: var(--border-color);
	--control-shadow: none;
	--control-radius: 0;
	--control-highlight: transparent;
	--panel-header-bg: transparent;
	--panel-header-border: var(--border-color);
	--panel-divider: var(--border-subtle);
	--meta-text: var(--text-muted);
	--list-gap: var(--space-6);

	/* Background image */
	--body-bg-image: url("/img/background.gif");
	--body-bg-repeat: repeat;
	--body-bg-position: top left;
	--body-bg-attachment: scroll;

	/* Spacing */
	--space-0: 0;
	--space-1: 0.25rem;
	--space-2: 0.35rem;
	--space-3: 0.4rem;
	--space-4: 0.5rem;
	--space-5: 0.6rem;
	--space-6: 0.75rem;
	--space-7: 1rem;
	--space-8: 1.5rem;
	--space-9: 2rem;

	/* Borders */
	--border-width: 1px;
	--border-width-strong: 2px;

	/* Window and layout sizing */
	--page-max-width: 72rem;
	--landing-article-max-width: 52rem;
	--auth-card-width: 28rem;
	--wide-window-min-width: 48rem;
	--window-default-width: min(90vw, 56rem);
	--window-max-width: none;
	--profile-max-width: min(90vw, 72rem);
	--profile-sidebar-min: 16rem;
	--profile-sidebar-max: 20rem;
	--profile-view-radius: 0;
	--profile-panel-radius: 0;
	--profile-control-radius: 0;
	--profile-avatar-frame-radius: 0;
	--profile-shape-shadow: none;
	--profile-control-shadow: none;

	/* Specific window widths */
	--messages-window-min-width: 34rem;
	--notifications-window-min-width: 26rem;
	--generic-window-min-width: 24rem;

	/* Typography */
	--font-sans: sans-serif;
	--font-heading: var(--font-sans);
	--font-mono: monospace;
	--line-height-base: 1.35;
	--line-height-tight: 1.2;
	--heading-line-height: var(--line-height-tight);
	--heading-font-weight: bold;
	--profile-username-size: 1.5rem;
	--list-title-size: 1.1rem;
	--notification-title-size: 1.05rem;

	/* Form sizing */
	--form-control-width: 100%;

	/* Component sizing */
	--profile-content-min-height: 18rem;
	--profile-content-min-height-mobile: 12rem;

	/* Mobile breakpoint */
	--mobile-breakpoint: 799px;

	/* Joba window tokens. Joba reads generic CSS variables and remains theme-agnostic. */
	--joba-bg: var(--bg-surface);
	--joba-fg: var(--text-color);
	--joba-border: var(--border-color);
	--joba-shadow: var(--border-color);
	--joba-content-border: var(--border-color);
	--joba-titlebar-bg: var(--joba-bg);
	--joba-title-font: var(--font-heading);
	--joba-title-font-weight: var(--heading-font-weight);
	--joba-titlebar-backdrop-filter: none;
	--joba-content-bg: var(--joba-bg);
	--joba-content-backdrop-filter: none;
	--joba-window-radius: 0;
	--joba-content-border-style: dotted;
	--joba-window-shadow:
		var(--joba-shadow-offset-x, 10px) var(--joba-shadow-offset-y, 10px) 0 var(--joba-shadow);
	--joba-close-bg: var(--joba-bg);
	--joba-close-fg: var(--joba-fg);
	--joba-close-border: var(--joba-border);
	--joba-close-bg-hover: #000000;
	--joba-close-fg-hover: #ffffff;
	--joba-close-border-hover: var(--joba-close-border);
	--joba-close-radius: 0;
	--joba-close-width: 1em;
	--joba-close-height: 1em;
	--joba-close-shadow: none;
	--joba-titlebar-image: url("/joba-windows/title-bar.png");
	--joba-attach-icon: url("/joba-windows/attach-icon.png");
	--joba-resize-icon: url("/joba-windows/resize-icon.png");
}

html[data-theme="naero"] {
	--bg-body: #6da0cf;
	--bg-surface: rgba(247, 251, 255, 0.82);
	--bg-surface-muted: rgba(225, 237, 249, 0.76);
	--bg-error: rgba(255, 214, 214, 0.9);
	--bg-success: rgba(219, 244, 219, 0.88);
	--bg-alert: #df514a;
	--text-color: #103b66;
	--text-muted: rgba(16, 59, 102, 0.76);
	--text-inverse: #ffffff;
	--font-sans: "Segoe UI", "Segoe UI Variable Text", Tahoma, Arial, sans-serif;
	--font-heading: "Segoe UI Light", "Segoe UI", "Segoe UI Variable Display", Tahoma, Arial, sans-serif;
	--heading-font-weight: 300;
	--heading-line-height: 1.28;
	--profile-view-radius: var(--surface-radius);
	--profile-panel-radius: var(--surface-radius);
	--profile-control-radius: var(--control-radius);
	--profile-avatar-frame-radius: calc(var(--surface-radius) * 0.75);
	--profile-shape-shadow: var(--surface-shadow);
	--profile-control-shadow: var(--control-shadow);
	--border-color: rgba(103, 150, 199, 0.92);
	--border-subtle: rgba(255, 255, 255, 0.72);
	--outline-strong: #eef8ff;
	--link-color: #0d4f91;
	--toolbar-bg: rgba(244, 249, 255, 0.44);
	--toolbar-border: rgba(126, 168, 213, 0.95);
	--surface-raised-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(229, 241, 252, 0.76));
	--surface-raised-bg-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 246, 253, 0.86));
	--surface-muted-bg: linear-gradient(180deg, rgba(239, 247, 254, 0.9), rgba(221, 236, 249, 0.82));
	--surface-border: rgba(132, 176, 219, 0.98);
	--surface-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.9),
		inset 0 0 0 1px rgba(255, 255, 255, 0.34),
		0 8px 18px rgba(15, 54, 96, 0.12);
	--surface-strong-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.94),
		inset 0 0 0 1px rgba(255, 255, 255, 0.42),
		0 12px 24px rgba(15, 54, 96, 0.16);
	--surface-radius: 0.25rem;
	--surface-highlight: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
	--control-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(214, 233, 249, 0.72));
	--control-bg-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(228, 241, 252, 0.84));
	--control-border: rgba(126, 168, 213, 0.95);
	--control-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.95),
		0 2px 8px rgba(16, 57, 98, 0.14);
	--control-radius: 0.25rem;
	--control-highlight: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
	--panel-header-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(188, 220, 246, 0.22));
	--panel-header-border: rgba(171, 205, 237, 0.98);
	--panel-divider: rgba(174, 205, 233, 0.9);
	--meta-text: rgba(24, 69, 111, 0.78);
	--list-gap: 0.75rem;
	--body-bg-image: url("/img/themes/naero/background.jpg");
	--body-bg-repeat: no-repeat;
	--body-bg-size: cover;
	--body-bg-attachment: fixed;
	--joba-bg: rgba(244, 250, 255, 0.72);
	--joba-fg: #0d3258;
	--joba-border: rgba(122, 167, 214, 0.98);
	--joba-shadow: rgba(7, 29, 58, 0.38);
	--joba-content-border: rgba(180, 213, 243, 0.95);
	--joba-titlebar-bg:
		linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0%, rgba(205, 233, 254, 0.58) 42%, rgba(111, 176, 236, 0.45) 100%);
	--joba-titlebar-backdrop-filter: blur(18px) saturate(140%);
	--joba-content-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(231, 242, 252, 0.78));
	--joba-content-backdrop-filter: blur(14px) saturate(125%);
	--joba-window-radius: 0.25rem;
	--joba-content-border-style: solid;
	--joba-window-shadow:
		0 18px 38px rgba(13, 44, 81, 0.34),
		0 0 0 1px rgba(255, 255, 255, 0.38),
		0 0 24px rgba(165, 212, 255, 0.28);
	--joba-close-bg: linear-gradient(180deg, #ff8c82 0%, #df514a 48%, #b8201d 100%);
	--joba-close-fg: #ffffff;
	--joba-close-border: rgba(124, 12, 12, 0.82);
	--joba-close-bg-hover: linear-gradient(180deg, #ffaaa2 0%, #f15b53 44%, #c51d1a 100%);
	--joba-close-fg-hover: #ffffff;
	--joba-close-border-hover: rgba(96, 0, 0, 0.95);
	--joba-close-radius: 0.18rem;
	--joba-close-width: 2.2rem;
	--joba-close-height: 1.05rem;
	--joba-close-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.55),
		0 1px 3px rgba(59, 0, 0, 0.25);
	--joba-update-bg: linear-gradient(180deg, #68e481 0%, #35b85a 48%, #1f8f3a 100%);
	--joba-update-fg: #ffffff;
	--joba-update-border: rgba(18, 107, 45, 0.86);
	--joba-update-bg-hover: linear-gradient(180deg, #89f29a 0%, #42c968 44%, #239246 100%);
	--joba-update-fg-hover: #ffffff;
	--joba-update-border-hover: rgba(10, 79, 31, 0.95);
	--joba-titlebar-image:
		radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.9), transparent 20%),
		radial-gradient(circle at 68% 0%, rgba(255, 255, 255, 0.5), transparent 28%),
		linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(198, 227, 250, 0.56) 36%, rgba(91, 163, 230, 0.42) 100%);
}
/* ==========================================================================
   Base
   ========================================================================== */

body {
	background-color: var(--bg-body);
	background-image: var(--body-bg-image);
	background-repeat: var(--body-bg-repeat);
	background-position: var(--body-bg-position);
	background-size: var(--body-bg-size);
	background-attachment: var(--body-bg-attachment);
	color: var(--text-color);
	font-family: var(--font-sans);
	line-height: var(--line-height-base);
}

a {
	color: var(--link-color);
}

.username-banned {
	color: var(--meta-text);
	font-style: italic;
	font-weight: bold;
}

.banned-user-avatar {
	display: grid;
	image-rendering: pixelated;
}

.joba-content [data-window-view] > h1:first-child {
	display: none;
}

h1,
h2,
h3,
.profile-username,
.profile-heading,
.directory-username,
.thread-list-title,
.notification-title,
.message-list-subject,
.message-card-subject,
.settings-section h2 {
	font-family: var(--font-heading);
	font-weight: var(--heading-font-weight);
	line-height: var(--heading-line-height);
}

/* ==========================================================================
   Shared auth and forms
   ========================================================================== */

.auth-page {
	min-height: calc(100vh - 4.5rem);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-7);
}

.auth-card {
	width: min(100%, var(--auth-card-width));
	background: var(--bg-surface);
	border: var(--border-width) solid var(--border-color);
	padding: var(--space-7);
	box-sizing: border-box;
}

.form-row {
	margin-bottom: var(--space-6);
}

.form-row label {
	display: block;
	margin-bottom: var(--space-1);
}

.form-row input,
.form-row textarea,
.form-row select {
	width: var(--form-control-width);
	box-sizing: border-box;
}

.form-row input,
.form-row textarea,
.form-row select,
.directory-search-row input,
.message-search-row input,
.thread-sort-row select {
	border: var(--border-width) solid var(--control-border);
	border-radius: var(--control-radius);
	background: var(--control-bg);
	box-shadow: var(--control-shadow);
	color: var(--text-color);
	padding: var(--space-3) var(--space-4);
}

.form-row textarea {
	border-radius: min(var(--control-radius), 0.75rem);
}

.llm-chat-form textarea {
	width: 100%;
	box-sizing: border-box;
}

.form-actions {
	margin-top: var(--space-7);
}

.form-message {
	padding: var(--space-4);
	border: var(--border-width) solid var(--border-color);
}

button,
.action-link,
.landing-button,
.directory-search-clear,
.directory-pagination a,
.notification-pagination a,
.thread-pagination a,
.message-pagination a,
.message-search-clear,
.message-toolbar a,
.thread-toolbar a,
.thread-actions a,
.message-actions a {
	display: inline-block;
	padding: var(--space-2) var(--space-5);
	border: var(--border-width) solid var(--control-border);
	border-radius: var(--control-radius);
	background:
		var(--control-highlight),
		var(--control-bg);
	box-shadow: var(--control-shadow);
	color: inherit;
	text-decoration: none;
}

button:hover,
button:focus-visible,
.action-link:hover,
.action-link:focus-visible,
.landing-button:hover,
.landing-button:focus-visible,
.directory-search-clear:hover,
.directory-search-clear:focus-visible,
.directory-pagination a:hover,
.directory-pagination a:focus-visible,
.notification-pagination a:hover,
.notification-pagination a:focus-visible,
.thread-pagination a:hover,
.thread-pagination a:focus-visible,
.message-pagination a:hover,
.message-pagination a:focus-visible,
.message-search-clear:hover,
.message-search-clear:focus-visible,
.message-toolbar a:hover,
.message-toolbar a:focus-visible,
.thread-toolbar a:hover,
.thread-toolbar a:focus-visible,
.thread-actions a:hover,
.thread-actions a:focus-visible,
.message-actions a:hover,
.message-actions a:focus-visible {
	background:
		var(--control-highlight),
		var(--control-bg-hover);
}

button,
input,
textarea,
select {
	font: inherit;
}

.form-message-error {
	background: var(--bg-error);
}

.form-message-success {
	background: var(--bg-success);
}

/* ==========================================================================
   Site footer
   ========================================================================== */

.site-footer {
	padding: var(--space-7);
	color: var(--meta-text);
	font-size: 0.92rem;
	text-align: center;
}

.site-footer-inner {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	align-items: center;
	justify-content: center;
}

.site-footer a {
	color: var(--link-color);
}

@media (max-width: 799px) {
	.site-footer-inner {
		flex-direction: column;
		gap: var(--space-1);
	}

	.site-footer-separator {
		display: none;
	}
}

/* ==========================================================================
   Landing page
   ========================================================================== */

.landing-page {
	padding: var(--space-8);
	max-width: var(--page-max-width);
	margin: 0 auto;
}

.landing-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	margin-bottom: var(--space-9);
}

.landing-logo-block {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.landing-logo {
	display: block;
	height: auto;
	image-rendering: pixelated;
	margin: auto;
}

.landing-title {
	margin: var(--space-6) 0 0 0;
}

.landing-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-6);
	justify-content: center;
	margin-top: var(--space-7);
}

.landing-button {
	padding: var(--space-5) var(--space-7);
}

.landing-main {
	display: flex;
	justify-content: center;
}

.landing-article {
	width: min(100%, var(--landing-article-max-width));
	background: var(--bg-surface);
	border: var(--border-width) solid var(--border-color);
	padding: var(--space-7);
	box-sizing: border-box;
}

.landing-update-notes h2 {
	margin: 0 0 var(--space-6) 0;
	font-size: 1.6rem;
}

.landing-update-kicker {
	margin: 0 0 var(--space-2) 0;
	color: var(--meta-text);
	font-weight: bold;
}

.landing-update-logo {
	display: block;
	max-width: min(100%, 420px);
	height: auto;
	margin: var(--space-4) auto var(--space-6);
	image-rendering: pixelated;
}

.landing-update-list {
	display: grid;
	gap: var(--space-5);
	margin: var(--space-7) 0;
	padding-left: 1.25rem;
}

.landing-update-list li {
	padding-left: var(--space-2);
}

.landing-update-notes code {
	font-family: var(--font-mono);
}

/* ==========================================================================
   Shared window sizing
   ========================================================================== */

.profile-view,
.directory-view,
.inbox-view,
.sent-view,
.message-view,
.compose-view,
.edit-profile-view,
.edit-avatar-view,
.threads-view,
.create-thread-view,
.thread-view,
.thread-reply-view,
.leaderboards-view,
.currency-view,
.trades-view,
.collectibles-view,
.collectible-store-view,
.notifications-view,
.settings-view {
	min-width: var(--wide-window-min-width);
}

/* ==========================================================================
   Profile
   ========================================================================== */

.profile-view {
	--profile-bg: #ffffff;
	--profile-panel: #ffffff;
	--profile-text: #000000;
	--profile-heading: #000000;
	--profile-border: #000000;

	padding: var(--space-4);
	max-width: var(--profile-max-width);
	border-radius: var(--profile-view-radius);
	background: var(--profile-bg);
	color: var(--profile-text);
	box-shadow: var(--profile-shape-shadow);
}

.profile-layout {
	display: grid;
	grid-template-columns: minmax(var(--profile-sidebar-min), var(--profile-sidebar-max)) minmax(0, 1fr);
	gap: var(--space-7);
	align-items: start;
}

.profile-sidebar {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
}

.profile-avatar-wrap {
	display: inline-block;
}

.profile-avatar-wrap .profile-avatar {
	border: var(--border-width) solid var(--profile-border);
	border-radius: var(--profile-avatar-frame-radius);
	box-shadow: var(--profile-shape-shadow);
	overflow: hidden;
}

.profile-username {
	margin: 0;
	font-size: var(--profile-username-size);
	line-height: 1.1;
	word-break: break-word;
	color: var(--profile-heading);
}

.profile-status {
	margin: 0;
	font-style: italic;
	color: var(--profile-text);
}

.profile-meta {
	margin: 0;
	padding: 0;
	color: var(--profile-text);
}

.profile-meta > div {
	margin-bottom: var(--space-4);
}

.profile-meta dt {
	font-weight: bold;
	margin-bottom: 0.15rem;
	color: var(--profile-heading);
}

.profile-meta dd {
	margin: 0;
}

.profile-actions {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.profile-actions a {
	display: inline-block;
	padding: var(--space-2) var(--space-5);
	border: var(--border-width) solid var(--profile-border);
	border-radius: var(--profile-control-radius);
	background: var(--profile-panel);
	box-shadow: var(--profile-control-shadow);
	color: var(--profile-text);
	text-decoration: none;
	width: fit-content;
	max-width: 100%;
}

.profile-main {
	min-width: 0;
}

.profile-content-card {
	border: var(--border-width) solid var(--profile-border);
	border-radius: var(--profile-panel-radius);
	background: var(--profile-panel);
	box-shadow: var(--profile-shape-shadow);
	padding: var(--space-4);
	min-height: var(--profile-content-min-height);
}

.profile-text-scroll,
.user-content-scroll {
	overflow-x: auto;
	overflow-y: auto;
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
}

.profile-text,
.user-content-text {
	font-family: var(--font-mono);
	white-space: pre;
	line-height: var(--line-height-tight);
	min-width: max-content;
	tab-size: 4;
	-moz-tab-size: 4;
}

.profile-text {
	color: var(--profile-text);
}

.profile-heading {
	margin: var(--space-7) 0 var(--space-3) 0;
	white-space: normal;
	line-height: var(--line-height-tight);
	color: var(--profile-heading);
}

.profile-heading:first-child {
	margin-top: 0;
}

.profile-text-block {
	display: block;
}

.profile-username-reference .username-link {
	font-weight: bold;
}

.profile-username-missing {
	font-style: italic;
	opacity: 0.8;
}

/* ==========================================================================
   Message toolbar
   ========================================================================== */

.message-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-6);
	margin: 0 0 var(--space-7) 0;
}

.message-toolbar a.is-current {
	font-weight: bold;
}

/* ==========================================================================
   Directory
   ========================================================================== */

.directory-view {
	width: var(--window-default-width);
	max-width: var(--window-max-width);
}

.directory-total {
	margin-bottom: var(--space-7);
}

.directory-list {
	display: flex;
	flex-direction: column;
	gap: var(--list-gap);
	padding: 0;
}

.directory-item {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--space-6);
	align-items: start;
	padding: var(--space-6);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-shadow);
}

.directory-item,
.thread-list-item,
.thread-post,
.notification-item,
.message-list-item,
.message-card,
.theme-choice-card,
.thread-meta,
.settings-section {
	transition: background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.directory-item[data-window-click],
.thread-list-item[data-window-click],
.notification-item[data-window-click],
.message-list-item[data-window-click] {
	cursor: pointer;
}

.directory-item:hover,
.thread-list-item:hover,
.thread-post:hover,
.notification-item:hover,
.message-list-item:hover,
.message-card:hover,
.theme-choice-card:hover,
.thread-meta:hover,
.settings-section:hover {
	background:
		var(--surface-highlight),
		var(--surface-raised-bg-hover);
	box-shadow: var(--surface-strong-shadow);
}

.directory-item[data-window-click]:focus-visible,
.thread-list-item[data-window-click]:focus-visible,
.notification-item[data-window-click]:focus-visible,
.message-list-item[data-window-click]:focus-visible {
	outline: var(--border-width-strong) solid var(--outline-strong);
	outline-offset: 2px;
}

.directory-avatar-link {
	display: inline-block;
	flex: 0 0 auto;
	text-decoration: none;
}

.directory-item-main {
	min-width: 0;
}

.directory-username {
	margin: 0 0 var(--space-2) 0;
	font-size: var(--list-title-size);
	line-height: 1.1;
	word-break: break-word;
}

.directory-username a {
	color: inherit;
	text-decoration: none;
}

.directory-status {
	margin: 0 0 var(--space-3) 0;
	font-style: italic;
	color: var(--meta-text);
}

.directory-joined {
	margin: 0;
	font-size: 0.92rem;
	color: var(--meta-text);
}

.directory-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-6);
	align-items: center;
	margin-top: var(--space-7);
}

.directory-search-row,
.message-search-row,
.thread-sort-row {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: var(--space-4);
	margin-bottom: var(--space-7);
}

.directory-search-row label,
.message-search-row label,
.thread-sort-row label {
	margin: 0;
}

.directory-search-row input,
.message-search-row input {
	flex: 1 1 14rem;
	min-width: 0;
}

/* ==========================================================================
   LLM chat
   ========================================================================== */

.llm-chat-view {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
	min-height: 24rem;
}

.llm-chat-topbar {
	display: flex;
	justify-content: flex-end;
}

.llm-chat-log {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	min-height: 14rem;
	max-height: 32rem;
	overflow: auto;
	padding: var(--space-4);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background: var(--bg-surface);
}

.llm-chat-empty,
.llm-chat-status {
	color: var(--meta-text);
}

.llm-chat-message {
	max-width: min(34rem, 92%);
	padding: var(--space-4);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-shadow);
	white-space: normal;
	overflow-wrap: anywhere;
}

.llm-chat-message-user {
	align-self: flex-end;
}

.llm-chat-message-assistant,
.llm-chat-message-failed {
	align-self: flex-start;
}

.llm-chat-message-meta {
	margin-bottom: var(--space-2);
	color: var(--meta-text);
	font-size: 0.9rem;
}

.llm-chat-error {
	margin: var(--space-3) 0 0 0;
	color: #9b1c1c;
}

.llm-chat-form {
	display: grid;
	gap: var(--space-3);
}

.llm-chat-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
	align-items: center;
}

/* ==========================================================================
   Threads
   ========================================================================== */

.thread-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-6);
	margin: 0 0 var(--space-7) 0;
}

.thread-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-6);
	margin: var(--space-7) 0;
}

.threads-view,
.create-thread-view,
.thread-view,
.thread-reply-view {
	width: var(--window-default-width);
	max-width: var(--window-max-width);
}

.thread-list {
	display: flex;
	flex-direction: column;
	gap: var(--list-gap);
	padding: 0;
}

.thread-list-item,
.thread-post {
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-shadow);
	padding: var(--space-6);
}

.thread-list-title {
	margin: 0 0 var(--space-3) 0;
	font-size: var(--list-title-size);
}

.thread-list-title a {
	color: inherit;
	text-decoration: none;
}

.games-view {
	width: var(--window-default-width);
	max-width: var(--window-max-width);
}

.game-list {
	display: flex;
	flex-direction: column;
	gap: var(--list-gap);
	padding: 0;
	list-style: none;
}

.game-list-item {
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-shadow);
	transition: background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.game-list-item:hover {
	background:
		var(--surface-highlight),
		var(--surface-raised-bg-hover);
	box-shadow: var(--surface-strong-shadow);
}

.game-list-item a {
	display: grid;
	grid-template-columns: 4.5rem minmax(0, 1fr);
	gap: var(--space-6);
	align-items: center;
	padding: var(--space-6);
	color: inherit;
	text-decoration: none;
}

.game-list-item a:focus-visible {
	outline: var(--border-width-strong) solid var(--outline-strong);
	outline-offset: 2px;
}

.game-list-item img {
	width: 4.5rem;
	height: 4.5rem;
	object-fit: contain;
	image-rendering: pixelated;
}

.game-list-main {
	display: grid;
	gap: var(--space-2);
	min-width: 0;
}

.game-list-title {
	font-size: var(--list-title-size);
	font-weight: bold;
	line-height: var(--heading-line-height);
	overflow-wrap: anywhere;
}

.game-list-description {
	color: var(--meta-text);
	overflow-wrap: anywhere;
}

.thread-list-meta,
.thread-list-status,
.thread-meta p {
	margin: 0 0 var(--space-2) 0;
	color: var(--meta-text);
}

/* ==========================================================================
   Leaderboards
   ========================================================================== */

.leaderboards-view {
	width: var(--window-default-width);
	max-width: var(--window-max-width);
}

.leaderboard-section {
	padding: var(--space-6);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-shadow);
}

.leaderboard-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
	margin-bottom: var(--space-7);
}

.leaderboard-toolbar a,
.leaderboard-pagination a {
	display: inline-block;
	padding: var(--space-2) var(--space-5);
	border: var(--border-width) solid var(--control-border);
	border-radius: var(--control-radius);
	background:
		var(--control-highlight),
		var(--control-bg);
	box-shadow: var(--control-shadow);
	color: inherit;
	text-decoration: none;
}

.leaderboard-toolbar a:hover,
.leaderboard-toolbar a:focus-visible,
.leaderboard-pagination a:hover,
.leaderboard-pagination a:focus-visible {
	background:
		var(--control-highlight),
		var(--control-bg-hover);
	outline: var(--border-width-strong) solid var(--outline-strong);
	outline-offset: 2px;
}

.leaderboard-toolbar a.is-current {
	font-weight: bold;
	outline: var(--border-width-strong) solid var(--outline-strong);
}

.leaderboard-heading-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4) var(--space-7);
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: var(--space-6);
}

.leaderboard-heading-row h2,
.leaderboard-heading-row p {
	margin: 0;
}

.leaderboard-heading-row h2 {
	font-size: var(--list-title-size);
}

.leaderboard-heading-row p {
	color: var(--meta-text);
}

.leaderboard-list {
	display: grid;
	gap: var(--space-4);
	margin: 0;
	padding: 0;
	list-style: none;
}

.leaderboard-item {
	display: grid;
	grid-template-columns: 2rem auto minmax(0, 1fr);
	gap: var(--space-4);
	align-items: center;
	padding: var(--space-4);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-muted-bg);
	box-shadow: var(--surface-shadow);
	cursor: pointer;
	transition: background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.leaderboard-item:hover {
	background:
		var(--surface-highlight),
		var(--surface-raised-bg-hover);
	box-shadow: var(--surface-strong-shadow);
}

.leaderboard-item:focus-visible {
	outline: var(--border-width-strong) solid var(--outline-strong);
	outline-offset: 2px;
}

.leaderboard-rank {
	font-weight: bold;
	text-align: center;
}

.leaderboard-avatar-link {
	display: inline-block;
	text-decoration: none;
}

.leaderboard-user,
.leaderboard-score {
	min-width: 0;
	overflow-wrap: anywhere;
}

.leaderboard-user a {
	color: inherit;
	font-weight: bold;
	text-decoration: none;
}

.leaderboard-score {
	grid-column: 3;
	color: var(--meta-text);
}

.leaderboard-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-6);
	align-items: center;
	margin-top: var(--space-7);
}

.thread-post-list {
	display: flex;
	flex-direction: column;
	gap: var(--list-gap);
	margin: var(--space-7) 0;
}

.thread-post {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--space-6);
	align-items: start;
}

.thread-post-avatar {
	flex: 0 0 auto;
}

.thread-post-avatar a {
	display: inline-block;
	text-decoration: none;
}

.thread-post-main {
	min-width: 0;
}

.thread-post-meta {
	margin-bottom: var(--space-4);
	padding-bottom: var(--space-4);
	border-bottom: var(--border-width) solid var(--panel-divider);
	color: var(--meta-text);
}

.thread-post-body {
	max-width: 100%;
}

.thread-post-body .user-content-text {
	color: var(--text-color);
}

.thread-post-body .user-content-text,
.message-card-body .user-content-text {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
	min-width: 0;
}

.thread-post-reference,
.thread-post-reference-line,
.thread-post-permalink {
	color: var(--link-color);
	font-weight: var(--heading-font-weight);
	text-decoration: underline;
}

.thread-post-reference-copy {
	margin: 0 var(--space-2);
	padding: 0 var(--space-2);
	font-size: 0.92rem;
}

.thread-post-reference-copy.is-copied {
	font-weight: bold;
}

.thread-post-reference-missing {
	font-style: italic;
	opacity: 0.8;
	text-decoration: none;
}

.collectible-reference {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	margin: 0;
	vertical-align: bottom;
}

.collectible-reference img,
.collectible-card img {
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	object-fit: contain;
	image-rendering: pixelated;
}

.avatar-preview {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	line-height: 0;
}

.avatar-preview .profile-avatar {
	image-rendering: pixelated;
}

.collectible-reference-missing {
	display: inline;
	width: auto;
	font-style: italic;
	opacity: 0.8;
}

.collectible-reference-line {
	display: block;
	line-height: 0;
	min-height: 48px;
}

.collectible-reference-line .collectible-reference-missing {
	line-height: var(--line-height-tight);
}

.trade-request-list {
	display: flex;
	flex-direction: column;
	gap: var(--list-gap);
}

.trade-request-card {
	padding: var(--space-6);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-shadow);
}

.trade-request-card-highlight {
	outline: var(--border-width-strong) solid var(--outline-strong);
	outline-offset: 2px;
}

.trade-request-header h2,
.trade-request-header p,
.trade-request-note {
	margin: 0;
}

.trade-request-meta {
	color: var(--meta-text);
}

.trade-request-columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-6);
	margin-top: var(--space-6);
}

.trade-request-panel {
	padding: var(--space-6);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-muted-bg);
	box-shadow: var(--surface-shadow);
}

.trade-item-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.trade-item-list-entry {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: var(--space-4);
	align-items: center;
	margin-bottom: var(--space-3);
}

.trade-item-list-entry:last-child {
	margin-bottom: 0;
}

.trade-item-list-entry strong,
.trade-item-list-entry code {
	display: inline-block;
}

.trade-recipient-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
	align-items: center;
}

.trade-recipient-row input {
	flex: 1 1 14rem;
	min-width: 0;
}

.trade-item-browser {
	margin-top: var(--space-6);
}

.trade-item-browser-label,
.trade-item-browser-empty {
	margin: 0 0 var(--space-3) 0;
}

.trade-item-browser-empty {
	color: var(--meta-text);
}

.trade-item-browser-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	max-height: 16rem;
	overflow-y: auto;
	padding-right: var(--space-2);
}

.trade-item-chip {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) auto;
	gap: var(--space-4);
	align-items: center;
	width: 100%;
	padding: var(--space-4);
	text-align: left;
}

.trade-item-chip span,
.trade-item-chip small {
	display: block;
}

.trade-item-chip small {
	color: var(--meta-text);
}

.trade-items-hidden-input {
	display: none;
}

.trade-selected-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	min-height: 2.5rem;
}

.trade-selected-empty {
	margin: 0;
	color: var(--meta-text);
}

.trade-selected-chip {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
	padding: var(--space-3) var(--space-4);
}

.trade-selected-chip span,
.trade-selected-chip small {
	display: block;
}

.thread-post:target,
.thread-post.joba-scroll-target {
	outline: var(--border-width-strong) solid var(--outline-strong);
	outline-offset: 2px;
}

.thread-closed-message {
	font-weight: bold;
}

.thread-meta,
.settings-section {
	padding: var(--space-6);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-shadow);
}

.thread-pagination,
.message-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-6);
	align-items: center;
	margin-top: var(--space-7);
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.notifications-view {
	max-width: min(90vw, 48rem);
}

.notification-list {
	display: flex;
	flex-direction: column;
	gap: var(--list-gap);
}

.notification-item {
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-shadow);
	padding: var(--space-6);
}

.notification-item-unread {
	outline: var(--border-width-strong) solid var(--outline-strong);
}

.notification-title {
	margin: 0 0 var(--space-3) 0;
	font-size: var(--notification-title-size);
}

.notification-title a {
	color: inherit;
	text-decoration: none;
}

.notification-text,
.notification-meta {
	margin: 0 0 var(--space-2) 0;
	color: var(--meta-text);
}

.notification-count {
	color: var(--text-inverse);
	background: var(--bg-alert);
}

.notification-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-6);
	align-items: center;
	margin-top: var(--space-7);
}

/* ==========================================================================
   Settings
   ========================================================================== */

.settings-view {
	width: var(--window-default-width);
	max-width: var(--window-max-width);
}

.settings-section {
	padding: var(--space-7);
}

.settings-section h2 {
	margin-top: 0;
}

.currency-view {
	width: var(--window-default-width);
	max-width: var(--window-max-width);
}

.currency-balance {
	padding: var(--space-7);
	margin-bottom: var(--space-7);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-shadow);
}

.currency-balance h2 {
	margin: 0 0 var(--space-3) 0;
}

.currency-balance-amount {
	margin: 0;
	font-size: 1.4rem;
	font-weight: bold;
}

.currency-transaction-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
}

.currency-transaction-item {
	padding: var(--space-5);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background: var(--surface-muted-bg);
}

.currency-transaction-item p {
	margin: var(--space-2) 0 0 0;
	color: var(--meta-text);
	font-size: 0.92rem;
}

.currency-amount-positive {
	color: #126b27;
}

.currency-amount-negative {
	color: #9b1d1d;
}

.trades-view,
.collectibles-view,
.collectible-store-view {
	width: var(--window-default-width);
	max-width: var(--window-max-width);
}

.collectible-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
	gap: var(--space-6);
}

.collectible-card {
	display: grid;
	gap: var(--space-3);
	align-content: start;
	padding: var(--space-6);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-muted-bg);
	box-shadow: var(--surface-shadow);
}

.collectible-card h2,
.collectible-card p {
	margin: 0;
}

.collectible-card h2 {
	font-size: 1rem;
}

.collectible-slug {
	color: var(--meta-text);
}

.copy-text-button {
	margin-left: var(--space-3);
	padding: var(--space-1) var(--space-3);
	font: inherit;
}

.copy-text-button.is-copied {
	font-weight: bold;
}

.copy-text-button.is-copy-failed {
	color: #9b1d1d;
}

.content-preview {
	display: grid;
	gap: var(--space-3);
	margin-top: var(--space-5);
}

.content-preview h2 {
	margin: 0;
	font-size: 1rem;
}

.content-preview-body {
	min-height: 5rem;
	padding: var(--space-4);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-muted-bg);
	box-shadow: var(--surface-shadow);
}

.content-preview-body.is-loading {
	opacity: 0.7;
}

.content-preview-empty {
	margin: 0;
	color: var(--meta-text);
}

.content-item-picker {
	display: grid;
	gap: var(--space-3);
	margin-top: var(--space-5);
}

.content-item-picker h2 {
	margin: 0;
	font-size: 1rem;
}

.content-item-picker-empty {
	margin: 0;
	color: var(--meta-text);
}

.content-item-picker-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	gap: var(--space-3);
	max-height: 13rem;
	overflow-y: auto;
	padding: var(--space-3);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-muted-bg);
	box-shadow: var(--surface-shadow);
}

.content-item-picker-button {
	display: grid;
	grid-template-columns: 2rem minmax(0, 1fr) auto;
	gap: var(--space-3);
	align-items: center;
	min-width: 0;
	padding: var(--space-3);
	text-align: left;
}

.content-item-picker-button img,
.content-item-picker-button .avatar-preview {
	width: 2rem;
	height: 2rem;
}

.content-item-picker-button span,
.content-item-picker-button code {
	min-width: 0;
	overflow-wrap: anywhere;
}

.content-item-picker-button code {
	grid-column: 2 / -1;
	color: var(--meta-text);
}

.content-item-picker-button small {
	color: var(--meta-text);
}

.theme-choice-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: var(--space-6);
	margin-top: var(--space-7);
}

.theme-choice-card {
	display: grid;
	gap: var(--space-4);
	align-content: start;
	padding: var(--space-6);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-muted-bg);
	box-shadow: var(--surface-shadow);
	cursor: pointer;
}

.theme-choice-card:has(input:checked) {
	outline: var(--border-width-strong) solid var(--outline-strong);
}

.theme-choice-card input {
	margin: 0;
}

.theme-choice-card strong,
.theme-choice-card span {
	display: block;
}

.theme-choice-preview {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2px;
	width: 100%;
	height: 3.5rem;
	border: var(--border-width) solid var(--surface-border);
	border-radius: calc(var(--surface-radius) * 0.8);
	background: var(--preview-bg);
}

.theme-choice-preview span:first-child {
	grid-column: 1 / -1;
	background: var(--preview-border);
}

.theme-choice-preview span:nth-child(2) {
	background: var(--preview-surface);
}

.theme-choice-preview span:nth-child(3) {
	background: var(--preview-text);
}

[data-theme-preview="classic"] {
	--preview-bg: #ffffff;
	--preview-surface: #ffffff;
	--preview-text: #000000;
	--preview-border: #000000;
}

[data-theme-preview="naero"] {
	--preview-bg: #7fb0db;
	--preview-surface: rgba(244, 250, 255, 0.82);
	--preview-text: #0d3258;
	--preview-border: #86b1d7;
}

/* ==========================================================================
   Messages
   ========================================================================== */

.inbox-view,
.sent-view,
.message-view {
	width: var(--window-default-width);
	max-width: var(--window-max-width);
}

.joba-content .directory-view,
.joba-content .threads-view,
.joba-content .create-thread-view,
.joba-content .thread-view,
.joba-content .thread-reply-view,
.joba-content .games-view,
.joba-content .leaderboards-view,
.joba-content .settings-view,
.joba-content .currency-view,
.joba-content .trades-view,
.joba-content .collectibles-view,
.joba-content .collectible-store-view,
.joba-content .inbox-view,
.joba-content .sent-view,
.joba-content .message-view {
	box-sizing: border-box;
	width: 100%;
}

/* Message lists */
.message-list {
	display: flex;
	flex-direction: column;
	gap: var(--list-gap);
	margin-top: var(--space-7);
}

.message-list-item {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--space-6);
	align-items: start;
	padding: var(--space-6);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-shadow);
}

.message-list-avatar a,
.message-party-avatar a {
	display: inline-block;
	text-decoration: none;
}

.message-list-main {
	min-width: 0;
}

.message-list-subject {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.2;
}

.message-list-subject a {
	color: inherit;
	text-decoration: none;
}

.message-list-subject a:hover {
	text-decoration: underline;
}

.message-list-meta {
	margin-top: var(--space-3);
	color: var(--meta-text);
}

.message-list-date {
	margin-top: var(--space-2);
	font-size: 0.92rem;
	color: var(--meta-text);
}

/* Single message */
.message-card {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--space-7);
	align-items: start;
	padding: var(--space-6);
	border: var(--border-width) solid var(--surface-border);
	border-radius: var(--surface-radius);
	background:
		var(--surface-highlight),
		var(--surface-raised-bg);
	box-shadow: var(--surface-strong-shadow);
	margin-top: var(--space-7);
}

.message-card-avatar a {
	display: inline-block;
	text-decoration: none;
}

.message-card-main {
	min-width: 0;
}

.message-card-header {
	margin-bottom: var(--space-7);
	padding: var(--space-5);
	border: var(--border-width) solid var(--panel-header-border);
	border-radius: calc(var(--surface-radius) * 0.85);
	background: var(--panel-header-bg);
}

.message-card-subject {
	margin: 0 0 var(--space-4) 0;
	line-height: 1.15;
}

.message-card-user {
	margin: 0 0 var(--space-2) 0;
}

.message-card-label {
	font-weight: bold;
}

.message-card-date {
	margin: 0;
	font-size: 0.92rem;
	color: var(--meta-text);
}

.message-card-body {
	padding: var(--space-6);
	border: var(--border-width) solid var(--panel-header-border);
	border-radius: calc(var(--surface-radius) * 0.85);
	background: var(--surface-muted-bg);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.message-card-body .user-content-text {
	color: var(--text-color);
}

#compose_body,
#create_thread_body,
[data-thread-reply-body] {
	font-family: var(--font-mono);
	line-height: var(--line-height-tight);
	white-space: pre;
	overflow: auto;
	tab-size: 4;
	-moz-tab-size: 4;
}

@media (max-width: 799px) {
	.message-card {
		grid-template-columns: 1fr;
		gap: var(--space-5);
		padding: var(--space-4);
	}

	.message-card-avatar {
		justify-self: start;
	}

	.message-card-header,
	.message-card-body {
		padding: var(--space-4);
	}

	.message-card-subject {
		font-size: 1rem;
		overflow-wrap: anywhere;
	}

	.message-card-body .user-content-text {
		font-size: 0.88rem;
		white-space: pre-wrap;
		overflow-wrap: anywhere;
		word-break: break-word;
		min-width: 0;
	}
}

.message-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-6);
	margin-top: var(--space-7);
}

@media (max-width: 799px) {
	.message-list-item,
	.message-party {
		grid-template-columns: 1fr;
	}

	.message-list-avatar,
	.message-party-avatar {
		justify-self: start;
	}
}

/* ==========================================================================
   Mobile layout
   ========================================================================== */

@media (max-width: 799px) {
	.profile-view,
	.directory-view,
	.inbox-view,
	.sent-view,
	.message-view,
	.compose-view,
	.edit-profile-view,
	.edit-avatar-view,
	.threads-view,
	.create-thread-view,
	.thread-view,
	.thread-reply-view,
	.leaderboards-view,
	.currency-view,
	.trades-view,
	.collectibles-view,
	.collectible-store-view,
	.notifications-view,
	.settings-view {
		min-width: 0;
		max-width: 100%;
	}

	.profile-layout {
		grid-template-columns: 1fr;
		gap: var(--space-6);
	}

	.profile-sidebar {
		order: 1;
	}

	.profile-main {
		order: 2;
		min-width: 0;
	}

	.profile-content-card {
		padding: 0.4rem;
		min-height: var(--profile-content-min-height-mobile);
	}

	.profile-text-scroll,
	.user-content-scroll {
		max-width: 100%;
		overflow-x: auto;
		overflow-y: auto;
	}

	.profile-text,
	.user-content-text {
		font-size: 0.95rem;
	}

	.profile-text,
	.profile-text .user-content-text {
		font-size: 0.88rem;
		white-space: pre;
		overflow-wrap: normal;
		word-break: normal;
		min-width: max-content;
	}

	.directory-item,
	.thread-post,
	.message-list-item,
	.message-party {
		grid-template-columns: 1fr;
	}

	.trade-request-columns {
		grid-template-columns: 1fr;
	}

	.thread-post {
		gap: var(--space-5);
		padding: var(--space-4);
	}

	.thread-post-meta {
		font-size: 0.88rem;
		overflow-wrap: anywhere;
	}

	.thread-post-body .user-content-text {
		font-size: 0.88rem;
		white-space: pre-wrap;
		overflow-wrap: anywhere;
		word-break: break-word;
		min-width: 0;
	}

	.profile-text,
	.thread-post-body,
	.message-card-body {
		--user-content-item-width: 6ch;
		--user-content-item-height: 3lh;
	}

	.profile-text,
	.profile-text .user-content-text,
	.profile-text .collectible-reference-line,
	.thread-post-body .collectible-reference-line,
	.message-card-body .collectible-reference-line {
		width: 80ch;
		max-width: 100%;
		min-width: 0;
		white-space: pre;
		overflow-wrap: normal;
		word-break: normal;
	}

	.profile-text .collectible-reference,
	.profile-text .avatar-preview,
	.thread-post-body .collectible-reference,
	.thread-post-body .avatar-preview,
	.message-card-body .collectible-reference,
	.message-card-body .avatar-preview {
		width: var(--user-content-item-width);
		height: var(--user-content-item-height);
		flex: 0 0 var(--user-content-item-width);
	}

	.profile-text .avatar-reference .avatar-preview,
	.thread-post-body .avatar-reference .avatar-preview,
	.message-card-body .avatar-reference .avatar-preview {
		width: 100%;
		height: 100%;
		flex: 0 0 100%;
	}

	.profile-text .collectible-reference img,
	.thread-post-body .collectible-reference img,
	.message-card-body .collectible-reference img {
		width: var(--user-content-item-width);
		height: var(--user-content-item-height);
		flex: 0 0 var(--user-content-item-width);
	}

	.profile-text .avatar-preview .profile-avatar,
	.thread-post-body .avatar-preview .profile-avatar,
	.message-card-body .avatar-preview .profile-avatar {
		grid-template-columns: repeat(16, 1fr) !important;
		grid-template-rows: repeat(16, 1fr) !important;
		width: 100% !important;
		height: 100% !important;
	}

	.profile-text .avatar-preview .profile-avatar > div,
	.thread-post-body .avatar-preview .profile-avatar > div,
	.message-card-body .avatar-preview .profile-avatar > div {
		width: auto !important;
		height: auto !important;
	}

	.profile-text .collectible-reference-line,
	.thread-post-body .collectible-reference-line,
	.message-card-body .collectible-reference-line {
		display: block;
		width: var(--user-content-item-width);
		height: var(--user-content-item-height);
		line-height: var(--line-height-tight);
		min-height: var(--user-content-item-height);
	}

	.thread-post-body .user-content-text {
		white-space: pre-wrap;
		overflow-wrap: anywhere;
		word-break: break-word;
	}

	.directory-avatar-link,
	.thread-post-avatar,
	.message-list-avatar,
	.message-party-avatar {
		justify-self: start;
	}
}
