/* Element defaults. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

body {
  margin: 0;
}

h1,
h2 {
  margin: 0;
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 1.15rem;
}

h2 {
  font-size: 1rem;
}

p {
  margin: 0 0 0.75rem;
}

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

hr {
  margin: 0.4rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.93em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

th,
td {
  padding: 0.4rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

thead th {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  background: var(--table-head);
}

tbody tr:last-child > * {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--row-hover);
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 0.35rem 0.6rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

textarea {
  resize: vertical;
}

/* A list to pick several from shows enough of itself to be read without scrolling much. */
select[multiple] {
  min-height: 12rem;
  padding: 0.2rem;
}

input:read-only,
textarea:read-only {
  color: var(--text-muted);
  background: var(--bg);
}

/* Buttons are neutral by default; the one main action of a page or dialog is .primary. */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--control-height);
  padding: 0.3rem 0.8rem;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--row-hover);
}

button.primary {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

button.primary:hover:not(:disabled) {
  background: var(--accent);
  filter: brightness(1.08);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}
