/* Wallace Correspondence — page-specific styles.
   Layers on top of site.css (the Cane infographic stylesheet: tokens, .tl-card,
   .cite, .pdf-modal, fonts). Uses the site's tokens only. Thin + wide
   Master-Timeline cards; narrative-button filters; two-pane enriched popup. */

/* ---- layout shell ---- */
/* Match the identity-infrastructure (scheme) page column: 1000px centered with a
   20px gutter, so the intro, filter bars, and list share one left/right margin. */
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px 64px; }
/* fig-intro fills the wrap column with no extra side gutter so its text left-aligns
   with the filter bars and the list (they inherit the wrap's 20px gutter). */
.fig-intro { max-width: none; padding-left: 0; padding-right: 0; }

/* override site.css .hero{min-height:100vh; background:var(--panel-2)} — this is a
   compact section header, so drop the full-hero panel background and blend with the
   page (site.css tints .hero with --panel-2, which otherwise reads as a stray box). */
.hero { min-height: auto; display: block; padding: 40px 0 22px; margin-bottom: 20px;
  background: transparent; border-bottom: 1px solid var(--line); position: static; overflow: visible; }

.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.sec-glyph { font-family: "NerdIcons"; font-size: 26px; color: var(--accent); line-height: 1; }
.section-head .sec-num { font-family: var(--mono); font-size: 15px; font-weight: 800;
  color: var(--accent); letter-spacing: .06em; }
.sec-title { font-family: var(--disp); font-size: 30px; font-weight: 700; color: var(--ink);
  letter-spacing: -.01em; }

.hero__subline { font-family: var(--sans); font-size: 14px; color: var(--dim); margin: 4px 0 0; }
.hero__subline strong { color: var(--ink); }
.hero__disclaimer { font-family: var(--sans); font-size: 12.5px; color: var(--faint);
  margin: 10px 0 0; max-width: none; line-height: 1.5; }
.hero__disclaimer .amber { color: var(--accent); font-weight: 700; }
.hero__disclaimer strong { color: var(--ink); font-weight: 700; }

/* scheme filter chips (in the note) */
.scheme-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
/* Scheme badges follow the .caneplay play-narration button style: outlined mono
   pill that fills with the accent when active. */
.scheme-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; box-sizing: border-box;
  font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); background: none; border: 1px solid var(--accent); border-radius: 5px; padding: 0 12px;
  cursor: pointer; transition: background .12s, color .12s; }
.scheme-chip:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.scheme-chip.is-active { background: var(--accent); color: var(--bg); }

/* ---- controls / filter bars ---- */
.filter-hint { font-family: var(--sans); font-size: 12px; color: var(--dim); line-height: 1.5;
  margin: 16px 0 2px; }
.filter-hint b { font-family: var(--mono); font-weight: 700; color: var(--ink); }
.controls-bar { margin: 18px 0 10px; }
.controls-bar__items { align-items: center; gap: 14px; }
.search-input { flex: 1 1 340px; font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 2px;
  padding: 8px 12px; outline: none; }
.search-input:focus { border-color: var(--accent-2); }
.count-badge { font-family: var(--mono); font-size: 12px; color: var(--dim); white-space: nowrap; }
.count-badge strong { color: var(--ink); }

/* Label column width shared across the filter rows (flex 0 0 64px + 10px gap). */
:root { --lbl-col: 74px; }
/* Filter rows + list span the full 1000px column, flush to the left margin. */
.controls-bar, .filter-bar { max-width: none; }
.list-head, .tl-list, .pager { margin-left: 0; max-width: none; }
.list-head { display: flex; justify-content: flex-end; margin-top: 6px; margin-bottom: 4px; }

/* Fixed-width label column so Filter / People / Keywords labels line up and the
   badge area shares one left edge — wrapped 2nd rows start under the first badge. */
.filter-bar { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; }
.filter-bar__group-label { flex: 0 0 64px; padding-top: 6px; text-align: right; font-family: var(--sans);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.filter-bar__items { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }

/* narrative/nav-button styling for the toggles (built on .cite) */
.filter-toggle { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 2px;
  padding: 5px 11px; cursor: pointer; line-height: 1.2; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 6px; transition: background .12s, border-color .12s; }
.filter-toggle:hover { border-color: var(--accent-2); background: var(--panel-2); }
/* Active = bold text + accent outline, NOT a black fill. */
.filter-toggle.is-active { background: var(--panel); color: var(--ink); border-color: var(--accent-2); font-weight: 800; }
.filter-toggle .nf { font-family: "NerdIcons"; font-size: 11px; }
.filter-toggle__count { font-family: var(--mono); font-size: 10.5px; opacity: .7; }
#starToggle.is-active { background: var(--panel); color: var(--accent); border-color: var(--accent); font-weight: 800; }
.filter-clear { color: var(--dim); }
.filter-clear:hover { border-color: var(--accent); color: var(--accent); }
.filter-bar--keywords { padding-top: 2px; }

/* People (top-10 From / To / Cc) dropdowns */
.people-select { display: inline-flex; align-items: center; gap: 6px; font-family: var(--sans);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
/* Styled exactly like a filter-toggle badge: appearance stripped + custom caret. */
.people-select select { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink);
  background-color: var(--panel); border: 1px solid var(--line-2); border-radius: 2px;
  padding: 5px 26px 5px 11px; line-height: 1.2; text-transform: none; letter-spacing: .02em;
  cursor: pointer; max-width: 220px; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; transition: background-color .12s, border-color .12s; }
.people-select select:hover { border-color: var(--accent-2); background-color: var(--panel-2); }
.people-select select:focus { border-color: var(--accent-2); outline: none; }
.people-select > span { flex: none; }

/* ---- Master-Timeline cards: thin + wide (narrowed ~15%, indented to badge edge) ---- */
.tl-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.tl-card { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 16px;
  align-items: start; width: 100%; padding: 8px 16px; border: 1px solid var(--line);
  background: var(--panel); border-radius: 2px; cursor: pointer;
  transition: border-color .12s, box-shadow .12s; }
.tl-card:hover { border-color: var(--accent-2); box-shadow: 0 1px 0 var(--line-2); }
.tl-card:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.tl-card:has(.tl-star) { border-left: 3px solid var(--accent); }

.tl-cardhead { display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  justify-content: flex-start; }
.tl-date { font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--accent);
  letter-spacing: .01em; }

/* Top line: parties on the left, corner cluster (topic badges + meta) on the right. */
.tl-topline { display: flex; align-items: flex-start; gap: 12px; }
.tl-topline .tl-parties { flex: 1 1 auto; min-width: 0; }
.tl-corner { flex: none; display: inline-flex; align-items: center; flex-wrap: wrap;
  justify-content: flex-end; gap: 5px; max-width: 58%; }
.tl-corner-ents { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-right: 2px; }
.tl-ico { vertical-align: -1px; }
.tl-meta { position: relative; display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono);
  font-size: 10px; font-weight: 700; color: var(--dim); border: 1px solid var(--line-2); border-radius: 2px;
  padding: 1px 5px; line-height: 1.2; }
/* white-background tooltip explaining the attach / page badges */
.tl-meta[data-tip]:hover::after, .tl-badge--thread[data-tip]:hover::after { content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 50; white-space: nowrap; background: #fff;
  color: #141414; border: 1px solid rgba(0,0,0,.18); border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.24);
  padding: 5px 8px; font-family: var(--sans); font-weight: 500; font-size: 11px; letter-spacing: 0;
  text-transform: none; }
.tl-badge--thread { display: inline-flex; align-items: center; justify-content: center; position: relative;
  min-width: 17px; height: 17px; padding: 0 5px; font-family: var(--mono); font-size: 10.5px;
  font-weight: 700; color: var(--accent-2); background: transparent;
  border: 1px solid var(--accent-2); border-radius: 2px; }

.tl-card__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-parties { font-family: var(--sans); font-size: 14px; color: var(--ink); font-weight: 600; }
.tl-parties .tl-star { color: var(--accent); font-size: 14px; line-height: 1; margin-right: 6px;
  vertical-align: baseline; }
.tl-from { font-weight: 700; }
.tl-arrow { color: var(--accent-2); margin: 0 7px; font-weight: 400; }
.tl-entities { display: flex; flex-wrap: wrap; gap: 4px; margin: 1px 0 0; }
.tl-ent { font-family: var(--sans); font-size: 10.5px; font-weight: 600; color: var(--accent-2);
  background: transparent; border: 1px solid var(--line-2); border-radius: 2px; padding: 1px 6px;
  letter-spacing: .01em; }
.tl-ent--more { color: var(--faint); border-color: var(--line); }
.tl-cc { font-family: var(--sans); font-size: 12px; color: var(--dim); }
.tl-cc__label { color: var(--faint); text-transform: uppercase; font-size: 10.5px;
  letter-spacing: .06em; margin-right: 3px; }
.tl-cc__toggle { font-family: var(--sans); font-size: 10.5px; font-weight: 600; color: var(--accent-2);
  background: transparent; border: 0; border-bottom: 1px dotted var(--accent-2); padding: 0 0 0 5px;
  margin-left: 3px; cursor: pointer; }
.tl-cc__toggle:hover { color: var(--accent); border-bottom-color: var(--accent); }
.tl-subject { font-family: var(--sans); font-size: 14px; color: var(--ink); font-weight: 400; }
.tl-summary { font-family: var(--sans); font-size: 12.5px; line-height: 1.45; margin: 2px 0 0;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tl-summary--placeholder { color: var(--faint); font-style: italic; }
.tl-summary--filled { color: var(--dim); }

/* white-background hover card with the full message header */
.tl-hovercard { position: absolute; left: 24px; top: calc(100% - 2px); z-index: 40; display: none;
  min-width: 320px; max-width: min(560px, 88vw); background: #fff; color: #141414;
  border: 1px solid rgba(0,0,0,.18); border-radius: 4px; box-shadow: 0 12px 36px rgba(0,0,0,.30);
  padding: 10px 13px; font-family: var(--sans); font-size: 12px; line-height: 1.5; }
.tl-hovercard div { overflow-wrap: anywhere; }
.tl-hovercard b { display: inline-block; min-width: 46px; color: #000; font-weight: 700; margin-right: 6px;
  text-transform: uppercase; font-size: 9.5px; letter-spacing: .05em; }
.tl-hovercard__sum { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0,0,0,.10); color: #333; }
.tl-card:hover .tl-hovercard, .tl-card:focus-within .tl-hovercard { display: block; }

.no-results { padding: 40px 0; text-align: center; color: var(--dim); font-family: var(--sans); }

/* SVG icon sizing inside filter toggles */
.filter-toggle .tl-ico { vertical-align: -2px; }

/* pagination — same badge language as the page/thread meta badges */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px;
  margin: 20px auto 4px; }
.pg-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px;
  padding: 0 8px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--dim);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 2px; cursor: pointer;
  transition: border-color .12s, color .12s; }
.pg-badge:hover { border-color: var(--accent-2); color: var(--ink); }
.pg-badge--active { color: var(--accent); border-color: var(--accent); }
.pg-badge--disabled { color: var(--faint); cursor: default; opacity: .5; }
.pg-ellipsis { font-family: var(--mono); font-size: 11px; color: var(--faint); padding: 0 2px; }

.foot { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line);
  font-family: var(--sans); font-size: 11.5px; color: var(--faint); text-align: center; }

/* ---- enriched PDF popup (site .pdf-modal) ---- */
.pdf-modal:not([hidden]) { display: block; }
/* Single-row toolbar: title on the left, close × aligned on the same row at right.
   Same background as the panel body so the header doesn't read as a separate band. */
.pdf-toolbar { flex-direction: row; align-items: center; gap: 12px; background: var(--panel); }
.pdf-tools { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.pdf-title { order: 1; flex: 1 1 auto; font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--ink); white-space: normal; }
/* Close × is outline-only — never a filled block. */
.pdf-close { order: 2; flex: none; background: transparent; border: 1px solid var(--line-2);
  color: var(--ink); font-weight: 400; }
.pdf-close:hover { background: transparent; border-color: var(--accent); color: var(--accent); }
.pdf-body { display: flex; align-items: stretch; }
/* Both panes share the same panel background so the PDF stage and the enrichment
   column read as one continuous surface. The side is a flex column so the raw .eml
   grows to the bottom of the popup. */
.pdf-body__side { flex: 0 0 40%; max-width: 40%; overflow-y: auto; border-right: 1px solid var(--line);
  background: var(--panel); display: flex; flex-direction: column; }
.pdf-body__main { flex: 1 1 60%; min-width: 0; background: var(--panel); }
.pdf-frame { width: 100%; height: 100%; border: 0; display: block; }

/* Pad + rule each enrichment section so its content fills the column width. */
.pdf-body__side .pdf-enrich { flex: none; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.pdf-body__side .pdf-enrich:last-child { border-bottom: 0; }
.pdf-body__side .pdf-enrich-more { width: 100%; }
/* Raw .eml is the growing tail section — it stretches to the popup bottom. */
.pdf-body__side .pdf-enrich-raw { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 200px; }
.pdf-enrich-raw h3 { flex: none; }

.pdf-enrich h3 { font-family: var(--sans); font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--faint); margin: 0 0 7px; }
.pdf-headers { display: grid; grid-template-columns: 74px 1fr; gap: 3px 10px; margin: 0;
  font-family: var(--sans); font-size: 12.5px; }
.pdf-headers dt { color: var(--faint); font-weight: 700; text-transform: uppercase; font-size: 10.5px;
  letter-spacing: .05em; padding-top: 2px; }
.pdf-headers dd { color: var(--ink); margin: 0; overflow-wrap: anywhere; }
.addr { color: var(--dim); font-size: 11px; }
.empty-note { color: var(--faint); font-style: italic; font-size: 12px; margin: 0; }

.summary-text { font-family: var(--sans); font-size: 13px; line-height: 1.5; color: var(--ink); margin: 0; }
.summary-placeholder { font-family: var(--sans); font-size: 12.5px; font-style: italic;
  color: var(--faint); margin: 0; }

.tag-group { margin-bottom: 9px; }
.tag-group__label { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-family: var(--sans); font-size: 11.5px; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: 2px; padding: 2px 7px; }
.tag--entity { border-color: var(--accent-2); color: var(--accent-2); }
.tag--amount { border-color: var(--accent); color: var(--accent); }
.tag--keyword { border-color: var(--accent-3); color: var(--accent-3); }

.triples-list { list-style: none; margin: 0; padding: 0; width: 100%;
  font-family: var(--sans); font-size: 12.5px; }
.triples-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px;
  width: 100%; padding: 5px 0; color: var(--ink); border-bottom: 1px solid var(--line);
  line-height: 1.4; }
.triples-list li:last-child { border-bottom: 0; }
.triples-list .op { color: var(--accent-2); margin: 0 4px; }
.triples-list.candidate li { color: var(--dim); }
.candidate-label { font-family: var(--sans); font-size: 10px; color: var(--faint);
  margin-left: 8px; font-style: italic; }

/* raw .eml source panel */
.pdf-enrich-raw h3 { display: flex; align-items: center; }
.raw-toggle { margin-left: 8px; font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--accent-2); background: transparent;
  border: 1px solid var(--line-2); border-radius: 2px; padding: 1px 7px; cursor: pointer; }
.raw-toggle:hover { border-color: var(--accent-2); }
/* Same background as the rest of the enrichment column; grows to fill and scrolls. */
pre.raw-eml { flex: 1 1 auto; white-space: pre-wrap; word-break: break-word; font-family: var(--mono);
  font-size: 11px; line-height: 1.45; color: var(--dim); background: var(--panel); border: 0;
  padding: 0; min-height: 120px; overflow: auto; margin: 6px 0 0; }
pre.raw-eml[hidden] { display: none; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .pdf-body { flex-direction: column; }
  .pdf-body__side { flex: none; max-width: none; width: 100%; max-height: 42vh; border-right: 0;
    border-bottom: 1px solid var(--line); }
  .pdf-body__main { flex: 1; min-height: 42vh; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px 48px; }
  .tl-card { grid-template-columns: 1fr; gap: 6px; }
  .sec-title { font-size: 24px; }
}
