/* =====================================================
   Kassi · App-CSS v0.10.5b
   Mobile-first, plain CSS, keine externen Libraries.
   Primäres Zielgerät: Smartphone 360–430 px.
===================================================== */

:root {
  /* Design Tokens v0.9.1 */
  --color-bg: #f6f8fb;
  --color-bg-soft: #eef4f8;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-surface-soft: #f1f5f9;
  --color-surface-tint: #eaf1ff;
  --color-primary: #2563eb;
  --color-primary-strong: #1e40af;
  --color-primary-soft: #eaf1ff;
  --color-accent: #00a88f;
  --color-accent-soft: #e5fbf7;
  --color-text: #111827;
  --color-muted: #64748b;
  --color-muted-strong: #475569;
  --color-border: rgba(15, 23, 42, 0.1);
  --color-border-strong: rgba(15, 23, 42, 0.16);
  --color-success: #0f9f6e;
  --color-success-soft: #e7f8ef;
  --color-danger: #e11d48;
  --color-danger-soft: #fff1f2;
  --color-warning: #c77700;
  --color-warning-soft: #fff7e8;
  --color-info: #0284c7;
  --color-info-soft: #eaf7ff;
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 24px 56px rgba(15, 23, 42, 0.14);
  --shadow-control: 0 10px 24px rgba(37, 99, 235, 0.22);
  --gap-s: 0.55rem;
  --gap-m: 0.8rem;
  --gap-l: 1rem;
  --radius-s: 8px;
  --radius-m: 10px;
  --radius-l: 14px;
  --radius-control: 14px;
  --radius-nav: 18px;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Legacy aliases used by the existing component CSS */
  --bg: var(--color-bg);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: var(--color-surface-elevated);
  --surface-soft: var(--color-surface-soft);
  --surface-tint: var(--color-surface-tint);
  --ink: var(--color-text);
  --ink-soft: var(--color-muted-strong);
  --ink-faint: var(--color-muted);
  --brand: var(--color-primary);
  --brand-strong: var(--color-primary-strong);
  --brand-soft: var(--color-primary-soft);
  --accent: var(--color-accent);
  --accent-soft: var(--color-accent-soft);
  --positive: var(--color-success);
  --positive-soft: var(--color-success-soft);
  --negative: var(--color-danger);
  --negative-soft: var(--color-danger-soft);
  --warning: var(--color-warning);
  --warning-soft: var(--color-warning-soft);
  --border: var(--color-border);
  --border-strong: var(--color-border-strong);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%);
}

body::before,
body::after {
  content: "";
  display: none;
  position: fixed;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(12px);
  opacity: 0.75;
  z-index: 0;
}

body::before {
  top: -8rem;
  right: -7rem;
  background: transparent;
}

body::after {
  bottom: -10rem;
  left: -7rem;
  background: transparent;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}

p { margin: 0; }
button, input, select, textarea { font: inherit; }

/* =====================================================
   Shells / Layout
===================================================== */

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 35rem;
  margin: 0 auto;
  padding:
    calc(0.9rem + env(safe-area-inset-top))
    1rem
    calc(2rem + env(safe-area-inset-bottom));
  display: grid;
  gap: var(--gap-l);
}

/* Zentrierte Card-Shell für Auth-Seiten */
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  align-content: center;
  max-width: 29rem;
  margin: 0 auto;
  padding:
    calc(1.5rem + env(safe-area-inset-top))
    1rem
    calc(1.75rem + env(safe-area-inset-bottom));
  gap: var(--gap-l);
}

/* =====================================================
   Typografie
===================================================== */

h1 { font-size: 2.35rem; line-height: 1.04; }
h2 { font-size: 1.45rem; line-height: 1.15; }
h3 { font-size: 1.15rem; line-height: 1.25; }

.section-kicker {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.section-kicker-light { color: rgba(255, 255, 255, 0.65); }

.lead {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.muted { color: var(--ink-soft); line-height: 1.55; }
.helper-text { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5; }

/* =====================================================
   Panel / Card
===================================================== */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 1.15rem;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.panel-elevated {
  background: var(--surface-strong);
  box-shadow: var(--shadow-strong);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

/* =====================================================
   Balance / Hero Panel
===================================================== */

.balance-panel {
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
  border-radius: var(--radius-l);
  background:
    linear-gradient(135deg, #17343b 0%, #1d5a63 58%, #2b6f73 100%);
  color: #fffdf8;
  box-shadow: 0 24px 48px rgba(23, 52, 59, 0.22);
}

.balance-panel::after {
  content: "";
  display: none;
  position: absolute;
  inset: auto -3rem -4.5rem auto;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  background: transparent;
}

.balance-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.55rem;
}

.balance-copy h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  color: rgba(255, 253, 248, 0.88);
}

.balance-amount {
  font-family: var(--font-display);
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
  color: #fff;
}

.balance-caption {
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255, 253, 248, 0.78);
}

/* =====================================================
   Status Pills
===================================================== */

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-neutral {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--border);
  color: var(--ink-faint);
}

.status-positive {
  background: var(--positive-soft);
  color: var(--positive);
  border-color: rgba(45, 139, 99, 0.15);
}

.status-negative {
  background: var(--negative-soft);
  color: var(--negative);
  border-color: rgba(196, 90, 77, 0.15);
}

.status-accent {
  background: var(--accent-soft);
  color: #8a5318;
  border-color: rgba(201, 139, 67, 0.2);
}

.status-balance {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  margin-top: 0.7rem;
}

/* =====================================================
   Summary Grid (Statistik-Kacheln)
===================================================== */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-m);
}

.summary-card {
  padding: 0.95rem;
  border-radius: var(--radius-m);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.summary-card-wide { grid-column: 1 / -1; }

.summary-label {
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.summary-value {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0;
}

.summary-value-positive { color: var(--positive); }
.summary-value-negative { color: var(--negative); }

/* =====================================================
   App Header
===================================================== */

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
}

.app-header-brand { display: grid; gap: 0.15rem; min-width: 0; }

.app-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.app-header-user {
  font-size: 0.8rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: var(--gap-s);
  flex: 0 0 auto;
}

/* =====================================================
   Flash Messages
===================================================== */

.flash {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-s);
  font-size: 0.92rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.flash-success { background: var(--positive-soft); color: var(--positive); border-color: rgba(45, 139, 99, 0.2); }
.flash-error { background: var(--negative-soft); color: var(--negative); border-color: rgba(196, 90, 77, 0.2); }
.flash-info { background: var(--brand-soft); color: var(--brand-strong); border-color: rgba(31, 102, 112, 0.2); }
.flash-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(176, 107, 14, 0.2); }

/* =====================================================
   Stale Notice (Multiuser-Hinweis)
===================================================== */

.stale-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-m);
  background: var(--warning-soft);
  border: 1px solid rgba(176, 107, 14, 0.22);
}

.stale-notice-body { flex: 1; min-width: 0; }

.stale-notice-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--warning);
  margin-bottom: 0.18rem;
}

.stale-notice-message {
  font-size: 0.86rem;
  color: #7a500c;
  line-height: 1.45;
}

.stale-notice-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.stale-notice-critical {
  background: var(--negative-soft);
  border-color: rgba(196, 90, 77, 0.22);
}

.stale-notice-critical .stale-notice-title { color: var(--negative); }
.stale-notice-critical .stale-notice-message { color: #8b2a22; }

.stale-notice-info {
  background: var(--brand-soft);
  border-color: rgba(31, 102, 112, 0.2);
}

.stale-notice-info .stale-notice-title,
.stale-notice-info .stale-notice-message {
  color: var(--brand-strong);
}

.stale-notice-success {
  background: var(--positive-soft);
  border-color: rgba(45, 139, 99, 0.2);
}

.stale-notice-success .stale-notice-title,
.stale-notice-success .stale-notice-message {
  color: var(--positive);
}

/* =====================================================
   Forms
===================================================== */

.form-stack { display: grid; gap: 0.8rem; }
.form-group { display: grid; gap: 0.4rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-m); }

label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 1.05rem;
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
  min-height: 3.1rem;
}

textarea {
  min-height: 4.5rem;
  resize: vertical;
  line-height: 1.5;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%),
    linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position:
    calc(100% - 1.1rem) calc(50% - 0.1rem),
    calc(100% - 0.8rem) calc(50% - 0.1rem);
  background-size: 0.32rem 0.32rem, 0.32rem 0.32rem;
  background-repeat: no-repeat;
  background-color: var(--surface-soft);
  padding-right: 2.2rem;
}

input::placeholder, textarea::placeholder { color: var(--ink-faint); }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(31, 102, 112, 0.26);
  background: #fffdf9;
  box-shadow:
    0 0 0 0.26rem rgba(31, 102, 112, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.form-note {
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.turnstile-field {
  display: flex;
  justify-content: center;
  max-width: 100%;
  overflow: visible;
}

.turnstile-field .cf-turnstile {
  max-width: 100%;
}

.resend-verification-inline-form {
  display: grid;
  gap: var(--gap-s);
}

.form-actions-row {
  display: flex;
  gap: var(--gap-s);
  flex-wrap: wrap;
}

/* =====================================================
   Buttons
===================================================== */

.btn {
  border: 0;
  border-radius: 1.1rem;
  min-height: 3.1rem;
  padding: 0.8rem 1rem;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; box-shadow: none; }
.btn-block { width: 100%; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  box-shadow: 0 14px 28px rgba(31, 102, 112, 0.22);
}

.btn-secondary {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
}

.btn-link {
  min-height: auto;
  padding: 0.15rem 0;
  background: transparent;
  color: var(--brand-strong);
  font-weight: 700;
  box-shadow: none;
  border-radius: 0;
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #c45a4d 0%, #9e3d32 100%);
  box-shadow: 0 10px 22px rgba(196, 90, 77, 0.22);
}

.btn-danger-ghost {
  color: var(--negative);
  background: var(--negative-soft);
  border: 1px solid rgba(196, 90, 77, 0.2);
}

.btn-compact {
  min-height: 2.5rem;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  font-size: 0.88rem;
}

.btn-small {
  min-height: 2.4rem;
  padding: 0.55rem 0.8rem;
  border-radius: 0.85rem;
  font-size: 0.88rem;
}

/* =====================================================
   Inline Feedback Blocks
===================================================== */

.error-block {
  background: var(--negative-soft);
  color: var(--negative);
  border: 1px solid rgba(196, 90, 77, 0.2);
  border-radius: var(--radius-s);
  padding: 0.8rem 0.95rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.info-block {
  background: var(--brand-soft);
  color: var(--brand-strong);
  border: 1px solid rgba(31, 102, 112, 0.15);
  border-radius: var(--radius-s);
  padding: 0.8rem 0.95rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.warning-block {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid rgba(176, 107, 14, 0.2);
  border-radius: var(--radius-s);
  padding: 0.8rem 0.95rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.error-list {
  margin: 0;
  padding-left: 1.2rem;
}

/* =====================================================
   Empty State
===================================================== */

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 1.4rem 1rem;
  background: var(--surface-soft);
  border-radius: var(--radius-m);
}

/* =====================================================
   Booking Cards (Buchungsliste)
===================================================== */

.booking-list { display: grid; gap: var(--gap-m); }

.booking-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 0.95rem;
  display: grid;
  gap: 0.7rem;
}

.booking-card-expense { border-color: rgba(196, 90, 77, 0.2); }
.booking-card-deposit { border-color: rgba(45, 139, 99, 0.2); }
.booking-card-editing { border-color: rgba(31, 102, 112, 0.3); background: var(--surface-tint); }

.booking-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.booking-desc-wrap { display: grid; gap: 0.2rem; min-width: 0; flex: 1; }

.booking-kind {
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.booking-desc {
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-amount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

.booking-card-expense .booking-amount { background: var(--negative-soft); color: var(--negative); }
.booking-card-deposit .booking-amount { background: var(--positive-soft); color: var(--positive); }

.booking-details { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.booking-actions { display: flex; gap: var(--gap-s); flex-wrap: wrap; }

/* =====================================================
   Tags / Chips
===================================================== */

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-neutral { background: var(--surface-soft); color: var(--ink-soft); }
.tag-muted { background: transparent; color: var(--ink-faint); padding-left: 0; font-size: 0.78rem; }

/* =====================================================
   Category Total Rows
===================================================== */

.category-totals-list { display: grid; gap: var(--gap-s); }
.category-totals-list-compact { gap: 0.45rem; }

.category-total-row {
  display: grid;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-s);
  background: var(--surface-soft);
}

.category-total-row-compact { padding: 0.6rem 0.72rem; }

.category-total-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
}

.category-total-text { min-width: 0; }
.category-total-name { font-weight: 700; font-size: 0.92rem; overflow-wrap: anywhere; }
.category-total-meta { font-size: 0.78rem; color: var(--ink-faint); margin-top: 0.08rem; }

.category-total-amount-wrap {
  flex: 0 0 auto;
  display: grid;
  gap: 0.04rem;
  justify-items: end;
  text-align: right;
}

.category-total-amount { font-weight: 800; color: var(--negative); white-space: nowrap; font-size: 0.95rem; }
.category-total-percent { font-size: 0.78rem; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }

.category-total-bar {
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  overflow: hidden;
}

.category-total-row-compact .category-total-bar { height: 0.32rem; }

.category-total-bar span {
  display: block;
  width: var(--category-total-share, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.category-preview-panel,
.round-evaluation-panel,
.category-breakdown {
  display: grid;
  gap: var(--gap-m);
}

.category-preview-header { margin-bottom: 0; align-items: flex-start; }

.category-preview-total {
  flex: 0 0 auto;
  color: var(--negative);
  font-size: 0.95rem;
  font-weight: 850;
  white-space: nowrap;
}

.category-preview-link { justify-self: start; }

.category-breakdown { margin-top: 0.1rem; }

.category-breakdown-title {
  font-size: 0.92rem;
  font-weight: 850;
  color: var(--ink);
}

.round-stats-grid-highlight .round-stat:last-child { grid-column: 1 / -1; }

/* =====================================================
   Kassasturz / Live-Preview
===================================================== */

.live-preview {
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-s);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: grid;
  gap: 0.3rem;
}

.live-preview-title {
  font-weight: 800;
  font-size: 0.97rem;
  color: var(--ink);
}

.live-preview-detail {
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.live-preview-match { background: var(--positive-soft); border-color: rgba(45, 139, 99, 0.2); }
.live-preview-match .live-preview-title { color: var(--positive); }

.live-preview-high { background: var(--brand-soft); border-color: rgba(31, 102, 112, 0.18); }
.live-preview-high .live-preview-title { color: var(--brand-strong); }

.live-preview-low,
.live-preview-invalid { background: var(--negative-soft); border-color: rgba(196, 90, 77, 0.18); }
.live-preview-low .live-preview-title,
.live-preview-invalid .live-preview-title { color: var(--negative); }

/* =====================================================
   Autocomplete
===================================================== */

.autocomplete-box {
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-s);
  background: var(--surface-tint);
  border: 1px solid rgba(31, 102, 112, 0.12);
  display: grid;
  gap: 0.55rem;
}

.autocomplete-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.suggestions-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.suggestion-chip {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  min-height: 2.2rem;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 150ms ease, border-color 160ms ease, background-color 160ms ease;
}

.suggestion-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 102, 112, 0.2);
  background: #fffdf9;
}

/* =====================================================
   Category Management Cards
===================================================== */

.category-list { display: grid; gap: var(--gap-m); }

.category-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 0.95rem;
  display: grid;
  gap: 0.8rem;
}

.category-card-inactive { border-style: dashed; opacity: 0.72; }

.category-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.category-name-wrap { display: grid; gap: 0.18rem; }
.category-name { font-weight: 800; font-size: 0.97rem; }
.category-meta { font-size: 0.8rem; color: var(--ink-soft); }

.category-actions { display: flex; flex-wrap: wrap; gap: var(--gap-s); align-items: center; }
.category-order-actions { display: flex; gap: var(--gap-s); }

.category-rename-form {
  display: flex;
  gap: var(--gap-s);
  align-items: stretch;
  flex-wrap: wrap;
}

.category-rename-form input {
  flex: 1;
  min-width: 8rem;
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.85rem;
}

.category-delete-section {
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-s);
  background: var(--negative-soft);
  border: 1px solid rgba(196, 90, 77, 0.15);
  display: grid;
  gap: 0.6rem;
}

.category-delete-note {
  font-size: 0.86rem;
  color: var(--negative);
  line-height: 1.45;
}

.category-replace-form {
  display: flex;
  gap: var(--gap-s);
  flex-wrap: wrap;
  align-items: stretch;
}

.category-replace-form select {
  flex: 1;
  min-width: 9rem;
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.85rem;
}

/* =====================================================
   Member / Invitation Cards
===================================================== */

.member-list, .invitation-list { display: grid; gap: var(--gap-m); }

.member-card, .invitation-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 0.95rem;
  display: grid;
  gap: 0.65rem;
}

.member-top, .invitation-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.member-identity, .invitation-identity {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.member-name, .invitation-email {
  font-weight: 800;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-email {
  font-size: 0.8rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-meta, .invitation-meta { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.4; }
.member-actions, .invitation-actions { display: flex; flex-wrap: wrap; gap: var(--gap-s); }

.invitation-copy-box { margin-top: var(--gap-s); }

.invitation-copy-box summary {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--brand-strong);
  cursor: pointer;
}

.invitation-copy-box summary:hover { text-decoration: underline; }

.invitation-textarea {
  min-height: 8rem;
  font-size: 0.84rem;
  margin-top: var(--gap-s);
  border-radius: var(--radius-s);
}

/* =====================================================
   Role / Invitation Badges
===================================================== */

.role-badge, .inv-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.role-owner { background: var(--accent-soft); color: #8a5318; }
.role-member { background: var(--surface-soft); color: var(--ink-soft); }

.inv-pending { background: var(--warning-soft); color: var(--warning); }
.inv-accepted { background: var(--positive-soft); color: var(--positive); }
.inv-declined, .inv-revoked { background: var(--surface-soft); color: var(--ink-faint); }

/* Backwards-compat mit PHP-Helfer-Klassen */
.badge-pending { background: var(--warning-soft); color: var(--warning); }
.badge-accepted { background: var(--positive-soft); color: var(--positive); }
.badge-declined, .badge-revoked, .badge-neutral { background: var(--surface-soft); color: var(--ink-faint); }
.badge-active { background: var(--positive-soft); color: var(--positive); }
.badge-inactive { background: var(--surface-soft); color: var(--ink-faint); }

/* =====================================================
   Round History Cards
===================================================== */

.round-history-list { display: grid; gap: var(--gap-m); }

.round-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 0.95rem;
  display: grid;
  gap: 0.8rem;
}

.round-card-selected { border-color: rgba(31, 102, 112, 0.3); background: var(--surface-tint); }

.round-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.round-card-title { display: grid; gap: 0.2rem; min-width: 0; }
.round-card-label { font-weight: 700; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; }
.round-card-meta { font-size: 0.78rem; color: var(--ink-soft); }

.round-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-s);
}

.round-stat {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-s);
  background: var(--surface-soft);
}

.round-stat-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.round-stat-value { font-size: 1rem; font-weight: 800; letter-spacing: 0; }
.round-stat-positive { color: var(--positive); }
.round-stat-negative { color: var(--negative); }

/* =====================================================
   Management Sections (collapsible details/summary)
===================================================== */

.management-section summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.1rem 0;
  user-select: none;
}

.management-section summary::-webkit-details-marker { display: none; }

.management-section summary::after {
  content: "›";
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ink-faint);
  transform: rotate(90deg);
  transition: transform 200ms ease;
  flex: 0 0 auto;
  line-height: 1;
}

.management-section[open] summary::after { transform: rotate(270deg); }

.management-summary-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}

.management-summary-meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.12rem;
}

.management-content { margin-top: 1rem; display: grid; gap: 1rem; }
.management-subsection { display: grid; gap: 0.8rem; }
.management-subsection-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }

/* =====================================================
   Section Headers & Dividers
===================================================== */

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.section-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: 0; }
.section-note { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5; margin-top: 0.25rem; }

.section-divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* =====================================================
   Auth-Page specific
===================================================== */

.auth-brand { display: grid; gap: 0.55rem; }
.auth-tagline { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.55; }

/* =====================================================
   Responsive: Größere Screens
===================================================== */

@media (min-width: 32rem) {
  .app-shell {
    padding-top: calc(1.3rem + env(safe-area-inset-top));
    padding-bottom: calc(2.2rem + env(safe-area-inset-bottom));
  }

  .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-card-wide { grid-column: auto; }

  .round-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .round-stats-grid-highlight { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .round-stats-grid-highlight .round-stat:last-child { grid-column: auto; }

  .category-rename-form { flex-wrap: nowrap; }
  .category-replace-form { flex-wrap: nowrap; }
}

@media (min-width: 34rem) {
  .form-row { gap: 0.9rem; }
}

/* =====================================================
   Focus / Accessibility
===================================================== */

:focus-visible {
  outline: 0.18rem solid rgba(31, 102, 112, 0.5);
  outline-offset: 2px;
}

/* =====================================================
   Top Bar (fixed app header)
===================================================== */

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: calc(3.5rem + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: rgba(248, 244, 237, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 1px 12px rgba(23, 48, 57, 0.06);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  max-width: 35rem;
  margin: 0 auto;
  padding: 0 1rem;
  gap: 1rem;
}

.top-bar-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-strong);
  letter-spacing: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

.top-bar-wallet-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  max-width: 13rem;
  transition: background 160ms ease;
}

.top-bar-wallet-btn:hover { background: var(--brand-soft); }
.top-bar-wallet-btn:active { background: var(--brand-soft); }

.top-bar-wallet-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-bar-wallet-arrow {
  font-size: 0.7rem;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.top-bar-wallet-empty {
  color: var(--ink-faint);
}

/* =====================================================
   App Shell: override padding for fixed bars
===================================================== */

.app-shell {
  padding-top: calc(3.8rem + env(safe-area-inset-top));
  padding-bottom: calc(5.4rem + env(safe-area-inset-bottom));
}

@media (min-width: 32rem) {
  .app-shell {
    padding-top: calc(4rem + env(safe-area-inset-top));
    padding-bottom: calc(5.6rem + env(safe-area-inset-bottom));
  }
}

/* =====================================================
   Tab Panels
===================================================== */

.tab-panel { display: none; }

.tab-panel.tab-active { display: grid; gap: var(--gap-l); }

/* When JS is unavailable show all panels stacked */
.no-js .tab-panel { display: grid; gap: var(--gap-l); }

/* =====================================================
   Bottom Navigation
===================================================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(248, 244, 237, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 -2px 16px rgba(23, 48, 57, 0.07);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.55rem 0.2rem 0.45rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 160ms ease;
  min-height: 4rem;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  font-family: inherit;
}

.nav-item:active { background: rgba(31, 102, 112, 0.05); }

.nav-item.nav-active { color: var(--brand); }

.nav-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: transform 160ms ease;
}

.nav-item.nav-active .nav-icon::before {
  content: "";
  position: absolute;
  inset: -0.4rem -0.55rem;
  background: var(--brand-soft);
  border-radius: 0.75rem;
  z-index: -1;
}

.nav-item.nav-active .nav-icon { transform: scale(1.08); }

.nav-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
}

.nav-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  line-height: 1;
}

/* Notification badge on nav icon */
.nav-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.2rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: var(--negative);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Center bottom nav on desktop */
@media (min-width: 35rem) {
  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 35rem;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-radius: var(--radius-l) var(--radius-l) 0 0;
  }
}

/* =====================================================
   Profile Tab
===================================================== */

.profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem;
}

.profile-avatar {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-display);
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(31, 102, 112, 0.28);
  letter-spacing: 0;
}

.profile-info {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.profile-name {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-email {
  font-size: 0.82rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 0.1rem;
}

/* =====================================================
   Quick Action Buttons (Start tab)
===================================================== */

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-m);
}

.quick-actions-single {
  grid-template-columns: 1fr;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.1rem 0.75rem;
  border-radius: var(--radius-m);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  font-family: inherit;
  transition: transform 150ms ease, box-shadow 180ms ease;
  min-height: 5.5rem;
  box-shadow: var(--shadow-soft);
}

.quick-action-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-strong); }
.quick-action-btn:active { transform: translateY(0); }

.quick-action-btn.qa-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 28px rgba(31, 102, 112, 0.25);
}

.quick-actions-single .quick-action-btn {
  min-height: 4.6rem;
  flex-direction: row;
}

.quick-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
}

.quick-action-icon svg {
  width: 1.6rem;
  height: 1.6rem;
  stroke-width: 2;
}

.quick-action-label {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  line-height: 1.25;
}

.round-mini-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-m);
  flex-wrap: wrap;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-s);
  background: var(--color-primary-soft);
  border: 1px solid rgba(37, 99, 235, 0.16);
}

.round-mini-title {
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  color: var(--color-primary-strong);
}

.round-mini-meta {
  margin-top: 0.1rem;
  font-size: 0.9rem;
  font-weight: 760;
  color: var(--color-text);
}

/* =====================================================
   Tab section headers
===================================================== */

.tab-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.tab-section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
  margin: 0;
}

/* =====================================================
   Active Round Info Card (Runden tab)
===================================================== */

.round-status-card {
  padding: 1rem 1.15rem;
  background: var(--surface-tint);
  border: 1px solid rgba(31, 102, 112, 0.18);
  border-radius: var(--radius-m);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.round-status-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.2rem;
}

.round-status-meta {
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.round-status-amount {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

/* =====================================================
   Wallet Tab section divider
===================================================== */

.wallet-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0.6rem 0 0.1rem;
}

/* =====================================================
   Start Tab: "Keine aktive Runde" state card
===================================================== */

.state-card {
  padding: 1.6rem 1.35rem;
  display: grid;
  gap: 0.9rem;
}

.state-card-icon {
  font-size: 2.4rem;
  line-height: 1;
}

.state-card-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}

.state-card-body {
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* =====================================================
   v0.9.1 Visual App Design Refresh
   Modernisierte Tokens, mobile App-Surfaces und Bottom-Nav-Fix.
===================================================== */

body {
  overflow-x: hidden;
  color: var(--color-text);
  background:
    linear-gradient(180deg, #fbfdff 0%, var(--color-bg) 46%, #edf7f4 100%);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  display: none;
}

body * {
  letter-spacing: 0;
}

h1,
h2,
h3,
.state-card-title,
.tab-section-title,
.section-title,
.management-summary-title,
.management-subsection-title,
.top-bar-brand {
  font-family: var(--font-body);
  letter-spacing: 0;
}

h1 {
  font-size: 2.35rem;
  line-height: 1.04;
  font-weight: 850;
}

h2 {
  font-size: 1.45rem;
  line-height: 1.15;
  font-weight: 820;
}

h3 {
  font-size: 1.1rem;
  line-height: 1.25;
  font-weight: 780;
}

@media (min-width: 32rem) {
  h1 { font-size: 2.65rem; }
  h2 { font-size: 1.6rem; }
}

.section-kicker,
.summary-label,
.booking-kind,
.round-stat-label,
.round-status-label,
.wallet-section-label,
.role-badge,
.inv-badge,
.status-pill,
.nav-label {
  letter-spacing: 0;
}

.lead,
.muted,
.helper-text,
.section-note,
.form-note,
.auth-tagline,
.state-card-body {
  color: var(--color-muted-strong);
}

.app-shell {
  max-width: 35rem;
  padding-top: calc(4.25rem + env(safe-area-inset-top));
  padding-bottom: calc(6.7rem + env(safe-area-inset-bottom));
  gap: 0.9rem;
}

.auth-shell {
  max-width: 29rem;
  padding-top: calc(1.4rem + env(safe-area-inset-top));
  padding-bottom: calc(1.6rem + env(safe-area-inset-bottom));
}

.panel,
.summary-card,
.booking-card,
.category-card,
.member-card,
.invitation-card,
.round-card,
.round-stat,
.category-total-row,
.live-preview,
.autocomplete-box,
.empty-state,
.category-delete-section,
.round-status-card {
  border-radius: var(--radius-s);
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.panel-elevated {
  background: var(--color-surface-elevated);
  border-color: rgba(37, 99, 235, 0.1);
  box-shadow: var(--shadow-strong);
}

.panel-head {
  margin-bottom: 1rem;
}

.balance-panel {
  padding: 1.25rem;
  border-radius: var(--radius-m);
  background:
    linear-gradient(135deg, #1746a2 0%, var(--color-primary) 55%, #00a88f 100%);
  box-shadow: 0 22px 44px rgba(37, 99, 235, 0.24);
}

.balance-panel::after {
  display: none;
}

.balance-copy {
  gap: 0.65rem;
}

.balance-copy h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 780;
  color: rgba(255, 255, 255, 0.86);
}

.balance-amount {
  font-family: var(--font-body);
  font-size: 2.7rem;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 880;
}

@media (min-width: 32rem) {
  .balance-amount { font-size: 3.15rem; }
}

.balance-caption {
  color: rgba(255, 255, 255, 0.8);
}

.summary-card,
.booking-card,
.category-card,
.member-card,
.invitation-card,
.round-card {
  background: var(--color-surface-elevated);
  border-color: var(--color-border);
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.06);
}

.summary-label,
.booking-kind,
.category-meta,
.member-meta,
.invitation-meta,
.round-card-meta,
.round-stat-label,
.wallet-section-label {
  color: var(--color-muted);
}

.summary-value,
.booking-amount,
.round-stat-value,
.round-status-amount {
  letter-spacing: 0;
  font-weight: 850;
}

.summary-value-positive,
.round-stat-positive {
  color: var(--color-success);
}

.summary-value-negative,
.round-stat-negative,
.category-total-amount {
  color: var(--color-danger);
}

.top-bar {
  height: calc(3.75rem + env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.06);
}

.top-bar-inner {
  height: 3.75rem;
}

.top-bar-brand {
  color: var(--color-primary-strong);
  font-weight: 850;
}

.top-bar-wallet-btn {
  min-height: 2.45rem;
  padding: 0.45rem 0.8rem;
  background: var(--color-surface-soft);
  border-color: var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
}

.top-bar-wallet-btn:hover,
.top-bar-wallet-btn:active {
  background: var(--color-primary-soft);
}

input,
select,
textarea {
  min-height: 3.25rem;
  border-radius: var(--radius-control);
  border-color: var(--color-border);
  background: var(--color-surface-soft);
  box-shadow: none;
}

textarea {
  min-height: 5rem;
}

select {
  background-color: var(--color-surface-soft);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.5);
  background: var(--color-surface);
  box-shadow: 0 0 0 0.24rem rgba(37, 99, 235, 0.13);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

label {
  font-weight: 760;
  color: var(--color-text);
}

.btn {
  min-height: 3rem;
  border-radius: var(--radius-control);
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-strong) 100%);
  box-shadow: var(--shadow-control);
}

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

.btn-ghost {
  color: var(--color-primary-strong);
  background: var(--color-primary-soft);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger) 0%, #be123c 100%);
  box-shadow: 0 12px 24px rgba(225, 29, 72, 0.2);
}

.btn-danger-ghost {
  color: var(--color-danger);
  background: var(--color-danger-soft);
  border: 1px solid rgba(225, 29, 72, 0.16);
}

.btn-compact,
.btn-small {
  border-radius: 999px;
}

.btn-link {
  color: var(--color-primary-strong);
}

.flash,
.error-block,
.info-block,
.warning-block,
.stale-notice {
  border-radius: var(--radius-s);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.flash-success {
  background: var(--color-success-soft);
  color: #08744f;
  border-color: rgba(15, 159, 110, 0.18);
}

.flash-error {
  background: var(--color-danger-soft);
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.18);
}

.flash-info,
.info-block {
  background: var(--color-info-soft);
  color: #075985;
  border-color: rgba(2, 132, 199, 0.16);
}

.flash-warning,
.warning-block,
.stale-notice {
  background: var(--color-warning-soft);
  color: #8a4f00;
  border-color: rgba(199, 119, 0, 0.18);
}

.error-block,
.stale-notice-critical {
  background: var(--color-danger-soft);
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.18);
}

.stale-notice-title {
  color: #8a4f00;
}

.stale-notice-message {
  color: #7a4d09;
}

.stale-notice-critical .stale-notice-title,
.stale-notice-critical .stale-notice-message {
  color: #be123c;
}

.stale-notice-info {
  background: var(--color-info-soft);
  color: #075985;
  border-color: rgba(2, 132, 199, 0.16);
}

.stale-notice-info .stale-notice-title,
.stale-notice-info .stale-notice-message {
  color: #075985;
}

.stale-notice-success {
  background: var(--color-success-soft);
  color: #08744f;
  border-color: rgba(15, 159, 110, 0.18);
}

.stale-notice-success .stale-notice-title,
.stale-notice-success .stale-notice-message {
  color: #08744f;
}

.status-positive,
.badge-active,
.badge-accepted,
.inv-accepted {
  background: var(--color-success-soft);
  color: #08744f;
  border-color: rgba(15, 159, 110, 0.16);
}

.status-negative {
  background: var(--color-danger-soft);
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.16);
}

.status-accent,
.role-owner {
  background: var(--color-accent-soft);
  color: #047d6d;
}

.status-neutral,
.role-member,
.badge-neutral,
.badge-inactive,
.badge-declined,
.badge-revoked,
.inv-declined,
.inv-revoked {
  background: var(--color-surface-soft);
  color: var(--color-muted-strong);
}

.badge-pending,
.inv-pending {
  background: var(--color-warning-soft);
  color: #8a4f00;
}

.tag,
.suggestion-chip {
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
}

.tag-neutral {
  background: var(--color-surface-soft);
  color: var(--color-muted-strong);
}

.suggestion-chip {
  border-color: rgba(37, 99, 235, 0.14);
}

.suggestion-chip:hover {
  background: var(--color-surface);
  border-color: rgba(37, 99, 235, 0.32);
}

.booking-card-expense {
  border-color: rgba(225, 29, 72, 0.2);
}

.booking-card-deposit {
  border-color: rgba(15, 159, 110, 0.2);
}

.booking-card-editing,
.round-card-selected {
  background: var(--color-primary-soft);
  border-color: rgba(37, 99, 235, 0.28);
}

.booking-card-expense .booking-amount {
  background: var(--color-danger-soft);
  color: #be123c;
}

.booking-card-deposit .booking-amount {
  background: var(--color-success-soft);
  color: #08744f;
}

.live-preview-match {
  background: var(--color-success-soft);
  border-color: rgba(15, 159, 110, 0.18);
}

.live-preview-match .live-preview-title {
  color: #08744f;
}

.live-preview-high {
  background: var(--color-info-soft);
  border-color: rgba(2, 132, 199, 0.16);
}

.live-preview-high .live-preview-title {
  color: #075985;
}

.live-preview-low,
.live-preview-invalid,
.category-delete-section {
  background: var(--color-danger-soft);
  border-color: rgba(225, 29, 72, 0.16);
}

.live-preview-low .live-preview-title,
.live-preview-invalid .live-preview-title,
.category-delete-note {
  color: #be123c;
}

.autocomplete-box,
.round-status-card {
  background: var(--color-primary-soft);
  border-color: rgba(37, 99, 235, 0.16);
}

.round-status-label {
  color: var(--color-primary-strong);
}

.profile-avatar {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
  letter-spacing: 0;
}

.quick-action-btn {
  border-radius: var(--radius-s);
  background: var(--color-surface-elevated);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.quick-action-btn.qa-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-strong) 100%);
  box-shadow: var(--shadow-control);
}

.quick-action-label {
  letter-spacing: 0;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  min-height: calc(4.85rem + env(safe-area-inset-bottom));
  padding: 0.38rem 0.45rem calc(0.42rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.1);
}

.nav-item {
  min-width: 0;
  min-height: 4.05rem;
  display: grid;
  grid-template-rows: 2rem 1rem;
  align-content: center;
  justify-items: center;
  gap: 0.22rem;
  padding: 0.32rem 0.1rem;
  border-radius: var(--radius-nav);
  color: var(--color-muted);
  overflow: visible;
}

.nav-item:active {
  background: var(--color-surface-soft);
}

.nav-item.nav-active {
  color: var(--color-primary-strong);
}

.nav-icon {
  width: 2.75rem;
  height: 2rem;
  border-radius: 999px;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms ease;
}

.nav-item.nav-active .nav-icon::before {
  display: none;
}

.nav-item.nav-active .nav-icon {
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
  transform: none;
}

.nav-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2.15;
}

.nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.66rem;
  line-height: 1.15;
  font-weight: 760;
  text-transform: none;
  color: currentColor;
}

.nav-badge {
  top: 0.08rem;
  right: 0.34rem;
  background: var(--color-danger);
  border: 2px solid var(--color-surface);
}

@media (min-width: 35rem) {
  .bottom-nav {
    width: 35rem;
    border-radius: var(--radius-nav) var(--radius-nav) 0 0;
  }
}

/* =====================================================
   v0.9.2 Beta Polish
===================================================== */

.help-panel {
  display: grid;
  gap: 0.15rem;
}

.help-list {
  display: grid;
  gap: 0.55rem;
}

.help-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-s);
  background: var(--color-surface-soft);
  overflow: hidden;
}

.help-item summary {
  cursor: pointer;
  list-style: none;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 800;
  color: var(--color-text);
}

.help-item summary::-webkit-details-marker {
  display: none;
}

.help-item summary::after {
  content: "+";
  flex: 0 0 auto;
  font-weight: 900;
  color: var(--color-primary-strong);
}

.help-item[open] summary::after {
  content: "-";
}

.help-item p {
  padding: 0 0.9rem 0.85rem;
  color: var(--color-muted-strong);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* =====================================================
   v0.10.5 UX Simplification & Flow Polish
===================================================== */

/* Globaler Mitglied-Hinweis im Wallet-Tab (statt Wiederholung pro Kategorie). */
.wallet-member-hint {
  margin-bottom: var(--gap-m, 0.85rem);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Mitglied-Sicht: Kategorien werden ohne Aktionen kompakter dargestellt. */
.category-card.category-card-compact {
  padding: 0.65rem 0.85rem;
  display: grid;
  gap: 0.25rem;
}

.category-card.category-card-compact .category-actions,
.category-card.category-card-compact .category-rename-form,
.category-card.category-card-compact .category-delete-section {
  display: none;
}

/* FAQ als einklappbares Akkordeon (oberste Ebene). */
.help-section .help-list {
  display: grid;
  gap: 0.5rem;
}

.help-section .help-panel {
  display: grid;
  gap: 0.25rem;
}

/* Logout-Panel optisch klar abtrennen. */
.profile-logout-panel {
  border: 1px solid rgba(196, 90, 77, 0.18);
}

/* App-Info: Beta-Pille als kleines visuelles Detail. */
.app-info-beta {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-soft, rgba(31, 102, 112, 0.12));
  color: var(--brand-strong, #1f6670);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Sekund&auml;re Buttons: klares "klickbar"-Gef&uuml;hl, konsistent mit dem Brand. */
.btn-secondary,
.btn-ghost {
  color: var(--color-primary-strong, var(--brand-strong, var(--ink)));
}

.btn-secondary {
  background: var(--color-primary-soft, var(--brand-soft, rgba(37, 99, 235, 0.10)));
  border-color: rgba(37, 99, 235, 0.28);
}

.btn-ghost {
  background: rgba(234, 241, 255, 0.72);
  border-color: rgba(37, 99, 235, 0.18);
}

.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  background: #dbe8ff;
  border-color: rgba(37, 99, 235, 0.38);
}

.btn-secondary:disabled,
.btn-ghost:disabled {
  color: var(--color-muted, #64748b);
  background: var(--color-surface-soft, #f1f5f9);
  border-color: var(--color-border, rgba(15, 23, 42, 0.1));
}

/* =====================================================
   v0.10.5b Responsive UX Repair & Navigation State Fixes
===================================================== */

.summary-grid {
  grid-template-columns: 1fr;
}

.quick-actions-single .quick-action-btn {
  width: 100%;
}

.state-card > .btn-primary:not(.btn-compact) {
  width: 100%;
}

.booking-category-deposit-note {
  padding: 0.78rem 0.85rem;
  border-radius: var(--radius-s);
  background: var(--color-primary-soft);
  border: 1px solid rgba(37, 99, 235, 0.16);
  color: var(--color-primary-strong);
  font-weight: 760;
}

.wallet-overview-panel {
  display: grid;
  gap: 0.9rem;
}

.wallet-overview-panel .section-header,
.section-header-compact {
  margin-bottom: 0 !important;
}

.wallet-switch-form {
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border);
}

.round-stats-grid-highlight .round-stat:last-child {
  grid-column: auto;
}

.round-stats-grid-highlight {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-shell {
  width: 100%;
  max-width: 30rem;
  align-content: center;
  gap: 1rem;
  padding-top: calc(1.1rem + env(safe-area-inset-top));
  padding-bottom: calc(1.2rem + env(safe-area-inset-bottom));
}

.auth-brand {
  padding: 0.15rem 0.1rem 0;
}

.auth-brand h1 {
  color: var(--color-primary-strong);
}

.auth-brand .section-kicker {
  color: var(--color-primary-strong);
}

.auth-shell > .panel {
  width: 100%;
}

.auth-shell > .helper-text {
  width: 100%;
}

@media (min-width: 32rem) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .state-card > .btn-primary:not(.btn-compact) {
    width: auto;
    justify-self: start;
  }
}

@media (min-width: 48rem) {
  .auth-shell {
    max-width: 58rem;
    grid-template-columns: minmax(0, 0.85fr) minmax(24rem, 1fr);
    align-items: center;
    gap: 2rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .auth-brand {
    padding: 1rem 0 1rem 0.25rem;
  }

  .auth-brand h1 {
    font-size: 3rem;
    line-height: 1;
  }

  .auth-tagline {
    max-width: 21rem;
  }

  .auth-shell > .helper-text {
    grid-column: 2;
    margin-top: -1rem;
  }
}
