/* Gàldu – clean & verspielt (Hinge-inspiriert). Weiss, Schwarz, Dunkelrot, Dunkelgrün. */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #ececec;
  --soft: #f6f5f3;
  --red: #8e1b2b;
  --red-soft: #f8ecee;
  --green: #1e4d3b;
  --green-soft: #e9f1ed;
  --radius: 22px;
  --radius-sm: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.gear { font-size: 1.25rem; line-height: 1; padding: 8px 10px !important; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted, small { color: var(--muted); }
.serif { font-family: var(--serif); }
.red { color: var(--red); }
.green { color: var(--green); }

/* Kopfzeile + mobile Tab-Leiste */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.6rem; text-decoration: none; letter-spacing: -0.02em; }
.brand .dot { color: var(--red); }
.nav { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.nav a, .nav button { text-decoration: none; padding: 8px 12px; border-radius: 999px; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; color: var(--ink); white-space: nowrap; }
.nav a:hover, .nav button:hover { background: var(--soft); }
.nav a.active { background: var(--ink); color: #fff; }
.tabbar { display: none; }
@media (max-width: 640px) {
  .nav .nav-main { display: none; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; text-align: center; text-decoration: none; font-size: .72rem; color: var(--muted); padding: 4px 0; position: relative; }
  .tabbar a .ico { display: block; font-size: 1.35rem; line-height: 1.2; }
  .tabbar a.active { color: var(--ink); font-weight: 700; }
  body.has-tabbar main { padding-bottom: 96px; }
}
.dot-badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: .7rem; line-height: 18px; text-align: center; font-weight: 700; vertical-align: middle; }
.tabbar .dot-badge { position: absolute; top: 0; left: 55%; }

main { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px 40px; }

/* Karten */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.card.soft { background: var(--soft); border-color: transparent; }
.card.red { background: var(--red-soft); border-color: transparent; }
.card.green { background: var(--green-soft); border-color: transparent; }
.card.action { border: 2px solid var(--red); position: relative; }
.card.action::before { content: "Du bist dran"; position: absolute; top: -12px; left: 18px; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.prompt-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.prompt-answer { font-family: var(--serif); font-size: 1.45rem; line-height: 1.25; }
.grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* Formulare */
label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=datetime-local], input[type=url], input[type=number], select, textarea {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--ink); transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
textarea { min-height: 120px; resize: vertical; }
input[type=file] { width: 100%; max-width: 100%; font: inherit; font-size: .9rem; padding: 12px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: var(--soft); }
input[type=file]::file-selector-button { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 8px 14px; margin-right: 10px; background: var(--ink); color: #fff; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; accent-color: var(--green); }
.hint { font-size: .85rem; color: var(--muted); margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .1s ease, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { border-color: var(--line); }
.btn.small { padding: 8px 14px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn.danger { color: var(--red); border-color: var(--line); }

/* Haupt-CTA der Suche */
.green-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 18px; padding: 18px; border: 0; border-radius: 999px;
  background: var(--green); color: #fff; font: inherit; font-weight: 700; font-size: 1.08rem; cursor: pointer; transition: transform .1s ease;
}
.green-bar:hover { transform: translateY(-2px); }
.green-bar:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Hinweise */
.flash { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-weight: 500; }
.flash.success { background: var(--green-soft); color: var(--green); }
.flash.error { background: var(--red-soft); color: var(--red); }
.flash.info { background: var(--soft); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--soft); color: var(--ink); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.dark { background: var(--ink); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; margin: 4px 4px 0 0; border-radius: 999px; border: 1.5px solid var(--line); font-size: .9rem; background: #fff; }
.chip.now { border-color: var(--green); color: var(--green); font-weight: 600; }
.tag { display: inline-block; padding: 2px 9px; margin: 3px 3px 0 0; border-radius: 999px; background: var(--soft); font-size: .78rem; color: var(--muted); }

/* Segment-Umschalter im Dashboard */
.segmented { display: flex; background: var(--soft); border-radius: 999px; padding: 5px; margin: 6px 0 22px; }
.segmented a { flex: 1; text-align: center; padding: 11px 8px; border-radius: 999px; text-decoration: none; font-weight: 700; color: var(--muted); }
.segmented a.active { background: #fff; color: var(--ink); box-shadow: 0 2px 10px rgba(0,0,0,.07); }

/* Status-Animation "Gàldu sucht…" */
.searching { display: flex; align-items: center; gap: 14px; }
.radar { width: 44px; height: 44px; border-radius: 50%; background: var(--green-soft); position: relative; flex: none; }
.radar::before, .radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--green); animation: ping 1.8s ease-out infinite; }
.radar::after { animation-delay: .9s; }
.radar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
@keyframes ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.wait-dots::after { content: "…"; animation: dots 1.4s steps(4, end) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { width: 0; } 100% { width: 1.2em; } }

/* Verfügbarkeiten als antippbare Chips */
.slot-grid { display: grid; grid-template-columns: auto repeat(7, 1fr); gap: 6px; align-items: center; font-size: .82rem; }
.slot-grid .head { text-align: center; font-weight: 700; color: var(--muted); }
.slot-grid label { margin: 0; font-weight: 400; }
.slot-grid input { position: absolute; opacity: 0; pointer-events: none; }
.slot-grid .cell { display: block; height: 36px; border-radius: 10px; background: var(--soft); cursor: pointer; transition: background .15s; }
.slot-grid input:checked + .cell { background: var(--green); }
.slot-grid input:focus-visible + .cell { outline: 2px solid var(--ink); }

/* Avatare */
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--soft); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.avatar.lg { width: 110px; height: 110px; font-size: 1.8rem; }
.photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); display: block; background: var(--soft); }

/* Terminvorschlag */
.proposal { border-radius: var(--radius); padding: 20px; background: var(--soft); }
.proposal dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 12px 0 16px; }
.proposal dt { color: var(--muted); font-size: .9rem; }
.proposal dd { margin: 0; font-weight: 600; }
.promo { display: inline-block; margin-top: 4px; font-size: .85rem; color: var(--green); font-weight: 700; }

/* Café-Auswahl */
.places { display: grid; gap: 10px; }
.place { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px; cursor: pointer; font-weight: 400; margin: 0; }
.place:has(input:checked) { border-color: var(--ink); background: var(--soft); }
.place input { margin-top: 4px; accent-color: var(--ink); }
.place strong { display: block; }
.place.custom { border-style: dashed; }

/* Timeline / Lebenslauf */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 24px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 22px; bottom: 2px; width: 1.5px; background: var(--line); }
.timeline li:last-child::after { display: none; }

/* Konversation */
.bubble { max-width: 85%; padding: 12px 16px; border-radius: 20px; margin: 8px 0; }
.bubble.seeker { background: var(--soft); border-bottom-left-radius: 6px; }
.bubble.buddy { background: var(--green-soft); margin-left: auto; border-bottom-right-radius: 6px; }
.bubble .who { font-size: .75rem; font-weight: 700; color: var(--muted); display: block; margin-bottom: 2px; }
.bubble.playing { outline: 2px solid var(--green); }
.locked { filter: blur(5px); user-select: none; pointer-events: none; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.media-grid figure { margin: 0; }
.media-grid img, .media-grid video { width: 100%; border-radius: var(--radius-sm); display: block; }
.media-grid figcaption { font-size: .8rem; color: var(--muted); }

/* Onboarding-Fortschritt */
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps div { flex: 1; height: 5px; border-radius: 999px; background: var(--line); }
.steps div.done { background: var(--ink); }
.steps div.current { background: var(--red); }

/* Swipe-Karten */
.swipe-wrap { position: relative; height: 380px; margin: 10px 0 18px; touch-action: pan-y; user-select: none; }
.swipe-card {
  position: absolute; inset: 0; background: #fff; border: 1.5px solid var(--line); border-radius: 28px; box-shadow: 0 10px 40px rgba(0,0,0,.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; cursor: grab; transition: transform .25s ease, opacity .25s ease;
}
.swipe-card.dragging { transition: none; cursor: grabbing; }
.swipe-card .emoji { font-size: 4.2rem; line-height: 1; margin-bottom: 18px; }
.swipe-card .q { font-family: var(--serif); font-size: 1.7rem; line-height: 1.2; }
.swipe-card .stamp { position: absolute; top: 24px; padding: 6px 14px; border: 3px solid; border-radius: 10px; font-weight: 800; font-size: 1.1rem; opacity: 0; transform: rotate(-12deg); }
.swipe-card .stamp.no { left: 22px; color: var(--red); }
.swipe-card .stamp.yes { right: 22px; color: var(--green); transform: rotate(12deg); }
.swipe-card .stamp.now { left: 50%; top: auto; bottom: 24px; transform: translateX(-50%); color: var(--green); }
.swipe-back { position: absolute; inset: 14px -8px -10px; background: var(--soft); border-radius: 28px; z-index: -1; }
.swipe-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.swipe-actions .btn { min-width: 120px; }
.progress { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.progress div { height: 100%; background: var(--green); border-radius: 999px; transition: width .3s ease; }

/* Profil-Kopf */
.profile-head { text-align: center; padding: 10px 0 22px; }
.avatar.xl { width: 150px; height: 150px; font-size: 2.4rem; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--red); }

/* Einstellungen */
.settings-list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.settings-list a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; border-bottom: 1px solid var(--line); }
.settings-list a:last-child { border-bottom: 0; }
.settings-list a:hover { background: var(--soft); }
.settings-list span { font-size: 1.4rem; }
.settings-list div { flex: 1; }
.settings-list small { display: block; color: var(--muted); }
.settings-list b { color: var(--muted); font-size: 1.4rem; font-weight: 400; }

/* Mindmap: grosses SVG ab Tablet, aufklappbare Liste auf dem Handy */
.mindmap { background: var(--soft); border-radius: var(--radius); padding: 8px; margin: 10px 0; }
.mindmap-svg { width: 100%; height: auto; display: block; }
.mindmap-list { display: none; }
@media (max-width: 640px) {
  .mindmap { display: none; }
  .mindmap-list { display: block; }
  .mindmap-list details { border-bottom: 1px solid var(--line); padding: 10px 0; }
}

/* Startseite */
.scroller-wrap { position: relative; }
.scroller { cursor: grab; }
.scroller.grabbing { cursor: grabbing; user-select: none; }
.scroll-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.scroll-btns button { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: 1.1rem; cursor: pointer; }
.scroll-btns button:hover { border-color: var(--ink); }
.hero { padding: 26px 0 8px; }
.hero h1 { font-size: clamp(2.6rem, 11vw, 4.2rem); line-height: 1; margin-bottom: 16px; }
.hero h1 em { font-style: italic; color: var(--red); }
.hero .lead { font-size: 1.15rem; max-width: 560px; }
.scroller { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; margin: 0 -16px; padding-left: 16px; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.scroller .card { flex: 0 0 78%; max-width: 300px; scroll-snap-align: start; margin: 0; }
.scroller .card:nth-child(odd) { transform: rotate(-1.2deg); }
.scroller .card:nth-child(even) { transform: rotate(1.2deg); }
.step-num { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; margin-bottom: 10px; }
.points { width: 100%; border-collapse: collapse; }
.points td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.points td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.points tr.minus td:last-child { color: var(--red); }
.section { margin: 44px 0; }
.kicker { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin-bottom: 8px; }

/* Tabellen (Admin) */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-weight: 700; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 999px; text-decoration: none; border: 1.5px solid var(--line); font-size: .9rem; font-weight: 600; }
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat { font-family: var(--serif); font-size: 2rem; font-weight: 600; }

details summary { cursor: pointer; font-weight: 700; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; color: var(--red); }
details[open] summary::before { content: "– "; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.center { text-align: center; }
