/* Chapters 11 and 12: results, conclusions, oral-exam practice.
   Every class here starts with "fd-" (scenes/findings.js) so that it cannot
   collide with the other chapters' style sheets. */
@layer stage {
  /* ---- extra marks on a chart ---- */
  .fd-cross line { stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
  .fd-zone { fill: var(--wash); opacity: 0.4; }
  .fd-ring { fill: none; stroke: var(--ink); stroke-width: 2; }
  .fd-leader { stroke: var(--ink-3); stroke-width: 1.3; }
  .fd-arrow { stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; }
  .fd-arrow-head { fill: var(--ink-2); }

  /* ---- a title line shared by the small panels ---- */
  .fd-bars-title { color: var(--ink-2); font-size: 0.9375rem; text-align: center; }
  .fd-bars-title:empty { display: none; }

  /* ---- small labelled numbers in a row ---- */
  .fd-chips { display: grid; gap: 0.35rem; }
  .fd-chips-title { color: var(--ink-2); font-size: 0.9375rem; text-align: center; }
  .fd-chips-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; }
  .fd-chip { display: grid; justify-items: center; padding: 0.15rem 0.5rem; border: 0.07rem solid var(--rule); border-radius: 0.4rem; background: var(--paper); min-inline-size: 3.1rem; }
  .fd-chip-top { font-size: 0.75rem; color: var(--ink-3); line-height: 1.3; }
  .fd-chip-main { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
  .fd-chip.is-hot { background: var(--wash); border-color: var(--ink); }

  /* ---- bars on one scale ---- */
  .fd-bars, .fd-shares { display: grid; gap: 0.4rem; padding-block: 0.25rem; }
  .fd-bars-list, .fd-shares-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content minmax(3rem, 1fr) max-content; gap: 0.35rem 0.7rem; align-items: center; }
  .fd-bar, .fd-share { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; font-size: 0.9375rem; padding: 0.1rem 0.35rem; border-radius: 0.3rem; }
  .fd-bar.is-hot { background: var(--wash); }
  .fd-bar-label { color: var(--ink); max-inline-size: 13rem; line-height: 1.4; }
  .fd-bar-label small { display: block; color: var(--ink-3); font-size: 0.8125rem; }
  .fd-bar-track { display: block; block-size: 1.1rem; background: var(--paper); border-radius: 0.25rem; overflow: clip; }
  .fd-bar-fill { display: block; block-size: 100%; inline-size: 0; min-inline-size: 0.15rem; background: var(--c, var(--ink-3)); }
  .fd-bar-value { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.0625rem; font-weight: 700; white-space: nowrap; }
  .fd-bars-note { color: var(--ink-2); font-size: 0.9375rem; text-align: center; }
  .fd-bars-note b { font-family: var(--font-num); font-size: 1.15em; color: var(--ink); }

  /* ---- the last part of a whole ---- */
  .fd-share-track { position: relative; display: flex; block-size: 1.5rem; background: var(--paper); border-radius: 0.25rem; overflow: clip; }
  .fd-share-rest { flex: 1; min-inline-size: 0; font-size: 0.8125rem; color: var(--ink-3); padding-inline: 0.5rem; line-height: 1.5rem; white-space: nowrap; overflow: clip; }
  .fd-share-last { inline-size: 0; background: var(--c, var(--ink-3)); }
  .fd-share-even { position: absolute; inset-block: 0; inline-size: 0; border-inline-start: 0.14rem dashed var(--ink); }
  .fd-shares-key { color: var(--ink-2); font-size: 0.875rem; text-align: center; }
  .fd-shares-tick { display: inline-block; block-size: 0.9em; border-inline-start: 0.14rem dashed var(--ink); margin-inline-end: 0.45rem; vertical-align: -0.1em; }

  /* ---- a table that fills in row by row ---- */
  .fd-facts-wrap { overflow-x: auto; }
  table.fd-facts { border-collapse: collapse; margin-inline: auto; font-size: 0.9375rem; }
  table.fd-facts caption { caption-side: top; color: var(--ink-2); font-size: 0.9375rem; padding-block-end: 0.35rem; }
  table.fd-facts th, table.fd-facts td { border-block-end: 0.07rem solid var(--rule); padding: 0.35rem 0.75rem; text-align: end; }
  table.fd-facts thead th { color: var(--ink-2); font-weight: 400; font-size: 0.875rem; background: var(--paper); }
  table.fd-facts td { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.0625rem; white-space: nowrap; }
  table.fd-facts tbody th, table.fd-facts thead th:first-child { text-align: start; }
  table.fd-facts tbody th { font-weight: 700; white-space: nowrap; }
  table.fd-facts tr.is-now > * { background: var(--wash); }
  table.fd-facts td.is-new { font-weight: 700; }
  .fd-facts-wrap.is-wide table.fd-facts { inline-size: 100%; }
  .fd-facts-wrap.is-wide table.fd-facts td { font-family: var(--font-body); font-size: 0.9375rem; text-align: start; white-space: normal; }
  .fd-facts-wrap.is-wide table.fd-facts thead th { text-align: start; }
  table.fd-facts .fd-key { display: inline-block; inline-size: 0.8rem; block-size: 0.8rem; border-radius: 50%; background: var(--c); margin-inline-end: 0.4rem; vertical-align: -0.05em; }

  /* ---- a formula put together piece by piece ---- */
  .fd-formula { display: grid; gap: 0.5rem; padding-block: 0.5rem; }
  .fd-formula-row { display: flex; flex-wrap: wrap; gap: 0.3rem 0.2rem; justify-content: center; align-items: start; }
  .fd-piece { display: grid; justify-items: center; gap: 0.1rem; padding: 0.15rem 0.3rem; border-radius: 0.4rem; }
  .fd-piece-main { font-size: 1.125rem; font-weight: 700; white-space: nowrap; }
  .fd-piece-main .num, .fd-piece-under .num { font-size: 1.1em; }
  .fd-piece-under { font-size: 0.75rem; color: var(--ink-2); min-block-size: 1.4em; white-space: nowrap; }
  .fd-piece.is-hot { background: var(--wash); }
  .fd-piece.is-box { border: 0.1rem solid var(--rule); background: var(--paper); }

  /* ---- three lengths on one line ---- */
  .fd-ruler { max-block-size: 34dvh; }
  .fd-ruler-axis { stroke: var(--ink-3); stroke-width: 2.5; }
  .fd-ruler-tip { fill: var(--ink-3); }
  .fd-ruler-tick { stroke-width: 3; stroke-linecap: round; }
  .fd-ruler-dot { stroke-width: 3; }
  .fd-ruler-mark.is-unknown .fd-ruler-tick { stroke-dasharray: 4 4; }
  .canvas .fd-ruler-name { font-size: 16px; font-weight: 700; paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; stroke-linejoin: round; }
  .canvas .fd-ruler-small { font-size: 14px; fill: var(--ink-2); paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; stroke-linejoin: round; }
  .fd-ruler-range { fill: var(--wash); stroke: var(--signal); stroke-width: 1.5; }
  .fd-ruler-brace { fill: none; stroke: var(--ink-2); stroke-width: 1.8; }

  /* ---- three sets of routes, one inside the other ---- */
  .fd-nest { max-block-size: 46dvh; }
  .fd-nest-all { fill: var(--paper); stroke: var(--ink-3); stroke-width: 1.5; }
  .fd-nest-clean { fill: var(--sheet); stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 7 5; }
  .fd-nest-best { fill: var(--wash); stroke: var(--ink); stroke-width: 2.5; }
  .canvas .fd-nest-name { font-size: 16px; font-weight: 700; }
  .fd-nest-dot { stroke: var(--sheet); stroke-width: 2.5; }
  .fd-nest-link { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 5; }
  .fd-nest-tip { fill: var(--ink); }
  .canvas .fd-nest-label { font-size: 15px; font-weight: 700; paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; stroke-linejoin: round; }
  .canvas .fd-nest-sub { font-size: 13px; fill: var(--ink-2); paint-order: stroke; stroke: var(--sheet); stroke-width: 4px; stroke-linejoin: round; }

  /* ---- the speed-up picker ---- */
  .fd-pick { display: grid; gap: 0.6rem; justify-items: center; padding-block: 0.5rem; }
  .fd-pick-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
  .fd-pick-buttons button { font-family: var(--font-body); }
  .fd-pick-buttons button:disabled { cursor: default; color: var(--ink-2); }
  .fd-pick-buttons button[aria-pressed="true"] { background: var(--signal); color: var(--on-signal); border-color: var(--ink); font-weight: 700; }
  .fd-pick-cells { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem; justify-content: center; }
  .fd-pick-cells li {
    inline-size: 2rem; block-size: 2rem; display: grid; place-items: center;
    border: 0.07rem solid var(--rule); border-radius: 0.3rem;
    font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--ink-3);
  }
  .fd-pick-cells li.is-base { background: var(--route-hk); border-color: var(--route-hk); color: var(--sheet); font-weight: 700; }
  .fd-pick-cells li.is-gain { background: var(--signal); border-color: var(--ink); color: var(--on-signal); font-weight: 700; }
  .fd-pick-read { font-size: 1.0625rem; text-align: center; }
  .fd-pick-read b, .fd-pick-mem b { font-family: var(--font-num); font-size: 1.3em; }
  .fd-pick-mem { display: grid; gap: 0.3rem; inline-size: min(100%, 30rem); text-align: center; }
  .fd-pick-track { display: block; block-size: 0.9rem; background: var(--paper); border: 0.07rem solid var(--rule); border-radius: 0.3rem; overflow: clip; }
  .fd-pick-fill { display: block; block-size: 100%; inline-size: 0; background: var(--ink-3); }
  .fd-pick-fill.is-over { background: var(--bad); }
  .fd-pick-note { color: var(--ink-2); font-size: 0.875rem; }

  /* ---- flash cards ---- */
  .fd-cards { display: grid; gap: 0.6rem; }
  .fd-cards-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; }
  .fd-cards-count { color: var(--ink-2); font-size: 0.9375rem; }
  .fd-cards-dots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
  button.fd-dot {
    min-block-size: 2rem; min-inline-size: 2rem; padding: 0; border-radius: 1rem;
    font-family: var(--font-num); font-size: 0.875rem; color: var(--ink-2); background: var(--sheet);
  }
  button.fd-dot.is-ok { border-color: var(--good); border-width: 0.15rem; color: var(--ink); }
  button.fd-dot.is-again { border-color: var(--bad); border-width: 0.15rem; border-style: dashed; color: var(--ink); }
  button.fd-dot.is-now { background: var(--signal); color: var(--on-signal); border-color: var(--ink); font-weight: 700; }
  .fd-card {
    display: grid; gap: 0.5rem; align-content: start;
    padding: 0.9rem 1.1rem; min-block-size: 11rem;
    border: 0.12rem solid var(--ink); border-radius: var(--radius); background: var(--paper);
  }
  .fd-card-no { font-family: var(--font-num); font-weight: 700; color: var(--ink-3); line-height: 1.2; }
  .fd-card-q { font-size: 1.25rem; }
  .fd-card-en { color: var(--ink-2); font-size: 0.9375rem; font-style: italic; }
  .fd-card-hint { color: var(--ink-3); font-size: 0.875rem; }
  .fd-card-a { display: grid; gap: 0.5rem; padding-block-start: 0.6rem; border-block-start: 0.07rem dashed var(--ink-3); font-size: 0.9688rem; line-height: 1.7; }
  .fd-card-a code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; background: var(--sheet); border: 0.07rem solid var(--rule); border-radius: 0.25rem; padding: 0 0.3em; }
  .fd-card-words { color: var(--ink-2); font-size: 0.875rem; }
  .fd-cards-actions { display: flex; gap: 0.5rem; justify-content: center; }
  button.fd-flip { border-color: var(--ink); font-weight: 700; min-inline-size: 7rem; }
  button.fd-flip:hover { background: var(--wash); }
  .fd-cards-rate { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; font-size: 0.9375rem; color: var(--ink-2); }
  .fd-cards-rate button[aria-pressed="true"] { background: var(--wash); color: var(--ink); border-color: var(--ink); font-weight: 700; }
  .fd-cards-tally { color: var(--ink-3); font-size: 0.8125rem; text-align: center; }

  /* ---- the English talk ---- */
  .fd-talk { display: grid; gap: 0.7rem; }
  .fd-talk-text { display: grid; gap: 0.6rem; font-size: 1.0625rem; line-height: 1.7; min-block-size: 6rem; }
  .fd-talk-s { border-radius: 0.2rem; padding-inline: 0.1em; }
  .fd-talk-s.is-now { background: var(--wash); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  .fd-talk-s[role="button"] { cursor: pointer; }
  .fd-talk-s[role="button"]:hover { text-decoration: underline dashed var(--signal) 0.12em; text-underline-offset: 0.25em; }
  .fd-talk-zh { color: var(--ink-2); }
  .fd-talk.is-full .fd-talk-text { font-size: 0.9375rem; line-height: 1.6; gap: 0.45rem; }
  .fd-talk-gloss { display: grid; gap: 0.2rem; padding: 0.6rem 0.9rem; border-inline-start: 0.25rem solid var(--signal); background: var(--paper); border-radius: 0.2rem; }
  .fd-talk-mean { font-size: 1rem; }
  .fd-talk-src { color: var(--ink-2); font-size: 0.875rem; }
  .fd-talk-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
  .fd-talk-tools button[aria-pressed="true"] { background: var(--wash); color: var(--ink); border-color: var(--ink); font-weight: 700; }

  /* ---- the whole trip on one screen ---- */
  /* Two columns when there is room for them, read down the first and then down the second. */
  .fd-trail { list-style: none; margin: 0; padding: 0; columns: 2 17rem; column-gap: 1rem; }
  .fd-stop { display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: 0.55rem; align-items: start; padding: 0.3rem 0.45rem; margin-block-end: 0.35rem; border-radius: 0.4rem; break-inside: avoid; }
  .fd-stop.is-now { background: var(--wash); }
  .fd-stop.is-wait { visibility: hidden; }
  .fd-stop-no {
    display: inline-grid; place-items: center; inline-size: 1.9rem; block-size: 1.45rem; margin-block-start: 0.15rem;
    border: 0.12rem solid var(--ink); border-radius: 0.3rem; background: var(--sheet);
    font-family: var(--font-num); font-weight: 700; font-size: 0.9375rem; line-height: 1;
  }
  .fd-stop h3 { font-size: 1rem; line-height: 1.4; }
  .fd-stop p { font-size: 0.875rem; color: var(--ink-2); line-height: 1.5; }
}
