/*
 * One stylesheet, no preprocessor.
 *
 * The colours come from the author's vault palette, the same one the Mermaid
 * diagrams in docs/ use, so a screenshot of the panel and a diagram of the
 * estate sit next to each other without clashing.
 */

:root {
  --ink: #1e1e1e;
  --paper: #fdfdfd;
  --rule: #d9d9d9;
  --muted: #6b6b6b;
  --accent: #1971c2;
  --accent-soft: #e7f5ff;
  --warn: #e8590c;
  --warn-soft: #fff4e6;
  --bad: #c92a2a;
  --bad-soft: #fff5f5;
  --good: #2f9e44;
  --good-soft: #ebfbee;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9e9e9;
    --paper: #1a1b1e;
    --rule: #373a40;
    --muted: #909296;
    --accent: #4dabf7;
    --accent-soft: #1c2a3a;
    --warn: #ff922b;
    --warn-soft: #34291c;
    --bad: #ff6b6b;
    --bad-soft: #3a1f1f;
    --good: #51cf66;
    --good-soft: #1e2f22;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#app {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 6rem;
}

header.bar {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

header.bar h1 {
  font-size: 1.1rem;
  margin: 0;
  letter-spacing: 0.02em;
}

nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-left: auto;
}

nav button,
button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

nav button[aria-current="page"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

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

button.danger {
  border-color: var(--bad);
  color: var(--bad);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

h2 {
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

p.intent {
  color: var(--muted);
  max-width: 46rem;
  margin: 0 0 1.5rem;
}

section.card {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 1.1rem;
}

label .name {
  display: block;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

label .help {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  max-width: 46rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  font: inherit;
  width: 100%;
  max-width: 34rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

textarea {
  min-height: 5rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}

label.wrong input,
label.wrong textarea,
label.wrong select {
  border-color: var(--bad);
}

.problem {
  color: var(--bad);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.7rem 0.9rem;
  border-radius: 0 4px 4px 0;
  margin: 0 0 1rem;
}

.note.warn {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.note.bad {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.note.good {
  border-color: var(--good);
  background: var(--good-soft);
}

pre.command {
  font-family: var(--mono);
  font-size: 0.86rem;
  background: var(--accent-soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}

ol.steps {
  padding-left: 1.2rem;
}

ol.steps li {
  margin-bottom: 1.4rem;
}

.where {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05rem 0.4rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.where.panel {
  border-color: var(--accent);
  color: var(--accent);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.94rem;
}

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

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
}

iframe.embed {
  width: 100%;
  height: 32rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
}

form.centred {
  max-width: 24rem;
  margin: 4rem auto;
}
