/* MAF mockups. Serif for reading, Gill Sans-style humanist sans for interface text.
   Sentence case everywhere, plain-language metadata, no third-party fonts. */

/* Type scale. Serif for reading: 32 page title, 20 heading, 18 body (24 for the MAF wordmark).
   Sans for interface: 16 controls (header, buttons), 15 interface (meta, labels, actions, footer), 13 fine print.
   Code samples: mono 14. Emoji, arrows and the (i) glyph are sized as icons, outside the scale. */
/* One gap from the header to the first thing on every page, in ink (MHN's baseline → the first line's capitals).
   29.2px: the front page's original gap, which the user picked as the reference (28px was tried; 29.2 looked neater). Each page's first element below
   subtracts the offset its own box already has, so they all land at exactly this. */
:root { --header-gap: 29.2px; --footer-gap: 24px; } /* footer: the same 24px as list → More, so the page ends in one even rhythm */

:root {
  --paper: #ffffff;
  --ink: #000000;
  --soft: #555555;
  --meta: #6b6b6b;
  --line: #e4e4e4;
  --border: #949494;
  --tint: #f5f5f3;
  --hot: #b4441c;
  --danger: #8a0303;
  --hot-wash: color-mix(in srgb, var(--hot) 7%, var(--paper));
  --wash: 7%;
  /* NSFW on: the page takes a warm tint, so you can always tell which side you're on. */
  --nsfw-paper: #f8e8e2;
  --nsfw-tint: #efdcd5;
  --nsfw-meta: #626262; /* 4.5:1 on the tinted paper and its boxes */
  /* Dates page: its own tint, and the Dates word in its accent while you're there. */
  --dates-paper: #fbe9ee;
  --dates-tint: #f1dbe2;
  --dates-accent: #c2456b;
  --visited: #6f6f6f;
  /* New badges: ember orange. In dark mode a shade deeper, so it doesn't glare against black. */
  --new-fill: #E2805A;
  --new-ink: #ffffff;
  --serif: "Iowan Old Style", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Gill Sans", "Gill Sans MT", Seravek, "Trebuchet MS", Calibri, sans-serif;
}

/* Dark mode mirrors light mode exactly: each color is 255 minus its light value per channel,
   so every tone keeps the same distance from the background in both themes.
   --meta and --border are set for WCAG AA contrast: meta text 4.5:1 on paper, tint and the #hottakes wash; input borders 3:1.
   Exceptions: --hot (the #hottakes ember) is hand-tuned per theme, and --tint is lifted to #1c1c1c, because a 4% shade that reads as a box on white disappears on black. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000;
    --ink: #ffffff;
    --soft: #aaaaaa;
    --meta: #949494;
    --line: #1b1b1b;
    --border: #6b6b6b;
    --tint: #1c1c1c;
    --hot: #e2805a;
    --danger: #ff6b6b;
    --hot-wash: color-mix(in srgb, var(--hot) 15%, var(--paper));
    --wash: 15%;
    --nsfw-paper: #22100c;
    --nsfw-tint: #34211c;
    --nsfw-meta: #949494;
    --dates-paper: #2e1520;
    --dates-tint: #432633;
    --dates-accent: #e87d9c;
    --visited: #909090;
    --new-fill: #C4663F;
    --new-ink: #ffffff;
  }
}

:root[data-theme="dark"] {
  --paper: #000000;
  --ink: #ffffff;
  --soft: #aaaaaa;
  --meta: #949494;
  --line: #1b1b1b;
  --border: #6b6b6b;
  --tint: #1c1c1c;
  --visited: #909090;
  --hot: #e2805a;
  --danger: #ff6b6b;
  --hot-wash: color-mix(in srgb, var(--hot) 15%, var(--paper));
  --wash: 15%;
  --nsfw-paper: #22100c;
  --nsfw-tint: #34211c;
  --nsfw-meta: #949494;
  --dates-paper: #2e1520;
  --dates-tint: #432633;
  --dates-accent: #e87d9c;
  --new-fill: #C4663F;
  --new-ink: #ffffff;
}

* { box-sizing: border-box; }

/* Reserve the scrollbar's width on every page so centered content doesn't shift between short and long pages. */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 var(--serif);
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Column fills the window height so the footer sits at the bottom on short pages. */
.page { max-width: 700px; margin: 0 auto; padding: 0 20px; min-height: 100vh; display: flex; flex-direction: column; }

/* Header */

.top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding: 22px 0 6px; }
.brand { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.top nav { display: flex; gap: 20px; font: 16px var(--sans); }
.top nav a { color: var(--soft); }
.top nav a[aria-current] { color: var(--ink); }
/* Submit is the main thing to do: always underlined, thin and grey like a hovered link; hovering it
   only eases it into full colour (the underline stays where it is). */
.top nav a.submit-link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; transition: color .15s ease; }
.top nav a.submit-link:hover { color: var(--ink); text-underline-offset: 4px; }
.find { margin-left: auto; }
/* Search and Dark are one group: 14px apart, tighter than the nav words' 20px, so they read as their own section.
   (.menu wraps nav + search, so the toggle follows .menu, not .find.) */
.menu + .theme-toggle { margin-left: -10px; }
.theme-toggle { font: 16px var(--sans); color: var(--soft); background: none; border: none; padding: 0; cursor: pointer; }
.brand + .theme-toggle { margin-left: auto; }
.theme-toggle:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.find input {
  font: 15px var(--sans); color: var(--ink); background: var(--tint);
  border: 1px solid transparent; border-radius: 4px; padding: 5px 10px; width: 130px;
}
.find input:hover { border-color: var(--border); }
.find input:focus { border-color: var(--ink); background: var(--paper); }
.find input:focus-visible { outline: none; } /* its own border is the focus mark: one outline, not two */

/* Sort row and week range */

.listbar {
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px;
  font: 15px var(--sans); color: var(--meta); margin: 12px 0 4px;
}
.sort { display: flex; gap: 16px; }
/* Lists without a date range keep an invisible one (list.html sort_row), so every sort bar lines up like home's. */
.range-standin { visibility: hidden; }
.sort a { color: var(--meta); }
.sort strong { color: var(--ink); font-weight: 600; }
/* Each option reserves its bold width, so changing the selection doesn't shift its neighbours. */
.sort a, .sort strong { display: inline-grid; }
.sort a::after, .sort strong::after { content: attr(data-text); font-weight: 600; height: 0; overflow: hidden; visibility: hidden; }

/* Post list */

.day { font: 600 18px var(--serif); margin: 26px 0 6px; color: var(--soft); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 6px 0 5px; } /* rows 24px apart in ink: 2× the 12px title→meta gap, the proximity ratio that groups without empty-looking space */
.title { font-size: 20px; line-height: 1.35; }
/* The host sits on the title's baseline; its hover underline goes a little lower, off the parentheses' tails. */
.host { font: 15px var(--sans); color: var(--meta); margin-left: 0; }
.host:hover { color: var(--ink); text-underline-offset: 4px; }
/* -2px: the meta clears the title's descenders (5.2px) by one meta x-height (6.7px), a 12px ink gap,
   tighter than a wrapped title's own lines (13.1px), so it reads as part of its title. */
.meta { font: 15px/1.5 var(--sans); color: var(--meta); margin-top: -2px; }
.meta a { color: var(--meta); }
.meta .sep { margin: 0 4px; color: var(--meta); }
/* The font's own "·", in a fixed-width box, nudged so its ink sits exactly in the middle: equal space both sides. */
.meta .dot { display: inline-block; width: 19px; font-size: 0; vertical-align: middle; text-align: center; }
.meta .dot::before { content: "·"; display: inline-block; font: 15px var(--sans); color: var(--meta); transform: translateX(-0.1426em); /* Gill Sans draws "·" 0.1426em right of its box centre */ }
.meta-action { font: inherit; color: var(--meta); background: none; border: none; padding: 0; cursor: pointer; }
.meta-action:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* 9px puts More 24px (in ink) under the last story, the same rhythm as the rows: it continues the list, and the
   footer stays the bigger gap (35px) as the next section. */
.pager { display: flex; justify-content: center; gap: 1em; font: 15px var(--sans); margin: 9px 0 0; } /* 1em (15px): one control, so tighter than the nav (20px) and footer (22px); the chevrons mark the split */
.pager a { color: var(--soft); }

/* Thread */

.post-head { padding: calc(var(--header-gap) - 24.8px) 0 0; } /* thread, About */
.post-head h1 { font-size: 32px; line-height: 1.2; font-weight: 600; margin: 0; }
/* Post page ladder, in ink: title → points 19.6px; points → post text 24px (the next rung, so the points line stays
   with the title); paragraphs 20px like comments; end of post → first comment 48px (2 × 24: a new section). */
.post-body { margin-top: 9.5px; }
.post-body p { margin: 0 0 4px; }

.id { font: inherit; color: var(--soft); background: none; border: none; padding: 0; cursor: pointer; }
.id:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.actions { font: 15px var(--sans); color: var(--meta); display: flex; align-items: baseline; gap: 18px; }
.actions a, .actions button { color: var(--meta); background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.actions a:hover, .actions button:hover { color: var(--ink); }

textarea, input[type=text], input[type=url], input[type=email] {
  width: 100%; font: 18px/1.5 var(--serif); color: var(--ink); background: var(--paper);
  border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px;
}
textarea:focus, input:focus { border-color: var(--ink); }
textarea::placeholder, input::placeholder { color: var(--meta); opacity: 1; }

.reply { margin: 30px 0 10px; }
.reply textarea { min-height: 100px; resize: vertical; }

/* Soft fill: the search box's pale grey, no border until hover. The secondary (plain) button is just text. */
.button {
  display: inline-block; font: 16px var(--sans); color: var(--ink); background: var(--tint);
  border: 1px solid transparent; border-radius: 4px; padding: 7px 16px; cursor: pointer;
}
.button:hover { text-decoration: none; border-color: var(--border); }
.button.plain { color: var(--soft); background: transparent; border-color: transparent; padding-left: 0; padding-right: 0; }
.button.plain:hover { color: var(--ink); border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
/* Inside a grey notice the fill would vanish, so buttons there sit on the page colour. */
.notice .button:not(.plain) { background: var(--paper); }
.row { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.note { font: 15px var(--sans); color: var(--meta); }

.comments { list-style: none; margin: 0; padding: 0; }
/* A thin line down the left of each set of replies shows which comment they answer. */
/* Reply connectors: rounded elbows (Reddit style). A rail drops from under the parent's name and curves into each
   reply's name line, stopping --gap short of it; it keeps running past a reply when another sibling follows. */
.comments .comments { --rail: 6px; --indent: 26px; --gap: 6px; --mid: 11px; --line-c: color-mix(in srgb, var(--meta) 55%, var(--paper));
                      position: relative; margin-left: 0; padding-left: var(--indent); }
.comments .comments > li.comment { position: relative; }
.comments .comments > li.comment::before {
  content: ""; position: absolute; left: calc(var(--rail) - var(--indent)); top: 0;
  width: calc(var(--indent) - var(--rail) - var(--gap)); height: calc(8px + var(--mid));
  border-left: 1.5px solid var(--line-c); border-bottom: 1.5px solid var(--line-c); border-bottom-left-radius: 10px;
}
.comments .comments > li.comment:not(:last-child)::after {
  content: ""; position: absolute; left: calc(var(--rail) - var(--indent)); top: 0; bottom: 0; border-left: 1.5px solid var(--line-c);
}
/* Each comment holds its own margins, so no slit opens between siblings where the rail must run unbroken. */
li.comment { display: flow-root; }
/* Comment spacing, in ink, on the same ladder as the story list: name line → text 12px (tighter than the text's
   own 16.3px line gap), paragraphs 20px (between a line break and a new comment), comment → next comment 24px
   (2 × 12, the same gap as between stories). */
.comment { padding: 8px 0 0; }
.comment p { margin: 0 0 4px; }
.comment > .text > p:first-child { margin-top: -2.5px; }

/* A reply linking to another MAF thread: a card with a left rule, its title, the first two lines of the
   post and its details. The whole card is one link. */
.embed { display: block; margin: 6px 0 10px; padding: 2px 0 2px 12px; border-left: 3px solid var(--ink); color: inherit; }
.embed:hover { text-decoration: none; }
.embed:hover .embed-title { text-decoration: underline; text-underline-offset: 3px; }
.embed-title { font: 600 18px/1.35 var(--serif); margin: 0; overflow-wrap: anywhere; }
.embed-text {
  margin: 4px 0 0; font: 16px/1.5 var(--serif); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.embed-meta { font: 13px/1.5 var(--sans); color: var(--meta); margin-top: 6px; }
.embed-meta .dot { margin: 0 4px; }
.embed-meta .tag { color: var(--meta); }

/* Hidden post notice */

.notice { background: var(--tint); border-radius: 4px; padding: 16px 18px; margin: 30px 0 0; font-size: 18px; }
.notice p { margin: 0 0 10px; }
/* Live replies banner: stays in view while you scroll the thread. */
.live-replies { position: sticky; top: 12px; z-index: 5; }
.live-show { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer;
             text-decoration: underline; text-underline-offset: 3px; }
/* After Show: new replies say "New" until the next reload; a reaction that went up gets a fading ring. */
.new-tag { display: inline-block; white-space: nowrap; font: 600 13px var(--sans); color: var(--new-ink); background: var(--new-fill); border-radius: 3px; padding: 1px 6px; margin-left: 6px; }
/* The preceding space separates inline badges but collapses at a line break. */
.new-list .meta > .new-tag { margin-left: 0; }
/* Alerts (alerts.js): the note under what you just did, and the line at the bottom of the Feed menu. */
/* Even space inside the note (its last line has no margin below it), and a comment's gap above it. */
.notice.alert-ask { margin-top: 18px; padding: 12px 18px; } /* 12px plus the line's own spacing looks like 18px */
.notice.alert-ask > :last-child { margin-bottom: 0; }
.notice.alert-ask > .row:last-child { margin-bottom: 6px; } /* a button's edge has no line spacing to borrow */
.alert-steps { margin: 4px 0 6px; padding-left: 22px; font: 15px/1.6 var(--sans); }
.share-icon { width: 13px; height: 17px; vertical-align: -3px; margin: 0 2px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bell-alerts { padding: 10px 20px 12px; border-top: 1px solid var(--line); font: 13px/1.5 var(--sans); color: var(--meta); }
.bell-alerts .alert-steps { font-size: 13px; margin: 4px 0 0; }
.tag-menu .bell-alerts .linkish, .tag-menu .bell-alerts .linkish:hover { display: inline; width: auto; padding: 0; font: inherit; color: var(--ink); background: none; }
.linkish { font: inherit; color: var(--ink); background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
/* Folding (fold.js): [–] after a comment's time folds it and its replies to the details line. */
.fold { font: 14px var(--mono); letter-spacing: -1px; color: var(--meta); background: none; border: none; padding: 0; cursor: pointer; }
.fold:hover { color: var(--ink); }
.comment.folded > :not(.meta) { display: none; }
.fold-count { display: none; }
.comment.folded > .meta .fold-count { display: inline; }
/* Inline, so the badge stays on the line with "hidden)" instead of wrapping alone (new-tag is inline-block). */
.meta .new-tag.fold-new { display: inline; }
.react.arrived { box-shadow: 0 0 0 1.5px var(--ink); border-radius: 999px; }
/* Emoji someone else added since your last visit to the post: the New badge's orange, kept on (new.js). */
.react.react-new, .react.react-new:hover { background: var(--new-fill); color: var(--new-ink); }
.react.react-new .react-count { color: inherit; }
.react.arrived.arrived-fade { box-shadow: 0 0 0 1.5px transparent; transition: box-shadow 2.5s ease; }
/* While a form is sending, its text boxes fade (the button already greys out and says what it's doing). */
form[aria-busy="true"] textarea, form[aria-busy="true"] input[type=text], form[aria-busy="true"] input[type=url], form[aria-busy="true"] input[type=email] { opacity: .55; }
/* Form errors: one plain line each, with room before the form. */
.form-errors { margin-bottom: 24px; }
.form-errors ul { list-style: none; margin: 0; padding: 0; }
.form-errors li + li { margin-top: 6px; }
.notice .actions a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.faded { opacity: 0.6; }

/* Forms */

h1.heading { font-size: 32px; font-weight: 600; margin: 34px 0 6px; line-height: 1.2; }
.lede { color: var(--soft); margin: 0 0 26px; }
.field { margin: 0 0 20px; }
.field label { display: block; font: 600 15px var(--sans); margin-bottom: 6px; }
.help { font: 13px var(--sans); color: var(--meta); margin: 6px 0 0; }
.field textarea { min-height: 180px; resize: vertical; }
.small { font: 15px var(--sans); color: var(--meta); margin: 30px 0 0; }

/* How it works */

.prose h2 { font-size: 20px; font-weight: 600; margin: 18px 0 4px; }
.prose p { margin: 0; }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 22px; margin: 0; }

/* ID pop-up */

dialog {
  border: 1px solid var(--line); border-radius: 6px; padding: 20px 22px; max-width: 380px;
  background: var(--paper); color: var(--ink); font-size: 18px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.3); }
dialog p { margin: 0 0 16px; }

/* Footer */

/* Footer: the last content sits --header-gap above it (mirroring the header → first content gap), and the space
   under it matches the space above the header (22px). 7px is the pager line's own offset. */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin: auto 0 0; padding: calc(var(--footer-gap) - 7px) 0 22px; font: 15px var(--sans); color: var(--meta); }
.foot a { color: var(--meta); }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .post-head h1, h1.heading, .profile-name { font-size: 26px; }
  .post-head { padding-top: calc(var(--header-gap) - 23.1px); } /* the smaller title's capitals start 1.7px lower */
  .comments .comments { --indent: 18px; --rail: 4px; --gap: 4px; }
}

/* Date range with arrows to step between 4-day pages */
.range { display: inline-flex; align-items: baseline; gap: 10px; }
.arrow { color: var(--soft); font-size: 20px; line-height: 1; padding: 0 2px; }
a.arrow:hover { color: var(--ink); text-decoration: none; } /* only arrows that lead somewhere react to hover */
span.arrow { color: var(--line); cursor: default; }
.list-flat { margin-top: 18px; }
.reply { margin-top: 4px; }
.reply .row, .inline-reply .row { margin-top: 12px; }
.inline-reply { margin: 10px 0 4px 26px; }
.inline-reply textarea { min-height: 80px; resize: vertical; }
@media (max-width: 560px) { .inline-reply { margin-left: 16px; } }
/* An edit replaces the words in place, so its box lines up with them (no reply indent). */
.inline-reply.edit-in-place { margin-left: 0; }

/* The name check's warning, inside the box it belongs to: same grey box as a notice, under the buttons. */
.name-warning { margin-top: 12px; background: var(--tint); border-radius: 4px; padding: 12px 14px; font: 15px/1.5 var(--sans); }
.name-warning p { margin: 0; }
.name-warning .row { margin-top: 8px; }

/* Hidden posts have no comment box, so the first comment follows the post at normal comment spacing. */
.faded .post-head { padding-bottom: 0; }
.faded .post-body p:last-child { margin-bottom: 6px; }

/* Empty front page */
.empty { text-align: center; font: 15px var(--sans); color: var(--meta); margin: calc(var(--header-gap) - 20.1px) 0 0; }

/* Hashtags: in the details line, and a # button in the search box that lists them all */
.meta .tag { color: var(--meta); }
.meta .tag:hover { color: var(--ink); }
.find { position: relative; }
.find input { padding-right: 10px; } /* no # button here: the clear ✕ sits 10px in, mirroring the text's left padding */
.tag-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; padding: 0; border: none; border-radius: 4px; background: none;
  font: 16px var(--sans); color: var(--meta); cursor: pointer;
}
.tag-toggle:hover, .tag-toggle[aria-expanded="true"] { color: var(--ink); }
.tag-toggle:focus-visible { color: var(--ink); }

.tag-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 10; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
/* Scrolls inside the panel with no scrollbar. Edges fade and a small arrow appears wherever there's more to scroll. */
.tag-scroll { max-height: 260px; overflow-y: auto; padding: 4px 0; scrollbar-width: none; }
.tag-scroll::-webkit-scrollbar { display: none; }
.tag-menu.more-below .tag-scroll { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); }
.tag-menu.more-above .tag-scroll { -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to top, #000 calc(100% - 40px), transparent); }
.tag-menu.more-above.more-below .tag-scroll { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.tag-menu .tag-more {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 1; display: none;
  width: 28px; height: 18px; padding: 0; border: none; background: none; color: var(--meta); cursor: pointer;
}
.tag-menu .tag-more:hover { color: var(--ink); background: none; }
.tag-menu .tag-more.up { top: 2px; }
.tag-menu .tag-more.down { bottom: 2px; }
.tag-menu.more-above .tag-more.up, .tag-menu.more-below .tag-more.down { display: flex; align-items: center; justify-content: center; }
.tag-menu button {
  display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding: 6px 12px;
  font: 15px var(--sans); color: var(--soft); background: none; border: none; text-align: left; cursor: pointer;
}
.tag-menu button:hover { color: var(--ink); background: var(--tint); }
.tag-count { font-size: 13px; color: var(--meta); }
/* Submit: the preset hashtags drop down under the Hashtags box. */
.tag-field { position: relative; }
.tag-suggest { top: calc(100% + 4px); padding: 4px 0; }

/* Search box clear button: same grey as the # button instead of the browser's blue. */
.find input::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 12px; height: 12px; margin: 0 0 0 8px; cursor: pointer;
  background-color: var(--meta);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 2l8 8M10 2l-8 8' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 2l8 8M10 2l-8 8' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.find input::-webkit-search-cancel-button:hover { background-color: var(--ink); }

/* #hottakes: the row sits on a faint ember wash and the tag takes the ember colour, the site's only accent. */
.list li.hot { background: var(--hot-wash); border-radius: 4px; margin: 0 -12px; padding: 8px 12px; }
.list li.hot + li.hot { margin-top: 4px; }
.meta .hot-tag { color: var(--hot); text-decoration: underline; text-underline-offset: 2px; } /* underline too, so it is not colour alone (WCAG 1.4.1) */

/* Private replies: laid out like any comment; the details line says who can see it, with an (i) explaining more. */
.private-note { color: var(--meta); }
.comment p.hidden-comment { font: 15px/1.5 var(--sans); color: var(--meta); margin: -2px 0 5.7px; } /* sits on the 24px comment rhythm like a name line */
/* Positioned, so the (i) card inside it is placed against this, not the whole page. */
.private-toggle { position: relative; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; vertical-align: -2px; }
.private-toggle[hidden] { display: none; }
.sealed-note { font: 15px/1.5 var(--sans); color: var(--meta); }
/* Landing on a reply (after posting, editing or flagging) leaves a little room above it. */
li.comment { scroll-margin-top: 0; } /* a jumped-to comment lands right at the top of the window, as on HN */
/* A long link or unbroken word wraps instead of pushing the page wider than the screen. */
.text, .post-head h1, .post-link, .list .title, .list .host, .notice p { overflow-wrap: anywhere; }
/* Edits under your own reply read as plain reply text, "Edit #N:" included. */
.delete-confirm .help { margin: 0; }
.help .dot { margin: 0 4px; }
.private-toggle label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.private-toggle input { accent-color: var(--ink); width: 13px; height: 13px; margin: 0; }
/* Far enough from the checkbox that each keeps its own 24px tap space (WCAG 2.5.8). */
.private-toggle .info { margin-left: 8px; }

.info {
  display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 4px;
  padding: 0; border: 1px solid var(--meta); border-radius: 50%; background: none; color: var(--meta);
  font: italic 600 10px/1 var(--serif); vertical-align: 1px; cursor: pointer;
}
.info:hover, .info[aria-expanded="true"] { color: var(--ink); border-color: var(--ink); }

.info-card {
  position: absolute; z-index: 20; width: 340px; padding: 16px 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  font: 18px/1.5 var(--serif); color: var(--soft);
}
.info-card p { margin: 0; }
.info-card p + p { margin-top: 8px; }
.info-card .info-title { font: 600 18px var(--serif); color: var(--ink); }
.info-card .info-fine { color: var(--meta); font: 13px/1.5 var(--sans); }

/* Etiquette banner on posts with a tag that has house rules (e.g. #hottakes). Same shape as the notice box, in that tag's colour. */
.notice.etiquette { background: var(--hot-wash); }
.notice.etiquette .etiquette-tag { color: var(--hot); font-weight: 600; }
.notice.etiquette p:last-child { margin-bottom: 0; }

/* The guided reply placeholder on #hottakes threads needs a little more room. */
.hottakes-thread .inline-reply textarea { min-height: 128px; }

/* Accessibility */

/* Skip link: off-screen until a keyboard user tabs to it. */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 30; font: 16px var(--sans); color: var(--paper); background: var(--ink); padding: 6px 12px; border-radius: 4px; }
.skip:focus { left: 20px; }
main { display: block; }

/* Small controls get an invisible 24x24 px tap area (WCAG 2.5.8) without changing how they look. */
.info, .arrow, .meta-action, .actions a, .actions button { position: relative; } /* .tag-more is already absolute, floating over its list */
.info::after, .arrow::after, .meta-action::after, .actions a::after, .actions button::after, .tag-menu .tag-more::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max(100%, 24px); height: max(100%, 24px);
}

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

/* Screen-reader-only text, e.g. the "Pinned to the top" announcement. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Personal pins: a pin at the right of each row, shown on hover or keyboard focus, always shown once pinned. */
.list li { position: relative; } /* no pin button here, so titles run to the same right edge as the header */
.list li.hot { padding-right: 48px; }
.pin {
  --pin-fill: none;
  position: absolute; right: 0; top: 12px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 4px; background: none; color: var(--meta); cursor: pointer;
  opacity: 0; transition: opacity 0.12s ease;
}
.list li.hot .pin { right: 12px; }
.list li:hover .pin, .pin:focus-visible, .list li.is-pinned .pin { opacity: 1; }
.pin:hover { color: var(--ink); }
.list li.is-pinned .pin { --pin-fill: currentColor; color: var(--soft); }
/* Touch screens have no hover, so the pin is always there. */
@media (hover: none) { .pin { opacity: 1; } }

/* Emoji reactions: quiet by default (emoji + count, no box); yours sit on the soft tint. The smiley opens a picker. */
.reactions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.post-reactions { display: flex; margin: -6px 0 4px -6px; }
.comment .actions { align-items: center; }
.actions .reactions { margin-left: -2px; }
.react, .actions .react {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 7px;
  border: none; border-radius: 4px; background: none; font: 13px var(--sans); color: var(--meta); cursor: pointer;
}
.react-emoji { font-size: 15px; line-height: 1; }
.react:hover, .actions .react:hover { background: var(--tint); color: var(--ink); }
.react[aria-pressed="true"], .actions .react[aria-pressed="true"] { background: var(--tint); color: var(--ink); }
.react-add, .actions .react-add {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0;
  border: none; border-radius: 4px; background: none; color: var(--meta); cursor: pointer;
}
.react-add:hover, .actions .react-add:hover, .react-add[aria-expanded="true"] { color: var(--ink); background: var(--tint); }

.emoji-picker {
  position: absolute; z-index: 20; display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; padding: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.emoji-picker[hidden] { display: none; }
.row[hidden], .actions[hidden] { display: none; } /* their flex would otherwise show them */
.emoji-picker button { width: 32px; height: 32px; padding: 0; border: none; border-radius: 4px; background: none; font-size: 18px; line-height: 1; cursor: pointer; }
.emoji-picker button:hover, .emoji-picker button[aria-pressed="true"] { background: var(--tint); }

/* Subscribed: the button stays clickable (a click stops it) but reads as done. */
.subscribe.subscribed { color: var(--meta); }
.subscribe.subscribed:hover { color: var(--ink); }
.subscribe-info, .private-info { position: relative; display: inline-flex; align-items: center; }
.subscribe-info { margin-left: 4px; }

/* Real app only: rules for markup the static mockups didn't need. */

/* Flag, reaction and moderation buttons are small POST forms; they lay out as if the button stood alone. */
.inline-form, .react-form { display: contents; }

/* Reply boxes start hidden. Reply links to the box, so it opens even without JavaScript. */
.inline-reply[hidden]:target { display: block; }
.post-link { font: 15px var(--sans); margin: 16px 0 14px; }
.post-link a { color: var(--soft); text-decoration: underline; text-underline-offset: 3px; }
/* Request unhide / Request deletion are form buttons here; they look like the mockup's links. */
.notice .actions button { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.faded .post-reactions { margin-top: 6px; }
/* A title-only post: no text above the reactions to absorb their pull-up, so give them the same 10px gap a post with text gets. */
.post-head .meta + .post-reactions { margin-top: 10px; }
/* Signed out there's no search box, so the theme toggle keeps its place on the right. */
.top nav + .theme-toggle { margin-left: auto; }
/* Grey notice boxes: even padding (no trailing paragraph margin) and room before whatever follows. */
.notice > :last-child, .notice p:last-child { margin-bottom: 0; }
.notice + form, .notice + .field { margin-top: 24px; }
/* A form error sits under its field, in ink so it reads as more than a hint. */
.help.error { color: var(--ink); }
/* "Send a new code" is a button that reads like the link beside it; grey while it counts down. */
button.note { background: none; border: none; padding: 0; cursor: pointer; }
button.note:hover:not(:disabled) { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
button.note:disabled { cursor: default; }
/* A centered dot between two links in a button row, closer than the row's usual gap. */
.row .dot { margin: 0 -8px; color: var(--meta); font: 15px var(--sans); }
/* Sign Out is a small POST form in the footer; it looks like the footer links beside it. */
.foot button { font: inherit; color: var(--meta); background: none; border: none; padding: 0; cursor: pointer; }
.foot button:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* Links inside page text (About, User Guide) are underlined so they read as links without relying on colour. */
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Replaces an inline style, which the Content-Security-Policy forbids. */
.after-notice { margin-top: 26px; }

/* A flag you've placed shows in blood red; clicking it again takes the flag back. */
.meta-action.flagged, .actions button.flagged { color: var(--danger); font-weight: 600; }
.meta-action.flagged:hover, .actions button.flagged:hover { color: var(--danger); text-decoration: underline; text-underline-offset: 3px; }

/* Code samples (Use this data): a grey box that scrolls sideways on its own instead of pushing the page wider. */
/* Long lines wrap inside the box; a Copy button sits in the top-right corner. */
.prose pre { position: relative; background: var(--tint); border-radius: 4px; padding: 14px 72px 14px 16px; margin: 8px 0 16px; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.5 var(--mono); }
.prose pre .copy { position: absolute; top: 8px; right: 8px; padding: 3px 10px; border: 1px solid transparent; border-radius: 4px; background: var(--paper); font: 13px var(--sans); color: var(--soft); cursor: pointer; }
.prose pre .copy:hover { color: var(--ink); border-color: var(--border); }
.prose .help + pre { margin-top: 6px; }
.token-row { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; font: 15px var(--sans); color: var(--soft); }
.token-row .dot { color: var(--meta); }
.prose code { font: 14px/1.5 var(--mono); }
.prose p code, .prose li code { background: var(--tint); border-radius: 3px; padding: 1px 5px; }
/* Revoke beside a token reads like a small text action, not a browser button. */
.token-row button { padding: 0; border: none; background: none; font: 15px var(--sans); color: var(--soft); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.token-row button:hover { color: var(--ink); }
/* Shown beside Flagged: how flags work, and where to go when it can't wait. */
.flag-note { font: 15px var(--sans); color: var(--meta); }
.flag-note a { color: var(--soft); text-decoration: underline; text-underline-offset: 3px; }
/* A button that can't be used right now (e.g. at the token limit) is greyed out. */
.button:disabled { color: var(--meta); cursor: default; }
.button:disabled:hover { border-color: transparent; }

/* Notifications, left of the theme toggle: "Feed" and a small count tag (muted at 0, bright when something's new),
   and a dropdown like the # menu. */
.bell-wrap { position: relative; display: flex; }
.bell { position: relative; font: 16px var(--sans); color: var(--soft); }
.bell:hover, .bell[aria-expanded="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* Always there and always the same width (room for two digits), so the header never shifts as the count changes. */
.bell-count {
  display: inline-block; min-width: 2.4em; margin-left: 6px; padding: 1px 4px; box-sizing: border-box; text-align: center;
  font: 600 13px var(--sans); color: var(--meta); background: var(--tint); border-radius: 3px;
}
.bell.has-new .bell-count { color: var(--ink); } /* only the number lights up; "Feed" stays as it is */
.bell-menu {
  position: absolute; top: calc(100% + 12px); left: 50%; right: auto; transform: translateX(-50%); z-index: 20;
  width: min(300px, calc(100vw - 32px));
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.bell-menu[hidden] { display: none; }
.bell-item { display: block; padding: 12px 20px; color: var(--ink); }
.bell-item:hover { background: var(--tint); text-decoration: none; }
.bell-what { display: block; font: 15px var(--sans); }
/* Inline, so the badge stays on the line with the label's last word instead of wrapping alone (new-tag is inline-block). */
.bell-what .new-tag { display: inline; margin-left: 8px; }
.bell-meta { display: block; font: 13px var(--sans); color: var(--meta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-menu .tag-scroll { max-height: 440px; padding: 8px 0; }
.bell-list { position: relative; }
.bell-empty { margin: 0; padding: 14px 20px; font: 14px/1.5 var(--sans); color: var(--meta); }
/* bell.js slides the list left (or right) when centring it would go past the window edge. */

/* Markdown in posts and replies (maf/markdown.py). Kept quiet: it should read like text, not a document. */
.text ul, .text ol { margin: 4px 0 10px; padding-left: 24px; }
.text ul { list-style: disc; }
.text ol { list-style: decimal; }
.text a { text-decoration: underline; text-underline-offset: 2px; }
.post-body.text ul, .post-body.text ol { margin: 0 0 16px; }
.text li + li { margin-top: 2px; }
.text blockquote { margin: 6px 0 10px; padding-left: 12px; border-left: 3px solid var(--line); color: var(--soft); }
.text blockquote p { margin: 0; }
/* A profile's "Comment:" sits right on top of its quoted comment (profiles.shown), on the profile and in profiles sent. */
.profile-text p:has(+ blockquote), .profile-replies > li > .text p:has(+ blockquote) { margin-bottom: 0; }
.text code { font: 0.85em var(--mono); background: var(--tint); padding: 1px 4px; border-radius: 3px; }
.text pre { background: var(--tint); border-radius: 4px; padding: 10px 12px; margin: 6px 0 10px; white-space: pre-wrap; font: 14px/1.5 var(--mono); }
.text pre code { background: none; padding: 0; font: inherit; }
.text hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* NSFW: a switch in the header like Dark. On, the word turns ember and lists show only NSFW posts (nsfw.js). */
.nsfw-toggle { font: 16px var(--sans); color: var(--soft); }
.nsfw-toggle:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.nsfw-toggle[data-on], .nsfw-toggle[data-on]:hover { color: #E2805A; }
/* Clicking a switch twice quickly mustn't select its word. */
.theme-toggle, .nsfw-toggle, .dates-toggle { user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
body[data-nsfw] { --paper: var(--nsfw-paper); --tint: var(--nsfw-tint); --meta: var(--nsfw-meta); --hot-wash: color-mix(in srgb, var(--hot) var(--wash), var(--paper)); }
/* After the NSFW rule, so on the Dates page its colour wins even with NSFW on. */
body[data-board="dates"] { --paper: var(--dates-paper); --tint: var(--dates-tint); --meta: var(--nsfw-meta); --hot-wash: color-mix(in srgb, var(--hot) var(--wash), var(--paper)); }
.dates-toggle { font: 16px var(--sans); color: var(--soft); }
.dates-toggle:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.dates-toggle[aria-current], .dates-toggle[aria-current]:hover { color: var(--dates-accent); }
#nsfw-dialog .row, #match-dialog .row, #hide-dialog .row, #unmatch-dialog .row, #send-dialog .row, #delete-dialog .row { display: flex; gap: 14px; align-items: center; }
/* Match's notice is longer than the other pop-ups: a little wider, and no word left alone on a line. */
#match-dialog, #hide-dialog, #unmatch-dialog, #send-dialog, #delete-dialog { max-width: 420px; }
#match-dialog p, #hide-dialog p, #unmatch-dialog p, #send-dialog p, #delete-dialog p { text-wrap: pretty; }
/* Dates threads: Reply with profile sits where the comment box would start; its notice opens just under it. */
.profile-reply .row { margin-top: -12px; } /* 18px under the profile's last line, as a thread's button sits under its box */
.notice.need-profile { margin-top: 12px; }
/* A profile's replies: a grey count, then a line, and the same line between each reply profile. */
:root { --divider: color-mix(in srgb, var(--ink) 18%, transparent); }
.profile-replies-count { margin: 4px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--divider); color: var(--meta); font: 15px var(--sans); }
.profile-replies-count:empty { padding-bottom: 0; }
.profile-reply + .profile-replies-count { margin-top: 20px; } /* under Reply with profile or Edit profile */
.profile-replies > li.comment + li.comment { border-top: 1px solid var(--divider); margin-top: 18px; }
.nsfw-answer, .choice-answer { cursor: pointer; caret-color: transparent; }
/* "Is NSFW?" with its (i) beside it; the card opens under the (i). */
.field .label-row { display: flex; align-items: center; margin-bottom: 6px; }
.field .label-row label { margin-bottom: 0; }
.label-info { position: relative; display: inline-flex; align-items: center; margin-left: 2px; }
.short-date { display: none; }

/* Phones: NSFW and Dark join MAF and Submit on the top row, at the right above Feed; Search and Feed share
   the row below. Sort and the dates fit on one row: no "Sort by:", short dates. */
@media (max-width: 560px) {
  .top .bell-wrap { order: 4; margin-left: auto; }
  .listbar { justify-content: space-between; }
  .sort a, .sort strong, .range { white-space: nowrap; }
  .range { margin-left: auto; } /* if it must wrap (the smallest phones), the dates keep to the right */
  .sort-label, .long-date { display: none; }
  .short-date { display: inline; }
}
@media (max-width: 380px) {
  .sort { gap: 12px; }
  .range { gap: 6px; }
}

/* HN list rows: a rank (or marker) in a fixed gutter, then the title block, like Hacker News' own list. */
.list li { position: relative; padding-left: 34px; }
/* Comments, search and user activity have no rank numbers, so nothing reserves the gutter. */
.list.unranked li { padding-left: 0; }
.rank { position: absolute; left: -2.9px; top: 8.4px; min-width: 22px; text-align: left; font: 15px/27px var(--sans); color: var(--meta); } /* 27px = the title's line box (20px × 1.35); top = row padding (6px) + 2.4px, which puts the smaller sans on the serif's baseline */ /* left-aligned, and -2.9px so the digits' ink starts exactly under the M of MHN */
.list li .title:visited { color: var(--visited); }
/* The thread page's title is a link out, like HN's: keep it looking like a headline. */
.post-title { font-size: 32px; line-height: 1.2; font-weight: 600; margin: 0 0 8px; overflow-wrap: anywhere; }
.post-title a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* User page */

.profile { margin: calc(var(--header-gap) - 24.8px) 0 0; } /* same offset as a thread title: same heading style */
.profile-name { font: 600 32px/1.2 var(--serif); margin: 0; } /* a page title: same as a thread title */
.profile-facts b { font-weight: inherit; color: var(--ink); }
.profile-about { margin-top: 9.5px; } /* details → text 24px, as a thread's points → post text */
.profile-about p { margin: 0 0 4px; } /* paragraphs 20px apart, like comments */
.profile-section { font: 600 18px var(--serif); color: var(--ink); margin: 0; } /* a heading, so full ink like the name above, not interface grey */

/* The header menu (option C from the mockups). Desktop: .menu adds no box, so nav and search stay header items. */
.menu { display: contents; }
.menu-button { display: none; }

/* Below 740px the one-row header no longer fits the column: brand, Dark and ☰ on top; ☰ drops the sections and
   search down over the page. Without JS (.js missing) the menu just stays open, so nothing becomes unreachable. */
@media (max-width: 739px) {
  .top { flex-wrap: nowrap; position: relative; gap: 18px; padding: 22px 0 6px; } /* same padding as desktop: nothing moves when the menu takes over */
  .top .theme-toggle { margin-left: auto; } /* Dark, then ☰ at the far right */
  .menu-button { display: block; color: var(--soft); background: none; border: 0; padding: 4px; margin: -4px; cursor: pointer; }
  .menu-button svg { display: block; width: 22px; height: 22px; }
  .menu-button:hover { color: var(--ink); }
  .menu-button .menu-close-icon, .top.menu-open .menu-button .menu-open-icon { display: none; }
  .top.menu-open .menu-button .menu-close-icon { display: block; }

  .menu { display: block; position: absolute; top: 100%; left: -20px; right: -20px; z-index: 10; padding: 0 20px 14px;
          background: var(--paper); border-bottom: 1px solid var(--border); box-shadow: 0 10px 20px rgba(0, 0, 0, .12); }
  .js .top:not(.menu-open) .menu { display: none; }
  .top .menu nav { display: block; font-size: 18px; }
  .top .menu nav a { display: block; padding: 11px 0; border-bottom: 1px solid var(--border); }
  .top .menu nav a:last-child { border-bottom: 0; }
  .top .menu .find { display: block; margin: 6px 0 0; }
  .top .menu .find input { width: 100%; box-sizing: border-box; font-size: 16px; padding: 8px 10px; }
}

/* Links inside an empty-state message are underlined: there is nothing else on the page to signal they are clickable. */
.empty a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Past: the date range sits centred above the day's front page. */
.listbar-past { justify-content: center; margin: calc(var(--header-gap) - 23.2px) 0 7.9px; } /* header → date --header-gap; date → first story 24px, the same gap as a list → its More line */
.listbar-past .long-date, .listbar-past .short-date { color: var(--soft); } /* same grey as the pager words it replaces */

/* Post → discussion (option 4 + 3): a soft box where HN's comment box sits, opening HN to write, then a hairline
   with the comment count in the middle. Gaps, measured to the line itself: post → box 24px, box → line 24px, line → first comment 24px. */
.add-comment { display: block; margin-top: 15.7px; background: var(--tint); border-radius: 6px; padding: 14px 16px;
               font: 15px var(--sans); color: var(--meta); }
.add-comment b { color: var(--ink); font-weight: 600; }
.add-comment:hover { text-decoration: none; } /* no colour change on hover: only the underline below */
.add-comment:hover b { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.discussion-rule { display: flex; align-items: center; gap: 14px; margin: 15.4px 0 3.7px; font: 15px var(--sans); color: var(--meta); }
.discussion-rule::before, .discussion-rule::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* A list that opens the page (front, new, ask, show, jobs, comments, search) starts --header-gap under the header. */
main > h1.sr-only:first-child + .list { margin-top: calc(var(--header-gap) - 29.2px); }

/* A thread ends on its last comment, whose box carries 8.7px more than the pager line: trim it so the footer gap holds. */
main > #comments:last-child { margin-bottom: -8.7px; }
@media (max-width: 560px) { main > #comments:last-child { margin-bottom: -8.1px; } } /* 17px phone text: 0.6px less */

/* Page-title → its details line: the front page's rule, scaled. There the points line clears the title's descenders
   (5.2px) by one meta x-height (6.7px) = 12px; a 32px title's descenders drop 8.4px, so 15.1px (13.5px on phones). */
.post-head > .meta, .profile-facts { margin-top: 1.5px; }
/* A section heading binds to its list (12px), like a title to its points line. */
.profile-section + .list { margin-top: -6.4px; }
/* The profile → "Recent activity" is the "block" gap (24px), whether the profile ends on details or on about text. */
.profile-section { margin-top: 11.3px; }
.profile:has(.profile-about) + .profile-section { margin-top: 9.6px; } /* merges with the last paragraph's 4px */
/* About has no points line: its title → text is the "block" gap (24px). */
.post-title + .post-body { margin-top: 8.1px; }

/* Phones: 17px text and 26px titles shift a few offsets by fractions of a pixel; these keep the 12 / 24 gaps exact. */
@media (max-width: 560px) {
  .post-head > .meta { margin-top: 1.2px; }
  .profile-facts { margin-top: -0.1px; }
  .post-body { margin-top: 9.7px; }
  .profile-about { margin-top: 9.7px; }
  .profile:has(.profile-about) + .profile-section { margin-top: 10.3px; }
  .post-title + .post-body { margin-top: 9.6px; }
}

/* A link post has no text: its points line → comment box is still the "block" gap (24px). */
.post-head:not(:has(.post-body)) + .add-comment { margin-top: 17.4px; }
@media (max-width: 560px) {
  .comment > .text > p:first-child { margin-top: -2.3px; } /* 17px comment text: name → text stays 12px */
  .comment { padding-top: 8.7px; }                           /* … and comment → comment stays 24px */
  .add-comment { margin-top: 16.3px; }                       /* post text → comment box stays 24px */
}

/* In-page links (root, parent, next, prev, a comment's time) scroll to their target, as on HN, instead of jumping.
   Skipped for people who ask their system to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Lists people type as "- item" / "1. item": the marker they typed hangs in the margin and wrapped lines align with
   the text. Items sit a paragraph apart (20px), and the list sits a paragraph from the text around it. */
.text ul.typed-list, .text ol.typed-list { list-style: none; margin: 0 0 4px; padding-left: 1.1em; } /* outranks .post-body.text ul */
.text .typed-list li { position: relative; margin: 0 0 4px; }
.text .typed-list li::before { content: attr(data-marker); position: absolute; right: calc(100% + 0.35em); color: var(--soft); }
.text .typed-list li + li { margin-top: 0; }

/* Page headings that aren't a post (a user's name, About): the front page's story-title size, below the 24px logo.
   Only a thread's title stays large, because there the title is the content. */
.page-title, .post-head h1.page-title { font: 600 20px/1.35 var(--serif); }
@media (max-width: 560px) { .page-title, .post-head h1.page-title { font-size: 20px; } }
/* Their gaps, retuned for 20px: header → heading --header-gap; name → details 12px (exactly the front page's title →
   points, same size); About's title → text 24px. */
.profile:has(.page-title), .post-head:has(.page-title) { margin-top: 0; padding-top: calc(var(--header-gap) - 23.2px); }
.page-title + .profile-facts { margin-top: -0.2px; }
.post-head h1.page-title + .post-body { margin-top: 9.5px; }
@media (max-width: 560px) {
  .page-title + .profile-facts { margin-top: -0.2px; }
  .post-head h1.page-title + .post-body { margin-top: 9.8px; }
}
/* Thread titles use the same 20px heading, so title → points is the front page's 12px exactly (as on user pages). */
.post-head > h1.page-title + .meta { margin-top: -0.2px; }

/* Poll options: each a line of serif text with its votes on a details line, rows 24px apart like the front page. */
.poll-options { list-style: none; margin: 9.5px 0 0; padding: 0 0 0 34px; } /* indented to the front page's title column, as HN indents them */
.poll-options li { padding: 6px 0 5px; }
.poll-option { font: 18px/1.6 var(--serif); }
/* A ▲ in the indent beside each option, as on HN, so the indent reads as a column; styled like the front page's
   rank numbers and set on the option's line box so it shares its baseline. */
.poll-options li { position: relative; }
.poll-options li::before { content: "▲"; position: absolute; left: -34px; top: 6px; font: 15px/28.8px var(--sans); color: var(--meta); }

/* A list that ends the page with no More line (the past page, any list's last page) still sits --header-gap above
   the footer: without the More line, the last row's padding leaves 8px more than the pager does. */
main > .list:last-child { margin-bottom: -8px; }


/* Footer: an interpunct sets MHN's own About apart from the HN/YC links, spaced like the details-line dots. */
.foot .dot { display: inline-block; width: 19px; margin: 0 -20px; align-self: center; text-align: center; font-size: 0; }
.foot .dot::before { content: "·"; display: inline-block; font: 15px var(--sans); color: var(--meta); transform: translateX(-0.1426em); /* Gill Sans draws "·" 0.1426em right of its box centre */ }

/* Stats (private /stats page): grey labels, ink numbers, rows on the front page's rhythm. */
.stat-current { color: var(--ink); }
.stat-totals { display: flex; gap: 40px; margin: 24px 0 0; }
.stat-totals div { display: flex; flex-direction: column-reverse; }
.stat-totals dt { font: 15px var(--sans); color: var(--meta); }
.stat-totals dd { margin: 0; font: 600 20px/1.35 var(--serif); }
.stat-chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; margin: 24px 0 4px; }
.stat-bar { flex: 1; background: var(--soft); border-radius: 2px 2px 0 0; min-width: 2px; }
.stat-axis { display: flex; justify-content: space-between; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 40px; }
.stat-heading { font: 600 18px var(--serif); margin: 24px 0 4px; }
.stat-rows { list-style: none; margin: 0; padding: 0; font: 15px/1.9 var(--sans); }
.stat-rows li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); }
.stat-num { color: var(--meta); font-variant-numeric: tabular-nums; }
.stat-empty, .stat-note { font: 15px var(--sans); color: var(--meta); }
.stat-note { margin-top: 24px; }
