:root {
  color-scheme: light;
  --green-900: #173f2d;
  --green-700: #246846;
  --green-600: #2f7d57;
  --green-200: #cde9d8;
  --green-100: #e3f3e8;
  --green-50: #f1f8f3;
  --ink: #17211d;
  --muted: #607069;
  --line: #d9e3dd;
  --paper: #ffffff;
  --background: #f4f7f3;
  --accent: #c95f32;
  --danger: #b23b39;
  --shadow: 0 10px 30px rgba(23, 63, 45, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--background); font-size: 16px; line-height: 1.45; }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--green-700); }

.app-shell { min-height: 100dvh; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 48px 1fr auto;
  gap: 8px; align-items: center; min-height: 68px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  color: white; background: linear-gradient(135deg, var(--green-900), var(--green-700));
  box-shadow: 0 4px 18px rgba(23, 63, 45, .18);
}
.brand-title { margin: 0; font-size: 1.18rem; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.brand-sub { display: block; margin-top: 2px; font-size: .78rem; font-weight: 500; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-mini { width: 42px; height: 42px; object-fit: cover; border-radius: 12px; border: 2px solid rgba(255,255,255,.65); background: white; }
.icon-btn { min-width: 44px; min-height: 44px; border: 0; border-radius: 13px; color: inherit; background: rgba(255,255,255,.13); cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.22); }
.top-actions { display: flex; gap: 6px; }

.content { width: min(100%, 840px); margin: 0 auto; padding: 18px 16px 0; }
.home-head { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; margin: 4px 0 22px; }
.home-logo { width: 96px; height: 96px; object-fit: cover; border-radius: 25px; box-shadow: var(--shadow); }
.home-head h2 { margin: 0 0 4px; font-size: clamp(1.45rem, 5vw, 2rem); line-height: 1.1; }
.home-head p { margin: 0; color: var(--muted); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }
.eyebrow { margin: 0 0 5px; color: var(--green-700); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.page-title { margin: 0; font-size: clamp(1.55rem, 6vw, 2.35rem); line-height: 1.12; }
.page-meta { margin: 8px 0 0; color: var(--muted); }

.card-list { display: grid; gap: 12px; }
.trip-card, .item-card, .area-card, .summary-card, .form-card, .empty-card {
  border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow);
}
.trip-card { position: relative; overflow: hidden; padding: 17px; cursor: pointer; }
.trip-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--green-600); }
.trip-main { display: grid; grid-template-columns: 50px 1fr auto; gap: 12px; align-items: center; }
.trip-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; background: var(--green-100); font-size: 1.65rem; }
.trip-card h3, .item-card h3 { margin: 0; font-size: 1.08rem; }
.trip-card p, .item-card p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.chevron { color: var(--green-700); font-size: 1.5rem; }

.detail-hero { position: relative; overflow: hidden; margin-bottom: 16px; padding: 22px; border-radius: 24px; color: white; background: linear-gradient(135deg, #173f2d 0%, #2f7d57 72%, #5a9a70 100%); box-shadow: var(--shadow); }
.detail-hero::after { content: attr(data-icon); position: absolute; right: 16px; bottom: -20px; font-size: 6.5rem; opacity: .16; transform: rotate(-8deg); }
.detail-hero h2 { position: relative; z-index: 1; margin: 0; font-size: clamp(1.6rem, 7vw, 2.5rem); line-height: 1.08; }
.detail-hero p { position: relative; z-index: 1; max-width: 75%; margin: 7px 0 0; color: rgba(255,255,255,.82); }
.detail-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.area-grid { display: grid; gap: 12px; }
.area-card { display: grid; grid-template-columns: 48px 1fr auto; gap: 13px; align-items: center; width: 100%; padding: 16px; border-color: #bcd9c7; text-align: left; cursor: pointer; background: linear-gradient(135deg, #f7fcf8, #dff1e5); }
.area-card:hover { border-color: var(--green-600); transform: translateY(-1px); }
.area-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: white; font-size: 1.45rem; box-shadow: 0 5px 16px rgba(23,63,45,.08); }
.area-card strong { display: block; font-size: 1rem; }
.area-card small { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; }
.count-badge { min-width: 30px; padding: 4px 8px; border-radius: 99px; color: white; background: var(--green-700); text-align: center; font-size: .78rem; font-weight: 800; }

.item-card { padding: 16px; }
.item-top { display: flex; justify-content: space-between; gap: 12px; }
.item-icon { font-size: 1.4rem; }
.item-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.linked-status { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 11px; border-radius: 12px; color: var(--green-900); background: var(--green-100); font-size: .86rem; font-weight: 750; }
.item-note { margin-top: 10px !important; padding-top: 10px; border-top: 1px solid var(--line); }
.amount { color: var(--green-700); font-size: 1.12rem; font-weight: 800; white-space: nowrap; }
.photo-strip { display: flex; gap: 7px; overflow-x: auto; margin-top: 12px; padding-bottom: 2px; }
.photo-strip img { width: 76px; height: 62px; flex: 0 0 auto; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

.form-card { padding: 18px; }
.form-grid { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span, .field legend { color: #33463e; font-size: .88rem; font-weight: 700; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid #b9c9c0; border-radius: 12px; color: var(--ink); background: white;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid rgba(47,125,87,.18); border-color: var(--green-600); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; padding: 10px 13px; border: 1px solid #b9c9c0; border-radius: 999px; background: white; cursor: pointer; }
.choice input:checked + span { border-color: var(--green-700); color: white; background: var(--green-700); }
.help { margin: -3px 0 0; color: var(--muted); font-size: .8rem; }
.error { padding: 10px 12px; border-radius: 12px; color: #7b1e1d; background: #fde9e7; }
.success { padding: 10px 12px; border-radius: 12px; color: var(--green-900); background: var(--green-100); }

.btn { min-height: 44px; padding: 10px 15px; border: 0; border-radius: 12px; font-weight: 750; cursor: pointer; }
.btn-primary { color: white; background: var(--green-700); }
.btn-primary:hover { background: var(--green-900); }
.btn-secondary { color: var(--green-900); background: var(--green-100); }
.btn-ghost { color: inherit; background: transparent; border: 1px solid currentColor; }
.btn-danger { color: var(--danger); background: #fdebea; }
.btn-small { min-height: 38px; padding: 8px 11px; font-size: .86rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.button-row .btn-primary { flex: 1 1 180px; }
.link-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pin-card { padding: 18px; border: 1px solid #bcd9c7; border-radius: 16px; background: var(--green-50); text-align: center; }
.pin-card span { display: block; color: var(--muted); font-size: .82rem; font-weight: 700; }
.pin-card strong { display: block; margin-top: 4px; color: var(--green-900); font-size: 2rem; letter-spacing: .16em; }
.invite-preview { display: grid; grid-template-columns: 54px 1fr; gap: 13px; align-items: center; }
.invite-preview h2, .invite-preview p { margin: 0; }
.invite-preview p { margin-top: 4px; color: var(--muted); }
.soft-divider { width: 100%; border: 0; border-top: 1px solid var(--line); }
.support-card { padding: 14px; border-radius: 16px; background: var(--green-50); }
.support-card h2 { margin-top: 0; }

.fab { position: fixed; right: max(20px, calc((100vw - 840px) / 2 + 20px)); bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 30; width: 60px; height: 60px; border: 0; border-radius: 20px; color: white; background: var(--accent); box-shadow: 0 10px 28px rgba(139,59,25,.28); font-size: 2rem; line-height: 1; cursor: pointer; }
.fab:active { transform: scale(.96); }

.empty-card { padding: 26px 20px; text-align: center; box-shadow: none; }
.empty-card .empty-icon { font-size: 2.2rem; }
.empty-card h3 { margin: 8px 0 4px; }
.empty-card p { margin: 0; color: var(--muted); }

.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.summary-card { padding: 14px; box-shadow: none; }
.summary-card strong { display: block; font-size: 1.25rem; }
.summary-card span { color: var(--muted); font-size: .82rem; }
.balance-positive { color: var(--green-700); }
.balance-negative { color: var(--danger); }

.photo-picker { padding: 12px; border: 1px dashed #93b4a1; border-radius: 14px; background: var(--green-50); }
.photo-picker h4 { margin: 0 0 4px; }
.photo-picker p { margin: 0 0 10px; color: var(--muted); font-size: .82rem; }
.photo-preview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-bottom: 10px; }
.photo-preview figure { position: relative; margin: 0; aspect-ratio: 1; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.photo-remove { position: absolute; top: 3px; right: 3px; width: 28px; height: 28px; border: 0; border-radius: 50%; color: white; background: rgba(0,0,0,.72); cursor: pointer; }
.hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: #dce8e0; }
.segmented button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.segmented button.active { color: white; background: var(--green-700); }
.footer-note { margin: 28px 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.footer-note button { padding: 4px; border: 0; color: var(--green-700); background: transparent; text-decoration: underline; cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: calc(94px + env(safe-area-inset-bottom)); z-index: 100; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; color: white; background: #173f2d; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

#print-root { display: none; }
.print-page { color: #111; font-family: Arial, sans-serif; }
.print-page h1 { margin: 0 0 4px; color: #173f2d; }
.print-page h2 { margin-top: 24px; padding-bottom: 5px; border-bottom: 2px solid #2f7d57; color: #173f2d; }
.print-page h3 { margin: 15px 0 4px; }
.print-page p { margin: 4px 0; }
.print-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; break-inside: avoid; }
.print-photos img { width: 100%; max-height: 230px; object-fit: contain; border: 1px solid #ccc; border-radius: 6px; }

@media (min-width: 660px) {
  .area-grid { grid-template-columns: 1fr 1fr; }
  .form-grid.two-col { grid-template-columns: 1fr 1fr; }
  .form-grid.two-col .span-2 { grid-column: 1 / -1; }
  .card-list.wide { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .home-head { grid-template-columns: 76px 1fr; }
  .home-logo { width: 76px; height: 76px; border-radius: 21px; }
  .field-row { grid-template-columns: 1fr; }
  .photo-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { padding-left: 10px; padding-right: 10px; }
}

@media print {
  @page { margin: 14mm; }
  body { background: white; }
  #app, #toast { display: none !important; }
  #print-root { display: block; }
  .print-page { display: block; }
  .print-section, .print-item { break-inside: avoid; }
}

/* Öffentliche Datenschutzerklärung: statisch, ohne Skripte oder Tracking. */
html { scroll-behavior: smooth; }
.privacy-page { margin: 0; color: #163529; background: #fffdf7; font-size: 16px; line-height: 1.65; }
.privacy-header { padding: 2.2rem 1rem 1.8rem; color: white; background: #246846; }
.privacy-header > div,
.privacy-main,
.privacy-footer { width: min(880px, calc(100% - 2rem)); margin-inline: auto; }
.privacy-header h1 { margin: 0; font-size: clamp(1.8rem, 5vw, 2.7rem); }
.privacy-header p { margin: .35rem 0 1rem; opacity: .92; }
.privacy-nav { display: flex; flex-wrap: wrap; gap: .55rem; }
.privacy-nav a { padding: .3rem .8rem; border: 1px solid rgba(255,255,255,.55); border-radius: 999px; color: white; text-decoration: none; }
.privacy-main { padding: 1.3rem 0 2.5rem; }
.privacy-section { margin: 1rem 0; padding: clamp(1rem, 4vw, 1.7rem); border: 1px solid #dce6df; border-radius: 18px; background: white; box-shadow: 0 3px 14px rgba(22,53,41,.05); }
.privacy-section h2 { margin-top: 0; color: #246846; }
.privacy-section h3 { margin-bottom: .25rem; }
.privacy-section p,
.privacy-section ul { margin-top: .35rem; }
.privacy-section address { font-style: normal; }
.privacy-section .lead { font-size: 1.06rem; }
.privacy-section .note { padding: .8rem 1rem; border-left: 4px solid #246846; background: #f0f7f2; }
.privacy-footer { padding: 1.2rem 0 2rem; border-top: 1px solid #dce6df; color: #597066; }
