:root {
  --paper: #f3f3f1;
  --sheet: #ffffff;
  --ink: #171715;
  --copy: #484743;
  --muted: #6f6d66;
  --line: #cfcbc0;
  --field: #888888;
  --focus: #2865d9;
  --danger-bg: #f5e3df;
  --danger-ink: #7a3029;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  padding: 18px;
  background: var(--paper);
  color: var(--copy);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.post-nav,
.post-page,
.post-footer {
  width: min(1100px, 100%);
  margin-inline: auto;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--sheet);
}

.post-brand {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-decoration: none;
  text-transform: uppercase;
}

.post-nav div {
  display: flex;
  gap: 14px;
  align-items: center;
}

.post-nav div a {
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 4px;
}

.post-page {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.post-aside,
.post-document {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--sheet);
}

.post-aside {
  align-self: start;
  padding: 18px;
}

.post-aside strong,
.post-aside nav > span {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.post-aside p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.post-aside nav {
  display: grid;
  gap: 9px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.post-aside nav a {
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 4px;
}

.post-warning {
  margin-top: 22px;
  padding: 13px;
  border: 1px solid #8a4a35;
  border-radius: 3px;
  background: var(--danger-bg);
  color: var(--danger-ink);
}

.post-warning strong {
  color: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.post-document { min-width: 0; }

.post-section {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 18px;
}

.post-section:last-child { border-bottom: 0; }

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

h1,
h2,
h3 { color: var(--ink); }

h1 {
  max-width: 16ch;
  margin-bottom: 10px;
  font-size: clamp(42px, 7vw, 64px);
  line-height: 1;
  letter-spacing: -.04em;
}

h2 {
  margin-bottom: 14px;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -.025em;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.post-lead {
  max-width: 68ch;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 16px;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-action,
.copy-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--sheet);
  font: 700 13px var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.post-action.secondary {
  background: transparent;
  color: var(--ink);
}

.post-action:hover,
.copy-button:hover { background: #8a4a35; }

.post-action.secondary:hover { background: var(--paper); }

.post-steps {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.post-steps li {
  position: relative;
  padding: 14px 0 14px 42px;
  border-top: 1px solid var(--line);
  counter-increment: steps;
}

.post-steps li::before {
  position: absolute;
  top: 15px;
  left: 0;
  color: var(--muted);
  content: counter(steps, decimal-leading-zero);
  font: 700 11px/1.4 var(--mono);
}

.post-steps p { margin-bottom: 0; }

.protocol {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.protocol th,
.protocol td {
  padding: 10px 8px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.protocol th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

code,
pre { font-family: var(--mono); }

code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: .92em;
}

pre {
  margin: 14px 0 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--field);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.prompt-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.copy-button { min-height: 44px; }

.copy-status {
  min-height: 1.5em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.rule-list {
  margin: 0;
  padding-left: 20px;
}

.rule-list li + li { margin-top: 7px; }

.post-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 4px;
  color: var(--muted);
  font: 700 11px/1.4 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  body { padding: 8px; }
  .post-nav {
    align-items: flex-start;
    flex-direction: column;
  }
  .post-nav div {
    width: 100%;
    justify-content: space-between;
  }
  .post-page { grid-template-columns: 1fr; }
  .post-aside { position: static; }
  .post-section { padding: 18px; }
  .post-actions { align-items: stretch; flex-direction: column; }
  .post-action { width: 100%; }
  .protocol,
  .protocol tbody,
  .protocol tr,
  .protocol th,
  .protocol td { display: block; }
  .protocol thead { display: none; }
  .protocol tr { padding: 10px 0; border-top: 1px solid var(--line); }
  .protocol td { padding: 3px 0; border: 0; }
  .protocol td::before {
    display: block;
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .prompt-head { align-items: stretch; flex-direction: column; }
  .copy-button { width: 100%; }
  .post-footer { flex-direction: column; }
}
