/* einly · Stil A4 „Beere“ */
:root {
  --bg: #FBEDEA;
  --surface: #FFF7F5;
  --card: #FFFFFF;
  --ink: #2A1420;
  --muted: #674E5A;
  --muted-2: #8A7280;
  --line: #F2DFDB;
  --line-2: #E6CEC9;
  --accent: #B0275C;
  --accent-ink: #FFFFFF;
  --soft: #FFE0C2;
  --soft-ink: #6E3A0E;
  --danger: #A3203C;
  --ok: #1F7A4D;
  --r-card: 36px;
  --r-field: 18px;
  --tabbar: 68px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Sora, system-ui, sans-serif; font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--accent); }

#app { max-width: 480px; min-height: 100dvh; margin: 0 auto; background: var(--surface); display: flex; flex-direction: column; }
.screen { flex: 1; padding: max(24px, env(safe-area-inset-top)) 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.screen.center { justify-content: center; }

.wordmark { font-weight: 800; font-size: 26px; letter-spacing: -1px; }
.wordmark span { color: var(--accent); }
h1 { font-size: 32px; line-height: 1.12; letter-spacing: -.5px; margin: 8px 0 0; font-weight: 700; }
h2 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 700; }
.lead { color: var(--muted); font-size: 16px; margin: 0; }
.small { color: var(--muted); font-size: 13px; margin: 0; }
.dots { display: flex; gap: 6px; }
.dots span { height: 6px; width: 6px; border-radius: 3px; background: var(--line-2); }
.dots span.on { width: 22px; background: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px; border: none; font-weight: 600; font-size: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: var(--card); color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-link { background: none; border: none; color: var(--muted); text-decoration: underline; min-height: 44px; padding: 0 8px; font-size: 14px; }
.btn-block { width: 100%; }
.actions { display: flex; gap: 10px; margin-top: auto; padding-top: 8px; }
.actions .btn { flex: 1; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
label.field .hint { font-weight: 400; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 50px; border: 1.5px solid var(--line-2); border-radius: var(--r-field); background: var(--card); padding: 12px 14px; font-weight: 400; }
textarea.input { resize: vertical; min-height: 84px; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--card); font-size: 14px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.group-title { font-weight: 600; font-size: 14px; margin: 6px 0 -6px; }

.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 0; }
.ok { color: var(--ok); font-weight: 600; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-card); padding: 20px; }
.notice { background: var(--soft); color: var(--soft-ink); border-radius: 24px; padding: 14px 16px; font-size: 14px; }

.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.photo-slot { position: relative; aspect-ratio: 4 / 5; border-radius: 24px; border: 1.5px dashed var(--line-2); background: var(--card); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted-2); font-size: 28px; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-slot .remove { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(42,20,32,.75); color: #fff; font-size: 16px; }

.profile-photo { border-radius: var(--r-card); overflow: hidden; aspect-ratio: 4 / 5; background: var(--line); }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prompt-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; }
.prompt-card .q { font-size: 13px; font-weight: 600; color: var(--muted); }
.prompt-card .a { font-size: 21px; font-weight: 600; line-height: 1.3; margin-top: 6px; }
.vitals { display: flex; flex-wrap: wrap; gap: 8px; }
.vitals span { background: var(--soft); color: var(--soft-ink); border-radius: 999px; padding: 6px 12px; font-size: 14px; }

#toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 18px; font-size: 14px; max-width: 90vw; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.field-title { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.hint { display: block; color: var(--muted); font-weight: 400; font-size: 13px; margin-top: 2px; }
label.field .hint { display: inline; margin: 0; }

/* Freiwillige Angaben: grau = nicht im Profil */
.opt-card { border-radius: 24px; padding: 14px 16px; background: var(--line); border: 1.5px solid var(--line); transition: background .15s; }
.opt-card .chip:not([aria-pressed="true"]), .opt-card .input { background: transparent; }
.opt-card.on { background: var(--card); border-color: var(--line-2); }
.opt-card.on .input { background: var(--card); }
.opt-card .opt-head { margin: 0 0 10px; }
.opt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.opt-tag { font-size: 12px; font-weight: 500; color: var(--muted); }
.opt-card.on .opt-tag { color: var(--accent); }
.count { text-align: right; }

/* Fotos */
.photo-slot .edit { position: absolute; inset: 0; border: 0; padding: 0; background: none; }
.photo-slot.filled { border-style: solid; }
.photo-slot .main-tag, .photo-slot .to-front { position: absolute; left: 6px; bottom: 6px; border: 0; border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.92); color: var(--ink); }
.photo-slot .main-tag { background: var(--accent); color: #fff; }

/* Zuschneiden */
.cropper { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; gap: 14px; padding: 12px 20px 24px; overflow-y: auto; }
.cropper-head { display: flex; justify-content: space-between; align-items: center; }
.cropper-head .strong { font-weight: 700; color: var(--accent); }
.cropper-stage { position: relative; width: 100%; max-width: 420px; margin: 0 auto; border-radius: var(--r-card); overflow: hidden; touch-action: none; cursor: grab; background: #000; }
.cropper-stage canvas { display: block; }
.cropper-frame { position: absolute; inset: 0; border-radius: var(--r-card); box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); pointer-events: none; }
.cropper-zoom input { width: 100%; accent-color: var(--accent); }
.center { text-align: center; }

/* ---------- App-Rahmen mit Leiste unten ---------- */
.shell { display: flex; flex-direction: column; min-height: 100dvh; }
.view { flex: 1; display: flex; flex-direction: column; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1.5px solid var(--line);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom); }
.tabbar button { position: relative; background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--muted-2); font-size: 11px; font-weight: 600; }
.tabbar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabbar button[aria-current="true"] { color: var(--accent); }
.tabbar button[aria-current="true"] svg { stroke-width: 2.3; }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: var(--accent); color: #fff; font-size: 11px; font-style: normal; line-height: 18px; text-align: center; }
.badge:empty { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 6px; }
.loading { margin: 40vh auto; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topline { display: flex; justify-content: space-between; align-items: center; }
.pill { background: var(--soft); color: var(--soft-ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--card); font-weight: 700; letter-spacing: 1px; }

/* ---------- Profil-Ansicht ---------- */
.profile { display: flex; flex-direction: column; gap: 14px; }
.profile-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.profile-head h1 { margin: 0; }
.profile-head .age { font-weight: 500; color: var(--muted); margin-left: 10px; }
.profile-photo { position: relative; }
.prompt-card { position: relative; }
.prompt-card .a { padding-right: 44px; white-space: pre-wrap; overflow-wrap: anywhere; }
.vitals-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.vitals.interests span { background: var(--card); border: 1.5px solid var(--line-2); color: var(--ink); }
.photo-missing { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 14px; padding: 20px; }
.like-btn { position: absolute; right: 14px; bottom: 14px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--card); color: var(--accent); font-size: 24px; box-shadow: 0 4px 14px rgba(42,20,32,.18); }
.marked { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-space { height: 64px; }
.skip-btn { position: fixed; z-index: 15; left: max(20px, calc(50% - 220px)); bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom)); width: 60px; height: 60px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 22px; box-shadow: 0 4px 14px rgba(42,20,32,.18); }

/* ---------- Fenster von unten ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(42,20,32,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border-radius: 28px 28px 0 0; padding: 18px 20px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.target { border-radius: 24px; overflow: hidden; }
.target.prompt { background: var(--card); border: 1.5px solid var(--line); padding: 16px 18px; }
.target .q { font-size: 13px; font-weight: 600; color: var(--muted); }
.target .a { font-size: 18px; font-weight: 600; margin-top: 4px; white-space: pre-wrap; }
.target-img { display: block; width: 100%; max-height: 38dvh; object-fit: cover; border-radius: 24px; }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-list .btn { justify-content: flex-start; }
.btn-danger { background: var(--card); color: var(--danger); border: 1.5px solid var(--line-2); }
.celebrate { display: flex; flex-direction: column; gap: 14px; text-align: center; padding: 8px 0; }
.celebrate img { width: 140px; height: 175px; object-fit: cover; border-radius: 28px; margin: 0 auto; }

/* ---------- Posteingang ---------- */
.like-note { background: var(--card); border: 1.5px solid var(--accent); border-radius: var(--r-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.like-note .who { font-weight: 700; }
.like-note .comment { font-size: 18px; font-weight: 600; white-space: pre-wrap; }
.decide { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); display: flex; gap: 10px; padding: 12px 0 4px; background: linear-gradient(transparent, var(--surface) 30%); }
.decide .btn { flex: 1; }

/* ---------- Match & Chat ---------- */
.match-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: var(--surface); border-bottom: 1.5px solid var(--line); }
.match-head img { width: 44px; height: 55px; object-fit: cover; border-radius: 14px; }
.match-head .name { font-weight: 700; font-size: 18px; flex: 1; }
.seg { display: flex; gap: 6px; padding: 10px 16px 0; }
.seg button { flex: 1; min-height: 40px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--card); font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chat { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 20px; background: var(--card); border: 1.5px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-color: var(--accent); border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; border-bottom-left-radius: 6px; }
.msg time { display: block; font-size: 11px; opacity: .7; margin-top: 2px; }
.day { align-self: center; font-size: 12px; color: var(--muted); margin: 6px 0; }
.origin { align-self: stretch; display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1.5px dashed var(--line-2); border-radius: 24px; padding: 14px; font-size: 14px; }
.origin img { width: 64px; height: 80px; object-fit: cover; border-radius: 14px; }
.origin .row-o { display: flex; gap: 10px; align-items: flex-start; }
.composer { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end; padding: 10px 16px; background: var(--surface); border-top: 1.5px solid var(--line); }
.composer textarea { flex: 1; min-height: 46px; max-height: 140px; resize: none; }
.composer .btn { min-height: 46px; padding: 0 18px; }

/* ---------- Einstellungen & Karte ---------- */
.map { height: 300px; border-radius: 24px; overflow: hidden; border: 1.5px solid var(--line-2); z-index: 0; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); }
.range-row output { min-width: 64px; text-align: right; font-weight: 700; }
.must { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.must input { width: 20px; height: 20px; accent-color: var(--accent); }
.list-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 56px; padding: 0 18px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; text-align: left; }
.list-btn::after { content: '›'; font-size: 22px; color: var(--muted-2); }
.list-btn.danger { color: var(--danger); }
