/* Raw import preview (JS/features/okr-import-preview.js): summary, grouped diff, inline
   resolution of unmatched names, write button. Reuses `.a-card`, `.a-btn`, `.a-chip`, `.a-okr-*`.
   No literal colours (`--a-*` tokens or the `--okr-c` triple from `.st-*`); scoped to `.alt-app`.
   At 390px the field table stacks, cells captioned from `data-l`. */


/* ---------- 1 · THE SUMMARY CARD ----------

   `.a-card` gives the surface and nothing else; this adds the padding and
   internal rhythm, all the summary needs on top of it. */
.alt-app .a-okr-imp-sum{
  display:flex; flex-direction:column; gap:var(--a-2);
  padding:var(--a-3) var(--a-4); min-width:0;
}

/* The one sentence read if nothing else is — "816 rows analysed." Nothing
   existing sets a figure at this size; this is a sentence, at reading size. */
.alt-app .a-okr-imp-lede{
  margin:0; font:600 var(--a-fs-16)/var(--a-lh-tight) var(--a-display); color:var(--a-text);
}

/* The findings list — a real `<ul>` so a screen reader announces "list, six
   items", bullets off since a status pill already leads each line. Shared by
   the summary, blocking and warnings sections, one definition not three. */
.alt-app .a-okr-imp-lines{
  list-style:none; margin:0; padding:0;
  display:flex; flex-direction:column; gap:var(--a-2);
  font-size:var(--a-fs-ctl); line-height:var(--a-lh-body); color:var(--a-text); min-width:0;
}
.alt-app .a-okr-imp-lines > li{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:6px; min-width:0;
}
.alt-app .a-okr-imp-lines .a-hint{ margin:0; }


/* ---------- 1b · A CHIP IS AS WIDE AS ITS WORD ----------
   `.a-okr-pill` is nowrap/ellipsis, but in this flex row
   `overflow:hidden` zeroes its min size and flex shrink crushed it. Take the chip out of the
   shrink (`flex:0 0 auto`) and let it wrap rather than ellipsise on very narrow screens.
   Scoped to this pane; elsewhere the ellipsis is right. */
.alt-app .a-okr-imp-sum .a-okr-pill,
.alt-app .a-okr-imp-block .a-okr-pill,
.alt-app .a-okr-imp-warn .a-okr-pill,
.alt-app .a-okr-imp-quar .a-okr-pill,
.alt-app .a-okr-imp-gh > .a-okr-pill,
.alt-app .a-okr-imp-rt > .a-okr-pill{
  flex:0 0 auto;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  height:auto;
}

/* 2 - Blocking vs warning: separate grounds and words plus a 3px status-colour spine so the
   distinction survives greyscale. The section is the status, so it names its token directly. */
.alt-app .a-okr-imp-block,
.alt-app .a-okr-imp-warn,
.alt-app .a-okr-imp-note{
  display:flex; flex-direction:column; gap:var(--a-2); min-width:0;
  padding:var(--a-3); border-radius:var(--a-r);
  border:1px solid var(--a-line-soft); border-left-width:3px;
}
.alt-app .a-okr-imp-block{ border-left-color:var(--a-red);   background:var(--a-red-soft); }
.alt-app .a-okr-imp-warn { border-left-color:var(--a-amber); background:var(--a-amber-soft); }
/* Quarters that already ended: must be noticeable without reading as a fault. Same shape as
   above in `--a-blue` ("notice this"), not amber or red. */
.alt-app .a-okr-imp-note { border-left-color:var(--a-blue);  background:var(--a-blue-soft); }
/* The lede and explanation take the box's own rhythm — a `<p>`'s UA margin
   fights the flex gap otherwise, landing the sentence half a line off. */
.alt-app .a-okr-imp-note > .a-okr-imp-lede,
.alt-app .a-okr-imp-note > .a-hint{ margin:0; }
/* `.a-check-l` centres, correct for a one-line label and wrong for one that
   wraps here — scoped to this box, not the scope filter's own checkboxes. */
.alt-app .a-okr-imp-note > .a-check-l{ align-items:flex-start; }
.alt-app .a-okr-imp-note > .a-check-l > .a-okr-check{ margin-top:2px; flex:0 0 auto; }
/* The error summary takes focus when the reader presses "Show what must be fixed", and a focus
   ring on a section is the only thing that says the jump landed. */
.alt-app .a-okr-imp-block:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-offset); }
.alt-app .a-okr-imp-block > .a-sec-h,
.alt-app .a-okr-imp-warn > .a-sec-h{ margin:0; }


/* 3 - Diff groups. Native `<details>` gives keyboard, announcement and print with no script.
   The marker is redrawn as a rotated `::before` because `display:flex` on `<summary>` drops
   the native triangle in WebKit/Blink. */
.alt-app .a-okr-imp-g{
  border:1px solid var(--a-line-soft); border-radius:var(--a-r);
  background:var(--a-panel); min-width:0; overflow:hidden;
}
.alt-app .a-okr-imp-g + .a-okr-imp-g{ margin-top:var(--a-2); }
.alt-app .a-okr-imp-gh{
  display:flex; align-items:center; gap:var(--a-2); min-width:0;
  padding:var(--a-2) var(--a-3); cursor:pointer;
  font:600 var(--a-fs-ctl)/var(--a-lh-ui) var(--a-body); color:var(--a-text);
  list-style:none;
}
.alt-app .a-okr-imp-gh::-webkit-details-marker{ display:none; }
.alt-app .a-okr-imp-gh::before{
  content:''; flex:0 0 auto; width:0; height:0;
  border-left:5px solid var(--a-faint);
  border-top:4px solid transparent; border-bottom:4px solid transparent;
  transition:transform var(--a-quick) var(--a-ease);
}
.alt-app .a-okr-imp-g[open] > .a-okr-imp-gh::before{ transform:rotate(90deg); }
/* A reader who has asked for less motion gets the same two states without the turn. */
@media (prefers-reduced-motion: reduce){
  .alt-app .a-okr-imp-gh::before{ transition:none; }
}
.alt-app .a-okr-imp-gh:hover{ background:var(--a-raised); }
.alt-app .a-okr-imp-gh:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-inset); }
/* The title takes the slack so the count sits hard right, lining up six
   group counts to be compared down the page rather than read one at a time. */
.alt-app .a-okr-imp-gt{ flex:1 1 auto; min-width:0; }
.alt-app .a-okr-imp-gh > .a-okr-num{ flex:0 0 auto; font-size:var(--a-fs-ctl); font-weight:600; }
/* Inset from the summary; tables inside keep their own `.a-okr-tscroll`. */
.alt-app .a-okr-imp-g > *:not(.a-okr-imp-gh){
  margin:0 var(--a-3) var(--a-3); min-width:0;
}
.alt-app .a-okr-imp-g > .a-hint:first-of-type{ margin-top:0; }


/* 4 - One record with its fields. Reconciliation shows FIELD, CURRENT, PROFIT.CO, PROPOSED per
   field, which a flat table cannot express, so a record is a block with its own small table. */
.alt-app .a-okr-imp-rec{
  display:flex; flex-direction:column; gap:6px; min-width:0;
  padding:var(--a-2) 0;
  border-top:1px solid var(--a-line-soft);
}
.alt-app .a-okr-imp-rec:first-of-type{ border-top:0; }
.alt-app .a-okr-imp-rt{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:6px; min-width:0;
  margin:0; font-size:var(--a-fs-ctl); line-height:var(--a-lh-ui); color:var(--a-text);
}
.alt-app .a-okr-imp-rt > .a-okr-pill{ align-self:center; }
.alt-app .a-okr-imp-rt > .a-hint{ margin:0; }

/* The sentence that says the reader's value survives — text, not colour,
   because "your value is kept" is not a thing a hue can say. */
.alt-app .a-okr-imp-kept{
  font-size:var(--a-fs-ctl-sm); font-weight:600; color:var(--a-amber); white-space:normal;
}


/* 4b - What a resolution choice did: one sentence under the map row for effects that are
   invisible (e.g. "do not import this person"). `--a-dim`, a settled decision, not a warning. */
.alt-app .a-okr-maprow > .a-okr-imp-mapnote{
  grid-column:1 / -1; min-width:0;
  font-size:var(--a-fs-ctl-sm); line-height:var(--a-lh-ui); color:var(--a-dim);
}


/* 5 - Scope filter: two checkbox buckets side by side, stacked when narrow. Nothing existing
   lays out a pair of labelled groups. */
.alt-app .a-okr-imp-scope{
  display:grid; gap:var(--a-3); min-width:0;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
}
.alt-app .a-okr-imp-scopeb{
  display:flex; flex-direction:column; gap:4px; min-width:0;
  padding:var(--a-2) var(--a-3); border-radius:var(--a-r-sm);
  border:1px solid var(--a-line-soft); background:var(--a-panel);
}
.alt-app .a-okr-imp-scopeb .a-okr-lbl{ margin:0 0 2px; }
/* A count beside its value, quiet, and never the thing the eye lands on first. */
.alt-app .a-okr-imp-scopeb .a-okr-num{ color:var(--a-faint); }


/* ---------- 6 · ANALYSIS PROGRESS ----------
   The six pipeline steps, each in the page's status pill. A named step tells a slow read
   from a hung one; a bare spinner cannot. */
.alt-app .a-okr-imp-steps{
  list-style:none; margin:0; padding:0;
  display:flex; flex-direction:column; gap:6px;
  font-size:var(--a-fs-ctl); line-height:var(--a-lh-ui); color:var(--a-text); min-width:0;
}
.alt-app .a-okr-imp-steps > li{
  display:flex; align-items:center; gap:var(--a-2); min-width:0;
}
.alt-app .a-okr-imp-steps > li > .a-okr-pill{ flex:0 0 auto; min-width:74px; }


/* ---------- 7 · THE FOOTER EXPLANATION ----------
   A disabled button says why, in words, beside the button. Takes its own line where sharing
   one would push Accept off the edge. */
.alt-app .a-okr-imp-why{ min-width:0; }


/* 8 - Quarantine: the import proceeds but rows are left behind. Red spine over the ordinary
   panel ground (something is lost, nothing is stopped). Everything else is borrowed. */
.alt-app .a-okr-imp-quar{
  display:flex; flex-direction:column; gap:var(--a-2); min-width:0;
  padding:var(--a-3); border-radius:var(--a-r);
  border:1px solid var(--a-line-soft); border-left-width:3px;
  border-left-color:var(--a-red); background:var(--a-panel);
}
.alt-app .a-okr-imp-quar:focus-visible{ outline:var(--a-focus); outline-offset:var(--a-focus-offset); }
.alt-app .a-okr-imp-quar > .a-sec-h{ margin:0; }
.alt-app .a-okr-imp-quar > .a-hint{ margin:0; }
/* The download is the artefact this section exists to produce, so it sits
   above the lists on its own line — stretched across the column it would
   read as a banner. */
.alt-app .a-okr-imp-quar > .a-btn{ align-self:flex-start; max-width:100%; }

/* Told apart by position as well as wording: rows to fix come first, rows
   only waiting follow, subordinate to the block above rather than equal to it. */
.alt-app .a-okr-imp-quarb{
  display:flex; flex-direction:column; gap:6px; min-width:0;
}
.alt-app .a-okr-imp-quarb + .a-okr-imp-quarb{
  margin-top:var(--a-2); padding-top:var(--a-3);
  border-top:1px solid var(--a-line-soft);
}
.alt-app .a-okr-imp-quarb > .a-sec-h{ margin:0; }
.alt-app .a-okr-imp-quarb > .a-hint{ margin:0 0 var(--a-1); }
/* A phrase here — "340 rows" — not the bare figure, or it reads as a row number. */
.alt-app .a-okr-imp-quar .a-okr-imp-gh > .a-okr-num{ white-space:nowrap; }


/* ================= RESPONSIVE =================
   `.a-okr-tscroll` already keeps wide tables in their own box, so nothing here is about
   horizontal overflow, only where sideways scrolling is the wrong answer. */

@media (max-width:820px){
  /* The footer's explanation takes its own line rather than competing with the buttons. */
  .alt-app .a-okr-imp-why{ flex:1 1 100%; }
}

@media (max-width:639px){
  .alt-app .a-okr-imp-sum{ padding:var(--a-3); }
  /* At 390px the quarantine list stacks rather than squeezes, and the
     download button takes a full line so it is never pushed off the edge. */
  .alt-app .a-okr-imp-quar{ padding:var(--a-2); }
  .alt-app .a-okr-imp-quar > .a-btn{ align-self:stretch; text-align:center; }
  .alt-app .a-okr-imp-quarb + .a-okr-imp-quarb{ padding-top:var(--a-2); }
  .alt-app .a-okr-imp-g > *:not(.a-okr-imp-gh){ margin:0 var(--a-2) var(--a-2); }
  .alt-app .a-okr-imp-gh{ flex-wrap:wrap; }

  /* At 390px the four-column field table stacks into labelled blocks: narrow columns would
   truncate the name comparison. Captions come from the cell's `data-l`, the same string the
   renderer writes into `<th>`. `<thead>` is hidden visually only. `.a-okr-imp-rows` stacks
   likewise (its last column holds the blocked reason). */
  .alt-app .a-okr-imp-fields,
  .alt-app .a-okr-imp-rows{ min-width:0; width:100%; }
  .alt-app .a-okr-imp-fields thead,
  .alt-app .a-okr-imp-rows thead{
    position:absolute; width:1px; height:1px; overflow:hidden;
    clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;
  }
  .alt-app .a-okr-imp-fields .a-okr-tr,
  .alt-app .a-okr-imp-rows .a-okr-tr{
    display:block; padding:6px 0; border-bottom:1px solid var(--a-line-soft);
  }
  .alt-app .a-okr-imp-fields .a-okr-td,
  .alt-app .a-okr-imp-rows .a-okr-td{
    display:grid; grid-template-columns:minmax(0,11ch) minmax(0,1fr);
    gap:var(--a-2); align-items:baseline;
    padding:2px 0; white-space:normal;
  }
  .alt-app .a-okr-imp-fields .a-okr-td::before,
  .alt-app .a-okr-imp-rows .a-okr-td::before{
    content:attr(data-l);
    font:700 var(--a-fs-11)/var(--a-lh-tight) var(--a-body); letter-spacing:.08em; text-transform:uppercase;
    color:var(--a-dim);
  }
}


/* 9 - Actions on one history run (JS/features/okr-import-history.js). Each run is a flex
   column that would stretch buttons full width; this is a wrapping row with
   `align-items:stretch`. `.a-actions` lives in a sheet okrs.html does not load. */
.alt-app .a-okr-imp-acts{
  display:flex; flex-wrap:wrap; gap:var(--a-2); min-width:0; margin-top:2px;
}
.alt-app .a-okr-imp-acts > .a-btn{ max-width:100%; }

@media (max-width:639px){
  /* A wrapped button takes the whole line — half-width buttons in a stack read as a broken grid. */
  .alt-app .a-okr-imp-acts{ flex-direction:column; align-items:stretch; }
  .alt-app .a-okr-imp-acts > .a-btn{ justify-content:center; }
}
