/* ==========================================================================
   Tools Suite — canonical theme
   --------------------------------------------------------------------------
   THIS FILE IS THE SINGLE SOURCE OF TRUTH for the visual language of the
   qqshi13.github.io developer tools (tools-suite, collaboard, flow,
   bsod-studio). Edit it here and nowhere else.

   Consumers do NOT load this file over the network. Each site vendors a pinned
   copy at theme/theme.css, verified against theme/theme.sha256, and refreshes
   it with:

       npm run theme          # scripts/sync-theme.mjs

   Never edit a vendored copy: `npm run theme` overwrites it, and CI fails on
   drift. To ship a change: edit this file, commit + deploy tools-suite, then
   re-pin and re-vendor in each consumer.

   Scope: design tokens + shared primitives only — no page layout.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #21262d;
  --border: #30363d;
  --text: #c9d1d9;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --success: #238636;
  --warning: #d29922;
  --error: #da3633;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, 'SFMono-Regular', Consolas, monospace;
}

/* --------------------------------------------------------------------------
   Reset + base typography
   -------------------------------------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Focus, selection, scrollbars
   -------------------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::selection { background: var(--accent); color: var(--bg); }

/* Colour only — the scrollbar keeps its native width, so nothing reflows. */
* { scrollbar-color: var(--border) transparent; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-hover);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover { background: var(--border); }

.btn.primary,
.btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-icon:hover { color: var(--accent); border-color: var(--accent); }

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* The `.panel` the tools repeat is a split-pane column container: its header
   and body paint their own surfaces, so this stays layout-neutral. */
.panel { display: flex; flex-direction: column; }

/* --------------------------------------------------------------------------
   Badge
   -------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   Screen-reader-only
   -------------------------------------------------------------------------- */
.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
