/* Copyright (c) 2026 Michael D Henderson. */
/* SPDX-License-Identifier: AGPL-3.0-or-later */

:root {
  --fg: #1d1d1f;
  --bg: #fdfdfb;
  --muted: #6b6b70;
  --ok: #1f6f3a;
  --error: #a8261b;
  --rule: #d8d8d4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e8e4;
    --bg: #18181a;
    --muted: #9a9aa0;
    --ok: #6fcf8e;
    --error: #f08a7e;
    --rule: #3a3a3e;
  }
}

body {
  margin: 0 auto;
  max-width: 48rem;
  padding: 1rem;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
}

a { color: inherit; }

header, footer {
  padding: 0.5rem 0;
  color: var(--muted);
}

header { border-bottom: 1px solid var(--rule); }
footer { border-top: 1px solid var(--rule); margin-top: 2rem; font-size: 0.875rem; }

.ok { color: var(--ok); }
.error { color: var(--error); }
.muted { color: var(--muted); font-size: 0.875rem; }

dt { font-family: ui-monospace, monospace; }
dd { margin: 0 0 0.5rem 1.5rem; }

header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
nav { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }

form.inline { display: inline; }
form.stack { display: flex; flex-direction: column; gap: 0.75rem; max-width: 24rem; }
form.stack label { display: flex; flex-direction: column; gap: 0.25rem; }
form.stack label:has(input[type=checkbox]) { flex-direction: row; align-items: center; }
form.stack button { align-self: flex-start; }

input, button { font: inherit; color: inherit; }
input { background: var(--bg); border: 1px solid var(--rule); padding: 0.25rem 0.5rem; }
input[type=number] { width: 4rem; }
input.link { width: 100%; font-family: ui-monospace, monospace; font-size: 0.875rem; }
button { background: none; border: 1px solid var(--rule); padding: 0.25rem 0.75rem; cursor: pointer; }
header button { padding: 0 0.5rem; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.375rem 0.5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }

.output {
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid var(--rule);
  padding: 0 0.75rem;
  margin-bottom: 0.75rem;
}
.output pre { white-space: pre-wrap; margin: 0.5rem 0; }
.output pre.echo { color: var(--muted); margin-bottom: 0; }
.prompt { margin: 0.5rem 0 0.25rem; font-family: ui-monospace, monospace; }
.prompt:empty { display: none; }
form.command { display: flex; gap: 0.5rem; }
form.command input { flex: 1; font-family: ui-monospace, monospace; }

form.editor { max-width: none; border: 1px solid var(--rule); padding: 0.75rem; margin-bottom: 0.75rem; }
form.editor h2 { font-size: 1rem; margin: 0; }
form.editor fieldset { border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 0.25rem; margin: 0; }
textarea, select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--rule); }
textarea { font-family: ui-monospace, monospace; width: 100%; box-sizing: border-box; }

.doc code { font-family: ui-monospace, monospace; font-size: 0.875em; }
.doc pre { overflow-x: auto; border: 1px solid var(--rule); padding: 0.5rem 0.75rem; }
.doc pre code { font-size: 0.875rem; }
.doc table { display: block; overflow-x: auto; }
