/* ------------------------------------------------------------------------- *
 * Menketreffen 2026 — Wolfsberg
 * Ruhiges, editoriales Design: Papier & Tinte · Haarlinien · klare
 * Typografie-Hierarchie · eine gedeckte Akzentfarbe · Mobile-first
 * ------------------------------------------------------------------------- */

/* ---- Tokens --------------------------------------------------------------- */
:root {
  color-scheme: light;

  --paper:        #f4f3f0;
  --paper-deep:   #eceae5;
  --surface:      #ffffff;

  --ink:          #16181d;   /*  16.6:1 auf Papier */
  --ink-soft:     #3a4048;   /*  10.4:1 */
  --muted:        #5f6672;   /*   5.6:1 */

  --hairline:     #e3e1db;
  --hairline-strong: #cdc9c0;

  --accent:       #234c3c;   /* tiefes Pinien-Grün — sehr sparsam eingesetzt */
  --accent-hover: #193a2e;
  --accent-soft:  #e8eee9;
  --accent-text:  #234c3c;

  --clay:         #9a5f45;   /* warme Sekundärnote (Sonne, Kuchen, Suppe) */

  --warn:         #7d5a2e;  --warn-soft:    #f1ebe0;
  --info:         #3f5a72;  --info-soft:    #e9edf1;
  --plum:         #6b4a63;  --plum-soft:    #efe9ee;
  --ok:           #2f6b4f;  --ok-soft:      #e7f0ea;
  --pending:      #7d5a2e;  --pending-soft: #f1ebe0;
  --danger:       #9b2c22;  --danger-soft:  #f5e8e6;

  --tag-bg:       #eef0f2;  --tag-fg:       #33404d;
  --tag-warm-bg:  #f2ede4;  --tag-warm-fg:  #6b4d24;
  --tag-cool-bg:  #e9edf1;  --tag-cool-fg:  #34506a;

  --radius:       6px;
  --radius-sm:    4px;

  --shadow-none:  none;
  --shadow-soft:  0 1px 2px rgba(22, 24, 29, 0.04);

  --font-sans:    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                  Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --ease:         cubic-bezier(0.22, 0.61, 0.36, 1);
  --ink-line:     rgba(22, 24, 29, 0.14);

  --topbar-h:     3.4rem;
}

/* ---- Base ---------------------------------------------------------------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(16px, 0.4vw + 15px, 17px);
  line-height: 1.72;
  letter-spacing: 0.004em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent-text); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: rgba(35, 76, 60, 0.14); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Kleine Auszeichnungen (Labels) ---------------------------------------- */
.eyebrow,
.chip-label,
.card h2,
.day-tab,
.day-title,
.entry-list > summary,
.options.stacked .option > summary,
.read-only-tag,
.badge,
.tag,
.tfoot-label,
th,
form label {
  font-variant-caps: normal;
}

/* ---- VISUELLE BÜHNE: ruhiger Himmel ---------------------------------------- */
.visual-stage {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  /* Sehr zurückhaltender Verlauf über dem Papier */
  background: linear-gradient(180deg, #eef0f1 0%, #f3f2ef 48%, #f1ece4 100%);
}

.stage-bg {
  position: relative;
  width: 100vw;
  height: 100vh;
  will-change: filter;
  backface-visibility: hidden;
}

/* Nacht: tiefes, entsättigtes Nachtblau */
.ambient-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #10161f;
  opacity: 0;
  z-index: 3;
}

/* Sterne (erscheinen mit dem Mond) */
.starfield {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.starfield .star {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.7);
}

/* Slider + Himmelskörper: liegen ÜBER dem Inhalt (anfassbar) */
.sky-controls {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

/* Dämmerung: warmes, weiches Licht statt Bonbon-Orange */
.sunset-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(154, 95, 69, 0.32) 0%,
    rgba(184, 122, 82, 0.16) 42%,
    rgba(210, 170, 120, 0.05) 72%,
    transparent 100%
  );
  mix-blend-mode: multiply;
  opacity: 0;
  z-index: 2;
}

/* Sonne & Mond — ruhige, entsättigte Scheiben */
.celestial-body {
  position: fixed;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  will-change: transform, opacity;
  transform: translate3d(-200px, -200px, 0);
}

/* Seitliche Schiene für den Lesefortschritt */
.progress-rail {
  position: fixed;
  top: 5.75rem;
  bottom: 2rem;
  right: 48px;
  width: 1px;
  background: transparent;   /* Schiene unsichtbar; nur Sonne/Mond zeigen den Fortschritt */
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
}
.progress-rail::before {
  content: "";
  position: absolute;
  top: -0.5rem;
  bottom: -0.5rem;
  left: -16px;
  right: -16px;
  cursor: grab;
}
.progress-rail.is-dragging,
.progress-rail.is-dragging::before { cursor: grabbing; }
#moon {
  /* Nicht voller Mond: die unbeleuchtete Seite wird per Maske ...
     ... transparent (der Hintergrund scheint durch), Glow folgt der Sichel. */
  background:
    radial-gradient(circle at 32% 30%, rgba(120, 132, 152, 0.50) 0 5.5%, transparent 6.5%),
    radial-gradient(circle at 56% 58%, rgba(120, 132, 152, 0.40) 0 8%, transparent 9%),
    radial-gradient(circle at 41% 70%, rgba(120, 132, 152, 0.34) 0 4.5%, transparent 5.5%),
    radial-gradient(circle at 66% 33%, rgba(120, 132, 152, 0.30) 0 3.5%, transparent 4.5%),
    radial-gradient(circle at 26% 55%, rgba(120, 132, 152, 0.26) 0 3%, transparent 4%),
    radial-gradient(circle at 40% 36%, #ffffff 0%, #eceff3 55%, #d3d9e0 100%);
  -webkit-mask-image: radial-gradient(circle at 90% 42%, transparent 0 46%, #000 47%);
          mask-image: radial-gradient(circle at 90% 42%, transparent 0 46%, #000 47%);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  filter: drop-shadow(0 0 7px rgba(205, 220, 238, 0.8));
}
#sun {
  background: radial-gradient(
    circle at 40% 36%,
    var(--sun-core, #fff7dd) 0%,
    var(--sun-mid, #ffcf45) 48%,
    var(--sun-edge, #ef8f06) 100%
  );
  box-shadow:
    0 0 0 1px var(--sun-ring, rgba(168, 100, 14, 0.45)),
    0 0 22px 6px var(--sun-glow, rgba(239, 143, 6, 0.55)),
    0 0 70px 18px var(--sun-glow2, rgba(239, 143, 6, 0.28)),
    0 14px 34px rgba(120, 70, 10, 0.28);
}

/* ---- Scroll-Hinweis: leise, in Versalien ------------------------------------ */
.scroll-hint {
  position: fixed;
  bottom: calc(2.25rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(244, 243, 240, 0.86);
  border: 1px solid var(--hairline-strong);
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 15;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.scroll-hint::before {
  content: "";
  width: 1px;
  height: 1.1em;
  background: var(--hairline-strong);
  order: 2;
  display: none;
}

/* ---- Topbar ---------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0.65rem max(1.35rem, env(safe-area-inset-left)) 0.65rem max(1.35rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--topbar-h);
  background: rgba(244, 243, 240, 0.88);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--hairline);
  padding-top: calc(0.65rem + env(safe-area-inset-top));
}
.topbar h1 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  min-width: 0;
}
.topbar h1::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  background: var(--accent);
  flex-shrink: 0;
}
.topbar h1 a { color: inherit; }
.topbar nav { display: flex; align-items: center; gap: 0.5rem; }
.topbar .link,
.topbar button.link {
  background: transparent;
  border: 1px solid var(--hairline-strong);
  color: var(--ink-soft);
  padding: 0.42rem 0.95rem;
  min-height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.topbar .link:hover {
  background: var(--surface);
  border-color: var(--ink-soft);
  color: var(--ink);
  text-decoration: none;
}

/* ---- Layout ---------------------------------------------------------------- */
main {
  position: relative;
  z-index: 10;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem) calc(4rem + env(safe-area-inset-bottom));
}
main.story {
  max-width: 1400px;
  pointer-events: none;
}

/* ---- Story-Sektionen (gescrubbt) -------------------------------------------- */
html.js main.story .content-section {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(4.5rem, 8vh, 6rem) 0;
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  will-change: opacity, transform;
  backface-visibility: hidden;
}
main.story .content-section { pointer-events: auto; }

.day-inner { width: 100%; }
.day-section { scroll-margin-top: 5rem; }
.night-section { align-items: center; }

/* Kürzere Strecke zwischen den Tagen (überschreibt die 100vh der Sektion) */
html.js main.story .content-section.night-section {
  min-height: 66vh;
  min-height: 66dvh;
  padding: 2rem 0;
}

/* ---- Karten: flach, Haarlinie, kein Zierrat ---------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.35rem, 3vw, 2.1rem) clamp(1.2rem, 3vw, 2.3rem) clamp(1.5rem, 3vw, 2.3rem);
  margin-bottom: 1.75rem;
  position: relative;
}
.card.narrow {
  max-width: 430px;
  margin: clamp(3rem, 12vh, 7rem) auto;
  padding: clamp(2rem, 5vw, 3rem);
}
/* Login: Eingabefeld so breit/hoch wie der Button */
.card.narrow input[type=password],
.card.narrow input[type=text] {
  width: 100%;
  padding: 0.75rem 1rem;
}
.card.narrow-wide {
  max-width: 900px;
  margin: clamp(2rem, 6vh, 4rem) auto;
  padding: clamp(1.8rem, 5vw, 3rem);
}

.card h2 {
  margin: 0 0 1.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.card h2 + .lead { margin-top: -0.5rem; margin-bottom: 1.5rem; }
.card h3 {
  margin: 2rem 0 0.9rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.card h3:first-of-type { margin-top: 1.5rem; }

/* ---- Packliste -------------------------------------------------------------- */
.packliste-list {
  margin: 0;
  padding-left: 1.4rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.packliste-list li { padding: 0.2rem 0; }
.packliste-list strong { color: var(--ink); }
.packliste-list .packliste-done { color: var(--ok); font-weight: 600; }
.packliste-list .packliste-btn {
  display: inline-block;
  margin-left: 0.15rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.packliste-list .packliste-btn:hover,
.packliste-list .packliste-btn:focus-visible { background: var(--accent-soft); }

/* Anker-Sprünge aus der Packliste unter der Topbar landen */
[id^="anmeldung-"] { scroll-margin-top: 5rem; }
.card .lead {
  color: var(--ink-soft);
  font-size: 1rem;
  margin: 0 0 1.5rem;
}

/* ---- Hero (Login) ----------------------------------------------------------- */
.hero-card { text-align: left; }
.hero-badge {
  display: inline-block;
  padding: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2rem, 6vw, 3rem) !important;
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1rem !important;
  color: var(--ink);
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
  display: block !important;
  text-transform: none !important;
}
.hero-title em { font-style: italic; font-weight: 300; color: var(--accent); }
.hero-sub {
  color: var(--muted);
  font-size: 1rem;
  margin: 0 0 2rem;
  max-width: 30rem;
}
.hero-card form { text-align: left; }

/* ---- Formulare --------------------------------------------------------------- */
form label {
  display: block;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 0.9rem 0 0.4rem;
}
input[type=text],
input[type=password],
input[type=number],
select,
textarea {
  padding: 0.66rem 0.85rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  min-width: 0;
  font-size: max(0.95rem, 16px);
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-soft); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 76, 60, 0.12);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=number] {
  width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ---- Buttons --------------------------------------------------------------- */
button {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  border-radius: var(--radius-sm);
  padding: 0.62rem 1.25rem;
  min-height: 38px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
  touch-action: manipulation;
}
button:hover {
  background: var(--surface);
  border-color: var(--ink-soft);
  color: var(--ink);
}
button.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
button.primary:hover {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}
button.danger { background: transparent; color: var(--danger); border-color: rgba(155, 44, 34, 0.4); }
button.danger:hover { background: var(--danger-soft); color: var(--danger); }
button.link,
.link {
  background: none;
  border: 0;
  color: var(--accent-text);
  padding: 0;
  min-height: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 0;
}
button.link:hover, .link:hover {
  background: none;
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
form.inline { display: inline-flex; align-items: center; gap: 0.4rem; }

.actions { margin-top: 1.6rem; }
.actions .primary { width: 100%; padding: 0.9rem 1.5rem; }

/* ---- Tabellen --------------------------------------------------------------- */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.4rem 0 0.8rem;
  font-size: 0.9rem;
}
table th, table td {
  border-bottom: 1px solid var(--hairline);
  padding: 0.7rem 0.85rem;
  text-align: left;
  vertical-align: middle;
}
table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border-bottom: 1px solid var(--hairline-strong);
  white-space: nowrap;
}
table tbody tr { transition: background 0.12s var(--ease); }
table tbody tr:hover { background: #faf9f7; }
table tbody tr:last-child td { border-bottom: 0; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--paper-deep);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

/* ---- Tags & Badges: minimale Auszeichnungen ---------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--tag-bg);
  color: var(--tag-fg);
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag.erwachsen    { background: var(--tag-cool-bg); color: var(--tag-cool-fg); }
.tag.kind         { background: var(--tag-warm-bg); color: var(--tag-warm-fg); }
.tag.kind-unter-3 { background: #f6e9e7; color: #8a352b; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink-soft);
}
.badge.veg     { color: var(--ok); border-color: rgba(47, 107, 79, 0.35); }
.badge.fleisch { color: var(--warn); border-color: rgba(125, 90, 46, 0.35); }
.badge.vegan   { color: var(--ok); border-color: rgba(47, 107, 79, 0.35); }
.badge.ok      { color: var(--ok); border-color: rgba(47, 107, 79, 0.35); }
.badge.pending { color: var(--warn); border-color: rgba(125, 90, 46, 0.35); }

.age-value {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.essen-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%235f6672'><path d='M4.5 6l3.5 3.5L11.5 6' stroke='%235f6672' stroke-width='1' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 12px;
  padding-right: 1.8rem;
  min-width: 9rem;
  cursor: pointer;
  font-weight: 500;
}

/* ---- Zustände / Utilities ----------------------------------------------------- */
.error {
  background: var(--danger-soft);
  border-left: 2px solid var(--danger);
  padding: 0.8rem 1rem;
  color: #7d2018;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.muted  { color: var(--muted); font-style: normal; }
.muted.small { font-size: 0.82rem; }
.small  { font-size: 0.82rem; }
.hint   { color: var(--muted); font-size: 0.95rem; margin: 0.4rem 0 0.7rem; }
.stats  { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.hidden { display: none; }

/* ---- Gruppen-Kennzahlen --------------------------------------------------------- */
.group-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 0;
  margin: 0 0 1.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.summary-chip {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-right: 1px solid var(--hairline);
}
.summary-chip:last-child { border-right: 0; }
.summary-chip-total { background: var(--accent-soft); }
.summary-chip-total .chip-value { color: var(--accent-text); }
.chip-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.chip-value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.chip-value small {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  flex-basis: 100%;
}

.logout-form { display: none; }
.logout-link { display: none; }

/* ---- Auswahl-Seite ---------------------------------------------------------------- */
.picker { margin: 1.5rem 0 0.5rem; }
.picker-label {
  display: block;
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
#self-picker {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  cursor: pointer;
}
.family-list {
  margin: 1.5rem 0;
  padding: 1.25rem 1.4rem;
  background: #faf9f7;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}
.family-list .hint { margin: 0 0 0.75rem; font-size: 0.85rem; color: var(--muted); }
.family-list ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.2rem; }
.family-list label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  padding: 0.5rem 0.5rem;
  min-height: 42px;
  border-radius: var(--radius-sm);
  transition: background 0.12s var(--ease);
}
.family-list label:hover { background: var(--accent-soft); }
.family-list input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex-shrink: 0; }

/* ---- Personentabelle --------------------------------------------------------------- */
.roster .person-table { margin-top: 0.2rem; }
.person-name { font-size: 1.02rem; font-weight: 600; }
.essen-form { margin: 0; }
.meal-warn {
  margin: 0.45rem 0 0;
  padding: 0.35rem 0.55rem;
  max-width: 22rem;
  background: var(--warn-soft);
  color: var(--warn);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

/* ---- Info-Bild (z. B. Gruppenfoto) -------------------------------------------------- */
.info-image {
  margin: 0.6rem 0 0.9rem;
  position: relative;
}
.info-image img {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  box-shadow: 0 10px 30px rgba(22, 24, 29, 0.12);
}
.info-image::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 4.5rem;
  height: 3px;
  background: var(--accent);
}

/* ---- Grill-Bestellung direkt in den Kennzahlen -------------------------------------- */
.grill-summary .summary-chip { gap: 0.5rem; }
.chip-grill { display: inline-flex; align-items: center; margin: 0; }
.chip-grill input[type=number],
.chip-grill select {
  width: 3.6rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.3rem 0.35rem;
  border-radius: var(--radius-sm);
}
.chip-amount {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ---- Grill-Tabelle (Admin) ---------------------------------------------------------- */
.grill-grid tfoot th {
  background: #faf9f7;
  font-weight: 700;
  color: var(--ink);
  border-top: 2px solid var(--ink);
}
.tfoot-label { text-align: right; text-transform: none !important; letter-spacing: 0 !important; }

.row-note {
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.25rem;
  line-height: 1.45;
  max-width: 22rem;
  white-space: pre-wrap;
}

/* ---- Slots --------------------------------------------------------------------------- */
.agenda-card .slot:first-of-type { margin-top: 0.4rem; }

.slot {
  border: 0;
  border-top: 1px solid var(--hairline);
  padding: 0;
  margin: 0;
  background: transparent;
}
.slot:first-of-type { border-top: 0; }
.slot:hover { background: transparent; }

.slot-head {
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1.15rem 0 1.15rem;
}
.slot-time {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  justify-self: start;
  font-variant-numeric: tabular-nums;
}
.slot-main { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.slot-title {
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.35;
}
.slot-icon { display: none; }
.slot-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.organizer-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  border: 0;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.read-only-tag {
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0;
  border: 0;
}

/* Slot-Innenabstand */
.slot > .options,
.slot > .mutate,
.slot > .freizeit-grid,
.slot > .info-image,
.slot > form,
.slot > details,
.slot > ul.subitems,
.slot > p.hint { margin-left: 5.25rem; margin-right: 0; }
.slot > p.hint:first-child { margin-top: 0.4rem; }
.slot > form:last-child,
.slot > .mutate:last-child { margin-bottom: 1.25rem; }
.slot > .freizeit-grid { padding-bottom: 1rem; margin-top: 0.5rem; }
.slot > .options,
.slot > .mutate,
.slot > details,
.slot > form,
.slot > ul.subitems { padding-bottom: 0.25rem; }

.subitems {
  list-style: none;
  margin: 0.3rem 0 1rem 5.25rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.subitems li { padding: 0.15rem 0; }
.subitems li::before { content: "— "; color: var(--hairline-strong); }

/* ---- Programm-Optionen ------------------------------------------------------------------ */
.options { margin: 0.5rem 0 1rem; display: flex; flex-direction: column; gap: 0; }
.option { background: transparent; border: 0; border-top: 1px solid var(--hairline); padding: 0; }
.option:first-child { border-top: 0; }
.option .organizer { color: var(--muted); font-size: 0.85rem; }
.option ul.assigned { list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.88rem; color: var(--ink-soft); }
.option ul.assigned li::before { content: "— "; color: var(--hairline-strong); }

.options.stacked { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.5rem 0 1rem 5.25rem; }
.options.stacked .option { padding: 0; border-top: 1px solid var(--hairline); }
.options.stacked .option:first-child { border-top: 0; }
.options.stacked .option > summary {
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 0;
  min-height: 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: baseline;
  user-select: none;
  transition: color 0.15s var(--ease);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}
.options.stacked .option > summary strong { min-width: 0; font-weight: 600; }
.options.stacked .option .option-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; align-items: baseline; }
.options.stacked .option > summary:hover { color: var(--accent); }
.options.stacked .option > summary::-webkit-details-marker { display: none; }
.options.stacked .option > summary::after {
  content: "+";
  color: var(--muted);
  margin-left: auto;
  font-size: 0.95rem;
  font-weight: 400;
  transition: transform 0.2s var(--ease);
}
.options.stacked .option[open] > summary::after { content: "–"; }
.options.stacked .option .count {
  font-size: 0.66rem;
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.options.stacked .option ul.assigned {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  columns: 2;
  column-gap: 2rem;
}
.options.stacked .option ul.assigned li { padding: 0.1rem 0; break-inside: avoid; }
.options.stacked .option ul.assigned li::before { content: "— "; color: var(--hairline-strong); }
.options.stacked .option ul.assigned li.unassigned { color: var(--muted); font-style: italic; }
.options.stacked .option ul.assigned li.unassigned em { font-size: 0.75rem; }

/* ---- Zuweisungs-Formulare ------------------------------------------------------------------ */
.mutate {
  margin-top: 1.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--hairline-strong);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mutate-title {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.assign-form {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.75rem;
  align-items: center;
  transition: none;
}
.assign-form:focus-within { box-shadow: none; }
.assigner-name {
  margin: 0;
  font-weight: 600;
  font-size: 0.86rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}
.assign-form.unassigned .assigner-name { color: var(--clay); }
.assign-form.unassigned .assigner-name::after {
  content: "";
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--clay);
  margin-left: 0.45rem;
  vertical-align: middle;
}
.assign-form select {
  padding: 0.4rem 0.5rem;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  max-width: 18rem;
}
.assign-form select:disabled { cursor: not-allowed; color: var(--muted); }

/* Fallback-Button nur ohne JavaScript (JS speichert per fetch ohne Reload) */
.assign-submit { display: none; }
html:not(.js) .assign-submit {
  display: inline-flex;
  grid-column: 2;
  justify-self: start;
  margin-top: 0.35rem;
}
.nojs-submit { display: none; }
html:not(.js) .nojs-submit { display: inline-flex; }

/* ---- Listen --------------------------------------------------------------------------------- */
.entries { list-style: none; padding: 0; margin: 0.5rem 0; }
.entries li {
  padding: 0.6rem 0;
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--hairline);
}
.entries li:last-child { border-bottom: 0; }
.entries .entry-name { font-weight: 600; }
.entries .entry-who  { color: var(--muted); font-size: 0.92rem; }

.entry-kind {
  display: inline-block;
  background: transparent;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0;
}

.add-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.75rem 0 1.25rem; }
.add-form label { margin: 0; font-weight: 600; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.add-form input[type=text] { flex: 1 1 12rem; }

.entry-list { margin: 0.6rem 0; }
.entry-list > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.2rem 0;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  user-select: none;
  transition: color 0.15s var(--ease);
}
.entry-list > summary:hover { color: var(--ink); }
.entry-list > summary::before { content: "＋"; font-size: 0.7rem; }
.entry-list[open] > summary::before { content: "－"; }
.entry-list > summary::-webkit-details-marker { display: none; }
.entry-list > ul.entries { margin-top: 0.75rem; }

/* Aufklappbares "Wunsch eintragen"-Menü */
.add-details { margin-top: 0.9rem; }
.add-details > summary { color: var(--accent-text); }
.add-details > summary:hover { color: var(--accent-hover); }
.add-details > form.add-form { margin: 1rem 0 0.75rem; }

/* Suppe: Einzel- und Gruppenanmeldung */
.soup-actions { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; margin: 1rem 0 0.75rem; }
.soup-single { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.soup-single label { margin: 0; }
.soup-group { display: inline-flex; }
.soup-group button { border-color: var(--hairline-strong); }

/* ---- Freizeit ---------------------------------------------------------------------------------- */
.freizeit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 2.25rem;
}
.freizeit-grid h4 {
  margin: 0 0 0.6rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
  font-weight: 600;
}
.freizeit-grid h4 .organizer { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

.grill-qty { display: inline-flex; align-items: center; }
.grill-qty input[type=number], .grill-qty select { border-radius: var(--radius-sm); padding: 0.4rem 0.25rem; }

/* ---- Mobile: Personentabelle minimalistisch, einzeilig ---------------------------------------- */
@media (max-width: 760px) {
  .person-table { border: 0; background: transparent; }
  .person-table thead { display: none; }
  .person-table tbody tr {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--hairline);
  }
  .person-table tbody tr:last-child { border-bottom: 0; }
  .person-table tbody td { border: 0; padding: 0; display: block; }
  .person-table tbody td::before { display: none; }
  .person-table tbody td:nth-child(1) { flex: 1 1 auto; min-width: 0; }
  .person-table tbody td:nth-child(1) .person-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .person-table tbody td:nth-child(2) { flex: 0 0 auto; }
  .person-table tbody td:nth-child(3),
  .person-table tbody td:nth-child(4) { display: none; }
  .person-table tbody td:nth-child(5) { flex: 0 0 auto; }
  .person-table .age-value { font-size: 0.78rem; padding: 0.1rem 0.4rem; }
  .person-table .essen-select {
    min-width: 0;
    width: auto;
    max-width: 8.5rem;
    font-size: 0.85rem;
    padding: 0.4rem 1.6rem 0.4rem 0.55rem;
  }
}

/* ---- Mobile Feinheiten ---------------------------------------------------------------------------- */
@media (max-width: 760px) {
  main { padding-left: 1rem; padding-right: 1rem; }

  .topbar { padding-left: 1rem; padding-right: 1rem; }
  .topbar h1 { font-size: 0.7rem; letter-spacing: 0.18em; }
  .topbar h1 a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .celestial-body { width: 40px; height: 40px; }
  .progress-rail { right: 22px; top: 5rem; bottom: 1.25rem; }
  .progress-rail::before { left: -22px; right: -22px; }
  .scroll-hint { bottom: calc(1.25rem + env(safe-area-inset-bottom)); font-size: 0.62rem; letter-spacing: 0.14em; }

  html.js main.story .content-section { padding: 4.5rem 0; }

  .group-summary { grid-template-columns: 1fr; }
  .summary-chip { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .summary-chip:last-child { border-bottom: 0; }

  .day-nav { gap: 1.25rem; margin-left: -1rem; margin-right: -1rem; padding-left: 1rem; padding-right: 1rem; }
  .day-tab { font-size: 0.66rem; letter-spacing: 0.12em; }

  .slot-head { grid-template-columns: 3.4rem 1fr; gap: 0.75rem; padding: 1rem 0; }
  .slot-time { font-size: 0.78rem; }
  .slot > .options,
  .slot > .mutate,
  .slot > .freizeit-grid,
  .slot > .info-image,
  .slot > form,
  .slot > details,
  .slot > ul.subitems,
  .slot > p.hint { margin-left: 0; }
  .subitems { margin-left: 0; }

  .options.stacked .option ul.assigned { columns: 1; }

  /* Programm: Titel auf eigener Zeile, darunter Organisator + Anmeldezahl */
  .options.stacked .option > summary {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 0.2rem 0.75rem;
  }
  .options.stacked .option > summary strong { grid-column: 1; grid-row: 1; }
  .options.stacked .option > summary::after {
    grid-column: 2; grid-row: 1; justify-self: end; margin-left: 0;
  }
  .options.stacked .option > summary .option-meta { grid-column: 1 / -1; grid-row: 2; }

  .assign-form { grid-template-columns: 5.5rem 1fr; gap: 0.6rem; }
  .assign-form select { width: 100%; max-width: none; min-height: 42px; }

  /* Freie Eingabefelder bleiben einzeilig (eine Zeile, nicht gestapelt) */
  .add-form { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .add-form label { flex: 1 1 100%; margin-bottom: -0.15rem; }
  .add-form input[type=text], .add-form select { flex: 1 1 8rem; width: auto; min-height: 44px; }
  .add-form button { width: auto; min-height: 44px; flex: 0 0 auto; }

  .card.narrow { margin-top: clamp(2rem, 10vh, 4rem); }
  .card > table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 420px) {
  .day-nav { gap: 1rem; }
  .slot-head { grid-template-columns: 3.1rem 1fr; }
  .organizer-badge { font-size: 0.62rem; }
}

/* ---- Scrollbar ------------------------------------------------------------------------------------ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---- Zimmer-Link & Popup -------------------------------------------------- */
.room-link {
  appearance: none;
  border: 1px solid var(--hairline-strong);
  background: var(--tag-cool-bg);
  color: var(--tag-cool-fg);
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}
.room-link:hover, .room-link:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

.room-dialog {
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  width: min(24rem, calc(100vw - 2rem));
  box-shadow: 0 18px 48px rgba(22, 24, 29, 0.22);
}
.room-dialog::backdrop { background: rgba(22, 24, 29, 0.42); }
.room-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--hairline);
}
.room-dialog-head h3 { margin: 0; font-size: 1rem; }
.room-dialog-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.room-dialog-close:hover { color: var(--ink); }
.room-dialog-list {
  list-style: none;
  margin: 0;
  padding: 0.6rem 1rem 1rem;
}
.room-dialog-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--hairline);
}
.room-dialog-list li:last-child { border-bottom: 0; }
