/* WTB Messe – mobil zuerst. Farben und Schrift aus dem wetastebetter-Theme
   (gleiche Palette wie WTB Büro: Gold-Akzent, warmes Off-White, Inter). */

:root {
  --black:      #0a0a0a;
  --off-white:  #f8f6f2;
  --text:       #1a1a1a;
  --muted:      #6b6b6b;
  --border:     #e8e4df;
  --gold:       #c8941a;
  --gold-soft:  #f5e6d0;
  --green:      #2f7a4f;
  --green-soft: #e6f2eb;
  --red:        #a33232;
  --red-soft:   #f7e9e9;
  --blue-soft:  #e8f3f7;
  --radius:     10px;
  --font: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --tabbar-h:   62px;
}

* { box-sizing: border-box; }

/* Das hidden-Attribut muss auch bei Elementen mit eigenem display (z. B. .btn) gelten */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;            /* mind. 16px, sonst zoomt iOS beim Fokussieren in Felder */
  line-height: 1.45;
  color: var(--text);
  background: var(--off-white);
}

body.mit-tabs { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

a { color: inherit; }
h1 { font-size: 1.4rem; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.grow { flex: 1; min-width: 0; text-decoration: none; }
.inline { display: inline; margin: 0; }

/* ── Kopfzeile ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--black); color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.brand { color: #fff; text-decoration: none; font-weight: 600; letter-spacing: .02em; }
.brand::before { content: '●'; color: var(--gold); margin-right: .5rem; font-size: .8em; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.linklike {
  background: none; border: 0; padding: 4px 0; font: inherit; font-size: .78rem;
  color: #cfcac2; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

.page { max-width: 640px; margin: 0 auto; padding: 16px; }

/* ── Karten & Listen ── */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin: 0 0 10px;
}
.card-link { display: block; text-decoration: none; }
.card-title { font-weight: 600; }
.row-actions { display: flex; align-items: center; gap: 10px; }
.preis { font-weight: 600; white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 28px 8px; }
.sep { margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .04em; }

.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.messe-kopf { margin-bottom: 12px; }
.back { color: var(--muted); text-decoration: none; font-size: .9rem; }

.badge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  padding: 1px 9px; border-radius: 999px; font-size: .72rem; font-weight: 500;
  background: var(--border); color: var(--text);
}
.badge-aktiv, .badge-erledigt { background: var(--green-soft); color: var(--green); }
.badge-geplant, .badge-neu { background: var(--blue-soft); color: #25607a; }
.badge-nachfassen { background: var(--gold-soft); color: #8a6212; }

/* ── Formulare ── */
.stack > * + * { margin-top: 10px; }
.stack label, label { display: block; font-size: .85rem; font-weight: 500; margin: 12px 0 4px; }
.stack label:first-child, .card.stack label:first-of-type { margin-top: 0; }
input, select, textarea {
  width: 100%; padding: 11px 12px; font: inherit;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > div > label { margin-top: 12px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.filter { display: flex; gap: 8px; margin-bottom: 8px; }
.filter input { flex: 1; }
.filter select { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; font: inherit; font-weight: 500; text-decoration: none;
  color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.btn-primary { background: var(--black); border-color: var(--black); color: #fff; }
.btn-danger { background: #fff; border-color: var(--red); color: var(--red); }
.btn-block { display: flex; width: 100%; margin-top: 12px; }
.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.icon-btn {
  min-width: 44px; min-height: 44px; background: none; border: 0; color: var(--muted);
  font-size: 1rem; cursor: pointer;
}

/* ── Packliste (To-do-Liste mit Erledigt-Knopf) ── */
.todo {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 4px 8px 14px; margin-bottom: 8px;
}
.todo-text { flex: 1; min-width: 0; }
.todo-title { font-weight: 500; overflow-wrap: anywhere; }
.todo.done { background: var(--green-soft); border-color: transparent; }
.todo.done .todo-title { color: var(--muted); text-decoration: line-through; }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: .9rem; white-space: nowrap; }
.btn-done { background: var(--green); border-color: var(--green); color: #fff; }
.progress { height: 6px; border-radius: 999px; background: var(--border); margin: 0 0 12px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--green); }

/* ── Team-Matrix ── */
.matrix-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.matrix { border-collapse: separate; border-spacing: 4px; width: 100%; }
.matrix th, .matrix td { text-align: center; font-weight: 500; font-size: .85rem; }
.matrix thead th { padding-bottom: 4px; line-height: 1.25; }
.matrix th.name { text-align: left; white-space: nowrap; padding-right: 8px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.art { font-size: .7rem; font-weight: 500; color: var(--muted); }
.art-aufbau, .art-abbau { color: #8a6212; }
.cell {
  width: 100%; min-width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: #fff; font-size: 1.1rem; cursor: pointer;
}
.cell.on { background: var(--green); border-color: var(--green); }
.summe { color: var(--muted); padding-top: 4px; }

/* ── Benutzerverwaltung ── */
.zugang { background: var(--gold-soft); border-color: var(--gold); }
.zugang-zeile { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; background: #fff; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.pw-details { margin-top: 10px; }
.pw-details summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: 6px 0; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; margin-top: 12px; }
label.check input { width: auto; }
.badge-gesperrt { background: var(--red-soft); color: var(--red); }

/* Eingabefeld mit Knopf daneben (z. B. Drive-Link + Öffnen) */
.input-btn { display: flex; gap: 8px; }
.input-btn input { flex: 1; min-width: 0; }

/* ── Lead erfassen ── */
.btn-lg { min-height: 54px; font-size: 1.05rem; }
.hint { color: var(--muted); font-size: .88rem; margin-top: 8px; min-height: 1.2em; }
.vorschau { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.vorschau:empty { display: none; }
.vorschau img { height: 84px; width: auto; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.vorschau.gross { margin: 12px 0; }
.vorschau.gross img { height: 150px; }
.feld { margin: 0; }
.feld.unsicher input, .feld.unsicher select { border-color: var(--gold); background: #fffaf0; }
.feld.unsicher label::after { content: ' – bitte prüfen'; color: #8a6212; font-weight: 400; }
details { margin-top: 10px; }
details > summary { cursor: pointer; color: var(--muted); padding: 8px 0; font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip { margin: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; width: auto; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--border);
  border-radius: 999px; background: #fff; font-weight: 500; font-size: .95rem; cursor: pointer;
}
.chip input:checked + span { background: var(--black); border-color: var(--black); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.recorder .btn.recording { background: var(--red); border-color: var(--red); color: #fff; animation: puls 1.2s infinite; }
@keyframes puls { 50% { opacity: .75; } }
.takes { margin-top: 8px; }
.take { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.take audio { flex: 1; min-width: 0; height: 40px; }
.check-consent { align-items: flex-start; background: var(--gold-soft); padding: 10px 12px; border-radius: 8px; font-size: .9rem; }
.check-consent input { margin-top: 3px; }
label.check { cursor: pointer; }
label.check input { flex: 0 0 22px; height: 22px; }
.ki { background: #f4f1fb; border-color: #ddd5f0; }
.ki p { margin: .4rem 0 0; }
.snippet { margin: 4px 0; color: #4b4560; }
.transkript { margin: 8px 0 0; font-size: .95rem; white-space: pre-wrap; }
#erfolg a { color: inherit; font-weight: 600; }

/* ── Dubletten ── */
.dublette-box { border: 1px solid #e8c47a; background: #fffaf0; border-radius: var(--radius); padding: 12px 14px; margin: 0 0 10px; }
.dublette-box.sicher { border-color: var(--gold); background: var(--gold-soft); }
.dublette-box.info { border-color: var(--border); background: #fff; }
.dublette-zeile { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(0, 0, 0, .08); }
.dublette-zeile:first-of-type { border-top: 0; padding-top: 0; }
.dublette-aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dublette-box > .btn { margin-top: 12px; }
.dublette-lead { display: block; text-decoration: none; padding: 8px 0; border-top: 1px solid var(--border); }
.badge-dublette { background: var(--gold-soft); color: #8a6212; }
.flash-warn { display: block; background: var(--gold-soft); color: #8a6212; text-decoration: none; font-weight: 500; }

/* ── Meldungen ── */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: .95rem; }
.flash-success { background: var(--green-soft); color: var(--green); }
.flash-error { background: var(--red-soft); color: var(--red); }
.flash-message, .flash-info { background: var(--blue-soft); color: #25607a; }

/* ── Login ── */
.login-card { max-width: 380px; margin: 8vh auto 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }

/* ── Untere Tab-Leiste (Handy) ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: #fff; border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: var(--tabbar-h); font-size: .66rem; color: var(--muted); text-decoration: none;
}
.tabbar a span { font-size: 1.2rem; line-height: 1.1; margin-bottom: 2px; }
.tabbar a.active { color: var(--black); font-weight: 600; box-shadow: inset 0 3px 0 var(--gold); }

/* ── Dialog ── */
.dialog { border: 0; border-radius: var(--radius); max-width: 420px; width: calc(100% - 32px); padding: 20px; }
.dialog::backdrop { background: rgba(10, 10, 10, .45); }
.dialog ul { padding-left: 1.2rem; margin: .25rem 0; }

@media (min-width: 700px) {
  .page { padding-top: 28px; }
  body.mit-tabs { padding-bottom: 0; }
  .tabbar { position: sticky; top: 46px; bottom: auto; max-width: 640px; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius); }
}
