/* Human Mailbox — shared styles. Airmail envelope look, system fonts only, works without JS and at 320px. */

:root {
  --paper: #f5efe2;
  --card: #fbf8f1;
  --ink: #1f1c17;
  --muted: #625a4d;
  --line: #d9cdb6;
  --red: #c0392b;
  --blue: #1d4f91;
  --code: #ece3d1;
  --ok: #2e6b30;
  --err: #a8261d;
  --on-accent: #ffffff;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161411;
    --card: #1f1c18;
    --ink: #ece6da;
    --muted: #a69d8d;
    --line: #3b352c;
    --red: #e0594b;
    --blue: #79a3e6;
    --code: #262219;
    --ok: #7cc47f;
    --err: #ff8a80;
    --on-accent: #10161f;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--red); }

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

.skip { position: absolute; left: -10000px; }
.skip:focus { left: 16px; top: 16px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* Red-blue airmail stripe */
.airmail {
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 16px, var(--paper) 16px 24px, var(--blue) 24px 40px, var(--paper) 40px 48px);
}

.banner {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 10px 16px 12px;
}
.banner strong { display: block; font-family: var(--mono); letter-spacing: 0.08em; font-size: 0.95rem; }
.banner span { display: block; font-size: 0.85rem; opacity: 0.85; }
.banner a { color: inherit; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Site navigation + breadcrumb (use-case pages, /de/) */
.topnav { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-top: 12px; padding-bottom: 4px; font-size: 0.9rem; }
.topnav a { text-decoration: none; }
.topnav a:hover { text-decoration: underline; }
.crumbs { margin: 14px 0 0; color: var(--muted); overflow-wrap: anywhere; }
caption { text-align: left; padding: 0 0 6px; }

/* Hero: an envelope with an airmail border and a stamp */
.hero {
  margin: 28px 0 8px;
  background: var(--card);
  border: 10px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--red) 0 12px, var(--card) 12px 18px, var(--blue) 18px 30px, var(--card) 30px 36px) 10;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}
.hero p { margin: 0.4em 0; }
.hero .lead { font-size: 1.12rem; }
.pledge { font-family: var(--serif); font-size: 1.05rem; border-left: 4px solid var(--blue); padding-left: 12px; margin: 12px 0 !important; }

.stamp {
  width: 92px;
  height: 108px;
  transform: rotate(6deg);
  margin-top: 4px;
  flex: none;
}

@media (max-width: 560px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 18px 14px; }
  .stamp { width: 64px; height: 76px; justify-self: end; margin-top: -8px; order: -1; }
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); margin: 0 0 10px; }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin: 44px 0 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
h3 { font-size: 1.15rem; margin: 24px 0 8px; }

.kicker { font-family: var(--mono); color: var(--red); letter-spacing: 0.06em; font-size: 0.8rem; text-transform: uppercase; margin: 0 0 6px; }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

code, kbd, samp { font-family: var(--mono); font-size: 0.92em; overflow-wrap: anywhere; }
:not(pre) > code { background: var(--code); padding: 0.1em 0.35em; border-radius: 4px; }

pre {
  background: var(--code);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  max-width: 100%;
  font: 13.5px/1.5 var(--mono);
  margin: 10px 0 16px;
}
pre code { overflow-wrap: normal; font-size: inherit; }

.codebox { position: relative; }
.codebox pre { padding-top: 34px; }
.codebox .copy { position: absolute; top: 6px; right: 6px; padding: 3px 10px; font-size: 0.8rem; }

.table-wrap { overflow-x: auto; max-width: 100%; margin: 10px 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
td.num { white-space: nowrap; font-family: var(--mono); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin: 0 0 18px; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue); color: var(--on-accent);
  font: 700 0.95rem/30px var(--mono); text-align: center;
}

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
.card h3 { margin-top: 0; }

.notice { border-left: 4px solid var(--red); background: var(--card); padding: 10px 14px; margin: 14px 0; }

ul.plain { padding-left: 1.2em; }
ul.plain li { margin: 4px 0; }

details { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 6px; }

/* Forms */
form { margin: 0; }
label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 0.9rem; }
input, textarea, select {
  width: 100%;
  padding: 10px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}
textarea { min-height: 110px; resize: vertical; }
button {
  font: inherit;
  font-weight: 600;
  background: var(--blue);
  color: var(--on-accent);
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  margin-top: 12px;
  cursor: pointer;
}
button:hover { background: var(--red); }
button:disabled { opacity: 0.6; cursor: wait; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
output { display: block; margin-top: 8px; font-size: 0.92rem; min-height: 1.4em; }
output.ok { color: var(--ok); }
output.err { color: var(--err); }

/* Docs */
.endpoint { font-family: var(--mono); font-weight: 700; overflow-wrap: anywhere; }
.method { display: inline-block; min-width: 3.6em; padding: 0 6px; margin-right: 6px; border-radius: 4px; background: var(--blue); color: var(--on-accent); font-size: 0.8rem; text-align: center; }
.method.post { background: var(--red); }
.method.patch { background: var(--muted); }
nav.toc ul { columns: 2 220px; padding-left: 1.2em; }

/* Legal */
.placeholder { background: #ffe58f; color: #3a2e00; padding: 0 3px; border-radius: 3px; }
.summary-en { border: 1px dashed var(--line); padding: 10px 14px; border-radius: 6px; background: var(--card); }

footer.site { margin-top: 56px; padding: 22px 0 36px; border-top: 2px dashed var(--line); font-size: 0.9rem; color: var(--muted); }
footer.site ul { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer.site a { color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .stamp { transition: transform 200ms ease; }
  .stamp:hover { transform: rotate(0deg) scale(1.04); }
}
