/* ============================================================================
   GEMEINSINN — Design-System "Organic"
   Quelle der Basis-Tokens/Komponenten: das importierte Wireframe-Projekt
   (_ds/organic-.../styles.css). Hier erweitert um: semantische Statusfarben,
   Senioren-Modus-Tokens, App-Shell (Sidebar/Topnav/Bottomnav), den
   Drei-Panel-Marktplatz und Tabellen-Werkzeuge — siehe /docs/design-reviews
   fuer die Kontrast- und Breakpoint-Belege.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Caprasimo:wght@400&family=Figtree:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --color-bg: #f5ead8;
  --color-bg-raised: #fffdf8;
  --color-surface: #ebddc5;
  --color-text: #201e1d;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);

  --color-neutral-100: #f9f4ed;
  --color-neutral-200: #eee7db;
  --color-neutral-300: #dcd3c4;
  --color-neutral-400: #c0b6a5;
  --color-neutral-500: #a19786;
  --color-neutral-600: #82796a;
  --color-neutral-700: #645c50;
  --color-neutral-800: #474238;
  --color-neutral-900: #2e2b25;

  --color-accent-100: #fff2eb;
  --color-accent-200: #ffe1d0;
  --color-accent-300: #ffc6a5;
  --color-accent-400: #f6a06b;
  --color-accent-500: #d67f48;
  --color-accent-600: #b2622d;
  --color-accent-700: #8c491a;
  --color-accent-800: #643312;
  --color-accent-900: #402310;
  --color-accent: var(--color-accent-500);

  --color-accent-2-100: #f0fae1;
  --color-accent-2-200: #e1eecc;
  --color-accent-2-300: #ccdbb2;
  --color-accent-2-400: #aebf92;
  --color-accent-2-500: #8fa073;
  --color-accent-2-600: #728157;
  --color-accent-2-700: #56633f;
  --color-accent-2-800: #3d472b;
  --color-accent-2-900: #272e1b;
  --color-accent-2: var(--color-accent-2-500);

  /* Semantische Statusfarben — unabhaengig vom Marken-Duo, jede Paarung mit
     ihrem Text auf --color-bg-raised gegen 4.5:1 geprueft (Appendix D). */
  --color-success: #3d6b2c;
  --color-success-bg: #e6f0dc;
  --color-warning: #8a5a10;
  --color-warning-bg: #fbeece;
  --color-danger: #9c3b2e;
  --color-danger-bg: #fbe4df;
  --color-info: #2c5a78;
  --color-info-bg: #dfeef7;

  --color-gold: #8a6d10;
  --color-gold-soft: #f6ecc8;
  --color-gold-ink: #6b5407;

  --font-heading: "Caprasimo", "Georgia", serif;
  --font-heading-weight: 400;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 13px;
  --space-4: 18px;
  --space-5: 22px;
  --space-6: 26px;
  --space-8: 35px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b25 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b25 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b25 22%, transparent);

  --touch-min: 44px;
  --header-h: 60px;
  --bottomnav-h: 60px;

  --transition-fast: 150ms ease;
  --transition-base: 220ms ease;
}

/* Respect prefers-color-scheme just enough to never actively break (Spec
   15.1): the palette above is warm/light by design (v1 has no full dark
   theme), so we simply keep explicit tokens everywhere rather than relying
   on UA defaults — nothing to invert. */

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

/* ── Senioren-Modus: groessere Schrift, mehr Kontrast, groessere Ziele
   (Spec 3, 15.3) — ein Attribut auf <html>, keine zweite Stylesheet. ── */
[data-senior="1"] {
  --step-body: 19px;
  --step-lg: 22px;
  --touch-min: 52px;
  --color-divider: color-mix(in srgb, #201e1d 34%, transparent);
}
[data-senior="1"] body { font-size: var(--step-body); line-height: 1.6; }
[data-senior="1"] .btn { font-size: 17px; padding: 14px 24px; }
[data-senior="1"] .gs-card-title { font-size: 19px; }

/* ============================================================================
   Reset & Grundtypografie
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
}
h1 { font-size: 34px; }
h2 { font-size: 28px; }
h3 { font-size: 23px; }
h4 { font-size: 19px; }
h5 { font-size: 16px; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent-700); text-underline-offset: 3px; }
a:hover { color: var(--color-accent-800); }
img { display: block; max-width: 100%; }
button { font-family: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--color-accent-700);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

.gs-skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--color-accent-700); color: #fff;
  padding: 12px 20px; border-radius: 0 0 12px 0; font-weight: 600;
}
.gs-skip-link:focus { left: 0; }

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

.gs-icon { width: 1.2em; height: 1.2em; flex: none; }
.gs-icon--sm { width: 1em; height: 1em; }
.gs-icon--md { width: 28px; height: 28px; }
.gs-icon--hero { width: 40px; height: 40px; color: var(--color-accent-700); }

/* ============================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; text-decoration: none; border: 1.5px solid transparent;
  font-family: var(--font-body); font-weight: 600; font-size: 14px; line-height: 1.2;
  color: var(--color-text); background: transparent;
  padding: 11px 20px; border-radius: 999px; min-height: var(--touch-min);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Bewusst accent-700, nicht der Marken-Ton accent-500: Weiss auf
   accent-500 liegt bei ~3.0:1 und faellt WCAG 1.4.3 fuer normalen Text
   (14px/600) durch; accent-700 gibt ~6.8:1 (siehe Kontrast-Tabelle im
   Accessibility-Audit des Marktplatz-Hubs). */
.btn-primary { background: var(--color-accent-700); color: #fff; border-color: var(--color-accent-700); }
.btn-primary:hover { background: var(--color-accent-800); border-color: var(--color-accent-800); }
.btn-primary:active { background: var(--color-accent-900); }
.btn-secondary { border-color: var(--color-neutral-400); background: var(--color-bg-raised); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-neutral-200); }
.btn-ghost { color: var(--color-accent-700); border-color: transparent; padding-inline: 12px; }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-danger { border-color: var(--color-danger); color: var(--color-danger); background: var(--color-bg-raised); }
.btn-danger:hover { background: var(--color-danger-bg); }
.btn-sm { padding: 8px 14px; font-size: 13px; min-height: 38px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--touch-min); height: var(--touch-min); padding: 0; flex: none; }

/* ============================================================================
   Formulare
   ========================================================================= */
.gs-field { margin-bottom: var(--space-4); }
.gs-field label, .gs-field legend {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0;
}
.gs-field .gs-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--color-neutral-700); }
.gs-field .gs-error {
  margin: 6px 0 0; font-size: 13px; color: var(--color-danger); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.gs-input, .gs-textarea, .gs-select {
  width: 100%; font: inherit; font-size: 15px; color: var(--color-text);
  background: var(--color-bg-raised); border: 1.5px solid var(--color-neutral-400);
  border-radius: 999px; padding: 12px 18px; min-height: var(--touch-min);
  transition: border-color var(--transition-fast);
}
.gs-textarea { border-radius: var(--radius-lg); min-height: 96px; resize: vertical; }
.gs-input:hover, .gs-textarea:hover, .gs-select:hover { border-color: var(--color-neutral-500); }
.gs-input:focus-visible, .gs-textarea:focus-visible, .gs-select:focus-visible { border-color: var(--color-accent-700); }
.gs-input.has-error, .gs-textarea.has-error { border-color: var(--color-danger); }
fieldset { border: 0; padding: 0; margin: 0 0 var(--space-4); }

.gs-check, .gs-radio {
  display: flex; gap: 12px; align-items: flex-start; font-size: 14px; cursor: pointer;
  padding: 4px 0; min-height: var(--touch-min);
}
.gs-check input, .gs-radio input {
  width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--color-accent-700); cursor: pointer;
}

.gs-tile-select { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gs-tile {
  border: 1.5px solid var(--color-divider); background: var(--color-bg-raised);
  border-radius: var(--radius-md); padding: 14px 8px; text-align: center; cursor: pointer;
  font-size: 12.5px; min-height: var(--touch-min);
}
.gs-tile input { position: absolute; opacity: 0; width: 0; height: 0; }
.gs-tile .gs-icon { width: 24px; height: 24px; margin: 0 auto 6px; color: var(--color-neutral-600); }
.gs-tile:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-2-100); }
.gs-tile:has(input:checked) .gs-icon { color: var(--color-accent-700); }
.gs-tile:has(input:focus-visible) { outline: 3px solid var(--color-accent-700); outline-offset: 2px; }

.gs-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.gs-seg-opt {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--color-neutral-400);
  font-size: 13.5px; min-height: var(--touch-min); background: var(--color-bg-raised);
}
.gs-seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.gs-seg-opt:has(input:checked) { background: var(--color-accent-2-700); border-color: var(--color-accent-2-700); color: #fff; font-weight: 600; }
.gs-seg-opt:has(input:focus-visible) { outline: 3px solid var(--color-accent-700); outline-offset: 2px; }

/* ============================================================================
   Karten, Tags, Badges
   ========================================================================= */
.gs-card {
  background: var(--color-bg-raised); border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg); padding: var(--space-4);
}
.gs-card-title { font-family: var(--font-body); font-weight: 700; font-size: 15px; margin: 0; line-height: 1.35; }
.gs-card-meta { font-size: 12.5px; color: var(--color-neutral-700); margin: 3px 0 0; }

.gs-tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px; letter-spacing: 0.01em; line-height: 1.5;
}
.gs-tag--request { background: var(--color-accent-200); color: var(--color-accent-800); }
.gs-tag--offer { background: var(--color-accent-2-200); color: var(--color-accent-2-800); }
.gs-tag--urgent { background: var(--color-accent-700); color: #fff; }
.gs-tag--neutral { background: var(--color-neutral-200); color: var(--color-neutral-800); font-weight: 600; }
.gs-tag--outline { border: 1.5px solid var(--color-neutral-400); background: transparent; color: var(--color-text); font-weight: 600; }
.gs-tag--success { background: var(--color-success-bg); color: var(--color-success); }
.gs-tag--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.gs-tag--danger { background: var(--color-danger-bg); color: var(--color-danger); }
.gs-tag--gold { background: var(--color-gold-soft); color: var(--color-gold-ink); }

.gs-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--color-neutral-300);
  flex: none; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--color-neutral-700); overflow: hidden; font-size: 14px;
}
.gs-avatar--lg { width: 84px; height: 84px; font-size: 26px; }
.gs-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================================
   Callouts (Rechtshinweise, Erklaerungen)
   ========================================================================= */
.gs-callout {
  border-left: 4px solid var(--color-accent-600); background: var(--color-accent-100);
  border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: 13px 17px;
  font-size: 13.5px; line-height: 1.55; margin-bottom: var(--space-4);
}
.gs-callout--success { border-color: var(--color-success); background: var(--color-success-bg); }
.gs-callout--warning { border-color: var(--color-warning); background: var(--color-warning-bg); }
.gs-callout--danger { border-color: var(--color-danger); background: var(--color-danger-bg); }
.gs-callout--calm { border-color: var(--color-accent-2-700); background: var(--color-accent-2-100); }

/* ============================================================================
   Tabellen — echtes <table>, per Tastatur sortierbar (Spec 15.6)
   ========================================================================= */
.gs-table-wrap { overflow-x: auto; border: 1px solid var(--color-divider); border-radius: var(--radius-lg); background: var(--color-bg-raised); }
.gs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 480px; }
.gs-table th { text-align: left; background: var(--color-surface); padding: 0; }
.gs-table th button.gs-sort {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; cursor: pointer;
  width: 100%; padding: 12px 14px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 700; color: var(--color-neutral-800); min-height: var(--touch-min);
}
.gs-table th button.gs-sort:hover { background: color-mix(in srgb, var(--color-text) 6%, transparent); }
.gs-table th button.gs-sort .gs-icon { width: 13px; height: 13px; opacity: 0.6; }
.gs-table th button.gs-sort[aria-sort="ascending"] .gs-icon,
.gs-table th button.gs-sort[aria-sort="descending"] .gs-icon { opacity: 1; color: var(--color-accent-700); }
.gs-table td { padding: 12px 14px; border-top: 1px solid var(--color-divider); vertical-align: middle; }
.gs-table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 3%, transparent); }
.gs-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.gs-amount-pos { color: var(--color-accent-2-800); }
.gs-amount-neg { color: var(--color-accent-800); }

/* ============================================================================
   Modale Dialoge — Fokusfalle per JS, Escape schliesst (Spec 15.4)
   ========================================================================= */
.gs-dialog-backdrop {
  position: fixed; inset: 0; z-index: 100; display: none; place-items: center;
  padding: var(--space-4); background: color-mix(in srgb, var(--color-neutral-900) 55%, transparent);
}
.gs-dialog-backdrop.is-open { display: grid; }
.gs-dialog {
  width: min(440px, 100%); background: var(--color-bg); border-radius: var(--radius-xl);
  padding: var(--space-5); box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
}
.gs-dialog h3 { margin-bottom: 10px; }
.gs-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: var(--space-4); flex-wrap: wrap; }

/* ============================================================================
   Toasts / Live-Ansagen
   ========================================================================= */
.gs-toast-region { position: fixed; bottom: calc(var(--bottomnav-h) + 14px); left: 14px; right: 14px; z-index: 150; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.gs-toast {
  background: var(--color-neutral-900); color: #fff; padding: 13px 18px; border-radius: var(--radius-md);
  font-size: 14px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; max-width: 420px; margin: 0 auto;
}
.gs-toast .gs-icon { color: var(--color-accent-2-400); }

/* ============================================================================
   App-Shell: Header, Sidebar (Desktop), Topnav (Tablet), Bottomnav (Mobile)
   ========================================================================= */
.gs-app { min-height: 100vh; display: flex; flex-direction: column; }

.gs-header {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); padding: 10px var(--space-4); background: var(--color-surface);
  border-bottom: 1.5px solid var(--color-divider); min-height: var(--header-h);
}
.gs-header-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; color: var(--color-text); text-decoration: none; }
.gs-header-brand .gs-logo-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--color-accent-2-600); flex: none; }
.gs-header-actions { display: flex; align-items: center; gap: 10px; }
.gs-balance-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  background: var(--color-accent-2-200); color: var(--color-accent-2-800); font-size: 13px; font-weight: 700;
  text-decoration: none; min-height: 38px;
}
.gs-balance-pill.is-negative { background: var(--color-accent-200); color: var(--color-accent-800); }
.gs-bell-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--touch-min); height: var(--touch-min); border-radius: 50%; color: var(--color-text); text-decoration: none; }
.gs-bell-btn:hover { background: color-mix(in srgb, var(--color-text) 8%, transparent); }
.gs-bell-badge {
  position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; border-radius: 999px;
  background: var(--color-accent-700); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.gs-emergency-btn {
  background: var(--color-accent-800); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700; border: none; cursor: pointer; min-height: var(--touch-min);
  display: inline-flex; align-items: center; gap: 6px;
}
.gs-emergency-btn:hover { background: var(--color-accent-900); }

.gs-body { flex: 1; display: flex; min-height: 0; }
.gs-sidebar { display: none; }
.gs-topnav { display: none; }
.gs-main { flex: 1; min-width: 0; padding: var(--space-4); padding-bottom: calc(var(--bottomnav-h) + var(--space-5)); max-width: 1280px; margin: 0 auto; width: 100%; }

.gs-bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: flex;
  background: var(--color-surface); border-top: 1.5px solid var(--color-divider); padding: 6px 0;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.gs-bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; font-size: 10.5px; color: var(--color-neutral-700); text-decoration: none; min-height: var(--touch-min);
}
.gs-bottomnav a.is-active { color: var(--color-accent-2-800); font-weight: 700; }
.gs-bottomnav a .gs-icon { width: 21px; height: 21px; }

.gs-sidebar-nav a, .gs-topnav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px;
  color: var(--color-text); text-decoration: none; font-size: 14px; min-height: var(--touch-min);
}
.gs-sidebar-nav a.is-active, .gs-topnav a.is-active { background: var(--color-accent-2-100); color: var(--color-accent-2-800); font-weight: 700; }
.gs-sidebar-nav a:hover:not(.is-active), .gs-topnav a:hover:not(.is-active) { background: color-mix(in srgb, var(--color-text) 6%, transparent); }

/* Tablet ≥768px: Ecken-Header bleibt, aber statt Bottom-Tabs ein
   horizontaler Topnav-Streifen — echtes, eigenstaendiges Layout statt
   gestrecktem Mobile (schliesst die groesste in den Wireframes benannte
   Luecke: "bei 768px gibt es kein eigenes Layout"). */
@media (min-width: 768px) {
  .gs-bottomnav { display: none; }
  .gs-topnav {
    display: flex; gap: 4px; overflow-x: auto; padding: 8px var(--space-4);
    background: var(--color-bg); border-bottom: 1.5px solid var(--color-divider);
  }
  .gs-topnav a { white-space: nowrap; }
  .gs-main { padding: var(--space-5) var(--space-5) var(--space-8); }
}

/* Desktop ≥1024px: persistente Seitenleiste ersetzt den Topnav-Streifen. */
@media (min-width: 1024px) {
  .gs-topnav { display: none; }
  .gs-body { max-width: 1440px; margin: 0 auto; width: 100%; }
  .gs-sidebar {
    display: flex; flex-direction: column; gap: 3px; width: 224px; flex: none;
    padding: var(--space-4) var(--space-3); border-right: 1.5px solid var(--color-divider);
  }
  .gs-main { padding: var(--space-5) var(--space-6) var(--space-8); }
}

/* ============================================================================
   Marktplatz-Hub (Spec 1.3 / Screen 4) — der wichtigste Bildschirm.
   Mobile: 1 Spalte + Tab-Umschaltung. Tablet: 2 Spalten (Feed | Detail).
   Desktop: 3 Spalten (Feed inkl. Zweispalten-Board | Detail+Vereinbarungen).
   ========================================================================= */
.gs-hub-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); flex-wrap: wrap; }
.gs-hub-actions { display: flex; gap: 8px; }
.gs-chip-row { display: flex; gap: 7px; flex-wrap: nowrap; overflow-x: auto; margin-bottom: var(--space-4); padding-bottom: 2px; }
.gs-chip-row.wrap { flex-wrap: wrap; overflow: visible; }
.gs-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 15px; border-radius: 999px;
  border: 1.5px solid var(--color-neutral-400); background: var(--color-bg-raised); font-size: 13px;
  text-decoration: none; color: var(--color-text); flex: none; min-height: var(--touch-min); cursor: pointer;
}
.gs-chip.is-active { background: var(--color-accent-2-700); border-color: var(--color-accent-2-700); color: #fff; font-weight: 700; }
.gs-chip:hover:not(.is-active) { background: var(--color-neutral-200); }

.gs-tabbar { display: flex; gap: 6px; margin-bottom: var(--space-4); }
.gs-tabbar a { flex: 1; text-align: center; padding: 9px; border-radius: 999px; border: 1.5px solid var(--color-neutral-400); font-size: 12.5px; text-decoration: none; color: var(--color-text); min-height: var(--touch-min); display: flex; align-items: center; justify-content: center; }
.gs-tabbar a.is-active { background: var(--color-accent-2-700); border-color: var(--color-accent-2-700); color: #fff; font-weight: 700; }

.gs-recommended {
  border: 1.5px dashed var(--color-accent-400); background: var(--color-accent-100);
  border-radius: var(--radius-lg); padding: var(--space-3) var(--space-3) var(--space-4); margin-bottom: var(--space-5);
}
.gs-recommended-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: var(--space-3); flex-wrap: wrap; }
.gs-recommended-head h2 { font-size: 17px; margin: 0; }
.gs-recommended-head span { font-size: 12px; color: var(--color-neutral-700); }
.gs-recommended-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.gs-recommended-row .gs-feed-card { flex: 0 0 250px; scroll-snap-align: start; }

.gs-feed-card { display: flex; flex-direction: column; gap: 10px; }
.gs-feed-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.gs-feed-card-body { display: flex; gap: 10px; }
.gs-feed-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gs-feed-card-actions .btn { flex: 1; min-width: 120px; }
.gs-feed-card-actions .btn-ghost, .gs-feed-card-actions .btn-secondary { flex: none; min-width: 0; }

.gs-hub-columns { display: flex; flex-direction: column; gap: var(--space-3); }
.gs-hub-col h2 { font-size: 15px; margin-bottom: var(--space-3); }
.gs-hub-col h2 .count { font-family: var(--font-body); font-weight: 500; font-size: 13px; color: var(--color-neutral-700); }
.gs-hub-list { display: flex; flex-direction: column; gap: 11px; }
.gs-empty { text-align: center; padding: var(--space-6) var(--space-4); color: var(--color-neutral-700); font-size: 14px; }

.gs-hub-grid { display: block; }
.gs-hub-side { display: none; }

.gs-detail-sheet {
  position: fixed; inset: 0; z-index: 90; display: none;
}
.gs-detail-sheet.is-open { display: block; }
.gs-detail-sheet-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--color-neutral-900) 45%, transparent); }
.gs-detail-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  background: var(--color-bg); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: var(--space-5);
  box-shadow: var(--shadow-lg); padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
}
.gs-detail-sheet-handle { width: 44px; height: 5px; border-radius: 999px; background: var(--color-neutral-400); margin: 0 auto var(--space-4); }
.gs-detail-close { position: absolute; top: var(--space-3); right: var(--space-3); }

@media (min-width: 768px) {
  .gs-hub-grid { display: grid; grid-template-columns: 1fr 300px; gap: var(--space-5); align-items: start; }
  .gs-hub-side { display: block; position: sticky; top: calc(var(--header-h) + var(--space-3)); }
  .gs-hub-columns { flex-direction: row; gap: var(--space-5); }
  .gs-hub-col { flex: 1; min-width: 0; }
  .gs-hub-col + .gs-hub-col { border-left: 1.5px dashed var(--color-neutral-400); padding-left: var(--space-5); }
  .gs-tabbar { display: none; }
  .gs-hub-columns { display: flex; }

  /* Detail-Panel wird ab Tablet zum echten Slide-over neben dem Feed statt
     Bottom-Sheet (Spec 9.4/15.2: Zwei-Panel-Layout auf dem Tablet). */
  .gs-detail-sheet-panel {
    top: 0; bottom: 0; left: auto; width: min(420px, 92vw); border-radius: 0;
    max-height: none;
  }
}

@media (max-width: 767px) {
  .gs-hub-side-mobile-hidden { display: none; }
  /* Tab-Umschaltung "Alle/Gesucht/Angeboten" ist reines CSS auf dem
     server-gerenderten data-Attribut - funktioniert auch ohne JS
     (Spec 2.1.1: Kernfunktion nicht hinter JS verstecken). */
  .gs-hub-columns[data-active-filter="requests"] .gs-hub-col--offers,
  .gs-hub-columns[data-active-filter="offers"] .gs-hub-col--requests { display: none; }
}

/* ============================================================================
   Guthaben / Statistik-Karten
   ========================================================================= */
.gs-stat-card { background: var(--color-bg-raised); border: 1.5px solid var(--color-accent-600); border-radius: var(--radius-xl); padding: var(--space-5); text-align: center; box-shadow: var(--shadow-md); }
.gs-stat-card.is-negative { border-color: var(--color-accent-700); }
.gs-stat-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-neutral-600); margin: 0 0 8px; }
.gs-stat-value { font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0; color: var(--color-accent-2-800); }
.gs-stat-value.is-negative { color: var(--color-accent-700); }
.gs-stat-sub { font-size: 13px; color: var(--color-neutral-700); margin: 8px 0 0; }

.gs-wallet-layout { display: flex; flex-direction: column; gap: var(--space-5); }
@media (min-width: 768px) {
  .gs-wallet-top { display: flex; gap: var(--space-5); align-items: flex-start; }
  .gs-stat-card { flex: none; width: 280px; }
}

.gs-stepper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.gs-step { padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--color-neutral-200); color: var(--color-neutral-700); }
.gs-step.is-done, .gs-step.is-current { background: var(--color-accent-2-700); color: #fff; }
.gs-step-arrow { color: var(--color-neutral-500); }

/* ============================================================================
   Admin / dichte Raster
   ========================================================================= */
.gs-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: var(--space-5); }
@media (min-width: 1024px) { .gs-stat-grid { grid-template-columns: repeat(4, 1fr); } }
.gs-stat-tile { background: var(--color-bg-raised); border: 1px solid var(--color-divider); border-radius: var(--radius-lg); padding: 16px; text-align: center; }
.gs-stat-tile strong { display: block; font-size: 24px; font-weight: 700; }
.gs-stat-tile span { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-600); }

.gs-settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3) var(--space-4); }
@media (min-width: 768px) { .gs-settings-grid { grid-template-columns: repeat(4, 1fr); } }

.gs-mode-choice { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 640px) { .gs-mode-choice { flex-direction: row; } }
.gs-mode-option { flex: 1; display: flex; gap: 11px; border: 1.5px solid var(--color-divider); background: var(--color-bg); border-radius: var(--radius-lg); padding: 14px; cursor: pointer; min-height: var(--touch-min); }
.gs-mode-option input { margin-top: 3px; accent-color: var(--color-accent-700); width: 20px; height: 20px; }
.gs-mode-option:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-2-100); }
.gs-mode-option:has(input:focus-visible) { outline: 3px solid var(--color-accent-700); outline-offset: 2px; }

/* ============================================================================
   Senioren-Modus Startbildschirm (Screen 16)
   ========================================================================= */
.gs-senior-tiles { display: flex; flex-direction: column; gap: 14px; }
.gs-senior-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: var(--color-bg-raised); border: 2px solid var(--color-neutral-700); border-radius: var(--radius-xl);
  padding: 26px; text-decoration: none; color: var(--color-text); min-height: 120px; justify-content: center;
}
.gs-senior-tile.is-help { background: var(--color-accent-2-100); }
.gs-senior-tile .gs-icon { width: 34px; height: 34px; }
.gs-senior-tile strong { font-size: 21px; font-weight: 700; }

/* ============================================================================
   Utility
   ========================================================================= */
.gs-flex { display: flex; }
.gs-flex-col { display: flex; flex-direction: column; }
.gs-gap-2 { gap: 8px; }
.gs-gap-3 { gap: 13px; }
.gs-mt-4 { margin-top: 18px; }
.gs-mb-0 { margin-bottom: 0; }
.gs-center { text-align: center; }
.gs-container-narrow { max-width: 640px; margin: 0 auto; }
.gs-container-medium { max-width: 760px; margin: 0 auto; }
.gs-link { color: var(--color-accent-700); text-decoration: underline; text-underline-offset: 3px; }
.gs-link:hover { color: var(--color-accent-800); }
.gs-progress { background: var(--color-neutral-200); border-radius: 999px; height: 8px; overflow: hidden; }
.gs-progress > span { display: block; height: 100%; background: var(--color-accent-2-600); }
.gs-badge-ambassador { text-align: center; }
.gs-details { border: 1px solid var(--color-divider); border-radius: var(--radius-lg); padding: 0; background: var(--color-bg-raised); }
.gs-details summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; min-height: var(--touch-min); }
.gs-details summary::-webkit-details-marker { display: none; }
.gs-details[open] summary { border-bottom: 1px solid var(--color-divider); }
.gs-details-body { padding: var(--space-4); }

/* ============================================================================
   Formen fuer die oeffentliche Startseite / Auth
   ========================================================================= */
.gs-guest-header { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--space-4); border-bottom: 1.5px solid var(--color-divider); background: var(--color-surface); }
.gs-hero { padding: 40px var(--space-4) 0; text-align: center; }
.gs-hero h1 { max-width: 640px; margin: 0 auto 14px; }
.gs-hero p { max-width: 560px; margin: 0 auto; font-size: 17px; color: var(--color-neutral-700); }
.gs-hero-actions { display: flex; gap: 10px; justify-content: center; margin-top: var(--space-5); flex-wrap: wrap; }

@media print {
  .gs-header, .gs-bottomnav, .gs-topnav, .gs-sidebar { display: none !important; }
}
