/* SPEC-197 FR-2, FR-6, SD-5: the composite app kit's styling. The tokens are the launchpad's (SPEC-196 v1.1.0), light and
   dark from data-theme on <html> (set by boot.js before the first paint); WCAG AA contrast in both. Apps style their own
   content with these tokens; the shared parts (header, menu, buttons, fields, dialog, tabs, tiles, states, toasts) are here. */
@import url("frame.css");


* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--kit-bg);
  color: var(--kit-text);
  min-height: 100vh;
}
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--kit-accent); outline-offset: 2px; }

/* Tabs below the header */
.kit-tabs {
  display: flex; gap: 4px; padding: 0 24px; background: var(--kit-shell); border-bottom: 1px solid var(--kit-line);
  overflow-x: auto; position: sticky; top: var(--kit-header-height); z-index: 15;
}
.kit-tab {
  padding: 12px 14px 10px; color: var(--kit-muted); text-decoration: none; font-weight: 600; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.kit-tab:hover { color: var(--kit-text); }
.kit-tab[aria-selected="true"] { color: var(--kit-accent); border-bottom-color: var(--kit-accent); }

/* Page */
.kit-main { max-width: calc(6 * var(--kit-tile) + 5 * var(--kit-gap) + 48px); margin: 0 auto; padding: 32px 24px 48px; }
.kit-main h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.01em; }
.kit-lead { color: var(--kit-muted); margin: 0 0 24px; }
.kit-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.kit-section-title { font-size: 15px; font-weight: 650; margin: 0 0 12px; color: var(--kit-muted); }
.kit-signin { max-width: 520px; margin: 80px auto; text-align: center; }
.kit-signin p { color: var(--kit-muted); margin-bottom: 28px; }

/* Tiles: standard 1 × 1, wide 2 × 1 */
.kit-tiles { display: grid; grid-template-columns: repeat(auto-fill, var(--kit-tile)); grid-auto-rows: var(--kit-tile); gap: var(--kit-gap); }
.kit-tile {
  position: relative; display: flex; flex-direction: column; padding: 16px; background: var(--kit-surface);
  border: 1px solid var(--kit-line); border-radius: var(--kit-radius); box-shadow: var(--kit-shadow); color: var(--kit-text);
  text-decoration: none; overflow: hidden; transition: box-shadow 120ms ease, border-color 120ms ease;
}
.kit-tile.wide { grid-column: span 2; }
a.kit-tile:hover { box-shadow: var(--kit-shadow-hover); border-color: var(--kit-accent); }
.kit-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: var(--kit-accent-soft); color: var(--kit-accent);
}
.kit-icon svg { width: 22px; height: 22px; fill: none; stroke: currentcolor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Primitives */
.kit-table { width: 100%; border-collapse: collapse; }
.kit-table th, .kit-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--kit-line); }
.kit-table th { color: var(--kit-muted); font-weight: 600; font-size: 13px; }

/* States */
.kit-empty { color: var(--kit-muted); padding: 24px; border: 1px dashed var(--kit-line); border-radius: var(--kit-radius); text-align: center; }
.kit-empty p { margin: 0 0 16px; }


/* Learn (guide-kit, SPEC-178) inside the kit. guide-kit colours its panel, bubbles and buttons with the portal's variable
   names; here they are the kit's tokens, so Learn follows the kit's light and dark theme. Without these the panel has no
   background (seen in the SPEC-197 walk: the page showed through while the panel slid in). test/appKit/web.test.ts checks
   that every variable guide.css reads is given here or by guide.css itself. */
:root {
  --page: var(--kit-bg);
  --surface: var(--kit-surface);
  --wash: var(--kit-bg);
  --ink: var(--kit-text);
  --ink-2: var(--kit-text);
  --muted: var(--kit-muted);
  --border: var(--kit-line);
  --grid: var(--kit-line);
  --critical: var(--kit-error);
  --good: var(--kit-ok);
}
/* Its docked lesson column starts below the header, never over it. */
.guide-panel.docked {
  top: calc(var(--kit-header-height) + 8px) !important;
  max-height: calc(100vh - var(--kit-header-height) - 20px) !important;
}

@media (max-width: 640px) {
  :root { --kit-tile: 148px; --kit-gap: 12px; }
  .kit-tabs { padding: 0 12px; }
  .kit-main { padding: 24px 12px; }
}
