		:root {
			color-scheme: light;
			--bg: #ffd9ec;
			--post-bg: #fff5fb;
			--post-border: #f2a7cf;
			--pending-bg: rgba(255, 183, 216, 0.25);
			--name-color: #0a0;
			--subject-color: #c2185b;
			--board-title: #d81b7f;
		/* Every filled button on the site (post submits, .btn, the error pages'
		   back button, …) keeps this color in both themes: it is defined once
		   here and never redefined in .dark, so buttons never turn light pink
		   against the dark background */
		--submit-bg: #d81b7f;
			--banner-bg: #ff9ec7;
			--link: #ad1457;
			--meta: #8a5a74;
			--error: #b00;
			--message: #080;
			--greentext: #0a0;
			--post-ref: #8b0000;
			--toggle-bg: rgba(0, 0, 0, 0.15);
			/* the color browsers paint native form controls (checkboxes, range
			   thumbs) with, so they follow the theme without per-control styling */
			accent-color: var(--submit-bg);
			/* keyboard focus ring color, matching the theme in both modes */
			--focus-ring: rgba(216, 27, 127, 0.55);
		}
		.dark { --focus-ring: rgba(255, 158, 199, 0.6); }
		/* themed text selection in both modes */
		::selection { background: var(--submit-bg); color: #fff; }
		/* keyboard focus is drawn as a themed ring instead of the browser default;
		   pointer interactions keep their hover styles without a ring */
		:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
		/* post anchors (#p123) keep a little clearance after an in-page jump */
		.op, .post { scroll-margin-top: 0.75rem; }
		/* small board switcher, shown only when there is more than one board;
		   static (in normal flow) like the board name below it */
		/* Board list is left-aligned (as before) and stays in normal flow — it scrolls
		   away with the page instead of being pinned/sticky. */
		.boardlist { width: fit-content; margin: 0 0 0.75rem; text-align: left;
			background: var(--toggle-bg); color: var(--fg); font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; }
		.boardlist a { color: var(--link); text-decoration: none; }
		.boardlist a:hover { text-decoration: underline; }
		/* landing-page top actions: the RSS/Rules buttons centred at the very top of the page,
		   above the board tiles */
		.page-actions { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 0.75rem; }
		/* the RSS/Rules buttons are slightly smaller variants of the shared .btn
		   (whose background is --submit-bg, the submit-button pink, in both themes) */
		.page-actions .btn { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

		/* landing page: responsive grid of board cards (mascot, name and /id/).
			The layout is chosen by the board count, emitted as a modifier class
			from the template:
			  --single  1 board  -> one large centred card
			  --two     2 boards -> two cards on one row
			  --three   3 boards -> three cards on one row (sized to fit)
			  --four    4 boards -> a 2x2 grid
			  --many    5 boards -> three cards per row, and a last row holding
			             fewer than three cards is centred (flexbox wraps and
			             centres every line, which a plain grid cannot do) */
		.board-grid { display: grid; margin-top: 1rem; justify-content: center; gap: 1rem; }
		.board-grid--single { grid-template-columns: minmax(280px, 400px); }
		.board-grid--two    { grid-template-columns: repeat(2, minmax(240px, 340px)); gap: 1.5rem; }
		.board-grid--three  { grid-template-columns: repeat(3, minmax(220px, 300px)); }
		.board-grid--four   { grid-template-columns: repeat(2, minmax(240px, 340px)); gap: 1.25rem; }
		/* five or more boards: at most three cards per row (the max-width caps
		   the rows) and every wrapped line — a short last row included — is
		   centred by the flex line packing */
		.board-grid--many {
			display: flex; flex-wrap: wrap; justify-content: center;
			gap: 0.75rem;
			max-width: calc(3 * 280px + 2 * 0.75rem);
			margin-inline: auto;
		}
		.board-grid--many .board-card { flex: 0 1 280px; min-width: 200px; }
		/* narrow screens: the fixed multi-column rows need more width than a
		   phone has (three columns want ~700px), so they collapse to a single
		   centred column, exactly like a single board */
		@media (max-width: 700px) {
			.board-grid--two, .board-grid--three, .board-grid--four {
				grid-template-columns: minmax(280px, 400px);
				gap: 1rem;
			}
		}
		.board-card {
			display: flex; flex-direction: column;
			background: var(--post-bg); border: 1px solid var(--post-border); border-radius: 12px;
			overflow: hidden; text-decoration: none; color: inherit;
			transition: transform 0.15s ease, box-shadow 0.15s ease;
		}
		.board-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
		.board-card-mascot {
			display: flex; align-items: center; justify-content: center;
			aspect-ratio: 4 / 3; background: var(--toggle-bg); padding: 0.75rem;
			position: relative;
		}
		/* The mascot is taken out of the flow and stretched over the fixed 4:3
		   box (object-fit letterboxes it inside): with position: absolute the
		   percentages resolve against the box's aspect-ratio-derived size, which
		   is definite — Chromium instead resolves percentage heights of in-flow
		   replaced children against their own intrinsic size, so even
		   width/height: 100% left tall pictures blowing the 4:3 box open there
		   (a headless-Chromium smoke test measures the rendered boxes:
		   scripts/smoke_thread_cards.py). */
		.board-card-mascot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
		.board-card-placeholder { font-size: 3.5rem; opacity: 0.8; }
		.board-card-name { font-weight: bold; padding: 0.6rem 0.75rem 0; color: var(--board-title); overflow-wrap: anywhere; }
		.board-card-id { padding: 0 0.75rem 0.75rem; color: var(--meta); font-size: 0.85em; }

		/* landing page: responsive grid of recent-thread cards (image, subject and meta).
			Same count-based sizing as the board grid:
			  --single  one thread   -> one large centred card
			  --few     few threads  -> big cards with wide gaps
			  --many    many threads -> smaller cards with thin gaps */
		.thread-grid { display: grid; margin-top: 1rem; justify-content: center; gap: 1rem; }
		/* thread cards stay smaller than the board cards above so those dominate */
		.thread-grid--single { grid-template-columns: minmax(240px, 320px); }
		.thread-grid--few    { grid-template-columns: repeat(auto-fill, minmax(220px, 300px)); gap: 1.25rem; }
		.thread-grid--many   { grid-template-columns: repeat(auto-fill, minmax(180px, 240px)); gap: 0.6rem; }
		/* narrow screens: the columns collapse into a single row and the small
		   capped cards end up centred with wide gaps on the sides, so let the
		   cards grow to fill the available width, but keep generous side
		   margins so they don't run edge to edge */
		@media (max-width: 700px) {
			.thread-grid--single, .thread-grid--few, .thread-grid--many {
				grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), calc(100% - 5rem)));
			}
		}
		.thread-card {
			display: flex; flex-direction: column;
			background: var(--post-bg); border: 1px solid var(--post-border); border-radius: 12px;
			overflow: hidden; text-decoration: none; color: inherit;
			transition: transform 0.15s ease, box-shadow 0.15s ease;
		}
		.thread-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }
		.thread-card-image {
			display: flex; align-items: center; justify-content: center;
			aspect-ratio: 4 / 3; background: var(--toggle-bg); padding: 0.75rem;
			position: relative;
		}
		/* The thumbnail is taken out of the flow and stretched over the card's
		   fixed 4:3 image box (object-fit letterboxes it inside): with
		   position: absolute the percentages resolve against the box's
		   aspect-ratio-derived size, which is definite — Chromium instead
		   resolves percentage heights of in-flow replaced children against
		   their own intrinsic size, so even width/height: 100% left every
		   thumbnail at a different size there (measured by the smoke test in
		   scripts/smoke_thread_cards.py; same fix the mascots carry). */
		.thread-card-image img, .thread-card-image video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
		.thread-card-placeholder { font-size: 3.5rem; opacity: 0.8; }
		/* the subject stays on one line; text that would not fit is cut and
		   ends in three dots so it is clear the card shows a truncated subject */
		.thread-card-subject { font-weight: bold; padding: 0.6rem 0.75rem 0; color: var(--board-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
		.thread-card-meta { padding: 0 0.75rem 0.75rem; color: var(--meta); font-size: 0.85em; }

		/* landing page empty state: shown instead of the grid when no boards exist */
		.board-empty {
			display: flex; flex-direction: column; align-items: center; justify-content: center;
			text-align: center; gap: 0.5rem; padding: 4rem 1rem;
		}
		.board-empty-icon { font-size: 5rem; opacity: 0.7; }
		.board-empty-text { font-size: 1.6em; font-weight: bold; color: var(--board-title); margin: 0; }
		.board-empty-hint { color: var(--meta); font-size: 0.95em; margin: 0; }

		/* recently updated threads section on the home page */
		.recent-threads { margin-top: 1.25rem; }
		/* centered IRC invite, shown above the recent-threads section on the home page */
		.irc-invite {
			display: block;
			width: fit-content;
			margin: 1.25rem auto 0;
			text-align: center;
			font-weight: bold;
			background: var(--banner-bg);
			border-radius: 999px;
			padding: 0.45rem 1.1rem;
		}
		.irc-invite a { color: var(--link); }
		.recent-threads-title { font-size: 1.3em; color: var(--board-title); margin: 0 0 0.5rem; text-align: center; }
		.recent-threads-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
		.recent-threads-list li a { font-weight: bold; }

		/* moon/sun button in the top right corner that switches light/dark theme;
		   the choice is remembered in localStorage and overrides the system theme */
		.theme-toggle {
			position: fixed;
			top: 0.75rem;
			right: 0.75rem;
			z-index: 30;
			font-size: 1.1em;
			line-height: 1;
			padding: 6px 9px;
			border-radius: 8px;
			border: 1px solid var(--post-border);
			background: var(--toggle-bg);
			color: #fff;
			text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
			cursor: pointer;
			box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
		}
		.theme-toggle:hover { transform: translateY(-1px) scale(1.08); }

		/* dark theme: the same cute pink/broccoli look tuned for dark backgrounds,
		   activated by the script in <head> when the system uses a dark color scheme */
		.dark {
			color-scheme: dark;
			--bg: #241019;
			--post-bg: #33182a;
			--post-border: #6d3f57;
			--pending-bg: rgba(255, 149, 197, 0.15);
			--name-color: #5f5;
			--subject-color: #ff8fc2;
			--board-title: #ff9ec7;
			--banner-bg: #4a1f38;
			--link: #ff9ec7;
			--meta: #c9a0b6;
			--error: #f77;
			--message: #5d5;
			--greentext: #5f5;
			--post-ref: #ff7b7b;
			/* the toggle button sits darker than the page background in dark mode */
			--toggle-bg: #140a0f;
		}
		.dark body { color: #f2e4ee; }
		body {
			background-color: var(--bg);
			/* subtle broccoli decorations */
			background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Ctext x='24' y='88' font-size='40' opacity='0.15'%3E%F0%9F%A5%A6%3C/text%3E%3C/svg%3E");
			color: #000;
			/* modern monospace stack: the platform's own mono face first, the
			   bundled bitmap-ish fallbacks after, so every OS gets a crisp look */
			font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", "Liberation Mono", Menlo, Consolas, monospace;
			font-size: 13px;
			line-height: 1.45;
			max-width: 960px;
			margin: 0 auto;
			padding: 0.5rem 1rem 2rem;
			/* iOS Safari must not inflate the text on rotation */
			-webkit-text-size-adjust: 100%;
			text-size-adjust: 100%;
		}
		a { color: var(--link); }
		h1.board-title {
			flex: 1;
			color: var(--board-title);
			text-align: center;
			font-size: 1.8em;
			margin: 0.5rem 0;
		}
		h1.board-title::before { content: "🥦 "; }
		h1.board-title::after { content: " 🥦"; }
		/* board header row: the title stays centred under the page-banner while the
		   "back to home" link is pinned to the left edge of the same row */
		.board-header {
			position: relative;
			text-align: center;
		}
		.back-home {
			position: absolute;
			left: 0;
			top: 50%;
			transform: translateY(-50%);
			white-space: nowrap;
			font-weight: bold;
			color: var(--link);
			text-decoration: none;
		}
		.back-home:hover { text-decoration: underline; }
		/* small admin banner shown at the top of board and thread pages: the
		   pages embed its small thumbnail, clickable to enlarge in a lightbox */
		a.page-banner-link { display: block; }
		.page-banner {
			display: block;
			max-height: 96px;
			width: auto;
			max-width: 100%;
			margin: 0 auto 1rem;
			border-radius: 6px;
		}
		.posting-banner {
			background: var(--banner-bg);
			border-radius: 8px;
			padding: 4px 8px;
			text-align: center;
			font-weight: bold;
			margin-bottom: 1rem;
		}
		table.posts { width: 100%; border-collapse: collapse; margin: 1rem 0; }
		table.posts th, table.posts td { border: 1px solid #999; padding: 4px 8px; text-align: left; vertical-align: top; }
		table.posts th { background: rgba(128, 128, 128, 0.15); }
		.post {
			background: var(--post-bg);
			border: 1px solid var(--post-border);
			border-radius: 10px;
			padding: 6px 8px;
			margin-bottom: 0.75rem;
		}
		/* contain floated attachments so the box grows around them */
		.post, .thread { display: flow-root; }
		/* board page: separate threads with a line and a little breathing room */
		.thread + .thread { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 2px solid var(--post-border); }
		/* thread page: the posts area is the flow the opening post's floated
		   attachment escapes into, so the first reply cards wrap around it — to
		   the right of the image first, full width once past its height — exactly
		   like the board page's recent replies; the flow-root keeps the float
		   from leaking into the admin bar or reply form below */
		#posts { display: flow-root; }
		/* thread page: the opening post block — plain (card-less) like the board
		   page's OP, and deliberately NOT a formatting context of its own, which
		   is what lets its floated image displace the reply cards beside it */
		.op { margin-bottom: 0.75rem; }
		.meta { color: var(--meta); font-size: 0.9em; }
		.meta .name { color: var(--name-color); font-weight: bold; }
		.meta .name.sage-name { color: #4a6cf7; }
		/* posts made while logged in as an admin get a red name (overrides sage) */
		.meta .name.admin-name { color: #d9534f; }
		.dark .meta .name.admin-name { color: #ff7b7b; }

		.meta .post-id { font-size: 0.85em; opacity: 0.6; text-decoration: none; }
		.meta .post-id:hover { opacity: 1; text-decoration: underline; }
		.subject { color: var(--subject-color); font-weight: bold; }
		img.post-image, video.post-image { max-width: 320px; max-height: 320px; float: left; margin: 0 8px 4px 0; border-radius: 8px; }
		img.post-image { cursor: zoom-in; }
		video.post-image { background: #000; cursor: pointer; }

		/* download-only attachments (archives, PDFs, torrents, SVG, …): a small
		   icon card with the file name and size — never inlined, always a link */
		.file-card {
			float: left;
			margin: 0 8px 4px 0;
			max-width: 320px;
			display: flex;
			align-items: center;
			gap: 0.6em;
			padding: 0.55em 0.8em;
			background: var(--post-bg);
			border: 1px solid var(--post-border);
			border-radius: 8px;
		}
		.file-card-icon { font-size: 1.8em; line-height: 1; }
		.file-card-text { display: flex; flex-direction: column; min-width: 0; }
		.file-card-name { color: var(--link); overflow-wrap: anywhere; }
		.file-card-name:hover { text-decoration: underline; }
		.file-card-size { color: var(--meta); font-size: 0.85em; }
		/* inline audio players sit below their file card like the fileinfo line */
		audio.post-audio {
			float: left;
			clear: none;
			margin: 0 8px 4px 0;
			max-width: 320px;
			width: 280px;
			height: 2.2em;
			border-radius: 8px;
		}
		/* recent-thread cards whose OP carries a non-previewable attachment
		   (audio or download-only file) show its emoji instead of a picture */
		.thread-card-fileicon { font-size: 64px; line-height: 1; opacity: 0.7; }

		/* click-to-enlarge overlay (no JS needed); clicking the enlarged image or the backdrop closes it */
		.lightbox { display: none; position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.75); text-align: center; }
		/* frosty backdrop where supported: the page behind the enlarged media
		   blurs instead of only dimming (the rgba above stays as the fallback) */
		@supports (backdrop-filter: blur(2px)) {
			.lightbox { backdrop-filter: blur(3px); background: rgba(24, 8, 18, 0.55); }
		}
		.lightbox:target { display: block; }
		.lightbox-backdrop { position: absolute; inset: 0; display: block; cursor: zoom-out; }
		.lightbox-img { position: relative; z-index: 1; display: inline-block; margin-top: 4vh; }
		.lightbox img { max-width: 95vw; max-height: 92vh; border-radius: 6px; background: #fff; }
		.lightbox video { max-width: 95vw; max-height: 92vh; border-radius: 6px; background: #000; }
		.fileinfo { color: var(--meta); font-size: 0.9em; clear: none; margin-bottom: 4px; }
		/* attachments waiting for approval: a cute box matching the spoiler boxes */
		.pending-file {
			display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
			width: 96px; height: 96px; padding: 8px; box-sizing: border-box; float: left; margin: 0 8px 4px 0;
			background: linear-gradient(145deg, var(--banner-bg), #ffb8d9);
			border: 2px dashed var(--post-border); border-radius: 16px;
			color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
			font-size: 0.75em; line-height: 1.25; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
		}
		.pending-file::before { content: "⏳"; font-size: 1.8em; margin-bottom: 4px; }
		.dark .pending-file { background: linear-gradient(145deg, #4a1f38, #6d3f57); }
		/* the cute box shown in place of an attachment deleted by an admin */
		.deleted-file {
			display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
			width: 96px; height: 96px; padding: 8px; box-sizing: border-box; float: left; margin: 0 8px 4px 0;
			background: linear-gradient(145deg, #a58e9d, #7c6575);
			border: 2px dashed #6d5a67; border-radius: 16px;
			color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
			font-size: 0.8em; line-height: 1.25; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
		}
		.deleted-file::before { content: "\1f5d1\fe0f"; font-size: 1.8em; margin-bottom: 4px; }
		.dark .deleted-file { background: linear-gradient(145deg, #4a3a44, #2e2229); }
		/* a configured deleted-file placeholder image takes the post-image spot */
		img.deleted-image { max-width: 320px; max-height: 320px; float: left; margin: 0 8px 4px 0; border-radius: 8px; }
		/* the cute square box shown when no spoiler image is configured */
		.spoiler-box {
			display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
			width: 96px; height: 96px; padding: 8px; box-sizing: border-box;
			background: linear-gradient(145deg, var(--banner-bg), #ffb8d9);
			border: 2px dashed var(--post-border); border-radius: 16px;
			color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
			font-size: 0.8em; line-height: 1.25; cursor: pointer; user-select: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
		}
		.spoiler-box::before { content: "🥦"; font-size: 1.8em; margin-bottom: 4px; }
		.spoiler-box:hover, .spoiler-box:focus-visible { border-style: solid; transform: scale(1.05) rotate(-2deg); box-shadow: 0 4px 10px rgba(216, 27, 127, 0.35); outline: none; }
		.dark .spoiler-box { background: linear-gradient(145deg, #4a1f38, #6d3f57); }

		/* a spoiled attachment is wrapped so the cover can be clicked to reveal the real file */
		.spoiler-wrap { float: left; margin: 0 8px 4px 0; max-width: 100%; }
		.spoiler-wrap .spoiler-reveal { display: none; float: none; margin: 0; max-width: 320px; max-height: 320px; border-radius: 8px; cursor: pointer; }
		.spoiler-wrap.revealed > :not(.spoiler-reveal) { display: none; }
		.spoiler-wrap.revealed .spoiler-reveal { display: block; }

		/* a configured spoiler image acts as the clickable cover too */
		img.spoiler-image { max-width: 320px; max-height: 320px; border-radius: 8px; cursor: pointer; }
		.spoiler-wrap img.spoiler-image { float: none; margin: 0; }

		/* "Spoiler text" button that wraps the comment selection in [s]...[/s] */
		button.spoiler-text-btn { border: none; background: var(--toggle-bg); color: #fff; font-family: inherit; font-size: 0.85em; padding: 3px 10px; border-radius: 6px; cursor: pointer; }
		button.spoiler-text-btn:hover { background: var(--submit-bg); transform: translateY(-1px); }
		.fileinfo, .comment { overflow: hidden; }
		.comment { margin-top: 2px; }
		/* Spoiler text ([s]...[/s]): themed pill, revealed on click */
		.spoiler { background: linear-gradient(145deg, var(--banner-bg), #ffb8d9); color: transparent; padding: 0 4px; border-radius: 6px; cursor: pointer; user-select: none; transition: filter 0.15s ease; }
		.spoiler:hover { filter: brightness(1.06); }
		.spoiler.revealed { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
		.dark .spoiler { background: linear-gradient(145deg, #4a1f38, #6d3f57); }
		/* "Spoiler image" checkbox in the post forms */
		.spoiler-check { cursor: pointer; }
		.spoiler-check input { vertical-align: middle; margin-right: 4px; }
		/* captcha in the post forms — the question is split into two noisy SVG
		   halves; the right one starts displaced and the slider (below the image)
		   pushes it back until the question is readable. The pieces clip inside
		   the fixed-width frame, so the widget keeps the submit row compact */
		.captcha-widget { display: inline-flex; flex-direction: column; gap: 4px; vertical-align: middle; margin-right: 0.5rem; }
		.captcha-puzzle { display: flex; overflow: hidden; border: 1px solid var(--post-border); border-radius: 8px; background: #fdeef6; line-height: 0; vertical-align: middle; }
		.captcha-piece { display: block; height: 64px; }
		.captcha-piece.captcha-right { transform: translateX(calc(var(--shift, 0px))); transition: transform 0.05s linear; }
		.captcha-slider { width: 100%; margin: 0; accent-color: var(--submit-bg); }
		/* Keep the captcha answer box short (the answer is at most two digits) so it never
		   outgrows the comment textarea next to it. The doubled attribute selector keeps this
		   rule winning over the global `input[type=text]` width below. */
		input[type="text"][name="captcha"] { width: 5em; }
		/* the captcha answer box sits right of the Post button on the submit row */
		tr.form-submit-row input[type="text"][name="captcha"] { margin-left: 0.5rem; vertical-align: middle; }
		/* 4chan/vichan-style greentext for quoted lines */
		.greentext { color: var(--greentext); }
		/* post references like >#6 jump to the quoted post */
		.post-ref { color: var(--post-ref); font-weight: bold; text-decoration: none; }
		.post-ref:hover { text-decoration: underline; }
		.recent-replies { margin-top: 4px; padding-left: 1em; border-left: 3px solid var(--post-border); }
		/* reply previews are post-like boxes; the meta line links into the thread */
		a.reply { display: inline-block; text-decoration: none; border-radius: 4px; padding: 0 2px; }
		a.reply:hover { background: rgba(0, 0, 0, 0.05); }
		.dark a.reply:hover { background: rgba(255, 255, 255, 0.1); }
		button.post-submit { background: var(--submit-bg); color: #fff; border: none; font-family: inherit; font-size: 1.1em; padding: 0.5rem 1.4rem; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); cursor: pointer; }
		button.post-submit:hover { background: #b0126a; transform: translateY(-1px); }
		/* file browse button styled like the submit buttons; the native input is hidden inside */
		label.file-btn { position: relative; display: inline-block; background: var(--submit-bg); color: #fff; font-family: inherit; font-size: 1.1em; padding: 0.5rem 1.4rem; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); cursor: pointer; }
		label.file-btn:hover { background: #b0126a; transform: translateY(-1px); }
		label.file-btn:focus-within { box-shadow: 0 0 4px rgba(216, 27, 127, 0.5); }
		label.file-btn input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
		/* any form's file row (post forms' File cell and the admin upload forms)
		   lays out the choose-file button, drop area, chosen name and preview in
		   one wrapping row with even gaps; on narrow screens the drop area grows to
		   fill the space beside the compact button instead of being pushed out */
		.file-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
		/* shown under the drop area (own line on narrow screens) so it never shifts the layout */
		.file-name { vertical-align: middle; color: var(--meta); font-size: 0.9em; word-break: break-all; }
		/* drag-and-drop target next to the Choose file button; a dropped file is
		   assigned to the form's hidden file input and previewed as a miniature */
		.file-drop {
			display: inline-block;
			padding: 4px 12px;
			border: 2px dashed var(--post-border);
			border-radius: 8px;
			background: var(--pending-bg);
			color: var(--meta);
			font-size: 0.85em;
			text-align: center;
			vertical-align: middle;
			user-select: none;
		}
		.file-drop.drag-over { border-color: var(--submit-bg); background: rgba(216, 27, 127, 0.15); color: var(--subject-color); }
		/* miniature preview of the chosen/dropped attachment; the cross in its
		   top right corner removes the file from the form again */
		.file-preview { position: relative; display: inline-block; margin-left: 1.25rem; vertical-align: middle; }
		.file-preview img, .file-preview video { display: block; max-width: 130px; max-height: 130px; border-radius: 8px; background: #fff; }
		.file-preview-remove {
			position: absolute;
			top: -7px;
			right: -7px;
			width: 1.5em;
			height: 1.5em;
			padding: 0;
			border: none;
			border-radius: 50%;
			background: var(--error);
			color: #fff;
			font-size: 0.95em;
			line-height: 1.5em;
			text-align: center;
			cursor: pointer;
			box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
		}
		.file-preview-remove:hover { transform: scale(1.2); }

		/* admin area: card sections and shared button styles */
		.admin-section { background: var(--post-bg); border: 1px solid var(--post-border); border-radius: 10px; padding: 20px 24px; margin-bottom: 1.5rem; }
		.admin-section h2 { color: var(--board-title); margin: 0 0 1.25rem; font-size: 1.2em; }
		/* statistics: cards with the headline numbers, then the two charts */
		.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
		.stat-card {
			background: var(--pending-bg);
			border: 1px solid var(--post-border);
			border-radius: 10px;
			padding: 0.75rem 0.9rem;
			text-align: center;
		}
		.stat-card-value { font-size: 1.6em; font-weight: bold; color: var(--board-title); line-height: 1.1; overflow-wrap: anywhere; }
		.stat-card-label { color: var(--meta); font-size: 0.8em; margin-top: 0.25rem; }
		.stats-charts { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
		@media (min-width: 720px) {
			/* wide enough for both charts side by side */
			.stats-charts { grid-template-columns: 3fr 2fr; }
		}
		.stats-chart h3 { color: var(--subject-color); margin: 0 0 0.75rem; font-size: 1em; }
		.stats-chart h3 small { color: var(--meta); font-weight: normal; }
		.stats-empty { color: var(--meta); margin: 0; }
		/* vertical bar chart (posts per day): flexible columns of equal width */
		.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; }
		.bar-chart-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-width: 0; height: 100%; }
		.bar-chart-value { font-size: 0.75em; color: var(--meta); line-height: 1; }
		.bar-chart-bar {
			width: 100%;
			min-height: 3px;
			border-radius: 4px 4px 0 0;
			background: linear-gradient(180deg, var(--board-title), var(--submit-bg));
		}
		.dark .bar-chart-bar { background: linear-gradient(180deg, #ff9ec7, #b3568b); }
		.bar-chart-label { font-size: 0.7em; color: var(--meta); line-height: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
		/* horizontal bar chart (posts per board) */
		.hbar-chart { display: flex; flex-direction: column; gap: 0.5rem; }
		.hbar-row { display: flex; align-items: center; gap: 0.6rem; }
		.hbar-label { flex: 0 0 4.5em; color: var(--link); font-weight: bold; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
		.hbar-track { flex: 1 1 auto; height: 0.9em; background: var(--toggle-bg); border-radius: 999px; overflow: hidden; }
		.hbar-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--submit-bg), var(--board-title)); }
		.dark .hbar-bar { background: linear-gradient(90deg, #b3568b, #ff9ec7); }
		.hbar-value { flex: 0 0 auto; color: var(--meta); font-size: 0.85em; }
		/* admin forms get breathing room between labels, inputs and buttons */
		.admin-section form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0; }
		/* ...but the login form stacks vertically: its field table (Name and
		   Password share one label column, so the inputs line up) sits above
		   the Log in button */
		.admin-section form.login-form { flex-direction: column; align-items: flex-start; }
		.admin-section form label { display: inline-flex; align-items: center; gap: 0.6em; }
		.admin-section form input[type=text], .admin-section form input[type=password] { width: 14em; max-width: 100%; }
		.board-rename-form input[type=text] { width: 12em; }
		/* button rows (e.g. Save/Cancel under the edit-post table) wrap onto their own line */
		.admin-section form .form-actions { width: 100%; display: flex; flex-wrap: wrap; gap: 0.75rem; }
		.admin-section table.posts th, .admin-section table.posts td { padding: 9px 12px; }
		.admin-section table.form th, .admin-section table.form td { padding: 4px 8px 4px 0; }
		/* boards table in the admin area: roomy cells, status tags and one row of actions */
		.board-table td { padding-top: 12px; padding-bottom: 12px; }
		.board-status-cell .board-hidden-tag,
		.board-status-cell .board-locked-tag { margin-right: 0.3rem; }
		.board-status-none { opacity: 0.5; }
		.board-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
		.board-actions form { margin: 0; }

		/* board mascot preview + upload form in the admin boards table */
		.mascot-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; max-width: 14em; }
		.mascot-preview,
		.mascot-placeholder {
			width: 3.5em;
			height: 3.5em;
			object-fit: contain;
			border-radius: 8px;
			background: rgba(255, 255, 255, 0.6);
		}
		.dark .mascot-preview,
		.dark .mascot-placeholder { background: rgba(255, 255, 255, 0.1); }
		/* pending image preview in the admin approval table */
		.pending-preview-media { display: block; width: 5em; height: 5em; object-fit: contain; border-radius: 8px; background: rgba(255, 255, 255, 0.6); }
		.dark .pending-preview-media { background: rgba(255, 255, 255, 0.1); }
		/* board rules page */
		.rules-page { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }
		/* the rules sit inside a card like the replies in threads (.post),
		   with a little more padding to breathe on their own page */
		.rules-card { padding: 1rem 1.25rem; }
		.rules-list { margin: 0; padding-left: 1.5rem; line-height: 1.6; }
		/* abuse-report contact line under the rules card's list */
		.rules-contact { margin: 0.75rem 0 0; color: var(--meta); font-size: 0.9em; }
		.rules-contact a { font-weight: bold; }
		.rules-list li { margin: 0.5rem 0; }
		.rules-back { text-align: center; margin-top: 1.5rem; }
		.mascot-placeholder {
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 1.4rem;
		}
		.mascot-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; }
		/* visibility toggle in the admin boards table */
		.board-hidden-tag { display: inline-block; background: rgba(0, 0, 0, 0.12); color: var(--meta); border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.8em; margin-right: 0.5rem; vertical-align: middle; }
		.dark .board-hidden-tag { background: rgba(255, 255, 255, 0.14); }
		.board-locked-tag { display: inline-block; background: rgba(214, 158, 46, 0.22); color: #b07d1e; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.8em; margin-right: 0.5rem; vertical-align: middle; }
		.dark .board-locked-tag { background: rgba(214, 158, 46, 0.3); color: #e6b95c; }
		.thread-sticky-tag { display: inline-block; background: rgba(74, 144, 217, 0.22); color: #3a6ea8; border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.8em; margin-right: 0.5rem; vertical-align: middle; }
		.dark .thread-sticky-tag { background: rgba(74, 144, 217, 0.3); color: #9cc3f0; }
		/* banner upload + preview grid in the admin page */
		.banner-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
		.banner-item { position: relative; margin: 0; background: rgba(0, 0, 0, 0.05); border-radius: 8px; padding: 4px; }
		.banner-item img { display: block; width: 160px; height: 60px; object-fit: cover; border-radius: 6px; background: #fff; }
		.banner-item form { position: absolute; top: -8px; right: -8px; margin: 0; }
		.btn { display: inline-block; background: var(--submit-bg); color: #fff; border: none; font-family: inherit; padding: 0.55rem 1.3rem; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); cursor: pointer; text-decoration: none; }
		.btn:hover { background: #b0126a; transform: translateY(-1px); }
		.btn.small { font-size: 0.9em; padding: 0.4rem 0.9rem; }
		.btn.ghost { background: transparent; color: var(--link); box-shadow: none; border: 1px solid var(--post-border); }
		.btn.ghost:hover { background: rgba(0, 0, 0, 0.06); transform: none; }
		.dark .btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }
		.btn.danger { background: #c0392b; }
		.btn.danger:hover { background: #a93226; }
		.thread-admin-bar { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
		/* move-thread form in the thread page's admin bar */
		.thread-move-form { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--meta); font-size: 0.9em; }
		.thread-move-form select { font-family: inherit; font-size: 1em; padding: 0.3rem 0.4rem; border: 1px solid var(--post-border); border-radius: 6px; background: var(--post-bg); color: inherit; }
		.thread-locked-note { color: var(--meta); background: var(--post-bg); border: 1px solid var(--post-border); border-radius: 8px; padding: 0.6rem 0.9rem; margin-bottom: 1rem; }
		form.posting { background: var(--post-bg); border: 1px solid var(--post-border); border-radius: 8px; padding: 8px; margin-bottom: 1rem; }
		form.post-form { margin-bottom: 0.75rem; }
		table.form th, table.form td { text-align: left; vertical-align: top; padding: 2px 6px 2px 0; }
		/* the submit button sits on its own row under the comment box, aligned with the textarea's start */
		table.form tr.form-submit-row td { padding-top: 8px; }
		input[type=text], textarea { font-family: inherit; width: 32em; max-width: 100%; }
		button.delete-btn { border: none; background: none; color: var(--error); font-size: 1.1em; cursor: pointer; padding: 0 4px; }
		a.edit-btn { color: var(--meta); font-size: 0.9em; }
		button.approve-btn { border: none; background: none; color: var(--board-title); font-size: 0.9em; cursor: pointer; padding: 0 2px; text-decoration: underline; }
		.error { color: var(--error); margin: 0.5rem 0; }
		.message { color: var(--message); margin: 0.5rem 0; }

		/* themed error pages */
		.error-page {
			max-width: 420px;
			margin: 12vh auto 0;
			text-align: center;
			background: var(--post-bg);
			border: 1px solid var(--post-border);
			border-radius: 12px;
			padding: 2rem 2.5rem;
			box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
		}
		.error-code { font-size: 3.5em; font-weight: bold; color: var(--board-title); line-height: 1; margin-bottom: 0.75rem; }
		.error-title { margin: 0 0 0.25rem; color: #4a0e2f; font-size: 1.3em; }
		.dark .error-title { color: #ffb8d9; }
		.error-message { margin: 0.5rem 0 1.25rem; color: var(--meta); }
		.error-back {
			display: inline-block;
			background: var(--submit-bg);
			color: #fff;
			text-decoration: none;
			padding: 0.6rem 1.4rem;
			border-radius: 8px;
			font-weight: bold;
			box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
		}
		.error-back:hover { background: #b0126a; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); }

		/* animations (opacity only, so fixed-position lightboxes keep working) */
		@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
		.post, form.posting { animation: fade-in 0.4s ease both; }
		#posts .post:nth-child(2) { animation-delay: 0.06s; }
		#posts .post:nth-child(3) { animation-delay: 0.12s; }
		#posts .post:nth-child(4) { animation-delay: 0.18s; }
		#posts .post:nth-child(n+5) { animation-delay: 0.24s; }
		a, button, input, textarea { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
		.post:hover { border-color: var(--board-title); box-shadow: 0 2px 8px rgba(216, 27, 127, 0.25); }
		button.delete-btn:hover { color: #f00; transform: scale(1.25); }
		button.approve-btn:hover { color: #b0126a; }
		input[type=text]:focus, textarea:focus { border-color: var(--board-title); box-shadow: 0 0 4px rgba(216, 27, 127, 0.4); outline: none; }

		/* responsive layout */
		@media (max-width: 640px) {
			body { font-size: 12px; padding: 0.25rem 0.5rem 1.5rem; }
			h1.board-title { font-size: 1.4em; }
			input[type=text], textarea { width: 100%; box-sizing: border-box; }
			button.post-submit { width: 100%; box-sizing: border-box; }
			/* comfortable touch targets: the theme toggle grows beyond the usual
			   44px recommendation for fingertip use, and board links gain padding */
			.theme-toggle { padding: 10px 14px; font-size: 1.25em; }
			.boardlist a { padding: 4px 6px; margin: -4px -2px; border-radius: 6px; }
			.boardlist a:active { background: var(--submit-bg); color: #fff; }
			/* the Choose file button keeps its compact size and shares the row with
		   the drop area, which grows to fill the remaining width beside it; a long
		   chosen file name wraps onto a full line of its own */
			.file-cell .file-drop { flex: 1 1 9em; }
			.file-cell .file-name { flex-basis: 100%; }
			.file-preview { margin-left: 0; }
			img.post-image, video.post-image { float: none; display: block; max-width: 100%; margin: 4px 0; }
			.file-card, audio.post-audio { float: none; max-width: 100%; margin: 4px 0; }
			.spoiler-wrap { float: none; margin: 4px 0; }
			.spoiler-wrap img.spoiler-image { max-width: 100%; }
			.spoiler-box, .pending-file { width: 100%; height: auto; aspect-ratio: 1 / 1; }
			table.posts, table.posts tbody, table.posts tr { display: block; }
			table.posts thead { display: none; }
			table.posts td { border: none; padding: 2px 8px; }
		}

		@media (prefers-reduced-motion: reduce) {
			*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
			/* anchor jumps become instant jumps again */
			html { scroll-behavior: auto; }
		}
		/* smooth in-page jumps (post links, back-to-post) for everyone else */
		@media (prefers-reduced-motion: no-preference) {
			html { scroll-behavior: smooth; }
		}

		/* live comment preview (board post form, thread reply form, admin edit) */
		.comment-preview { margin-top: 4px; padding: 6px 8px; border-left: 3px solid var(--post-border); background: var(--pending-bg); border-radius: 0 6px 6px 0; font-size: 0.95em; }
		.comment-preview[hidden] { display: none; }

		/* external video embeds (YouTube, Bilibili): a responsive 16:9 frame */
		.video-embed { position: relative; width: 100%; max-width: 560px; aspect-ratio: 16 / 9; margin: 4px 0; }
		.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; background: #000; }

		/* easter egg: a small bee that flies across the page, spawned by the
		   script below on 10% of visits */
		.flying-bee {
			position: fixed;
			/* fallback height; the spawn script below picks a random top per visit */
			top: 18%;
			left: 0;
			z-index: 40;
			font-size: 2rem;
			line-height: 1;
			pointer-events: none;
			animation: bee-fly 14s linear forwards;
		}
		@keyframes bee-fly {
			/* the bee glyph (🐝) faces left, so every step mirrors her with scaleX(-1)
		   — she flies left-to-right pointing right, where she's going */
			0%   { transform: translate3d(-6vw, 0, 0) rotate(-8deg) scaleX(-1); }
			10%  { transform: translate3d(8vw, -4vh, 0) rotate(6deg) scaleX(-1); }
			20%  { transform: translate3d(22vw, 2vh, 0) rotate(-6deg) scaleX(-1); }
			30%  { transform: translate3d(36vw, -5vh, 0) rotate(8deg) scaleX(-1); }
			40%  { transform: translate3d(50vw, 1vh, 0) rotate(-8deg) scaleX(-1); }
			50%  { transform: translate3d(64vw, -3vh, 0) rotate(6deg) scaleX(-1); }
			60%  { transform: translate3d(78vw, 3vh, 0) rotate(-6deg) scaleX(-1); }
			70%  { transform: translate3d(92vw, -4vh, 0) rotate(8deg) scaleX(-1); }
			85%  { transform: translate3d(104vw, -1vh, 0) rotate(4deg) scaleX(-1); }
			100% { transform: translate3d(112vw, -2vh, 0) rotate(0deg) scaleX(-1); }
		}
