/* Kit additions for a full-page web app. The SKILLMERC kit v1 (brand/kit/) is built for extension panels and
   settings pages; a web app needs a few more parts. Each one below uses kit tokens by name and nothing else
   (test/tokens.test.mjs fails on any raw colour, font or radius here). Prefix skx- = "kit addition": when the
   kit's maintainer lifts a part into brand/kit/kit.css, rename it to sk- there and delete it here.
   Every part works at 320 px, in dark mode and by keyboard. */

/* ---------- skx-app: page frame for a web app (header, main that grows, footer at the bottom) ----------
   Why: the kit's .sk-page is a 760 px settings column; a data app needs the full width for wide tables. */
.skx-app { min-height: 100vh; display: flex; flex-direction: column; background: var(--sk-bg); }
.skx-main { flex: 1 0 auto; width: 100%; max-width: 1120px; margin: 0 auto; padding: var(--sk-space-8) var(--sk-space-5) var(--sk-space-10); display: flex; flex-direction: column; gap: var(--sk-space-6); }
.skx-defs { position: absolute; }
.skx-icon { width: 16px; height: 16px; flex: none; }

/* ---------- skx-header: site header for a web app ----------
   Why: the kit has a panel head (.sk-panel__head) but no page header. Product icon and name left, one quiet action right. */
.skx-header { display: flex; align-items: center; gap: var(--sk-space-3); min-height: 56px; padding: var(--sk-space-2) var(--sk-space-5); border-bottom: 1px solid var(--sk-line); background: var(--sk-surface); }
.skx-brand { display: inline-flex; align-items: center; gap: var(--sk-space-2); color: var(--sk-text); text-decoration: none; border-radius: var(--sk-radius-sm); }
.skx-brand:hover { color: var(--sk-text); }
.skx-brand__name { font-size: var(--sk-text-md); font-weight: var(--sk-weight-title); letter-spacing: var(--sk-tracking-title); }
.skx-theme { margin-left: auto; }

/* ---------- skx-footer: site footer for a web app ----------
   Why: the kit's .sk-made sits in a panel footer; a page needs a full-width bar. The mark and "Made by SKILLMERC"
   keep the kit's place: the first thing in the last line. */
.skx-footer { 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-5); border-top: 1px solid var(--sk-line); background: var(--sk-bg-sunken); font-size: var(--sk-text-xs); color: var(--sk-text-muted); }
.skx-footer__privacy { color: var(--sk-text-muted); }
/* The mark's own tile is the darkest neutral, the same as the dark footer: a hairline keeps its edge visible. (Kit note: sk-mark on a dark sunken surface.) */
.skx-footer .sk-mark { border-radius: var(--sk-radius-sm); box-shadow: 0 0 0 1px var(--sk-line); }

/* ---------- skx-welcome: first-run headline ----------
   Why: the kit's .sk-empty is a dashed box for a panel; a first visit to a page needs a calm headline, one
   sentence and the privacy line. Uses --sk-text-xl, which the kit reserves for "first-run headline". */
.skx-welcome { display: flex; flex-direction: column; gap: var(--sk-space-3); max-width: 680px; }
.skx-welcome__title { font-size: var(--sk-text-xl); text-wrap: balance; }
.skx-welcome__title--small { font-size: var(--sk-text-lg); }
.skx-welcome__body { font-size: var(--sk-text-md); color: var(--sk-text-muted); }
.skx-privacy { display: inline-flex; align-items: center; gap: var(--sk-space-2); font-size: var(--sk-text-sm); color: var(--sk-text); font-weight: var(--sk-weight-strong); }
.skx-privacy .skx-icon { color: var(--sk-accent); }
.skx-start { display: flex; flex-direction: column; gap: var(--sk-space-6); }

/* ---------- skx-drop: file drop zone ----------
   Why: no drop target in the kit. A dashed box (the kit's empty-state border) that turns to the accent while a
   file is over it (.is-over, set by the app on dragenter). The file button inside is the keyboard path. */
.skx-drop { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sk-space-2); padding: var(--sk-space-8) var(--sk-space-5); border: 2px dashed var(--sk-line-strong); border-radius: var(--sk-radius-lg); background: var(--sk-bg-sunken); transition: border-color var(--sk-fast) var(--sk-ease), background-color var(--sk-fast) var(--sk-ease); }
.skx-drop.is-over { border-color: var(--sk-accent); background: var(--sk-accent-soft); }
.skx-drop__icon { width: 28px; height: 28px; color: var(--sk-accent); }
.skx-drop__title { font-size: var(--sk-text-md); font-weight: var(--sk-weight-title); }
.skx-drop__hint { color: var(--sk-text-muted); max-width: 520px; }
.skx-file { margin-top: var(--sk-space-2); }
.skx-file:focus-within { box-shadow: var(--sk-focus-ring); }

/* ---------- skx-sample: sample-data buttons ----------
   Why: the kit's buttons hold one label; a sample needs a name and a one-line note, as a card you press. */
.skx-samples { display: flex; flex-direction: column; gap: var(--sk-space-3); }
.skx-samples__title { font-size: var(--sk-text-sm); font-weight: var(--sk-weight-strong); color: var(--sk-text-muted); }
.skx-samples__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sk-space-3); }
.skx-sample { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sk-space-1); 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); color: var(--sk-text); font: inherit; text-align: left; cursor: pointer; transition: border-color var(--sk-fast) var(--sk-ease), background-color var(--sk-fast) var(--sk-ease); }
.skx-sample:hover { border-color: var(--sk-accent); background: var(--sk-accent-soft); }
.skx-sample__name { font-weight: var(--sk-weight-strong); }
.skx-sample__note { font-size: var(--sk-text-xs); color: var(--sk-text-muted); }

/* ---------- skx-progress: progress with cancel ----------
   Why: the kit has a busy button but no progress bar. A long read shows the share done and a Cancel button. */
.skx-progress { display: flex; flex-direction: column; gap: var(--sk-space-2); padding: var(--sk-space-4); border: 1px solid var(--sk-line); border-radius: var(--sk-radius-lg); background: var(--sk-surface); }
.skx-progress__row { display: flex; align-items: center; gap: var(--sk-space-3); }
.skx-progress__label { flex: 1 1 auto; min-width: 0; font-weight: var(--sk-weight-strong); overflow-wrap: anywhere; }
.skx-progress__track { height: 8px; border-radius: var(--sk-radius-pill); background: var(--sk-bg-sunken); border: 1px solid var(--sk-line); overflow: hidden; }
.skx-progress__bar { height: 100%; width: 0; background: var(--sk-accent); transition: width var(--sk-base) var(--sk-ease); }
/* task 1191: packing an Excel file has no steps to count, so the bar moves to show work goes on, without a number */
.skx-progress__bar--busy { width: 30%; animation: skx-busy 1.6s var(--sk-ease) infinite alternate; }
@keyframes skx-busy { from { margin-left: 0; } to { margin-left: 70%; } }
@media (prefers-reduced-motion: reduce) { .skx-progress__bar--busy { animation: none; width: 100%; opacity: 0.5; } }
.skx-save__progress { margin-top: var(--sk-space-3); }

/* ---------- skx-grid and skx-tableview: a wide data table ----------
   Why: the kit's .sk-table fits a panel; a data app shows dozens of columns. The wrap scrolls both ways inside a
   fixed height, the header stays on top, and the row number column stays on the left. */
.skx-tableview { display: flex; flex-direction: column; gap: var(--sk-space-3); }
.skx-tableview__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sk-space-2) var(--sk-space-4); }
.skx-tableview__name { font-size: var(--sk-text-md); font-weight: var(--sk-weight-title); overflow-wrap: anywhere; }
.skx-tableview__actions { display: flex; gap: var(--sk-space-2); margin-left: auto; }
.skx-grid { max-height: 60vh; }
.skx-grid .sk-table th.skx-rownum, .skx-grid .sk-table td.skx-rownum { position: sticky; left: 0; background: var(--sk-bg-sunken); color: var(--sk-text-faint); text-align: right; width: 1%; }
.skx-grid .sk-table th.skx-rownum { z-index: 2; }
.skx-grid .sk-table td.skx-changed { background: var(--sk-accent-soft); }

/* ---------- skx-fixes: list of proposed fixes, each with its reason ---------- */
.skx-fixes { display: flex; flex-direction: column; gap: var(--sk-space-2); }
.skx-fixes__title { font-size: var(--sk-text-sm); font-weight: var(--sk-weight-strong); color: var(--sk-text-muted); }
.skx-fix { display: flex; flex-direction: column; gap: var(--sk-space-1); padding: var(--sk-space-2) var(--sk-space-3); border: 1px solid var(--sk-line); border-radius: var(--sk-radius); background: var(--sk-surface); }
/* One layout for every card (HQ 23 Nov): the head line (badge, then the column) and the reason always on its own line. */
.skx-fix__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sk-space-2); min-width: 0; }
.skx-fix__col { font-weight: var(--sk-weight-strong); min-width: 0; overflow-wrap: anywhere; }
.skx-fix__reason { color: var(--sk-text-muted); min-width: 0; overflow-wrap: anywhere; }
.skx-fix__choices { display: flex; flex-wrap: wrap; gap: var(--sk-space-2) var(--sk-space-5); padding-top: var(--sk-space-1); }
.skx-fix__result { color: var(--sk-text); }
.skx-fix__actions { display: flex; flex-wrap: wrap; gap: var(--sk-space-2); padding-top: var(--sk-space-1); } /* task 1189: open another sheet or table */
.skx-fix__eg { font-family: var(--sk-mono); font-size: var(--sk-text-xs); color: var(--sk-text); }

/* ---------- skx-save: the save step under the fixes ----------
   Why: the kit has buttons and a select but no row that keeps a select next to its own button. Save as CSV and
   its separator stay together when the row wraps on a phone. */
.skx-save { display: flex; flex-direction: column; gap: var(--sk-space-2); 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-save__title { font-size: var(--sk-text-md); font-weight: var(--sk-weight-title); margin: 0; }
.skx-save__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sk-space-2); }
.skx-save__csv { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sk-space-1); min-width: 0; }
.skx-save__sep { display: inline-flex; min-width: 0; max-width: 100%; }
.skx-save__sep .sk-select { width: auto; max-width: 100%; }

/* ---------- skx-errorpage: a whole page that says what went wrong and the way back ---------- */
.skx-errorpage { display: flex; flex-direction: column; gap: var(--sk-space-3); max-width: 560px; padding-top: var(--sk-space-10); }
.skx-errorpage__code { font-family: var(--sk-mono); font-size: var(--sk-text-2xl); color: var(--sk-accent); font-weight: var(--sk-weight-strong); }

@media (max-width: 420px) {
  .skx-main { padding: var(--sk-space-5) var(--sk-space-4) var(--sk-space-8); }
  .skx-header, .skx-footer { padding-left: var(--sk-space-4); padding-right: var(--sk-space-4); }
  .skx-drop { padding: var(--sk-space-6) var(--sk-space-4); }
  .skx-tableview__actions { margin-left: 0; width: 100%; }
}
