:root {
  --bg: #000;
  --panel: #111;
  --line: #222;
  --text: #fff;
  --muted: #8e8e93;
  --accent: #ff3b30;
  --radius: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
body.withtabs { padding-bottom: calc(64px + var(--safe-bottom)); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg:not(.leaflet-zoom-animated) { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h1 { font-size: 24px; line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 24px 0 8px; }
small { color: var(--muted); }

#view { min-height: 100vh; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 8px; }
.areabtn { display: inline-flex; align-items: center; gap: 4px; font-size: 26px; font-weight: 800; }
.areabtn svg { width: 26px; height: 26px; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); }
.iconbtn.on { background: var(--text); color: var(--bg); }
.genrebar { margin: 0 16px 8px; color: var(--muted); font-size: 14px; }
.genrebar b { color: var(--text); }
.genrebar button { margin-left: 6px; color: var(--muted); }
.hint { margin: 0 16px 12px; color: var(--muted); font-size: 14px; }

.chips, .tabsrow { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar, .tabsrow::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.tabsrow { border-bottom: 1px solid var(--line); padding-bottom: 0; gap: 20px; }
.tabsrow .chip { border: 0; border-radius: 0; padding: 8px 0 10px; background: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabsrow .chip.on { color: var(--text); border-bottom-color: var(--text); background: none; }

.dayhead {
  position: sticky; top: 0; z-index: 2; margin: 0; padding: 14px 16px 6px; background: var(--bg);
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}

.card { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card:active, .row:active, .arearow:active { background: var(--panel); }
.thumb { flex: none; width: 88px; height: 88px; object-fit: cover; border-radius: 6px; background: var(--panel); }
.thumb.noimg { background: linear-gradient(135deg, #1c1c1e, #0b0b0b); }
.cardbody { min-width: 0; flex: 1; }
.cardtitle { font-weight: 700; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.badges { display: flex; gap: 6px; margin-top: 4px; align-items: center; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 4px; background: var(--text); color: var(--bg); }
.badge.live { background: var(--accent); color: #fff; }
.savedmark { color: var(--accent); font-size: 12px; }

.loading { display: flex; justify-content: center; gap: 6px; padding: 32px; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: 0.15s; }
.loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 12px; }
.end { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }

.searchbox { padding: 4px 16px 8px; }
.searchbox input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: inherit; font-size: 16px; outline: none;
}
.searchbox input:focus { border-color: var(--muted); }

.arealist { display: flex; flex-direction: column; }
.arearow { display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 13px 16px;
  border-bottom: 1px solid var(--line); font-size: 16px; }
.arearow.on { font-weight: 700; }
.arearow.on::after { content: "✓"; }

.row { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.rowimg { flex: none; width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--panel); }

.hero { background: var(--panel); }
.heroimg { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #0b0b0b; }
.detail { padding: 16px; }
.detail > .badge { margin-bottom: 8px; }
.when { margin-top: 6px; font-size: 16px; font-weight: 600; }
.venuebox { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px;
  padding: 12px 14px; border-radius: var(--radius); background: var(--panel); }
.venuebox svg { flex: none; color: var(--muted); }
.actions { display: flex; gap: 8px; margin-top: 14px; }
.btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  padding: 0 14px; border-radius: var(--radius); background: var(--panel); font-weight: 600; border: 1px solid var(--line); }
.btn.on { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.ghost { background: none; }
#sharebtn { flex: none; width: 48px; padding: 0; }
blockquote { margin: 18px 0 0; padding: 0 0 0 12px; border-left: 3px solid var(--accent); color: #ddd; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 18px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.lineup { white-space: pre-line; font-size: 16px; line-height: 1.55; color: var(--muted); }
.lineup b, .artistlink { color: var(--text); font-weight: 700; }
.artistlink { border-bottom: 1px solid #444; }
.content { margin-top: 16px; white-space: pre-line; color: #ddd; overflow-wrap: anywhere; }
.content a { color: var(--text); text-decoration: underline; }
.extlink { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: underline; overflow-wrap: anywhere; }
.source { margin-top: 28px; color: var(--muted); font-size: 12px; }
.headrow { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.logo { width: 56px; height: 56px; border-radius: 8px; object-fit: contain; background: #fff; }
.avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--panel); }
.list { border-top: 1px solid var(--line); }

#map { height: 300px; margin: 0 16px 8px; border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.darktiles { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9) grayscale(0.6); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #1c1c1e; color: var(--text); }
.leaflet-popup-content a { color: var(--text); text-decoration: underline; }
.leaflet-container .leaflet-control-attribution { background: rgba(0, 0, 0, 0.6); color: var(--muted); }
.leaflet-container .leaflet-control-attribution a { color: var(--muted); }

#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: flex;
  padding-bottom: var(--safe-bottom); background: rgba(0, 0, 0, 0.92); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
#tabs[hidden] { display: none; }
#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px;
  font-size: 11px; color: var(--muted); }
#tabs a.on { color: var(--text); }

/* ---------- Plattform: Konto, Tickets, Veranstalter, Admin ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint.small { font-size: 13px; }
.mx { margin-left: 16px; margin-right: 16px; }
.grow { flex: 1; }
.topactions { display: flex; gap: 8px; }
.badge.outline { background: none; color: var(--text); border: 1px solid #555; }
.badge.warn { background: #ff9f0a; color: #000; }
.notice { margin: 8px 0 12px; padding: 10px 12px; border-radius: var(--radius); background: #2a2010; color: #ffd60a; font-size: 14px; }
.btn.wide { display: flex; width: 100%; margin-top: 10px; }
.btn.small { flex: none; min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.danger, .linkbtn.danger { color: var(--accent); }
.btn.icononly { flex: none; width: 48px; padding: 0; }
.btn:disabled { opacity: 0.4; }
.linkbtn { color: var(--muted); text-decoration: underline; font-size: 13px; padding: 4px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding-left: 0; padding-right: 0; }

.tiers { display: flex; flex-direction: column; gap: 8px; }
.tier { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--radius); background: var(--panel); }
.tierprice { font-weight: 700; white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; background: #222; font-size: 20px; line-height: 1; }
.stepper span { min-width: 24px; text-align: center; font-weight: 700; }
.summary { margin: 16px 0 4px; padding: 12px 14px; border-radius: var(--radius); background: var(--panel); }
.summary:empty { display: none; }
.summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--muted); }
.summary > div.total { color: var(--text); font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.summary.small { font-size: 14px; }
.field input, .form input, .form select, .form textarea, .sheetbox textarea, .sheetbox input {
  width: 100%; padding: 11px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font: inherit; font-size: 16px; outline: none; }
.form textarea, .sheetbox textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .field input:focus { border-color: var(--muted); }
.form label { display: block; margin-top: 12px; color: var(--muted); font-size: 13px; }
.form label > input, .form label > select, .form label > textarea { margin-top: 4px; }
.form label.check, label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; margin-top: 12px; }
label.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two label { min-width: 0; }
input[type="datetime-local"] { min-height: 44px; }
.searchbox.nopad { padding: 4px 0 6px; }
.imgpick { display: grid; place-items: center; width: 96px; height: 96px; border-radius: var(--radius); background: var(--panel);
  border: 1px dashed #444; color: var(--muted); font-size: 13px; overflow: hidden; cursor: pointer; text-align: center; }
.imgpick.flyer { width: 100%; height: auto; min-height: 140px; margin-top: 12px; }
.imgpick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgpick.flyer img { max-height: 360px; object-fit: contain; }
.imgpick.busy { opacity: 0.4; }
.subform { margin-top: 8px; padding: 4px 12px 12px; border-radius: var(--radius); background: #0b0b0b; border: 1px solid var(--line); }
.lineupedit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.luitem { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--panel); }
.luitem span { flex: 1; font-weight: 600; }
.tieredit { margin-top: 10px; padding: 4px 12px 10px; border-radius: var(--radius); background: var(--panel); }
.tieredit input { background: #0b0b0b; }
.tierfoot { display: flex; justify-content: space-between; align-items: center; }
details summary { margin-top: 10px; color: var(--muted); font-size: 13px; cursor: pointer; }
.actions.sticky { position: sticky; bottom: 0; padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.manageevent { border-bottom: 1px solid var(--line); }
.manageevent .card { border-bottom: 0; padding-bottom: 6px; }
.manageevent .notice { margin: 0 16px 10px; }
.managebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 16px 12px; }

.ticketlist { display: flex; flex-direction: column; gap: 14px; padding: 0 16px 24px; }
.ticket { border-radius: 14px; background: #fff; color: #000; overflow: hidden; }
.ticket.dim { opacity: 0.45; }
.ticket .qr { padding: 18px 18px 6px; }
.ticket .qr svg { width: 100%; height: auto; display: block; }
.ticketinfo { padding: 6px 18px 16px; border-top: 2px dashed #ddd; }
.ticketinfo .meta { color: #555; }
.scanres { margin-top: 12px; padding: 16px; border-radius: var(--radius); text-align: center; font-size: 17px; }
.scanres.ok { background: #0f3d1e; color: #30d158; }
.scanres.bad { background: #3d0f0f; color: #ff453a; }
.scanres .btn { color: var(--text); }
.arearow.done { color: var(--muted); }
.facts.copy dd { overflow-wrap: anywhere; cursor: pointer; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 16px 12px; }
.stats > div { padding: 12px; border-radius: var(--radius); background: var(--panel); }
.stats b { display: block; font-size: 20px; }
.stats span { color: var(--muted); font-size: 12px; }
.admincard { margin: 10px 16px; padding: 12px 14px; border-radius: var(--radius); background: var(--panel); }
.admincard .actions { margin-top: 10px; }
.adminbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px;
  border-radius: var(--radius); border: 1px dashed #444; }
.avatar.initials { display: grid; place-items: center; width: 56px; height: 56px; font-size: 24px; font-weight: 800; }

.sheet { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; background: rgba(0, 0, 0, 0.6); }
.sheetbox { width: 100%; padding: 16px 16px calc(16px + var(--safe-bottom)); border-radius: 16px 16px 0 0; background: #1c1c1e; }
.sheetbox h3 { margin: 0 0 10px; font-size: 17px; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(80px + var(--safe-bottom)); z-index: 3000; padding: 12px 14px;
  border-radius: var(--radius); background: #f2f2f7; color: #000; font-weight: 600; text-align: center;
  opacity: 0; transform: translateY(10px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
#toast.show { opacity: 1; transform: none; }
#toast.error { background: var(--accent); color: #fff; }
.summary > div.total:first-child { border-top: 0; margin-top: 0; padding-top: 3px; }
