/* The catalog's own look, a sibling of the Threadiverse Catalog's
   (codefloe.com/catodon/threadiverse-catalog, internal/web/static/style.css,
   whose colours, type, corners, panels, buttons, fields and header this copies).
   Both follow Catodon's default look: the dark theme "Rosé Pine v3", which
   Catodon shows to everyone unless they choose another (it does not follow the
   device's light or dark setting, and neither does this site), with Catodon's
   default corner roundness (14, 20 and 26 pixels, and full pills).

   Nothing here loads anything from another host: the typeface is the site's
   own file (the build adds its hash to the address), and the only pictures are
   the logo's.

   The colours are named --site-*, not --bg or --accent: custom properties
   reach into the previews' shadow roots, and an item's CSS written for older
   Misskey (which used those short names) must not find the site's colours
   there. */
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("/static/InterVariable.woff2?v=693b77d4f32e") format("woff2");
}

:root {
	--site-bg: #191724; /* also THEME_COLOR in layout.ts */
	--site-panel: #1f1d2e;
	--site-text: #e0def4;
	--site-strong: #eae8fa;
	--site-muted: rgba(224, 222, 244, 0.75);
	--site-divider: rgba(255, 255, 255, 0.1);
	--site-control-border: rgba(255, 255, 255, 0.2);
	--site-accent: #c4a7e7;
	--site-accented-bg: rgba(196, 167, 231, 0.15);
	--site-focus: rgba(196, 167, 231, 0.3);
	--site-button-bg: rgba(255, 255, 255, 0.05);
	--site-button-hover-bg: rgba(255, 255, 255, 0.1);
	--site-link: #9ccfd8;
	--site-button-a: #c4a7e7;
	--site-button-b: #ebbcba;
	--site-on-accent: #26233a;
	--site-hashtag: #ebbcba;
	--site-notice-bg: #26233a;
	--site-notice-text: #f6c177;
	--site-warn-bg: rgba(235, 111, 146, 0.15);
	--site-warn-text: #eb6f92;
	--site-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	--site-radius-xs: 14px;
	--site-radius-sm: 20px;
	--site-radius: 26px;
	--site-mono: "Fira Code", "Fira Mono", ui-monospace, Menlo, Consolas, monospace;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--site-bg);
	color: var(--site-text);
	font: 16px/1.5 "Inter", "Noto Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
}
::selection { color: var(--site-on-accent); background: var(--site-accent); }
.wrap { max-width: 56rem; margin: 0 auto; padding: 0 1rem; }
a { color: var(--site-link); text-underline-offset: 0.15em; }
:focus-visible { outline: 3px solid var(--site-accent); outline-offset: 2px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
h1, h2, h3, strong, b, legend, label, .label, dt { color: var(--site-strong); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 1.5rem 0 1rem; letter-spacing: -0.01em; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.05rem; line-height: 1.3; margin: 1.25rem 0 0.4rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }
code { font: 0.9em var(--site-mono); background: var(--site-accented-bg); padding: 0.1em 0.35em; border-radius: 6px; overflow-wrap: anywhere; }
pre { font: 0.85rem/1.5 var(--site-mono); }

/* For text that only a screen reader should announce, not show. */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.skip { position: absolute; inset-inline-start: -999px; top: 0; z-index: 10; padding: 0.5rem 1rem; color: var(--site-on-accent); background: var(--site-button-a); font-weight: 700; }
.skip:focus { inset-inline-start: 0; }

/* What needs the script is hidden without it, and what stands in for it is hidden with it. */
.js-only { display: none; }
.js .js-only { display: inline-block; }
.js .no-js-only { display: none; }

/* Header and logo: the Threadiverse Catalog's. The cat is the same picture;
   the words are its lettering, rearranged (see logo-licence.txt). */
header.site { background: var(--site-panel); border-bottom: 1px solid var(--site-divider); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1.5rem; padding-top: 0.55rem; padding-bottom: 0.55rem; }
.brand { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--site-strong); text-decoration: none; border-radius: var(--site-radius-xs); }
.brand img { display: block; height: 76px; width: auto; }
/* The menu, then the account (Sign in, or the handle and Sign out), side by side. */
.menus { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
header.site nav, .account { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
header.site nav a, .account a, .nav-button {
	display: inline-block; min-height: 0; padding: 0.4rem 0.9rem;
	font: inherit; font-weight: 500; color: var(--site-text); text-decoration: none;
	background: none; border: 0; border-radius: 999px; cursor: pointer;
}
header.site nav a:hover, .account a:hover, .nav-button:hover { background: var(--site-accented-bg); filter: none; }
header.site nav a[aria-current="page"], .account a[aria-current="page"] { font-weight: 700; color: var(--site-accent); background: var(--site-accented-bg); }
.who { padding: 0 0.25rem 0 0.75rem; color: var(--site-muted); font-size: 0.9rem; overflow-wrap: anywhere; }

footer.site { margin-top: 3rem; border-top: 1px solid var(--site-divider); padding: 1.25rem 0 2rem; color: var(--site-muted); font-size: 0.875rem; }
footer.site p { margin: 0 0 0.6rem; }

/* A page of text or a form sits on one panel. */
.sheet { background: var(--site-panel); border-radius: var(--site-radius); box-shadow: var(--site-shadow); padding: 0.5rem 1.75rem 1.25rem; margin-top: 1rem; }
.sheet h1 { margin-top: 1.25rem; }
.sheet > :last-child { margin-bottom: 0; }

/* Buttons: Catodon's (MkButton): bold, a full pill, the accent gradient for
   what a page is for, the plain button colour for the rest. At least 44px high. */
button, .button {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
	min-height: 2.75rem; padding: 0.6rem 1.4rem;
	font: inherit; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer;
	color: var(--site-on-accent); background: linear-gradient(90deg, var(--site-button-a), var(--site-button-b));
	border: 0; border-radius: 999px;
}
button:hover, .button:hover { filter: brightness(1.08); }
button.secondary, .button.secondary { color: var(--site-text); background: var(--site-button-bg); box-shadow: inset 0 0 0 1px var(--site-control-border); }
button.secondary:hover, .button.secondary:hover { filter: none; background: var(--site-button-hover-bg); }
button.danger { color: var(--site-warn-text); background: var(--site-warn-bg); }
button.danger:hover { filter: brightness(1.15); }
button[aria-pressed="true"] { color: var(--site-accent); background: var(--site-accented-bg); }
button[disabled], button[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.link-button { min-height: 2.75rem; padding: 0.25rem 0.5rem; font-weight: 400; color: var(--site-link); text-decoration: underline; background: none; }

/* Forms: the fields sit on the page colour, with a faint edge that takes the
   accent colour under the pointer. */
label, .label { display: block; margin-bottom: 0.25rem; font-size: 0.875rem; font-weight: 600; }
.hint { font-weight: 400; color: var(--site-muted); font-size: 0.875rem; }
input[type="text"], input[type="search"], input[type="url"], select, textarea {
	display: block; width: 100%; min-height: 2.75rem; padding: 0.55rem 1rem;
	font: inherit; color: var(--site-strong); background: var(--site-bg);
	border: 1px solid var(--site-control-border); border-radius: var(--site-radius-sm);
}
input::placeholder, textarea::placeholder { color: var(--site-muted); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--site-accent); }
input[type="search"] { border-radius: 999px; padding-left: 1.2rem; }
textarea { resize: vertical; }
textarea#source-text { font: 0.875rem/1.5 var(--site-mono); }
input[type="file"] { max-width: 100%; font: inherit; color: var(--site-text); }
input[type="file"]::file-selector-button { margin-right: 0.75rem; padding: 0.5rem 1.1rem; font: inherit; font-weight: 700; color: var(--site-text); background: var(--site-button-bg); border: 1px solid var(--site-control-border); border-radius: 999px; cursor: pointer; }
fieldset { margin: 1rem 0; padding: 0.5rem 1rem 1rem; border: 1px solid var(--site-divider); border-radius: var(--site-radius-sm); min-width: 0; }
legend { padding: 0 0.3rem; font-size: 0.875rem; font-weight: 600; }
[aria-invalid="true"], [aria-invalid="true"]:hover { border-color: var(--site-warn-text); border-width: 2px; }
.stack { max-width: 40rem; }
#upload-form { max-width: none; }
#upload-form > fieldset, #upload-form [data-after] > fieldset { max-width: 40rem; }
input[type="checkbox"], input[type="radio"] { width: 1.25rem; height: 1.25rem; margin: 0 0.4rem 0 0; vertical-align: -0.2em; accent-color: var(--site-accent); }
/* A radio button or a checkbox with its words: the words in the plain text style. */
.choices-radio label, .tag-choices label, fieldset > label { display: inline-block; margin: 0 1rem 0.25rem 0; padding: 0.3rem 0; font-size: 1rem; font-weight: 400; color: var(--site-text); }
.tag-choices { display: block; }

/* Messages */
.lede { max-width: 48rem; font-size: 1.1rem; }
.note { max-width: 48rem; color: var(--site-muted); }
.note strong { color: var(--site-text); }
.alert { padding: 0.75rem 1.25rem; color: var(--site-notice-text); background: var(--site-notice-bg); border-radius: var(--site-radius); }
.alert strong, .alert a { color: inherit; }
.empty { padding: 2rem 0; color: var(--site-muted); }
/* A status line takes no room until it has something to say. */
.status { color: var(--site-muted); }
.status:empty { margin: 0; }
.check { padding: 0.75rem 1.25rem; color: var(--site-muted); background: var(--site-bg); border-radius: var(--site-radius-sm); overflow-wrap: anywhere; }
.check.good { color: var(--site-strong); background: var(--site-accented-bg); }
.check.bad { color: var(--site-warn-text); background: var(--site-warn-bg); }
.check.bad strong, .check.bad code { color: inherit; }

/* Browse: the kinds, the search and the filters on one panel, as the
   Threadiverse Catalog's search form. */
.finder { display: grid; gap: 0.75rem; margin: 1rem 0 1.25rem; padding: 1.25rem; background: var(--site-panel); border-radius: var(--site-radius); box-shadow: var(--site-shadow); }
.finder .lede { margin: 0; color: var(--site-muted); font-size: 1rem; }
.tabs ul { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.tabs li { margin: 0; }
.tabs a { display: block; padding: 0.4rem 0.9rem; font-weight: 500; color: var(--site-text); text-decoration: none; border-radius: 999px; }
.tabs a:hover { background: var(--site-accented-bg); }
.tabs a[aria-current="page"] { font-weight: 700; color: var(--site-accent); background: var(--site-accented-bg); }
.search { display: flex; gap: 0.75rem; }
.search input { flex: 1; min-width: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; align-items: baseline; }
.filter-name { min-width: 5.5rem; font-size: 0.875rem; font-weight: 600; color: var(--site-strong); }
.choices { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.choices li { margin: 0; }
.choices a { display: inline-block; padding: 0.3rem 0.85rem; font-size: 0.9rem; color: var(--site-text); text-decoration: none; background: var(--site-bg); border: 1px solid transparent; border-radius: 999px; }
.choices a:hover { border-color: var(--site-accent); }
.choices a[aria-current] { font-weight: 700; color: var(--site-accent); background: var(--site-accented-bg); }

/* The cards: Catodon's panels, with the preview across the top. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.card { position: relative; display: flex; flex-direction: column; margin: 0; overflow: hidden; background: var(--site-panel); border-radius: var(--site-radius); box-shadow: var(--site-shadow); }
.card:hover { box-shadow: var(--site-shadow), inset 0 0 0 1px var(--site-control-border); }
.card:focus-within { outline: 3px solid var(--site-accent); outline-offset: 2px; }
.card-link:focus-visible { outline: none; }
.card-preview { background: var(--site-bg); }
.card-body { padding: 0.9rem 1.25rem 1.1rem; }
.card h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.card-link { color: var(--site-accent); text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card-link::after { content: ""; position: absolute; inset: 0; }   /* the whole card is the link */
.card .meta, .card .stats { margin: 0.2rem 0; color: var(--site-muted); font-size: 0.9rem; }
.stats { display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; }
.badge { padding: 0.05rem 0.6rem; font-size: 0.8rem; font-weight: 600; color: var(--site-accent); background: var(--site-accented-bg); border-radius: 999px; }
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.4rem 0 0; padding: 0; list-style: none; }
.tags li { margin: 0; }
.tags li, .tags a { display: inline-block; padding: 0.1rem 0.6rem; font-size: 0.8rem; font-weight: 600; color: var(--site-hashtag); background: var(--site-bg); border-radius: 999px; text-decoration: none; }
.tags li:has(> a) { padding: 0; background: none; }
.tags a:hover { text-decoration: underline; }
/* "More" is Catodon's button under its timelines (MkButton, primary and
   rounded): the accent colour, bold, a full pill. */
.paging { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; justify-content: center; margin: 1.5rem 0; }
.paging .button { min-height: 2.5rem; padding: 7px 18px; font-size: 95%; color: var(--site-on-accent); background: var(--site-accent); }

/* Previews: the host clips the mock, which draws itself in a shadow root. */
.pv { display: block; overflow: hidden; border-radius: var(--site-radius-xs); }
.pv-small { height: 11.5rem; border-radius: 0; }
.pv-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0; }
.card .pv-row { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
.card .pv-small + .pv-small { border-left: 1px solid var(--site-divider); }
.previews .pv-row, [data-preview].pv-row { gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.previews { margin-bottom: 1.25rem; }
.previews figure, [data-preview] figure { margin: 0; }
figcaption { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--site-muted); }
.pv-code { height: 11.5rem; tab-size: 2; margin: 0; padding: 0.9rem 1.25rem; overflow: hidden; color: var(--site-muted); background: transparent; white-space: pre; }
.pv-none { margin: 0; padding: 1rem 1.25rem; color: var(--site-muted); }
[data-preview] pre { grid-column: 1 / -1; margin: 0; padding: 0.9rem 1.25rem; overflow: auto; background: var(--site-bg); border-radius: var(--site-radius-xs); }

/* An item */
.crumbs { margin-top: 1.25rem; font-size: 0.9rem; }
.crumbs a { color: var(--site-link); }
.item h1 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.item-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; margin-top: 1rem; }
@media (min-width: 52rem) { .item-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.panel { margin: 0 0 0.75rem; padding: 0.25rem 1.5rem 1rem; background: var(--site-panel); border-radius: var(--site-radius); box-shadow: var(--site-shadow); }
.panel h2 { margin-top: 1rem; }
.panel > :last-child { margin-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.install-out p { margin: 0.5rem 0; }
.install-out form { margin-top: 0.5rem; }
.facts { margin: 0; padding: 0.5rem 1.5rem; background: var(--site-panel); border-radius: var(--site-radius); box-shadow: var(--site-shadow); }
.facts > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.5rem; padding: 0.55rem 0; border-bottom: 1px solid var(--site-divider); font-size: 0.95rem; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-weight: 400; color: var(--site-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts .tags { margin: 0; }
.warnings { padding: 0; list-style: none; }
.warnings li { margin-bottom: 0.5rem; }
.strings { padding-left: 1.2rem; }
.strings li { overflow-wrap: anywhere; }
.code details { margin: 0.5rem 0; overflow: hidden; background: var(--site-panel); border-radius: var(--site-radius-sm); box-shadow: var(--site-shadow); }
.code summary { padding: 0.75rem 1.25rem; font-weight: 600; color: var(--site-strong); cursor: pointer; }
.code summary:hover { background: var(--site-button-bg); }
.code pre { max-height: 30rem; margin: 0; padding: 0.9rem 1.25rem; overflow: auto; border-top: 1px solid var(--site-divider); white-space: pre; tab-size: 2; }
.report summary { min-height: 2.75rem; padding: 0.6rem 0; cursor: pointer; font-weight: 600; color: var(--site-strong); }

/* My items */
.rows { margin: 0 0 1rem; padding: 0; list-style: none; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin: 0 0 0.5rem; padding: 0.9rem 1.25rem; background: var(--site-bg); border-radius: var(--site-radius-sm); }
.row-main { min-width: 0; }
.row h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.row h2 a { color: var(--site-accent); text-decoration: none; }
.row h2 a:hover { text-decoration: underline; }
.row .meta { margin: 0.2rem 0; color: var(--site-muted); font-size: 0.9rem; }
.row .alert { margin: 0.5rem 0 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.prose { max-width: 46rem; }
.prose dt { font-weight: 700; }
.prose dd { margin: 0 0 0.75rem; }

@media (max-width: 40rem) {
	.search { flex-direction: column; }
	.filter-name { min-width: 100%; }
	.facts > div { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 30rem) {
	.brand img { height: 60px; }
	.sheet { padding: 0.25rem 1.1rem 1rem; }
	.finder { padding: 1rem; }
	.panel { padding: 0.25rem 1.1rem 1rem; }
	.facts { padding: 0.25rem 1.1rem; }
	.card-body { padding: 0.8rem 1rem 1rem; }
	.row { padding: 0.8rem 1rem; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
