/* Wohnungssuche – Stylesheet. Mobil zuerst, heller und dunkler Modus. */

:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #f0f2ee;
  --surface-3: #e7eae5;
  --border: #e1e5df;
  --border-strong: #cdd3cb;
  --text: #1b2220;
  --muted: #5d6a65;
  --faint: #89958f;
  --primary: #0f766e;
  --primary-hover: #0d655e;
  --primary-ink: #ffffff;
  --primary-soft: #dff1ed;
  --accent: #c2410c;
  --accent-soft: #ffedd5;
  --new: #b45309;
  --new-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --maybe: #a16207;
  --maybe-soft: #fef9c3;
  --score-l: 40%;
  --score-s: 62%;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgb(16 24 20 / 6%), 0 6px 20px rgb(16 24 20 / 6%);
  --shadow-lg: 0 10px 40px rgb(16 24 20 / 16%);
  --tabbar-h: 62px;
  --topbar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1311;
    --surface: #161c1a;
    --surface-2: #1c2421;
    --surface-3: #25302c;
    --border: #28322e;
    --border-strong: #37433e;
    --text: #e6ece9;
    --muted: #a2afaa;
    --faint: #75827d;
    --primary: #2bb3a5;
    --primary-hover: #3cc4b6;
    --primary-ink: #04201d;
    --primary-soft: #13312d;
    --accent: #fb923c;
    --accent-soft: #3b2312;
    --new: #fbbf24;
    --new-soft: #3a2d0c;
    --danger: #f87171;
    --danger-soft: #3b1515;
    --ok: #4ade80;
    --ok-soft: #12301d;
    --maybe: #facc15;
    --maybe-soft: #352e0b;
    --score-l: 38%;
    --score-s: 55%;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1311;
  --surface: #161c1a;
  --surface-2: #1c2421;
  --surface-3: #25302c;
  --border: #28322e;
  --border-strong: #37433e;
  --text: #e6ece9;
  --muted: #a2afaa;
  --faint: #75827d;
  --primary: #2bb3a5;
  --primary-hover: #3cc4b6;
  --primary-ink: #04201d;
  --primary-soft: #13312d;
  --accent: #fb923c;
  --accent-soft: #3b2312;
  --new: #fbbf24;
  --new-soft: #3a2d0c;
  --danger: #f87171;
  --danger-soft: #3b1515;
  --ok: #4ade80;
  --ok-soft: #12301d;
  --maybe: #facc15;
  --maybe-soft: #352e0b;
  --score-l: 38%;
  --score-s: 55%;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
  --shadow-lg: 0 10px 40px rgb(0 0 0 / 50%);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.15rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 0.75rem;
}

small,
.small {
  font-size: 0.85rem;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.nowrap {
  white-space: nowrap;
}

.num {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

svg.i {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --- Kopfzeile und Navigation ------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand .logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--primary-ink);
  display: grid;
  place-items: center;
}

.brand .logo svg {
  width: 18px;
  height: 18px;
}

.topnav {
  display: none;
  gap: 4px;
  margin-left: 12px;
}

.topnav a {
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 500;
  display: flex;
  gap: 6px;
  align-items: center;
}

.topnav a:hover {
  background: var(--surface-2);
  text-decoration: none;
  color: var(--text);
}

.topnav .dot-badge {
  position: static;
  border: 0;
  margin-left: -2px;
}

.topnav a.active {
  color: var(--primary);
  background: var(--primary-soft);
}

@media (min-width: 900px) {
  .topnav {
    display: flex;
  }
}

.topbar .spacer {
  flex: 1;
}

.iconbtn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.iconbtn:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.iconbtn svg {
  width: 22px;
  height: 22px;
}

.dot-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--surface);
}

.dot-badge:empty {
  display: none;
}

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--border);
}

.tabbar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
}

.tabbar a:hover {
  text-decoration: none;
}

.tabbar a svg {
  width: 23px;
  height: 23px;
}

.tabbar a.active {
  color: var(--primary);
}

.tabbar .dot-badge {
  top: 6px;
  right: calc(50% - 22px);
}

@media (min-width: 900px) {
  .tabbar {
    display: none;
  }
}

/* --- Seitenrahmen ---------------------------------------------------------------- */

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.page.narrow {
  max-width: 760px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-head h1 {
  margin: 0;
}

.page-head .sub {
  color: var(--muted);
  margin-top: 2px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 10px;
}

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
}

.section-head a {
  font-weight: 500;
  font-size: 0.9rem;
}

/* --- Karten ------------------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.pad {
  padding: 16px;
}

.card + .card {
  margin-top: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  margin-bottom: 10px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.grid.two {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
}

.stack > * + * {
  margin-top: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row.between {
  justify-content: space-between;
}

.row.nowrap {
  flex-wrap: nowrap;
}

hr.sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* --- Buttons ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}

.btn:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.btn.primary:hover {
  background: var(--primary-hover);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn.danger {
  color: var(--danger);
}

.btn.sm {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 0.875rem;
}

.btn.block {
  width: 100%;
}

.btn[disabled],
.btn.busy {
  opacity: 0.6;
  pointer-events: none;
}

form.inline {
  display: inline;
}

/* Umschalter (Abstimmung, Zusage) */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.seg button {
  white-space: nowrap;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.seg button:hover {
  color: var(--text);
  background: var(--surface);
}

.seg button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgb(0 0 0 / 12%);
}

.seg button.on.yes {
  background: var(--ok);
  color: var(--surface);
}

.seg button.on.maybe {
  background: var(--maybe);
  color: var(--surface);
}

.seg button.on.no {
  background: var(--danger);
  color: var(--surface);
}

.seg.full {
  display: flex;
}

.seg.full button {
  flex: 1;
  justify-content: center;
}

/* --- Formulare ---------------------------------------------------------------------- */

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.field {
  margin-bottom: 14px;
}

.field .hint {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  margin-top: 3px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  vertical-align: -3px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}

.form-grid {
  display: grid;
  gap: 0 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.color-pick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-pick label {
  margin: 0;
}

.color-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-pick span {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 3px solid transparent;
  box-shadow: inset 0 0 0 2px var(--surface);
  cursor: pointer;
}

.color-pick input:checked + span {
  border-color: var(--text);
}

/* --- Hinweise ----------------------------------------------------------------------- */

#flash:empty {
  display: none;
}

.flash {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(92vw, 520px);
  background: var(--text);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  animation: flash-in 0.2s ease-out, flash-out 0.4s ease-in 5s forwards;
}

@media (min-width: 900px) {
  .flash {
    bottom: 24px;
  }
}

@keyframes flash-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

@keyframes flash-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.notice {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.notice.warn {
  background: var(--new-soft);
  border-color: transparent;
  color: var(--text);
}

.notice.ok {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--text);
}

.notice.error {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--text);
}

.empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
}

.empty svg {
  width: 40px;
  height: 40px;
  color: var(--faint);
  margin-bottom: 8px;
}

.empty h3 {
  color: var(--text);
}

/* --- Badges, Chips, Avatare ------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.chip svg {
  width: 14px;
  height: 14px;
}

.chip.new {
  background: var(--new-soft);
  color: var(--new);
  border-color: transparent;
}

.chip.good {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}

.chip.bad {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.chip.primary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}

.chip.strong {
  background: var(--text);
  color: var(--surface);
  border-color: transparent;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 650;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: currentColor;
}

.status.s-accepted {
  background: var(--ok-soft);
  color: var(--ok);
}

.status.s-rejected,
.status.s-dismissed {
  background: var(--surface-2);
  color: var(--faint);
}

.status.s-viewing,
.status.s-visited {
  background: var(--new-soft);
  color: var(--new);
}

.status.s-applied {
  background: color-mix(in srgb, #7c3aed 14%, var(--surface));
  color: #7c3aed;
}

.score {
  --h: 120;
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  background: hsl(var(--h) var(--score-s) var(--score-l));
  color: #fff;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.score.lg {
  min-width: 64px;
  height: 52px;
  font-size: 1.6rem;
  border-radius: 14px;
}

.score.none {
  background: var(--surface-3);
  color: var(--muted);
}

.avatar {
  --c: #0f766e;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--c);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: none;
  letter-spacing: 0.02em;
}

.avatar.sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar.lg {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.avatar .mark {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 16px;
  height: 16px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  color: #fff;
}

.avatar .mark svg {
  width: 9px;
  height: 9px;
  stroke-width: 4;
}

.avatar .mark.yes {
  background: var(--ok);
}

.avatar .mark.maybe {
  background: var(--maybe);
}

.avatar .mark.no {
  background: var(--danger);
}

.avatar.pending {
  opacity: 0.35;
}

.avatars {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

/* --- Inserate-Karten ------------------------------------------------------------- */

.lcard {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, transform 0.15s;
}

.lcard:hover {
  box-shadow: var(--shadow-lg);
}

.lcard.is-hidden {
  opacity: 0.55;
}

.lcard.is-inactive .lphoto img {
  filter: grayscale(1);
}

.lphoto {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  display: block;
  overflow: hidden;
}

.lphoto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lphoto .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--faint);
}

.lphoto .placeholder svg {
  width: 44px;
  height: 44px;
  opacity: 0.5;
}

.lphoto .tl,
.lphoto .tr,
.lphoto .bl {
  position: absolute;
  display: flex;
  gap: 6px;
  align-items: center;
}

.lphoto .tl {
  top: 10px;
  left: 10px;
}

.lphoto .tr {
  top: 10px;
  right: 10px;
}

.lphoto .bl {
  bottom: 10px;
  left: 10px;
}

.lphoto .chip {
  background: rgb(255 255 255 / 92%);
  color: #1b2220;
  border: 0;
  box-shadow: 0 1px 3px rgb(0 0 0 / 15%);
}

.lphoto .chip.new {
  background: #fde68a;
  color: #78350f;
}

.lphoto .status {
  box-shadow: 0 1px 3px rgb(0 0 0 / 15%);
  background: rgb(255 255 255 / 94%);
}

.lphoto .score {
  box-shadow: 0 2px 6px rgb(0 0 0 / 25%);
}

.lbody {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.ltitle {
  font-weight: 650;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.ltitle:hover {
  text-decoration: none;
  color: var(--primary);
}

.lplace {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lfacts {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.lprice {
  font-weight: 750;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.lfacts .muted {
  font-size: 0.88rem;
}

.lchips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.lfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.lfoot .actions {
  display: flex;
  gap: 4px;
}

.lfoot .iconbtn {
  width: 34px;
  height: 34px;
}

.lfoot .iconbtn svg {
  width: 19px;
  height: 19px;
}

.lfoot .iconbtn.on {
  color: var(--primary);
}

.unread-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

/* --- Filterleiste ------------------------------------------------------------------ */

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.filters input[type="search"] {
  flex: 1 1 220px;
  max-width: 360px;
  min-height: 38px;
  border-radius: 999px;
  padding-left: 16px;
}

.filters select {
  width: auto;
  min-height: 38px;
  border-radius: 999px;
  padding: 6px 30px 6px 14px;
  font-size: 0.9rem;
}

.filter-more {
  width: 100%;
}

.filter-more summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
  list-style: none;
  padding: 4px 0;
}

.filter-more summary::-webkit-details-marker {
  display: none;
}

.filter-more .form-grid {
  margin-top: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toggle-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.toggle-chips a {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--surface);
}

.toggle-chips a:hover {
  text-decoration: none;
  color: var(--text);
}

.toggle-chips a.on {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}

.result-info {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  align-items: center;
}

/* --- Karte -------------------------------------------------------------------------- */

.map {
  height: calc(100vh - var(--topbar-h) - var(--tabbar-h) - 150px);
  min-height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.minimap {
  height: 240px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.map-pin {
  display: grid;
  place-items: center;
  width: 34px;
  height: 26px;
  border-radius: 8px;
  color: #fff;
  font-weight: 750;
  font-size: 12px;
  font-family: var(--font);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 35%);
}

.map-pin.pinned {
  outline: 3px solid #f59e0b;
}

.map-pin.home {
  width: 30px;
  height: 30px;
  border-radius: 99px;
  background: var(--primary);
}

.map-pin.dest {
  width: auto;
  padding: 0 8px;
  background: #334155;
  white-space: nowrap;
}

.leaflet-popup-content {
  font-family: var(--font);
  margin: 10px 12px;
}

.map-pop {
  width: 220px;
}

.map-pop img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 6px;
}

.map-pop b {
  display: block;
  margin-bottom: 2px;
}

/* --- Detailseite ------------------------------------------------------------------ */

.detail {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1000px) {
  .detail {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }
  .detail .dtop {
    grid-column: 1;
    grid-row: 1;
  }
  .detail .side {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .detail .dmore {
    grid-column: 1;
    grid-row: 2;
  }
}

.gallery {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

.gallery .track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  aspect-ratio: 16 / 10;
}

.gallery .track::-webkit-scrollbar {
  display: none;
}

.gallery .track a {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.gallery .track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery .count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgb(0 0 0 / 60%);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.gallery .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 99px;
  border: 0;
  background: rgb(255 255 255 / 90%);
  color: #111;
  display: none;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgb(0 0 0 / 25%);
}

.gallery:hover .nav {
  display: grid;
}

.gallery .nav.prev {
  left: 12px;
}

.gallery .nav.next {
  right: 12px;
}

.gallery.empty-gallery {
  aspect-ratio: 16 / 7;
  display: grid;
  place-items: center;
  color: var(--faint);
}

.gallery.empty-gallery svg {
  width: 56px;
  height: 56px;
}

.dhead {
  margin-top: 16px;
}

.dhead h1 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.dprice {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.dprice .big {
  font-size: 1.7rem;
  font-weight: 780;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 14px;
}

.facts > div {
  background: var(--surface);
  padding: 9px 12px;
}

.facts dt {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.facts dd {
  margin: 1px 0 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

dl {
  margin: 0;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 0.92rem;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bars {
  display: grid;
  gap: 9px;
}

.bar {
  display: grid;
  grid-template-columns: 112px 1fr 34px;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
}

.bar .track {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.bar .fill {
  --h: 120;
  display: block;
  height: 100%;
  border-radius: 99px;
  background: hsl(var(--h) var(--score-s) calc(var(--score-l) + 6%));
}

.bar .val {
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.bar .lbl small {
  color: var(--faint);
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 12px;
}

.tabs a {
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
  white-space: nowrap;
}

.tabs a.on {
  background: var(--primary-soft);
  color: var(--primary);
}

.tabs a:hover {
  text-decoration: none;
  color: var(--text);
}

.description {
  white-space: pre-line;
  font-size: 0.95rem;
  color: var(--text);
}

.clamp {
  position: relative;
  max-height: 220px;
  overflow: hidden;
}

.clamp.open {
  max-height: none;
}

.clamp:not(.open)::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 70px;
  background: linear-gradient(transparent, var(--surface));
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pricechart {
  width: 100%;
  height: 60px;
  color: var(--primary);
}

/* --- Zusammenarbeit (Pin-Bereich) -------------------------------------------------- */

.pin-cta {
  text-align: center;
  padding: 22px 18px;
}

.pin-cta textarea {
  min-height: 64px;
  margin: 10px 0;
}

.team-votes {
  display: grid;
  gap: 8px;
}

.team-vote {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-vote .who {
  flex: 1;
  font-weight: 600;
}

.team-vote .what {
  font-size: 0.85rem;
  font-weight: 650;
}

.team-vote .what.yes {
  color: var(--ok);
}

.team-vote .what.maybe {
  color: var(--maybe);
}

.team-vote .what.no {
  color: var(--danger);
}

.team-vote .what.none {
  color: var(--faint);
}

.consensus {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 0.9rem;
}

.consensus.yes {
  background: var(--ok-soft);
  color: var(--ok);
}

.consensus.mixed {
  background: var(--maybe-soft);
  color: var(--maybe);
}

.consensus.no {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-steps button {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.status-steps button:hover {
  color: var(--text);
  border-color: var(--text);
}

.status-steps button.on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.status-steps button.done-on {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}

/* Termine */
.appt {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.appt + .appt {
  border-top: 1px solid var(--border);
}

.appt.cancelled {
  opacity: 0.55;
}

.appt.cancelled .when-title {
  text-decoration: line-through;
}

.datebox {
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  text-align: center;
  padding: 6px 0;
  height: fit-content;
}

.datebox .d {
  display: block;
  font-size: 1.45rem;
  font-weight: 780;
  line-height: 1.1;
}

.datebox .m {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.appt .when-title {
  font-weight: 700;
}

.appt .meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 2px 0 8px;
}

.appt .meta div {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.appt .meta svg {
  margin-top: 3px;
}

.appt .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.appt details.edit {
  margin-top: 10px;
}

.appt details.edit summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.add-box > summary {
  list-style: none;
  cursor: pointer;
}

.add-box > summary::-webkit-details-marker {
  display: none;
}

.add-box[open] > summary {
  margin-bottom: 12px;
}

@media (max-width: 440px) {
  .seg button {
    padding: 6px 9px;
    font-size: 0.84rem;
  }
  .appt {
    padding: 12px;
    gap: 10px;
  }
}

/* Aufgaben */
.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tasks li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}

.tasks li + li {
  border-top: 1px solid var(--border);
}

.tasks .t-title {
  flex: 1;
  min-width: 0;
}

.tasks li.done .t-title {
  text-decoration: line-through;
  color: var(--faint);
}

.task-check {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: transparent;
  padding: 0;
}

.task-check svg {
  width: 14px;
  height: 14px;
  stroke-width: 3.5;
}

li.done .task-check {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

/* Verlauf / Kommentare */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
}

.msg .bubble {
  background: var(--surface-2);
  border-radius: 4px 14px 14px 14px;
  padding: 8px 12px;
  min-width: 0;
}

.msg.mine .bubble {
  background: var(--primary-soft);
}

.msg .head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.82rem;
}

.msg .head b {
  font-size: 0.88rem;
}

.msg .head .t {
  color: var(--faint);
}

.msg .text {
  overflow-wrap: anywhere;
}

.msg .del {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  padding: 0 2px;
}

.msg .del:hover {
  color: var(--danger);
}

.atts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.atts a.img {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-3);
}

.atts a.img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.atts a.file {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

.ev {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--muted);
  padding-left: 6px;
}

.ev .avatar {
  width: 20px;
  height: 20px;
  font-size: 8px;
}

.ev .ic {
  width: 20px;
  height: 20px;
  border-radius: 99px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  flex: none;
}

.ev .ic svg {
  width: 12px;
  height: 12px;
}

.ev .t {
  color: var(--faint);
  margin-left: auto;
  white-space: nowrap;
}

.composer {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.composer textarea {
  min-height: 70px;
}

.composer .bar2 {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-names {
  font-size: 0.82rem;
  color: var(--muted);
}

/* --- Board ---------------------------------------------------------------------------- */

.board {
  display: grid;
  gap: 16px;
}

@media (min-width: 1000px) {
  .board {
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 1fr);
    overflow-x: auto;
    padding-bottom: 8px;
    align-items: start;
  }
}

.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.col-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.col-head .n {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: 99px;
  padding: 0 8px;
}

.col {
  display: grid;
  gap: 10px;
}

.bcard {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.bcard:hover {
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}

.bcard .thumb {
  width: 76px;
  height: 76px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--faint);
}

.bcard .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bcard .t {
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bcard .m {
  font-size: 0.82rem;
  color: var(--muted);
}

.bcard .f {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.col-empty {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  color: var(--faint);
  font-size: 0.85rem;
}

/* --- Übersicht ------------------------------------------------------------------------- */

.hello {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.hello h1 {
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
  gap: 10px;
}

.stat {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.stat:hover {
  text-decoration: none;
  border-color: var(--border-strong);
}

.stat .v {
  font-size: 1.6rem;
  font-weight: 780;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat .l {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.vote-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.vote-item + .vote-item {
  border-top: 1px solid var(--border);
}

.vote-item .thumb {
  width: 64px;
  height: 64px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface-2);
}

.vote-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-list > a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  color: var(--text);
}

.mini-list > a + a {
  border-top: 1px solid var(--border);
}

.mini-list > a:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.mini-list .t,
.mini-list .m {
  display: block;
}

.mini-list .t {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-list .m {
  font-size: 0.83rem;
  color: var(--muted);
}

/* --- Aktivität ------------------------------------------------------------------------- */

.notifs a {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  align-items: start;
}

.notifs a + a {
  border-top: 1px solid var(--border);
}

.notifs a:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.notifs a.unread {
  background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
}

.notifs .sys {
  width: 32px;
  height: 32px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--muted);
}

.notifs .sys svg {
  width: 16px;
  height: 16px;
}

.notifs .title {
  font-weight: 650;
}

.notifs .body {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: pre-line;
}

.notifs .t {
  color: var(--faint);
  font-size: 0.8rem;
  white-space: nowrap;
}

.day-head {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 22px 0 8px;
}

/* --- Anmelden ---------------------------------------------------------------------------- */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth .card {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px;
}

.auth .brand {
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.auth h1 {
  font-size: 1.25rem;
  text-align: center;
}

.auth p.lead {
  text-align: center;
  color: var(--muted);
}

/* --- Einstellungen --------------------------------------------------------------------- */

.settings .card {
  margin-bottom: 14px;
}

.copy-field {
  display: flex;
  gap: 8px;
}

.copy-field input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.logbox {
  background: #0d1210;
  color: #cfe3dc;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 12px;
  border-radius: var(--radius-sm);
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.user-row + .user-row {
  border-top: 1px solid var(--border);
}

.toggle-list .check {
  padding: 7px 0;
}

.toggle-list .check + .check {
  border-top: 1px solid var(--border);
}

/* --- Druck --------------------------------------------------------------------------------- */

@media print {
  .topbar,
  .tabbar,
  .composer,
  form {
    display: none !important;
  }
  body {
    padding: 0;
    background: #fff;
  }
}
