/* Kochansicht — Handy, in der Küche, mit fettigen Fingern.
 *
 * Andere Aufgabe als die Pflegeansicht am Mac, deshalb eigene Gestaltung:
 * eine Sache pro Bildschirm, Trefferflächen ab 52 px, Zahlen groß genug, um
 * sie im Vorbeigehen zu lesen. Kein Schweben, kein Ausklappen, keine Tabelle.
 */

:root {
  --tinte:    #201d17;
  --gold:     #a5813a;
  --gedaempft:#8a8073;
  --linie:    #e8e1d3;
  --gruen:    #6f8c4e;
  --creme:    #faf6ea;
  --papier:   #fffdf7;
  --rot:      #a4462f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--creme);
  color: var(--tinte);
  font-family: Karla, -apple-system, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

h1, h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; margin: 0; }
h1 { font-size: 27px; }
h2 { font-size: 21px; margin-bottom: 4px; }

/* --- Kopf mit mitlaufender Uhr ------------------------------------------- */

.kkopf {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: var(--papier); border-bottom: 1px solid var(--linie);
}
/* Kopf und Fuß laufen über die ganze Breite, ihr Inhalt aber nicht — sonst
 * steht der Knopf am PC 1400 Pixel breit unter einer 640 Pixel schmalen Liste. */
.kkopf > *, .kfuss > * { max-width: 640px; }
.kkopf { padding-left: max(16px, calc((100% - 640px) / 2)); padding-right: max(16px, calc((100% - 640px) / 2)); }
.kmarke {
  font-family: 'Playfair Display', Georgia, serif; font-size: 19px;
}
/* Die Uhr ist der Grund, warum diese Ansicht existiert: Arbeitszeit wird
 * gemessen statt geschätzt. Also steht sie immer sichtbar oben. */
.kuhr {
  font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 600;
  color: var(--gold); min-width: 68px; text-align: right;
}
.kuhr.laeuft::before {
  content: '●'; color: var(--rot); margin-right: 6px; font-size: 11px;
  vertical-align: 2px;
}

/* Dieselbe Ansicht auf drei Geräten: Handy, iPad und PC in der Küche.
 * Der Inhalt bleibt überall gleich breit — auf dem großen Bildschirm wird die
 * Spalte nicht breiter, sondern zentriert. Große Trefferflächen sind am
 * Küchen-PC genauso richtig wie am Handy: Es geht nicht um kleine Displays,
 * sondern um Bedienen im Vorbeigehen. */
main { padding: 20px 16px 24px; max-width: 640px; margin: 0 auto; }

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

.kknopf {
  display: block; width: 100%; font: inherit; font-size: 18px; font-weight: 600;
  background: var(--tinte); color: var(--creme); border: 1px solid var(--tinte);
  border-radius: 4px; padding: 16px; min-height: 56px; cursor: pointer;
  margin-bottom: 10px;
}
.kknopf:active { background: #35302a; }
.kknopf:disabled { opacity: .45; }
.kknopf-zweit { background: transparent; color: var(--tinte); border-color: var(--linie); font-weight: 500; }
.kknopf-gross { font-size: 20px; padding: 22px; min-height: 72px; }
.kflach {
  font: inherit; background: none; border: 0; color: var(--gold);
  padding: 8px 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

input {
  font: inherit; font-size: 18px; width: 100%; color: var(--tinte);
  background: var(--papier); border: 1px solid var(--linie);
  border-radius: 4px; padding: 14px; min-height: 54px;
}
input:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
label { display: block; margin-bottom: 14px; }
.kname {
  display: block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gedaempft); margin-bottom: 6px;
}

.khinweis { color: var(--gedaempft); font-size: 15px; margin: 8px 0 18px; }
.kfehler  { color: var(--rot); font-size: 15px; margin: 10px 0; }

/* --- Zutatenliste -------------------------------------------------------- */

.kzutaten { list-style: none; margin: 0 0 16px; padding: 0; }
.kzutat {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--papier); border: 1px solid var(--linie); border-radius: 4px;
  padding: 14px; margin-bottom: 8px; min-height: 60px;
}
.kzutat-name { font-weight: 600; }
.kzutat-unten { font-size: 14px; color: var(--gedaempft); }
.kzutat-menge { font-variant-numeric: tabular-nums; font-size: 18px; white-space: nowrap; }
.kzutat-weg {
  font: inherit; background: none; border: 0; color: var(--gedaempft);
  font-size: 22px; padding: 6px 10px; cursor: pointer; min-width: 44px;
}
.kzutat-weg:active { color: var(--rot); }

/* --- Suche --------------------------------------------------------------- */

.ktreffer {
  display: block; width: 100%; text-align: left; font: inherit; cursor: pointer;
  background: var(--papier); border: 1px solid var(--linie); border-radius: 4px;
  padding: 14px; margin-bottom: 8px; min-height: 60px;
}
.ktreffer:active { border-color: var(--gold); background: #fdfaf1; }
.ktreffer-titel { font-weight: 600; display: block; }
.ktreffer-zusatz { font-size: 14px; color: var(--gedaempft); }
.kmarke-rezeptur {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-left: 8px;
  color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 1px 7px;
}

/* --- Ergebnis ------------------------------------------------------------ */

.kkarte {
  background: var(--papier); border: 1px solid var(--linie);
  border-top: 3px solid var(--gold); border-radius: 4px; padding: 18px; margin-bottom: 16px;
}
.kzeile { display: flex; justify-content: space-between; align-items: baseline; padding: 5px 0; gap: 12px; }
.kzeile-name { color: var(--gedaempft); font-size: 15px; }
.kzeile-wert { font-variant-numeric: tabular-nums; font-weight: 600; }
.kzeile-gross .kzeile-wert { font-family: 'Playfair Display', Georgia, serif; font-size: 26px; }
.kzeile-summe { border-top: 1px solid var(--linie); margin-top: 6px; padding-top: 8px; }

.kmengenfeld { display: flex; gap: 10px; }
.kmengenfeld input:first-child { flex: 2; text-align: right; font-size: 22px; font-weight: 600; }
.kmengenfeld input:last-child { flex: 1; }

.kfuss {
  position: sticky; bottom: 0; background: var(--papier);
  border-top: 1px solid var(--linie);
  padding: 12px max(16px, calc((100% - 640px) / 2)) calc(env(safe-area-inset-bottom) + 12px);
}
.kfuss:empty { display: none; }
.kfuss .kknopf { margin-bottom: 0; }

.kgespeichert { text-align: center; padding: 40px 0; }
.kgespeichert h1 { color: var(--gruen); margin-bottom: 10px; }

/* --- Arbeitszeit --------------------------------------------------------- */

.kzeitzeile {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--papier); border: 1px solid var(--linie); border-radius: 4px;
  padding: 12px 14px; margin-bottom: 16px;
}
.kzeit-text { flex: 1; font-size: 15px; color: var(--gedaempft); }
.kzeitzeile label { flex: 1 1 160px; margin: 0; }
.kzeitzeile .kknopf { width: auto; margin: 0; padding: 12px 18px; min-height: 48px; }
