/*
 * Base (issue #43): minimal reset + element defaults on the token system —
 * typography (system font stack), links with visible focus, form controls,
 * table normalization. Visual treatments that are a choice (not a default)
 * are opt-in classes in components.css.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--ink);
  background: var(--paper);
}

h1 {
  font-size: var(--text-xl);
  margin: var(--space-2) 0 var(--space-4);
}

h2 {
  font-size: var(--text-lg);
  margin: var(--space-6) 0 var(--space-2);
}

a {
  color: var(--accent);
}

/* Keyboard focus stays visible everywhere (WCAG 2.4.7); pointer users are
   unaffected thanks to :focus-visible. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

summary {
  cursor: pointer;
}

code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-1);
  font-size: 0.9em;
}

.hint {
  color: var(--muted);
}

/* Form controls */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  font: inherit;
  color: inherit;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  min-width: 18rem;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* Tables: normalization only — the bordered treatment is .table */

table {
  border-collapse: collapse;
  font: inherit;
}

th {
  text-align: left;
}

/* Description lists (detail screens) */

dl {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-4) 0;
}

dt {
  color: var(--muted);
  font-weight: var(--weight-semibold);
}

dd {
  margin: 0;
}
