/* herrdorok-basis.css – gemeinsame Gestaltung der Apps rund um herrdorok.de
   (text, board, screen, ablage, …). Original: Programmierung/herrdorok-basis/.
   In den Projekten nur kopieren, nie dort ändern – Änderungen hier machen und neu verteilen.
   Erwartet den Ordner schrift/ direkt daneben. Keine externen Quellen. */

@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url(schrift/nunito-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url(schrift/nunito-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-weight: 600; font-display: swap; src: url(schrift/nunito-600-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Nunito'; font-weight: 600; font-display: swap; src: url(schrift/nunito-600-latin-ext.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url(schrift/nunito-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url(schrift/nunito-700-latin-ext.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url(schrift/nunito-800-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url(schrift/nunito-800-latin-ext.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fredoka'; font-weight: 500; font-display: swap; src: url(schrift/fredoka-500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Fredoka'; font-weight: 500; font-display: swap; src: url(schrift/fredoka-500-latin-ext.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url(schrift/fredoka-600-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url(schrift/fredoka-600-latin-ext.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }


/* ---------------------------------------------------------------- Tokens
   Eigene Akzentfarbe je App: in der App-CSS (nach dieser Datei laden)
   --akzent, --akzent-hell und --akzent-dunkel überschreiben, und zwar
   einmal in :root und einmal im Dunkel-Block. Alles andere bleibt gleich. */

:root {
  --akzent: #bc1900;
  --akzent-hell: #fbeae7;
  --akzent-dunkel: #941400;
  --text: #222;
  --text-2: #5e5a57;
  --text-3: #8d8884;
  --linie: #e6e2df;
  --flaeche: #fff;
  --flaeche-2: #faf8f6;
  --seite: #f4f1ee;
  --gefahr: #c62828;
  --ok: #2f8f46;
  --warten: #b7791f;
  --radius: 16px;
  --schatten: 0 1px 2px rgba(40, 20, 10, .06), 0 8px 26px rgba(40, 20, 10, .13);
  --schatten-klein: 0 1px 2px rgba(40, 20, 10, .07), 0 2px 10px rgba(40, 20, 10, .08);
  --schrift: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --titel: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --breite: 1240px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --akzent: #ff6a50;
    --akzent-hell: #3a1c17;
    --akzent-dunkel: #ff8a75;
    --text: #ece9e6;
    --text-2: #b4aea9;
    --text-3: #8a847f;
    --linie: #3a3532;
    --flaeche: #262220;
    --flaeche-2: #2d2926;
    --seite: #1a1716;
    --gefahr: #ff6b6b;
    --ok: #5cc777;
    --warten: #e0a84a;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 26px rgba(0, 0, 0, .45);
    --schatten-klein: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .3);
  }
}

/* Farbfamilien: --f ist die Farbe, --f-hell eine zarte Fläche dazu */
.f-rot { --f: #bc1900; }
.f-orange { --f: #d0601b; }
.f-gelb { --f: #b98a00; }
.f-gruen { --f: #2f8a46; }
.f-tuerkis { --f: #0e8484; }
.f-blau { --f: #2a62b4; }
.f-violett { --f: #6c4bc2; }
.f-pink { --f: #c03a79; }
.f-grau { --f: #5f6470; }
.f-rot, .f-orange, .f-gelb, .f-gruen, .f-tuerkis, .f-blau, .f-violett, .f-pink, .f-grau { --f-hell: color-mix(in srgb, var(--f) 12%, var(--flaeche)); --f-mittel: color-mix(in srgb, var(--f) 26%, var(--flaeche)); }

/* ----------------------------------------------------------------- Grund */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; font-family: var(--schrift); font-size: 1rem; line-height: 1.5;
  color: var(--text); background: var(--seite);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--akzent); text-underline-offset: .15em; }
h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.i { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.dreht { animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
.unsichtbar { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- Knöpfe */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  min-height: 44px; padding: .5em 1.05em; border-radius: 12px;
  border: 1px solid var(--linie); background: var(--flaeche); font-weight: 700; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--flaeche-2); border-color: color-mix(in srgb, var(--akzent) 35%, var(--linie)); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.btn.primaer:hover { background: var(--akzent-dunkel); }
@media (prefers-color-scheme: dark) { .btn.primaer { color: #1a1716; } }
.btn.gefahr { background: var(--gefahr); border-color: var(--gefahr); color: #fff; }
.btn.leise { background: transparent; border-color: transparent; }
.btn.leise:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.btn.leise.gefahr { color: var(--gefahr); }
.btn.klein { min-height: 36px; padding: .3em .8em; font-size: .92rem; border-radius: 10px; }
.btn.gross { min-height: 52px; font-size: 1.05rem; }
.btn .i { width: 1.15em; height: 1.15em; }
.btn.aktiv { background: var(--akzent-hell); border-color: var(--akzent); color: var(--akzent-dunkel); }

.ibtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  transition: background .15s, color .15s;
}
.ibtn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.ibtn:disabled { opacity: .35; pointer-events: none; }
.ibtn .i { width: 20px; height: 20px; }

/* ------------------------------------------------------------- Formulare */

.feld {
  width: 100%; min-height: 46px; padding: .6em .8em; border-radius: 12px;
  border: 1.5px solid var(--linie); background: var(--flaeche); font-size: 1rem;
}
.feld:focus { outline: none; border-color: var(--akzent); box-shadow: 0 0 0 3px var(--akzent-hell); }
textarea.feld { resize: vertical; line-height: 1.45; min-height: 110px; }
select.feld { appearance: auto; }
.zeile { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.zeile > span, .feld-titel { font-weight: 700; font-size: .92rem; color: var(--text-2); }
.zeile small, .klein-hinweis { color: var(--text-3); font-size: .85rem; font-weight: 400; }
.haken { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.haken input { width: 22px; height: 22px; accent-color: var(--akzent); flex: none; margin: 0; }
.meldung { color: var(--gefahr); font-weight: 700; min-height: 1.2em; margin: 4px 0; }
.meldung:empty { display: none; }
.hinweis { color: var(--text-2); line-height: 1.55; }
.falle { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.wahl { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.wahl button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--linie); background: var(--flaeche); font-weight: 700;
}
.wahl button.aktiv { border-color: var(--akzent); background: var(--akzent-hell); color: var(--akzent-dunkel); }
.fortschritt { height: 6px; border-radius: 3px; background: var(--linie); overflow: hidden; }
.fortschritt > span { display: block; height: 100%; width: 0; background: var(--akzent); transition: width .2s; }

/* ------------------------------------------------------- Karte, Schild */

.karte { background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten-klein); padding: 20px; }
.schild {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px;
  background: var(--flaeche-2); border: 1px solid var(--linie); color: var(--text-2); font-size: .78rem; font-weight: 700; white-space: nowrap;
}

/* ---------------------------------------------------------------- Dialog
   Eigene Dialoge: .dlg-hinten > .dlg. Für <dialog> genügt class="dlg". */

.dlg-hinten {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
  background: rgba(30, 20, 15, .42); animation: einblenden .16s ease-out;
}
.dlg-hinten.weg { opacity: 0; transition: opacity .15s; }
@keyframes einblenden { from { opacity: 0; } }
.dlg {
  width: min(500px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: var(--flaeche); color: var(--text); border-radius: 22px; box-shadow: 0 20px 60px rgba(30, 20, 15, .3);
  animation: hochkommen .2s cubic-bezier(.2, .9, .3, 1.2);
}
.dlg.breit { width: min(760px, 100%); }
dialog.dlg { padding: 0; border: 0; max-width: calc(100vw - 32px); }
dialog.dlg:not([open]) { display: none; }
dialog.dlg::backdrop { background: rgba(30, 20, 15, .42); animation: einblenden .16s ease-out; }
dialog.dlg > form { display: flex; flex-direction: column; min-height: 0; }
@keyframes hochkommen { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.dlg-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 4px 24px; }
.dlg-kopf h2 { margin: 0; font-size: 1.25rem; font-weight: 800; min-width: 0; }
.dlg-inhalt { padding: 10px 24px 8px; overflow: auto; }
.dlg-inhalt > p:first-child { margin-top: 4px; }
.dlg-fuss { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 24px 20px; }
.dlg-fuss .links { margin-right: auto; }
@media (max-width: 520px) {
  .dlg-hinten { padding: 0; place-items: end stretch; }
  .dlg, .dlg.breit { width: 100%; border-radius: 22px 22px 0 0; max-height: 94dvh; padding-bottom: env(safe-area-inset-bottom); }
  dialog.dlg { max-width: 100%; margin: auto 0 0; }
}

/* ----------------------------------------------------------------- Menü */

.menue {
  position: fixed; z-index: 1100; min-width: 230px; padding: 6px; background: var(--flaeche);
  border-radius: 14px; box-shadow: 0 10px 40px rgba(30, 20, 15, .25); animation: einblenden .12s;
}
.menue button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 14px;
  border: 0; background: none; border-radius: 10px; text-align: left; font-weight: 600;
}
.menue button:hover { background: var(--seite); }
.menue button:disabled { opacity: .4; pointer-events: none; }
.menue button.gefahr { color: var(--gefahr); }
.menue hr { border: 0; border-top: 1px solid var(--linie); margin: 6px 4px; }

/* -------------------------------------------------------------- Meldungen */

.toasts { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1200; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px;
  background: #2b2522; color: #fff; font-weight: 700; box-shadow: var(--schatten); animation: hochkommen .2s;
  max-width: min(560px, calc(100vw - 32px));
}
.toast .i { color: #86efac; }
.toast.fehler .i { color: #fca5a5; }
.toast.weg { opacity: 0; transform: translateY(8px); transition: .3s; }

.leer-mitte { min-height: 60dvh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--text-2); text-align: center; padding: 20px; }
.leer-mitte > .i { width: 40px; height: 40px; color: var(--akzent); }

/* ---------------------------------------------------- Kopf, Fuß, Anmelden */

.kopf {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--flaeche) 90%, transparent); backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--akzent);
}
.kopf-innen { max-width: var(--breite); margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: max(8px, env(safe-area-inset-top)) 20px 8px; min-height: 60px; }
.marke { display: flex; align-items: center; gap: 10px; font-family: var(--titel); font-weight: 600; font-size: 1.3rem; color: var(--text); text-decoration: none; margin-right: auto; min-width: 0; }
.marke img { width: 32px; height: 32px; flex: none; }
.marke small { font-family: var(--schrift); font-weight: 600; font-size: .85rem; color: var(--text-3); }
.kopf .werkzeuge { display: flex; align-items: center; gap: 6px; }
.konto { display: flex; align-items: center; gap: 8px; border: 1px solid var(--linie); background: var(--flaeche); border-radius: 999px; padding: 3px 10px 3px 3px; font-weight: 700; min-height: 42px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--akzent-hell); color: var(--akzent-dunkel); font-weight: 800; font-size: .85rem; flex: none; }
@media (max-width: 640px) {
  .kopf-innen { padding-inline: 12px; gap: 6px; }
  .konto > span:not(.avatar), .konto > .i, .marke small, .btn .text-breit { display: none; }
  .konto { padding: 3px; }
  .kopf .btn { padding-inline: .7em; }
}

.fuss { max-width: var(--breite); margin: 48px auto 0; padding: 24px 20px calc(28px + env(safe-area-inset-bottom)); color: var(--text-3); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; }
.fuss a { color: inherit; }

.anmelden-seite { min-height: calc(100dvh - 200px); display: grid; place-items: center; padding: 30px 16px; }
.anmelden { width: min(400px, 100%); background: var(--flaeche); border-radius: 24px; padding: 30px 28px 26px; box-shadow: var(--schatten); }
.anmelden h1 { text-align: center; margin: 12px 0 20px; font-family: var(--titel); font-weight: 600; font-size: 1.8rem; }
.anmelden .btn { width: 100%; margin-top: 8px; }
.anmelden .logo { display: block; width: 64px; height: 64px; margin: 0 auto; }
.anmelden .hinweis { text-align: center; font-size: .92rem; margin: 0 0 18px; }

/* ---------------------------------------------------------------- Seite */

.seite { max-width: var(--breite); margin: 0 auto; padding: 20px 20px 0; }
.seite.schmal { max-width: 780px; }
.titelzeile { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 10px 0 22px; }
.titelzeile h1 { margin: 0; font-family: var(--titel); font-weight: 600; font-size: 2rem; }
.abschnitt-titel { font-family: var(--titel); font-weight: 600; font-size: 1.35rem; margin: 36px 0 6px; }
@media (max-width: 640px) { .seite { padding-inline: 12px; } }
