:root {
  color-scheme: light;
  --ink: #211e19;
  --secondary: #554f44;
  --accent: #28503d;
  --line: #cfc5b5;
  --canvas: #f5f0e6;
  --panel: #fffcf5;
  --well: #f4efdf;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 1rem/1.55 system-ui, sans-serif;
}

.wrap { width: min(100% - 3.5rem, 75rem); margin-inline: auto; }

.skip-link {
  position: absolute;
  z-index: 2;
  inset: 0 auto auto 1rem;
  background: var(--panel);
  padding: .7rem;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }
a { color: var(--accent); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.masthead { border-bottom: 1px solid var(--line); }

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  gap: .75rem 1rem;
  padding-block: .55rem;
}

.wordmark {
  color: var(--accent);
  font: bold clamp(1.16rem, 2.3vw, 1.5rem)/1.2 var(--serif);
  letter-spacing: -.035em;
}

.guide-link { font-size: .9rem; font-weight: 650; }
.intro { padding-block: clamp(2.05rem, 6vw, 4.2rem) clamp(1.65rem, 4.3vw, 3.3rem); }

h1, h2, h3, p { margin: 0; }

h1 {
  font: 550 clamp(3.1rem, 8.2vw, 7rem)/.96 var(--serif);
  letter-spacing: -.067em;
}

h1 em { color: var(--accent); font-weight: 500; }
.intro > p { margin-top: 1rem; max-width: 35rem; color: var(--secondary); font-size: clamp(1.04rem, 2vw, 1.2rem); }
.notice { border: 1px solid var(--line); background: var(--panel); padding: .75rem; margin-bottom: 1rem; }

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 3vw, 1.65rem);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-block-start: 3px solid var(--accent);
  background: var(--panel);
  padding: clamp(1rem, 3.2vw, 1.6rem);
}

.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: .5rem; min-height: 2.65rem; }
h2 { font: 550 clamp(1.48rem, 3.2vw, 2rem)/1.15 var(--serif); letter-spacing: -.04em; }
h3 { font-size: .95rem; line-height: 1.4; font-weight: 680; }
.hint { color: var(--secondary); font-size: .91rem; }
#input-help, #summary { margin: .4rem 0 1rem; }
#preview-heading, #details-heading { margin-bottom: .45rem; }
.preview-note { margin-block: .55rem 1.15rem; }

button {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: .22rem;
  padding: .46rem .68rem;
  font: inherit;
  font-size: .9rem;
  line-height: 1.28;
  cursor: pointer;
  min-height: 2.5rem;
}

button:hover:not(:disabled), button[aria-pressed="true"] { background: #e8eddf; border-color: var(--accent); }
button:disabled { color: var(--secondary); opacity: .7; cursor: default; }
.quiet-button { border-color: transparent; }

textarea {
  display: block;
  width: 100%;
  min-height: 11.5rem;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: .2rem;
  background: #fffdf7;
  color: var(--ink);
  padding: .9rem;
  font: 1rem/1.55 var(--mono);
}

textarea::placeholder { color: var(--secondary); opacity: 1; }
.examples { margin-top: 1.15rem; }
.example-buttons { display: flex; flex-wrap: wrap; margin-top: .5rem; gap: .42rem; }
.example-note { color: var(--secondary); font-size: .91rem; margin-top: .6rem; }
.example-note:empty, #row-note:empty { display: none; }

.preview {
  background: var(--well);
  margin: 0;
  padding: .75rem;
  border: 1px solid var(--line);
  min-height: 5.6rem;
  max-height: 20rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
  font: .92rem/1.6 var(--mono);
}

.preview samp { font: inherit; }
.table-wrap { max-height: 24rem; overflow: auto; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: start; font-size: .87rem; }
th, td { padding: .48rem .35rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--secondary); font-weight: 650; }
th:nth-child(1) { width: 19%; }
th:nth-child(2) { width: 26%; }
td:first-child, td:nth-child(2) { font: .85rem/1.55 var(--mono); }
#row-note { margin-top: .6rem; }
.footer { color: var(--secondary); font-size: .85rem; padding-block: 2rem; }

@media (max-width: 47rem) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .desktop-break { display: none; }
}

@media (max-width: 30rem) {
  .wrap { width: calc(100% - 2rem); }
  .masthead-inner { min-height: 3.9rem; }
  .guide-link { font-size: .8rem; text-align: end; }
  .panel { padding: .9rem; }
  th, td { padding-inline: .22rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.masthead-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .35rem 1.2rem;
}

.editorial-grid,
#preflight + .workbench { align-items: stretch; }

.editorial p + p,
#preflight + .workbench .panel p + p { margin-top: .8rem; }

.fixture-list { margin: 1rem 0; }
.fixture-list dt { font-weight: 700; }
.fixture-list dd { margin: .18rem 0 .85rem; }

@media (max-width: 30rem) {
  .masthead-nav { gap: .2rem .75rem; }
}
