/* WeserKiste – Nachrichten, Chat, Inserieren, Profil, Dialoge, Responsive. */

/* -------------------------------------------------------- Nachrichten */

.messages-page .page-head { margin-bottom: 16px; }
.messages-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* FIX: Keine starre Hoehe mehr (fuehrte zu Ueberlappungen) –
     die Layout wächst natuerlich mit dem Inhalt, begrenzt nur
     durch denViewport-Bereich: */
  min-height: 0;
  max-height: calc(100dvh - 170px);
}
.thread-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.thread-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.thread-panel-head h2 { font-size: 14px; letter-spacing: -.01em; }
.thread-panel-head > span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 750;
}
.thread-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.thread-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  transition: background .16s ease;
}
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: var(--surface-2); }
.thread-row.active { background: var(--brand-soft); }
.thread-thumb {
  position: relative;
  width: 50px;
  height: 50px;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
}
.thread-thumb .art, .chat-thumb .art, .ad-thumb .art, .mini-art .art, .success-thumb .art { width: 100%; height: 100%; }
.thread-thumb .art-emoji { font-size: 24px; }
.thread-thumb .photo { width: 100%; height: 100%; object-fit: cover; }
.thread-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.thread-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.thread-top b { font-size: 12.5px; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-top time { font-size: 9.5px; color: var(--ink-3); flex: none; }
.thread-listing { font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-preview { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-row.active .thread-preview { color: var(--brand-text); }
.unread {
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  flex: none;
}
.thread-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  padding: 28px 20px;
}
.thread-empty > span { font-size: 32px; }
.thread-empty p { font-size: 11.5px; color: var(--ink-2); max-width: 230px; }
.thread-empty .btn { margin-top: 4px; }

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}
.chat-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  padding: 28px;
}
.chat-empty-art {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 24px;
  background: var(--brand-soft);
  font-size: 34px;
}
.chat-placeholder h2 { font-size: 18px; letter-spacing: -.02em; }
.chat-placeholder p { max-width: 300px; font-size: 12px; color: var(--ink-3); }

.chat-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
  background: var(--surface);
}
.chat-back { display: none; width: 36px; height: 36px; }
.chat-thumb {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  overflow: hidden;
  flex: none;
  background: var(--surface-2);
}
.chat-thumb .art-emoji { font-size: 20px; }
.chat-thumb .photo { width: 100%; height: 100%; object-fit: cover; }
.chat-title { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.chat-title b { font-size: 13px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title a { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title a:hover { color: var(--brand-text); }

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  background: var(--surface-2);
}
.chat-context {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.chat-context .art, .chat-context .photo {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  overflow: hidden;
  flex: none;
}
.chat-context .art-emoji { font-size: 19px; }
.chat-context .photo { object-fit: cover; }
.chat-context > div:not(.art) { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.chat-context span { font-size: 8.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }
.chat-context a { font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-context > b { font-size: 11px; color: var(--brand-text); flex: none; }

.chat-flow { display: flex; flex-direction: column; gap: 4px; }
.chat-day { display: flex; justify-content: center; margin: 7px 0; }
.chat-day span {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 650;
}
.msg {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  margin-bottom: 2px;
}
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; align-items: flex-start; }
.bubble {
  padding: 9px 12px;
  border-radius: 15px;
  font-size: 12.8px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.them .bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
  color: #000;
  box-shadow: 0 2px 6px -4px rgba(0, 0, 0, .15);
}
.msg.me .bubble {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 12px -8px rgba(14, 122, 95, .8);
}
.msg time { margin: 2px 6px 3px; font-size: 8.5px; color: var(--ink-3); }
.msg.typing .bubble { display: flex; align-items: center; gap: 3px; padding: 12px 14px; }
.msg.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: typing 1.2s infinite ease-in-out;
}
.msg.typing i:nth-child(2) { animation-delay: .15s; }
.msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-3px); opacity: 1; }
}
.chat-starter {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 16px;
  gap: 4px;
}
.chat-starter > span { font-size: 32px; }
.chat-starter h3 { font-size: 15px; }
.chat-starter p { font-size: 11.5px; color: var(--ink-3); max-width: 250px; }

.chat-quick {
  display: flex;
  gap: 6px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  flex: none;
  background: var(--surface);
}
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick .chip { flex: none; }
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}
.chat-composer textarea {
  flex: 1;
  min-height: 42px;
  max-height: 132px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.4;
  resize: none;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.chat-composer textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); background: var(--surface); }
.send-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(14, 122, 95, .7);
  transition: background .18s ease, transform .16s ease;
}
.send-btn svg { width: 19px; height: 19px; }
.send-btn:hover { background: var(--brand-strong); }
.send-btn:active { transform: scale(.94); }

/* ------------------------------------------------------------ Formular */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; position: relative; }
.field > span, .field-label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field small { font-size: 10.5px; color: var(--ink-3); }
.field input[type="text"],
.field input[type="number"],
.field input[type="search"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 13.5px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field textarea { resize: vertical; min-height: 108px; line-height: 1.5; }
.field select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c8d83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 17px;
  cursor: pointer;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--ring);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field.invalid input, .field.invalid textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.count { align-self: flex-end; margin-top: -2px; font-size: 10px !important; }
.input-suffix { position: relative; display: flex; }
.input-suffix input { padding-right: 34px !important; }
.input-suffix em {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-3);
  pointer-events: none;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row .field { margin-bottom: 0; }
.field-row + .field { margin-top: 14px; }

/* ----------------------------------------------------------- Inserieren */

.compose-layout { display: grid; gap: 20px; }
.listing-form { padding: 18px 16px; }
.form-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.form-section:first-child { padding-top: 2px; }
.form-section:last-of-type { border-bottom: 0; padding-bottom: 4px; }
.form-head { margin-bottom: 13px; }
.form-head h2 { font-size: 18px; letter-spacing: -.02em; }
.form-head p { margin-top: 3px; font-size: 12px; color: var(--ink-3); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(10, 22, 16, .66);
  color: #fff;
  backdrop-filter: blur(3px);
}
.photo-remove svg { width: 12px; height: 12px; }
.photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  aspect-ratio: 1;
  padding: 6px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.photo-add:hover { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); }
.photo-add svg { width: 20px; height: 20px; }
.photo-add span { font-size: 10.5px; font-weight: 650; line-height: 1.2; }
.photo-add small { font-size: 8.5px; color: var(--ink-3); }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--line-strong); background: var(--surface-2); }
.choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-text);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.choice:has(input:focus-visible) { outline: 3px solid var(--ring); outline-offset: 2px; }
.choice-emoji { font-style: normal; font-size: 15px; line-height: 1; }
.choice-row { display: flex; flex-wrap: wrap; gap: 7px; }
.choice-row .choice { flex: 0 0 auto; }
.choice-grid.invalid { outline: 2px dashed var(--danger); outline-offset: 5px; border-radius: 14px; }

.price-row { display: grid; gap: 10px; margin-bottom: 10px; }
.price-row .field { margin-bottom: 0; }
.price-row .check-row { align-items: center; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: opacity .18s ease;
}
.check-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--brand);
  flex: none;
}
.check-row b { display: block; font-size: 12.5px; font-weight: 700; }
.check-row small { display: block; margin-top: 1px; font-size: 10.5px; color: var(--ink-3); }
.check-row.is-disabled { opacity: .5; }
.price-field.is-disabled { opacity: .5; }
.cond-block { margin-top: 14px; }
.cond-block .field-label { display: block; margin-bottom: 7px; }
.form-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.5;
}
.form-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--brand-text); }
.form-note.small { margin-top: 0; padding: 0; background: transparent; max-width: 440px; }
.form-note.warn { background: var(--danger-soft); color: var(--danger); }
.form-note.warn svg { color: var(--danger); }
.compose-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 16px;
}
.compose-actions .btn { flex: none; }
.compose-aside { display: none; }

.preview-wrap {
  position: sticky;
  top: calc(var(--appbar-h) + 18px);
  z-index: 1;
  background: var(--bg);
  padding-bottom: 16px;
}
.preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.preview-head span { font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.preview-head small { font-size: 9.5px; color: var(--ink-3); }
.preview-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.preview-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.preview-media .art, .preview-media .photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.preview-media .art-emoji { font-size: 56px; }
.preview-media .photo { object-fit: cover; }
.preview-body { padding: 12px 14px 14px; }
.preview-body h3 {
  margin: 3px 0 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.preview-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.compose-tips { margin-top: 14px; padding: 16px 18px; background: var(--surface-2); border-style: dashed; box-shadow: none; }
.compose-tips h3 { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.compose-tips h3 svg { width: 15px; height: 15px; color: var(--brand-text); }
.compose-tips .check-list { margin-top: 7px; }

/* -------------------------------------------------------------- Profil */

.profile-hero {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(120% 150% at 100% -20%, rgba(120, 255, 214, .32), transparent 55%),
    linear-gradient(132deg, #0a5542, #0e7a5f 55%, #169b78);
  box-shadow: 0 28px 60px -34px rgba(8, 80, 62, .75);
}
.profile-hero-bg {
  position: absolute;
  width: 280px;
  height: 280px;
  right: -80px;
  top: -120px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  pointer-events: none;
}
.profile-hero-bg::after {
  content: "";
  position: absolute;
  inset: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .12);
}
.profile-identity { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.profile-identity h1 { font-size: clamp(26px, 4.5vw, 34px); letter-spacing: -.035em; line-height: 1.05; margin: 3px 0 5px; }
.profile-identity .eyebrow { color: #a8f3d9; }
.profile-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 11.5px; color: rgba(255, 255, 255, .8); }
.profile-sub svg { width: 13px; height: 13px; }
.profile-identity .verified-pill { margin-top: 8px; background: rgba(255, 255, 255, .16); color: #fff; }
.profile-edit { margin-left: auto; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .26); color: #fff; }
.profile-edit:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.profile-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border-radius: 15px;
  overflow: hidden;
  background: rgba(255, 255, 255, .13);
}
.profile-stats div {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(4px);
}
.profile-stats b { font-size: 20px; letter-spacing: -.02em; line-height: 1.1; }
.profile-stats span { font-size: 9.5px; color: rgba(255, 255, 255, .72); margin-top: 2px; }

.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.profile-main, .profile-side { min-width: 0; }
.my-ads { padding: 17px 16px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { font-size: 18px; letter-spacing: -.02em; }
.panel-head p { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.ad-list { display: flex; flex-direction: column; }
.ad-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line); }
.ad-row:first-child { border-top: 0; }
.ad-thumb {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  flex: none;
  background: var(--surface-2);
}
.ad-thumb .art-emoji { font-size: 26px; }
.ad-thumb .photo { width: 100%; height: 100%; object-fit: cover; }
.ad-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.ad-copy > a b { font-size: 12.5px; letter-spacing: -.005em; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-copy > a:hover b { color: var(--brand-text); }
.ad-copy > span { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--ink-3); }
.ad-copy > span svg { width: 11px; height: 11px; }
.status-line { color: var(--ink-2) !important; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.active { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.dot.reserved { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.dot.sold { background: var(--ink-3); }
.inline-empty {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-2);
}
.inline-empty > span { font-size: 30px; }
.inline-empty > div { flex: 1; min-width: 170px; }
.inline-empty b { font-size: 12.5px; }
.inline-empty p { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.inline-empty .btn { margin-left: auto; }

.favorites-panel { padding: 17px 16px; }
.mini-list { display: flex; flex-direction: column; }
.mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.mini-item:first-child { border-top: 0; }
.mini-art { position: relative; width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex: none; background: var(--surface-2); }
.mini-art .art-emoji { font-size: 20px; }
.mini-art .photo { width: 100%; height: 100%; object-fit: cover; }
.mini-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mini-copy b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-copy small { font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-arrow svg { width: 15px; height: 15px; color: var(--ink-3); }

.profile-side { display: flex; flex-direction: column; gap: 14px; }
.settings-card { padding: 17px 16px; }
.settings-card .panel-head { margin-bottom: 12px; }
.settings-card .field { margin-bottom: 10px; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.setting-row b { display: block; font-size: 12.5px; }
.setting-row small { display: block; margin-top: 1px; font-size: 10.5px; color: var(--ink-3); }
.settings-card .form-note { margin-top: 12px; }
.profile-tip { padding: 15px 17px; background: var(--surface-2); border-style: dashed; box-shadow: none; }
.profile-tip p:last-child { margin-top: 4px; font-size: 11px; color: var(--ink-2); line-height: 1.5; }

/* Schalter */
.switch { position: relative; display: inline-flex; width: 46px; height: 27px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background .2s ease;
  pointer-events: none;
}
.switch-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: transform .2s ease;
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track i { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--ring); outline-offset: 2px; }

/* ------------------------------------------------------------- Dialoge */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(6, 18, 13, .52);
  backdrop-filter: blur(5px);
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .2s ease, transform .24s cubic-bezier(.2, .9, .3, 1);
}
.modal.is-open { opacity: 1; transform: none; }
.modal.small { max-width: 430px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 19px 19px 13px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.modal-head h2 { font-size: 19px; letter-spacing: -.025em; line-height: 1.2; }
.modal-head p { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }
.modal-body { padding: 20px 24px 22px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px 19px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  flex: none;
}
.modal-text { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }
.modal-text.small { font-size: 11px; color: var(--ink-3); margin-top: 10px; }
.modal .check-list { margin-bottom: 4px; }
.modal .check-list li { font-size: 11.5px; }

.filter-form .field:last-of-type { margin-bottom: 12px; }
.filter-checks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
}
.filter-actions .btn { flex: 1 1 auto; }

.menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  text-align: left;
  transition: background .16s ease;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 19px; height: 19px; color: var(--ink-3); margin-top: 2px; }
.menu-item b { display: block; font-size: 12.5px; }
.menu-item small { display: block; margin-top: 1px; font-size: 10.5px; color: var(--ink-3); }
.menu-ico { width: 19px; text-align: center; font-size: 16px; line-height: 1.3; }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }

.success-art {
  font-size: 48px;
  line-height: 1;
  text-align: center;
  margin: 0 0 12px;
  animation: successPop .5s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes successPop { 0% { transform: scale(.5) rotate(-10deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.success-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.success-thumb { position: relative; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; flex: none; }
.success-thumb .art-emoji { font-size: 22px; }
.success-thumb .photo { width: 100%; height: 100%; object-fit: cover; }
.success-preview > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.success-preview b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.success-preview span { font-size: 10.5px; color: var(--ink-3); }

.about-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.about-hero b { font-size: 17px; letter-spacing: -.02em; }
.about-hero p { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.modal-safety { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.modal-safety .safety-item { padding: 11px; }
.modal-safety .safety-item > span { font-size: 18px; }
.modal-safety .safety-item h3 { font-size: 11.5px; }
.modal-safety .safety-item p { font-size: 10.5px; }

/* -------------------------------------------------------------- Toasts */

.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 160;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(92vw, 440px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast { width: fit-content; max-width: 100%; }
body[data-route="auction"] .toast-root { bottom: calc(92px + env(safe-area-inset-bottom)); }
body[data-route="chat"] .toast-root { bottom: calc(14px + env(safe-area-inset-bottom)); }
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px) scale(.98);
  transition: opacity .2s ease, transform .24s cubic-bezier(.2, .9, .3, 1);
}
.toast.show { opacity: 1; transform: none; }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: #6fe3bd; flex: none; }
.toast.error .toast-dot { background: #ff8a80; }
.toast.info .toast-dot { background: #9fd8ff; }

/* ---------------------------------------------------------- Responsive */

@media (min-width: 560px) {
  .price-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-identity .profile-edit { margin-left: 0; }
  .modal-foot .btn { flex: none; }
}

@media (max-width: 899px) {
  .chat-page .messages-layout { height: auto; min-height: 0; max-height: calc(100dvh - 142px); }
  .chat-page .thread-panel { display: none; }
  .chat-page .chat-panel { flex: 1; }
  .chat-back { display: grid; }
  .messages-page .chat-placeholder { display: none; }
  .messages-page .messages-layout { height: auto; min-height: 0; max-height: calc(100dvh - 260px); }
  .messages-page .thread-panel { flex: 1; }
  body[data-route="chat"] #view { padding: 10px 10px 0; }
  .chat-page .chat-panel { border-radius: 18px 18px 0 0; }
  .chat-composer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
}

@media (min-width: 900px) {
  .messages-layout {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 14px;
    /* FIX: natuerliche Hoehe ohne Ueberlappung */
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 200px);
  }
  .messages-page .messages-layout { height: auto; max-height: calc(100dvh - 200px); }
  .chat-page .messages-layout { height: auto; min-height: 0; max-height: calc(100dvh - 130px); }
  .thread-panel { height: 100%; }
  .chat-panel { height: 100%; }
  .compose-layout { grid-template-columns: minmax(0, 1fr) 318px; align-items: start; gap: 24px; }
  .compose-aside { display: block; }
  .profile-layout { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
  .profile-side { position: sticky; top: calc(var(--appbar-h) + 18px); z-index: 1; background: var(--bg); padding-bottom: 16px; }
  .profile-hero { padding: 28px 30px; }
  .profile-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 620px; }
  .profile-stats div { padding: 12px 16px; }
  .my-ads, .favorites-panel { padding: 20px; }
  .settings-card { padding: 20px; }
  .listing-form { padding: 22px 24px; }
  .toast-root { bottom: 24px; }
  body[data-route="auction"] .toast-root, body[data-route="chat"] .toast-root { bottom: 24px; }
}

@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.small, .modal.sheet {
    max-width: none;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }
  .modal { transform: translateY(30px); }
  .modal.is-open { transform: none; }
  .modal-body { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .modal-foot { padding-bottom: calc(15px + env(safe-area-inset-bottom)); }
  .modal-safety { grid-template-columns: 1fr; }
  .profile-identity .profile-edit { margin-left: 0; width: 100%; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-stats div:nth-child(3), .profile-stats div:nth-child(4) { background: rgba(255, 255, 255, .085); }
  .inline-empty .btn { margin-left: 0; }
  .messages-page .messages-layout { height: calc(100dvh - 292px); }
}

@media (max-width: 420px) {
  .compose-actions .btn { width: 100%; }
  .filter-actions .btn { flex: 1 1 100%; }
  .chat-quick .chip { font-size: 10.5px; }
  .mini-copy small { font-size: 9.5px; }
  .ad-copy > span { font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------- Profil-Hero: Titelbild frei */
.profile-hero { display: flex; align-items: flex-end; min-height: 340px; padding: 0 22px 18px; }
@media (max-width: 1024px) { .profile-hero { min-height: 280px; } }
@media (max-width: 559px) { .profile-hero { min-height: 220px; } }
.profile-hero .profile-identity { z-index: 3; padding-right: 64px; }
.profile-hero-shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5,38,29,.38) 0%, rgba(5,38,29,.05) 42%, rgba(5,38,29,.82) 100%);
}

/* Einstellungs-Menü oben rechts (nur eigenes Profil) */
.profile-settings { position: absolute; top: 14px; right: 14px; z-index: 6; }
.profile-settings-btn {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(6, 46, 36, .72); color: #eafff6;
  border: 1.5px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
  transition: transform .15s ease, background .15s ease;
}
.profile-settings-btn svg { width: 22px; height: 22px; }
.profile-settings-btn:hover { background: rgba(6, 46, 36, .9); transform: scale(1.06); }
.profile-settings-btn:active { transform: scale(.94); }
.profile-settings-menu {
  position: absolute; top: 50px; right: 0;
  min-width: 230px; max-width: calc(100vw - 28px);
  background: #0b5341; border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px; padding: 4px;
  box-shadow: 0 18px 40px -14px rgba(0,0,0,.55);
  display: flex; flex-direction: column; gap: 1px;
  z-index: 90;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.profile-settings-menu.open-up { top: auto; bottom: 50px; }
.profile-settings-menu[hidden] { display: none !important; }
.profile-settings-menu button,
.profile-settings-menu a {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 10px;
  color: #eafff6; font-size: 13.5px; font-weight: 600;
  padding: 10px 12px; cursor: pointer; text-decoration: none;
  transition: background .12s ease;
}
.profile-settings-menu button:hover, .profile-settings-menu button:focus-visible,
.profile-settings-menu a:hover, .profile-settings-menu a:focus-visible { background: rgba(255,255,255,.12); }
.profile-settings-menu button.danger { color: #ffd9d9; }
.profile-settings-menu button.danger:hover { background: rgba(239, 68, 68, .22); }
.profile-settings-menu .pm-ico { display: flex; width: 18px; height: 18px; flex: none; }
.profile-settings-menu .pm-ico svg { width: 17px; height: 17px; }

/* Statistik-Karten UNTER dem Titelbild */
.profile-stats-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; margin-top: 12px;
}
.stat-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2, #f1f5f9);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px; padding: 12px 14px;
  min-width: 0;
}
.stat-ico {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  font-size: 17px;
}
.stat-ico svg { width: 18px; height: 18px; }
.stat-ico.live { background: #d1fae5; color: #065f46; }
.stat-ico.watch { background: #ffe4e6; color: #be123c; }
.stat-ico.bid { background: #dbeafe; color: #1d4ed8; }
.stat-ico.win { background: #fef3c7; color: #92400e; }
.stat-copy { display: flex; flex-direction: column; min-width: 0; }
.stat-copy b { font-size: 18px; letter-spacing: -.02em; line-height: 1.1; }
.stat-copy span { font-size: 10.5px; color: var(--ink-3, #64748b); margin-top: 2px; }

@media (max-width: 899px) {
  .profile-hero { min-height: 210px; padding: 0 16px 14px; }
  .profile-settings { top: 10px; right: 10px; }
  .profile-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .profile-hero .profile-identity { padding-right: 56px; gap: 10px; }
  .profile-public-actions { width: 100%; flex-wrap: wrap; margin-top: 6px; }
  .profile-public-actions .btn { flex: 1 1 30%; min-width: 0; font-size: 12px; padding: 8px 10px; }
}
