/* review_keys.css - keyboard review of result cards (static/js/review_keys.js). Own file: app.css is
 * at its size cap. Every rule is under [data-rk-focus], .rcard[data-rk-done], .rk-* or the card's
 * .ractions > .rk-tick, so deleting the script tag leaves the page exactly as it was (C3). Theme
 * tokens only; spacing 4/8/12/16/24, type 12/13/15, 32px targets, 2px gold focus ring with a 2px
 * offset (DESIGN.md). Load after results.css: the Grid tile rules below tie it on specificity. */

/* ── The focused card ───────────────────────────────────────────────────────────────────── */
/* Drawn by the module only after a key was pressed, so nobody who stays on the mouse sees it. */
[data-rk-focus] {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  scroll-margin-block: 72px;
}
[data-rk-focus]:focus { outline: 2px solid var(--gold); }
[data-rk-focus]:focus-visible { outline: 2px solid var(--gold); }

/* ── The "reviewed" check ───────────────────────────────────────────────────────────────── */
/* A third small icon in the rail's button row, matching the Regenerate and Share buttons
   (36 x 30). It exists only on a reviewed card. */
.ractions > .rk-tick {
  order: -2;
  flex: 0 0 36px;
  width: 36px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--ok);
  background: transparent;
  color: var(--ok);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ractions > .rk-tick svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ractions > .rk-tick:hover { background: var(--s2); }
.ractions > .rk-tick:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* A closed Grid tile hides every rail button except Regenerate and Share; the check is the
   one more it must show, and the Copy button beside them gives up a little width. */
:is(#img-list, #vid-list)[data-density="grid"] > :not([data-rd-open]) .ractions > .rk-tick { display: inline-flex; }
:is(#img-list, #vid-list)[data-density="grid"] > :not([data-rd-open]) .rcard[data-rk-done] .kw-copy-btn { right: 137px; }
:is(#img-list, #vid-list)[data-density="grid"] > :not([data-rd-open]) .rcard[data-rk-done]:not(:has(.regen-btn)) .kw-copy-btn { right: 96px; }

/* ── The strip above the cards: reviewed counter + the quiet hint ───────────────────────── */
.rk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-height: 32px;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.rk-bar[hidden] { display: none; }
.rk-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  font-weight: 600;
}
.rk-count svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rk-hint { margin-left: auto; }
.rk-count + .rk-hint { margin-left: auto; }
.rk-x {
  appearance: none;
  min-width: 32px;
  height: 32px;
  margin-right: -8px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.rk-x:hover { color: var(--text); }
.rk-x:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* A key cap, in the strip and in the sheet. */
.rk-kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  border: 1px solid var(--border2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--s1);
  color: var(--dim);
  font-family: var(--mono, ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

/* ── The shortcut sheet (a pkChoose dialog) ─────────────────────────────────────────────── */
.rk-sheet table { width: 100%; border-collapse: collapse; }
.rk-sheet th,
.rk-sheet td { padding: 6px 0; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; font-weight: 400; vertical-align: middle; }
.rk-sheet th { width: 96px; white-space: nowrap; }
.rk-sheet td { color: var(--text); }
.rk-sheet p { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ── Screen-reader status ───────────────────────────────────────────────────────────────── */
.rk-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .ractions > .rk-tick { transition: none; }
}
