/* ================= THE OKR EXPORT — THE PAPER DELTA =================

   The exported report is `.a-okr-print.okr-export`, and `.a-okr-print` is
   already dressed for paper by CSS/alt/alt-okrs.css §11. None of it is repeated
   here — a second set of values for one look is how two printers disagree.

   This file is the report-shaped delta on top: the page box, the cover, the
   scope list, the digest block, the section rhythm, and the page-break
   behaviour a multi-page document needs that a one-board printout does not.

   The document must survive this sheet's absence: every element still carries
   a class alt-okrs.css dresses, so the report prints plainer, never broken —
   which is why "At a glance" is a real table rather than a tile grid.

   Everything is scoped under `.okr-export`; nothing here may reach the
   application. Typography keeps the 11px floor anyway, in points, because an
   executive report is read on paper by people who did not choose the size. */

/* ---------- on screen ----------
   The report is staged with the `hidden` attribute and only given a box
   inside @media print. `[hidden]{display:none !important}` in CSS/base.css
   already does that; this is the belt to its braces. */
.okr-export{ display:none; }


/* ---------- the dialog, on screen ----------

   The export dialog is drawn into the shared OKR flow host, so its buttons,
   hints, checkboxes and captions are already the suite's. Not already dressed
   is the scope list — a bare `<dl>`, which a browser indents like a glossary.

   These three classes exist only inside this dialog. Every colour is an
   `--a-*` token with a classic fallback, since this sheet must be correct on a
   host whose suite tokens have not resolved. */
.okr-export-what,
.okr-export-ai{
  display:flex; flex-direction:column; gap:var(--a-2, 8px); min-width:0;
}
.okr-export-what > p,
.okr-export-ai > p{ margin:0; }
.okr-export-ai{
  padding-top:var(--a-3, 12px);
  border-top:1px solid var(--a-line, var(--border, #d8dde5));
}
.okr-export-ai > .a-btn{ align-self:flex-start; }

/* The scope list, in the dialog only — the document's own copy is laid out for
   paper below. Label/value pairs across the width, so one fact is one glance. */
.okr-export-what .okr-export-scope{
  margin:0; display:grid; gap:4px 16px;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
}
.okr-export-what .okr-export-scope-row{
  display:flex; gap:8px; align-items:baseline; min-width:0;
}
.okr-export-what .okr-export-scope dt{
  flex:0 0 auto; margin:0;
  font:700 10px/1.4 var(--a-body, inherit); letter-spacing:.09em; text-transform:uppercase;
  color:var(--a-dim, var(--text-dim, #5b6472));
}
.okr-export-what .okr-export-scope dd{
  flex:1 1 auto; margin:0; min-width:0;
  font-size:12px; line-height:1.45; overflow-wrap:anywhere;
  color:var(--a-text, var(--text, #10151d));
}

/* The digest preview — a read-only paragraph, regenerated never edited, since
   an edited narrative under its own provenance line would stop being true. */
.okr-export-ai .okr-export-digest-slot{
  display:flex; flex-direction:column; gap:6px; min-width:0;
  padding:var(--a-3, 12px);
  border:1px solid var(--a-line-soft, var(--border, #e3e7ee));
  border-radius:var(--a-r-sm, 8px);
  background:var(--a-panel, var(--panel, #fff));
}
.okr-export-ai .okr-export-digest-body{
  margin:0; font-size:13px; line-height:1.55;
  color:var(--a-text, var(--text, #10151d));
}


@media print{

  /* ---------- the page box ----------
     The one @page rule in the project, and the reason this file exists:
     without it a wide table's last column falls off the edge, silently, on
     somebody else's printer. 16mm is binder-safe on both A4 and US Letter. */
  @page{ margin:16mm 14mm; }

  .okr-export{
    display:block;
    /* `.a-okr-print` sets the family and 11pt/1.4; the report only adds the
       reading width — the page itself needs no cap, but the cover's prose does. */
    max-width:none;
  }

  /* ---------- the cover ----------
     Not a cover page: the masthead sits at the top of page one with the
     digest under it, the first thing that should be read. */
  .okr-export .okr-export-cover{
    break-after:avoid; page-break-after:avoid;
    border-bottom:2px solid #000; padding-bottom:8pt; margin-bottom:12pt;
  }
  .okr-export .okr-export-cover h1{
    margin:2pt 0 4pt; font-size:22pt; line-height:1.15; font-weight:700; color:#000;
  }
  .okr-export .okr-export-period{
    margin:0 0 8pt; font-size:12pt; line-height:1.4; color:#000;
  }
  .okr-export .okr-export-when{
    margin:8pt 0 0; font-size:9pt; line-height:1.45; color:#333; max-width:78ch;
  }

  /* The scope list — what the reader checks before trusting the numbers, label/
     value pairs across the width. `is-narrow` is the pair that REMOVED work
     from the report and has to be noticed, so it takes the rule beside it. */
  .okr-export .okr-export-scope{
    margin:0; display:grid; gap:3pt 16pt;
    grid-template-columns:repeat(auto-fit, minmax(180pt, 1fr));
  }
  .okr-export .okr-export-scope-row{
    display:flex; gap:6pt; align-items:baseline; min-width:0;
    break-inside:avoid; page-break-inside:avoid;
  }
  .okr-export .okr-export-scope-row.is-narrow{
    border-left:2pt solid #000; padding-left:5pt;
  }
  .okr-export .okr-export-scope dt{
    flex:0 0 auto; margin:0;
    font-size:9pt; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:#333;
  }
  .okr-export .okr-export-scope dd{
    flex:1 1 auto; margin:0; min-width:0;
    font-size:10pt; line-height:1.4; color:#000; overflow-wrap:anywhere;
  }

  /* ---------- the digest ----------
     The first thing read, so it is set largest. The provenance line must
     never be mistaken for part of the narrative — hence the rule and caption face. */
  .okr-export .okr-export-digest{
    padding:10pt 12pt; margin:0 0 14pt;
    break-inside:avoid; page-break-inside:avoid;
  }
  .okr-export .okr-export-digest-body{
    margin:6pt 0 0; font-size:12pt; line-height:1.55; color:#000; max-width:78ch;
  }
  .okr-export .okr-export-prov{
    margin:8pt 0 0; padding-top:6pt; border-top:1px solid #999;
    /* `.a-okr-lbl`'s caption face is right over a figure, shouty over prose — this is a sentence. */
    text-transform:none; letter-spacing:0; font-weight:400; white-space:normal;
    font-size:9pt; line-height:1.5; color:#333;
  }

  /* ---------- section rhythm ----------
     A heading that ends a page is a heading for nothing, at every level. */
  .okr-export .okr-export-sec{ margin:0 0 14pt; }
  .okr-export .a-okr-group-h{ break-after:avoid; page-break-after:avoid; }
  .okr-export h2{
    margin:0 0 6pt; font-size:14pt; line-height:1.25; font-weight:700; color:#000;
    border-bottom:1px solid #000; padding-bottom:3pt;
  }
  .okr-export h3{ margin:0 0 4pt; font-size:12pt; line-height:1.3; font-weight:700; color:#000; }
  .okr-export h4{ margin:0; font-size:11pt; line-height:1.35; font-weight:700; color:#000; }
  .okr-export .a-okr-lbl{ font-size:9pt; }

  /* ---------- at a glance ----------
     The headline figures, an ordinary `.a-okr-table` made big enough to read
     as the summary they are. */
  .okr-export .okr-export-fig{
    font-size:16pt; font-weight:700; line-height:1.2; color:#000; text-align:right;
    white-space:nowrap;
  }
  .okr-export .okr-export-glance .a-okr-th{ font-size:8.5pt; }

  /* ---------- tables ----------
     The header row repeats on every page — without it, page two is unlabelled
     columns. And the table never scrolls: a scroll container prints as its
     visible slice, so the last columns would simply not exist. */
  .okr-export table.a-okr-table{ width:100%; min-width:0; table-layout:auto; margin:4pt 0 0; }
  .okr-export table.a-okr-table thead{ display:table-header-group; }
  .okr-export table.a-okr-table tfoot{ display:table-footer-group; }
  .okr-export .a-okr-th{ font-size:8.5pt; padding:4pt 6pt; border-bottom:1px solid #000; }
  .okr-export .a-okr-td{ font-size:9.5pt; padding:4pt 6pt; vertical-align:top; }
  .okr-export .a-okr-th.num, .okr-export .a-okr-td.a-okr-num{ text-align:right; }
  /* A measure title is the widest thing in the row and the only one that should wrap. */
  .okr-export .a-okr-td{ overflow-wrap:anywhere; }
  .okr-export .a-okr-num{ white-space:nowrap; }

  /* ---------- the detail ----------
     An area starts a page, a quarter does not — a page per quarter would be
     near-empty pages for a team that plans across quarters. The first area
     does not break, or the cover and digest would sit alone on page one. */
  .okr-export .okr-export-area{ break-before:page; page-break-before:always; }
  .okr-export .okr-export-area:first-of-type{ break-before:auto; page-break-before:auto; }
  .okr-export .okr-export-areah{
    border-bottom:1px solid #000; padding-bottom:4pt; margin:0 0 8pt;
  }
  .okr-export .okr-export-q{ margin:0 0 10pt; }
  .okr-export .okr-export-qh{ margin:0 0 5pt; }
  .okr-export .okr-export-qh .a-okr-lbl{
    font-size:9pt; letter-spacing:.09em; color:#333;
  }

  /* An objective may break — a deliberate override of alt-okrs.css's `break-
     inside:avoid`, right for a board printout but wrong here: an objective with
     ten measures is taller than a page, and avoiding the break only pushes it
     to a fresh page and breaks it anyway. The heading and its first rows are
     held together instead, via `break-after:avoid` and the repeating header.
     Scoped to `.okr-export` only — the existing print path is untouched. */
  .okr-export .a-okr-group.okr-export-obj{
    break-inside:auto; page-break-inside:auto;
    margin:0 0 10pt; padding:0 0 8pt; border-bottom:1px solid #ccc;
  }
  .okr-export .okr-export-obj:last-child{ border-bottom:0; }
  .okr-export .okr-export-obj .a-okr-group-h{ margin:0 0 4pt; }

  /* The objective's headline facts, one line that wraps rather than clips —
     clipping would drop the period, the fact the health beside it was measured against. */
  .okr-export .okr-export-objmeta{
    display:flex; align-items:center; flex-wrap:wrap; gap:4pt 10pt;
    margin:3pt 0 0; font-size:9.5pt; line-height:1.4; color:#000;
  }
  .okr-export .okr-export-meta{ color:#333; }
  /* A magnitude worth keeping where the printer has colour, the percentage
     beside it for where it does not. Fixed width so a row compares down the page. */
  .okr-export .okr-export-bar{
    width:90pt; height:5pt; flex:0 0 auto; border-radius:2.5pt;
  }

  /* ---------- the push indicator ----------

     The document's own chip, because `.a-okr-print` never resets one —
     alt-okrs.css's print block takes the colour out of the pill/dot/bars, but
     `.a-chip` is not on that list. Left alone, the shared screen chip would
     print mid-grey text on white, unreadable in the medium this document
     exists for. #333 on #fff inside a #666 border is the same treatment
     CSS/okr-report-print.css gives the identical chip, so the whole message
     survives a black-and-white printer or a reader who cannot see colour. */
  .okr-export .a-chip{
    display:inline-flex; align-items:center; height:auto; padding:1pt 5pt;
    border-radius:8pt; font:600 8pt/1.35 var(--a-body, sans-serif); white-space:normal;
    background:#fff; color:#333; border:0.5pt solid #666;
    max-width:100%; overflow-wrap:anywhere;
  }
  /* Separated from the date it is about — `<td>` is not a flex container, so
     the gap must come from the chip itself. */
  .okr-export .okr-export-push{ margin-left:4pt; }
  .okr-export .okr-export-desc{
    margin:0 0 4pt; font-size:10pt; line-height:1.5; color:#333; max-width:78ch;
  }

  /* ---------- the footer ---------- */
  .okr-export .okr-export-foot{
    margin:14pt 0 0; padding-top:6pt; border-top:1px solid #999;
    break-inside:avoid; page-break-inside:avoid;
  }
  .okr-export .okr-export-foot .a-okr-lbl{
    text-transform:none; letter-spacing:0; font-weight:400; white-space:normal;
    font-size:9pt; line-height:1.5; color:#333; max-width:78ch;
  }
}
