/* Wohnungssuche, Apple-style, mobile first. One accent (a calm Säuliamt green), colour on data and state only. */
:root {
  --ground: #f4f3ef;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #55555b;
  --ink-3: #6e6e73;
  --line: rgba(0, 0, 0, .09);
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --accent: #1d7a55;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ea;
  --warn: #8a5a00;
  --warn-soft: #fbefd5;
  --new: #0a6ccf;
  --new-soft: #e1eefc;
  --danger: #c4332b;
  --bar: rgba(244, 243, 239, .78);
  --sheet: #ffffff;
  --shadow: 0 10px 40px rgba(0, 0, 0, .18);
  --r-card: 20px;
  --r-ctl: 12px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --st-neu: #0a6ccf; --st-interessant: #1d7a55; --st-angefragt: #8a5a00; --st-besichtigung: #7a3fb8; --st-abgelehnt: #8e8e93;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111311; --card: #1c1e1c; --ink: #f2f2f2; --ink-2: #b7b7bc; --ink-3: #9a9aa0;
    --line: rgba(255, 255, 255, .1); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .34);
    --accent: #3fbf8a; --accent-ink: #062818; --accent-soft: rgba(63, 191, 138, .16);
    --warn: #f2c063; --warn-soft: rgba(242, 192, 99, .16); --new: #5eb0ff; --new-soft: rgba(94, 176, 255, .16);
    --danger: #ff6b61; --bar: rgba(17, 19, 17, .78); --sheet: #1f211f; --shadow: 0 10px 40px rgba(0, 0, 0, .6);
    --st-neu: #5eb0ff; --st-interessant: #3fbf8a; --st-angefragt: #f2c063; --st-besichtigung: #c79bff; --st-abgelehnt: #8e8e93;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.35 var(--font); letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-3); }
[hidden] { display: none !important; }
.booting { opacity: 0; }
#app { transition: opacity .25s ease; }

/* ---------- brand ---------- */
.mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.mark svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.mark.big { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 18px; }
.mark.big svg { width: 42px; height: 42px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card h1 { font: 700 28px/1.15 var(--font-display); letter-spacing: -.02em; margin: 0; }
.login-card .muted { margin: 6px 0 28px; }
.field { position: relative; display: block; }
.field input { width: 100%; height: 52px; padding: 0 52px 0 16px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--card); font-size: 17px; outline: none; transition: border-color .2s, box-shadow .2s; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.in-field { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; border: 0; background: none; color: var(--ink-3); border-radius: 10px; display: grid; place-items: center; }
.in-field:active { background: var(--fill); }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 10px 0 6px; }

/* ---------- buttons ---------- */
.btn { height: 50px; padding: 0 22px; border-radius: 14px; border: 0; font-weight: 600; font-size: 17px; transition: transform .15s var(--ease), opacity .15s, background .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); width: 100%; }
.btn.primary[disabled] { opacity: .5; }
.btn.plain { background: none; color: var(--accent); font-weight: 500; }
.btn.wide { width: 100%; }
.link { border: 0; background: none; color: var(--accent); font-size: 17px; padding: 6px 2px; }
.link.strong { font-weight: 600; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 20px; border: 0; background: var(--fill); display: grid; place-items: center; transition: transform .15s var(--ease), background .2s; }
.icon-btn:active { transform: scale(.92); background: var(--fill-2); }
.icon-btn .count { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; line-height: 18px; }

/* ---------- top bar ---------- */
.view { padding-bottom: calc(96px + var(--safe-b)); }
.bar { position: sticky; top: 0; z-index: 5; padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 12px; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.bar.scrolled { border-bottom-color: var(--line); }
.bar-row { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.large { font: 700 34px/1.1 var(--font-display); letter-spacing: -.025em; margin: 6px 0 2px; }
.summary { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--fill); border-radius: 10px; padding: 2px; max-width: 420px; }
.seg button { position: relative; z-index: 1; height: 32px; border: 0; background: none; font-size: 14px; font-weight: 500; border-radius: 8px; }
.seg button[aria-selected="true"] { font-weight: 600; }
.seg-thumb { position: absolute; top: 2px; left: 2px; width: calc(50% - 2px); height: 32px; border-radius: 8px; background: var(--card); box-shadow: 0 2px 6px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); transition: transform .3s var(--ease); }
.seg[data-pos="1"] .seg-thumb { transform: translateX(100%); }

/* ---------- list ---------- */
.list { display: grid; gap: 16px; padding: 8px 16px 0; grid-template-columns: 1fr; max-width: 1240px; margin: 0 auto; }
@media (min-width: 720px) { .list { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 24px 0; gap: 20px; } .bar { padding-left: 24px; padding-right: 24px; } }
@media (min-width: 1100px) { .list { grid-template-columns: repeat(3, minmax(0, 1fr)); } .bar > * { max-width: 1192px; margin-left: auto; margin-right: auto; } }
.card { background: var(--card); border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.photo { position: relative; aspect-ratio: 16 / 10; background: var(--fill); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .3s; }
.photo img.loading { opacity: 0; }
.photo .nophoto { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); }
.photo .nophoto svg { width: 40px; height: 40px; stroke-width: 1.3; }
.badges { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 24px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.badge.new { background: var(--new); color: #fff; }
.badge.fixed { background: var(--warn-soft); color: var(--warn); }
.badge.gone { background: rgba(0, 0, 0, .62); color: #fff; }
.body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.addr { min-width: 0; }
.addr b { display: block; font-weight: 600; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.addr span { color: var(--ink-2); font-size: 15px; }
.rent { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.rent b { display: block; font: 700 20px/1.2 var(--font-display); letter-spacing: -.02em; }
.rent span { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { min-width: 0; padding-right: 6px; }
.facts dt { color: var(--ink-3); font-size: 12px; margin: 0 0 2px; }
.facts dd { margin: 0; font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.walk { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 15px; }
.walk svg { width: 18px; height: 18px; color: var(--accent); }
.walk b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; border-radius: 8px; background: var(--fill); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 10px; border-radius: 18px; border: 0; background: var(--fill); font-size: 14px; font-weight: 600; transition: transform .15s var(--ease), background .2s; }
.status-btn:active { transform: scale(.95); background: var(--fill-2); }
.status-btn svg { width: 14px; height: 14px; color: var(--ink-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st, var(--ink-3)); flex: none; }
.open { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 4px 0 12px; border-radius: 18px; color: var(--accent); font-size: 15px; font-weight: 600; text-decoration: none; transition: opacity .15s; }
.open:active { opacity: .6; }
.open svg { width: 16px; height: 16px; }
.meta { color: var(--ink-3); font-size: 13px; }
.card.is-gone .photo img { filter: grayscale(1); opacity: .5; }
.card.is-gone .body > *:not(.foot) { opacity: .55; }
.card.is-gone .rent b { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.gone-block { max-width: 1240px; margin: 28px auto 0; }
.reveal { display: block; margin: 0 auto 14px; border: 0; background: var(--fill); border-radius: 18px; height: 36px; padding: 0 16px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: transform .15s var(--ease); }
.reveal:active { transform: scale(.96); }
.empty { text-align: center; color: var(--ink-2); padding: 64px 32px; max-width: 420px; margin: 0 auto; }
.empty b { display: block; color: var(--ink); font-size: 19px; margin-bottom: 6px; }

/* ---------- grouped form ---------- */
.form { max-width: 640px; margin: 0 auto; padding: 8px 16px 0; }
.group-title { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3); margin: 22px 16px 8px; text-transform: uppercase; }
.group { background: var(--card); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.group + .group { margin-top: 12px; }
.group-foot { color: var(--ink-3); font-size: 13px; margin: 8px 16px 0; }
.group-foot.center { text-align: center; margin: 14px 0 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 16px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.row > span:first-child { flex: 1; min-width: 0; }
.input-row input[type="text"], .input-row select { text-align: right; border: 0; background: none; outline: none; min-width: 0; flex: 1; max-width: 62%; color: var(--ink-2); font-size: 17px; }
.input-row select { -webkit-appearance: none; appearance: none; padding-right: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") right center / 12px no-repeat; }
.unit-field { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; background: var(--fill); }
.unit-field input { width: 76px; border: 0; background: none; outline: none; text-align: right; font-size: 17px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.unit-field input::-webkit-outer-spin-button, .unit-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-field em { font-style: normal; color: var(--ink-3); font-size: 15px; }
.unit-field:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.stepper { display: inline-flex; align-items: center; background: var(--fill); border-radius: 10px; height: 36px; }
.stepper button { width: 40px; height: 36px; border: 0; background: none; font-size: 20px; border-radius: 10px; transition: background .15s; }
.stepper button:active { background: var(--fill-2); }
.stepper output { min-width: 44px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-2); transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .3s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }
.check-row { cursor: pointer; }
.check-row .tick { width: 22px; height: 22px; color: var(--accent); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease); }
.check-row[aria-checked="true"] .tick { opacity: 1; transform: none; }
.check-row:active { background: var(--fill); }
#save-btn { margin-top: 22px; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: grid; grid-template-columns: 1fr 1fr; padding: 6px 0 calc(6px + var(--safe-b)); background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); }
.tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 4px 0; color: var(--ink-3); font-size: 11px; font-weight: 500; transition: color .2s, transform .15s var(--ease); }
.tabbar button:active { transform: scale(.94); }
.tabbar button[aria-current="page"] { color: var(--accent); }
.tabbar button[aria-current="page"] svg { fill: var(--accent-soft); }
@media (min-width: 720px) { .tabbar { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); width: 320px; border-radius: 22px; border: 1px solid var(--line); padding: 6px 0; box-shadow: 0 8px 30px rgba(0, 0, 0, .1); } }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .3s ease; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow: auto; background: var(--ground); border-radius: 18px 18px 0 0; padding: 8px 16px calc(18px + var(--safe-b)); transform: translateY(105%); transition: transform .42s var(--ease); box-shadow: var(--shadow); }
.sheet.on { transform: none; }
@media (min-width: 720px) { .sheet { left: 50%; right: auto; width: 440px; bottom: auto; top: 50%; border-radius: 18px; transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .35s var(--ease), opacity .25s; padding-bottom: 18px; } .sheet.on { transform: translate(-50%, -50%); opacity: 1; } .grabber { display: none; } }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto 10px; }
.sheet h2 { font-size: 17px; font-weight: 600; text-align: center; margin: 4px 0 2px; }
.sheet-sub { text-align: center; color: var(--ink-3); font-size: 13px; margin: 0 0 14px; overflow-wrap: anywhere; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 14px; }
.sheet-head .link:first-child { justify-self: start; }
.sheet-head .link:last-child { justify-self: end; }
.sheet-head h2 { margin: 0; }
.sheet .btn.plain { margin-top: 10px; background: var(--card); border: 1px solid var(--line); }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 16px; border: 0; background: none; text-align: left; font-size: 17px; position: relative; }
.opt + .opt::before { content: ""; position: absolute; top: 0; left: 35px; right: 0; height: 1px; background: var(--line); }
.opt:active { background: var(--fill); }
.opt span { flex: 1; }
.opt svg { width: 20px; height: 20px; color: var(--accent); opacity: 0; }
.opt[aria-checked="true"] svg { opacity: 1; }
.opt[aria-checked="true"] span { font-weight: 600; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); z-index: 30; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 18px; border-radius: 22px; background: var(--ink); color: var(--ground); font-size: 15px; font-weight: 600; transition: transform .35s var(--ease), opacity .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; } }
