:root {
  --bg: #faf9f5;
  --surface: #fff;
  --text: #1f1e1d;
  --muted: #7c7869;
  --accent: #d97757;
  --border: #e3e0d6;
  --error: #b54a3a;
  font-family:
    ui-sans-serif,
    -apple-system,
    'Segoe UI',
    sans-serif;
  color: var(--text);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}
.wrap {
  max-width: 980px;
  margin: auto;
  padding: 28px 20px 72px;
}
header,
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
header span {
  color: var(--muted);
}
h1 {
  font-size: 28px;
  margin: 24px 0 6px;
}
h2 {
  font-size: 20px;
  margin: 0 0 12px;
}
h3 {
  font-size: 16px;
  margin: 20px 0 8px;
}
a {
  color: #aa4a2c;
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
p {
  margin: 10px 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}
.badge {
  display: inline-block;
  border-radius: 20px;
  padding: 3px 10px;
  background: #f5e6df;
  color: #853b23;
  font-size: 13px;
}
nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px 0;
}
button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font: inherit;
  padding: 10px 15px;
  cursor: pointer;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.secondary,
nav button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
nav button[aria-pressed='true'] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.danger {
  background: var(--error);
}
input,
select {
  font: inherit;
  max-width: 100%;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
  color: var(--text);
}
label {
  display: block;
  margin: 12px 0 5px;
}
form > button {
  margin-top: 16px;
}
fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 16px 0;
  padding: 12px;
}
fieldset label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
}
input[type='checkbox'] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
code,
pre {
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
code {
  overflow-wrap: anywhere;
}
pre {
  background: #f4f2ed;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 8px;
  overflow: auto;
  max-height: 480px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
td code {
  font-size: 12px;
}
details {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 16px;
}
summary {
  cursor: pointer;
  font-weight: 600;
}
dialog {
  width: min(620px, calc(100% - 32px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop {
  background: #1f1e1d70;
}
#notice.error {
  color: var(--error);
}
#notice:empty {
  display: none;
}
:focus-visible {
  outline: 3px solid #d9775780;
  outline-offset: 3px;
}
.key {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.key p {
  margin: 5px 0;
}
.key small {
  color: var(--muted);
}
@media (max-width: 600px) {
  .wrap {
    padding: 18px 14px 48px;
  }
  .card {
    padding: 16px;
  }
  h1 {
    font-size: 24px;
  }
  .row {
    align-items: flex-start;
  }
  .row button {
    max-width: 100%;
  }
  header {
    font-size: 14px;
  }
  nav button {
    flex: 1;
    padding: 10px;
  }
  dialog {
    padding: 18px;
  }
}
