:root {
  color-scheme: light;
  --papier: #d5ddd6;
  --feld: #f3f5f1;
  --tinte: #1c1915;
  --linie: #b7c0b8;
  --wachs: #7d2a2a;
  --wachs-tief: #5c1f1f;
  --offen: #1e4d3a;
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", "Noto Serif", Georgia, serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0 auto;
  max-width: 38rem;
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom));
  background: var(--papier);
  color: var(--tinte);
  font-size: 1.05rem;
  line-height: 1.45;
}

.kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.marke {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: 0.01em;
}

h1, h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.2rem 0 0.4rem;
}

h2 { font-size: 1rem; }

p { margin: 0.4rem 0 0.8rem; }

.hinweis {
  margin-top: 0.6rem;
  max-width: 36rem;
}

.leise { font-size: 0.95rem; }

.zwischen {
  margin: 1rem 0 0.3rem;
  font-size: 0.95rem;
}

label {
  display: block;
  margin: 0.8rem 0 0.3rem;
}

input, textarea, button {
  font: inherit;
  color: inherit;
}

input, textarea {
  width: 100%;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--linie);
  border-radius: 0;
  background: var(--feld);
  font-size: 16px;
}

textarea { resize: vertical; }

#ausgabe, #eigen, .zeichen, #code-ein, #gegen-zeichen {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.35;
}

.zeichen {
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  margin: 0.2rem 0 0.8rem;
  word-break: break-all;
}

.linkzeile {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-all;
  margin: 0.6rem 0;
}

#gegen-anzeige {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}

details { margin-top: 1.2rem; }

summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

button {
  min-height: 48px;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--tinte);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

button:active { transform: translateY(1px); }

.stempel {
  display: block;
  width: 100%;
  margin-top: 1rem;
  border-color: var(--wachs);
  background: var(--wachs);
  color: #f4f6f2;
}

.stempel:active { background: var(--wachs-tief); }

.stempel:disabled { opacity: 0.55; }

.weit {
  display: block;
  width: 100%;
  margin-top: 1rem;
}

.modus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 0.6rem;
}

.modus button {
  border-color: var(--linie);
}

.modus button[aria-checked="true"] {
  border-color: var(--tinte);
  background: var(--feld);
}

.datei input { margin-top: 0.3rem; }

.haken {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  margin: 0;
}

.haken input {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
}

.reihe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.reihe button,
.reihe a {
  flex: 1 1 8rem;
}

.reihe a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--tinte);
  color: inherit;
  text-decoration: none;
  text-align: center;
}

.zeile-liste {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 48px;
  border-top: 1px solid var(--linie);
}

#warnung,
#fremd-block {
  margin: 0.8rem 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--wachs);
  background: var(--feld);
}

#warnung p,
#fremd-block p { margin: 0.3rem 0; }

#status {
  min-height: 1.4em;
  margin-top: 1rem;
}

#status.offen { color: var(--offen); }

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

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  button:active { transform: none; }
}
