/* stingtype.org -- one stylesheet for every page */
:root {
  --ink: #252525;
  --muted: #666;
  --faint: #8a8a8a;
  --line: #e0e0e0;
  --panel: #f7f7f7;
  --bg: #fff;
  --accent: #de4f3b;
  --accent-dark: #b93a28;
  --code-bg: #f4f4f4;
  --ink-2: #474747;
  --surface: #fff;
  --surface-2: #f4f4f4;
  --surface-3: #e7e7e7;
  --line-2: #cfcfcf;
  --on-accent: #fff;
  --accent-soft: color-mix(in srgb, var(--accent) 5%, var(--surface));
  --err-bg: #fff7f6; --err-line: #e0aaa2; --err-ink: #8a2216;
  --ok-bg: #f6faf6; --ok-line: #b8cfb8; --ok-ink: #244824;
  color: var(--ink);
  background: var(--bg);
  font-family: "Candara Light", Candara, "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color-scheme: light;
}
/* dark mode (data-mode on <html>, set by assets/look.js before the page draws) */
:root[data-mode="dark"] {
  --ink: #e9e9e9; --ink-2: #c8c8c8; --muted: #a0a0a0; --faint: #7f7f7f;
  --bg: #15171a; --surface: #1c1f23; --surface-2: #23272c; --surface-3: #2d3238; --panel: #1f2226;
  --line: #31363c; --line-2: #464c54; --code-bg: #2a2e34;
  --err-bg: #2b1b19; --err-line: #6b3a33; --err-ink: #f0a99d;
  --ok-bg: #18261a; --ok-line: #355a39; --ok-ink: #a6d8a8;
  color-scheme: dark;
}
:root[data-mode="dark"] .logo, :root[data-mode="dark"] .hero-logo { filter: brightness(.95); }
/* themes: the accent color (each with a lighter one for dark mode) */
:root[data-theme="super-maroon"] { --accent: #8c1c34; --accent-dark: #6b1427; }
:root[data-theme="calm-orange"] { --accent: #e07a32; --accent-dark: #b85f21; }
:root[data-theme="navy-blue"] { --accent: #1f4e8c; --accent-dark: #163a6a; }
:root[data-theme="forest-green"] { --accent: #2e7d4f; --accent-dark: #215e3a; }
:root[data-theme="smooth-purple"] { --accent: #7a59c2; --accent-dark: #5e42a0; }
:root[data-theme="iroko-black"] { --accent: #2b2724; --accent-dark: #000; }
:root[data-theme="cherry-red"] { --accent: #c8143c; --accent-dark: #9d0f2f; }
:root[data-mode="dark"] { --accent-dark: #f08a77; }
:root[data-mode="dark"][data-theme="super-maroon"] { --accent: #b33a55; --accent-dark: #e7899c; }
:root[data-mode="dark"][data-theme="calm-orange"] { --accent: #e98a45; --accent-dark: #f4b27f; }
:root[data-mode="dark"][data-theme="navy-blue"] { --accent: #3f74c4; --accent-dark: #8fb4ea; }
:root[data-mode="dark"][data-theme="forest-green"] { --accent: #3c9a63; --accent-dark: #8fd2a9; }
:root[data-mode="dark"][data-theme="smooth-purple"] { --accent: #9576dd; --accent-dark: #c4b0f2; }
:root[data-mode="dark"][data-theme="iroko-black"] { --accent: #e4ddd4; --accent-dark: #fff; --on-accent: #1a1714; }
:root[data-mode="dark"][data-theme="cherry-red"] { --accent: #e0405f; --accent-dark: #f39aac; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--ink); text-underline-offset: .18em; }
a:hover { color: var(--accent-dark); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
img { max-width: 100%; }

.wrap { width: min(100% - 3rem, 68rem); margin-inline: auto; }

/* ---- header ---- */
.site-header { border-bottom: 1px solid var(--line); padding: 1.1rem 0 .9rem; }
.brand { display: flex; align-items: center; justify-content: center; gap: .9rem; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.logo { width: 4rem; height: 4rem; object-fit: contain; flex: 0 0 auto; border-radius: .7rem; }
.brand-name { margin: 0; font-size: clamp(2.3rem, 6vw, 3.4rem); line-height: 1; letter-spacing: -.06em; font-weight: 300; }
.tagline { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; min-height: 1.5em; }
.nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .35rem; margin-top: .9rem; }
.nav a { padding: .25rem .75rem; border: 1px solid transparent; border-radius: .3rem; text-decoration: none; color: var(--ink-2); font-size: .94rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); border-color: var(--line-2); color: var(--ink); }
.nav-spacer { flex: 1 1 1rem; }
.account-area { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }

/* ---- home ---- */
.hero { text-align: center; padding: 3.2rem 0 2.4rem; }
.hero-logo { width: 7.5rem; height: 7.5rem; border-radius: 1.3rem; }
.hero h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 4.4rem); font-weight: 300; letter-spacing: -.05em; line-height: 1.05; }
.hero .tagline { font-size: 1.15rem; }
.hero .lede { max-width: 44rem; margin: 1.4rem auto 0; font-size: 1.15rem; color: var(--ink-2); }
.hero-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }
.version-pill { display: inline-block; margin-top: 1rem; padding: .12rem .65rem; border: 1px solid var(--line-2); border-radius: 99px; color: var(--muted); font-size: .82rem; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 2.5rem; }
.feature { padding: 1.1rem 1.2rem; background: var(--panel); border: 1px solid var(--line); border-radius: .4rem; }
.feature h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.code-sample { margin: 0 auto 2.8rem; max-width: 46rem; }
.downloads { padding: 2rem; background: var(--panel); border: 1px solid var(--line); border-radius: .4rem; text-align: center; margin-bottom: 3rem; }
.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; margin-top: 1.3rem; }
.platform h3 { margin: 0 0 .5rem; font-size: 1.08rem; }
.platform p { margin: .2rem 0; color: var(--muted); font-size: .86rem; }

/* ---- buttons, forms ---- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .9rem; border: 1px solid var(--line-2); border-radius: .3rem; background: var(--surface-2); color: var(--ink); text-decoration: none; line-height: 1.25; }
.button:hover { background: var(--surface-3); color: var(--ink); }
.button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.button.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); border-color: color-mix(in srgb, var(--accent) 86%, var(--ink)); color: var(--on-accent); }
.button.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.button.dark:hover { background: var(--ink-2); }
.button.small { padding: .25rem .6rem; font-size: .86rem; }
.button.danger { color: var(--err-ink); }
.field { display: grid; gap: .3rem; margin-top: .85rem; }
.field label { font-weight: 600; font-size: .91rem; }
.field .hint { color: var(--muted); font-size: .82rem; }
input, textarea, select { width: 100%; padding: .6rem .75rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: .25rem; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: 1rem; }
.muted { color: var(--muted); font-size: .9rem; }

/* ---- page parts ---- */
main { padding: 2.4rem 0 4rem; }
.eyebrow { margin: 0 0 .35rem; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 400; line-height: 1.1; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 1.45rem; font-weight: 600; line-height: 1.25; }
h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
p { margin: .5rem 0 0; }
.lede { max-width: 48rem; color: var(--ink-2); font-size: 1.08rem; margin-top: .8rem; }
.section { margin-top: 2rem; }
.panel { padding: 1.25rem 1.35rem; background: var(--panel); border: 1px solid var(--line); border-radius: .4rem; }
.status { display: none; margin: 1rem 0; padding: .7rem .9rem; background: var(--panel); border: 1px solid var(--line-2); border-radius: .3rem; font-size: .94rem; }
.status.show { display: block; }
.status.error { background: var(--err-bg); border-color: var(--err-line); color: var(--err-ink); }
.status.success { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.badge { display: inline-block; padding: .06rem .5rem; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); color: var(--ink-2); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.badge.accent { border-color: var(--accent); color: var(--accent-dark); }
.empty { padding: .85rem 0 .2rem; color: var(--muted); font-size: .93rem; }

/* ---- code ---- */
code { padding: .05rem .3rem; background: var(--code-bg); border: 1px solid var(--line); border-radius: .2rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .86em; }
pre { overflow-x: auto; padding: .9rem 1rem; background: #1f1f1f; color: #eee; border-radius: .4rem; line-height: 1.45; }
pre code { padding: 0; background: none; border: 0; color: inherit; font-size: .84rem; }
pre .kw { color: #ff8a73; }
pre .str { color: #a8d98a; }
pre .com { color: #8f8f8f; font-style: italic; }
pre .num { color: #f2c46d; }

/* ---- docs ---- */
.docs-layout { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2.4rem; }
.docs-nav { position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow-y: auto; font-size: .9rem; padding-right: .5rem; }
.docs-nav h4 { margin: 1.1rem 0 .3rem; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.docs-nav a { display: block; padding: .15rem 0; text-decoration: none; color: var(--ink-2); }
.docs-nav a:hover { color: var(--accent-dark); }
.docs-nav a[aria-current="page"] { color: var(--accent-dark); font-weight: 600; }
.docs-nav .toc a { padding-left: .7rem; font-size: .84rem; color: var(--muted); }
.doc h1 { font-size: clamp(2.1rem, 5vw, 3rem); }
.doc h2 { margin-top: 2.2rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.doc h3 { margin-top: 1.6rem; }
.doc table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .9rem; display: block; overflow-x: auto; }
.doc th, .doc td { padding: .4rem .6rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { background: var(--panel); }
.doc blockquote { margin: 1rem 0; padding: .5rem 1rem; border-left: 3px solid var(--accent); background: var(--panel); }
.doc li + li { margin-top: .25rem; }
.doc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.doc-cards a { display: block; padding: 1.1rem 1.2rem; background: var(--panel); border: 1px solid var(--line); border-radius: .4rem; text-decoration: none; }
.doc-cards a:hover { border-color: var(--accent); }
.doc-cards h3 { margin: 0 0 .25rem; }
.doc-cards p { margin: 0; color: var(--ink-2); font-size: .92rem; }

/* ---- devlog ---- */
.entry { margin-top: 1.4rem; padding: 1.4rem 1.5rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--surface); }
.entry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; flex-wrap: wrap; }
.entry h2 { font-size: 1.6rem; letter-spacing: -.02em; }
.entry h2 a { text-decoration: none; }
.entry-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; margin-top: .35rem; color: var(--muted); font-size: .86rem; }
.entry-body { margin-top: 1rem; overflow-wrap: anywhere; }
.entry-body p { margin: .7rem 0 0; }
.entry-extra { margin-top: 1rem; padding: .8rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: .35rem; font-size: .94rem; }
.entry-extra summary { cursor: pointer; font-weight: 600; }
.entry-footer { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--line-2); color: var(--ink-2); font-style: italic; }
.entry-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.admin-panel { margin-top: 1.5rem; border-color: var(--accent); }
.preview { margin-top: 1rem; }

/* ---- forum ---- */
.board { margin-top: 1rem; padding: 1.15rem 1.2rem; border: 1px solid var(--line-2); border-radius: .4rem; background: var(--surface); }
.board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.board-copy { max-width: 43rem; }
.board-list { margin-top: .85rem; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.two-col .board { margin: 0; }
.topic-card { padding: .85rem 0; border-top: 1px solid var(--line); }
.topic-card:first-child { border-top: 0; }
.topic-title-button { display: block; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; font-size: 1.06rem; font-weight: 650; }
.topic-title-button:hover { text-decoration: underline; color: var(--accent-dark); }
.topic-excerpt { margin-top: .25rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); font-size: .93rem; }
.topic-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .8rem; margin-top: .35rem; color: var(--muted); font-size: .82rem; }
.topic-actions { display: flex; gap: .35rem; margin-top: .55rem; flex-wrap: wrap; }
.thread-top { display: flex; gap: .7rem; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 1.25rem; }
.thread-post { padding: 1.15rem; border: 1px solid var(--line-2); border-radius: .4rem; background: var(--surface); }
.thread-body, .reply-body { margin-top: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.reply-card { padding: .9rem 0; border-top: 1px solid var(--line); }
.reply-card:first-child { border-top: 0; }
.report-item { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .8rem; padding: .9rem 0; border-top: 1px solid var(--line-2); }
.report-item:first-child { border-top: 0; }
.auth-panel { margin: 1.5rem 0 2rem; max-width: 39rem; }
.auth-switch { display: flex; gap: .45rem; flex-wrap: wrap; margin: .8rem 0 0; }
.auth-switch button[aria-pressed="true"] { background: var(--surface-3); border-color: var(--line-2); }

/* ---- footer ---- */
.footer { padding: 1.2rem 0 2rem; border-top: 1px solid var(--line-2); color: var(--muted); font-size: .88rem; text-align: center; }
.footer a { color: inherit; }

@media (max-width: 52rem) {
  .docs-layout { grid-template-columns: 1fr; gap: 1rem; }
  .docs-nav { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
  .features, .platforms { grid-template-columns: 1fr; }
}
@media (max-width: 43rem) {
  .wrap { width: min(100% - 2rem, 68rem); }
  .logo { width: 3.3rem; height: 3.3rem; }
  .brand { gap: .65rem; }
  .nav { gap: .2rem; }
  .nav-spacer { display: none; }
  .account-area { width: 100%; justify-content: center; margin-top: .25rem; }
  .two-col, .doc-cards, .form-row { grid-template-columns: 1fr; }
  .entry, .board, .panel { padding: 1rem; }
}
.editor-title { margin-top: 1.2rem; }
.filter-bar { justify-content: flex-end; align-items: center; }
.filter-bar select { width: auto; }

/* ---- forums: channels on the left, a channel's posts (or a thread) on the right ---- */
.forum-wrap { width: min(100% - 3rem, 78rem); padding-top: 1.2rem; }
.forum { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 1.6rem; align-items: start; margin-bottom: 3rem; }
.forum-side { position: sticky; top: 1rem; padding: .9rem .7rem; background: var(--panel); border: 1px solid var(--line); border-radius: .5rem; }
.side-title { margin: .2rem .5rem .4rem; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.side-title + .channel-list { margin-bottom: 1rem; }
.channel-list { list-style: none; margin: 0; padding: 0; }
.channel-link { display: flex; align-items: center; gap: .45rem; padding: .38rem .55rem; border-radius: .35rem; color: var(--ink-2); text-decoration: none; font-size: .97rem; }
.channel-link:hover { background: var(--surface-3); color: var(--ink); }
.channel-link.active { background: var(--surface-3); color: var(--ink); font-weight: 650; }
.channel-hash { width: 1.1rem; text-align: center; color: var(--faint); font-weight: 400; }
.channel-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-count { color: var(--faint); font-size: .8rem; font-weight: 400; }
.unread-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.side-note { margin: .4rem .3rem 0; padding-top: .8rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.side-note p { margin: 0 0 .5rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.forum-main { min-width: 0; }
.channel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.channel-titles h1 { margin: 0; font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; }
.channel-titles p { margin: .2rem 0 0; max-width: 40rem; }
.new-post { font-size: 1.02rem; padding: .6rem 1.15rem; font-weight: 600; }
.channel-tools { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin: 1rem 0 .4rem; }
.search { flex: 1 1 14rem; padding: .45rem .7rem; border: 1px solid var(--line-2); border-radius: .35rem; background: var(--surface); }
.sort-toggle { display: flex; gap: .3rem; }
.sort-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.post-list { display: grid; gap: .55rem; margin-top: .6rem; }
.post-card { display: block; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); color: inherit; text-decoration: none; transition: border-color .12s, background .12s; }
a.post-card:hover { border-color: var(--line-2); background: var(--surface-2); color: inherit; }
.post-card-top { display: flex; gap: .8rem; align-items: flex-start; }
.post-card-text { min-width: 0; flex: 1 1 auto; }
.post-title { margin: 0; font-size: 1.08rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.post-excerpt { margin: .2rem 0 0; color: var(--ink-2); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.post-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; margin: .55rem 0 0 2.95rem; color: var(--muted); font-size: .82rem; }
.post-meta .who { color: var(--ink); }
.badge { display: inline-block; margin-left: .45rem; padding: 0 .4rem; border-radius: .25rem; background: var(--surface-3); color: var(--ink-2); font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; line-height: 1.6; }
.badge.new { background: var(--accent); color: var(--on-accent); }
.avatar { --hue: 10; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 2.15rem; height: 2.15rem; border-radius: 50%; background: hsl(var(--hue) 55% 88%); color: hsl(var(--hue) 45% 30%); font-weight: 700; font-size: .95rem; }
.more-button { display: block; margin: 1rem auto 0; }
.empty-channel { padding: 2rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: .5rem; }

.composer { margin-top: 1rem; padding: 1rem 1.15rem 1.15rem; border: 1px solid var(--accent); border-radius: .5rem; background: var(--accent-soft); }
.composer h2 { margin: 0; font-size: 1.15rem; }
.composer p { margin: .4rem 0 0; }
.composer input, .composer textarea { width: 100%; }
.composer textarea { min-height: 10rem; resize: vertical; font-family: inherit; }

.thread-top { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .6rem; }
.back-link { color: var(--muted); text-decoration: none; font-size: .95rem; }
.back-link:hover { color: var(--accent-dark); }
.thread-head { padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.thread-head h1 { margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.thread-head p { margin: .25rem 0 0; }
.thread { margin-top: .4rem; }
.message { display: flex; gap: .85rem; padding: .9rem .4rem; border-radius: .4rem; }
.message:hover { background: var(--surface-2); }
.message.op { padding-bottom: 1.2rem; }
.message-col { min-width: 0; flex: 1 1 auto; }
.message-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.message-head .who { font-weight: 650; }
.message-head .when { color: var(--faint); font-size: .8rem; }
.message-body { overflow-wrap: anywhere; line-height: 1.6; }
.message-body p { margin: .3rem 0 0; }
.message-body pre { margin: .6rem 0; }
.message-actions { display: flex; gap: .35rem; margin-top: .45rem; opacity: .75; }
.message:hover .message-actions { opacity: 1; }
.divider { display: flex; align-items: center; gap: .7rem; margin: .3rem 0; color: var(--faint); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.reply-box { margin-top: .8rem; padding: .8rem 0 1rem; border-top: 1px solid var(--line); }
.reply-form textarea { width: 100%; min-height: 4.5rem; padding: .65rem .8rem; border: 1px solid var(--line-2); border-radius: .5rem; resize: vertical; font-family: inherit; background: var(--surface); }
.reply-row { display: flex; justify-content: space-between; align-items: center; gap: .7rem; margin-top: .4rem; }
.reply-row .hint { color: var(--muted); font-size: .8rem; }
.button.danger { color: var(--err-ink); }

@media (max-width: 820px) {
  .forum { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .forum > * { min-width: 0; }
  .forum-side { position: static; padding: .5rem; }
  .forum-side .side-title, .side-note { display: none; }
  .channel-list { display: flex; gap: .3rem; overflow-x: auto; }
  .side-title + .channel-list { margin-bottom: 0; }
  .forum-side > .channel-list + .side-title + .channel-list { display: none; }
  .channel-link { white-space: nowrap; }
  .post-meta { margin-left: 0; }
  .new-post { width: 100%; }
}

/* ---- the account button (top right) and its menu ---- */
.site-header { position: relative; }
.user-area { position: absolute; top: 1rem; right: 1.25rem; z-index: 30; }
.user-button { display: inline-flex; padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; transition: border-color .15s, transform .15s; }
.user-button:hover, .user-button[aria-expanded="true"] { border-color: var(--accent); transform: scale(1.04); }
.user-avatar { width: 2.6rem; height: 2.6rem; font-size: 1.1rem; }
#user-avatar:not(.emoji):has(svg) { background: var(--surface-3); color: var(--muted); }
.user-menu { position: absolute; top: calc(100% + .55rem); right: 0; min-width: 14.5rem; padding: .4rem; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: .9rem; box-shadow: 0 .6rem 1.8rem rgb(0 0 0 / .14), 0 .1rem .3rem rgb(0 0 0 / .08);
  opacity: 0; transform: translateY(-.5rem) scale(.96); transform-origin: top right; transition: opacity .18s ease, transform .18s cubic-bezier(.2, .9, .3, 1.2); }
.user-menu.open { opacity: 1; transform: none; }
.menu-who { display: grid; padding: .5rem .65rem .6rem; margin-bottom: .25rem; border-bottom: 1px solid var(--line); line-height: 1.35; }
.menu-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-who .muted { font-size: .8rem; }
.menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .48rem .65rem; border: 0; border-radius: .55rem; background: none; color: var(--ink); text-align: left; text-decoration: none; font-size: .95rem; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); color: var(--ink); }
.menu-icon { width: 1.2rem; text-align: center; color: var(--muted); }
#menu-logout { margin-top: .25rem; border-top: 1px solid var(--line); border-radius: 0 0 .55rem .55rem; }
.avatar.emoji { background: var(--surface-2); font-size: 1.15em; }
.avatar.big { width: 4.2rem; height: 4.2rem; font-size: 1.8rem; }
.who-name { color: var(--ink); }
.who-handle { margin-left: .35rem; color: var(--faint); font-weight: 400; font-size: .85em; }
:root[data-mode="dark"] .avatar:not(.emoji) { background: hsl(var(--hue) 35% 26%); color: hsl(var(--hue) 70% 82%); }

/* ---- settings ---- */
.settings-wrap { max-width: 46rem; }
.tabs { display: flex; gap: .3rem; margin: 1.4rem 0 1.2rem; border-bottom: 1px solid var(--line); }
.tab { padding: .55rem 1rem; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); text-decoration: none; font-size: 1rem; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"], .tab.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }
.small-tabs { margin: 1rem 0 .4rem; }
.small-tabs .tab { font-size: .92rem; padding: .4rem .8rem; }
.profile-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-radius: .7rem; }
.profile-name { margin: 0; font-size: 1.3rem; font-weight: 650; }
.profile-card .muted { margin: 0; }
.settings-group { margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.settings-group:first-of-type { border-top: 0; }
.settings-group h2 { font-size: 1.2rem; }
.settings-group .sub { margin-top: 1.2rem; font-size: .95rem; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr)); gap: .45rem; margin-top: .8rem; }
.icon-choice { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px solid var(--line); border-radius: .7rem; background: var(--surface); font-size: 1.45rem; transition: transform .12s, border-color .12s; }
.icon-choice:hover { transform: translateY(-2px); border-color: var(--line-2); }
.icon-choice.letter { font-size: 1rem; font-weight: 700; color: var(--muted); }
.icon-choice[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .5rem; margin-top: .8rem; }
.theme-choice { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 2px solid var(--line); border-radius: .7rem; background: var(--surface); color: var(--ink); text-align: left; font-size: .93rem; }
.theme-choice:hover { border-color: var(--line-2); }
.theme-choice[aria-checked="true"] { border-color: var(--swatch-on, var(--accent)); font-weight: 650; }
.swatch { width: 1.4rem; height: 1.4rem; flex: 0 0 auto; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 2px rgb(255 255 255 / .35); }
.mode-toggle { display: flex; gap: .4rem; margin-top: .5rem; }
.mode-toggle [aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.danger-zone { margin-top: 2rem; padding: 1.1rem 1.2rem; border: 1px solid var(--err-line); border-radius: .7rem; background: var(--err-bg); }
.danger-zone h2 { color: var(--err-ink); }
.danger-button { background: #b3261e; border-color: #b3261e; color: #fff; }
.danger-button:hover { background: #8f1d17; color: #fff; }
.history-title { margin-top: .6rem; }
.page-notices .status, .page-notices .auth-panel { margin-top: 1rem; }
.page-notices .auth-panel { margin-inline: auto; }
@media (max-width: 43rem) {
  .user-area { top: .8rem; right: .8rem; }
  .user-avatar { width: 2.3rem; height: 2.3rem; }
}
#history-list .post-meta { margin-left: 0; }
#panel-history .back-link { display: inline-block; margin-top: 1rem; }
.avatar { overflow: hidden; }
.avatar.photo { background: var(--surface-3); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfp-row { display: flex; align-items: center; gap: 1.1rem; margin-top: .8rem; padding: .8rem; border: 2px dashed transparent; border-radius: .8rem; transition: border-color .15s, background .15s; }
.pfp-row.drop { border-color: var(--accent); background: var(--accent-soft); }
.pfp-row .avatar.big { width: 5.5rem; height: 5.5rem; font-size: 2.2rem; }
.pfp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.pfp-actions .hint { width: 100%; color: var(--muted); font-size: .82rem; }
label.button { cursor: pointer; }
#pfp-file:focus-visible + * , #pfp-pick:focus-within { outline: 2px solid var(--muted); }
