/* The one count look (owner 2026-11-14, "B · Ledger"; teramud
   docs/quill.md §4.15, arcana docs/combat-view.md §5): every count is
   "×N" after the thing it counts, gold fixed-width numerals after a quiet
   ×. A live count that goes up rolls up once (.quill-count-roll; never
   with reduced motion, never for a count drawn the first time).

   One markup for all of them: Quill <count/>, the wasm core's combat
   counts (arcana-theme html::count_span, with the count's colour inline:
   gold, darker on a light row, the row's own on a red one) and the
   Story's blow rows (combat-story.js, counts.js countEl):
     <span class="quill-count"><span class="quill-count-x" aria-hidden="true">×</span><span class="quill-count-n">8</span></span>
   Combat text writes a real space before it; a Quill document may add a
   margin of its own. */
:root {
  --count-ink: var(--gilt, #c7a24b);
  --count-font: "JetBrains Mono", ui-monospace, Consolas, Menlo, monospace;
  --count-x-opacity: 0.55;
}
:root.theme-light { --count-ink: #6f5110; }
.quill-count { color: var(--count-ink); white-space: nowrap; }
.quill-count-x { font-style: normal; font-weight: 400; opacity: var(--count-x-opacity); margin-right: 1px; }
.quill-count-n { font-family: var(--count-font); font-weight: 600; letter-spacing: -0.02em; }
.quill-count-roll .quill-count-n { display: inline-block; animation: quill-count-roll 0.3s ease-out; }
@keyframes quill-count-roll { from { transform: translateY(70%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .quill-count-roll .quill-count-n { animation: none; } }

/* In a Quill document (Content.Show out: the floor, a stack of creatures,
   inventory) the count stands a little after the text it counts; telnet's
   " [8]" has the space, the markup doesn't. */
:is(.quill-show, .quill-out, .room-entry) .quill-count { margin-left: 0.32em; }

/* <idx/>: which line (teramud docs/quill.md §4.14, owner 2026-11-14,
   "B · Ledger"): gold fixed-width numerals right-aligned in a left margin
   behind a thin ruled line, no brackets. A line led by one
   (p.quill-ixl: span.quill-idx, then span.quill-ixt) is two columns, so a
   wrapped line hangs under its text. The margin is a fixed width (three
   digits), so lines line up across the documents of one list (the floor's
   things and the creatures after them) and an empty <idx/>
   (.quill-idx-none) keeps it: the names line up. In a grid cell (the news
   list's Num, a board's No.) the column lines them up; the rule follows the
   number. A list with one number draws none: the game leaves it out. */
:root { --idx-w: 2.2em; --idx-gap: 6px; }
.quill-ixl { display: grid; grid-template-columns: var(--idx-w) minmax(0, 1fr); align-items: baseline; }
.quill-idx { font-family: var(--count-font); font-size: 0.8em; font-weight: 400; color: var(--count-ink); opacity: 0.85; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.quill-ixl > .quill-idx { padding-right: var(--idx-gap); overflow: hidden; }
.quill-ixt { min-width: 0; border-left: 1px solid var(--rule-strong); padding-left: 8px; }
:is(td, th) > .quill-idx { display: inline-block; padding-right: var(--idx-gap); border-right: 1px solid var(--rule-strong); font-size: 0.85em; }
/* On the room floor the index is inline (<idx inline="yes"/>, owner
   2026-11-14): only stacks are numbered there, so a margin would push one
   line in while the single things, the creatures and the next lines start
   at the edge. The line starts at the edge like every room line: the number,
   its thin rule, then the text; a long line just wraps. */
.quill-idx-inline { display: inline-block; padding-right: var(--idx-gap); margin-right: 8px; border-right: 1px solid var(--rule-strong); line-height: 1.1; }
.quill-idx-inline.quill-idx-none { display: none; }
