/* ═══════════════════════════════════════════════════════════════════════════
   print.css — the paper stylesheet.

   Linked from both shells with media="print", after every other stylesheet.
   Every rule is also wrapped in @media print, so the file is correct whether
   it is linked with a media attribute, linked without one, or @imported.

   What a printed Achline page is: a document. No rail, no top bar, no tab bar,
   no filters, no buttons, no forms — those are ways of asking for a different
   page, and paper cannot ask. Black on white, hairline rules, tables that are
   never clipped, rows that never break across a page.

   Why every selector starts with html: a print reset has to win against rules
   it has never seen — the theme's own component rules and each track's
   stylesheet — and it must win whatever order the files arrive in. One extra
   type selector does that without a single !important. The token reset is
   written on html:root and on each [data-theme] variant for the same reason:
   THEME-3 defines the dark palette on :root[data-theme='dark'] (0,2,0), which
   would otherwise beat a bare :root reset and print black paper.
   ═══════════════════════════════════════════════════════════════════════════ */

@media print{

  html:root,
  html:root[data-theme],
  html:root[data-theme='light'],
  html:root[data-theme='dark']{
    color-scheme:only light;

    --ground:#fff; --surface:#fff; --surface-2:#fff; --rail:#fff; --rail-2:#fff;
    --chrome:#fff; --chrome-2:#fff; --tint-funded:#fff; --hover-fill:transparent;
    --toast-ground:#fff; --toast-ground-solid:#fff;

    --label:#000; --label-2:#000; --label-3:#333; --label-4:#333;
    --ink:#000; --ink-2:#000; --ink-3:#333; --rail-ink:#000; --rail-ink-2:#333;

    --separator:#999; --separator-2:#bbb;
    --hair:#999; --hair-2:#bbb; --line:#999;

    --shadow-1:none; --shadow-2:none; --shadow-3:none;

    /* Ink only: colour is not a printing press. Status still reads, because
       every chip carries its word and every code carries its letters. */
    --accent:#000; --accent-ink:#000; --accent-solid:#fff; --accent-solid-2:#fff;
    --on-accent:#000; --on-accent-dim:#999;
    --danger-solid:#fff; --danger-solid-2:#fff; --ok-solid:#fff;
    --sys-blue:#000; --sys-blue-2:#000; --sys-blue-3:#000;
    --sys-green-text:#000; --sys-red-text:#000; --sys-orange-text:#000; --sys-indigo-text:#000;
    --sys-gray5:#fff; --sys-gray6:#fff;
    --sys-blue-tint:#fff; --sys-green-tint:#fff; --sys-red-tint:#fff;
    --sys-orange-tint:#fff; --sys-indigo-tint:#fff; --wait-tint:#fff;
  }

  @page{size:letter; margin:16mm}

  html{background:#fff; color:#000}
  html body{background:#fff; color:#000; font-size:11pt; -webkit-print-color-adjust:exact; print-color-adjust:exact}

  /* ── the chrome is not part of the document ───────────────────────────── */
  html .rail,html .top,html .tabbar,html .toasts,html .skip,html .hr,
  html .page-head .acts,html .card-head .acts,html .tab-bar,html .filters,html .seg,
  html .chip,html a.chip,html button.chip,html .chip-select,html .btn,
  html .row-acts,html .stage-acts,html dialog,html .spin,
  html .nav-progress,html [data-print]{display:none!important}
  html form:not(.doc form){display:none!important}

  html .app{display:block; min-height:0}
  html .main{display:block}
  html .page{padding:0; display:block; max-width:none; margin:0; gap:0}
  html .grid,html .g-2,html .g-3,html .g-main,html .g-focus,html .kpis,html .board{display:block}

  /* ── surfaces ─────────────────────────────────────────────────────────── */
  html .card{background:#fff; border:1px solid #000; border-radius:0; box-shadow:none; break-inside:avoid; page-break-inside:avoid; margin:0 0 8pt}
  html .card-head{padding:6pt 8pt; border-bottom:1px solid #000; background:#fff}
  html .card-head h2{font-size:12pt}
  html .card-body{padding:8pt}
  html .card-foot{padding:4pt 8pt; border-top:1px solid #bbb}
  html .kpi{border:0; padding:4pt 8pt}
  html .deal,html .fact{background:#fff; break-inside:avoid; page-break-inside:avoid}

  /* ── tables are never clipped and never split a row ───────────────────── */
  html .t-wrap{overflow:visible!important}
  html .t-wrap table,html .t-wrap table.t{min-width:0!important; width:100%}
  html table.t{font-size:10pt; font-variant-numeric:tabular-nums}
  html table.t thead th{
    height:auto; padding:4pt 6pt; background:#fff; color:#000;
    text-transform:none; letter-spacing:0; border-bottom:1px solid #000;
  }
  html table.t tbody td,html table.t tbody th{height:auto; padding:4pt 6pt; border-bottom:1px solid #bbb; background:#fff}
  html table.t tbody tr{break-inside:avoid; page-break-inside:avoid; background:#fff}
  html thead{display:table-header-group}

  /* Status keeps its outline so a chip still reads as a chip on paper. */
  html .st,html .st.pending,html .st.submitted,html .st.settled,html .st.returned,
  html .st.retry,html .st.blocked,html .st.info,html .st.plain,
  html .code,html .code.bad,html .code.stop,html .tag,
  html .delta,html .delta.up,html .delta.dn,
  html .rail a .ct,html .more-nav a .ct,html .col-h .n,html .avatar,html .org-badge{
    background:#fff; border:1px solid #999; color:#000;
  }
  html .track{background:#fff; border:1px solid #999; height:7px}
  html .track i{background:#000; border:0}

  /* A printed link is text: the URL helps nobody holding a statement. */
  html a{color:#000; text-decoration:none}
  html a[href]::after{content:none!important}

  /* ── a server-rendered header, on paper only ──────────────────────────── */
  html .print-only{display:block!important}
  html tr.print-only{display:table-row!important}
  html span.print-only,html .print-only.inline{display:inline!important}

  /* ── the document shell (THEME-7): paper half ─────────────────────────── */
  html .doc{max-width:none; width:auto; margin:0; padding:0; border:0; border-radius:0; background:#fff; box-shadow:none}
  html .doc-head{border-bottom:1px solid #000; padding-bottom:8pt}
  html .doc-title{page-break-after:avoid; break-after:avoid}
  html .doc table.t tbody tr,html .doc-totals,html .doc-note{break-inside:avoid; page-break-inside:avoid}
  html .doc .card{border:0; margin:0}
}
