/* AAC app census (/aac-app-prices/). Loaded after site.css on that page only; uses its tokens, so light and dark
   follow the rest of the site. Charts: tools/aac_census/charts.py (inline SVG, percentage x positions).
   Series colors, validated with the dataviz validator against the chart surface in each mode (2026-10-30):
   pay once = teal, a year of subscription = orange; light #007FA8/#EB6834 on #FFFFFF, dark #2F96BA/#D95926 on
   #0E1C21: lightness, chroma, CVD (17.3 / 20.4) and contrast all pass. Text never wears a series color.
   Unit chart (an ordinal pair of one hue: "one of the ten most-rated" darker in light mode, lighter in dark):
   light #7DBAD0/#007FA8, dark #1F5C6E/#8AD6EC, validated with --ordinal (light end >= 2:1 on the surface). */
:root { --c-once: #007FA8; --c-year: #EB6834; --grid: #E3EAED; --base: #B9C7CD; }
@media (prefers-color-scheme: dark) { :root { --c-once: #2F96BA; --c-year: #D95926; --grid: #1E3139; --base: #36515C; } }

.page-head .eyebrow { margin-bottom: 14px; }
.page-head .byline { font-size: .95rem; margin-top: 14px; color: var(--ink-2); }
.census { max-width: calc(980px + 2 * var(--gutter)); padding-top: clamp(20px, 3vw, 40px); padding-bottom: clamp(48px, 6vw, 80px); line-height: 1.65; }
.census > section { margin: 0 0 clamp(28px, 4vw, 48px); padding: 0; }
.census h2 { font-size: var(--step-2); max-width: 30ch; margin: 0 0 .55em; scroll-margin-top: 16px; line-height: 1.15; }
.census h3 { font-size: var(--step-1); margin: 1.4em 0 .4em; }
.census p, .census ul { max-width: 68ch; }
.census ul { padding-left: 1.3em; }
.census li { margin-bottom: .4em; }
.census > .finding, .census > .method, .census > .data { border-top: 1px solid var(--line); padding-top: clamp(28px, 3.5vw, 40px); }
.census > section:first-child { border-top: 0; padding-top: 0; }
.census > .disclosure { background: var(--surface-2); border-radius: var(--radius); padding: 24px 26px 8px; }

/* Figure shell */
.viz { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 16px; margin: 24px 0 0; }
.viz figcaption { margin: 0 0 14px; }
.viz-t { display: block; font-weight: 800; font-size: 1.1rem; line-height: 1.3; }
.viz-s { display: block; color: var(--ink-2); font-size: .95rem; margin-top: 2px; }
.viz-note { color: var(--ink-2); font-size: .92rem; margin: 14px 0 0; max-width: none !important; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0 0 12px; padding: 0 !important; font-size: .92rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.legend svg { overflow: visible; }
.m-once { fill: var(--c-once); stroke: var(--surface); stroke-width: 2; }
.m-year { fill: var(--surface); stroke: var(--c-year); stroke-width: 2.5; }
.g { stroke: var(--grid); stroke-width: 1; }
.base { stroke: var(--base); stroke-width: 1; }
.link { stroke: var(--base); stroke-width: 1.5; }
.ax { width: 100%; overflow: visible; display: block; }
.ax text, .ann { font-family: var(--font); }
.ax text { fill: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.trk { width: 100%; overflow: visible; display: block; }

/* Dot plot: one row per app */
.dots, .bars { list-style: none; margin: 0; padding: 0 !important; max-width: none !important; }
.dots li, .bars li { display: grid; grid-template-columns: minmax(9rem, 30%) 1fr; gap: 0 14px; align-items: center; margin: 0; border-radius: 6px; }
.dots li:not(.axis) { min-height: 26px; }
.dots .lab, .bars .lab { font-size: .95rem; line-height: 1.25; }
.dots li[tabindex]:hover, .bars li:hover { background: var(--tint); }
.dots li:focus-visible, .bars li:focus-visible, .u:focus-visible, .t:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dots li:hover .m-once, .dots li:focus .m-once { r: 7; }

/* Bars */
.bars li { min-height: 34px; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bars .trk { width: calc((100% - 3.5em) * var(--f)); flex: none; }
.bar { fill: var(--c-once); }
.bars li:hover .bar { opacity: .85; }
.bars .val { font-variant-numeric: tabular-nums; font-weight: 700; }

/* Unit chart */
.units { display: grid; gap: 14px; }
.ugrp .lab { margin: 0 0 6px; font-size: .95rem; }
.ugrp .lab strong { font-size: 1.15rem; }
.usq { list-style: none; margin: 0; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 4px; max-width: none !important; }
.u, .key.u { width: 22px; height: 22px; border-radius: 6px 6px 6px 2px; background: #7DBAD0; margin: 0; display: inline-block; }
.u.hi, .key.u.hi { background: var(--c-once); }
.key.u { width: 14px; height: 14px; border-radius: 4px 4px 4px 1px; }
.u:hover { outline: 2px solid var(--ink-2); outline-offset: 1px; }

/* Timeline (dot histogram) */
.ann { fill: var(--ink-2); font-size: 13px; }
.page-head .wrap.census-head { max-width: calc(980px + 2 * var(--gutter)); }
.tl { padding: 0 6px; }
.tl-plot { width: 100%; display: block; overflow: visible; }
.t .d { fill: var(--c-once); stroke: var(--surface); stroke-width: 2; }
.t.hi .d, .legend .hi .d { fill: var(--c-year); }
.legend .d { fill: var(--c-once); }
.t .hit { fill: transparent; }
.t:hover .d, .t:focus .d { stroke: var(--ink); }

/* Table views */
.tv { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.tv summary { cursor: pointer; font-weight: 700; color: var(--link); font-size: .95rem; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .95rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { font-weight: 800; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* The full table */
.viz.wide { padding: 18px 0 14px; }
.viz.wide figcaption, .viz.wide .viz-note, .filters { padding: 0 22px; }
.apps { min-width: 760px; margin-top: 0; }
.apps th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 10.5rem; }
.apps tbody th { font-weight: 700; }
.apps .src { display: block; font-weight: 400; font-size: .85rem; margin-top: 2px; }
.apps .note { display: block; color: var(--ink-2); font-size: .82rem; line-height: 1.35; margin-top: 2px; min-width: 24ch; max-width: 40ch; }
.apps td:nth-child(2), .apps td:nth-child(3) { width: 4.5rem; }
.apps td:last-child, .apps td:nth-child(4), .apps td:nth-child(5), .apps td:nth-child(7) { white-space: nowrap; }
.apps .no { color: var(--ink-3); }
.apps .talk { display: block; width: fit-content; margin-top: 3px; font-size: .78rem; font-weight: 700; color: var(--link); background: var(--tint); border-radius: 6px; padding: 1px 7px; }
.apps tbody tr:hover { background: var(--tint); }
.apps tr[hidden] { display: none; }
.apps th button { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-weight: 800; }
.apps th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.apps th button::after { content: "\2195"; color: var(--ink-3); font-weight: 400; }
.apps th[aria-sort="ascending"] button::after { content: "\2191"; color: var(--ink); }
.apps th[aria-sort="descending"] button::after { content: "\2193"; color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; margin: 0 0 14px; }
.filters label { display: grid; gap: 4px; font-size: .9rem; font-weight: 700; color: var(--ink-2); }
.filters select, .filters input { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line-cool); border-radius: 10px; padding: 8px 10px; min-height: 44px; }
.filters .count { margin: 0 0 10px; font-size: .92rem; color: var(--ink-2); }

/* Method, disclosure, data */
.cite { font-size: .95rem; color: var(--ink-2); border-left: 4px solid var(--accent); padding-left: 14px; }
.dl-row { margin: 0 0 16px; }

.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line-cool);
  border-radius: 10px; padding: 8px 12px; box-shadow: var(--shadow); font-size: .9rem; line-height: 1.4; max-width: 280px; }
.tip strong { display: block; }
.tip .t-row { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.tip .t-key { width: 12px; height: 3px; border-radius: 2px; flex: none; background: var(--ink-3); }
.tip .t-key.once { background: var(--c-once); }
.tip .t-key.year { background: var(--c-year); }
.tip .t-key.n { display: none; }
.tip[hidden] { display: none; }

@media (max-width: 600px) {
  .dots li, .bars li { grid-template-columns: 7.6rem 1fr; gap: 0 10px; }
  .dots .lab, .bars .lab { font-size: .86rem; }
  .dots li:not(.axis) { min-height: 30px; }
  .viz { padding: 16px 14px 12px; margin-left: calc(-1 * var(--gutter) / 2); margin-right: calc(-1 * var(--gutter) / 2); }
  .viz.wide figcaption, .viz.wide .viz-note, .filters { padding: 0 14px; }
  .filters label { flex: 1 1 140px; }
}
@media print { .tv, .tip, .filters { display: none; } }
@media (forced-colors: active) { .m-once, .bar, .u.hi, .t .d { fill: CanvasText; } .m-year { stroke: CanvasText; } }
@media (prefers-color-scheme: dark) {
  .u, .key.u { background: #1F5C6E; }
  .u.hi, .key.u.hi { background: #8AD6EC; }
}
