:root {
  --bg: #f3efe6;
  --surface: #fffdf8;
  --ink: #1c1914;
  --muted: #6d655c;
  --line: #ddd4c7;
  --accent: #9a3412;
  --accent-ink: #fff7ed;
  --ok: #0f766e;
  --warn: #9a6700;
  --bad: #b42318;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "HarmonyOS Sans SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Sarasa Term SC", Consolas, monospace;
}

* { box-sizing: border-box; }
* { font-feature-settings: "kern" 1, "liga" 1; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.shell { max-width: 42rem; margin: 0 auto; padding: 24px 20px 64px; }
.shell:has(.wide) { max-width: 68rem; }
.wide { max-width: none; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 28px;
}
.brand {
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
}
.top nav a, .linkish {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
h1, h2 {
  font-weight: 650;
  letter-spacing: 0;
  margin: 0 0 8px;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.15rem; margin-bottom: 12px; }
.lead, .muted { color: var(--muted); }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}
label { display: block; margin: 12px 0 6px; color: var(--muted); }
input, select, textarea, button {
  font: inherit;
  border-radius: 8px;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 10px;
  color: var(--ink);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, white);
  outline-offset: 2px;
}
input:invalid:not(:placeholder-shown), textarea:invalid:not(:placeholder-shown) {
  border-color: var(--bad);
}
textarea { font-family: var(--mono); font-size: 13px; }
button {
  min-height: 44px;
  margin-top: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  padding: 8px 14px;
  cursor: pointer;
}
button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.err { color: var(--bad); margin-top: 12px; }
.warn { color: var(--warn); }
.field-help { color: var(--muted); font-size: .9rem; margin: 4px 0 8px; }
.noscript { max-width: 65ch; margin: 16px auto; padding: 0 20px; color: var(--bad); }
.page-head { margin-bottom: 20px; }
.usage-line { font-variant-numeric: tabular-nums; font-size: 1.2rem; margin: 0 0 10px; }
.bar {
  height: 8px;
  background: #ece6db;
  border-radius: 4px;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 500;
}
.stack { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row input { flex: 1; }
.list, .notes { padding-left: 1.1rem; }
.list li { margin: 8px 0; }
.code {
  font-family: var(--mono);
  font-size: 13px;
  background: #f6f1e8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 16px;
  align-items: end;
}
.grid-form .span2 { grid-column: 1 / -1; }
.grid-form button { margin-top: 0; }
.inline {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}
.inline input { width: auto; flex: 1; min-width: 12rem; }
.inline button { margin-top: 0; }
.status-ok { color: var(--ok); }
.status-bad { color: var(--bad); }
.status-warn { color: var(--warn); }

@media (max-width: 620px) {
  .shell { padding: 16px 14px 48px; }
  .panel { padding: 16px; }
  h1 { font-size: 1.45rem; }
  .inline { align-items: stretch; }
  .inline input { min-width: 100%; }
  .inline button { width: 100%; }
  th, td { padding-right: 14px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
