/* Messe-Nachbuchung: iPad-first, grosse Touch-Ziele, eine Hand. */
:root {
  --ink: #14171c;
  --ink-2: #4b515b;
  --ink-3: #868c96;
  --paper: #f3f1ec;
  --card: #ffffff;
  --line: #e0ddd5;
  --ok: #19803a;
  --ok-bg: #e4f4e8;
  --warn: #b45f06;
  --warn-bg: #fdf0dc;
  --bad: #b3261e;
  --bad-bg: #fbe5e3;
  --mc: #14171c; /* Messefarbe, wird pro Screen gesetzt */
  --r: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0, 0, 0.3, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink);
  font: 18px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
#app { min-height: 100%; display: flex; flex-direction: column; }

/* ---------- Kopf ---------- */
.kopf { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: var(--mc); color: #fff; min-height: 68px; }
.kopf h1 { margin: 0; font-size: 24px; letter-spacing: -0.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf .sub { display: block; font-size: 14px; font-weight: 500; opacity: .85; letter-spacing: 0; }
.ib { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: 24px; color: #fff; flex: none; transition: background 180ms var(--ease), transform 180ms var(--ease); }
.ib:active { background: rgba(255,255,255,.32); transform: scale(.96); }
.netz { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.18); white-space: nowrap; }
.netz.aus { background: #fff; color: var(--warn); }

.seite { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 16px calc(24px + var(--safe-b)); flex: 1; }

/* ---------- Login ---------- */
.login { margin: auto; width: min(420px, 92vw); text-align: center; padding: 40px 0; }
.login h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -0.02em; }
.login p { color: var(--ink-2); margin: 0 0 24px; }
.pin-punkte { display: flex; justify-content: center; gap: 14px; margin: 0 0 22px; height: 18px; }
.pin-punkte i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink-3); transition: background 120ms; }
.pin-punkte i.an { background: var(--ink); border-color: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pad button { height: 76px; border-radius: 20px; background: var(--card); font-size: 32px; font-weight: 600; box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line) inset; transition: transform 120ms var(--ease), background 120ms; }
.pad button:active { background: #e9e6df; transform: scale(.96); }
.pad .leer { visibility: hidden; }
.fehlertext { color: var(--bad); font-weight: 600; min-height: 26px; margin-top: 14px; }

/* ---------- Messe-Auswahl ---------- */
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 8px; }
.kachel { position: relative; text-align: left; min-height: 190px; border-radius: 24px; padding: 22px; color: #fff; background: var(--mc);
  display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 10px 28px -14px rgba(0,0,0,.45);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease); }
.kachel:active { transform: scale(.985); }
.kachel h2 { margin: 0; font-size: 34px; letter-spacing: -0.02em; }
.kachel .ziel { font-size: 17px; font-weight: 500; opacity: .92; }
.kachel .ziel.fehlt { background: rgba(255,255,255,.95); color: var(--bad); display: inline-block; padding: 4px 12px; border-radius: 99px; font-weight: 700; }
.kachel .zahl { font-size: 15px; font-weight: 600; opacity: .9; }
@media (orientation: portrait) and (max-width: 820px) { .kacheln { grid-template-columns: 1fr; } .kachel { min-height: 150px; } }

/* ---------- Messe-Screen ---------- */
.leiste { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 99px; background: var(--card); box-shadow: 0 0 0 1px var(--line) inset; font-weight: 600; font-size: 16px; }
.chip.ok { background: var(--ok-bg); color: var(--ok); box-shadow: none; }
.chip.warn { background: var(--warn-bg); color: var(--warn); box-shadow: none; }
.chip.bad { background: var(--bad-bg); color: var(--bad); box-shadow: none; }
.suche { position: sticky; top: calc(68px + var(--safe-t)); z-index: 4; padding: 8px 0 12px; background: linear-gradient(var(--paper) 82%, transparent); }
.suche input { width: 100%; height: 64px; border: 0; border-radius: 18px; padding: 0 20px 0 56px; font-size: 22px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' fill='none' stroke='%23868c96' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M17 17l7 7'/%3E%3C/svg%3E") 18px 50% no-repeat; box-shadow: 0 0 0 1px var(--line) inset; outline: none; }
.suche input:focus { box-shadow: 0 0 0 3px var(--mc) inset; }
.tabs { display: flex; gap: 8px; margin: 4px 0 12px; }
.tab { flex: 1; min-height: 56px; border-radius: 16px; background: transparent; font-weight: 700; font-size: 17px; color: var(--ink-2); box-shadow: 0 0 0 1.5px var(--line) inset; }
.tab.an { background: var(--ink); color: #fff; box-shadow: none; }
.tab .n { display: inline-block; min-width: 24px; padding: 1px 8px; margin-left: 6px; border-radius: 99px; background: rgba(127,127,127,.2); font-size: 14px; }

.liste { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 900px) { .liste { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.zeile { text-align: left; display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 12px 16px; border-radius: var(--r); background: var(--card); box-shadow: 0 0 0 1px var(--line) inset;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); width: 100%; }
.zeile:active { transform: scale(.985); box-shadow: 0 0 0 3px var(--mc) inset; }
.zeile .t { flex: 1; min-width: 0; }
.zeile .f { font-weight: 700; font-size: 19px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.zeile .k { color: var(--ink-2); font-size: 15px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .pfeil { color: var(--ink-3); font-size: 26px; }
.zeile.gebucht { background: #eef6f0; box-shadow: 0 0 0 1px #c8e2cf inset; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 99px; white-space: normal; text-align: center; line-height: 1.25; flex-shrink: 1; min-width: 0; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.grau { background: #ebe8e1; color: var(--ink-2); }
.leer { text-align: center; color: var(--ink-2); padding: 48px 16px; }
.leer b { display: block; color: var(--ink); font-size: 20px; margin-bottom: 6px; }

.btn { min-height: 60px; padding: 0 28px; border-radius: 18px; background: var(--ink); color: #fff; font-weight: 700; font-size: 19px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform 160ms var(--ease), opacity 160ms; }
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn.mc { background: var(--mc); }
.btn.zweit { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1.5px var(--line) inset; }
.btn.klein { min-height: 48px; font-size: 16px; padding: 0 18px; border-radius: 14px; }
.btn.breit { width: 100%; }

/* ---------- Buchung ---------- */
.buchung { display: grid; gap: 14px; grid-template-columns: 1fr; padding-bottom: 210px; }
@media (min-width: 900px) and (orientation: landscape) { .buchung { grid-template-columns: 1fr 1fr; align-items: start; } .buchung .links, .buchung .rechts { display: grid; gap: 14px; } }
.karte { background: var(--card); border-radius: 20px; padding: 18px 20px; box-shadow: 0 0 0 1px var(--line) inset; }
.karte h3 { margin: 0 0 12px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.fkopf h2 { margin: 0; font-size: 28px; letter-spacing: -0.02em; line-height: 1.15; }
.fkopf .k { color: var(--ink-2); margin-top: 4px; }
.stepper { display: grid; grid-template-columns: 76px 1fr 76px; gap: 10px; align-items: stretch; }
.stepper button { height: 76px; border-radius: 18px; background: #ebe8e1; font-size: 38px; font-weight: 500; transition: transform 120ms var(--ease), background 120ms; }
.stepper button:active { transform: scale(.94); background: #ddd9cf; }
.stepper .wert { position: relative; }
.stepper input { width: 100%; height: 76px; border: 0; border-radius: 18px; background: #f7f6f2; box-shadow: 0 0 0 1px var(--line) inset; text-align: center; font-size: 38px; font-weight: 700; outline: none; }
.stepper input:focus { box-shadow: 0 0 0 3px var(--mc) inset; }
.stepper .einheit { position: absolute; right: 14px; bottom: 8px; font-size: 14px; font-weight: 600; color: var(--ink-3); pointer-events: none; }
.preis { margin-top: 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--mc) 9%, white); }
.preis b { font-size: 28px; letter-spacing: -0.01em; }
.preis small { color: var(--ink-2); font-size: 14px; }
.hinweis { color: var(--ink-2); font-size: 15px; margin-top: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg button { min-height: 72px; border-radius: 18px; padding: 8px 14px; background: #f7f6f2; box-shadow: 0 0 0 1.5px var(--line) inset; font-weight: 700; font-size: 18px; line-height: 1.25; transition: transform 120ms var(--ease); }
.seg button.an { background: var(--mc); color: #fff; box-shadow: none; }
.seg button:active { transform: scale(.98); }
textarea, .feld input { width: 100%; border: 0; border-radius: 14px; background: #f7f6f2; box-shadow: 0 0 0 1px var(--line) inset; padding: 14px 16px; font-size: 19px; outline: none; font-family: inherit; }
textarea { margin-top: 10px; min-height: 96px; resize: none; }
textarea:focus, .feld input:focus { box-shadow: 0 0 0 3px var(--mc) inset; }
.feld { display: grid; gap: 6px; margin-bottom: 12px; }
.feld label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.feld input { height: 58px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; min-height: 64px; padding: 10px 14px; border-radius: 16px; background: #f7f6f2; box-shadow: 0 0 0 1.5px var(--line) inset; margin-bottom: 8px; font-size: 17px; line-height: 1.3; transition: background 120ms; }
.opt .box { flex: none; width: 32px; height: 32px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 2px var(--ink-3) inset; display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 800; }
.opt.an { background: color-mix(in srgb, var(--mc) 10%, white); box-shadow: 0 0 0 2px var(--mc) inset; }
.opt.an .box { background: var(--mc); box-shadow: none; }
.opt .letzte { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.sig { position: relative; }
.sig canvas { display: block; width: 100%; height: 260px; background: #fff; border-radius: 16px; box-shadow: 0 0 0 1.5px var(--ink-3) inset; touch-action: none; }
.sig .x { position: absolute; left: 22px; bottom: 54px; color: var(--ink-3); font-size: 26px; pointer-events: none; }
.sig .linie { position: absolute; left: 20px; right: 20px; bottom: 50px; border-top: 1.5px dashed #c9c5ba; pointer-events: none; }
.sig .leerhinweis { position: absolute; inset: 0; display: grid; place-items: center; color: #b5b1a6; font-size: 20px; pointer-events: none; }
.sig .weg { position: absolute; top: 10px; right: 10px; }
.warnbox { border-radius: 16px; padding: 14px 16px; font-weight: 600; margin-bottom: 4px; }
.warnbox.ok { background: var(--ok-bg); color: var(--ok); }
.warnbox.warn { background: var(--warn-bg); color: var(--warn); }
.warnbox.bad { background: var(--bad-bg); color: var(--bad); }
.warnbox label { display: flex; gap: 12px; align-items: center; margin-top: 10px; font-weight: 700; }
.warnbox input[type=checkbox] { width: 30px; height: 30px; accent-color: var(--warn); }
.fuss { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 12px 16px calc(12px + var(--safe-b)); background: rgba(243,241,236,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.fuss .in { max-width: 1180px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.fuss .sum { flex: 1; min-width: 0; font-size: 15px; color: var(--ink-2); line-height: 1.3; }
.fuss .sum b { color: var(--ink); font-size: 17px; }
.fuss .btn { min-width: 280px; min-height: 68px; font-size: 21px; }

/* ---------- Heute ---------- */
.stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.stat div { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: 0 0 0 1px var(--line) inset; }
.stat b { display: block; font-size: 34px; letter-spacing: -0.02em; }
.stat span { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.hz { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--r); padding: 12px 16px; box-shadow: 0 0 0 1px var(--line) inset; }
.hz .t { flex: 1; min-width: 0; }
.hz .f { font-weight: 700; font-size: 18px; }
.hz .k { color: var(--ink-2); font-size: 15px; }

/* ---------- Modal / Toast ---------- */
.schleier { position: fixed; inset: 0; z-index: 20; background: rgba(20,23,28,.55); display: grid; place-items: center; padding: 20px; }
.modal { width: min(560px, 100%); background: var(--card); border-radius: 24px; padding: 24px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.modal h2 { margin: 0 0 6px; font-size: 24px; }
.modal p { color: var(--ink-2); margin: 0 0 16px; }
.modal .aktion { display: flex; gap: 10px; margin-top: 18px; justify-content: flex-end; }
.erfolg { text-align: center; padding: 14px 4px 4px; }
.erfolg .haken { width: 92px; height: 92px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 56px; display: grid; place-items: center; margin: 0 auto 14px; animation: pop 360ms var(--ease); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 99px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease), transform 220ms var(--ease); z-index: 40; max-width: 90vw; text-align: center; }
#toast.an { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
