/* Laden – eine Datei, keine fremden Quellen. Zielgerät: iPad quer, danach das Handy.
   Schrift: Noto Sans Thai, selbst gehostet in static/fonts (SIL Open Font License 1.1). */
@font-face { font-family: "Noto Sans Thai"; font-style: normal; font-weight: 100 900; font-display: swap;
             src: url("/static/fonts/noto-sans-thai-thai.woff2") format("woff2");
             unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Thai"; font-style: normal; font-weight: 100 900; font-display: swap;
             src: url("/static/fonts/noto-sans-thai-latin.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; }
:root {
  --grund: #f6f1e7; --karte: #fffdf8; --tinte: #2b2118; --leise: #7a6a58;
  --akzent: #b4502e; --akzent-dunkel: #8f3d21; --rand: #dccfb9; --gut: #2f6b4f; --warn: #a3341f;
  --schrift: "Noto Sans Thai", "Thonburi", "Leelawadee UI", system-ui, sans-serif;
  --griff: 3rem;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--tinte); font: 18px/1.5 var(--schrift); }
a { color: var(--akzent-dunkel); }
h1 { margin: 0; font-size: 1.5rem; line-height: 1.3; }
h1 small { font-size: .95rem; font-weight: 400; color: var(--leise); margin-left: .5rem; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Kopf */
.kopf { display: flex; align-items: center; gap: 1.25rem; padding: .5rem 1.25rem;
        background: var(--karte); border-bottom: 1px solid var(--rand); position: sticky; top: 0; z-index: 5; }
.marke { font-weight: 700; font-size: 1.15rem; color: var(--tinte); text-decoration: none; }
.haupt { display: flex; gap: .25rem; flex: 1; }
.haupt a { display: inline-flex; align-items: center; min-height: var(--griff); padding: 0 1rem;
           border-radius: .6rem; color: var(--leise); text-decoration: none; font-weight: 600; }
.haupt a[aria-current] { background: var(--tinte); color: var(--karte); }
.rechts { display: flex; align-items: center; gap: .75rem; }
.sprache a { display: inline-flex; align-items: center; min-height: var(--griff); padding: 0 .5rem;
             color: var(--leise); text-decoration: none; }
.sprache a[aria-current] { color: var(--tinte); font-weight: 700; }

main { padding: 1.25rem; max-width: 80rem; margin: 0 auto; }
.leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
          gap: .75rem; margin-bottom: 1rem; }
.knoepfe { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.knoepfe.weitere { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--rand); }

/* Knöpfe */
button, .knopf { display: inline-flex; align-items: center; justify-content: center; min-height: var(--griff);
                 padding: 0 1.2rem; font: inherit; font-weight: 700; color: #fff; background: var(--akzent);
                 border: 1px solid var(--akzent); border-radius: .6rem; text-decoration: none; cursor: pointer; }
button:active, .knopf:active { background: var(--akzent-dunkel); }
.zweit { color: var(--tinte); background: var(--karte); border-color: var(--rand); }
.leise { color: var(--leise); background: none; border-color: transparent; font-weight: 400; }
.knopf.klein { min-height: 2.4rem; padding: 0 .8rem; font-size: .9rem; }

/* Meldungen */
.hinweis { margin: 0 0 1rem; padding: .7rem 1rem; border-left: 4px solid var(--gut);
           background: #e9f1ea; border-radius: .4rem; }
.fehler { margin: 0 0 1rem; padding: .7rem 1rem .7rem 2rem; border-left: 4px solid var(--warn);
          background: #f8e7e2; border-radius: .4rem; }
.leer { color: var(--leise); padding: 2rem 0; }
.klein { color: var(--leise); font-size: .9rem; }

/* Reiter nach Status */
.reiter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.reiter a { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.6rem; padding: 0 .9rem;
            border: 1px solid var(--rand); border-radius: 2rem; background: var(--karte);
            color: var(--tinte); text-decoration: none; }
.reiter a[aria-current] { background: var(--tinte); border-color: var(--tinte); color: var(--karte); }
.reiter b { font-weight: 700; color: var(--leise); }
.reiter a[aria-current] b { color: var(--rand); }

/* Formularfelder */
label { display: block; color: var(--leise); font-size: .9rem; }
input, select, textarea { display: block; width: 100%; min-height: var(--griff); margin-top: .2rem;
                          padding: .4rem .7rem; font: inherit; font-size: 1rem; color: var(--tinte);
                          background: #fff; border: 1px solid var(--rand); border-radius: .5rem; }
.filter { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.filter label { min-width: 12rem; }
.formular { display: grid; gap: 1rem; max-width: 48rem; padding: 1.25rem; background: var(--karte);
            border: 1px solid var(--rand); border-radius: .8rem; }
.reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; }

/* Tabellen */
.tabelle { overflow-x: auto; background: var(--karte); border: 1px solid var(--rand); border-radius: .8rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--rand); vertical-align: middle; }
th { font-size: .85rem; font-weight: 600; color: var(--leise); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
a.nr { display: inline-flex; align-items: center; min-height: 2.6rem; font-weight: 700; }
td.nr { color: var(--leise); font-variant-numeric: tabular-nums; }
table.eingabe td { padding: .25rem .3rem; }
table.eingabe input, table.eingabe select { margin: 0; min-width: 9rem; }
table.eingabe .kurz { min-width: 5rem; width: 6rem; }
table.eingabe .mittel { min-width: 7rem; width: 8rem; }
table.eingabe select { min-width: 4.5rem; }
.blaettern { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }

/* Status */
.status { display: inline-block; padding: .1rem .6rem; border-radius: 1rem; font-size: .85rem;
          font-weight: 600; white-space: nowrap; background: #ece4d3; }
.s-lager { background: #e3ecdf; color: var(--gut); }
.s-im_stream { background: #fbe6c8; color: #7a4a00; }
.s-reserviert { background: #dfe7f3; color: #2a4a7a; }
.s-verkauft { background: var(--tinte); color: var(--karte); }
.s-aussortiert { background: #ece4d3; color: var(--leise); }

.z-geplant { background: #ece4d3; color: var(--leise); }
.z-laeuft { background: var(--akzent); color: #fff; }
.z-beendet { background: #e3ecdf; color: var(--gut); }
.z-storniert { background: #ece4d3; color: var(--leise); text-decoration: line-through; }
.status.hueter, .reiter a.hueter { background: #f8e7e2; color: var(--warn); border-color: #e9c4b8; }

/* Zahlen */
.plus { color: var(--gut); }
.minus { color: var(--warn); }
.kennzahlen .minus dd, .kennzahlen .plus dd { color: inherit; }
tr.summe td { font-weight: 700; border-top: 2px solid var(--tinte); }
tr.durch td { color: var(--leise); text-decoration: line-through; }
td small { color: var(--leise); font-weight: 400; }
td small.minus { color: var(--warn); }

/* Streams */
h2 { margin: 2rem 0 .75rem; font-size: 1.15rem; }
h2 small { font-weight: 400; color: var(--leise); margin-left: .4rem; }
.kennzahlen { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0 0 1rem; }
.kennzahlen div { flex: 1 1 8rem; padding: .7rem 1rem; background: var(--karte); border: 1px solid var(--rand);
                  border-radius: .8rem; }
.kennzahlen dt { font-size: .85rem; color: var(--leise); }
.kennzahlen dd { margin: 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kennzahlen dd.klein, .kennzahlen dd small { font-size: .95rem; font-weight: 400; }
.code { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
td.code { font-size: 1.15rem; }
.teil { display: inline-block; margin: .1rem .8rem .1rem 0; white-space: nowrap; }
table.wahl input[type="checkbox"] { width: 1.6rem; height: 1.6rem; min-height: 0; margin: 0; }
table.wahl label { display: block; padding: .5rem 0; font-size: 1rem; color: var(--tinte); }
.knoepfe.oben { margin-bottom: .75rem; }
button[disabled] { opacity: .45; cursor: not-allowed; }
details.mehr { margin-top: 2rem; }
details.mehr summary { display: inline-flex; align-items: center; min-height: var(--griff); color: var(--leise); cursor: pointer; }

/* Live – zwei Spalten auf dem iPad quer, untereinander auf dem Handy */
.live { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 1.25rem; align-items: start; }
.eingabe { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr) auto; gap: .75rem; align-items: end; }
.eingabe input { min-height: 4.5rem; font-size: 2rem; font-weight: 700; padding: .3rem 1rem; }
.eingabe #code { text-transform: uppercase; letter-spacing: .05em; }
.eingabe button { min-height: 4.5rem; font-size: 1.2rem; padding: 0 1.5rem; }
.vorschau { min-height: 1.6em; margin: .6rem 0 0; font-size: 1.1rem; }
.vorschau[data-art="fehler"] { color: var(--warn); text-decoration: line-through; }
.meldung-live { min-height: 2.6rem; margin: .4rem 0 1rem; padding: .5rem .9rem; border-radius: .5rem; font-size: 1.15rem; font-weight: 600; }
.meldung-live:empty { visibility: hidden; }
.meldung-live[data-art="fehler"] { background: #f8e7e2; color: var(--warn); }
.meldung-live[data-art="gut"] { background: #e9f1ea; color: var(--gut); }
.pufferzeile { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.puffer { display: inline-block; margin: 0; padding: .3rem .8rem; border-radius: 2rem; font-size: .9rem; font-weight: 600; }
.puffer[data-art="gut"] { background: #e9f1ea; color: var(--gut); }
.puffer[data-art="wartet"] { background: #fbe6c8; color: #7a4a00; }
.puffer[data-art="fehler"] { background: #f8e7e2; color: var(--warn); }
.abgelehnt { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .4rem; }
.abgelehnt li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .5rem .8rem;
                background: #f8e7e2; border-left: 4px solid var(--warn); border-radius: .4rem; }
.abgelehnt .warum { flex: 1; color: var(--warn); font-weight: 600; }
.zettel { background: var(--karte); border: 1px solid var(--rand); border-radius: .8rem; padding: .25rem 1rem 1rem;
          max-height: calc(100vh - 6rem); overflow-y: auto; }
.zettel h2 { margin: .75rem 0 .5rem; }
.zettel ol { list-style: none; margin: 0; padding: 0; }
.zettel li { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto auto 2.6rem; gap: .1rem .6rem;
             align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--rand); }
.zettel .wer { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zettel .was { grid-column: 2 / 5; grid-row: 2; font-size: .85rem; color: var(--leise);
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zettel .zahl { font-weight: 600; }
.zettel .wann { font-size: .85rem; color: var(--leise); }
.zettel li button { grid-column: 5; grid-row: 1 / 3; min-height: 2.6rem; padding: 0; }
.zettel .z-wartet { background: #fdf3e1; }
.zettel .z-wartet .wann { color: #7a4a00; font-weight: 600; }
.zettel .z-storniert { color: var(--leise); }
.zettel .z-storniert .code, .zettel .z-storniert .wer, .zettel .z-storniert .zahl { text-decoration: line-through; font-weight: 400; }

@media (max-width: 52rem) {
  .live { grid-template-columns: 1fr; }
  .eingabe { grid-template-columns: minmax(0, 2fr) minmax(0, 4fr); }
  .eingabe button { grid-column: 1 / 3; }
  .eingabe input { font-size: 1.6rem; min-height: 4rem; }
  .zettel { max-height: none; }
}

/* Anmeldung */
body.anmeldung { min-height: 100vh; display: grid; place-items: center; font-size: 20px; }
.karte { width: min(26rem, 100% - 2rem); padding: 2rem; background: var(--karte);
         border: 1px solid var(--rand); border-radius: 1rem; }
.karte header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.karte label { margin-top: 1rem; }
.karte button { width: 100%; min-height: 3.4rem; margin-top: 1rem; }
.meldung { margin: 1rem 0 0; color: var(--warn); min-height: 1.5em; }

@media (max-width: 40rem) {
  .kopf { flex-wrap: wrap; gap: .25rem .75rem; padding: .4rem .75rem; }
  .haupt { order: 3; flex-basis: 100%; }
  main { padding: .75rem; }
}
