/* Kit additions for combining files and recipes (skx-), from kit tokens only (scripts/check-tokens.mjs).
   Cards, badges, switches, fields and the table are the kit's own; these lay them out on a full page. */

/* ---------- skx-multi: the combine view ---------- */
.skx-multi { display: flex; flex-direction: column; gap: var(--sk-space-4); }
.skx-multi[aria-busy="true"] { opacity: 0.6; pointer-events: none; transition: opacity var(--sk-fast) var(--sk-ease); }
.skx-multi__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sk-space-4); align-items: start; }
.skx-card { display: flex; flex-direction: column; gap: var(--sk-space-3); min-width: 0; }
.skx-card .sk-card__label { margin: 0; }

/* ---------- skx-filelist: one line per file, with its status ---------- */
.skx-filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sk-space-2); }
.skx-fileitem { display: flex; align-items: flex-start; gap: var(--sk-space-2); padding: var(--sk-space-2) 0; border-top: 1px solid var(--sk-line); }
.skx-fileitem:first-child { border-top: 0; padding-top: 0; }
.skx-fileitem .sk-badge { flex: none; margin-top: 1px; }
.skx-fileitem__text { flex: 1 1 auto; min-width: 0; }
.skx-fileitem__name { font-weight: var(--sk-weight-strong); overflow-wrap: anywhere; }
.skx-fileitem .sk-btn { flex: none; }

/* ---------- skx-matches: the match report and the mismatch report ---------- */
.skx-match__summary { font-weight: var(--sk-weight-strong); }
.skx-matches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sk-space-2); }
.skx-match { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sk-space-2) var(--sk-space-3); padding: var(--sk-space-2) var(--sk-space-3); border: 1px solid var(--sk-line); border-radius: var(--sk-radius); background: var(--sk-bg-sunken); }
.skx-match__text { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.skx-into__row { display: inline-flex; align-items: center; gap: var(--sk-space-2); flex-wrap: wrap; }
.skx-into__label { font-size: var(--sk-text-sm); color: var(--sk-text-muted); }
.skx-into { max-width: 100%; }
.skx-mismatch { border-color: var(--sk-warning); }
.skx-mismatch--none { border-color: var(--sk-line); }
/* A file missing this month (task 1187): the line that matters most, first, with a warning edge until answered. */
.skx-match--missing-file { border-color: var(--sk-warning); border-left-width: 4px; }
.skx-match--accepted { border-color: var(--sk-line); }
.skx-match__actions { gap: var(--sk-space-2); }
.skx-mismatch .sk-badge { white-space: normal; max-width: 100%; }

/* ---------- skx-cfix: a switch with its reason (the combined table's fixes) ---------- */
.skx-cfix { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sk-space-1) var(--sk-space-3); padding: var(--sk-space-2) var(--sk-space-3); border: 1px solid var(--sk-line); border-radius: var(--sk-radius); background: var(--sk-surface); }
.skx-cfix .sk-switch { flex: none; font-weight: var(--sk-weight-strong); }
.skx-cfix__reason { flex: 1 1 260px; min-width: 0; color: var(--sk-text-muted); overflow-wrap: anywhere; }

/* ---------- skx-perfile: rows per file ---------- */
.skx-perfile { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sk-space-2); }
.skx-perfile__item { display: inline-flex; gap: var(--sk-space-2); align-items: baseline; padding: var(--sk-space-1) var(--sk-space-2); border: 1px solid var(--sk-line); border-radius: var(--sk-radius-pill); background: var(--sk-surface); font-size: var(--sk-text-xs); max-width: 100%; }
.skx-perfile__name { color: var(--sk-text-muted); overflow-wrap: anywhere; }
.skx-grid .sk-table td.skx-source, .skx-grid .sk-table th.skx-source { color: var(--sk-text-muted); font-size: var(--sk-text-xs); white-space: nowrap; }

/* ---------- skx-recipes: the recipe list on the start screen ---------- */
.skx-recipes { display: flex; flex-direction: column; gap: var(--sk-space-3); }
.skx-recipes__head { display: flex; align-items: center; gap: var(--sk-space-2); }
.skx-recipes__empty { align-items: flex-start; text-align: left; border: 1px dashed var(--sk-line-strong); border-radius: var(--sk-radius-lg); padding: var(--sk-space-5); }
.skx-recipes__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sk-space-2); }
.skx-recipe { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sk-space-2) var(--sk-space-4); padding: var(--sk-space-3) var(--sk-space-4); border: 1px solid var(--sk-line); border-radius: var(--sk-radius-lg); background: var(--sk-surface); }
.skx-recipe__text { flex: 1 1 260px; min-width: 0; }
.skx-recipe__name { font-weight: var(--sk-weight-strong); overflow-wrap: anywhere; }
.skx-recipe__actions { display: flex; flex-wrap: wrap; gap: var(--sk-space-2); }

/* ---------- skx-recipe-save: name and Save recipe ---------- */
.skx-recipe-save__row { gap: var(--sk-space-2); flex-wrap: wrap; }
.skx-recipe-save__row .sk-input { flex: 1 1 220px; width: auto; min-width: 0; }

/* ---------- skx-colbtn and skx-colpanel: the column buttons on the table header (both views) ----------
   Why: the kit has no header button. A column name is a quiet button (keyboard reachable) that opens a panel
   above the table: Name with Rename, Read as, Remove column. Built from kit cards, inputs, selects and buttons. */
.skx-colbtn { display: inline-flex; align-items: center; gap: var(--sk-space-1); max-width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-align: left; cursor: pointer; border-radius: var(--sk-radius-sm); }
.skx-colbtn:hover .skx-colbtn__name { text-decoration: underline; text-underline-offset: 2px; }
.skx-colbtn:focus-visible { box-shadow: var(--sk-focus-ring); }
.skx-colbtn__caret { flex: none; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 0.6; }
.skx-colslot:empty { display: none; }
.skx-colpanel { display: flex; flex-direction: column; gap: var(--sk-space-3); max-width: 560px; }
.skx-colpanel__head { display: flex; align-items: center; gap: var(--sk-space-2); }
.skx-colpanel__head .sk-card__label { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.skx-colpanel__row { gap: var(--sk-space-2); flex-wrap: wrap; }
.skx-colpanel__row .sk-input { flex: 1 1 200px; width: auto; min-width: 0; }
.skx-colpanel__type { width: auto; max-width: 100%; }
.skx-colpanel__why { overflow-wrap: anywhere; }
.skx-colpanel .sk-input::selection { background: var(--sk-accent-soft); color: var(--sk-text); } /* the name is selected on open: readable in dark too */
.skx-colpanel__remove { color: var(--sk-danger); }
.skx-gridbox { display: flex; flex-direction: column; gap: var(--sk-space-2); min-width: 0; }

/* ---------- skx-recipe-actions: Update recipe, and Save as a new recipe (quiet) ---------- */
.skx-recipe-actions { display: flex; flex-direction: column; gap: var(--sk-space-2); }
.skx-recipe-actions .sk-row { gap: var(--sk-space-2); flex-wrap: wrap; }
.skx-recipe-actions__new:empty { display: none; }

@media (max-width: 420px) {
  .skx-multi__cols { grid-template-columns: 1fr; }
  .skx-recipe__actions { width: 100%; }
  .skx-fileitem { flex-wrap: wrap; }
}
/* "A recipe called ... exists" (task 1192): the question sits under the name field until answered. */
.skx-recipe-save__ask { display: grid; gap: var(--sk-space-2); padding: var(--sk-space-3); border: 1px solid var(--sk-warning); border-radius: var(--sk-radius); background: var(--sk-bg-sunken); }
.skx-recipe-save__question { margin: 0; }
