/* Meet & Eat – Design. Farben zentral in :root anpassen. */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --text-2: #44403c;
  --muted: #78716c;
  --subtle: #a8a29e;
  --line: #e7e5e4;
  --line-2: #d6d3d1;
  --hover: #f5f5f4;
  --accent: #7b2d3b;
  --accent-hover: #632230;
  --accent-soft: #f7eff1;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --warn: #a16207;
  --warn-soft: #fefce8;
  --err: #b91c1c;
  --err-soft: #fef2f2;
  --r: 8px;
  --r-lg: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
code { font-size: 0.875em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 40px; padding: 0 1rem; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--surface); color: var(--text); font: inherit; font-size: 0.9375rem; font-weight: 550;
  text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--err); }
.btn.sm { min-height: 32px; padding: 0 0.75rem; font-size: 0.875rem; }
.btn.lg { min-height: 48px; padding: 0 1.5rem; font-size: 1rem; }
.link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link.muted { color: var(--muted); }
.link.danger { color: var(--err); }

/* Formulare */
.stack { display: grid; gap: 1.25rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 0.375rem; align-content: start; }
label, .label { font-size: 0.875rem; font-weight: 550; }
.opt { font-weight: 400; color: var(--muted); }
.hint { font-size: 0.8125rem; color: var(--muted); }
.error { font-size: 0.8125rem; color: var(--err); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="search"], input[type="url"], select, textarea {
  width: 100%; min-height: 44px; padding: 0.5rem 0.75rem; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--surface); color: inherit; font: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--subtle); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
[aria-invalid="true"] { border-color: var(--err) !important; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 0.2rem 0 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.check { display: flex; gap: 0.625rem; align-items: flex-start; font-size: 0.9375rem; font-weight: 400; cursor: pointer; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 0.375rem; font-size: 0.875rem; font-weight: 550; }

.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.segmented label, .segmented button { position: relative; margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span, .segmented button {
  display: block; padding: 0.5rem 0.875rem; border: 0; border-left: 1px solid var(--line); background: none;
  color: var(--text-2); font: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer;
}
.segmented > :first-child span, .segmented > button:first-child { border-left: 0; }
.segmented input:checked + span, .segmented button[aria-pressed="true"] { background: var(--text); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

details.more > summary { cursor: pointer; color: var(--text-2); font-size: 0.9375rem; font-weight: 550; list-style: none; display: inline-flex; align-items: center; gap: 0.4rem; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; margin-right: 0.15rem; }
details.more[open] > summary::before { transform: rotate(45deg); }
details.more > .stack { margin-top: 1.25rem; }

.notice { padding: 0.75rem 1rem; border-radius: var(--r); font-size: 0.9375rem; background: var(--hover); color: var(--text-2); }
.notice.ok { background: var(--ok-soft); color: #14532d; }
.notice.warn { background: var(--warn-soft); color: #713f12; }
.notice.err { background: var(--err-soft); color: #7f1d1d; }
.notice ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }

/* ---------- Öffentliche Seite ---------- */
.page { max-width: 600px; margin: 0 auto; padding: 4rem 1.25rem 3rem; }
.page .intro { padding-bottom: 2.5rem; }
.kicker { margin-bottom: 0.75rem; color: var(--muted); font-size: 0.9375rem; }
.page .intro h1 { margin-bottom: 1rem; font-size: clamp(2rem, 7vw, 2.5rem); letter-spacing: -0.025em; }
.page .intro .lead { color: var(--text-2); font-size: 1.0625rem; }
.page .intro .btn { margin-top: 1.75rem; }
.page section { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.page section > h2 { margin-bottom: 1rem; }
.page section > p { color: var(--text-2); }
.schedule { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1.5rem; margin: 1.5rem 0 0; }
.schedule dt { color: var(--muted); font-variant-numeric: tabular-nums; }
.schedule dd { margin: 0; }
.facts { display: grid; gap: 0.625rem; margin: 0; padding: 0; list-style: none; color: var(--text-2); }
.facts li { position: relative; padding-left: 1.25rem; }
.facts li::before { content: ""; position: absolute; left: 0; top: 0.68em; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.done h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.done .teamnr { font-size: 3rem; font-weight: 700; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; margin: 0.25rem 0 1.5rem; }
.done p + p { margin-top: 0.75rem; }
.page footer { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.page footer a { color: var(--muted); }

/* ---------- Orga-Bereich ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-in { display: flex; align-items: center; gap: 2rem; max-width: 1180px; min-height: 56px; margin: 0 auto; padding: 0 1.5rem; }
.bar .title { font-weight: 650; white-space: nowrap; }
.nav { display: flex; flex: 1; gap: 1.5rem; overflow-x: auto; }
.nav a { padding: 1rem 0 calc(1rem - 2px); border-bottom: 2px solid transparent; color: var(--muted); font-size: 0.9375rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
@media (max-width: 720px) { .bar-in { flex-wrap: wrap; gap: 0 1rem; padding-top: 0.5rem; } .nav { order: 3; flex-basis: 100%; } }

.view { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.5rem 6rem; }
.view.narrow { max-width: 720px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.head p { margin-top: 0.25rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.block { margin-top: 3rem; }
.block > h2 { margin-bottom: 1rem; }

.kpis { display: flex; flex-wrap: wrap; gap: 1rem 3.5rem; margin-bottom: 3rem; }
.kpi b { display: block; font-size: 2rem; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi span { color: var(--muted); font-size: 0.875rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.steps { margin: 0; padding: 0 1.25rem; list-style: none; }
.steps li { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps .dot { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border: 1.5px solid var(--line-2); border-radius: 50%; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.steps .done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps .current .dot { border-color: var(--accent); color: var(--accent); }
.steps .txt { flex: 1; min-width: 0; }
.steps .txt b { display: block; font-weight: 550; }
.steps .done .txt b { color: var(--muted); font-weight: 450; }
.steps .txt span { color: var(--muted); font-size: 0.875rem; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; color: var(--text-2); font-size: 0.9375rem; }
.dotlabel { display: inline-flex; align-items: center; gap: 0.5rem; }
.dotlabel::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); }
.dotlabel.ok::before { background: var(--ok); }
.dotlabel.warn::before { background: var(--warn); }
.dotlabel.err::before { background: var(--err); }
.issues { margin: 0; padding: 0; list-style: none; }
.issues li { padding: 0.75rem 0; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--text-2); }
.issues li:first-child { border-top: 0; padding-top: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.toolbar input[type="search"] { max-width: 320px; }
.toolbar select { width: auto; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
table.t { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
table.t th { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; font-weight: 550; text-align: left; white-space: nowrap; }
table.t td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr.clickable { cursor: pointer; }
table.t tbody tr.clickable:hover td { background: var(--hover); }
table.t tr.off td { color: var(--subtle); }
table.t .num { width: 3.5rem; color: var(--muted); font-variant-numeric: tabular-nums; }
table.t .center { text-align: center; }
.name-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 550; text-align: left; cursor: pointer; }
.sub { color: var(--muted); font-size: 0.8125rem; }
.sub.warn { color: var(--warn); }
.below { display: flex; gap: 1.25rem; margin-top: 1rem; font-size: 0.875rem; }

.empty { padding: 4rem 1.5rem; text-align: center; }
.empty h2 { margin-bottom: 0.5rem; font-size: 1.25rem; }
.empty p { color: var(--muted); max-width: 460px; margin: 0 auto; }
.empty .actions { justify-content: center; margin-top: 1.75rem; }

/* Einteilung */
.course { margin-top: 3rem; }
.course-h { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 1rem; }
.course-h span { color: var(--muted); font-size: 0.875rem; }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.dtable { padding: 1rem 1.125rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.dtable .tl { display: flex; justify-content: space-between; align-items: center; min-height: 24px; margin-bottom: 0.375rem; color: var(--muted); font-size: 0.8125rem; }
.dtable .host { font-weight: 600; }
.dtable .addr { margin-bottom: 0.625rem; color: var(--muted); font-size: 0.8125rem; }
.guest { display: flex; gap: 0.5rem; width: calc(100% + 1rem); margin: 0 -0.5rem; padding: 0.375rem 0.5rem; border: 1px solid transparent; border-radius: 6px; background: none; color: inherit; font: inherit; font-size: 0.875rem; text-align: left; cursor: pointer; }
.guest:hover { background: var(--hover); }
.guest .n { min-width: 1.5rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.guest .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest .tag { color: var(--muted); font-size: 0.75rem; }
.guest.sel { background: var(--accent-soft); border-color: var(--accent); }
.guest.bad { background: var(--err-soft); color: var(--err); }
.dtable .notes { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; line-height: 1.5; }

/* E-Mails */
.mail-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
details.mail { border-top: 1px solid var(--line); }
details.mail:first-child { border-top: 0; }
details.mail > summary { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; list-style: none; cursor: pointer; }
details.mail > summary::-webkit-details-marker { display: none; }
details.mail > summary:hover { background: var(--hover); }
details.mail:first-child > summary { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.mail .n { width: 2rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mail .who { flex: 1; min-width: 0; }
.mail .who b { display: block; overflow: hidden; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.mail .who span { display: block; overflow: hidden; color: var(--muted); font-size: 0.8125rem; text-overflow: ellipsis; white-space: nowrap; }
.mail.sent .who b { color: var(--muted); font-weight: 450; }
.mail .state { color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }
.mail .state.err { color: var(--err); }
.mail .body { padding: 0.25rem 1rem 1.25rem 4rem; }
.mail .meta { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: 0.25rem 0.75rem; align-items: center; font-size: 0.875rem; }
.mail .meta .k { color: var(--muted); }
.mail pre { max-height: 380px; margin: 0.75rem 0 0; padding: 1rem; overflow: auto; background: var(--bg); border-radius: var(--r); font: inherit; font-size: 0.875rem; white-space: pre-wrap; }
@media (max-width: 640px) { .mail .body { padding-left: 1rem; } .mail .state { display: none; } }

/* Einstellungen */
.settings section { padding: 2rem 0; border-top: 1px solid var(--line); }
.settings section:first-of-type { border-top: 0; padding-top: 0; }
.settings section > h2 { margin-bottom: 1.25rem; }
.placeholders { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.75rem; }
.placeholders button { padding: 0.125rem 0.5rem; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); font: 0.8125rem ui-monospace, Consolas, monospace; cursor: pointer; }
.placeholders button:hover { border-color: var(--accent); color: var(--accent); }
.preview { max-height: 420px; overflow: auto; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: 0.875rem; white-space: pre-wrap; }
.savebar { position: fixed; left: 50%; bottom: 1.25rem; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: 0.625rem 0.625rem 0.625rem 1.25rem; transform: translateX(-50%); background: var(--text); color: #fff; border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); font-size: 0.9375rem; }
.savebar .btn.quiet { color: #d6d3d1; }
.savebar .btn.quiet:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* Dialog */
.modal-bg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: start center; padding: 6vh 1rem; overflow-y: auto; overscroll-behavior: contain; background: rgba(28, 25, 23, 0.4); }
.modal { width: min(640px, 100%); background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2); }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem 0; }
.modal .mb { padding: 1.25rem 1.5rem; }
.modal .mb h3 { margin: 1.75rem 0 1rem; color: var(--muted); font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.modal .mb h3:first-child { margin-top: 0; }
.modal .mf { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.5rem 1.25rem; border-top: 1px solid var(--line); }
.modal .mf .left { margin-right: auto; }

/* Hinweise unten rechts */
.toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 80; display: grid; gap: 0.5rem; }
.toast { max-width: 360px; padding: 0.75rem 1rem; border-radius: var(--r); background: var(--text); color: #fff; font-size: 0.9375rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); animation: tin 0.18s ease-out; }
.toast.err { background: var(--err); }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.login { display: grid; place-items: center; min-height: 100dvh; padding: 1rem; }
.login form { width: min(360px, 100%); }
.login h1 { margin-bottom: 1.5rem; }

/* Druck */
@media print {
  body { background: #fff; font-size: 10pt; }
  .bar, .no-print, .toasts, .savebar { display: none !important; }
  .view { max-width: none; padding: 0; }
  .tables { grid-template-columns: repeat(3, 1fr); gap: 6pt; }
  .dtable, .panel, .table-wrap { break-inside: avoid; border-color: #ccc; }
  .course { break-after: page; margin-top: 0; }
  .guest { padding: 1pt 0; margin: 0; width: 100%; }
}
