/* Reset, page frame, and the .btn pattern shared across tools. Depends on
   the custom properties declared in lib/tokens.css (link that first); each
   tool's own styles.css is linked after this file, so it can still override. */

/* ---- reset ----------------------------------------------------------------- */
* { box-sizing: border-box; }
/* The hidden attribute must always win over the display rules below. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---- page frame ------------------------------------------------------------ */
.page {
  max-width: 52rem;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-8);
}
.page-head h1 { margin: 0 0 var(--space-2); font-size: var(--text-xl); }
.lede { margin: 0; color: var(--text-dim); }

/* ---- buttons ------------------------------------------------------------- */
.btn {
  font: inherit;
  font-size: var(--text-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-h);
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover { opacity: 0.85; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn.sm { height: 32px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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