:root {
  color-scheme: light;
  --bg: #eef7f2;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --text: #202a36;
  --muted: #66717e;
  --line: rgba(32, 42, 54, 0.1);
  --accent: #43b879;
  --accent-dark: #24985f;
  --accent-soft: #e8f7ef;
  --success: #e8f8ec;
  --shadow: 0 20px 50px rgba(32, 42, 54, 0.12);
  --soft-shadow: 0 10px 30px rgba(32, 42, 54, 0.1);
  --radius-lg: 28px;
  --radius-md: 20px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --title-page: 2.8rem;
  --title-home: 3.2rem;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--text-md);
  line-height: 1.45;
  background:
    radial-gradient(circle at 20% 4%, rgba(67, 184, 121, 0.18), transparent 34rem),
    radial-gradient(circle at 90% 18%, rgba(198, 234, 216, 0.48), transparent 30rem),
    linear-gradient(180deg, #ffffff 0%, #eef7f2 58%, #e8f3ee 100%),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

button,
a {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.app-shell {
  width: min(100%, 1080px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 14px 112px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand picture {
  display: block;
}

.desktop-nav {
  display: none;
}

.welcome-section h2,
.page-heading h2,
.card h3,
.stats-card h4 {
  margin: 0;
  letter-spacing: 0;
}

.brand-logo {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.icon-button,
.round-action,
.filter-button {
  border: 0;
  cursor: pointer;
}

.top-menu {
  position: relative;
  flex: 0 0 auto;
}

.top-menu summary {
  list-style: none;
}

.top-menu summary::-webkit-details-marker {
  display: none;
}

.icon-button {
  display: grid;
  width: 52px;
  height: 46px;
  flex: 0 0 52px;
  place-items: center;
  border: 1px solid rgba(32, 42, 54, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(32, 42, 54, 0.08);
  color: var(--text);
  font-size: var(--text-lg);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.icon-button:hover,
.icon-button:focus-visible,
.top-menu[open] .icon-button {
  border-color: rgba(67, 184, 121, 0.32);
  background: var(--accent-soft);
  box-shadow: 0 14px 30px rgba(67, 184, 121, 0.16);
  color: var(--accent-dark);
  outline: 0;
}

.icon-button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 8px 18px rgba(32, 42, 54, 0.1);
}

.top-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  min-width: 230px;
  max-height: min(420px, calc(100vh - 96px));
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.top-menu-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 800;
  text-decoration: none;
  text-align: left;
}

.top-menu-link:hover,
.top-menu-link:focus-visible,
.app-shell:has(#admin-lokale:target) .top-menu-link[href="#admin-lokale"],
.app-shell:has(#admin-speisen:target) .top-menu-link[href="#admin-speisen"],
.app-shell:has(#admin-mitglieder:target) .top-menu-link[href="#admin-mitglieder"],
.app-shell:has(#admin-gruppen:target) .top-menu-link[href="#admin-gruppen"],
.app-shell:has(#admin-historie:target) .top-menu-link[href="#admin-historie"] {
  background: var(--accent-soft);
  color: var(--accent);
  outline: 0;
}

.top-menu-logout {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
}

.top-menu-logout:hover,
.top-menu-logout:focus-visible {
  border-radius: 12px;
}

.top-menu-link span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  font-size: var(--text-lg);
}

.test-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}

.test-mode label {
  display: none;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 850;
  white-space: nowrap;
}

.test-mode select {
  min-height: 38px;
  max-width: 92px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 800;
}

.supabase-status {
  display: none;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #fff6dc;
  color: #8a6200;
  font-size: var(--text-xs);
  font-weight: 850;
  white-space: nowrap;
}

.supabase-status[data-status="connected"] {
  background: var(--success);
  color: #176c2d;
}

.supabase-status[data-status="error"] {
  background: #fff1f1;
  color: #a33131;
}

.content {
  display: block;
}

.page {
  display: none;
  gap: 18px;
}

[hidden] {
  display: none !important;
}

.page-home {
  display: grid;
}

.page-registration {
  justify-content: center;
}

.app-shell:has(.page:target) .page {
  display: none;
}

.app-shell:has(.page:target) .page:target {
  display: grid;
}

.app-shell:has(#admin-lokale:target) .page,
.app-shell:has(#admin-speisen:target) .page,
.app-shell:has(#admin-mitglieder:target) .page,
.app-shell:has(#admin-gruppen:target) .page,
.app-shell:has(#admin-historie:target) .page {
  display: none;
}

.app-shell:has(#admin-lokale:target) #page-admin,
.app-shell:has(#admin-speisen:target) #page-admin,
.app-shell:has(#admin-mitglieder:target) #page-admin,
.app-shell:has(#admin-gruppen:target) #page-admin,
.app-shell:has(#admin-historie:target) #page-admin {
  display: grid;
}

.welcome-section,
.page-heading {
  padding: 18px 8px 0;
}

.welcome-section {
  display: grid;
  justify-items: center;
  text-align: center;
}

.welcome-section h2 {
  max-width: 8ch;
  font-size: var(--title-home);
  line-height: 0.98;
}

.splitwise-connect-button {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  padding: 10px 18px 10px 12px;
  border: 0;
  border-radius: 999px;
  background: #1cc29f;
  box-shadow: 0 14px 26px rgba(28, 194, 159, 0.22);
  color: #ffffff;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 850;
}

.splitwise-connect-button:hover,
.splitwise-connect-button:focus-visible {
  background: #18ad90;
  outline: 0;
}

.splitwise-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #1cc29f;
  font-size: var(--text-xs);
  font-weight: 950;
  line-height: 1;
}

.account-deactivate-button {
  border: 0;
  background: transparent;
  color: #a33131;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-deactivate-button:hover,
.account-deactivate-button:focus-visible {
  color: #7f2626;
  outline: 0;
}

.page-heading h2 {
  font-size: var(--title-page);
  line-height: 1;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.profile-card {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 30px 22px 26px;
  text-align: center;
}

.profile-photo-control {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.profile-photo-button {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 14px 34px rgba(67, 184, 121, 0.13);
  cursor: pointer;
}

.profile-photo-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-button span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(32, 42, 54, 0.72);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 800;
}

.change-photo-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid rgba(67, 184, 121, 0.2);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 850;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.profile-grid {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.profile-grid div {
  display: grid;
  gap: 6px;
  padding: 4px 12px;
}

.profile-grid div + div {
  border-left: 1px solid var(--line);
}

.profile-grid span,
.restaurant-item span,
.admin-grid span,
.history-row span,
.cart-row p,
.detail-list span {
  color: var(--muted);
}

.profile-grid strong {
  font-size: var(--text-lg);
}

.stats-card,
.restaurants-card,
.menu-card,
.cart-card,
.history-card,
.detail-card,
.admin-card,
.admin-panel,
.registration-card {
  padding: 22px;
}

.registration-card {
  width: min(100%, 460px);
  justify-self: center;
}

.page-registration .page-heading {
  width: min(100%, 460px);
  justify-self: center;
}

.card h3,
.profile-card h3 {
  font-size: var(--text-xl);
  line-height: 1.15;
}

.restaurants-card p,
.cart-card p,
.history-row,
.detail-list,
.admin-grid {
  font-size: var(--text-sm);
}

.section-title,
.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-header {
  justify-content: space-between;
  margin-bottom: 16px;
}

.menu-card .card-header,
.admin-speisen-panel .admin-select,
.admin-panel .card-header {
  position: sticky;
  top: 104px;
  z-index: 12;
  padding-block: 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.section-title {
  margin-bottom: 18px;
}

.section-icon {
  color: var(--accent);
  font-size: var(--text-xl);
  font-weight: 900;
  line-height: 1;
}

.stats-groups {
  display: grid;
  gap: 20px;
}

.stats-groups > div + div {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.stats-card h4 {
  margin-bottom: 12px;
  font-size: var(--text-lg);
}

.stat-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.stat-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px var(--line);
}

.stat-row::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  grid-column: 1;
}

.stat-row span {
  min-width: 0;
  grid-column: 2;
  color: var(--muted);
  font-size: var(--text-sm);
}

.stat-row strong {
  grid-column: 3;
  max-width: 13ch;
  color: var(--text);
  font-size: var(--text-sm);
  text-align: right;
}

.stat-row.highlight {
  background: linear-gradient(180deg, rgba(255, 239, 239, 0.9), rgba(255, 255, 255, 0.78));
}

.restaurants-card p,
.cart-card p {
  margin: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--success);
  color: #176c2d;
  font-size: var(--text-xs);
  font-weight: 800;
  white-space: nowrap;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 16px 28px rgba(67, 184, 121, 0.22);
}

.btn-secondary,
.filter-button {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

.filter-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 750;
}

.full-width {
  width: 100%;
  margin-top: 18px;
}

.restaurant-list,
.menu-list,
.cart-list,
.history-list,
.admin-history-list,
.admin-list,
.admin-grid,
.detail-list {
  display: grid;
  gap: 12px;
}

.page-lokale .menu-card {
  display: none;
}

.page-lokale.is-menu-focused .restaurants-card {
  display: none;
}

.page-lokale.is-menu-focused .menu-card {
  display: block;
}

.menu-card {
  position: relative;
}

.restaurant-item,
.history-row,
.admin-history-row,
.cart-row,
.admin-grid article,
.detail-list div {
  display: grid;
  align-items: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.restaurant-item {
  grid-template-columns: 64px 1fr 36px;
  gap: 12px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.restaurant-item.is-selected {
  background: rgba(232, 247, 239, 0.9);
  box-shadow: inset 0 0 0 2px rgba(67, 184, 121, 0.28);
}

.restaurant-item.has-order {
  background: linear-gradient(180deg, rgba(232, 247, 239, 0.94), rgba(255, 255, 255, 0.82));
  box-shadow: inset 0 0 0 2px rgba(67, 184, 121, 0.34), var(--soft-shadow);
}

.restaurant-item.has-order::after {
  content: "Aktive Gruppenbestellung";
  grid-column: 1 / -1;
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 850;
}

.restaurant-item strong,
.restaurant-item span {
  display: block;
}

.restaurant-item span {
  margin-top: 3px;
  font-size: var(--text-sm);
}

.food-thumb {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #f6fbf8, #dff4e9);
  box-shadow: inset 0 0 0 1px rgba(67, 184, 121, 0.14);
  color: var(--accent);
  font-weight: 900;
}

.food-thumb::before {
  content: "L";
}

.food-thumb.burger::before {
  content: "H";
}

.food-thumb.bowl::before {
  content: "D";
}

.round-action {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-size: var(--text-xl);
  line-height: 1;
}

.cart-open-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 850;
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.back-button {
  position: sticky;
  top: 114px;
  z-index: 18;
  float: left;
  margin: 8px 10px 0 0;
  left: 18px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-xl);
  font-weight: 850;
  line-height: 1;
}

.menu-card .card-header {
  padding-left: 0;
}

.cart-open-button span {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-size: var(--text-xs);
}

.menu-subtitle {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.menu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.menu-item strong,
.menu-item span {
  display: block;
}

.menu-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.meal-action {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.meal-action strong {
  font-size: var(--text-sm);
  white-space: nowrap;
}

.meal-action button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: var(--text-xl);
  font-weight: 850;
  line-height: 1;
}

.cart-row {
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.cart-row p {
  display: grid;
  gap: 2px;
  font-size: var(--text-sm);
}

.cart-row strong {
  color: var(--text);
}

.initial {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #f6dcf6;
  color: #8a328e;
  font-size: var(--text-xs);
  font-weight: 850;
}

.initial.blue {
  background: #deecff;
  color: #1965bb;
}

.initial.green {
  background: #dff5e3;
  color: #1e7a32;
}

.initial.red {
  background: #dff4e9;
  color: var(--accent);
}

.initial.muted {
  background: #f0efed;
  color: var(--muted);
}

.history-order {
  border-bottom: 1px solid var(--line);
}

.admin-history-order {
  border-bottom: 1px solid var(--line);
}

.history-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 15px 0;
  border-radius: 0;
  background: transparent;
}

.history-row div,
.detail-list div {
  display: grid;
  gap: 3px;
}

.history-row > strong {
  color: var(--text);
  font-weight: 800;
  justify-self: end;
}

.history-details-button {
  grid-column: 2 / -1;
  width: 100%;
}

.history-details {
  display: grid;
  gap: 12px;
  padding: 0 0 16px 46px;
}

.history-details[hidden] {
  display: none;
}

.history-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.history-detail-summary div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(232, 247, 239, 0.72);
}

.history-detail-summary span,
.history-detail-item span {
  color: var(--muted);
}

.history-detail-item .history-note {
  justify-self: start;
  margin-top: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(67, 184, 121, 0.22);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: var(--text-xs);
  font-weight: 850;
}

.history-detail-items {
  display: grid;
  gap: 12px;
}

.history-person-group {
  display: grid;
  gap: 10px;
}

.cart-person-group {
  display: grid;
  gap: 6px;
}

.person-group-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.person-group-items {
  display: grid;
  gap: 10px;
  padding-left: 44px;
}

.cart-person-group .person-group-items {
  gap: 6px;
}

.history-detail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.history-detail-item div {
  display: grid;
  gap: 2px;
}

.admin-history-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 15px 0;
  border-radius: 0;
  background: transparent;
}

.admin-history-row div {
  display: grid;
  gap: 3px;
}

.admin-history-row > strong {
  color: var(--text);
  font-weight: 800;
  justify-self: end;
}

.admin-history-row span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.admin-history-details {
  padding-left: 0;
}

.danger-button {
  justify-self: center;
  width: auto;
  min-width: 128px;
  margin-top: 2px;
  padding: 0 18px;
  border-color: rgba(184, 67, 67, 0.28);
  color: #a33131;
}

.danger-button:hover,
.danger-button:focus-visible {
  background: #fff1f1;
  outline: 0;
}

.admin-panel[hidden],
.member-admin-panel[hidden] {
  display: none;
}

.admin-form,
.member-admin-panel,
.invite-card,
.registration-preview {
  display: grid;
  gap: 12px;
}

.admin-form {
  margin-bottom: 16px;
}

.admin-form label,
.admin-select {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 800;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-select select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
}

.admin-form textarea {
  resize: vertical;
}

.bulk-meal-list {
  display: grid;
  gap: 10px;
}

.bulk-meal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px var(--line);
}

.bulk-meal-row .danger-button {
  align-self: end;
  min-width: 44px;
  padding: 0 12px;
}

.admin-form-actions,
.admin-row-actions,
.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-form-actions {
  align-items: center;
}

.admin-row-actions {
  justify-content: flex-end;
}

.admin-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px var(--line);
}

.admin-item-row.is-selected {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(67, 184, 121, 0.24);
}

.archived-groups {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.archived-groups summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 850;
}

.archived-groups .admin-list {
  margin-top: 12px;
}

.archived-item-row {
  opacity: 0.78;
}

.admin-item-main {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.admin-item-row span,
.invite-card span,
.registration-preview span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.mini-thumb {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.food-thumb img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.food-thumb span {
  font-size: var(--text-lg);
}

.member-admin-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.invite-card,
.invite-detected,
.registration-preview {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(232, 247, 239, 0.68);
}

.invite-detected {
  display: grid;
  gap: 4px;
  background: rgba(28, 194, 159, 0.13);
}

.invite-detected[hidden] {
  display: none;
}

.invite-actions [aria-disabled="true"],
.invite-actions button:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.auth-register-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-secondary-link {
  justify-self: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.registration-dialog {
  text-align: left;
}

.invite-actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.qr-preview {
  display: grid;
  width: 108px;
  height: 108px;
  place-items: center;
  border: 6px solid var(--surface-strong);
  border-radius: 10px;
  background:
    linear-gradient(90deg, var(--text) 12px, transparent 12px) 0 0 / 24px 24px,
    linear-gradient(var(--text) 12px, transparent 12px) 0 0 / 24px 24px,
    var(--surface-strong);
  color: var(--accent);
  font-weight: 900;
  box-shadow: var(--soft-shadow);
}

.calendar-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 9px;
  color: transparent;
}

.detail-list div,
.admin-grid article {
  gap: 5px;
  padding: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.admin-grid article {
  cursor: pointer;
}

.profile-dialog {
  width: min(92vw, 420px);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: center;
}

.profile-dialog::backdrop {
  background: rgba(28, 20, 15, 0.42);
  backdrop-filter: blur(5px);
}

.profile-dialog img {
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  margin: 8px auto 18px;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: var(--soft-shadow);
}

.profile-dialog h2 {
  margin: 0 0 14px;
  font-size: var(--text-xl);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-xl);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 80;
  max-width: min(340px, calc(100vw - 36px));
  padding: 14px 18px;
  border: 1px solid rgba(67, 184, 121, 0.26);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--accent-dark);
  font-weight: 850;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cart-dialog {
  width: min(94vw, 460px);
  max-height: min(82vh, 760px);
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
  color: var(--text);
}

.cart-dialog[open] {
  display: flex;
  flex-direction: column;
}

.cart-dialog::backdrop {
  background: rgba(28, 20, 15, 0.42);
  backdrop-filter: blur(5px);
}

.cart-dialog h2 {
  margin: 0;
  font-size: var(--text-xl);
}

.detailed-cart-list {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 12px;
  overflow: auto;
  padding-right: 4px;
  gap: 8px;
}

.cart-checkout-button {
  position: sticky;
  bottom: 0;
  flex: 0 0 auto;
  z-index: 2;
  margin-bottom: 0;
  box-shadow: 0 -12px 20px rgba(255, 255, 255, 0.96), 0 16px 28px rgba(67, 184, 121, 0.22);
}

.empty-cart {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 244, 244, 0.8);
  color: var(--muted);
  text-align: center;
}

.cart-detail-row {
  display: grid;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.cart-detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  gap: 8px;
  align-items: center;
}

.cart-detail-main div {
  display: grid;
  gap: 2px;
}

.cart-detail-main span {
  color: var(--muted);
  font-size: var(--text-sm);
}

.remove-cart-item {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff1f1;
  color: var(--accent);
  cursor: pointer;
  font-size: var(--text-lg);
  font-weight: 850;
  line-height: 1;
}

.cart-detail-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
}

.cart-detail-row input {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

.bottom-nav {
  position: fixed;
  right: 10px;
  bottom: 14px;
  left: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.bottom-nav a {
  display: grid;
  min-height: 68px;
  place-items: center;
  gap: 4px;
  border-right: 1px solid var(--line);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 750;
  text-decoration: none;
}

.bottom-nav a:last-child {
  border-right: 0;
}

.bottom-nav span {
  color: currentColor;
  font-size: var(--text-xl);
  line-height: 1;
}

.nav-home {
  color: var(--accent);
}

.app-shell:has(.page:target) .bottom-nav a {
  color: var(--text);
}

.app-shell:has(#admin-lokale:target) .bottom-nav a,
.app-shell:has(#admin-speisen:target) .bottom-nav a,
.app-shell:has(#admin-mitglieder:target) .bottom-nav a,
.app-shell:has(#admin-gruppen:target) .bottom-nav a,
.app-shell:has(#admin-historie:target) .bottom-nav a {
  color: var(--text);
}

.app-shell:has(#page-home:target) .nav-home,
.app-shell:has(#page-lokale:target) .nav-lokale,
.app-shell:has(#page-bestellungen:target) .nav-bestellungen {
  color: var(--accent);
}

@media (min-width: 620px) {
  .app-shell {
    padding: 18px 20px 124px;
  }

  .page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .welcome-section,
  .page-heading,
  .profile-card,
  .stats-card,
  .restaurants-card,
  .menu-card,
  .cart-card,
  .history-card,
  .detail-card,
  .admin-card,
  .admin-history-card,
  .admin-panel,
  .registration-card {
    grid-column: 1 / -1;
  }

  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-item-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .compact-admin-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .bulk-meal-row {
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.4fr) 110px auto;
    align-items: end;
  }

  .history-row {
    grid-template-columns: 34px minmax(0, 1fr) auto auto;
  }

  .admin-history-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .history-details-button {
    grid-column: auto;
    width: auto;
    justify-self: end;
  }

  .round-action {
    justify-self: end;
  }

  .bottom-nav a {
    font-size: var(--text-xs);
  }
}

@media (min-width: 920px) {
  :root {
    --title-page: 3.3rem;
    --title-home: 3.75rem;
  }

  .app-shell {
    width: 100%;
    padding: 20px clamp(32px, 5vw, 72px) 112px;
  }

  .topbar {
    position: sticky;
    top: 14px;
    z-index: 60;
    width: min(100%, 1360px);
    max-width: none;
    margin-right: auto;
    margin-left: auto;
    padding: 10px 16px;
  }

  .desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-left: auto;
  }

  .test-mode {
    display: flex;
    margin-left: 0;
  }

  .test-mode label,
  .supabase-status {
    display: inline-flex;
  }

  .desktop-nav a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 800;
    text-decoration: none;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  }

  .desktop-nav a:hover,
  .desktop-nav a:focus-visible {
    border-color: rgba(67, 184, 121, 0.24);
    background: rgba(232, 247, 239, 0.72);
    color: var(--accent-dark);
    outline: 0;
  }

  .desktop-nav .nav-home {
    border-color: rgba(67, 184, 121, 0.18);
    background: rgba(232, 247, 239, 0.62);
    color: var(--accent-dark);
  }

  .app-shell:has(.page:target) .desktop-nav a {
    border-color: transparent;
    background: transparent;
    color: var(--text);
  }

  .app-shell:has(#page-home:target) .desktop-nav .nav-home,
  .app-shell:has(#page-lokale:target) .desktop-nav .nav-lokale,
  .app-shell:has(#page-bestellungen:target) .desktop-nav .nav-bestellungen {
    border-color: rgba(67, 184, 121, 0.18);
    background: rgba(232, 247, 239, 0.62);
    color: var(--accent-dark);
  }

  .app-shell:has(#admin-lokale:target) .desktop-nav a,
  .app-shell:has(#admin-speisen:target) .desktop-nav a,
  .app-shell:has(#admin-mitglieder:target) .desktop-nav a,
  .app-shell:has(#admin-gruppen:target) .desktop-nav a,
  .app-shell:has(#admin-historie:target) .desktop-nav a {
    background: transparent;
    color: var(--text);
  }

  .brand-logo {
    width: clamp(260px, 20vw, 310px);
    height: auto;
    border-radius: 0;
  }

  .icon-button {
    width: 54px;
    height: 46px;
    flex-basis: 54px;
    border-radius: 16px;
    font-size: var(--text-lg);
  }

  .stats-card,
  .restaurants-card,
  .menu-card,
  .cart-card,
  .history-card,
  .detail-card,
  .admin-card,
  .admin-panel,
  .registration-card {
    padding: 18px;
  }

  .card-header {
    margin-bottom: 12px;
  }

  .menu-card .card-header,
  .admin-speisen-panel .admin-select,
  .admin-panel .card-header {
    top: 14px;
  }

  .back-button {
    top: 24px;
  }

  .section-title {
    margin-bottom: 14px;
  }

  .page-home,
  .page-lokale,
  .page-bestellungen,
  .page-admin,
  .page-registration {
    width: min(100%, 1360px);
    min-height: calc(100vh - 172px);
    margin: 0 auto;
    gap: clamp(18px, 2vw, 28px);
    align-content: center;
  }

  .page-home,
  .page-lokale,
  .page-bestellungen {
    grid-template-columns: minmax(440px, 1.05fr) minmax(440px, 0.95fr);
  }

  .page-home {
    justify-content: center;
  }

  .page-registration {
    width: min(100%, 560px);
    grid-template-columns: minmax(0, 1fr);
    justify-content: center;
  }

  .page-admin {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .welcome-section {
    grid-column: 1 / -1;
  }

  .page-home .profile-card,
  .page-lokale .restaurants-card,
  .page-bestellungen .history-card {
    grid-column: 1;
  }

  .page-home .stats-card,
  .page-lokale .menu-card,
  .page-bestellungen .detail-card {
    grid-column: 2;
  }

  .page-lokale .restaurant-list {
    grid-auto-flow: column;
    grid-template-rows: repeat(5, auto);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: start;
  }

  .page-lokale:not(.is-menu-focused) .restaurants-card {
    grid-column: 1 / -1;
  }

  .page-lokale.is-menu-focused {
    grid-template-columns: minmax(620px, 900px);
    justify-content: center;
  }

  .page-lokale.is-menu-focused .menu-card {
    grid-column: 1;
  }

  .page-bestellungen .history-card {
    padding: 14px 16px;
  }

  .page-bestellungen .history-list {
    gap: 4px;
  }

  .page-bestellungen .history-row {
    padding: 9px 0;
  }

  .page-bestellungen .history-details {
    gap: 8px;
    padding-bottom: 10px;
    padding-left: 40px;
  }

  .page-bestellungen .history-detail-summary {
    gap: 8px;
  }

  .page-bestellungen .history-detail-summary div {
    padding: 8px 10px;
  }

  .page-bestellungen .history-detail-items,
  .page-bestellungen .history-person-group,
  .page-bestellungen .person-group-items {
    gap: 6px;
  }

  .page-bestellungen .history-detail-item {
    padding: 6px 0;
  }

  .page-bestellungen .history-note {
    margin-top: 3px;
    padding: 4px 7px;
  }

  .admin-history-card .history-detail-item {
    width: 100%;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 18px;
  }

  .admin-history-card .history-detail-item > strong {
    justify-self: end;
  }

  .admin-history-card .history-details {
    width: min(100%, 760px);
    margin-inline: auto;
  }

  .admin-history-card > .card-header,
  .admin-history-card .admin-history-list,
  .admin-history-card .admin-history-row {
    width: min(100%, 760px);
    margin-inline: auto;
  }

  .admin-history-card .admin-history-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .admin-history-card .history-detail-summary {
    width: 100%;
  }

  .admin-history-card .history-detail-items {
    width: 100%;
  }

  .bottom-nav {
    display: none;
  }
}
