/*
 * Tchouker — styles from the Claude Design "Tchoukball social network" canvas.
 *
 * Category colors: an element sets `--c` (the category's hex color, inline);
 * its light tint and dark ink are derived here, so a category only stores one color.
 */

/*
 * Fonts, self-hosted (assets/fonts/, see README.md there): variable Archivo (display) and Geist (text),
 * both SIL Open Font License 1.1. Axes limited to what the site uses; Latin + Latin Extended characters.
 */
@font-face {
    font-family: 'Archivo';
    src: url("../fonts/archivo-variable-MtiBJZk.woff2") format('woff2-variations'), url("../fonts/archivo-variable-MtiBJZk.woff2") format('woff2');
    font-weight: 400 900;
    font-stretch: 100% 125%;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Geist';
    src: url("../fonts/geist-variable-pC7yptB.woff2") format('woff2-variations'), url("../fonts/geist-variable-pC7yptB.woff2") format('woff2');
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f3f3f1;
    --surface: #ffffff;
    --surface-muted: #f7f7f5;
    --line: #ebebe7;
    --text: #111315;
    --text-body: #2a2d31;
    --text-muted: #45484d;
    --text-subtle: #5e6166;
    --text-faint: #8c8f94;
    --accent: #ff6248;
    --accent-ink: #b8361f;
    --accent-tint: #fff0ec;
    --danger: #b3261e;

    --font-display: 'Archivo', system-ui, sans-serif;
    --font-body: 'Geist', system-ui, sans-serif;

    --shadow-sm: 0 1px 2px rgba(17, 19, 21, 0.06);
    --shadow-card: 0 1px 2px rgba(17, 19, 21, 0.04), 0 8px 24px rgba(17, 19, 21, 0.04);
    --pill: 999px;
    --tile: 30%;
}

/* Category color helpers */
[style*='--c'],
.has-color {
    --tint: color-mix(in srgb, var(--c) 12%, #ffffff);
    --ink: color-mix(in srgb, var(--c) 55%, #000000);
}
.no-color {
    --c: var(--text-faint);
    --tint: #ededea;
    --ink: var(--text-muted);
}

/* Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    min-height: 100vh;
    background: #ffffff;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a {
    color: var(--text);
}
a:hover {
    color: var(--accent-ink);
}
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
button,
input,
textarea {
    font: inherit;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.contents {
    display: contents;
}
.display {
    font-family: var(--font-display);
    font-stretch: 125%;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}
.site-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
}
.site-nav__link {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}
.site-nav__link:hover {
    text-decoration: underline;
}
.site-nav__user {
    color: var(--text);
    text-decoration: none;
}
.site-nav__user:hover .author__name {
    text-decoration: underline;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    font-family: var(--font-display);
    font-stretch: 125%;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.03em;
    text-decoration: none;
}


/* Buttons */
.btn {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.btn--accent {
    background: var(--accent);
    color: var(--text);
}
.btn--accent:hover {
    color: var(--text);
    filter: brightness(0.96);
}
.btn--dark {
    background: var(--text);
    color: #ffffff;
}
.btn--dark:hover {
    color: #ffffff;
}
.btn svg {
    flex: 0 0 auto;
}

/* Page */
.page > *,
.contents > * {
    min-width: 0;
}
.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.page--narrow .narrow {
    width: 100%;
    max-width: 840px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.page-title {
    margin: 0;
    font-size: 44px;
}
.back-link {
    align-self: flex-start;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
}
.empty {
    margin: 0;
    padding: 28px;
    border-radius: 28px;
    background: var(--bg);
    color: var(--text-subtle);
}

/* Flash messages */
/* Feedback messages: floating at the top of the window, then fading out (no JavaScript). */
.flash {
    position: fixed;
    top: 84px;
    left: 50%;
    z-index: 10;
    width: min(560px, calc(100% - 32px));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    animation: flash-out 0.4s ease-in 6s forwards;
}
.flash p {
    margin: 0;
    padding: 12px 18px;
    border-radius: 18px;
    background: var(--text);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(17, 19, 21, 0.18);
    animation: flash-in 0.25s ease-out;
}
.flash-success p::before {
    content: '✓ ';
    color: #7ee2a8;
}
@keyframes flash-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
}
@keyframes flash-out {
    to {
        opacity: 0;
        visibility: hidden;
    }
}
@media (prefers-reduced-motion: reduce) {
    .flash,
    .flash p {
        animation-duration: 0s;
    }
    .flash {
        animation-delay: 8s;
    }
}

/* Discussions heading + category chips */
.discussions-head {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}
.chip {
    min-height: 44px;
    padding: 0 18px 0 14px;
    border-radius: var(--pill);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}
.chip[aria-current='page'] {
    background: var(--ink);
    color: #ffffff;
}
.chip--all {
    padding: 0 18px;
}
.chip--all[aria-current='page'] {
    background: var(--text);
}
.chip[aria-current='page'] .dot {
    background: #ffffff;
}
.dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: var(--tile);
    background: var(--c);
}


/* Category / topic banner */
.banner {
    border-radius: 32px;
    padding: 32px 36px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    background: var(--tint);
    color: var(--ink);
}
.banner__text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.banner__label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.banner__title {
    margin: 0;
    font-size: 72px;
    line-height: 0.95;
    letter-spacing: -0.05em;
    color: var(--ink);
}
.banner__meta {
    font-size: 16px;
    font-weight: 500;
}
.banner__meta a {
    color: inherit;
}
.banner__links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.banner__links a {
    min-height: 44px;
    padding: 0 16px;
    border-radius: var(--pill);
    background: rgba(255, 255, 255, 0.75);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}
.banner__links a span {
    font-weight: 500;
}

/* Topic cards */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow-card);
}
.topic-card {
    --card-pad: 22px;
    padding: 6px var(--card-pad) 18px;
    scroll-margin-top: 90px;
}
.topic-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0 14px;
}
.tile {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: var(--tile);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tint);
}
.tile::after {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: var(--tile);
    background: var(--c);
}
/* Level-3 title; also "## title" in articles */
.topic-card__name,
.article-body h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.topic-card__name a {
    text-decoration: none;
}
.topic-card__count {
    font-size: 13px;
    color: var(--text-subtle);
}
.topic-card__count a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.see-all {
    min-height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--tint);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.see-all:hover {
    color: var(--ink);
    filter: brightness(0.97);
}

/*
 * Post items (lists and topic cards). Two columns: what you read on the left (title, summary, then
 * the topics at the bottom), details on the right (author, date), smaller and quieter. The item's own width decides
 * (container query): below 560px the details go under the title, in one row.
 */
.post-items {
    list-style: none;
    margin: 0;
    padding: 0;
    container-type: inline-size;
}
.post-item {
    position: relative;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
    align-items: start;
    gap: 8px 32px;
}
.post-item__main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
/* Level-4 title; also "### title" in articles */
.post-item__title,
.article-body h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: -0.015em;
    text-wrap: pretty;
}
.post-item__title a {
    color: var(--text);
    text-decoration: none;
}
/* The title link covers the whole item. */
.post-item__title a::after {
    content: '';
    position: absolute;
    inset: 0;
}
.post-item:hover .post-item__title a,
.post-item__title a:focus-visible {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.post-item__title a:focus-visible {
    outline: none;
}
.post-item__title a:focus-visible::after {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
.post-item__summary {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}
.tldr-badge {
    margin-right: 7px;
    padding: 2px 7px;
    border-radius: var(--pill);
    background: var(--tint);
    color: var(--ink);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: 2px;
}
.post-item__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    padding-top: 2px;
    text-align: right;
    font-size: 13px;
    color: var(--text-subtle);
}
/* Topics at the bottom of the left column; their links stay clickable above the item link. */
.post-item__main .topic-pills {
    position: relative;
    z-index: 1;
    margin-top: 4px;
    gap: 6px;
}
.post-item__byline {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.post-item__byline .author {
    gap: 6px;
}
/* The author link stays clickable above the item link. */
.post-item__byline a.author__name {
    position: relative;
    z-index: 1;
}
.post-item__byline .author__name {
    font-weight: 600;
    color: var(--text-muted);
}
.post-item__date {
    white-space: nowrap;
}
.topic-pills--sm .topic-pill {
    min-height: 24px;
    padding: 0 9px 0 7px;
    gap: 5px;
    font-size: 12px;
}

@container (max-width: 560px) {
    .post-item {
        grid-template-columns: minmax(0, 1fr);
    }
    .post-item__meta {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 6px 12px;
        padding-top: 0;
        text-align: left;
    }
    .post-item__byline {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    .post-item__byline .post-item__date::before {
        content: '·';
        margin-right: 8px;
    }
}

.post-list {
    --card-pad: 22px;
    padding: 6px var(--card-pad);
}
.post-list .post-item:first-child {
    border-top: 0;
}
/* Inside cards, items reach the card's sides so separators span the full width. */
.post-list .post-item,
.topic-card .post-item {
    margin-inline: calc(-1 * var(--card-pad));
    padding-inline: var(--card-pad);
}
/*
 * Content column: lists of cards (home posts, category topics) are limited to the width of a
 * comfortable reading column, centered; page headings and banners keep the full page width.
 */
.content-column {
    width: 100%;
    max-width: 840px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Recently discussed topics (home), above the posts: a compact grid */
.recent-topics {
    padding: 18px 22px 16px;
}
.recent-topics__title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
/* Latest comments (home): "X commented on Y", the date on the right */
.latest-comments__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
}
.latest-comment {
    padding: 8px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-subtle);
}
.latest-comment + .latest-comment {
    border-top: 1px solid var(--line);
}
/* One sentence that wraps as text: the author's name (no avatar) flows inline with it. */
.latest-comment__text {
    flex: 1 1 16em;
    min-width: 0;
}
.latest-comment__text .author {
    display: inline;
}
.latest-comment__text .avatar {
    display: none;
}
.latest-comment__date {
    margin-left: auto;
    white-space: nowrap;
}
.latest-comment__text a {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}
.latest-comment__text a:hover {
    text-decoration: underline;
}
.recent-topics__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 20px;
}
.recent-topic {
    position: relative;
    padding: 8px 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.recent-topic .dot {
    flex: 0 0 auto;
    transform: translateY(-1px);
}
.recent-topic__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.recent-topic__name {
    font-size: 16px;
    font-weight: 650;
    color: var(--text);
    text-decoration: none;
    overflow-wrap: anywhere;
}
/* The name link covers the row. */
.recent-topic__name::after {
    content: '';
    position: absolute;
    inset: 0;
}
.recent-topic:hover .recent-topic__name {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.recent-topic__meta {
    font-size: 13px;
    color: var(--text-subtle);
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.pagination__status {
    font-size: 14px;
    color: var(--text-subtle);
}

/* Article */
.article-head {
    padding: 32px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.topic-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.topic-pill {
    min-height: 34px;
    padding: 0 14px 0 11px;
    border-radius: var(--pill);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--tint);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.topic-pill:hover {
    color: var(--ink);
    filter: brightness(0.97);
}
/*
 * The post this one replies to, after the title and before the TL;DR: a coral card (the design's
 * "Where this article came from" / "Promoted to article" blocks). The whole card is one link.
 */
.reply-to {
    padding: 16px 20px 16px 16px;
    border-radius: 28px;
    background: var(--accent-tint);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    transition: filter 0.15s;
}
.reply-to:hover {
    color: var(--text);
    filter: brightness(0.98);
}
.reply-to:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
.reply-to__icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: var(--tile);
    background: var(--surface);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
}
.reply-to__text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.reply-to__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-ink);
}
.reply-to__title {
    font-size: 19px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.015em;
    text-wrap: pretty;
}
.reply-to:hover .reply-to__title {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.reply-to__summary {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
.reply-to__arrow {
    flex: 0 0 auto;
    color: var(--accent-ink);
    transition: transform 0.15s;
}
.reply-to:hover .reply-to__arrow {
    transform: translateX(3px);
}
@media (prefers-reduced-motion: reduce) {
    .reply-to,
    .reply-to__arrow {
        transition: none;
    }
}
@media (max-width: 720px) {
    .reply-to {
        padding: 14px 16px 14px 14px;
        gap: 12px;
    }
    .reply-to__icon {
        width: 36px;
        height: 36px;
    }
    .reply-to__title {
        font-size: 17px;
    }
    .reply-to__arrow {
        display: none;
    }
}

.article-title {
    margin: 0;
    font-size: 64px;
    line-height: 0.98;
    letter-spacing: -0.05em;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    color: var(--text-subtle);
}

/* Author: avatar (initials, or a dashed circle when anonymous) + name */
.author {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.author__name {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
}
.avatar {
    --size: 24px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--text);
    color: var(--surface);
    font-family: var(--font-display);
    font-size: calc(var(--size) * 0.4);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
}
.author--lg .avatar {
    --size: 36px;
}
.avatar--anonymous {
    background: transparent;
    border: 1.5px dashed var(--text-faint);
}
.author:has(.avatar--anonymous) .author__name {
    font-weight: 500;
    color: var(--text-subtle);
}
a.author__name {
    text-decoration: none;
}
a.author__name:hover,
a.author__name:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}
/* "Anonymous" links to the anonymous page, without any hover effect. */
.author:has(.avatar--anonymous) a.author__name:hover {
    text-decoration: none;
}

/* Profile page */
.profile-banner {
    justify-content: flex-start;
    align-items: center;
}
.profile-banner__avatar {
    --size: 112px;
}
.profile-banner__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.profile-intro {
    margin-bottom: 24px;
}
.profile-intro p {
    margin: 0;
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}
.tldr {
    padding: 26px 30px;
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--text);
    color: #ffffff;
}
.tldr h2 {
    margin: 0;
    align-self: flex-start;
    padding: 4px 11px;
    border-radius: var(--pill);
    background: #ffffff;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.tldr p {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
}
.article-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.article-body {
    padding: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-body);
}
.article-body > * {
    margin: 0;
}

/*
 * Article content (Markdown). Headings are shifted one level ("# title" is an <h2>) and share the
 * site's title styles: h2 with .related__title, h3 with .topic-card__name, h4 with .post-item__title.
 */
.article-body :is(h2, h3, h4, h5, h6) {
    color: var(--text);
}
.article-body > :is(h2, h3, h4, h5, h6):not(:first-child) {
    margin-top: 16px;
}
.article-body h5 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.article-body h6 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
.article-body a {
    color: var(--accent-ink);
    text-underline-offset: 3px;
}
.article-body strong {
    font-weight: 650;
    color: var(--text);
}
.article-body :is(ul, ol) {
    padding-left: 1.4em;
}
.article-body li + li,
.article-body li > :is(ul, ol) {
    margin-top: 6px;
}
.article-body li::marker {
    color: var(--text-faint);
}
.article-body blockquote {
    padding: 4px 0 4px 20px;
    border-left: 4px solid var(--accent);
    color: var(--text-muted);
    font-style: italic;
}
.article-body blockquote > * {
    margin: 0;
}
.article-body blockquote > * + * {
    margin-top: 12px;
}
.article-body code {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
}
.article-body pre {
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    overflow-x: auto;
    font-size: 15px;
    line-height: 1.6;
}
.article-body pre code {
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
}
.article-body hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
}
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}

/* Votes (post page): one form per option, in the option's color */
.votes {
    margin-top: 48px;
    padding: 22px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.votes__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.related__count {
    color: var(--text-faint);
}

/* Discussion under an article, most recent first: comments (posts without title) shown in full, mixed with
   reactions (articles replying to it) shown as the usual post card. */
/* "Reply with an article", below the comment form (or the invitation to sign in). */
.comment-signin,
.discussion-reply {
    margin: 0;
    padding: 20px 24px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    color: var(--text-subtle);
}
.discussion {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.comment {
    padding: 16px 18px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-margin-top: 90px;
}
.comment:target {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint);
}
.comment__meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-subtle);
}
.comment__date {
    color: inherit;
    text-decoration: none;
}
.comment__date:hover {
    text-decoration: underline;
}
.comment__content {
    margin: 0;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-body);
    overflow-wrap: anywhere;
}
.votes__options {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.votes__options form {
    margin: 0;
}
.vote-option {
    min-height: 44px;
    padding: 0 18px;
    border: 2px solid transparent;
    border-radius: var(--pill);
    background: var(--tint);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: inherit;
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
}
.vote-option:hover {
    border-color: var(--c);
}
.vote-option:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
.vote-option[aria-pressed='true'] {
    background: var(--c);
    color: #ffffff;
}
.votes__note {
    margin: 0;
    font-size: 14px;
    color: var(--text-subtle);
}
/* Results, once you voted: each option's share; the bar is the share + 1px so 0% still shows. */
.vote-results {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) 3.5em;
    align-items: center;
    gap: 8px 12px;
    font-size: 14px;
}
.vote-result {
    display: contents;
}
.vote-result__name {
    font-weight: 600;
    color: var(--ink);
}
.vote-result__bar {
    width: calc(var(--share) + 1px);
    max-width: 100%;
    height: 10px;
    border-radius: var(--pill);
    background: var(--c);
}
.vote-result__share {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-subtle);
}
.votes__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}
.votes__footer form {
    margin: 0;
}
.votes__remove {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* Related posts (post page) */
.related {
    margin-top: 56px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
/* Level-2 title; also "# title" in articles */
.related__title,
.article-body h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

/* Forms */
.form-intro {
    margin: -4px 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--text-subtle);
}
.form-intro > p {
    margin: 0;
}
.form-card__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Write a post: steps and topic choice */
.steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-faint);
}
.steps__item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.steps__number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    border: 1.5px solid currentColor;
    font-size: 13px;
}
.steps__item.is-current {
    color: var(--text);
}
.steps__item.is-current .steps__number {
    border-color: var(--accent);
    background: var(--accent);
}
.steps__item.is-done {
    color: var(--text-subtle);
}
.steps__item.is-done a {
    color: inherit;
}
.topic-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.topic-group__name {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
.topic-choices {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.form-card {
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-card form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-card label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
}
.form-card input[type='text'],
.form-card input[type='email'],
.form-card select,
.form-card textarea {
    width: 100%;
    border: 0;
    border-radius: 16px;
    padding: 12px 16px;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}
.form-card input[type='text'],
.form-card input[type='email'],
.form-card select {
    min-height: 48px;
}
.form-card textarea {
    resize: vertical;
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    outline: 3px solid var(--accent);
    outline-offset: 0;
}
.form-card .help-text {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-subtle);
}
.form-card form ul {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
}
/* Checkbox row: box and label side by side, help text below */
.form-card div:has(> input[type='checkbox']) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}
.form-card div:has(> input[type='checkbox']) label {
    margin: 0;
}
.form-card div:has(> input[type='checkbox']) .help-text {
    flex-basis: 100%;
    margin-top: 0;
    padding-left: 30px;
}
.form-card input[type='checkbox'] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}
.form-author {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}
.form-author__label {
    color: var(--text-subtle);
}
.form-note {
    margin: 0;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--accent-tint);
    color: var(--text-muted);
    font-size: 15px;
}
.form-note p {
    margin: 0;
}
.form-note p + p {
    margin-top: 8px;
}
.form-note strong {
    color: var(--text);
}
.form-note a {
    color: var(--accent-ink);
    font-weight: 600;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
}
.form-intro a {
    color: var(--accent-ink);
    font-weight: 600;
}
.form-card input.code-input {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.3em;
    font-variant-numeric: tabular-nums;
}

/* Phone */
@media (max-width: 720px) {
    .profile-banner__avatar {
        --size: 72px;
    }
    .site-header__inner {
        padding: 10px 16px;
        gap: 8px;
    }
    .brand {
        gap: 9px;
        margin-right: auto;
        font-size: 20px;
    }
    .brand img {
        width: 28px;
        height: 28px;
    }
    .page {
        padding: 8px 16px 40px;
        gap: 16px;
    }
    .page-title {
        font-size: 34px;
    }
    .chips {
        flex: 1 1 100%;
        min-width: 0;
        margin: 0 -16px;
        padding: 2px 16px 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .chip {
        flex: 0 0 auto;
    }
    .banner {
        padding: 22px;
        border-radius: 28px;
    }
    .banner__title {
        font-size: 42px;
        line-height: 1;
    }
    .topic-card {
        --card-pad: 18px;
        padding: 4px var(--card-pad) 14px;
        border-radius: 24px;
    }
    .article-head {
        padding: 16px 0 12px;
        gap: 20px;
    }
    .article-content {
        gap: 24px;
    }
    .article-body {
        gap: 20px;
    }
    .related {
        margin-top: 40px;
    }
    .article-title {
        font-size: 38px;
    }
    .tldr {
        padding: 22px;
    }
    .form-card {
        padding: 24px 22px;
    }
}

/* Account page (/account) */
.account {
    display: flex;
    flex-direction: column;
    gap: 48px;
}
.account__section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.account__note {
    margin: 0 0 4px;
    color: var(--text-subtle);
}
.account-profiles {
    margin: 0;
    padding: 8px 0;
    list-style: none;
}
.account-profile {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    padding: 14px 24px;
}
.account-profile + .account-profile {
    border-top: 1px solid var(--line);
}
.account-profile__details {
    color: var(--text-subtle);
    font-size: 15px;
}
.account-profile__last-used,
.pending-badge {
    padding: 3px 10px;
    border-radius: var(--pill);
    background: var(--bg);
    color: var(--text-subtle);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.account-profile__last-used {
    margin-left: auto;
}
.pending-badge {
    vertical-align: 3px;
}
