/*
 * Gastansicht – Grundlayout. Farben, Schriften und Formen kommen aus
 * public/css/themes/<design>.css über die Variablen unten.
 */
:root {
  --bg: #fff; --ink: #111; --muted: #555; --card: #fff; --line: #eee;
  --accent: #f50; --accent-ink: #111; --accent-2: #fc0; --accent-2-ink: #111;
  --selected-bg: #111; --selected-ink: #fff;
  --font-head: system-ui, sans-serif; --font-body: system-ui, sans-serif;
  --radius: 18px; --radius-btn: 16px; --border: 2px solid var(--ink);
  --hero-bg: var(--accent); --hero-ink: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
/* Links ohne Unterstreichung; beim Darüberfahren und per Tastatur unterstrichen */
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.made-with a { font-weight: 700; }
h1, h2 { font-family: var(--font-head); margin: 0; line-height: 1; }
h2 { font-size: 23px; font-weight: 700; margin-bottom: 6px; }
p { margin: 0; }
fieldset { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sub { font-size: 15px; color: var(--muted); }
.grow { flex: 1 1 auto; min-width: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

.page { max-width: 560px; margin: 0 auto; padding-bottom: 32px; }

/* Kopf */
.hero { position: relative; overflow: hidden; background: var(--hero-bg); color: var(--hero-ink); padding: 30px 22px 64px; border-radius: 0 0 36px 36px; }
.hero-content { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.hero .for { background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.hero h1 { font-size: clamp(40px, 12vw, 58px); font-weight: 800; letter-spacing: -1.5px; margin-top: 6px; max-width: 100%; hyphens: auto; overflow-wrap: anywhere; }
.hero h1.long { font-size: clamp(32px, 9vw, 48px) !important; }
.hero h1.very-long { font-size: clamp(28px, 7.5vw, 40px) !important; }
/* Mit JavaScript (js/titel.js): Wörter bleiben ganz, die Schrift wird stattdessen kleiner */
.hero h1.ganz { hyphens: manual; overflow-wrap: normal; }
.hero .host { font-size: 18px; font-weight: 600; }
.hero .motto { background: var(--accent-2); color: var(--accent-2-ink); border-radius: 10px; padding: 6px 12px; font-weight: 800; font-size: 15px; }
.deco { position: absolute; display: block; }
.dnum { display: none; line-height: 1; pointer-events: none; }

/* Hinweise */
.notice { margin: 16px 18px 0; border-radius: 14px; padding: 12px 16px; background: var(--card); border: var(--border); font-size: 15px; }
.notice .when { color: var(--muted); font-size: 14px; }
.notice.success { background: var(--accent-2); color: var(--accent-2-ink); border-color: transparent; font-weight: 700; }
.notice.error, .notice.cancelled { background: #FFE1D9; color: #8E2A14; border-color: #8E2A14; font-weight: 600; }

/* Karten */
.card { background: var(--card); border-radius: var(--radius); padding: 16px 18px; }
.info { position: relative; margin: -34px 18px 0; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.10); }
.info-row { display: flex; align-items: center; gap: 14px; }
.info-row strong { font-size: 16px; }
.icon { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--line); color: var(--ink); }
.route { font-weight: 800; padding: 12px 4px; }
.description { border-top: 1px solid var(--line); padding-top: 12px; }
.counter { margin: 18px 18px 0; text-align: center; font-weight: 600; }
.counter strong { font-family: var(--font-head); font-size: 22px; }

.section { padding: 26px 18px 0; }

/* Antwort */
.rsvp { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.choices { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 64px; padding: 6px; border: var(--border); border-radius: var(--radius-btn); background: var(--card); font-weight: 800; font-size: 15px; cursor: pointer; }
.choice input:checked + span { background: var(--selected-bg); color: var(--selected-ink); border-color: var(--selected-bg); }
.choice input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* Kästen sind <fieldset>: block statt flex – Safari setzt die <legend> in einem Flex-Fieldset trotz float auf die
   Rahmenkante (Überschrift ragt aus dem Kasten). Abstände deshalb per margin statt gap. */
.persons { border: 0; margin: 0; min-width: 0; display: block; }
.persons legend { float: left; width: 100%; font-weight: 800; margin: 0 0 10px; padding: 0; }
/* Sehr schmale Handys mit breiter Schrift: Plus/Minus rutscht unter die Bezeichnung statt seitlich überzustehen */
.person-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.person-row .stepper { margin-left: auto; }
.person-row label { display: flex; flex-direction: column; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--line); color: var(--ink); font-size: 22px; font-weight: 800; cursor: pointer; font-family: inherit; }
.stepper input { width: 52px; min-height: 44px; text-align: center; border: var(--border); border-radius: 12px; font: inherit; font-weight: 800; font-size: 18px; background: var(--card); color: var(--ink); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.message { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 15px; }
.message .sub { font-weight: 400; }
textarea, select { width: 100%; border: var(--border); border-radius: 14px; padding: 10px 14px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink); }
select { width: auto; min-height: 44px; padding: 0 10px; }

button.primary { min-height: 56px; border: 0; border-radius: var(--radius-btn); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 17px; font-weight: 800; cursor: pointer; }

/* Mitbringliste */
.items { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar > div { height: 8px; border-radius: 4px; background: var(--accent); }
.claim { display: flex; gap: 6px; align-items: center; }
.claim button { min-height: 44px; padding: 0 14px; border: var(--border); border-radius: 12px; background: var(--accent-2); color: var(--accent-2-ink); font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.claim button.mine { background: var(--selected-bg); color: var(--selected-ink); border-color: var(--selected-bg); }
.full { font-weight: 800; font-size: 14px; color: var(--muted); padding: 0 6px; }

.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.secondary { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; border: var(--border); border-radius: var(--radius-btn); background: var(--card); font-weight: 800; text-decoration: none; padding: 4px 8px; }

.privacy { display: flex; gap: 10px; align-items: flex-start; margin: 22px 18px 0; font-size: 15px; color: var(--muted); }
.privacy svg { flex-shrink: 0; margin-top: 1px; }


.made-with { margin: 28px 18px 0; text-align: center; font-size: 15px; color: var(--muted); }
.made-with a, .made-with button { display: inline-flex; align-items: center; min-height: 44px; }

/* Allergien & Musikwünsche */
.diet, .songs { border: 0; margin: 0; min-width: 0; display: block; }
.diet legend, .songs legend { float: left; width: 100%; font-weight: 800; margin: 0 0 10px; padding: 0; }
.persons > legend + *, .diet > legend + *, .songs > legend + * { clear: both; }
.persons > :not(legend) + :not(legend), .diet > :not(legend) + :not(legend), .songs > :not(legend) + :not(legend) { margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: var(--border); border-radius: 999px; background: var(--card); font-weight: 700; font-size: 14px; cursor: pointer; }
.chip input:checked + span { background: var(--selected-bg); color: var(--selected-ink); border-color: var(--selected-bg); }
.chip input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.rsvp input[type=text] { width: 100%; min-height: 44px; border: var(--border); border-radius: 12px; padding: 0 12px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink); }
.song-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.song-row label { display: flex; flex-direction: column; gap: 2px; }
.songs > .song-auf-liste { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-weight: 700; }
.song-auf-liste svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.icon.i4 { background: var(--line); }
.actions .wide { grid-column: 1 / -1; }

/* Ablaufplan, Fahrgemeinschaft */
.schedule { list-style: none; margin: 12px 0 0; display: flex; flex-direction: column; gap: 12px; }
.schedule li { display: flex; gap: 14px; align-items: baseline; }
.schedule .time { font-family: var(--font-head); font-weight: 800; font-size: 18px; min-width: 56px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check-line input { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--accent); }
.item .secondary { min-height: 44px; }

/* Live-Summe der Personen, Hinweis auf ungesendete Antwort, Meldung am Abschnitt */
.persons-total { font-weight: 800; margin: 2px 0 0; }
.notice.inline { margin: 12px 0 0; }
.unsaved { margin: 12px 0 0; border-radius: 14px; padding: 10px 14px; background: #FFF4CC; color: #4A3500; border: 2px solid #8A6A00; font-size: 15px; font-weight: 700; }
a.sub { display: inline-flex; align-items: center; min-height: 44px; }
/* Stehen Hinweise zwischen Kopf und Infokarte, darf die Karte nicht über sie rutschen */
.hero ~ .notice ~ .info { margin-top: 16px; }
/* Platzhalter in Nebentextfarbe des Designs (Kontrast in allen Designs ≥ 4,5 : 1) */
.rsvp input::placeholder, .rsvp textarea::placeholder { color: var(--muted); opacity: 1; }
.rsvp input[type=tel], .song-row input[type=number] { width: 100%; min-height: 44px; border: var(--border); border-radius: 12px; padding: 0 12px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink); }
.unsaved a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
/* Vorschau und gesperrte Bereiche: Bedienelemente sichtbar, aber nicht nutzbar */
fieldset.preview-lock { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.rsvp :disabled, .claim :disabled, button:disabled { cursor: not-allowed; }
.claim button:disabled, button.primary:disabled, .actions button:disabled { opacity: .7; }
.notice.preview { border-style: dashed; font-weight: 600; }
/* Beispiel-Einladung: Weg zur eigenen Feier als deutlicher Link */
/* Beispiel: Design wechseln */
.beispiel-design { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.beispiel-design label { font-weight: 800; }
.beispiel-design select { flex: 1; min-width: 0; min-height: 44px; border: var(--border); border-radius: 12px; padding: 0 12px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink); }
.beispiel-design button { min-height: 44px; }
.notice.preview a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.actions button.secondary { font: inherit; font-weight: 800; color: inherit; width: 100%; }
.ride-details { display: flex; flex-direction: column; gap: 10px; }
.rsvp input::placeholder, .rsvp textarea::placeholder { font-weight: 400; }

/* Unkostenbeitrag nach der Zusage (invite/partials/beitrag) */
.beitrag { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.beitrag p { margin: 0; }
.beitrag-summe { font-size: 20px; font-weight: 800; }
.pay-button { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: var(--radius-btn); background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 800; text-decoration: none; }
.pay-button[aria-disabled] { opacity: .7; }
.verwendung-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; }
.verwendung-zeile strong { overflow-wrap: anywhere; }
.kopieren { min-height: 44px; padding: 0 12px; border: var(--border); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }

.bezahlt-hinweis { font-weight: 800; font-size: 16px; margin: 0; }

/* Kurze Bestätigung nach dem automatischen Speichern (public/js/antwort.js) */
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--card); font-weight: 800; font-size: 16px; line-height: 1.35; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); text-align: center; }
.toast::before { content: "✓ "; }
.toast.fehler { background: #A3261A; color: #fff; }
.toast.fehler::before { content: ""; }
.autosave-hinweis { margin: 0; }

/* Namen (freiwillig) und „wie viele?“ je Ernährungsart */
details.namen { margin-top: 6px; }
details.namen > summary { font-weight: 800; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; list-style: none; }
details.namen > summary::-webkit-details-marker { display: none; }
details.namen > summary::before { content: "+"; color: var(--accent); font-size: 20px; width: 14px; }
details.namen[open] > summary::before { content: "−"; }
.namen-liste { display: grid; gap: 8px; }
.namen-liste label { display: flex; align-items: center; gap: 10px; }
.namen-liste label span { width: 128px; flex: none; font-weight: 700; white-space: nowrap; }
.namen-liste input { flex: 1; min-width: 0; min-height: 46px; border: var(--border); border-radius: 12px; padding: 0 12px; font: inherit; background: var(--card); color: var(--ink); }
.wieviele { background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.wieviele > p { margin: 0 0 4px; font-weight: 800; }
.wieviele .person-row { padding: 4px 0; }
.wieviele .stepper button { width: 44px; height: 44px; font-size: 20px; }
.wieviele .stepper input { width: 44px; min-height: 44px; }
.check.speichern { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check.speichern input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--selected-bg); }

.beitrag p, .beitrag .verwendung { font-size: 15px; }
.beitrag .verwendung .sub { font-size: 14px; }
.beitrag-liste { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 15px; }
.beitrag-liste > span { white-space: nowrap; }

/* Freiwilliger Zusatz – dezent unter dem Beitrag */
.zusatz { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.zusatz-frage { margin: 0; font-weight: 800; font-size: 15px; }
.zusatz-frage .sub { display: block; font-weight: 500; }
.zusatz-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.zusatz-knoepfe button { min-height: 44px; padding: 0 14px; border: var(--border); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.zusatz-knoepfe button.gewaehlt { background: var(--selected-bg); color: var(--selected-ink); border-color: var(--selected-bg); }
.zusatz-eigen { display: flex; gap: 8px; }
.zusatz-eigen input { flex: 1; min-width: 0; min-height: 44px; border: var(--border); border-radius: 12px; padding: 0 12px; font: inherit; background: var(--card); color: var(--ink); }

/* Liedvorschläge unter dem Titel-Feld (public/js/musik.js) – höchstens 5, keine eigene Scrollfläche */
.musik-vorschlaege { grid-column: 1 / -1; list-style: none; margin: 0; padding: 4px; border: var(--border); border-radius: 12px; background: var(--card); }
.musik-vorschlaege button { width: 100%; text-align: left; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.musik-vorschlaege button:hover, .musik-vorschlaege button:focus-visible { background: var(--line); }
.musik-vorschlaege .titel { font-weight: 800; }
.musik-vorschlaege .interpret { display: block; font-size: 14px; color: var(--muted); font-weight: 500; }
.musik-vorschlaege .schon { font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.musik-vorschlaege .leer { padding: 8px 10px; font-size: 14px; color: var(--muted); }

/* Vorschau für Gastgeber: Leiste „Zurück zur Feier“ bleibt oben stehen (auch in der installierten App) */
.vorschau-zurueck { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; min-height: calc(48px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0; background: #1C1830; color: #fff; font: 700 16px/1.2 system-ui, sans-serif; text-decoration: none; }
.vorschau-zurueck:hover, .vorschau-zurueck:focus-visible { text-decoration: none; opacity: .9; }

/* Nach einer Zusage: Termin direkt in den Kalender */
.kalender-jetzt { margin: 4px 0 14px; }

/* Save the Date (invite/save-the-date): Vorankündigung mit früher Absage */
.std-folgt { margin: 0; font-weight: 700; }
.std-karte .secondary { font: inherit; font-weight: 800; color: inherit; }
.std-absage { margin: 18px 18px 0; display: grid; gap: 10px; }
.std-absage h2 { margin: 0; font-size: 20px; }
.std-absage p { margin: 0; }
.std-absage form { margin: 0; }
.std-absage .secondary { width: 100%; font: inherit; font-weight: 800; color: inherit; cursor: pointer; }
.std-absage .secondary:disabled { cursor: default; opacity: .6; }

/* Anmelde-Link (anmeldung/show, anmeldung/bestaetigen) und Warteliste (invite/warteliste) – Business */
.anm-karte { margin: 18px 18px 0; display: grid; gap: 12px; }
.anm-karte h2 { margin: 0; font-size: 20px; }
.anm-karte p { margin: 0; }
.anm-karte form { margin: 0; display: grid; gap: 14px; }
.anm-karte input[type=text], .anm-karte input[type=email] { width: 100%; min-height: 48px; border: var(--border); border-radius: 12px;
  padding: 0 14px; font: inherit; font-size: 16px; background: var(--card); color: var(--ink); }
.anm-karte button.primary { width: 100%; }
.anm-karte button.primary:disabled { cursor: default; }
.anm-karte .secondary { width: 100%; font: inherit; font-weight: 800; color: inherit; cursor: pointer; }
.anm-plaetze { font-weight: 700; }
.anm-falle { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Einlass-Code (Business Phase 4) – QR immer schwarz auf weiß, damit jede Kamera ihn liest */
.einlass-code { display: grid; justify-items: center; gap: 10px; text-align: center; }
.einlass-code p { margin: 0; }
.einlass-qr { background: #fff; padding: 12px; border-radius: 12px; line-height: 0; }
.einlass-qr svg { width: 220px; height: 220px; max-width: 100%; }

/* Business-Branding: Logo der Firma über dem Titel (invite/partials/firmenlogo) – auf weißem Grund, damit dunkle Logos auch auf dunklem Kopf lesbar sind */
.firmenlogo-einladung { display: block; height: 48px; width: auto; max-width: 70%; object-fit: contain; margin: 0 0 16px;
  background: #FFFFFF; border-radius: 8px; padding: 6px 10px; box-sizing: content-box; }

/* Motto-Abstimmung (invite/partials/motto) */
.motto-wahl { display: grid; gap: 12px; }
.motto-wahl p { margin: 0; }
.motto-wahl form { display: grid; gap: 14px; margin: 0; }
.motto-wahl fieldset { border: 0; margin: 0; padding: 0; }
.motto-liste { margin: 0; padding-left: 20px; font-weight: 700; }
