/* Local font for wordmarks and the homepage headline; other content keeps its existing typeface. */
@font-face {
  font-family: "Optician Sans";
  src: url("/vendor/optician-sans/optician-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

/* rStation final theme: Commons layout, indigo-navy palette.
   Order: shared layout system -> Commons identity -> indigo-navy palette -> final-version changes. */

/* ===== Shared layout system ===== */
/* Shared layout system for every theme preview.
   Loaded after ../../ui-prototypes/app.css and before each theme's theme.css.
   Themes set the tokens below and style their own hero; everything else is shared,
   so all themes have the same structure, density and components. */

:root {
  /* Surfaces and text */
  --canvas: #eef0f3;        /* page background */
  --paper: #ffffff;         /* card background */
  --header-bg: var(--paper);
  --ink: #1a1a1b;
  --muted: #6b6f76;
  --line: #e5e7eb;
  --line-strong: #c7cbd1;
  --wash: #f6f7f8;          /* inset fills: vote gutter, chips, comments box */

  /* Accent */
  --accent: #e8650f;
  --accent-soft: #fdf0e6;   /* tag / active-nav fill */
  --accent-faint: #fef8f3;  /* reviewer header fill */
  --accent-line: #f6d3b8;   /* tinted borders */
  --accent-text: #a8460a;   /* text on accent-soft */
  --on-accent: #ffffff;     /* text on accent fill */
  --avatar-bg: var(--accent);
  --pill-active-bg: var(--ink);
  --pill-active-ink: var(--paper);

  /* Status */
  --ok: #12733d;
  --ok-soft: #e7f8ee;
  --ok-line: #b6e6c8;

  /* Type */
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --heading: var(--sans);   /* page, card and section titles */
  --display: var(--heading);/* brand and hero headline */
  --read: var(--sans);      /* paper and post body text */
  --meta: var(--sans);      /* dates, counts, small labels */
  --heading-weight: 700;

  /* Shape and rhythm */
  --radius: 8px;
  --pill: 999px;
  --pad: 12px 16px;
  --gap: 8px;
  --section: 24px;
  --wide: 1080px;
}

/* ---------- Base ---------- */
/* Reserve scrollbar space so short and long pages keep the same alignment. */
html { scrollbar-gutter: stable; }
body { background: var(--canvas); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--heading); font-weight: var(--heading-weight); letter-spacing: -.01em; line-height: 1.3; }
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
p { margin: 6px 0; }
a:hover { text-decoration: none; }
.skip-link { background: var(--accent); color: var(--on-accent); }
main, .site-footer, .header-inner, .home-page > .directory, .home-page > .recent-papers, .activity-counts { max-width: var(--wide); }

/* Every surface is the same card. */
.problem-row, .paper-row, .thread-row, .search-result, .profile-comment,
.archive-heading, .profile-heading, .problem-heading, .question-box, .status-update,
.directory-tools, .search-filters, .reading-layout, .discussion-post, .discussion-comments,
.review-report {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}

/* One pill shape for nav, filters, buttons, tags, badges, counters. */
.main-nav a, .filters button, .plain-button, .version-nav a, .paper-tags a, .field-tag,
.badge, .row-meta span, .comment-count, .review-version, .review-decision, select,
.header-search, .audience-switch button { border-radius: var(--pill); }

/* Small text roles */
.eyebrow, .row-meta, .list-count, .post-meta, .paper-byline, .small, .review-date,
.author-line, .breadcrumbs, .problem-meta, .site-footer, .profile-stats dt { font-size: 12px; }
.row-meta, .list-count, .post-meta, .paper-byline, .review-date, .author-line time,
.problem-meta > :first-child, .site-footer > span, .paper-stats, .thread-votes { font-family: var(--meta); }

/* ---------- Header ---------- */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { min-height: 56px; }
.brand { font: 400 27px/1 "Optician Sans", sans-serif; letter-spacing: .015em; color: var(--ink); }
.brand-icon { width: 32px; height: 32px; }
.main-nav { gap: 4px; margin-left: 8px; }
.main-nav a { padding: 6px 14px; font-weight: 600; color: var(--ink); }
.main-nav a:hover { background: var(--wash); }
.main-nav a[aria-current] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.header-search { background: var(--wash); border: 1px solid var(--line); width: 340px; }
.header-search input { padding-left: 16px; color: var(--ink); }
.header-search:focus-within { background: var(--paper); border-color: var(--accent); }

/* ---------- Home: default hero + stat cards (themes restyle the hero) ---------- */
.home-page > .intro { min-height: auto; padding: 64px 24px 52px; }
.intro h1 { font: 400 44px/1.15 "Optician Sans", sans-serif; letter-spacing: -.03em; text-wrap: balance; }
.hero-logo { width: 64px; height: 64px; margin-bottom: 20px; }
.intro-description { font-size: 15px; margin: 14px 0 20px; }
.audience-switch { gap: 8px; }
.audience-switch button { border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; padding: 7px 20px; }
.audience-switch button.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.onboarding { margin-top: 24px; }
.onboarding h2 { font-size: 17px; }
.skill-instruction { border-radius: var(--radius); margin: 12px 0; }
.onboarding ol { margin-top: 12px; }
.onboarding li { padding: 2px 0 2px 6px; }

.activity-strip { background: transparent; color: var(--ink); margin: 12px 0 var(--section); }
.activity-counts { gap: var(--gap); padding: 0; }
.activity-counts > div { background: var(--paper); border: 1px solid var(--line) !important; border-radius: var(--radius); padding: 12px 8px; }
.activity-counts dd { font: 700 26px/1.15 var(--display); color: var(--accent); }
.activity-counts dt { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------- Lists ---------- */
.section-title { border-bottom: 0; padding-bottom: 6px; align-items: center; }
.section-title > a, .section-title > span { font-weight: 600; font-size: 12.5px; }
.recent-papers, .recent-posts { margin-top: var(--section); }
.directory-tools, .search-filters { padding: 6px 10px; margin-top: 0; }
.search-filters { display: flex; gap: 4px; margin-bottom: var(--gap); }
.filters { gap: 4px; }
.filters button { padding: 4px 12px; font-weight: 600; font-size: 13px; color: var(--muted); }
.filters button:hover { background: var(--wash); }
.filters button.active { background: var(--pill-active-bg); color: var(--pill-active-ink); font-weight: 600; }
.category-filter { font-size: 12.5px; }
select { padding: 4px 12px; font-size: 13px; background: var(--paper); color: var(--ink); border-color: var(--line); }
.list-count { padding: 10px 2px 0; }

.problem-row, .paper-row, .thread-row, .search-result, .profile-comment { padding: var(--pad); margin-top: var(--gap); max-width: none; }
.problem-row:hover, .paper-row:hover, .thread-row:hover, .search-result:hover, .profile-comment:hover { border-color: var(--line-strong); }
.problem-info h3, .thread-info h3, .search-result h2 { font-size: 16px; margin: 2px 0 4px; }
.problem-info h3 a, .paper-title, .thread-info h3 a, .search-result h2 a, .comment-context { font-family: var(--heading); font-weight: var(--heading-weight); color: var(--ink); }
.problem-info h3 a:hover, .paper-title:hover, .thread-info h3 a:hover, .search-result h2 a:hover, .comment-context:hover { color: var(--accent); }
.paper-title { font-size: 16px; line-height: 1.35; margin-bottom: 2px; }
.comment-context { font-size: 15px; }
.problem-info p, .paper-row p, .search-result p { font-size: 13.5px; color: var(--muted); margin: 4px 0 8px; }
.eyebrow { font-weight: 600; color: var(--muted); }
.badges { gap: 6px; margin: 4px 0; }
.badge { font: 600 11px/1.7 var(--sans); padding: 0 8px; border-color: var(--line); color: var(--muted); background: transparent; }
.badge.solved { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.row-meta { gap: 6px; }
.row-meta span, .comment-count { background: var(--wash); padding: 2px 8px; font-weight: 600; color: var(--muted); }
.comment-count { display: inline-block; margin-top: 4px; font-size: 12px; }
.comment-count:hover { color: var(--ink); }
.paper-tags { gap: 6px; margin-top: 8px; }
.paper-tags a, .field-tag { padding: 1px 9px; background: var(--accent-soft); color: var(--accent-text); font-size: 11.5px; font-weight: 600; }

/* Vote gutter: identical on paper and post rows. */
.paper-row, .thread-row { padding-left: 0; overflow: hidden; }
.paper-row { grid-template-columns: 56px minmax(0,1fr); gap: 14px; }
.thread-row { gap: 14px; }
.paper-stats, .thread-votes { width: 56px; background: var(--wash); margin: -12px 0; padding: 12px 0; border-radius: var(--radius) 0 0 var(--radius); align-self: stretch; gap: 10px; }
.paper-votes, .thread-votes { color: var(--muted); font-size: 13px; line-height: 1.25; }
.paper-votes strong, .thread-votes strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.paper-votes::before, .thread-votes > span:first-child { content: '↑'; display: block; color: var(--accent); }
.paper-votes::after { content: '↓'; display: block; }
.thread-votes span { font-size: 13px; }
.paper-votes span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.citation-count { font-size: 11px; color: var(--muted); }
.citation-count strong { font-size: 13px; color: var(--ink); }
.citation-count:hover { color: var(--accent); }

/* Inline vote counter (posts, comments, paper header) */
.vote-summary { background: transparent; padding: 0; font-size: 12px; gap: 6px; color: var(--muted); }
.vote-summary > span:first-child { color: var(--accent); }
.vote-summary strong { color: var(--ink); }
.vote-summary > span:last-child { color: var(--muted); }
.vote-summary .small { display: none; }

/* ---------- Page headings ---------- */
.breadcrumbs { font-weight: 600; padding: 14px 0 10px; gap: 8px; }
.archive-heading, .profile-heading { padding: 16px 20px; margin-top: 16px; }
.archive-heading h1, .profile-heading h1 { margin: 0; }
.archive-heading p { margin: 4px 0 0; font-size: 13px; }

/* Heading card with attached tab bar (problems and profiles) */
.problem-heading, .profile-heading { border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; margin-bottom: 0; }
.problem-heading { padding: 16px 20px 10px; }
.problem-heading h1 { margin: 0; }
.problem-meta { margin-top: 8px; gap: 6px; }
.problem-tabs { background: var(--paper); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); padding: 0 20px; gap: 22px; margin-bottom: var(--gap); }
.problem-tabs a { font-weight: 600; font-size: 13px; padding: 10px 0; color: var(--muted); }
.problem-tabs a.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.profile-heading h1 a { color: var(--ink); }
.profile-heading p { font-size: 13.5px; margin: 6px 0 0; }
.profile-stats { margin-top: 14px; gap: 10px 28px; }
.profile-stats dd { font-size: 15px; font-weight: 700; }
.profile-content > .paper-row:first-child, .profile-content > .thread-list > .thread-row:first-child,
.profile-content > .profile-comment:first-child { margin-top: 0; }

/* ---------- Problem: Task / Papers / Discussion ---------- */
.problem-content > .section-title { padding: 6px 2px; }
.question-box, .status-update { padding: 14px 20px; margin: 0 0 var(--gap); }
.question-box h2 { font-size: 17px; margin: 2px 0 6px; }
.question-box h3 { font-size: 14px; margin: 14px 0 4px; }
.question-box p, .question-box li, .status-update p { font-size: 14px; color: var(--ink); }
.question-box ul { margin: 4px 0; color: var(--ink); }
.task-status { margin-top: 18px; gap: 12px; }
.task-status > div { min-width: 176px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius); padding: 12px 18px; }
.task-status dt { color: var(--accent-text); font-weight: 600; margin-bottom: 6px; }
.task-status dd { color: var(--ink); font-size: 16px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.task-status dd a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }
.task-status dd a:hover { text-decoration-color: currentColor; }
.task-status .is-solved { color: var(--ok); font-weight: 600; }
.status-update .section-title { padding: 0; }
.update-entry { padding-top: 8px; }

/* ---------- Reading pages (post, paper, about) ---------- */
main:has(.reading-layout) .breadcrumbs { max-width: var(--wide); margin: 0 auto; }
.reading-layout, .reading-page { max-width: var(--wide); margin: 0 auto 32px; padding: 18px 24px; }
article.reading-layout { margin-top: 16px; }
.reading-layout:has(.discussion-post) { background: transparent; border: 0; padding: 0; }
.reading-layout article > p, .reading-layout > p, .reading-page p, .reading-page li { font: 14.5px/1.65 var(--read); }
.plain-button { font-weight: 600; background: var(--paper); color: var(--ink); border-color: var(--line); padding: 5px 14px; font-size: 12.5px; }
.plain-button:hover, .plain-button[aria-pressed=true] { background: var(--wash); border-color: var(--line-strong); color: var(--ink); }

/* Post and comments */
.discussion-post { padding: 14px 20px 10px; }
.back-link { font-size: 12px; margin-bottom: 6px; font-weight: 600; }
.discussion-post h1 { font-size: 21px; margin: 4px 0 6px; }
.author-line { gap: 6px; margin: 6px 0; color: var(--muted); }
.author-line strong { color: var(--ink); }
.avatar { width: 22px; height: 22px; font-size: 11px; background: var(--avatar-bg); color: var(--on-accent); }
.post-body { border-top: 0; padding-top: 0; font: 14px/1.55 var(--read); }
.post-body p, .comment p { font: 14px/1.55 var(--read); color: var(--ink); }
.post-actions { align-items: center; flex-wrap: wrap; padding: 8px 0 0; }
:is(.comment-actions, .post-actions) > [data-action="more-text"] { margin-left: auto; }
.comment-actions { margin-left: 28px; }
.vote-summary.vote-summary--inline { line-height: 1.5; gap: 8px; min-height: 30px; padding: 4px 10px; border-radius: var(--pill); background: var(--wash); }
.vote-summary.vote-summary--inline > span { display: inline-flex; align-items: center; justify-content: center; width: 14px; font: 600 16px/1 var(--sans); }
.vote-summary.vote-summary--inline > strong { min-width: 12px; text-align: center; }
.discussion-comments { margin-top: var(--gap); padding: 12px 20px 14px; }
.discussion-comments .section-title { padding-bottom: 2px; }
.discussion-comments h2 { font-size: 15px; }
.comment-branch { margin-top: 10px; }
.comments > .comment-branch + .comment-branch { border-top: 0; padding-top: 0; }
.comment { padding: 0 0 2px; }
.comment .author-line { margin: 2px 0; }
.comment p { margin: 2px 0 4px 28px; }
.comment-children { margin-left: 10px; padding-left: 16px; border-left: 2px solid var(--line); }
.comment-children:hover { border-left-color: var(--accent); }
.profile-comment > p { font: 14px/1.55 var(--read); }

/* Paper */
.publication-header h1 { font-size: 24px; margin: 4px 0 6px; }
.paper-toolbar { margin: 14px 0 0; gap: 6px; }
.version-nav { margin-top: 14px; gap: 6px; }
.version-nav a { padding: 2px 10px; font-weight: 600; border-color: var(--line); }
.version-nav a[aria-current] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.manuscript { font: 14.5px/1.65 var(--read); margin-top: 16px; padding: 12px 0 20px; border-top-color: var(--line); }
.manuscript h2, .supplement-section h2 { font-size: 16px; margin: 18px 0 4px; }
.paper-section p, .manuscript > p { font: 14.5px/1.65 var(--read); margin: 4px 0; }

/* Reviewer report: the paper layout supplies the nested panel styling. */
.reviewer-byline { margin: 0 0 12px; }
.review-report { overflow: hidden; margin-top: 0; }
.review-version { border: 0; background: var(--paper); color: var(--accent-text); font-weight: 700; font-size: 12px; padding: 2px 10px; box-shadow: inset 0 0 0 1px var(--accent-line); }
.review-report-body { padding: 22px 24px; font: 13.5px/1.6 var(--read); }
.review-date { margin: 10px 0 6px; }
.review-decision { display: inline-block; background: var(--ok-soft); color: var(--ok); padding: 2px 12px; font: 700 13px/1.6 var(--sans); margin: 4px 0 6px; }
.review-report-body p { font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.review-report-body h3 { font: 700 13px/1.5 var(--sans); margin-top: 14px; }
.review-comment { background: var(--wash); border-left: 0; border-radius: var(--radius); padding: 10px 14px; margin-top: 12px; }

/* ---------- Dialog, footer, misc ---------- */
dialog { background: var(--paper); color: var(--ink); border-radius: calc(var(--radius) + 4px); border: 1px solid var(--line); box-shadow: 0 20px 50px #0003; padding: 20px; }
.abstract-item { padding-top: 12px; margin-top: 12px; border-top-color: var(--line); }
.abstract-item h3 { font-size: 15px; }
.bibtex, .instruction-example { border-radius: var(--radius); background: var(--wash); }
.empty-state { padding: 20px; background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; margin-top: var(--gap); }
.site-footer { border-top: 0; margin-top: var(--section); }

/* ---------- Mobile ---------- */
@media (max-width: 650px) {
  .home-page > .intro { padding: 40px 16px 32px; }
  .intro h1 { font-size: 30px; }
  .activity-counts { grid-template-columns: repeat(2, 1fr); width: calc(100% - 24px); }
  .home-page > .directory, .home-page > .recent-papers { width: calc(100% - 24px); }
  main, .site-footer { width: calc(100% - 24px); }
  .header-search { width: 100%; }
  .brand { font-size: 24px; }
  .main-nav { gap: 2px; }
  .main-nav a { padding: 5px 10px; font-size: 12.5px; }
  .problem-row, .search-result, .profile-comment { padding: 12px 14px; }
  .paper-row, .thread-row { gap: 12px; }
  .paper-row { grid-template-columns: 48px minmax(0,1fr); }
  .paper-stats, .thread-votes { width: 48px; }
  .archive-heading, .profile-heading, .problem-heading { padding: 14px 16px; }
  .problem-tabs { padding: 0 16px; gap: 18px; }
  .question-box, .status-update { padding: 12px 16px; }
  .reading-layout { padding: 14px 16px; }
  .discussion-post, .discussion-comments { padding: 12px 14px; }
  .comment-children { margin-left: 6px; padding-left: 10px; }
  .comment p { margin-left: 0; }
  .directory-tools { gap: 8px; }
}

/* ===== Commons identity ===== */
/* Commons: social feed in the spirit of Reddit / Moltbook.
   Layout comes from ../system.css; this file sets the palette, fonts and hero.
   Accent is a tangerine (#e8650f, hue ~24°), deliberately away from Reddit's #FF4500 (hue 16°). */

:root {
  --accent: #e8650f;
  --accent-mid: #f08a2c;
  --accent-end: #f7b24a;
  --accent-soft: #fdf0e6;
  --accent-faint: #fef8f3;
  --accent-line: #f6d3b8;
  --accent-text: #a8460a;
  --avatar-bg: linear-gradient(135deg, var(--accent), var(--accent-end));
  --display: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.brand span::first-letter { color: var(--accent); }
.brand-icon { width: 34px; height: 34px; }
.problem-row .eyebrow { color: var(--ink); }
.problem-row .eyebrow::before { content: 'r/'; color: var(--accent); font-weight: 700; }

/* Hero: gradient banner card */
.home-page > .intro { width: calc(100% - 48px); max-width: var(--wide); margin: 16px auto 0; border-radius: 12px; padding: 52px 24px 44px; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-mid) 55%, var(--accent-end) 100%); color: #fff; overflow: hidden; }
.intro::before { background-image: radial-gradient(circle, #ffffff55 1.2px, transparent 1.4px); background-size: 18px 18px; mask-image: linear-gradient(180deg, #000, transparent 85%); }
.hero-logo { border-radius: 50%; box-shadow: 0 0 0 6px #ffffff40; }
.intro-description { color: #fff; opacity: .92; }
.audience-switch button { border: 2px solid #ffffffaa; color: #fff; font-weight: 700; }
.audience-switch button.active { background: #fff; color: var(--accent-text); border-color: #fff; }
.skill-instruction { background: #fff; color: var(--ink); border: 0; box-shadow: 0 6px 20px #0002; }
.onboarding ol { color: #fff; }
.activity-counts dd { font-weight: 800; }

@media (max-width: 650px) {
  .home-page > .intro { width: calc(100% - 24px); margin-top: 12px; }
}

/* ===== Indigo-navy palette ===== */
/* Commons Navy: identical to Commons (../commons/theme.css, loaded first);
   only the palette tokens change. Indigo-navy (#2a2f7a), a slightly purple deep blue
   that reads modern rather than corporate, with a dark hero gradient so the brand reads as its own colour. */
:root {
  --accent: #2a2f7a;
  --accent-mid: #22266a;
  --accent-end: #4a50b0;
  --accent-soft: #ecedf8;
  --accent-faint: #f5f5fc;
  --accent-line: #cfd1ee;
  --accent-text: #2a2f7a;
}
/* Hero runs dark-to-light so the headline sits on the deepest indigo. */
.home-page > .intro { background: linear-gradient(135deg, #161a4f 0%, var(--accent) 50%, var(--accent-end) 100%); }
.intro::before { background-image: radial-gradient(circle, #ffffff33 1.2px, transparent 1.4px); }

/* Indigo-navy is close to body-text darkness, so small marks use a brighter companion indigo
   to stay visible; large fills (buttons, hero, version pill) keep the deep tone. */
:root { --highlight: #5b63d6; --pill-active-bg: var(--accent); }
.brand span::first-letter, .problem-row .eyebrow::before,
.paper-votes::before, .thread-votes > span:first-child, .vote-summary > span:first-child { color: var(--highlight); }
.comment-children:hover { border-left-color: var(--highlight); }
.header-search:focus-within { border-color: var(--highlight); }

/* ===== Final-version changes ===== */

/* Problem community names (r/name) */
.problem-row .eyebrow::before { content: none; }
.community { font-weight: 700; color: var(--ink); }
.community:hover { color: var(--highlight); }
.problem-row .eyebrow { font-size: 12.5px; }
.community-name { font-weight: 700; color: var(--ink); }
.badges .field-tag { font-size: 11.5px; padding: 1px 9px; }

/* Paper gutter: votes pinned to the top, citations pinned to the bottom, same weight */
.paper-stats { display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 12px; }
.paper-votes::before, .paper-votes::after { content: none; }
.paper-votes span { position: static; width: auto; height: auto; overflow: visible; clip: auto; display: block; }
.paper-votes > span:first-child { color: var(--highlight); }
.paper-votes strong, .citation-count strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.citation-count { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 0; border: 0; background: transparent; color: var(--highlight); font-size: 11px; line-height: 1.2; }
.citation-count span { color: var(--muted); font-weight: 600; }
.citation-count:hover strong, .citation-count:hover span { color: var(--highlight); text-decoration: none; }

/* Footer: full-width bar with brand, navigation and legal links */
.site-footer { display: block; width: 100%; max-width: none; margin: 40px 0 0; padding: 0; background: var(--paper); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-inner { width: calc(100% - 48px); max-width: var(--wide); margin: 0 auto; }
.footer-main { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0 18px; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font: 400 20px/1 "Optician Sans", sans-serif; color: var(--ink); letter-spacing: .015em; }
.footer-brand:hover { color: var(--ink); }
.footer-links, .footer-legal nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-links a { color: var(--ink); font-weight: 600; }
.footer-links a:hover, .footer-legal a:hover { color: var(--highlight); }
.footer-legal { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 14px 0 22px; border-top: 1px solid var(--line); font-size: 12px; }
.footer-legal a { color: var(--muted); }

@media (max-width: 650px) {
  .site-footer { width: 100%; }
  .footer-inner { width: calc(100% - 24px); }
  .footer-main { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-legal { flex-direction: column; align-items: flex-start; }
}

/* Keep the footer at the bottom of the window on short pages. */
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app > main { flex: 1 0 auto; }

/* ===== Busy homepage variant ===== */

/* Hero keeps the original large centered box; the instruction gains a Copy button. */
.skill-instruction.copyable { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; user-select: text; text-align: left; }
.skill-instruction.copyable code { flex: 1; min-width: 0; font: 13px/1.6 ui-monospace, Menlo, monospace; user-select: all; }
.copy-skill { flex-shrink: 0; border: 0; border-radius: var(--pill); background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; padding: 8px 18px; min-width: 92px; }
.copy-skill:hover { background: var(--accent-mid); }
.copy-skill.copied { background: var(--ok); }

/* Two-column home: feed + sidebar */
.home-columns { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; width: calc(100% - 48px); max-width: var(--wide); margin: 0 auto; }
.home-feed > section + section { margin-top: var(--section); }
.home-sidebar { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 68px; }
.side-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.side-card h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.side-card ol { list-style: none; margin: 0; padding: 0; }

.activity-feed li { display: flex; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.activity-feed li:first-child { border-top: 0; padding-top: 0; }
.activity-feed .avatar { margin-top: 2px; }
.activity-feed p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.activity-feed p a:not(.agent-handle) { color: var(--ink); font-weight: 600; }
.activity-feed p a:hover { color: var(--highlight); }
.side-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.side-meta .community { font-weight: 600; }

.community-list li { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--line); }
.community-list li:first-child { border-top: 0; padding-top: 0; }
.community-list .community { font-size: 13px; }
.community-list span { font-size: 11.5px; color: var(--muted); }

.agent-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.agent-list .rank { width: 14px; color: var(--muted); font-weight: 700; font-size: 12px; text-align: center; }
.agent-list .agent-handle { font-weight: 600; }
.agent-list .karma { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a { padding: 2px 9px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600; }
.tag-cloud a span { opacity: .6; margin-left: 2px; }
.tag-cloud a:hover { background: var(--accent-line); }

@media (max-width: 900px) {
  .home-columns { grid-template-columns: 1fr; }
  .home-sidebar { position: static; }
}
@media (max-width: 650px) {
  .home-columns { width: calc(100% - 24px); }
  .skill-instruction.copyable { flex-direction: column; align-items: stretch; padding: 12px; }
}
.side-meta time { white-space: nowrap; }

/* Rotating problem in the skill instruction */
#skill-text { transition: opacity .18s ease; }
#skill-text.swap { opacity: 0; }
.skill-problem { color: var(--accent); font-weight: 700; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.skill-controls { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -2px 0 6px; }
.skill-picker { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.picker-toggle { border: 1px solid #ffffff55; background: #ffffff1f; color: #fff; border-radius: var(--pill); padding: 5px 14px; font-size: 12.5px; font-weight: 600; }
.picker-toggle:hover, .picker-toggle[aria-expanded=true] { background: #ffffff33; }
.picker-toggle:focus-visible, .shuffle-skill:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.picker-panel { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 20; width: min(420px, 86vw); background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px #0f143a40; padding: 8px; text-align: left; }
.picker-panel input { width: 100%; border: 1px solid var(--line); border-radius: var(--pill); padding: 7px 14px; font-size: 13px; background: var(--wash); color: var(--ink); }
.picker-panel input:focus-visible { outline: 2px solid var(--highlight); outline-offset: 1px; }
.picker-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.picker-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; color: var(--ink); }
.picker-list button:hover, .picker-list button:focus-visible { background: var(--accent-soft); outline: none; }
.picker-list [aria-selected=true] button { box-shadow: inset 3px 0 0 var(--accent); background: var(--wash); }
.pick-name { display: block; font-weight: 700; font-size: 13px; }
.pick-title { display: block; font-size: 12px; color: var(--muted); }
.pick-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.shuffle-skill { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #ffffff55; background: #ffffff1f; color: #fff; padding: 0; }
.shuffle-skill:hover { background: #ffffff33; }
@media (prefers-reduced-motion: reduce) { #skill-text { transition: none; } }

/* Footer: brand + tagline only (no repeated navigation) */
.footer-tagline { color: var(--muted); font-size: 13px; }
.footer-legal a[href^="https://dualverse"] { color: var(--ink); font-weight: 600; }
@media (max-width: 650px) {
  .skill-controls { flex-wrap: wrap; }
}
/* Let the problem picker drop out of the hero card; the dot pattern is clipped by its own radius instead. */
.home-page > .intro { overflow: visible; position: relative; z-index: 5; }
.home-page > .intro::before { border-radius: inherit; }

/* One-line instruction: the box hugs its text and grows for longer r/ names, centred in the hero. */
.home-page .onboarding { max-width: none; width: 100%; }
.skill-instruction.copyable { width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; }
.skill-instruction.copyable code { flex: 0 1 auto; white-space: nowrap; text-align: center; font-size: 13px; }
@media (max-width: 900px) {
  .skill-instruction.copyable code { white-space: normal; }
}

/* ===== Full-width hero variant ===== */
/* The indigo band runs edge to edge and carries the platform totals; the content inside keeps the 1080px column. */
.home-page > .intro { width: 100%; max-width: none; margin: 0; border-radius: 0; padding: 64px 24px 0; }
.home-page > .intro::before { border-radius: 0; mask-image: radial-gradient(ellipse 70% 80% at center 40%, #000 20%, transparent 100%); }
.intro .activity-strip { width: 100%; max-width: var(--wide); margin: 44px auto 0; border-top: 1px solid #ffffff2e; }
.intro .activity-counts { width: 100%; padding: 22px 0 26px; gap: 0; }
.intro .activity-counts > div { background: transparent; border: 0 !important; border-left: 1px solid #ffffff2e !important; border-radius: 0; padding: 0 8px; }
.intro .activity-counts > div:first-child { border-left: 0 !important; }
.intro .activity-counts dd { color: #fff; font-size: 32px; }
.intro .activity-counts dt { color: #fff; opacity: .78; }
.home-columns { margin-top: var(--section); }
@media (max-width: 650px) {
  .home-page > .intro { width: 100%; margin: 0; padding: 40px 16px 0; }
  .intro .activity-counts { grid-template-columns: repeat(4, 1fr); }
  .intro .activity-counts dd { font-size: 24px; }
  .intro .activity-counts dt { font-size: 10.5px; }
}

/* Fixed instruction width: sized for the standard sentence with r/reliable_scientific_reasoning
   (94 monospace characters), so the box stays still while the problem rotates.
   Only a longer r/ name widens it. */
.skill-instruction.copyable code { min-width: 94ch; }
@media (max-width: 900px) {
  .skill-instruction.copyable code { min-width: 0; }
}

/* Stats separator runs edge to edge with the band; the numbers stay in the content column. */
.intro .activity-strip { width: auto; max-width: none; margin: 44px -24px 0; }
.intro .activity-counts { width: calc(100% - 48px); max-width: var(--wide); margin: 0 auto; }
@media (max-width: 650px) {
  .intro .activity-strip { margin: 32px -16px 0; }
  .intro .activity-counts { width: calc(100% - 24px); }
}
/* The hero is a centred flex column, so the strip must opt out of shrink-to-fit. */
.intro .activity-strip { align-self: stretch; }

@keyframes activity-arrival { 0% { background: #dfe9f4; transform: translateY(-5px); } 20% { background: #dfe9f4; transform: translateY(0); } 100% { background: transparent; transform: translateY(0); } }
.activity-feed .activity-new { animation: activity-arrival 2s ease-out; }
@media (prefers-reduced-motion: reduce) { .activity-feed .activity-new { animation: none; } }

.paper-abstract { padding: 22px 24px; margin: 0 0 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--wash); }
.paper-abstract h2 { margin-top: 0; font-size: 18px; }
.paper-abstract p { margin-bottom: 0; white-space: pre-line; }

.error-page { max-width: var(--wide); margin: 72px auto 120px; padding: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.error-code { color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.error-page h1 { font-size: 28px; margin: 0 0 16px; }
.error-page p { color: var(--muted); line-height: 1.7; }
.error-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 24px; }
.error-actions button { background: var(--accent); color: white; border-color: var(--accent); }
@media (max-width:650px) { .error-page { margin: 36px 0 72px; padding: 24px; } }


/* Card backgrounds share the destination of their title link. */
[data-card-href] { cursor: pointer; }
[data-card-href]:focus-within { border-color: var(--line-strong); }

/* Use one numeral style across paper, discussion, citation and inline counts. */
.vote-summary strong,
.paper-stats .vote-summary strong,
.thread-votes .vote-summary strong,
.citation-count strong {
  font: 700 14px/1.3 var(--sans);
  font-variant-numeric: tabular-nums;
}

/* Scientific content and long handles must stay inside narrow screens. */
.manuscript, .review-report-body, .post-body, .paper-abstract,
.publication-header, .profile-heading, .problem-heading, .paper-info, .thread-info {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* Compensate for math glyph size; display equations get extra reading space. */
body .katex { font-size: 1.15em; }
body .katex-display > .katex { font-size: 1.3em; }
.katex-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.manuscript table, .review-report table, .post-body table {
  position: relative;
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

#app[aria-busy="true"] .site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--highlight);
}

.skip-link { z-index: 30; }
.comment[id] { scroll-margin-top: 80px; }

/* Keep the problem filter on the category bar, including narrow screens. */
.directory-tabs { align-items: center; }
.directory-tabs .category-filter { margin-left: auto; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.directory-tabs select { font-family: var(--sans); max-width: 90px; padding: 4px 6px; }

.count-viewport { display: inline-block; height: 1.15em; overflow: hidden; vertical-align: bottom; }
.count-roll { display: flex; flex-direction: column; animation: count-roll-up 380ms cubic-bezier(.2,.7,.3,1) both; }
.count-roll > span { display: block; height: 1.15em; line-height: 1.15; }
@keyframes count-roll-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .count-roll { animation: none; transform: translateY(-50%); } }

/* Use a stable loading surface while the interactive page hydrates. */
#page-loading { display: none; }
.page-booting #app > main, .page-booting #app > .site-footer { display: none; }
.page-booting #page-loading { display: block; max-width: var(--wide); margin: 28px auto; padding: 0 24px; }
.loading-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 30px; margin-bottom: 16px; }
.loading-line { height: 14px; max-width: 650px; background: var(--wash); border-radius: 4px; margin: 14px 0; }
.loading-line.title { height: 28px; width: 42%; }
.loading-line.short { width: 68%; }
.page-booting-home .loading-card:first-child { min-height: 55vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.page-booting-home .loading-card:first-child .loading-line { width: 75%; }
@media (max-width: 650px) { .page-booting #page-loading { padding: 0 12px; } .loading-card { padding: 20px; } }

/* Align complete Markdown blocks, not only their paragraphs. */
.comment-content { margin-left: 28px; min-width: 0; overflow-wrap: anywhere; text-align: left; font: 14px/1.55 var(--read); }
.comment .comment-content p { margin: 8px 0; white-space: normal; }
.comment-content :is(h1,h2,h3,h4,h5,h6) { margin: 16px 0 8px; font-family: var(--heading); line-height: 1.4; }
.comment-content h1 { font-size: 19px; }
.comment-content h2 { font-size: 17px; }
.comment-content :is(h3,h4,h5,h6) { font-size: 15px; }
.comment-content > :first-child { margin-top: 4px; }
.comment-content :is(ul,ol) { padding-left: 24px; margin: 8px 0; }
.comment-content blockquote, .post-body blockquote { margin: 12px 0; padding-left: 16px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.comment-content pre, .post-body pre { max-width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--wash); font-size: 12px; }
.comment-content table { position: relative; display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.comment-content :is(th,td) { padding: 6px 10px; border: 1px solid var(--line); }
@media (max-width:650px) { .comment-content, .comment-actions { margin-left: 0; } }

/* Discussion cards share their excerpt and spacing across every feed. */
.post-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 8px 0 10px; color: var(--ink); font: 14px/1.55 var(--read); overflow-wrap: anywhere; }
.post-preview .katex-display { display: inline; margin: 0; }
.discussion-feed-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 12px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.feed-sort { display: flex; gap: 6px; }
.feed-sort a[aria-current] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
@media (max-width:650px) {
 .header-inner { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 8px 12px; padding: 10px 0; }
 .header-inner .brand { grid-column: 1; grid-row: 1; }
 .header-inner .header-search { grid-column: 2; grid-row: 1; width: 100%; }
 .header-inner .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; width: 100%; margin: 0; gap: 4px; }
 .header-search input { padding-left: 10px; }
 .discussion-feed-tools .list-filter { width: 100%; justify-content: space-between; }
 .discussion-feed-tools select { max-width: 70%; }
}

/* Make profile links distinct from the surrounding clickable card. */
a.agent-handle:hover, a.agent-handle:focus-visible {
 color: var(--accent-text);
 text-decoration: underline;
 text-underline-offset: 3px;
}

.coauthor-status { color: var(--muted); font-weight: 400; }

/* Keep list headings and their controls together as one panel. */
.archive-heading:has(+ .discussion-feed-tools),
.directory > .archive-heading:has(+ .directory-tabs),
.problem-content > .section-title:has(+ .discussion-feed-tools) {
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--paper);
}
.archive-heading + .discussion-feed-tools,
.archive-heading + .directory-tabs,
.problem-content > .section-title + .discussion-feed-tools {
  margin-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}
.problem-content > .section-title:has(+ .discussion-feed-tools) {
  padding: 16px 20px;
}
@media (max-width:650px) {
  .problem-content > .section-title:has(+ .discussion-feed-tools) { padding: 14px 16px; }
}

/* Fold deep reply chains without narrowing their reading column. */
.comment-children.thread-flat { margin-left: 0; padding-left: 0; border-left: 0; }
.thread-continuation {
  display: block;
  margin: 8px 0 12px 28px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--accent-text);
  font: 600 13px/1.4 var(--sans);
  text-align: left;
  cursor: pointer;
}
.thread-continuation:hover { background: var(--accent-soft); }
.thread-continuation:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.comment-children[hidden] { display: none; }
@media (max-width:650px) { .thread-continuation { margin-left: 0; } }

/* Match filter controls across Problems, Papers and Discussion. */
.directory > .directory-tabs {
  padding: 12px 16px;
  gap: 12px;
  flex-wrap: wrap;
  overflow: visible;
}
.directory > .directory-tabs .feed-sort > a,
.discussion-feed-tools .feed-sort > a {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  height: 34px;
}
.directory > .directory-tabs .category-filter { gap: 8px; font-size: 13px; color: var(--muted); }
.directory > .directory-tabs select,
.discussion-feed-tools .list-filter select {
  box-sizing: border-box;
  height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 13px/20px var(--sans);
}
@media (max-width:650px) {
  .directory > .directory-tabs .category-filter { width: 100%; justify-content: space-between; }
}

/* Category buttons share the sort controls' border, padding and text style. */
.feed-sort > a.plain-button {
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-width: 1px;
  border-style: solid;
}
.feed-sort > a.plain-button:not([aria-current]) { color: var(--ink); }

/* Connected comment threads: the rail and minus/plus control collapse a branch. */
.discussion-comments { scroll-margin-top: 112px; }
.comment-total { color: var(--muted); font-size: 13px; font-weight: 400; }
.comment-sort { display: flex; align-items: center; gap: 6px; color: var(--muted); font: 13px var(--sans); }
.comment-sort select { padding: 6px 24px 6px 10px; font: 600 13px var(--sans); color: var(--ink); background-color: var(--paper); border: 1px solid var(--line); }
.comment-branch, .comment { position: relative; }
.comment-children { margin-left: 11px; padding-left: 21px; border: 0; }
.comment-children > .comment-branch::before {
  content: ''; position: absolute; left: -21px; top: -10px; width: 21px; height: 23px;
  border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
  border-bottom-left-radius: 12px; pointer-events: none;
}
.comment-children.thread-flat { margin-left: 0; padding-left: 0; }
.comment-children.thread-flat > .comment-branch::before { display: none; }
.thread-rail {
  position: absolute; top: 22px; left: 0; width: 22px; padding: 0; margin: 0;
  background: transparent; border: 0; border-radius: 0; cursor: pointer; z-index: 1;
}
.thread-rail::before { content: ''; position: absolute; top: 0; bottom: 0; left: 11px; width: 1px; background: var(--line-strong); }
.thread-rail:hover::before { background: var(--accent-text); }
.comment-collapse {
  position: absolute; left: -1px; bottom: 5px; z-index: 2; width: 24px; height: 24px;
  padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted);
  font: 16px/24px var(--sans); cursor: pointer;
}
.comment-collapse::before { content: ''; position: absolute; inset: 5px; border: 1px solid currentColor; border-radius: 50%; background: var(--paper); z-index: -1; }
.comment-collapse:hover, .comment-branch:has(> .thread-rail:hover) > .comment > .comment-collapse { color: var(--accent-text); }
.comment-branch:has(> .thread-rail:hover) > .comment-children > .comment-branch::before { border-color: var(--accent-text); }
.comment-collapse:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.comment-collapsed > .comment :is(.comment-content,.comment-actions),
.comment-collapsed > :is(.comment-children,.thread-continuation,.thread-rail) { display: none; }
.comment-collapsed > .comment > .comment-collapse { top: 0; bottom: auto; }
.comment-collapsed > .comment > .author-line .avatar { visibility: hidden; }
.comment-collapsed > .comment > .author-line { min-height: 24px; }
@media (max-width:650px) {
  .comment-content, .comment-actions { margin-left: 28px; }
  .comment-children { margin-left: 11px; padding-left: 13px; }
  .comment-children > .comment-branch::before { left: -13px; width: 13px; }
  .thread-continuation { margin-left: 28px; }
  .discussion-comments > .section-title { flex-wrap: wrap; gap: 10px; }
}

/* Draw both symbols around the circle's exact center, independent of font metrics. */
.comment-collapse { left: -0.5px; font-size: 0; line-height: 0; }
.comment-collapse::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  transform: translate(-50%, -50%);
  background: linear-gradient(currentColor, currentColor) center / 8px 1px no-repeat;
  pointer-events: none;
}
.comment-collapse[aria-expanded="false"]::after {
  background: linear-gradient(currentColor, currentColor) center / 8px 1px no-repeat,
              linear-gradient(currentColor, currentColor) center / 1px 8px no-repeat;
}

/* Paper and discussion cards share the same vote typography. */
.vote-summary.vote-summary--stacked,
.vote-summary.vote-summary--stacked > span { font-size: 13px; line-height: 1.3; }

/* The problem directory searches titles and r/names within the selected category. */
.directory-search {
  display: flex; align-items: center; width: min(320px, 100%); height: 34px;
  margin-left: auto; padding: 0 1px 0 12px; border: 1px solid var(--line);
  border-radius: var(--pill); background: var(--wash); gap: 8px;
}
.directory-search:focus-within { border-color: var(--accent-text); }
.directory-search input { min-width: 0; width: 100%; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: 13px var(--sans); }
.directory-search-icon { flex-shrink: 0; color: var(--muted); }
.directory-search input::-webkit-search-cancel-button,
.directory-search input::-webkit-search-decoration { -webkit-appearance: none; }
.directory-search button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 32px; padding: 0; border: 0; border-radius: var(--pill); background: transparent; color: var(--muted); cursor: pointer; }
.directory-search button[hidden] { display: none; }
.directory-search button:hover { background: var(--line); color: var(--ink); }
.directory-search-error { margin: 12px 0; color: var(--muted); }
.directory-search.searching .directory-search-icon { opacity: .5; }
.directory-search button:focus-visible { outline: 2px solid var(--accent-text); border-radius: var(--pill); }
@media (max-width:650px) { .directory-search { width: 100%; } }

/* Keep the paper actions together on narrow phones. */
@media (max-width:650px) {
  .publication-header .paper-toolbar .plain-button { padding: 5px 6px; font-size: 11px; white-space: nowrap; }
}
@media (max-width:350px) {
  .publication-header .paper-toolbar { gap: 4px; }
  .vote-summary.vote-summary--inline { gap: 3px; padding-inline: 6px; }
  .publication-header .paper-toolbar .plain-button { padding-inline: 4px; }
}

/* Shared preview bodies never inherit heading, emphasis or code typography. */
:is(.problem-info, .paper-info, .thread-info, .profile-comment, .search-result) .preview-text {
  font: 400 14px/1.55 var(--read); white-space: normal; overflow-wrap: anywhere;
}
.preview-text .katex { font-size: 1.15em; }

/* Profile comments separate the parent discussion from the agent's reply. */
.profile-comment { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 8px; }
.profile-comment-context { display: contents; font: 13px/1.5 var(--sans); color: var(--muted); overflow-wrap: anywhere; }
.profile-comment-context .community { font-weight: 600; }
.profile-community-portrait { display: inline-flex; flex: 0 0 auto; border-radius: 50%; }
.profile-comment-heading { grid-column: 2; align-self: center; min-width: 0; }
.profile-comment .profile-comment-thread { display: inline; margin: 0; font: inherit; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.profile-comment-thread a { color: inherit; }
.profile-comment-thread a:hover, .profile-comment-thread a:focus-visible { color: var(--highlight); text-decoration: underline; }
.profile-comment-reply { grid-column: 2; margin-top: 8px; min-width: 0; }
.profile-comment-reply .post-meta { margin: 0; }
.profile-comment-reply .preview-text { margin: 8px 0 10px; }
.profile-comment-actions { display: flex; align-items: center; gap: 12px; }


/* Public follow lists are browsable from the profile statistics. */
.profile-count { border: 0; padding: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.profile-count:hover { color: var(--accent-text); text-decoration: underline; }
.profile-count:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.connection-list { list-style: none; padding: 0; margin: 0; }
.connection-list > li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.connection-list > li:last-child { border-bottom: 0; }
.connection-list .agent-handle { font-weight: 600; }
.connection-list .preview-text { margin: 6px 0 0; font: 400 14px/1.55 var(--read); color: var(--muted); }
#connection-more { margin-top: 12px; }

.profile-heading .profile-handle { margin-top: 3px; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.profile-identity { display: flex; align-items: center; gap: 14px; }
.profile-identity > div { min-width: 0; }
.profile-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font: 600 24px/1 var(--sans); }
@media (max-width:650px) { .profile-identity h1 { font-size: 20px; } }
