/* Signalwerk Web-App: schlicht, Tokens der Website (Navy, Teal, Manrope), kein Glas.
   Schrift lokal (SIL OFL 1.1, siehe OFL-Manrope.txt), keine externen Ressourcen. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("manrope-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("manrope-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy: #0f1e36;
  --teal: #0f9d8f;
  --teal-ink: #0a7a6f;
  --ink: #0b1220;
  --ink-2: #2b3648;
  --paper: #f6f8fb;
  --surface: #ffffff;
  --line: #dfe5ee;
  --tint: #edf2f7;
  --focus: #0f1e36;
  --btn-bg: #0f1e36;
  --btn-bg-hover: #1d3560;
  --btn-ink: #ffffff;
  --gut-bg: #e2f4f1;
  --gut-ink: #0a5a52;
  --fehler-bg: #fdecec;
  --fehler-ink: #8f1d1d;
  --fehler-rand: #c0392b;
  --gefahr: #b42318;
  --radius: 8px;
  --radius-karte: 16px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef2f8;
    --ink-2: #b9c4d6;
    --teal-ink: #4fd1c1;
    --paper: #0b1220;
    --surface: #121c2e;
    --line: #24314a;
    --tint: #0f192b;
    --focus: #4fd1c1;
    --btn-bg: #0f9d8f;
    --btn-bg-hover: #13b3a3;
    --btn-ink: #04110f;
    --gut-bg: #10312e;
    --gut-ink: #8be5d9;
    --fehler-bg: #3a1717;
    --fehler-ink: #ffb4ab;
    --fehler-rand: #ff6b5e;
    --gefahr: #ff6b5e;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.rahmen {
  width: 100%;
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main.rahmen {
  padding-top: 24px;
  padding-bottom: 48px;
}

.kopf {
  background: var(--navy);
  color: #ffffff;
}
.kopf-innen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 56px;
}
.marke {
  font-weight: 800;
  letter-spacing: 0.04em;
}
.plakette {
  font-size: 0.8rem;
  color: #ffffff;
  border: 1px solid rgb(255 255 255 / 0.4);
  border-radius: 999px;
  padding: 2px 12px;
  text-decoration: none;
}

.fuss {
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.8rem;
  padding: 16px 0 32px;
}

h1 {
  font-size: 1.563rem;
  line-height: 1.25;
  margin: 8px 0 16px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 32px 0 12px;
}

p {
  margin: 0 0 12px;
}

a {
  color: var(--teal-ink);
  text-underline-offset: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0 8px;
}

code {
  font-size: 0.9em;
  background: var(--tint);
  padding: 1px 6px;
  border-radius: 4px;
}

.leise {
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 400;
}
.hinweis {
  color: var(--ink-2);
  font-size: 0.88rem;
  margin: 4px 0 12px;
}

.sprung {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 16px;
  z-index: 10;
}
.sprung:focus {
  left: 8px;
  top: 8px;
}

/* Sichtbarer Fokus für alles Bedienbare */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.kopf :focus-visible {
  outline-color: #ffffff;
}

/* Formulare */
.formular fieldset,
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-karte);
  background: var(--surface);
  padding: 16px;
  margin: 0 0 24px;
  min-width: 0;
}
fieldset fieldset {
  background: transparent;
  border-radius: var(--radius);
  margin: 12px 0 0;
}
legend {
  font-weight: 700;
  padding: 0 8px;
}

label {
  display: block;
  font-weight: 600;
  margin: 0 0 4px;
}

input[type="text"],
input[type="number"],
textarea,
select {
  display: block;
  width: 100%;
  max-width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-2);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 44px;
}
textarea {
  resize: vertical;
}
input[type="number"] {
  max-width: 8rem;
}

.feld {
  margin-bottom: 16px;
}
.feld select {
  max-width: 20rem;
}

.gewichte {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 24px;
}
.gewicht {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.5rem;
  align-items: center;
  gap: 8px 12px;
}
.gewicht label {
  margin: 0;
  font-weight: 500;
}
.gewicht select {
  padding: 8px;
}
@media (max-width: 479px) {
  .gewicht {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .gewicht label {
    font-weight: 600;
  }
}

.checkliste {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 24px;
}
.zeile-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
}
.zeile-check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--teal-ink);
}
.zeile-check label {
  font-weight: 500;
  margin: 0;
}

@media (min-width: 640px) {
  .gewichte,
  .checkliste {
    grid-template-columns: 1fr 1fr;
  }
}

/* Knöpfe */
.knopf {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: 2px solid var(--btn-bg);
  border-radius: var(--radius);
  padding: 10px 20px;
  min-height: 44px;
  cursor: pointer;
}
.knopf:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-bg-hover);
}
.knopf.zweit {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink-2);
}
.knopf.gefahr {
  background: var(--gefahr);
  border-color: var(--gefahr);
  color: #ffffff;
}
.knopf.gefahr-rand {
  background: transparent;
  color: var(--gefahr);
  border-color: var(--gefahr);
}
.knopfreihe {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Meldungen */
.meldung {
  border-left: 4px solid var(--teal);
  background: var(--gut-bg);
  color: var(--gut-ink);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 0 20px;
}
.meldung p:last-child {
  margin-bottom: 0;
}
.meldung.fehler {
  border-left-color: var(--fehler-rand);
  background: var(--fehler-bg);
  color: var(--fehler-ink);
}
.meldung ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.karte {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-karte);
  padding: 16px;
  font-weight: 600;
}
.geerbt {
  margin-top: 12px;
}
.geerbt summary {
  cursor: pointer;
  font-weight: 600;
  padding: 10px 0;
  min-height: 44px;
}
.geerbt ul {
  padding-left: 20px;
}

/* Admin */
.liste {
  padding-left: 20px;
}
.liste li {
  margin-bottom: 8px;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.inline-form .feld {
  margin: 0;
}
.tabelle {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.88rem;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: normal;
}
thead th {
  background: var(--tint);
  white-space: nowrap;
}
tr.fehlerzeile td {
  background: var(--fehler-bg);
  color: var(--fehler-ink);
}
.mailrahmen {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

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