/* ==========================================================================
   /app/haushalt (public/app/haushalt.php). Präfix hx-. Neu 21.11.2026.
   Bilder aus dem Alltag statt Kacheln: Klingelschild (Name und Bewohner), Einkaufszettel (gemeinsame Listen),
   Schlüsselanhänger (Einladungscode). Verwaltung als ruhige Zeilen am Ende.
   ========================================================================== */

.hx {
  --hx-metall-1: #eef0ee; --hx-metall-2: #cfd4d1; --hx-gravur: #3c4541; --hx-gravur-licht: rgba(255,255,255,.75);
  --hx-papier: #fffbeb; --hx-papier-linie: rgba(59,130,246,.13); --hx-tinte: #2b2a24;
  background: var(--rf-hg); color: var(--rf-text); font-family: var(--rf-schrift-text);
  padding: clamp(28px, 4.5vw, 64px) 0 clamp(72px, 9vw, 120px); overflow-x: clip;
}
[data-theme="dark"] .hx {
  --hx-metall-1: #3a403d; --hx-metall-2: #262b29; --hx-gravur: #dfe5e1; --hx-gravur-licht: rgba(0,0,0,.55);
  --hx-papier: #29271f; --hx-papier-linie: rgba(147,197,253,.08); --hx-tinte: #ece6d4;
}
.hx-rahmen { width: 100%; max-width: calc(1040px + 2 * var(--rf-seitenrand)); margin-inline: auto; padding-inline: var(--rf-seitenrand); }
.hx h1, .hx h2 { font-family: var(--rf-schrift-titel); letter-spacing: -.03em; color: var(--rf-text); text-wrap: balance; margin: 0; }
.hx h2 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; font-weight: 800; }
.hx p { line-height: 1.6; margin: 0; }
.hx-klein { font-size: var(--rf-text-sm); color: var(--rf-text-3); margin-top: 10px !important; }
.hx-nur-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hx section + section { margin-top: clamp(56px, 7vw, 88px); }

/* ── Knöpfe ───────────────────────────────────────────────────────────── */
.hx-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: var(--rf-radius-rund); border: 1px solid var(--rf-rand-stark); background: var(--rf-flaeche); color: var(--rf-text);
  font: 600 15px/1.2 var(--rf-schrift-text); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--rf-dauer-kurz), border-color var(--rf-dauer-kurz), transform var(--rf-dauer-kurz);
}
.hx-knopf:hover { border-color: var(--rf-text-3); }
.hx-knopf:active { transform: scale(.98); }
.hx-knopf:disabled { opacity: .55; cursor: progress; }
.hx-knopf--voll { background: var(--rf-akzent); border-color: var(--rf-akzent); color: var(--rf-akzent-auf); }
.hx-knopf--voll:hover { background: var(--rf-akzent-stark); border-color: var(--rf-akzent-stark); }
.hx-knopf--gefahr { color: var(--rf-gefahr); }
.hx-knopf--gefahr:hover { border-color: var(--rf-gefahr); }
.hx-knopf--voll.hx-knopf--gefahr { background: var(--rf-gefahr); border-color: var(--rf-gefahr); color: #fff; }
.hx :focus-visible { outline: 2px solid var(--rf-fokus); outline-offset: 2px; }

/* ── Klingelschild (Kopf und Gründen-Formular) ────────────────────────── */
.hx-platte, .hx-schild__platte {
  position: relative; border-radius: 10px; color: var(--hx-gravur);
  background: linear-gradient(180deg, var(--hx-metall-1), var(--hx-metall-2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 4px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.12), 0 10px 28px -14px rgba(0,0,0,.35);
}
/* Schrauben in den Ecken */
.hx-platte::before, .hx-platte::after, .hx-schild__platte::before {
  content: ''; position: absolute; top: 12px; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.7), transparent 45%), linear-gradient(135deg, #9aa29e, #6c7571);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}
.hx-platte::before { left: 12px; } .hx-platte::after { right: 12px; }
.hx-schild__platte::before { left: 12px; top: 50%; transform: translateY(-50%); }

.hx-kopf { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.hx-platte { display: inline-block; max-width: 100%; padding: 22px 44px 20px; }
.hx-platte h1 {
  color: var(--hx-gravur); font-size: clamp(28px, 4.4vw, 46px); line-height: 1.1; font-weight: 800; letter-spacing: -.01em;
  text-shadow: 0 1px 0 var(--hx-gravur-licht); overflow-wrap: anywhere;
}
.hx-platte__namen { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid color-mix(in srgb, var(--hx-gravur) 22%, transparent);
  display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 1px 0 var(--hx-gravur-licht); }
.hx-kopf__info { color: var(--rf-text-2); }

/* ── Jetzt: Kühlschrank links, Zettel rechts ─────────────────────────── */
.hx-jetzt { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; margin-top: clamp(40px, 5vw, 64px) !important; }
.hx-kuehl h2 { font-size: clamp(24px, 3.1vw, 34px); line-height: 1.18; max-width: 22em; }
.hx-faellig { list-style: none; margin: 22px 0 0; padding: 0; }
.hx-faellig li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px 0 12px 16px;
  border-bottom: 1px solid var(--rf-rand); position: relative;
}
.hx-faellig li::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--rf-rand-stark); }
.hx-faellig li.ist-knapp::before { background: var(--rf-warnung); }
.hx-faellig li.ist-ab::before { background: var(--rf-gefahr); }
.hx-faellig__name { font-weight: 650; overflow-wrap: anywhere; }
.hx-faellig__wann { font-size: var(--rf-text-sm); color: var(--rf-text-2); text-align: right; font-variant-numeric: tabular-nums; }
.ist-ab .hx-faellig__wann { color: var(--rf-gefahr); font-weight: 650; }
.ist-knapp .hx-faellig__wann { color: var(--rf-warnung); font-weight: 650; }
.hx-faellig__von { grid-column: 1 / -1; font-size: 13px; color: var(--rf-text-3); }
.hx-leer { margin-top: 16px !important; color: var(--rf-text-2); max-width: 34em; }
.hx-kuehl > .hx-knopf { margin-top: 24px; }

/* Einkaufszettel */
.hx-zettel {
  position: relative; padding: 30px 26px 24px; color: var(--hx-tinte); transform: rotate(.8deg);
  background-color: var(--hx-papier);
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, var(--hx-papier-linie) 31px 32px);
  background-position: 0 58px; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 16px 32px -18px rgba(0,0,0,.35);
}
.hx-zettel::before { /* Klebestreifen */
  content: ''; position: absolute; top: -11px; left: 50%; width: 92px; height: 24px; transform: translateX(-50%) rotate(-2.5deg);
  background: color-mix(in srgb, var(--rf-akzent) 22%, rgba(255,255,255,.55)); border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.hx-zettel h2 { color: var(--hx-tinte); font-size: 22px; margin-bottom: 8px; }
.hx-zettel__liste { display: block; padding: 10px 0; color: inherit; text-decoration: none; border-bottom: 1px dashed color-mix(in srgb, var(--hx-tinte) 22%, transparent); }
.hx-zettel__liste strong { display: block; font-size: 16px; }
.hx-zettel__liste:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.hx-zettel__posten { display: block; font-size: 14px; line-height: 1.5; color: color-mix(in srgb, var(--hx-tinte) 72%, transparent); overflow-wrap: anywhere; }
.hx-zettel__neu { display: inline-block; margin-top: 14px; font-weight: 650; color: var(--rf-akzent-stark); text-decoration: none; }
[data-theme="dark"] .hx-zettel__neu { color: var(--rf-akzent-hell); }
.hx-zettel__neu:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Wer dazugehört ───────────────────────────────────────────────────── */
.hx-personen { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--rf-rand); }
.hx-person { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 200px) 44px; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rf-rand); }
.hx-avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--hx-farbe); color: #fff; font: 800 18px/1 var(--rf-schrift-titel);
}
.hx-person__text { display: flex; flex-direction: column; min-width: 0; }
.hx-person__text strong { font-size: 16px; overflow-wrap: anywhere; }
.hx-person__text span { font-size: var(--rf-text-sm); color: var(--rf-text-3); }
.hx-du { font-weight: 500; color: var(--rf-text-3); }
.hx-person__anteil { display: flex; flex-direction: column; gap: 6px; }
.hx-person__anteil small { font-size: 13px; color: var(--rf-text-3); }
.hx-balken { display: block; height: 6px; border-radius: 3px; background: var(--rf-flaeche-2); overflow: hidden; }
.hx-balken i { display: block; height: 100%; border-radius: 3px; background: var(--hx-farbe); min-width: 0; }

.hx-menue { position: relative; justify-self: end; }
.hx-menue summary {
  list-style: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--rf-text-2);
}
.hx-menue summary::-webkit-details-marker { display: none; }
.hx-menue summary:hover, .hx-menue[open] summary { background: var(--rf-flaeche-2); }
.hx-menue__liste {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px; padding: 6px;
  background: var(--rf-flaeche); border: 1px solid var(--rf-rand); border-radius: var(--rf-radius-md); box-shadow: var(--rf-schatten-lg);
}
.hx-menue__liste button {
  display: block; width: 100%; text-align: left; padding: 11px 12px; border: 0; border-radius: var(--rf-radius-sm); background: none;
  font: 550 15px/1.3 var(--rf-schrift-text); color: var(--rf-text); cursor: pointer; white-space: nowrap;
}
.hx-menue__liste button:hover { background: var(--rf-flaeche-2); }
.hx-menue__liste button.ist-gefahr { color: var(--rf-gefahr); }

/* ── Einladen: Schlüsselanhänger ──────────────────────────────────────── */
.hx-einladen { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px 48px; align-items: center; }
.hx-einladen p { margin-top: 10px; color: var(--rf-text-2); max-width: 30em; }
.hx-anhaenger {
  position: relative; padding: 26px 28px 24px 64px; border-radius: 18px 60px 60px 18px;
  background: var(--rf-flaeche); border: 1px solid var(--rf-rand); box-shadow: var(--rf-schatten-md);
}
.hx-anhaenger::before { /* Loch für den Ring */
  content: ''; position: absolute; left: 22px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); border-radius: 50%;
  background: var(--rf-hg); box-shadow: inset 0 1px 3px rgba(0,0,0,.25);
}
.hx-anhaenger__code { display: flex; gap: 6px; font: 800 30px/1 var(--rf-schrift-mono); color: var(--rf-text); }
.hx-anhaenger__code span {
  display: grid; place-items: center; width: 42px; height: 54px; border-radius: 8px;
  background: var(--rf-flaeche-2); border-bottom: 3px solid var(--rf-rand-stark);
}
.hx-anhaenger__knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* ── Verwaltung ───────────────────────────────────────────────────────── */
.hx-zeilen { margin-top: 16px; border-top: 1px solid var(--rf-rand); max-width: 760px; }
.hx-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 0; border-bottom: 1px solid var(--rf-rand); flex-wrap: wrap; }
.hx-zeile > span, .hx-zeile > label { font-weight: 650; display: flex; flex-direction: column; gap: 3px; flex: 1 1 280px; min-width: 0; }
.hx-zeile small { font-weight: 400; font-size: var(--rf-text-sm); color: var(--rf-text-3); line-height: 1.45; }
.hx-zeile__feld { display: flex; gap: 8px; flex: 1 1 320px; }
.hx-zeile__feld input, .hx-schild input, .hx-code-feld { font: inherit; color: var(--rf-text); }
.hx-zeile__feld input {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 14px; border: 1px solid var(--rf-rand-stark); border-radius: var(--rf-radius-md); background: var(--rf-flaeche);
}
form.hx-zeile > label { flex: 0 0 auto; }

.hx-schalter, .hx-zeile > .hx-schalter { position: relative; display: inline-block; width: 50px; height: 30px; flex: none; }
.hx-schalter input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.hx-schalter > span[aria-hidden] { position: absolute; inset: 0; border-radius: 15px; background: var(--rf-rand-stark); transition: background var(--rf-dauer-kurz); }
.hx-schalter > span[aria-hidden]::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--rf-dauer-kurz); }
.hx-schalter input:checked + span { background: var(--rf-akzent); }
.hx-schalter input:checked + span::after { transform: translateX(20px); }
.hx-schalter input:focus-visible + span { outline: 2px solid var(--rf-fokus); outline-offset: 2px; }

/* ── Ohne Haushalt ────────────────────────────────────────────────────── */
.hx-start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hx-start h1 { font-size: clamp(34px, 5.2vw, 58px); line-height: 1.04; font-weight: 800; letter-spacing: -.04em; }
.hx-lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--rf-text-2); margin-top: 18px !important; max-width: 32em; }
.hx-start__text p + p { margin-top: 14px; color: var(--rf-text-2); max-width: 32em; }
.hx-schild { display: flex; flex-direction: column; gap: 14px; }
.hx-schild__frage { font-weight: 700; }
.hx-schild__platte { display: flex; align-items: center; gap: 12px; padding: 18px 18px 18px 36px; }
.hx-schild__platte input {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 6px 4px; color: var(--hx-gravur);
  font: 800 clamp(22px, 2.6vw, 28px)/1.2 var(--rf-schrift-titel); letter-spacing: -.01em; text-shadow: 0 1px 0 var(--hx-gravur-licht);
  border-bottom: 1px dashed color-mix(in srgb, var(--hx-gravur) 30%, transparent);
}
.hx-schild__platte input::placeholder { color: color-mix(in srgb, var(--hx-gravur) 38%, transparent); }
.hx-schild__platte input:focus { outline: none; border-bottom-color: var(--hx-gravur); }
.hx-schild__klingel { /* Klingelknopf */
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 40% 35%, #f8f9f8, #c4cac7 60%, #9aa29e);
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.18), 0 0 0 4px color-mix(in srgb, var(--hx-gravur) 12%, transparent);
}
.hx-schild .hx-knopf { align-self: flex-start; }
.hx-schild .hx-klein { margin-top: 0 !important; }

.hx-beitreten { padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--rf-rand); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 40px; align-items: end; }
.hx-beitreten h2 { grid-column: 1; }
.hx-beitreten p { grid-column: 1; color: var(--rf-text-2); max-width: 34em; }
.hx-codeform { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 10px; }
.hx-code-feld {
  width: 11ch; min-height: 52px; padding: 8px 14px; border: 1px solid var(--rf-rand-stark); border-radius: var(--rf-radius-md); background: var(--rf-flaeche);
  font: 800 24px/1 var(--rf-schrift-mono) !important; letter-spacing: .18em; text-transform: uppercase;
}
.hx-code-feld::placeholder { color: var(--rf-text-3); opacity: .5; }
.hx-beitreten--eingeladen { order: -1; border-top: 0; padding: 28px; border-radius: var(--rf-radius-lg); background: var(--rf-akzent-weich); margin: 0 0 clamp(40px, 5vw, 64px) !important; }
.hx-rahmen:has(.hx-beitreten--eingeladen) { display: flex; flex-direction: column; }
.hx-rahmen:has(.hx-beitreten--eingeladen) .hx-start { margin-top: 0; }

/* ── Dialog und Meldung ───────────────────────────────────────────────── */
/* margin: auto ausdrücklich, weil kopfzeile.css allen Elementen margin: 0 gibt (sonst klebt der Dialog oben links) */
.hx-dialog { margin: auto; inset: 0; width: min(440px, calc(100vw - 32px)); padding: 26px; border: 0; border-radius: var(--rf-radius-lg); background: var(--rf-flaeche); color: var(--rf-text); box-shadow: var(--rf-schatten-lg); }
.hx-dialog::backdrop { background: rgba(10, 14, 12, .45); }
.hx-dialog h2 { font: 800 21px/1.25 var(--rf-schrift-titel); margin: 0 0 10px; letter-spacing: -.02em; }
.hx-dialog p { margin: 0; color: var(--rf-text-2); line-height: 1.55; }
.hx-dialog__knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.hx-meldung {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; max-width: calc(100vw - 32px);
  padding: 12px 20px; border-radius: var(--rf-radius-rund); background: var(--rf-text); color: var(--rf-hg); font-weight: 600; box-shadow: var(--rf-schatten-lg);
}
.hx-meldung.ist-fehler { background: var(--rf-gefahr); color: #fff; }

/* ── Schmal ───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hx-jetzt, .hx-start { grid-template-columns: minmax(0, 1fr); }
  .hx-zettel { transform: none; }
  .hx-einladen { grid-template-columns: minmax(0, 1fr); }
  .hx-beitreten { grid-template-columns: minmax(0, 1fr); }
  .hx-codeform { grid-column: 1; grid-row: auto; margin-top: 12px; }
}
@media (max-width: 560px) {
  .hx-platte { padding: 20px 30px 18px; }
  .hx-person { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 4px 12px; }
  .hx-avatar { width: 40px; height: 40px; font-size: 16px; }
  .hx-person__anteil { grid-column: 2; grid-row: 2; }
  .hx-menue { grid-column: 3; grid-row: 1; }
  .hx-anhaenger { padding: 22px 18px 20px 52px; border-radius: 16px 40px 40px 16px; }
  .hx-anhaenger::before { left: 16px; width: 18px; height: 18px; }
  .hx-anhaenger__code { gap: 4px; font-size: 24px; }
  .hx-anhaenger__code span { width: 34px; height: 46px; }
  .hx-codeform { flex-direction: column; }
  .hx-code-feld { width: 100%; }
  .hx-zeile__feld { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .hx-knopf { transition: none; } }
