/* Bleed visuals, the evidence drawer and presentation mode (6 Oct).
   Tokens only (app.css §0), so light and dark are the same rules. The charts keep their
   .lc-* styles and the calendar its .cal-* ones; this file frames them and adds the rest. */

/* ---------- one visual ---------- */
.bv { container-type: inline-size; position: relative; min-width: 0; max-width: 100%; margin: 16px 0 0; padding: 18px 20px 14px; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow-1); color: var(--ink); font: 13.5px/1.5 var(--text); }
.bv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.bv-title { font: 500 21px/1.2 var(--display); color: var(--ink); overflow-wrap: anywhere; }
.bv-badge, .be-cover { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font: 600 10.5px/1.6 var(--text); letter-spacing: .1em; text-transform: uppercase; color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--paper)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 40%, transparent); }
.bv-badge .icon { width: 12px; height: 12px; }
.bv-partial { margin: 6px 0 0; font-size: 12.5px; color: var(--warn); }
.bv-body { margin-top: 12px; min-width: 0; }
.bv-quiet { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--soft); }
.bv-body > .bv-quiet:first-child { margin: 0 0 10px; }
.bv-note { margin: 12px 0 0; font-size: 12.5px; color: var(--soft); }
.bv-nof { color: var(--muted); font-style: italic; font-weight: 400; }
.bv-measure { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font: 600 10.5px/1.4 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bv-measure:first-child { margin-top: 0; }
.bv-measure + .lc-plot { margin-top: 10px; }
.bv-measure i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bv-empty { display: grid; gap: 4px; justify-items: center; padding: 30px 16px; border: 1px dashed var(--rule2); border-radius: var(--r); text-align: center; }
.bv-empty strong { font: 500 19px/1.2 var(--display); color: var(--ink); }
.bv-empty span { font-size: 12.5px; color: var(--soft); overflow-wrap: anywhere; }

/* the table: wide or long, it scrolls in its own box and the page never widens */
.bv-tablebox { min-width: 0; }
.bv-scroll { max-width: 100%; max-height: 440px; overflow: auto; border: 1px solid var(--rule); border-radius: var(--r); scrollbar-color: var(--rule2) transparent; }
.bv-table { width: max-content; min-width: 100%; border: 0; border-radius: 0; box-shadow: none; background: transparent; font-size: 13px; font-variant-numeric: tabular-nums; }
.bv-table th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; white-space: nowrap; }
.bv-table td { padding: 8px 12px; max-width: 34ch; overflow-wrap: anywhere; }
.bv-table tbody tr:last-child td { border-bottom: 0; }
.bv-table .num { text-align: right; white-space: nowrap; }
.bv-pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; }
.bv-pager-at { margin-right: 4px; }
.bv-step, .be-close, .bp-nav { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm); }
.bv-step .icon, .be-close .icon { width: 15px; height: 15px; }
.bv-exact { margin-top: 12px; border-top: 1px solid var(--rule); }
.bv-exact > summary { padding: 10px 0 8px; font-size: 12px; }

.bv-totals dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.bv-totals dl > div { padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper2); min-width: 0; }
.bv-totals dt { font: 600 10.5px/1.3 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bv-totals dd { margin: 4px 0 0; font: 500 28px/1.1 var(--display); font-variant-numeric: tabular-nums; color: var(--ink); overflow-wrap: anywhere; }
.bv-totals small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--soft); }

/* the app's charts, framed here */
.bv .lc-plot { min-height: 0; }
.bv .lc-bars { margin: 12px 0 4px; }
.bv .lc-bar-row strong { font-weight: 600; }
.bv .lc-legend { margin: 10px 0 0; }
.bv .lc-donut-layout { min-height: 0; margin-top: 8px; }
.bv .lc-donut { max-width: 200px; }
.bv .lc-donut-legend > div { text-transform: none; }
.bv .lc-donut-legend strong { font-variant-numeric: tabular-nums; }
.bv .lc-segment:focus { outline: none; stroke-width: 28; }
.bv-readout { margin: 8px 0 0; min-height: 18px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bv-readout.on { color: var(--ink); font-weight: 600; }
@container (max-width: 520px) {
  .bv .lc-axis { font-size: 24px; }
  .bv .lc-donut-layout { flex-direction: column; align-items: stretch; }
  .bv .lc-donut { width: 60%; align-self: center; }
}

/* calendar and timeline */
.bv-cal { display: grid; gap: 18px; min-width: 0; }
.bv-cal-grid { max-width: 380px; min-width: 0; }
.bv .cal-title { font-size: 19px; }
.bv .cal-nav button { display: inline-grid; place-items: center; }
.bv .cal-nav .icon { width: 14px; height: 14px; }
.bv button.cal-cell { gap: 0; justify-items: start; text-align: left; font-weight: 500; line-height: 1; cursor: pointer; }
.bv button.cal-cell:hover { background: color-mix(in srgb, var(--accent) 16%, var(--paper)); }
.bv button.cal-cell[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--gold); }
@container (min-width: 640px) { .bv-cal { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; align-items: start; } }
.bv-day-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; font: 600 13.5px/1.3 var(--text); color: var(--ink); }
.bv-day-title small { font: 500 11.5px var(--text); color: var(--muted); }
.bv-entries { list-style: none; margin: 8px 0 0; padding: 0; }
.bv-entry { display: flex; gap: 14px; padding: 9px 0; border-top: 1px solid var(--rule); }
.bv-entry-time { flex: none; width: 52px; padding-top: 1px; font: 600 12.5px/1.5 var(--text); font-variant-numeric: tabular-nums; color: var(--accent3); }
.bv-entry-time .bv-nof { font-size: 11px; line-height: 1.3; display: block; }
.bv-entry-what { min-width: 0; display: grid; gap: 2px; }
.bv-entry-what strong { font-weight: 600; overflow-wrap: anywhere; }
.bv-entry-meta { display: flex; flex-wrap: wrap; gap: 0 14px; font-size: 12.5px; color: var(--soft); font-variant-numeric: tabular-nums; }
.bv-entry-meta > span { overflow-wrap: anywhere; }
.bv-tl { display: grid; gap: 18px; }
.bv-tl-day { padding-left: 14px; border-left: 2px solid var(--gold-line); min-width: 0; }
.bv-more { margin-top: 12px; font-size: 12.5px; }

.bv-foot { display: grid; gap: 3px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--rule); }
.bv-foot p, .bp-standing p { display: flex; gap: 7px; margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.bv-foot .icon, .bp-standing .icon { flex: none; width: 12px; height: 12px; margin-top: 3px; }
.bv-foot span, .bp-standing span { min-width: 0; overflow-wrap: anywhere; }
.bv-foot b { font-weight: 600; color: var(--soft); }

/* ---------- the evidence drawer: right side on a desk, a sheet on a phone ---------- */
.be { position: fixed; inset: 0; z-index: 115; outline: none; }
.be-shade { position: absolute; inset: 0; background: color-mix(in srgb, var(--night) 42%, transparent); animation: be-fade .2s ease-out both; }
.be-panel { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(540px, 100%); background: var(--paper); color: var(--ink); border-left: 1px solid var(--rule); box-shadow: var(--shadow-3); font: 14px/1.55 var(--text); animation: be-slide .35s var(--ease) both; }
@keyframes be-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes be-slide { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes be-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.be-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--rule); }
.be-head .eyebrow { display: block; margin-bottom: 3px; color: var(--accent3); }
.be-head h3 { margin: 0; font: 500 25px/1.15 var(--display); }
.be-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 24px; scrollbar-color: var(--rule2) transparent; }
.be-list { list-style: none; margin: 0; padding: 0; }
.be-ref { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 16px 8px; border-bottom: 1px solid var(--rule); border-radius: var(--r); outline: none; scroll-margin-top: 4px; }
.be-ref:last-child { border-bottom: 0; }
.be-ref.on { background: var(--accent2); box-shadow: inset 0 0 0 1px var(--gold-line); }
.be-ref h4 { margin: 0; font: 600 14.5px/1.35 var(--text); overflow-wrap: anywhere; }
.be-what { margin: 2px 0 0; font-size: 12.5px; color: var(--soft); overflow-wrap: anywhere; }
.be-facts { display: grid; gap: 7px; margin: 12px 0 0; }
.be-facts > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.be-facts dt { font: 600 10px/1.5 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.be-facts dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.be-cover.complete { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--paper)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 40%, transparent); }
.be-cover.unknown { color: var(--soft); background: var(--bg2); box-shadow: inset 0 0 0 1px var(--rule2); }
.be-rows { margin-top: 10px; }
.be-rows > summary { padding: 6px 0; font-weight: 600; }
.be-rows .bv { margin: 4px 0 0; padding: 12px; box-shadow: none; background: var(--paper2); }
.be-rows .bv-title { font-size: 17px; }
.be-out { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 12px; }
.be-none { margin: 28px 8px; color: var(--soft); }
@media (max-width: 640px) {
  .be-panel { top: auto; left: 0; width: 100%; max-height: 88dvh; border-left: 0; border-top: 1px solid var(--rule); border-radius: var(--r-xl) var(--r-xl) 0 0; animation-name: be-rise; }
  .be-head { padding: 16px 16px 12px; }
  .be-head h3 { font-size: 21px; }
  .be-scroll { padding: 0 8px 20px; }
}

/* ---------- presentation mode ---------- */
.bp { position: fixed; inset: 0; z-index: 112; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--text); outline: none; animation: be-fade .25s ease-out both; }
.bp-gate { grid-row: 1 / -1; align-self: center; justify-self: center; width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; padding: 26px 26px 22px; border: 1px solid var(--rule2); border-radius: var(--r-xl); background: var(--paper); box-shadow: var(--shadow-2); }
.bp-gate .eyebrow { color: var(--accent3); }
.bp-gate h2 { margin: 4px 0 0; font: 500 32px/1.1 var(--display); }
.bp-gate-sub { margin: 8px 0 0; color: var(--soft); }
.bp-levels { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.bp-levels legend { padding: 0; margin-bottom: 8px; font: 600 10.5px/1.2 var(--text); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.bp-option { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--rule2); border-radius: var(--r); cursor: pointer; transition: border-color .15s, background .15s; }
.bp-option:hover { background: var(--paper2); }
.bp-option:has(input:checked) { border-color: var(--gold); background: var(--accent2); }
.bp-option input { margin: 3px 0 0; accent-color: var(--gold); }
.bp-option strong { display: block; font-weight: 600; color: var(--ink); }
.bp-option small { display: block; font-size: 12.5px; color: var(--soft); }
.bp-gate-note { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.bp-gate-go { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.bp-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 12px 24px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.bp-top-id { min-width: 0; display: grid; gap: 1px; }
.bp-top-id .eyebrow { color: var(--accent3); }
.bp-chat { font: 500 20px/1.2 var(--display); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bp-top-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.bp-seg-label { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px/1 var(--text); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.bp-seg-label .icon { width: 14px; height: 14px; }
.bp-seg { display: inline-flex; padding: 3px; border: 1px solid var(--rule2); border-radius: 999px; background: var(--bg2); }
.bp-seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; font: 600 12px/1.3 var(--text); color: var(--soft); white-space: nowrap; }
.bp-seg button:hover { background: transparent; color: var(--ink); }
.bp-seg button[aria-pressed="true"], .bp-seg button[aria-pressed="true"]:hover { background: var(--solid); color: var(--on-solid); }
.bp-exit { padding: 6px 12px; font-size: 12.5px; }
.bp-exit .icon { width: 13px; height: 13px; }

.bp-slide { overflow-y: auto; padding: clamp(20px, 4vw, 56px) clamp(16px, 5vw, 72px); outline: none; scrollbar-color: var(--rule2) transparent; }
.bp-page { max-width: 1320px; margin: 0 auto; }
.bp-q { margin: 0 0 clamp(14px, 2vw, 26px); padding-left: 14px; border-left: 2px solid var(--gold); font: italic 500 clamp(19px, 1.7vw, 26px)/1.3 var(--display); color: var(--soft); overflow-wrap: anywhere; }
.bp-cols { display: grid; gap: clamp(20px, 3vw, 44px); min-width: 0; }
@media (min-width: 1100px) { .bp-page.has-visuals .bp-cols { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } }
.bp-text { min-width: 0; font-size: clamp(19px, 1.75vw, 29px); line-height: 1.5; overflow-wrap: anywhere; }
.bp-text p { margin: 0 0 .7em; }
.bp-text ul, .bp-text ol { margin: 0 0 .7em; padding-left: 1.2em; }
.bp-text li { margin: .3em 0; }
.bp-text strong { font-weight: 650; }
.bp-text > :last-child { margin-bottom: 0; }
.bp-cite { margin-left: 2px; font: 700 .5em/1 var(--text); color: var(--accent3); vertical-align: super; }
.bp-visuals { display: grid; gap: 16px; min-width: 0; }
.bp-visuals .bv { margin: 0; font-size: 14.5px; }
.bp-visuals .bv-title { font-size: 25px; }
.bp-visuals .bv-table { font-size: 14.5px; }
.bp-visuals .bv-foot p { font-size: 12.5px; }
.bp-warn { display: flex; align-items: center; gap: 8px; margin: 22px 0 0; font-size: 13.5px; color: var(--warn); }
.bp-sources { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; margin: clamp(22px, 3vw, 40px) 0 0; padding: 14px 0 0; border-top: 1px solid var(--rule2); font-size: 12.5px; color: var(--ink2); }
.bp-sources.none { display: block; color: var(--muted); }
.bp-sources li { min-width: 0; overflow-wrap: anywhere; }
.bp-sources b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-right: 6px; padding: 0 4px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--gold) 18%, var(--paper)); color: var(--accent3); font: 700 10.5px/1 var(--text); }
.bp-sources span { color: var(--muted); }

.bp-foot { display: flex; align-items: center; gap: 14px; padding: 10px 24px; border-top: 1px solid var(--rule); background: var(--paper); }
.bp-standing { flex: 1; min-width: 0; display: grid; gap: 1px; }
.bp-standing p { font-size: 12.5px; color: var(--soft); }
.bp-count { flex: none; font: 600 13px var(--text); font-variant-numeric: tabular-nums; color: var(--soft); }
.bp-nav { width: 40px; height: 40px; }
.bp-nav .icon { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .bp-top { padding: 10px 14px; }
  .bp-seg-label { display: none; }
  .bp-top-tools { width: 100%; justify-content: space-between; }
  .bp-seg button { padding: 5px 9px; font-size: 11.5px; }
  .bp-foot { padding: 8px 12px; gap: 10px; }
  .bp-standing p { font-size: 11.5px; line-height: 1.4; }
  .bp-gate { padding: 20px 18px 18px; }
  .bp-gate h2 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  .be-shade, .be-panel, .bp { animation: none !important; }
  .bv *, .bp-option { transition: none !important; }
}
