/* reset.css — replaces PicoCSS. Minimal base styles only.
 * Load before tokens.css and components.css. */

/* ── Box model ───────────────────────────────────────────── */

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

/* ── Base ────────────────────────────────────────────────── */

body {
  margin: 0;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5rem; line-height: 1.2; }
p  { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

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

small  { font-size: 0.8em; }
strong { font-weight: 600; }
hr     { border: none; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* ── Nav ─────────────────────────────────────────────────── */

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  border-bottom: 1px solid var(--line);
}

header nav ul {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

header nav a {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-3);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: var(--r-chip);
  transition: color 0.1s;
}

header nav a:hover { color: var(--ink); }

/* ── Form labels ─────────────────────────────────────────── */

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 1rem;
}

label > input,
label > select,
label > textarea { margin-top: 0.35rem; }

/* Checkbox/radio inline with label text */
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 400;
}

/* ── Inputs ──────────────────────────────────────────────── */

input,
select,
textarea {
  display: block;
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  outline: none;
  margin: 0;
  transition: border-color 0.1s, box-shadow 0.1s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px var(--rust-soft);
}

textarea { resize: vertical; line-height: 1.5; }

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238C8F97' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  display: inline-block;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

[hidden] { display: none !important; }

input[type="color"] {
  padding: 2px;
  cursor: pointer;
}

/* ── Buttons ─────────────────────────────────────────────── */

button,
[role="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--r-input);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  -webkit-appearance: none;
}

button:hover,
[role="button"]:hover { background: var(--ink-2); }

button:disabled,
[role="button"][aria-disabled="true"] { opacity: 0.4; cursor: default; }

button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 2px;
}

/* Small — compact height for inline/header use */
button.btn-sm,
a.btn-sm {
  height: auto;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Log action — rust primary, the brand signal */
button.btn-log,
a.btn-log {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--bg);
}
button.btn-log:hover,
a.btn-log:hover {
  background: var(--rust-deep);
  border-color: var(--rust-deep);
}

/* Ghost — transparent, for secondary actions */
button.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
  font-weight: 500;
}
button.btn-ghost:hover { background: var(--line-soft); }

/* Outline secondary — used for destructive / low-priority actions */
button.outline.secondary,
button.secondary.outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-3);
}
button.outline.secondary:hover,
button.secondary.outline:hover {
  border-color: var(--ink-3);
  color: var(--ink-2);
  background: transparent;
}

/* ── Tables ──────────────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 0.55rem 1rem;
  text-align: left;
  background: var(--line-soft);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1.5px solid var(--line);
}

tbody td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  vertical-align: middle;
}

/* ── Details / Summary ───────────────────────────────────── */

details { margin-bottom: 1rem; }

details > summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 0.75rem; }
