/* ASSET-CARD-V2 — unified asset card (templates/_asset_card.html).
   Built on the site's own variables from style.css (--plane, --surface, --ink, --meta,
   --grid, --border-strong, --link, --accent-wash, --up, --down, --stale-ink, --font, --mono).
   Only three tokens are new, because the site has no text-safe value for them:
     --ac-action / --ac-on-action  fill of primary buttons (white on --accent is 4.4:1, below AA)
     --ac-cond                     "with conditions" as text (--warn yellow is unreadable as text in light) */
:root { --ac-action: var(--link, #1c5cab); --ac-on-action: #fff; --ac-cond: #8a5300; --ac-yes: var(--up, #006300); --ac-no: var(--down, #b3261e); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ac-action: var(--link, #6da7ec); --ac-on-action: #0d0d0d; --ac-cond: #f5c04a; --ac-yes: #4cc24c; } }
:root[data-theme="dark"] { --ac-action: var(--link, #6da7ec); --ac-on-action: #0d0d0d; --ac-cond: #f5c04a; --ac-yes: #4cc24c; }

.ac { --ac-line: var(--grid); display: flex; flex-direction: column; gap: 28px; font-size: 16px; line-height: 1.6; color: var(--ink); }
.ac a { color: var(--link); }
.ac h1, .ac h2, .ac h3, .ac p { margin: 0; }
.ac h2 { font-size: 26px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; text-wrap: balance; }
.ac h3 { font-size: 18px; font-weight: 650; }
.ac code, .ac pre { font-family: var(--mono); font-size: 14px; }
.ac-muted { color: var(--meta); }
.ac-small { font-size: 14px; line-height: 1.5; }
.ac-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ac-ic { flex: 0 0 auto; display: block; }
.ac [hidden] { display: none !important; }
.ac :focus-visible { outline: 2px solid var(--ac-action); outline-offset: 2px; border-radius: 6px; }

/* status colors: icon + text, never color alone */
.ac-s-yes { color: var(--ac-yes); }
.ac-s-cond { color: var(--ac-cond); }
.ac-s-no { color: var(--ac-no); }
.ac-s-unknown { color: var(--meta); }
.ac-s-info { color: var(--ink); }
.ac-up { color: var(--ac-yes); }
.ac-down { color: var(--ac-no); }

/* buttons: color of action is separate from the status colors */
.ac-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 8px; background: transparent; color: var(--ink); font: 500 15px var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s; }
.ac a.ac-btn { color: var(--ink); }
.ac-btn:hover { background: var(--surface-2); text-decoration: none; }
.ac-btn-primary { min-height: 48px; padding: 0 20px; border-color: var(--ac-action); background: var(--ac-action); color: var(--ac-on-action); font-weight: 650; font-size: 16px; }
.ac-btn-primary:hover { background: var(--ac-action); filter: brightness(1.08); }
.ac-btn-sm { min-height: 44px; font-size: 15px; padding: 0 16px; }
.ac-btn-block { width: 100%; }
.ac-btn[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--ac-action); color: var(--ac-action); }
.ac-btn[aria-pressed="true"] .ac-ic { fill: currentColor; }
.ac-icon-btn { flex: 0 0 44px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--meta); cursor: pointer; }
.ac-icon-btn:hover { color: var(--ink); background: var(--surface); }
.ac-icon-btn .ac-ic-done { display: none; color: var(--ac-yes); }
.ac-icon-btn.is-done > .ac-ic { display: none; }
.ac-icon-btn.is-done .ac-ic-done { display: block; }

/* top row */
.ac-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.ac-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 14px; color: var(--meta); }
.ac-crumbs a { color: var(--meta); display: inline-flex; align-items: center; min-height: 32px; }
.ac-crumbs [aria-current] { color: var(--ink); }
.ac-save { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: transparent; color: var(--ink); font: 500 15px var(--font); cursor: pointer; }
.ac-save[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--ac-action); color: var(--ac-action); }
.ac-save[aria-pressed="true"] .ac-ic { fill: currentColor; }

/* hero */
.ac-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 32px 48px; }
.ac-hero-text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.ac-title { display: flex; align-items: center; gap: 16px; }
.ac-logo { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); object-fit: cover; }
.ac-logo-letter { display: inline-flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 650; color: var(--meta); background: var(--surface-2); }
.ac-title-text { min-width: 0; }
.ac h1 { font-size: 42px; line-height: 1.1; font-weight: 650; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ac-by { font-size: 15px; color: var(--meta); }
.ac-lead { font-size: 19px; line-height: 1.5; max-width: 34em; color: var(--ink-2); }
.ac-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--ink); font-size: 14px; text-decoration: none; }
.ac a.ac-chip { color: var(--ink); }
.ac-chip-quiet { border-color: var(--border); color: var(--meta); }
.ac-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ac-preview { flex: 1 1 420px; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ac-preview-frame { border-radius: 12px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.ac-preview-frame img { display: block; width: 100%; height: auto; }
.ac-preview figcaption { font-size: 14px; color: var(--meta); }

/* verdict strip */
.ac-verdicts { display: flex; flex-direction: column; }
.ac-vstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ac-line); border-bottom: 1px solid var(--ac-line); }
.ac-v { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px 20px; border: 0; border-right: 1px solid var(--ac-line); background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer; transition: background-color .15s; }
.ac-v:last-child { border-right: 0; }
.ac-v:hover { background: var(--surface-2); }
.ac-v[aria-expanded="true"] { background: var(--accent-wash); }
.ac-v-label { font-size: 14px; color: var(--meta); }
.ac-v-value { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 650; line-height: 1.2; }
.ac-v-value .ac-ic { width: 22px; height: 22px; }
.ac-v-value sup { font-size: 13px; color: var(--ac-action); align-self: flex-start; }
.ac-v-sub { font-size: 14px; color: var(--meta); }
.ac-vnote { position: relative; display: flex; padding: 18px 64px 18px 20px; background: var(--accent-wash); border-bottom: 1px solid var(--ac-line); }
.ac-vnote-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 46em; }
.ac-vnote-head { font-size: 14px; color: var(--meta); }
.ac-vnote blockquote { margin: 0; font-size: 18px; line-height: 1.5; font-style: italic; }
.ac-vnote-body a { font-size: 14px; }
.ac-vnote-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.ac-vnote-close:hover { background: var(--surface); }
.ac-vfoot { padding-top: 10px; display: flex; flex-wrap: wrap; gap: 2px 18px; font-size: 14px; color: var(--meta); }
.ac-vfoot a { color: var(--meta); }

/* sticky in-page navigation: sits right under the sticky site header (--site-head-h is set by asset-card.js) */
.ac-nav { position: sticky; top: var(--site-head-h, 0px); z-index: 5; background: var(--plane); border-bottom: 1px solid var(--ac-line); margin-block: -8px; }
.ac-nav-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.ac-nav-row::-webkit-scrollbar { display: none; }
.ac-nav a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; color: var(--meta); font-size: 15px; text-decoration: none; transition: background-color .15s, color .15s; }
.ac-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.ac-nav a[aria-current="location"] { background: var(--ac-action); color: var(--ac-on-action); font-weight: 650; }

/* columns */
.ac-cols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 56px 48px; }
.ac-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 64px; }
.ac-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 40px; }
.ac-sec, .ac-side #checked { scroll-margin-top: calc(var(--site-head-h, 0px) + 76px); }
.ac-sec { display: flex; flex-direction: column; gap: 20px; }
.ac-prose { font-size: 17px; line-height: 1.7; max-width: 38em; }
.ac-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; list-style: disc outside; }
.ac-list li { display: list-item; }

/* uses */
.ac-uses { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px 32px; }
.ac-use { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--ac-line); }
.ac-use img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 8px; }
.ac-use-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 650; }
.ac-use-text { color: var(--ink-2); }
.ac-pill { display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--meta); line-height: 20px; }

/* popularity */
.ac-stats { display: flex; flex-wrap: wrap; gap: 24px 48px; }
.ac-stat { display: flex; flex-direction: column; gap: 2px; min-width: 120px; max-width: 220px; }
.ac-stat-n { font-size: 32px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ac-stat-n span { font-size: 16px; font-weight: 400; color: var(--meta); }
.ac-stat-l { font-size: 14px; color: var(--meta); }
.ac-stat-l a { color: var(--meta); }
.ac-stat-d { font-size: 14px; font-weight: 600; }
.ac-flag { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--meta); max-width: 46em; }
.ac-flag b { color: var(--ink); font-weight: 600; }
.ac-flag .ac-ic { margin-top: 2px; }
.ac-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.ac-chart { max-width: 620px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ac-chart figcaption { display: flex; flex-direction: column; }
.ac-chart figcaption b { font-weight: 650; }
.ac-chart figcaption span { font-size: 14px; color: var(--meta); }
.ac-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ac-chart .ac-grid { stroke: var(--grid); }
.ac-chart .ac-axis { fill: var(--meta); font-size: 11px; font-family: var(--font); }
.ac-chart .ac-bar { fill: var(--series-1, #2a78d6); }
.ac-chart .ac-bar-last { fill: var(--series-1, #2a78d6); opacity: .55; }
.ac-chart .ac-val { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--font); }

/* how to start */
.ac-prompt { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 14px; }
.ac-prompt-h { font-size: 15px; font-weight: 650; }
.ac-prompt-text { font-size: 18px; line-height: 1.6; max-width: 38em; }
.ac-install-wrap { display: flex; flex-direction: column; gap: 8px; }
.ac-install { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.ac-install pre { flex: 1 1 auto; min-width: 0; margin: 0; padding: 14px 0; overflow-x: auto; }
.ac-code { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ac-code summary { list-style: none; min-height: 52px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 16px; font-weight: 650; cursor: pointer; }
.ac-code summary::-webkit-details-marker, .ac-faq summary::-webkit-details-marker { display: none; }
.ac-code-hint { font-weight: 400; font-size: 15px; }
.ac-chev { display: inline-flex; transition: transform .15s; }
details[open] > summary .ac-chev { transform: rotate(180deg); }
.ac-code-body { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.ac-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ac-line); overflow-x: auto; }
.ac-tabs button { min-height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--meta); font: 600 15px var(--font); cursor: pointer; white-space: nowrap; }
.ac-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ac-action); }
.ac-panel { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ac-panel pre, .ac-rules pre { margin: 0; padding: 14px 16px; background: var(--surface-2); border-radius: 8px; overflow-x: auto; line-height: 1.6; }

/* rows: label / value lines without boxes */
.ac-rows { border-top: 1px solid var(--ac-line); }
.ac-row { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--ac-line); }
.ac-row-l { flex: 0 1 220px; font-size: 15px; color: var(--meta); }
.ac-row-v { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.ac-row-val { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ac-quote { font-size: 15px; line-height: 1.6; color: var(--ink-2); font-style: italic; }
.ac-quote a { font-style: normal; font-size: 14px; }
.ac-links { flex-direction: row; flex-wrap: wrap; gap: 4px 20px; }
.ac-key { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; }
.ac-key > span { display: inline-flex; align-items: center; gap: 6px; }
.ac-key > span > span { color: var(--meta); }

.ac-mistake { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 16px 0; border-bottom: 1px solid var(--ac-line); }
.ac-dont, .ac-do { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ac-dont { flex-direction: row; gap: 10px; color: var(--meta); }
.ac-do > div { display: flex; gap: 10px; font-weight: 500; }
.ac-do > p { padding-left: 28px; }
.ac-mistake code { font-size: 14px; overflow-wrap: anywhere; }
.ac-mistake span, .ac-mistake code { min-width: 0; overflow-wrap: anywhere; }  /* long paths without spaces wrap on phones */
.ac-dont .ac-ic, .ac-do .ac-ic { margin-top: 3px; }

.ac-rules { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ac-rules-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border); font-weight: 650; font-size: 15px; }
.ac-rules pre { border-radius: 0; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }

.ac-alt { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 32px; padding: 16px 0; border-bottom: 1px solid var(--ac-line); }
.ac-alt-main { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ac-alt-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 650; font-size: 17px; }
.ac-alt-name a { color: var(--ink); }
.ac-alt-facts { flex: 1 1 240px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 14px; }
.ac-alt-facts > span { display: inline-flex; align-items: center; gap: 6px; }
.ac-more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }

.ac-faq { border-bottom: 1px solid var(--ac-line); }
.ac-faq summary { list-style: none; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 0; font-weight: 650; font-size: 17px; cursor: pointer; }
.ac-faq p { margin: 0 0 18px 30px; color: var(--ink-2); max-width: 38em; }

/* sidebar */
.ac-side section { display: flex; flex-direction: column; gap: 10px; }
.ac-side h2 { font-size: 17px; }
.ac-dl { margin: 0; }
.ac-dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--ac-line); font-size: 15px; }
.ac-dl > div:last-child { border-bottom: 1px solid var(--ac-line); }
.ac-dl dt { color: var(--meta); }
.ac-dl dd { margin: 0; text-align: right; }
.ac-dl .ac-dl-wide { flex-direction: column; gap: 2px; }
.ac-dl .ac-dl-wide dd { text-align: left; font-size: 14px; }
.ac-side .ac-list { font-size: 15px; }
.ac-srcs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; overflow-wrap: anywhere; }

/* responsive (spec section 6) */
@media (max-width: 1000px) {
  .ac-vstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-v:nth-child(2n) { border-right: 0; }
  .ac-v:nth-child(-n+2) { border-bottom: 1px solid var(--ac-line); }
}
@media (max-width: 700px) {
  .ac h1 { font-size: 32px; }
  .ac h2 { font-size: 23px; }
  .ac-vstrip { grid-template-columns: 1fr; }
  .ac-v { border-right: 0; border-bottom: 1px solid var(--ac-line); padding: 14px 4px; }
  .ac-v:last-child { border-bottom: 0; }
  .ac-vnote { padding: 16px 56px 16px 12px; }
  .ac-row-l { flex-basis: 100%; }
  .ac-crumbs a { min-height: 44px; }
  .ac-main { gap: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .ac *, .ac *::before { transition: none !important; animation: none !important; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ASSET-CARD-QUIET (2026-11-17), appended to static/css/asset-card.css at the next deploy.
   Rule: one solid (primary) button per page, the hero action. Repeated or secondary actions are quiet. */
.ac-nav a[aria-current="location"] { background: var(--accent-wash); color: var(--ink); font-weight: 650; }
.ac-prompt .ac-btn-primary, .ac-rules .ac-btn-primary, .ac-sec .ac-btn-primary {
  min-height: 44px; padding: 0 16px; border-color: var(--border-strong); background: transparent; color: var(--ink); font-weight: 600; font-size: 15px; }
.ac-prompt .ac-btn-primary:hover, .ac-rules .ac-btn-primary:hover, .ac-sec .ac-btn-primary:hover { background: var(--accent-wash); filter: none; }

/* ASSET-CARD-V2 mobile fixes (2026-11-17), appended to static/css/asset-card.css at the next deploy.
   1. Long URLs and paths wrap instead of running past the column on phones. */
.ac-faq p, .ac-prose, .ac-row-v, .ac-vnote-body, .ac-dl dd, .ac-alt-main, .ac-use-text, .ac-quote, .ac-prompt-text { overflow-wrap: anywhere; }
/* 2. Stand-alone links get a 44 px tall tap area without moving the layout (padding out, margin back in). */
.ac-vnote-body > a, .ac-dl dd a, .ac-row-l a, .ac-row-v > a, .ac-side section > a, .ac-alt-name a { display: inline-block; padding-block: 11px; margin-block: -11px; }

/* ASSET-CARD-NAV (2026-11-17): the sticky in-page nav and the verdict footer were too faint after ASSET-CARD-QUIET.
   No solid fill: readable inactive items, a tinted active pill with a thin ring in the link hue, a separated bar.
   Contrast (WCAG): inactive ink-2 on surface 7.7:1 light / 9.7:1 dark; active link on its tint 5.4:1 / 4.9:1. */
.ac { --ac-nav-tint: rgba(28, 92, 171, .12); --ac-nav-ring: rgba(28, 92, 171, .35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ac { --ac-nav-tint: rgba(109, 167, 236, .20); --ac-nav-ring: rgba(109, 167, 236, .35); } }
:root[data-theme="dark"] .ac { --ac-nav-tint: rgba(109, 167, 236, .20); --ac-nav-ring: rgba(109, 167, 236, .35); }
.ac-nav { background: var(--surface); border-bottom: 1px solid var(--border-strong); box-shadow: 0 10px 16px -16px rgba(0, 0, 0, .45); }
.ac-nav-row { padding-inline: 6px; }
.ac-nav a { color: var(--ink-2); font-weight: 500; }
.ac-nav a:hover { background: var(--surface-2); color: var(--ink); }
.ac-nav a[aria-current="location"] { background: var(--ac-nav-tint); color: var(--link); font-weight: 650; box-shadow: inset 0 0 0 1px var(--ac-nav-ring); }
.ac-vfoot { color: var(--ink-2); }
.ac-vfoot a { color: var(--link); }
