/* ---------- charts: a table drawn as a chart (section 16f, app/js/chart.js) ---------- */

/* Its table stays under it, out of sight but still read aloud and still typed in: a cell given the keyboard opens it
   under the chart (.tch-ed) until the keyboard leaves it. */
.obj.table.tch:not(.tch-ed) > .tgrid { position: absolute; left: 0; top: 0; width: 100%; height: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.obj.table.tch-ed > .tgrid { border-top: 1px solid var(--rule-2); }

/* The pitch deck's look: ink and greys (one lit in the table's own colour), hairline rules, figures in Geist with
   tabular digits, scales in Geist Mono; hollow and dashed where a figure is about or at least. Text is in the text
   inks, never in a mark's colour. The greys are the ink over the paper, so a coloured table's are its own. */
.tchart {
  --ch-1: var(--ink); --ch-lit: var(--ink);
  --ch-2: color-mix(in srgb, var(--ink) 58%, var(--surface));
  --ch-3: color-mix(in srgb, var(--ink) 30%, var(--surface));
  --ch-4: color-mix(in srgb, var(--ink) 16%, var(--surface));
  --ch-5: color-mix(in srgb, var(--ink) 7%, var(--surface));
  --ch-grid: var(--rule);
  position: relative; padding: 14px 16px; font-size: 15px; line-height: 1.4; font-variant-numeric: tabular-nums; color: var(--ink);
  user-select: none; -webkit-user-select: none; overflow-wrap: anywhere;
}
.obj.table[data-color] > .tchart { --ch-lit: var(--k-a); }
/* A colour of one's own is shown as it was picked, its fill and its mark alike (style.css), so a mark in it would vanish
   into the table: the lit one is the ink on it, as a plain table's is the ink. */
.obj.table[data-color^="#"] > .tchart { --ch-lit: var(--k-on); }
.obj.table[data-fs="s"] > .tchart { font-size: 13.5px; }
.obj.table[data-fs="l"] > .tchart { font-size: 17.5px; }
.obj.table[data-fs="xl"] > .tchart { font-size: 21.5px; }
.tchart :is(b, i, em, span) { font-style: normal; }
.ch-h { padding-bottom: .55em; font-size: .8em; line-height: 1.3; color: var(--ink-3); }
.ch-lg { display: flex; flex-wrap: wrap; gap: .2em 1.1em; }
.ch-lg > span { display: inline-flex; align-items: center; gap: .45em; color: var(--ink-2); }
.ch-lg i { flex: none; width: .72em; height: .72em; border-radius: 2px; background: var(--c); }
.ch-lg.round i { border-radius: 50%; }
.ch-lg.round > span:not(:last-child) i { width: .5em; height: .5em; }
.ch-none { padding: 1.4em .4em; font-size: .9em; text-align: center; color: var(--ink-3); }

/* bars and dots: a label a row, its marks on one scale beside it, each figure after its mark (room: for the last) */
.ch-bars { display: grid; grid-template-columns: fit-content(38%) minmax(0, 1fr); column-gap: 1.1em; }
.ch-bars > :is(.ch-t, .ch-ax, .ch-gl) { grid-column: 2; position: relative; min-width: 0; }
.ch-bars.lanes { grid-template-columns: fit-content(30%) repeat(var(--n), minmax(0, 1fr)); }
.ch-bars.lanes .ch-v { font-size: .9em; }
.ch-n { grid-column: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: .5em 0; border-top: 1px solid var(--ch-grid); }
.ch-n b { font-weight: 500; line-height: 1.3; }
.ch-n i { font-size: .8em; line-height: 1.3; color: var(--ink-3); }
.ch-t { min-height: 2.7em; border-top: 1px solid var(--ch-grid); }
.ch-p { position: absolute; top: 0; bottom: 0; left: 0; right: var(--room, 2.4em); }
.ch-ax { height: 1.75em; }
.ch-ax b { position: absolute; bottom: .55em; font: 400 .68em/1 var(--f-mono); letter-spacing: .02em; white-space: nowrap; color: var(--ink-3); }
.ch-gl { pointer-events: none; }
.ch-gl i { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: var(--ch-grid); }
.ch-bar { position: absolute; top: 50%; z-index: 1; height: .62em; translate: 0 -50%; border-radius: 0 2px 2px 0; background: var(--c); }
.ch-bars.many .ch-bar { height: .6em; }
.ch-bar.est { background: transparent; box-shadow: inset 0 0 0 1.25px var(--c); }
.ch-bar.plus { box-sizing: border-box; border: 1.25px dashed var(--c); border-left: 0; background: transparent; opacity: .75; }
.ch-v { position: absolute; top: 50%; z-index: 1; translate: 0 -50%; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.ch-v.sm { font-size: .7em; font-weight: 400; line-height: 1; color: var(--ink-2); }
.ch-x { position: absolute; top: 50%; translate: 0 -50%; font-size: .9em; white-space: nowrap; color: var(--ink-3); }
.ch-dots .ch-t { min-height: 2.9em; }
.ch-dots .ch-ax b { top: .6em; bottom: auto; }
.ch-dot { position: absolute; top: 50%; z-index: 2; width: .8em; height: .8em; margin: -.4em 0 0 -.4em; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface); }
.ch-dot.sm { width: .5em; height: .5em; margin: -.25em 0 0 -.25em; }
.ch-dot.est { background: var(--surface); box-shadow: inset 0 0 0 1.6px var(--c), 0 0 0 2px var(--surface); }
.ch-dl { position: absolute; top: 50%; z-index: 1; height: 2px; margin-top: -1px; background: var(--ch-3); }
.ch-dl.est { height: .5em; margin-top: -.25em; border-radius: .25em; background: transparent; box-shadow: inset 0 0 0 1.25px var(--c); }

/* columns and a line: a plot half as tall as it is wide, its labels under it */
.ch-box { position: relative; aspect-ratio: var(--ar, 2); }
.ch-cols .ch-box { margin-top: 1.4em; }
.ch-cols.ticks :is(.ch-box, .ch-xl) { margin-left: 3.4em; }
.ch-col { position: absolute; z-index: 1; border-radius: 2px 2px 0 0; background: var(--c); }
.ch-col.est { background: transparent; box-shadow: inset 0 0 0 1.25px var(--c); }
.ch-col.plus { box-sizing: border-box; border: 1.25px dashed var(--c); border-bottom: 0; background: transparent; opacity: .75; }
.ch-cv { position: absolute; z-index: 1; translate: -50% 0; font-size: .86em; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.ch-cv.sm { font-size: .7em; font-weight: 400; color: var(--ink-2); }
.ch-z { position: absolute; left: 0; right: 0; height: 1px; background: var(--rule-2); }
.ch-gy { position: absolute; left: 0; right: 0; height: 1px; background: var(--ch-grid); }
.ch-gy b { position: absolute; right: calc(100% + .55em); top: 0; translate: 0 -50%; font: 400 .68em/1 var(--f-mono); white-space: nowrap; color: var(--ink-3); }
.ch-xl { position: relative; height: 1.5em; margin-top: .45em; }
.ch-xl span { position: absolute; top: 0; translate: -50% 0; overflow: hidden; font-size: .78em; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; color: var(--ink-2); }
.ch-line .ch-box { margin: .7em var(--r) .5em var(--l); }
.ch-line .ch-xl { margin: 0 var(--r) 0 var(--l); }
.ch-gx { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: var(--ch-grid); }
.ch-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.ch-svg path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ch-svg path.sm { stroke-width: 1.5; }
.ch-svg path.dash { stroke-dasharray: 4 4; }
.ch-pt { position: absolute; z-index: 1; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface); }
.ch-pt.sm { width: 6px; height: 6px; margin: -3px 0 0 -3px; }
.ch-pt.est { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--c), 0 0 0 2px var(--surface); }
.ch-e, .ch-st { position: absolute; translate: 0 -50%; line-height: 1.2; white-space: nowrap; }
.ch-e { left: calc(100% + .7em); max-width: calc(var(--r) - .7em); overflow: hidden; text-overflow: ellipsis; }
.ch-e b { font-weight: 500; padding-left: .25em; }
.ch-st { right: calc(100% + .7em); font-size: .88em; color: var(--ink-2); }
.ch-e.sm, .ch-st.sm { color: var(--ink-3); }

/* parts of a whole: one bar, its parts 2px apart, named under them (or in a key, small ones) */
.ch-pb { display: flex; gap: 2px; height: .8em; }
.ch-pb i { min-width: 2px; border-radius: 1.5px; background: var(--c); }
.ch-pb i.est { background: transparent; box-shadow: inset 0 0 0 1.25px var(--c); }
.ch-pu { display: flex; gap: 2px; margin-top: .55em; }
.ch-pu > span { min-width: 0; padding-right: .7em; line-height: 1.35; }
.ch-pu b, .ch-pk b { font-weight: 500; }
.ch-pv { color: var(--ink-2); }
.ch-pu em, .ch-pk em { font-size: .85em; color: var(--ink-3); }
.ch-pk { display: flex; flex-wrap: wrap; gap: .35em 1.2em; margin: .75em 0 0; padding: 0; list-style: none; }
.ch-pk li { display: inline-flex; align-items: baseline; gap: .4em; }
.ch-pk li > i { flex: none; align-self: center; width: .72em; height: .72em; border-radius: 2px; background: var(--c); }
.ch-pg { display: grid; grid-template-columns: fit-content(34%) minmax(0, 1fr); align-items: center; gap: .7em 1.1em; }
.ch-pg > .ch-n { padding: 0; border: 0; }
.ch-pg > .ch-t { min-height: 0; border: 0; }

/* squares by area: one in another from the corner, each named across from its corner; or in a row on a line */
.ch-sq { display: grid; grid-template-columns: 46% minmax(0, 1fr); column-gap: 1.4em; margin-top: 1.3em; }
.ch-sa { position: relative; align-self: start; aspect-ratio: 1; }
.ch-s { position: absolute; left: 0; bottom: 0; width: var(--s); height: var(--s); min-width: 3px; min-height: 3px; background: var(--f); box-shadow: inset 0 0 0 1px var(--ch-3); }
.ch-s.on, .ch-sb.on { background: var(--c); box-shadow: none; }
.ch-s.est, .ch-sb.est { background: transparent; box-shadow: none; outline: 1.25px dashed var(--ch-2); outline-offset: -1.25px; }
.ch-ld { position: absolute; right: -1.15em; height: 1px; background: var(--ch-3); pointer-events: none; }
.ch-ld::before { content: ""; position: absolute; left: -2.5px; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--ch-2); }
.ch-sls { position: relative; min-height: var(--lh); }
.ch-sl { position: absolute; left: 0; right: 0; line-height: 1.25; }
.ch-sl b { display: block; font-size: 2.1em; font-weight: 300; line-height: 1.1; letter-spacing: -.02em; white-space: nowrap; }
.ch-sl span, .ch-sl em { display: block; }
.ch-sl em, .ch-sn { font-size: .85em; line-height: 1.35; color: var(--ink-3); }
.ch-sr { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: 1.2em; }
.ch-si { display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; min-width: 0; }
.ch-si > span { font: 500 .7em/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ch-si > b { margin-bottom: .2em; font-size: 1.9em; font-weight: 300; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; }
.ch-sb { display: block; width: var(--s); min-width: 3px; aspect-ratio: 1; background: var(--f); box-shadow: inset 0 0 0 1px var(--ch-2); }
.ch-bl { grid-column: 1 / -1; height: 1px; background: var(--ch-3); }
.ch-sn { padding-top: .6em; }

/* out of 100: ten by ten, the key beside them */
.ch-units { display: grid; grid-template-columns: min(40%, 15em) minmax(0, 1fr); align-items: start; column-gap: 1.4em; }
.ch-uw { --c: var(--ch-5); display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .22em; }
.ch-uw i { aspect-ratio: 1; border-radius: 2px; background: var(--c); }
.ch-uw i.on { background: var(--on); }
.ch-uw i.pt { background: linear-gradient(90deg, var(--on) var(--p), var(--c) 0); }
.ch-uw.est i.on { background: transparent; box-shadow: inset 0 0 0 1.25px var(--on); }
.ch-units.many { grid-template-columns: repeat(auto-fit, minmax(8.5em, 1fr)); gap: 1.5em 1.6em; }
.ch-um .ch-uw { max-width: 12em; }
.ch-um .ch-uk { margin-top: .85em; }
.ch-uk { display: grid; gap: .9em; margin: 0; padding: 0; list-style: none; }
.ch-uk li { display: grid; grid-template-columns: .72em minmax(0, 1fr); column-gap: .6em; }
.ch-uk li > i { width: .72em; height: .72em; margin-top: .5em; border-radius: 2px; background: var(--c); }
.ch-uk li.bare { display: block; }
.ch-uk b { display: block; font-size: 1.45em; font-weight: 400; line-height: 1.2; letter-spacing: -.01em; }
.ch-uk span, .ch-uk em { display: block; line-height: 1.35; }
.ch-uk span { color: var(--ink-2); }
.ch-uk em { font-size: .85em; color: var(--ink-3); }

/* numbers: each figure large, its words beside it, a hairline between them; or side by side, each over its words */
.ch-nums { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.ch-nr { display: contents; }
.ch-nr > b { grid-column: 1; padding: .18em .5em .18em 0; border-top: 1px solid var(--ch-grid); text-align: right; font-size: 2.5em; font-weight: 300; line-height: 1.1; letter-spacing: -.03em; white-space: nowrap; }
.ch-nr > div { grid-column: 2; display: flex; flex-direction: column; justify-content: center; padding: .55em 0 .55em .7em; border-top: 1px solid var(--ch-grid); }
.ch-nr:first-child > * { border-top: 0; }
.ch-nr span { font-size: 1.05em; line-height: 1.3; }
.ch-nr em { font-size: .8em; line-height: 1.35; color: var(--ink-3); }
.ch-nums.row { display: flex; flex-wrap: wrap; gap: 1.1em 2em; }
.ch-nums.row .ch-nr { display: block; flex: 1 1 8em; min-width: 0; }
.ch-nums.row .ch-nr > b { display: block; padding: 0; border: 0; text-align: left; font-size: 2.8em; }
.ch-nums.row .ch-nr > div { padding: .25em 0 0; border: 0; }

/* The kinds' card (#tvpop), from the button over a table (#tview, the board switch's look: style.css): Table and the
   eight, three a row, each its glyph over its name, the one shown pressed in. */
#tview svg { width: 13px; height: 13px; }
:is(#tgbar, #tview, #tvpop) svg .g-d { fill: currentColor; stroke: none; }
:is(#tgbar, #tview, #tvpop) svg .g-b { stroke-width: 2.4; stroke-linecap: butt; }
:is(#tgbar, #tview, #tvpop) svg .g-w { stroke-width: 3.4; }
:is(#tgbar, #tview, #tvpop) svg .g-q { opacity: .5; }
.tgb-o[aria-pressed="true"] { color: var(--ink); }
#tvpop {
  position: fixed; left: 0; top: 0; z-index: 30; width: 258px; max-width: calc(100vw - 16px); padding: 13px 10px 10px; box-sizing: border-box;
  border-radius: 9px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule), var(--pop); user-select: none; -webkit-user-select: none;
}
#tvpop[hidden] { display: none; }
#tvpop .ip-h { margin: 0 4px 10px; }
.tv-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.tv-o {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 11px 4px 9px; border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--ink-2); font: 500 8.5px/1.2 var(--f-mono); letter-spacing: .09em; text-transform: uppercase; text-align: center;
  transition: color 120ms ease-out, background-color 120ms ease-out;
}
.tv-o svg { width: 22px; height: 22px; }
#tvpop svg * { fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.tv-o[aria-checked="true"] { color: var(--ink); background: var(--press-bg); box-shadow: var(--press); }
@media (hover: hover) { .tv-o:not([aria-checked="true"]):hover { color: var(--ink); background: var(--press-bg); } }
@media (pointer: coarse) { .tv-o { padding: 13px 4px 11px; } }
