/* carvel page — the Topics view, drawn as a reference work's page.
   The index is a main page: a banner that names the project, the newest topic opened out,
   and every topic on one line under it. A topic is an article: its title in the reading
   face, the tabs under it, the line naming the project, a hatnote, the lead, a floated
   infobox of the topic's own facts, numbered sections with a rule under every heading, and
   the contents down the side. The view reads; the only presses it draws are the owner's own.
   The classes below are the renderer's (web/app-topics.js, web/app-topic-now.js,
   web/app-topic-rail.js): the sheet names no text of its own. */

/* ---------- the reference work's own palette ----------
   Measured from a Vector 2022 article in both themes (16 px root, 912 px column, 176 px
   contents): its papers, its inks, its link blue and its grey rules. The rest of the page
   keeps the interface's tokens; this view is a page of a reference work inside it, so the
   palette is the view's own and lives here rather than in tokens.css. */

#topics-page {
  /* Dark first, and the light block written twice for a page that sets no theme. */
  color-scheme: dark;
  --wiki-page: #202122;       /* the article's paper */
  --wiki-canvas: #101418;     /* the page around it */
  --wiki-ink: #eaecf0;
  --wiki-ink-em: #f8f9fa;
  --wiki-subtle: #a2a9b1;
  --wiki-line: #72777d;
  --wiki-line-soft: #54595d;
  --wiki-link: #88a3e8;
  --wiki-link-hover: #a6bbf5;
  --wiki-visited: #a799cd;
  --wiki-red: #fd7865;
  --wiki-toc-active: rgba(255, 255, 255, .08);
  --wiki-th: #27292d;
  --wiki-tint-green: #16301f;
  --wiki-tint-blue: #1c2a3a;
  --wiki-attn: #f2a93b;
  --wiki-attn-soft: rgba(242, 169, 59, .12);
  --wiki-serif: "Linux Libertine", Georgia, Times, "Source Serif 4", serif;
  --wiki-sans: sans-serif;
  background: var(--wiki-canvas);
  color: var(--wiki-ink);
  font-family: var(--wiki-sans);
}

:root[data-theme="light"] #topics-page {
  color-scheme: light;
  --wiki-page: #ffffff;
  --wiki-canvas: #f8f9fa;
  --wiki-ink: #202122;
  --wiki-ink-em: #101418;
  --wiki-subtle: #54595d;
  --wiki-line: #a2a9b1;
  --wiki-line-soft: #c8ccd1;
  --wiki-link: #3366cc;
  --wiki-link-hover: #3056a9;
  --wiki-visited: #6a60b0;
  --wiki-red: #bf3c2c;
  --wiki-toc-active: #eaecf0;
  --wiki-th: #eaecf0;
  --wiki-tint-green: #cef2e0;
  --wiki-tint-blue: #dceafa;
  --wiki-attn: #8a5200;
  --wiki-attn-soft: #fdf3e3;
}

/* The same light palette, for a page that sets no theme and a system that asks for light:
   CSS cannot share one declaration list with a media query, so the block is written twice. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) #topics-page {
    color-scheme: light;
    --wiki-page: #ffffff;
    --wiki-canvas: #f8f9fa;
    --wiki-ink: #202122;
    --wiki-ink-em: #101418;
    --wiki-subtle: #54595d;
    --wiki-line: #a2a9b1;
    --wiki-line-soft: #c8ccd1;
    --wiki-link: #3366cc;
    --wiki-link-hover: #3056a9;
    --wiki-visited: #6a60b0;
    --wiki-red: #bf3c2c;
    --wiki-toc-active: #eaecf0;
    --wiki-th: #eaecf0;
    --wiki-tint-green: #cef2e0;
    --wiki-tint-blue: #dceafa;
    --wiki-attn: #8a5200;
    --wiki-attn-soft: #fdf3e3;
  }
}

/* One drawing for every mark the view uses: a 20-unit grid, stroked, never filled. */
.topic-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- the index: a main page for the project's topics ---------- */

.topics-index {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 24px 20px 64px;
  font-family: var(--wiki-sans);
  color: var(--wiki-ink);
}

/* The banner: whose topics these are, over one line of what they are and the counts. */
.topics-banner {
  padding: 14px 20px 18px;
  border: 1px solid var(--wiki-line);
  background: var(--wiki-page);
  text-align: center;
}
.topics-title {
  margin: 0;
  font-family: var(--wiki-serif);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.375;
  color: var(--wiki-ink-em);
}
.topics-title b { font-weight: 400; color: var(--wiki-link); }
.topics-tagline { margin: 6px 0 0; font-size: 1rem; line-height: 1.5; color: var(--wiki-ink); }
.topics-counts { margin: 4px 0 0; font-size: .875rem; line-height: 1.5; color: var(--wiki-subtle); }

/* A box of the main page: a tinted head and the words under it. */
.topics-box {
  border: 1px solid var(--wiki-line);
  background: var(--wiki-page);
}
.topics-box-head {
  margin: 0;
  padding: 6px 12px;
  border-bottom: 1px solid var(--wiki-line);
  background: var(--wiki-tint-blue);
  font-family: var(--wiki-sans);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--wiki-ink-em);
}
.topics-featured .topics-box-head { background: var(--wiki-tint-green); }
.topics-box-body { padding: 12px 16px 16px; }
.topics-featured .topics-box-body { padding: 14px 16px 16px; }
.topics-feature-title {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--wiki-sans);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--wiki-link);
  text-align: left;
  cursor: pointer;
}
.topics-feature-title:hover { color: var(--wiki-link-hover); text-decoration: underline; text-underline-offset: 2px; }
.topics-feature-lead {
  margin: 8px 0 0;
  max-width: 62rem;
  font-size: 1rem;
  line-height: 1.625;
  color: var(--wiki-ink);
}
.topics-feature-meta { margin: 10px 0 0; font-size: .875rem; color: var(--wiki-subtle); }
.topics-feature-when { font-variant-numeric: tabular-nums; }
.topics-feature-more {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--wiki-sans);
  font-size: .9375rem;
  color: var(--wiki-link);
  cursor: pointer;
}
.topics-feature-more:hover { text-decoration: underline; }

/* One line per topic: the mark, the title as a link, the lead under it, then its facts. */
.topics-list { display: flex; flex-direction: column; }
.topics-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: start;
  width: 100%;
  padding: 7px 2px;
  border: 0;
  border-bottom: 1px solid var(--wiki-line-soft);
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.topics-list .topics-row:last-child { border-bottom: 0; }
.topics-row:hover { background: var(--wiki-toc-active); }
.topics-row:focus-visible { outline: 2px solid var(--wiki-link); outline-offset: -2px; }
.topics-row[aria-current="page"] { background: var(--wiki-toc-active); }
.topics-row-mark { display: flex; align-items: center; gap: 4px; padding-top: 4px; color: var(--wiki-subtle); }
.topics-row-mark .topic-icon { width: 14px; height: 14px; }
.topics-row-mark .dot { width: 5px; height: 5px; }
.topics-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topics-row-title {
  font-family: var(--wiki-sans);
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--wiki-link);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topics-row:hover .topics-row-title { color: var(--wiki-link-hover); text-decoration: underline; text-underline-offset: 2px; }
.topics-row-lead {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-family: var(--wiki-sans);
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--wiki-ink);
  /* Two lines: what the topic is about, without three rows' worth of it on every line. */
}
.topics-row-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 4px;
  font-size: .8125rem;
  color: var(--wiki-subtle);
  white-space: nowrap;
}
.topics-row-open.is-open { color: var(--wiki-attn); }
.topics-row-unread { color: var(--wiki-attn); }
.topics-row-when { font-variant-numeric: tabular-nums; }
.topics-empty { margin: 0; padding: 12px 0; font-size: 1rem; line-height: 1.6; color: var(--wiki-ink); }
.topics-empty b { color: var(--wiki-ink-em); font-weight: 700; }
.topics-index .inbox-notice { margin: 0; padding: 12px 0; font-size: 1rem; color: var(--wiki-ink); }

/* ---------- a topic: an article, its discussion and its contents ---------- */

/* The reading column stands where a reference work puts it: the contents in a 176 px column
   on the left, the article's own 912 px beside it, and the page left-anchored as Vector 2022
   anchors it (measured 17 Nov 2026 at 1440 px: contents 176, column 912, 216 px in from the
   page's edge). The status under the contents is carvel's, never the article's. */
.topic-body {
  display: grid;
  grid-template-columns: 176px minmax(0, 912px);
  column-gap: 24px;
  justify-content: start;
  align-items: start;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 8px 20px 64px;
  background: var(--wiki-page);
  font-family: var(--wiki-sans);
  color: var(--wiki-ink);
}
/* The discussion has no second column, so the page takes the reading measure alone. */
.topic-body.is-talk { display: block; max-width: 60rem; }
.topic-body > .topic-crumb { grid-column: 1 / -1; }
.topic-side { grid-column: 1; grid-row: 2; }
.topic-doc { grid-column: 2; grid-row: 2; min-width: 0; font-size: 1rem; line-height: 1.625; }
.topic-doc p { margin: 8px 0 16px; }

.topic-crumb {
  margin: 0 0 4px;
  font-size: .8125rem;
  color: var(--wiki-subtle);
}
.topic-back { padding: 0; border: 0; background: none; font: inherit; color: var(--wiki-link); cursor: pointer; }
.topic-back:hover { text-decoration: underline; text-underline-offset: 3px; }

.topic-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--wiki-subtle);
}
.topic-eyebrow-sep { color: var(--wiki-line); }

/* The title: the reading face at Wikipedia's own 1.8 em, over the tabs' rule. */
.topic-title {
  margin: 0 0 4px;
  font-family: var(--wiki-serif);
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.375;
  letter-spacing: 0;
  color: var(--wiki-ink-em);
  text-wrap: balance;
}

/* The tabs: Article and Talk on the left, Read and Copy link on the right, the row ruled. */
.topic-tabs {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 6px;
  border-bottom: 1px solid var(--wiki-line);
}
.topic-tabs-side { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.topic-tabs-side.is-right { gap: 12px; }
.topic-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 8px 7px;
  border: 0;
  background: none;
  font-family: var(--wiki-sans);
  font-size: .875rem;
  line-height: 1.4;
  color: var(--wiki-link);
  text-decoration: none;
  cursor: pointer;
}
.topic-tab:hover { color: var(--wiki-link-hover); text-decoration: underline; text-underline-offset: 2px; }
.topic-tab.is-current { color: var(--wiki-ink); font-weight: 700; cursor: default; }
/* The current tab sits on the row's rule, the way a reference work marks the page on show:
   the reading menu's Read carries the rule, the page's own Article is simply the bold one. */
.topic-tabs-side.is-right .topic-tab.is-current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--wiki-ink);
}
.topic-tab:focus-visible { outline: 2px solid var(--wiki-link); outline-offset: -2px; }

/* "From the topics of <project>": the line that names the work a page belongs to. */
.topic-subtitle { margin: 0 0 10px; font-size: .875rem; line-height: 1.5; color: var(--wiki-ink); }
.topic-subtitle b { font-weight: 400; color: var(--wiki-ink); }

/* A hatnote: italic, indented, one line of where else to look. */
.topic-hatnote {
  margin: 0 0 10px;
  padding-left: 1.6em;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--wiki-ink);
}
.topic-hatnote-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-style: normal;
  color: var(--wiki-link);
  cursor: pointer;
}
.topic-hatnote-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- the infobox: the topic's own facts, floated at the head of the article ---------- */

.topic-infobox {
  float: right;
  /* 368 px beside a 912 px column: a Vector 2022 infobox measures 366 px there. */
  width: 368px;
  max-width: 100%;
  margin: 4px 0 12px 16px;
  padding: 2px;
  border: 1px solid var(--wiki-line);
  border-collapse: separate;
  border-spacing: 0;
  background: var(--wiki-canvas);
  font-family: var(--wiki-sans);
  font-size: .88em;
  line-height: 1.5;
  color: var(--wiki-ink);
}
.topic-infobox-head {
  padding: 4px;
  font-family: var(--wiki-sans);
  font-size: 1.25em;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  color: var(--wiki-ink-em);
}
.topic-infobox-row + .topic-infobox-row { border-top: 1px solid var(--wiki-line-soft); }
.topic-infobox-label,
.topic-infobox-value { padding: 4px 6px; vertical-align: top; text-align: left; }
.topic-infobox-label { width: 42%; font-weight: 700; color: var(--wiki-ink); }
.topic-infobox-value { color: var(--wiki-ink); }
.topic-infobox-sha { font-family: var(--font-mono); font-size: .92em; }
.topic-infobox-when { color: var(--wiki-subtle); }

/* ---------- the sections of the article ---------- */

.topic-section { margin-top: 0; }
.topic-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 24px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--wiki-line);
  font-family: var(--wiki-serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.375;
  color: var(--wiki-ink-em);
}
.topic-heading-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topic-count { margin-left: auto; font-family: var(--wiki-sans); font-size: .8125rem; font-variant-numeric: tabular-nums; color: var(--wiki-subtle); }
.topic-section.is-landed .topic-heading,
.topic-block.is-landed,
.topic-now.is-landed,
.topic-changed.is-landed { animation: topic-land 0.9s var(--ease); }
@keyframes topic-land { 0% { background-color: var(--wiki-attn-soft); } }

.topic-block { position: relative; margin-top: 10px; }
.topic-block-text {
  max-width: none;
  font-family: var(--wiki-sans);
  font-size: 1rem;
  line-height: 1.625;
  color: var(--wiki-ink);
}
.topic-block.is-lead { margin-top: 6px; }
.topic-block.is-lead .topic-block-text { font-size: 1rem; }
.topic-block-text.is-folded { overflow: hidden; }
/* A block the owner has not seen keeps the one mark the interface owns: amber, at its edge. */
.topic-block.is-changed { padding-left: 10px; border-left: 2px solid var(--wiki-attn); }
.topic-block.is-partly-changed { padding-left: 10px; border-left: 2px solid var(--wiki-attn); }
.topic-block.is-arrived { animation: topic-arrive 2.4s var(--ease); }
@keyframes topic-arrive { 0%, 60% { background: var(--wiki-attn-soft); } 100% { background: transparent; } }
.topic-block.has-timeline { margin-top: 16px; }
.topic-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.topic-cell-changed { background: var(--wiki-attn-soft); }
.topic-qid { font-size: .875rem; color: var(--wiki-subtle); font-weight: 400; }

/* The article's own reading: paragraphs, lists, quotes and the code of a fence. */
.topic-doc .topic-md h1,
.topic-doc .topic-md h2 { margin: 1.2em 0 .25em; font-family: var(--wiki-serif); font-size: 1.35em; font-weight: 400; color: var(--wiki-ink-em); }
.topic-doc .topic-md h3,
.topic-doc .topic-md h4 { margin: 1em 0 .2em; font-family: var(--wiki-sans); font-size: 1.05em; font-weight: 700; color: var(--wiki-ink-em); }
.topic-doc .topic-md p { margin: 8px 0 16px; }
.topic-doc .topic-md ul { margin: 8px 0 16px; padding-left: 1.6em; list-style: disc; }
.topic-doc .topic-md ul ul { margin: 4px 0; padding-left: 1.4em; list-style: circle; }
.topic-doc .topic-md ol { margin: 8px 0 16px; padding-left: 1.9em; list-style: decimal; }
.topic-doc .topic-md li { margin: 2px 0; }
.topic-doc .topic-md strong { font-weight: 700; color: var(--wiki-ink-em); }
.topic-doc .topic-md a { color: var(--wiki-link); text-decoration: none; }
.topic-doc .topic-md a:hover { text-decoration: underline; text-underline-offset: 2px; }
.topic-doc .topic-md code { font-family: var(--font-mono); font-size: .875em; color: var(--wiki-ink); background: var(--wiki-canvas); padding: 0 3px; border-radius: 2px; }
.topic-doc .topic-md pre { margin: 8px 0 16px; padding: 10px 12px; background: var(--wiki-canvas); border: 1px solid var(--wiki-line-soft); overflow-x: auto; }
.topic-doc .topic-md pre code { padding: 0; background: none; font-size: .875em; line-height: 1.6; }
/* The owner's words are quotes: indented, with the rule a reference work gives a long quotation. */
.topic-doc .topic-md blockquote { margin: 8px 0 16px; padding-left: 1.6em; color: var(--wiki-ink); }
.topic-doc .topic-md blockquote p { margin: 0 0 8px; padding: 0; text-indent: 0; font-style: italic; }
.topic-doc .topic-md blockquote:has(+ blockquote) { margin-bottom: 0; }

/* A table reads as a reference work's table: hairline cells, a tinted head, no rounded card. */
.topic-doc .topic-md .table-wrap { margin: 8px 0 16px; border: 0; border-radius: 0; background: none; }
.topic-doc .topic-md table {
  width: auto;
  min-width: 0;
  max-width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--wiki-line);
  background: var(--wiki-page);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0;
}
.topic-doc .topic-md th,
.topic-doc .topic-md td {
  padding: 4px 8px;
  border: 1px solid var(--wiki-line-soft);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  vertical-align: top;
  text-align: left;
  color: var(--wiki-ink);
}
.topic-doc .topic-md th,
.topic-doc .topic-md thead th { background: var(--wiki-th); font-weight: 700; white-space: normal; color: var(--wiki-ink-em); }
.topic-doc .topic-md tbody tr:nth-child(even) td { background: none; }

/* ---------- a part's state, a changed cell, the block's own presses ---------- */

.topic-state {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 2px;
  font-family: var(--wiki-sans);
  font-size: .75rem;
  line-height: 1;
  color: var(--wiki-subtle);
  background: var(--wiki-canvas);
  box-shadow: inset 0 0 0 1px var(--wiki-line-soft);
  white-space: nowrap;
}
.topic-state[data-state="running"], .topic-state[data-state="started"] { color: var(--wiki-link); background: var(--wiki-tint-blue); box-shadow: none; }
.topic-state[data-state="passed"], .topic-state[data-state="landed"], .topic-state[data-state="done"] { color: var(--ok); background: var(--ok-soft); box-shadow: none; }
.topic-state[data-state="failed"], .topic-state[data-state="stopped"] { color: var(--bad); background: var(--bad-soft); box-shadow: none; }
.topic-state[data-state="waiting"], .topic-state[data-state="asked"] { color: var(--wiki-attn); background: var(--wiki-attn-soft); box-shadow: none; }

.topic-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.topic-actions .btn { height: 24px; padding: 0 8px; font-family: var(--wiki-sans); font-size: .8125rem; color: var(--wiki-subtle); }
.topic-actions .btn:hover { color: var(--wiki-ink); }
/* A block's own presses are the owner's, not the article's: they stand out of the flow at the
   block's edge and show on a hover or a focus, the way a reference work keeps its editing
   links quiet. A pointer that cannot hover keeps them drawn, one short line under the block. */
.topic-block > .topic-actions {
  position: absolute;
  right: 0;
  bottom: -16px;
  z-index: 1;
  margin: 0;
  padding: 0;
  opacity: 0;
  transition: opacity 120ms var(--ease);
}
.topic-block:hover > .topic-actions,
.topic-block:focus-within > .topic-actions { opacity: 1; }
.topic-block > .topic-actions .btn { height: 18px; padding: 0 4px; border: 0; background: none; font-size: .75rem; }
.topic-block > .topic-actions .btn:hover { color: var(--wiki-link); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: none), (pointer: coarse) {
  .topic-block > .topic-actions { position: static; margin-top: 2px; opacity: 1; }
}
.topic-more { margin-top: 6px; }
.topic-new {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border-radius: 2px;
  font-family: var(--wiki-sans);
  font-size: .6875rem;
  font-weight: 700;
  line-height: 1;
  color: var(--wiki-attn);
  background: var(--wiki-attn-soft);
  vertical-align: 1px;
}
.topic-new.is-clearing { opacity: 0; transition: opacity var(--t-med) var(--ease); }

/* ---------- carvel's status: the rail's own small print under the contents ----------

   What needs the owner, what changed since their last look and the version on show are
   carvel's, not the article's. They stand in the left rail under the contents, in the rail's
   own small type and with no card of their own, so nothing between the title and the lead but
   the hatnote: measured 17 Nov 2026, the rail's own mass blurred beside Vector 2022's. */

.topic-status {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--wiki-line-soft);
  font-size: .8125rem;
  line-height: 1.45;
}

.topic-now { margin: 0; padding: 0; border: 0; background: none; font-size: .8125rem; line-height: 1.45; }
.topic-now-title { margin: 0 0 6px; font-family: var(--wiki-sans); font-size: .875rem; font-weight: 400; line-height: 1.4; color: var(--wiki-subtle); }
.topic-now-row { display: block; }
.topic-now-row + .topic-now-row { margin-top: 7px; }
.topic-now-label { margin: 0 0 1px; font-family: var(--wiki-sans); font-size: .6875rem; font-weight: 700; letter-spacing: .02em; color: var(--wiki-subtle); }
.topic-now-lines { margin: 0; padding: 0; list-style: none; display: block; min-width: 0; }
.topic-now-row.is-none .topic-now-lines { color: var(--wiki-subtle); }
.topic-now-line { display: block; font-size: .8125rem; line-height: 1.45; color: var(--wiki-ink); }
.topic-now-line + .topic-now-line { margin-top: 4px; }
.topic-now-line.is-named { display: block; }
.topic-now-text { display: block; }
.topic-now-name { display: block; font-weight: 700; }
.topic-now-where, .topic-now-when { color: var(--wiki-subtle); font-size: .75rem; }
.topic-now-ids { font-family: var(--font-mono); font-size: .6875rem; color: var(--wiki-subtle); }
.topic-now-sub { display: block; font-size: .75rem; color: var(--wiki-subtle); }
.topic-now-subject { color: var(--wiki-ink); }
.topic-now-age { display: block; font-size: .75rem; color: var(--wiki-subtle); }
.topic-now-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.topic-now-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.topic-now-track { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin: 1px 0 0; padding: 0; list-style: none; }
.topic-now-track .topic-now-step {
  position: relative;
  padding: 0 5px 0 6px;
  font-size: .6875rem;
  line-height: 1.4;
  color: var(--wiki-subtle);
  border-left: 1px solid var(--wiki-line-soft);
}
.topic-now-track .topic-now-step:first-child { border-left: 0; padding-left: 0; }
.topic-now-track .topic-now-step.is-past { color: var(--wiki-ink); }
.topic-now-track .topic-now-step.is-lit { color: var(--wiki-link); }
.topic-now-track.is-alarm .topic-now-step.is-lit { color: var(--wiki-red); }
.topic-now-foot { margin-top: 6px; }

/* The changed lines, as thin as a reference work's own notice: one rule at its edge, no card. */
.topic-changed {
  margin: 10px 0 0;
  padding: 0 0 0 8px;
  border: 0;
  border-left: 3px solid var(--wiki-attn);
  background: none;
  font-size: .75rem;
  line-height: 1.5;
  color: var(--wiki-ink);
}
.topic-changed.is-quiet { border-left-color: var(--wiki-line-soft); }
.topic-changed-n { display: none; }
.topic-changed-text { margin: 0; min-width: 0; }
.topic-changed-text b { font-weight: 700; color: var(--wiki-ink-em); }
.topic-gone { display: block; margin-top: 2px; color: var(--wiki-subtle); }

/* The presses of the status are the rail's links: blue words, no box. */
.topic-status .btn {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-family: var(--wiki-sans);
  font-size: .75rem;
  line-height: 1.5;
  color: var(--wiki-link);
}
.topic-status .btn:hover { background: none; color: var(--wiki-link-hover); text-decoration: underline; text-underline-offset: 2px; }
.topic-status .btn:focus-visible { outline: 2px solid var(--wiki-link); outline-offset: 1px; }
.topic-gone-seen, .topic-mark-seen { display: block; margin: 2px 0 0; }

/* ---------- a timeline fence: the Helm's points and the steps drawn from records ---------- */

.topic-timeline { margin: 8px 0 16px; }
.topic-tl-list { margin: 0; padding: 0; list-style: none; }
.topic-tl-point {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  column-gap: 10px;
  padding: 4px 0;
}
.topic-tl-point::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: -6px;
  width: 1px;
  background: var(--wiki-line-soft);
}
.topic-tl-point:last-child::before { display: none; }
.topic-tl-mark { display: flex; align-items: center; justify-content: center; height: 14px; margin-top: 5px; color: var(--wiki-subtle); }
.topic-tl-mark .topic-icon { width: 13px; height: 13px; }
.topic-tl-point[data-kind="landed"] .topic-tl-mark { color: var(--ok); }
.topic-tl-point[data-kind="failed"] .topic-tl-mark { color: var(--wiki-red); }
.topic-tl-point[data-kind="asked"] .topic-tl-mark,
.topic-tl-point[data-kind="waiting"] .topic-tl-mark { color: var(--wiki-attn); }
.topic-tl-point.is-drawn .topic-tl-mark { color: var(--wiki-subtle); }
.topic-tl-point.is-new .topic-tl-text { color: var(--wiki-ink-em); }
.topic-tl-body { min-width: 0; font-size: 1rem; line-height: 1.6; color: var(--wiki-ink); }
.topic-tl-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: .8125rem; color: var(--wiki-subtle); }
.topic-tl-at, .topic-tl-kind, .topic-tl-by { white-space: nowrap; }
.topic-tl-kind { text-transform: none; }
.topic-tl-text { margin-top: 2px; }
.topic-tl-text code { font-family: var(--font-mono); font-size: .84em; }
.topic-tl-point.is-drawn .topic-tl-text { color: var(--wiki-subtle); }

/* ---------- a [[link]] between topics: blue for a page that exists, red for one that does not ---------- */

.topic-link {
  display: inline;
  color: var(--wiki-link);
  text-decoration: none;
  border-bottom: 0;
  cursor: pointer;
}
.topic-link:hover { color: var(--wiki-link-hover); text-decoration: underline; text-underline-offset: 2px; }
.topic-link:visited { color: var(--wiki-visited); }
.topic-link .topic-icon { display: none; }
.topic-link-title { font-weight: 400; }
.topic-link-words { color: var(--wiki-subtle); font-size: .875em; font-style: italic; }
.topic-link-words::before { content: " · "; }
.topic-link.is-gone, .topic-link.is-elsewhere { color: var(--wiki-red); text-decoration: none; border-bottom: 0; cursor: default; }
.topic-link.is-elsewhere { color: var(--wiki-subtle); }
.topic-link-raw { font-family: var(--font-mono); font-size: .875em; }
.topic-link-note { font-size: .8125em; }
.topic-from { margin: 6px 0 0; font-size: .875rem; color: var(--wiki-subtle); }
.topic-from-label { display: flex; align-items: center; gap: 5px; margin: 0; font-size: .8125rem; }
.topic-from-label .topic-icon { width: 11px; height: 11px; }
.topic-from-list { margin: 2px 0 0; padding-left: 1.2em; list-style: disc; }
.topic-from-link { color: var(--wiki-link); cursor: pointer; }
.topic-from-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.topic-from-title { font-weight: 400; }
.topic-from-words { color: var(--wiki-subtle); }
.topic-from-words::before { content: " · "; }

/* ---------- the contents down the side ---------- */

.topic-side {
  position: sticky;
  top: 8px;
  align-self: start;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  /* The contents' head sits on the article's title line, as Vector 2022 sets its own. */
  padding-top: 30px;
  font-family: var(--wiki-sans);
  font-size: .875rem;
  line-height: 1.5;
}
.topic-side-headrow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--wiki-line-soft); }
.topic-side-head { margin: 0; font-family: var(--wiki-sans); font-size: .875rem; font-weight: 400; color: var(--wiki-subtle); }
.topic-side-fold {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--wiki-sans);
  font-size: .8125rem;
  color: var(--wiki-link);
  cursor: pointer;
}
.topic-side-fold:hover { text-decoration: underline; text-underline-offset: 2px; }
.topic-side-list { margin: 6px 0 0; padding: 0; list-style: none; }
.topic-side-list[hidden] { display: none; }
.topic-side-item + .topic-side-item { margin-top: 1px; }
.topic-side-link {
  display: grid;
  grid-template-columns: 1.4em minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 6px;
  width: 100%;
  padding: 3px 4px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--wiki-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.topic-side-link:hover { background: var(--wiki-toc-active); }
.topic-side-link.is-current { background: var(--wiki-toc-active); font-weight: 700; }
.topic-side-num { color: var(--wiki-subtle); font-variant-numeric: tabular-nums; }
.topic-side-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-side-n { font-size: .75rem; font-variant-numeric: tabular-nums; color: var(--wiki-subtle); }
.topic-side-link.is-current .topic-side-num { color: var(--wiki-ink); }
.topic-side-parts { margin: 1px 0 4px; padding: 0 0 0 1.4em; list-style: none; border-left: 1px solid var(--wiki-line-soft); }
.topic-side-part {
  display: block;
  width: 100%;
  padding: 2px 4px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--wiki-subtle);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.topic-side-part:hover { background: var(--wiki-toc-active); color: var(--wiki-ink); }
.topic-side-part-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-side-version { margin: 12px 0 0; font-size: .75rem; line-height: 1.5; color: var(--wiki-subtle); }

/* ---------- the discussion: the owner's messages, the Helm's answers, the comments ---------- */

.topic-talk { min-width: 0; }
.topic-talk-comments { margin-top: 8px; }
.topic-talk-block { margin: 12px 0 0; padding-top: 8px; border-top: 1px solid var(--wiki-line-soft); }
.topic-talk-words { margin: 0 0 8px; font-size: .9375rem; line-height: 1.55; color: var(--wiki-subtle); font-style: italic; }
.topic-comment, .topic-answer, .topic-exchange {
  max-width: none;
  padding: 10px 12px;
  border: 1px solid var(--wiki-line-soft);
  border-radius: 0;
  background: var(--wiki-canvas);
  box-shadow: none;
}
.topic-comment-you { display: flex; align-items: baseline; gap: 8px; font-size: .8125rem; color: var(--wiki-subtle); }
.topic-who { font-weight: 700; color: var(--wiki-ink); }
.topic-who.is-helm { color: var(--wiki-link); }
.topic-comment-text { margin: 4px 0 0; font-size: 1rem; line-height: 1.6; color: var(--wiki-ink); }
.topic-answer { margin-top: 8px; background: var(--wiki-page); }
.topic-answer-text { font-family: var(--wiki-sans); font-size: 1rem; line-height: 1.625; color: var(--wiki-ink); }
.topic-exchanges { margin-top: 12px; }
.topic-exchange { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 0; }
.topic-form { display: flex; flex-direction: column; gap: 8px; max-width: none; }
.topic-form textarea {
  width: 100%;
  min-height: 4.5rem;
  padding: 8px;
  border: 1px solid var(--wiki-line);
  border-radius: 2px;
  background: var(--wiki-page);
  box-shadow: none;
  color: var(--wiki-ink);
  font-family: var(--wiki-sans);
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
}
.topic-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.topic-form-hint { margin-right: auto; font-size: .75rem; color: var(--wiki-subtle); }
.topic-waiting { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--wiki-subtle); }

/* ---------- the foot of the page ---------- */

.topic-footer {
  clear: both;
  margin-top: 32px;
  padding: 12px 0 0;
  border-top: 1px solid var(--wiki-line);
  font-size: .875rem;
  line-height: 1.6;
  color: var(--wiki-subtle);
}
.topic-footer-line { margin: 0; }
.topic-footer-line.is-version { margin-top: 2px; }

/* ---------- the card a hovered [[link]] opens: its target's own lead, from the index read ---------- */

.topic-preview {
  position: fixed;
  z-index: 40;
  width: 20rem;
  max-width: calc(100vw - 16px);
  padding: 12px 14px 10px;
  border: 1px solid var(--wiki-line);
  background: var(--wiki-page);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
  color: var(--wiki-ink);
  font-family: var(--wiki-sans);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms var(--ease), transform 120ms var(--ease);
}
.topic-preview.is-shown { opacity: 1; transform: none; }
.topic-preview-title { font-family: var(--wiki-serif); font-size: 1.15rem; line-height: 1.3; color: var(--wiki-ink-em); }
.topic-preview-lead { margin: 6px 0 0; font-size: .875rem; line-height: 1.5; color: var(--wiki-ink); }
.topic-preview-meta { margin: 8px 0 0; font-size: .75rem; color: var(--wiki-subtle); }
.topic-preview-more { margin-top: 6px; font-size: .8125rem; color: var(--wiki-link); }

/* ---------- the narrow widths ---------- */

@media (max-width: 1100px) {
  /* One column: the way back, the contents folded to its head, the article, and carvel's own
     status after the article, so the reading is what a narrow page opens on. */
  .topic-body,
  .topic-body.is-talk { display: flex; flex-direction: column; max-width: 60rem; }
  .topic-crumb { order: 0; }
  .topic-side { display: contents; }
  .topic-side-toc { order: 1; width: 100%; padding: 0 0 8px; }
  .topic-side-parts { padding-left: 1.4em; }
  .topic-doc { order: 2; }
  .topic-status { order: 3; width: 100%; margin-top: 28px; }
  .topic-side-version { display: none; }
  /* The article reads first on a narrow page too: the lead's section comes before the
     infobox, and the infobox before the later sections, as a phone's article does. */
  .topic-doc { display: flex; flex-direction: column; }
  .topic-doc > #topic-s-0 { order: 1; }
  .topic-doc > .topic-infobox { order: 2; width: 100%; margin: 8px 0 16px; }
  .topic-doc > .topic-section { order: 3; }
  .topic-doc > .topic-footer { order: 4; }
}
@media (max-width: 700px) {
  .topics-index { padding: 16px 12px 48px; }
  .topics-title { font-size: 1.5rem; }
  .topics-box-head { font-size: 1.05rem; }
  .topics-row { grid-template-columns: 16px minmax(0, 1fr); row-gap: 2px; }
  .topics-row-meta { grid-column: 2; gap: 10px; padding-top: 0; }
  .topics-row-parts { display: none; }
  .topic-body { padding: 4px 12px 48px; }
  .topic-title { font-size: 1.6rem; }
  .topic-tabs { flex-wrap: wrap; gap: 4px; }
  .topic-tabs-side.is-right { margin-left: auto; }
  .topic-actions .btn { min-height: 2.75rem; padding: 0 12px; }
  .topic-tab { min-height: 2.75rem; }
}

/* ---------- motion: the page opens once, and nothing moves for a reader who asked it not to ---------- */

.topic-body.is-entering .topic-doc { animation: topic-open 320ms var(--ease) both; animation-delay: calc(-1 * var(--elapsed, 0ms)); }
@keyframes topic-open { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .topic-body.is-entering .topic-doc { animation: none; }
  .topic-preview { transition: none; }
}
/* ================= the Inbox's Markdown and talk box =================
   These are the Inbox's, not the view's: the sheet keeps them because the Inbox
   draws its text bodies and its message box from these classes. */

.topic-crumb { margin: 0 0 0.75rem; font-size: 0.8125rem; color: var(--text-2); }
.topic-back { padding: 0; background: none; border: 0; font: inherit; color: var(--accent); cursor: pointer; }
.topic-back:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Markdown drawn from renderMarkdown: a list item reads as a line, a quote as words. */
.topic-md > :first-child { margin-top: 0; }
.topic-md > :last-child { margin-bottom: 0; }
.topic-md p { margin: 0 0 0.5rem; }
.topic-md blockquote { margin: 0; color: inherit; }
.topic-md blockquote p { margin: 0; text-indent: -0.4em; padding-left: 0.4em; font-style: italic; }
.topic-md strong { font-weight: 700; color: var(--text); }
.topic-md h1, .topic-md h2 { margin: 1.25rem 0 0.5rem; font-size: 1.25rem; font-weight: 800; line-height: 1.3; color: var(--text); }
.topic-md h3, .topic-md h4 { margin: 1rem 0 0.25rem; font-size: 1rem; font-weight: 700; line-height: 1.4; color: var(--text); }
.topic-md ul { margin: 0; padding: 0; list-style: none; }
.topic-md ul ul { margin-top: 0.25rem; padding-left: 1.25rem; list-style: disc; }
.topic-md ol { margin: 0; padding-left: 1.5rem; }
.topic-md code { font-size: 0.8125rem; letter-spacing: 0; }
.topic-md a { color: var(--accent); }
.topic-md pre, .topic-md .table-wrap { max-width: 100%; overflow-x: auto; }
.topic-md pre { margin: 0.5rem 0 0; }

/* A table reads by tone: a header band, a band on every other row, room in the cells;
   a table too wide for its block scrolls sideways inside it. */
.topic-md .table-wrap { margin: 0.25rem 0; border: 1px solid var(--line); border-radius: 0.5rem; }
.topic-md table { width: 100%; min-width: 34rem; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; line-height: 1.5; letter-spacing: 0; }
.topic-md th, .topic-md td { padding: 0.625rem 0.875rem; text-align: left; vertical-align: top; }
.topic-md th { background: var(--surface-1); border-bottom: 1px solid var(--line); font-size: 0.8125rem; font-weight: 800; white-space: nowrap; color: var(--text); }
.topic-md td { font-weight: 430; color: var(--text-2); }
.topic-md tbody tr:nth-child(even) td { background: var(--surface-1); }

/* The waiting line of the talk box and of the Inbox's waiting rows. */
.topic-waiting, .talk-status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-2); }
.topic-waiting-dot { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--attn); animation: topic-wait 1.4s ease-in-out infinite; }
.topic-waiting-word { font-weight: 700; color: var(--attn); }
@keyframes topic-wait { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .topic-waiting-dot { animation: none; } }

/* The box is the shared field; the talk box only says how tall it starts. */
.talk-text {
  width: 100%;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: vertical;
}
.talk-text { min-height: 3.5rem; font-size: 1rem; }
.talk-text::placeholder { color: var(--text-3); }
.talk-text:disabled, .talk-topic:disabled { opacity: 0.6; }
.draft-images[hidden] { display: none; }

/* ---- the talk box: at the foot of the Inbox ---- */
.talk {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem max(1.25rem, calc((100% - 60rem) / 2)) 0.875rem;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.talk-status[hidden] { display: none; }
.talk-open { padding: 0; background: none; border: 0; font: inherit; color: var(--accent); cursor: pointer; }
.talk-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.talk-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.talk-where { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text-2); }
.talk-topic {
  max-width: 18rem;
  font-size: 0.875rem;
}
.talk-hint { margin-right: auto; font-size: 0.75rem; color: var(--text-3); }
.talk-status { min-height: 1.25rem; }

@media (max-width: 700px) {
  .talk { gap: 0.375rem; padding: 0.5rem 0.75rem 0.625rem; }
  .talk-text { min-height: 2.75rem; }
  .talk-hint { display: none; }
  .talk-foot { flex-wrap: nowrap; gap: 0.5rem; }
  .talk-where { flex: 1 1 0; min-width: 0; }
  .talk-topic { flex: 1 1 0; min-width: 0; max-width: none; font-size: 1rem; }
}
@media (max-width: 700px), (pointer: coarse) {
  .topic-back, .talk-send, .talk-topic { min-height: 2.75rem; }
}
