/* Articles (/:slug/articles): this page group's own rules, loaded after app.css.
 *
 * The shared components (the header, the title line ov-head, the list chooser ov-lists and service
 * chip ov-esp, figures ov-figs / ov-f-*, ov-lead, ov-plot, keys, marks, meters, ov-vs, ov-div, tones
 * ov-s-*) live in app.css with one name each: use them, never redefine them here. Every colour is a
 * token from the top of app.css.
 *
 * Every new name starts with art-. One scale for every bar and mark on the page: an article's clicks
 * against the sends around it, on the ratio axis (charts.ratioAt: 0.4x to 2.5x, log), so -20% and
 * +25% sit the same distance from the average. It has no unit, so it reads the same on every site,
 * every list and every email service. `is-` belongs to the marks alone and is always scoped. */

/* ─── Title line: Add articles, a button that opens a panel under it. No script. ─── */
.art-add { position: relative; }
.art-add > summary { list-style: none; gap: 6px; cursor: pointer; }
.art-add > summary::-webkit-details-marker { display: none; }
.art-add[open] > summary { background: var(--bg-2); }
.art-add > .art-add-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 25; width: min(560px, calc(100vw - 48px)); max-width: none; margin: 0; padding: 16px; border-radius: 12px; background: var(--raise); border: 1px solid var(--tip-line); box-shadow: var(--shadow); }
.art-add-pop .field { margin-top: 0; }
.art-add-pop textarea { display: block; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.art-add-pop .ov-q { font-size: 12px; }

/* An empty pool: the title line and Add, then one quiet line. */
.none.art-none { margin-top: 28px; }

/* ─── The three figures: the Overview's row, three across. ─── */
.ov-f-v.art-warn { color: var(--warn); }
.ov-f-v.art-zero { color: var(--ink-3); }
/* A figure's sub-line keeps its height when it is empty, so the three charts share one baseline. */
.ov-figs.art-figs .ov-f-s { min-height: 19px; }

/* In rotation: every article, split by what is known of it; the tick is the fewest the send times need. */
.art-pool { position: relative; display: block; height: 44px; }
.art-pool-bar { position: absolute; left: 0; top: 13px; display: flex; gap: 2px; height: 10px; }
.art-pool-bar > i { display: block; min-width: 2px; }
.art-pool-bar > i:first-child { border-radius: 5px 0 0 5px; }
.art-pool-bar > i:last-child { border-radius: 0 5px 5px 0; }
.art-pool-bar > i:only-child { border-radius: 5px; }
.art-k-sent { background: var(--mark); }
.art-k-new { background: var(--g-2); }
.art-k-weak { background: var(--warn); }
.art-floor { position: absolute; top: 6px; height: 24px; width: 1px; background: var(--ink); }
.art-floor b { position: absolute; top: calc(100% + 3px); transform: translateX(-50%); font-size: 10.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.art-floor.art-end b { transform: translateX(-100%); }
.art-pool.art-under .art-floor { background: var(--bad); }
.art-pool.art-under .art-floor b { color: var(--bad); }

/* Weak: one tick per article sent, on the ratio axis. Amber: weak. Accent: strong. No tips, no tab stops. */
.art-spread { position: relative; display: block; height: 28px; border-bottom: 1px solid var(--line-2); }
.art-spread > i { position: absolute; bottom: 3px; width: 2px; height: 20px; margin-left: -1px; border-radius: 1px; background: var(--mark-2); opacity: 0.75; }
.art-spread > i.art-s-weak { background: var(--warn); opacity: 1; }
.art-spread > i.art-s-strong { background: var(--mark); opacity: 1; }
.art-spread > b { position: absolute; top: -2px; bottom: 0; width: 1px; background: var(--ink); }
.art-spread > u { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--ink-3); opacity: 0.7; }
.art-axis { position: relative; display: block; height: 14px; margin-top: 2px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.art-axis > span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.art-axis > span.art-0 { font-weight: 600; color: var(--ink-2); }

/* ─── The view chooser, a filter from By topic, and what acts on the whole view. ─── */
.art-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 28px 0 10px; }
.art-views { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.art-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.art-bulk .confirm { align-items: center; margin-top: 0; }
.art-bulk .confirm input { margin: 0; }
.art-filter { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px 2px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 12.5px; font-weight: 550; color: var(--ink); white-space: nowrap; }
.art-filter a { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--ink-3); }
.art-filter a:hover { background: var(--bg-2); color: var(--ink); }

/* ─── The ranked list. Hairline rows; the column heads stay in view under the header. ─── */
.art-list { width: 100%; border-collapse: collapse; table-layout: fixed; }
.art-list th { position: sticky; top: 56px; z-index: 3; height: 34px; padding: 0 0 8px; background: var(--bg); box-shadow: inset 0 -1px 0 var(--line-2); font-size: 12px; font-weight: 400; color: var(--ink-3); text-align: left; white-space: nowrap; vertical-align: bottom; }
.art-list td { height: 40px; padding: 0; border-top: 1px solid var(--line); vertical-align: middle; }
.art-list tbody tr:first-child td { border-top: 0; }
.art-list .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }
/* Widths on the heads: with a fixed layout the first row sets them, and a hidden head takes its column with it. */
.art-list th.art-b { width: 22%; }
.art-list th.art-vs { width: 82px; }
.art-list th.art-rate { width: 70px; }
.art-list th.art-money { width: 108px; }
.art-list th.art-sent { width: 50px; }
.art-list th.art-last { width: 66px; }
.art-list th.art-act { width: 84px; }

.art-list td.art-h { padding: 6px 16px 6px 0; min-width: 0; }
.art-h > a { font-weight: 500; line-height: 1.3; }
.art-h > a:hover { color: var(--accent); }
.art-t { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 1px; font-size: 12px; line-height: 16px; }
.art-t > a { color: var(--ink-3); }
.art-t > a:hover { color: var(--accent); }
.art-t > a.art-t-person { color: var(--ink-2); }
.art-t > a.art-t-none { color: var(--warn); }
.art-gone { display: inline-flex; align-items: center; gap: 5px; font-weight: 550; color: var(--warn); }
.art-src { color: var(--ink-3); }

/* The bar: from the average (solid line) to the article. Dashed: the weak line, a fifth under. */
.art-list td.art-b { position: relative; }
.art-b > b { position: absolute; top: 0; bottom: -1px; left: 50%; width: 1px; background: var(--ink-3); z-index: 1; }
.art-b > u { position: absolute; top: 0; bottom: -1px; width: 0; border-left: 1px dashed var(--line-2); }
.art-b > i { position: absolute; top: 50%; height: 8px; margin-top: -4px; background: var(--mark); }
.art-b > i.is-up { border-radius: 0 3px 3px 0; }
.art-b > i.is-down { border-radius: 3px 0 0 3px; background: var(--mark-2); }
.art-b > i.is-weak { background: var(--warn); }
/* Not judged yet: a hollow dot on the average, never sent; filled, sent in the last 48 hours. */
.art-b > i.art-wait { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--g-2); z-index: 2; }
.art-b > i.art-wait.art-settle { background: var(--g-2); box-shadow: 0 0 0 2px var(--bg); }
.art-scale { position: relative; display: block; height: 14px; }
.art-scale > span { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.art-scale > span.art-0 { font-weight: 600; color: var(--ink-2); }

.art-list .art-vs { font-weight: 650; }
.art-list tr.art-is-weak .art-vs { color: var(--warn); }
.art-list .art-q { color: var(--ink-3); font-weight: 400; }
.art-list td.art-vs .art-q { font-weight: 550; }
.art-list td.art-act { padding-left: 12px; }
.art-act .btn { opacity: 0; }
.art-list tbody tr:hover .art-act .btn, .art-act .btn:focus-visible { opacity: 1; }
.art-list tbody tr:hover td { background: var(--bg-2); }
.art-list tr.art-open td, .art-list tr:target td { background: var(--wash); }
/* A row reached by its link lands below the sticky header and heads, not under them (scroll-margin does not reach a table row). */
html:has(#articles .art-list tr:target) { scroll-padding-top: 120px; }

/* The topic form, open on one row. */
.art-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0 2px; }
.art-form select { font: inherit; font-size: 12.5px; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 6px; }
.art-form .btn { min-height: 26px; padding: 0 10px; font-size: 12.5px; }
.art-form a { font-size: 12.5px; color: var(--ink-3); }
.art-form a:hover { color: var(--accent); }

/* ─── By topic: each kind of article as a dot (its middle article) with the range chance allows.
   Significant only when the range keeps off the average line: then coloured, with its figure. ─── */
.art-chk { display: flex; align-items: center; gap: 10px; margin: 6px 0 18px; font-size: 12.5px; color: var(--ink-3); }
.art-chk-bar { display: block; width: 160px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.art-chk-bar > i { display: block; height: 100%; background: var(--mark); }
.art-chk b { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.art-tps { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: 48px; align-items: start; }
.art-tp-row { display: grid; grid-template-columns: minmax(120px, 1fr) 52px minmax(100px, 200px) 72px; column-gap: 14px; align-items: center; min-height: 40px; border-top: 1px solid var(--line); }
a.art-tp-row:hover { background: var(--bg-2); }
a.art-tp-row:hover .art-tp-name { color: var(--accent); }
.art-tp-head { min-height: 34px; align-items: end; padding-bottom: 8px; border-top: 0; box-shadow: inset 0 -1px 0 var(--line-2); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.art-tp-head + .art-tp-row { border-top: 0; }
.art-tp-name { font-weight: 600; }
.art-tp-row.art-tp-minor { min-height: 34px; font-size: 13px; }
.art-tp-row.art-tp-minor .art-tp-name { padding-left: 16px; font-weight: 400; color: var(--ink-2); }
.art-tp-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.art-tp-head .art-tp-n { color: var(--ink-3); }
.art-tp-v { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.art-tp-head .art-tp-v { font-weight: 400; }
.art-tp-v.art-dash { font-weight: 400; color: var(--ink-3); }
.art-tp-v.art-up { color: var(--up); }
.art-tp-v.art-dn { color: var(--warn); }
.art-ci { position: relative; display: block; height: 24px; }
.art-ci > b { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--ink-3); }
.art-ci > s { position: absolute; top: 50%; height: 2px; margin-top: -1px; border-radius: 1px; background: var(--line-2); text-decoration: none; }
.art-ci > i { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--mark-2); box-shadow: 0 0 0 2px var(--bg); z-index: 1; }
.art-ci.art-up > s { background: var(--mark); opacity: 0.55; }
.art-ci.art-up > i { background: var(--mark); }
.art-ci.art-dn > s { background: var(--warn); opacity: 0.55; }
.art-ci.art-dn > i { background: var(--warn); }
.art-ci.art-few > i { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--mark-2), 0 0 0 2px var(--bg); }
a.art-tp-row:hover .art-ci > i { box-shadow: 0 0 0 2px var(--bg-2); }
a.art-tp-row:hover .art-ci.art-few > i { box-shadow: inset 0 0 0 1.5px var(--mark-2), 0 0 0 2px var(--bg-2); }

/* ─── Narrower ─── */

/* At 960 or under the shared figure row goes two across; this page keeps its three. */
@media (max-width: 960px) {
  .ov-figs.art-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-figs.art-figs > .ov-f:nth-child(3) { padding-left: 20px; border-left: 1px solid var(--line); }
  .art-list .art-b, .art-list .art-last { display: none; }
  .art-tps { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
}
@media (hover: none) { .art-act .btn { opacity: 1; } }
@media (max-width: 640px) {
  .ov-figs.art-figs { grid-template-columns: minmax(0, 1fr); row-gap: 22px; }
  .ov-figs.art-figs > .ov-f, .ov-figs.art-figs > .ov-f:nth-child(3) { padding-left: 0; border-left: 0; }
  .art-list .art-money, .art-list .art-rate { display: none; }
  .art-list th.art-act { width: 64px; }
  .art-tp-row { grid-template-columns: minmax(0, 1fr) 36px 96px 60px; column-gap: 10px; }
}
