/* ============================================================
   AUKTIONSHAUS24 – FREUNDE & MESSENGER (Steam-Liste + ICQ-Chat)
   Design: grün-gelbes System (var(--brand), var(--amber)),
   leuchtende Statuspunkte, dezente Animationen.
   Alle Animationen respektieren prefers-reduced-motion.
   ============================================================ */

/* ------------------------------------------------ Freunde-Seite */
.friends-page { display: grid; gap: 16px; }

.fr-panel { padding: 16px; }
.fr-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.fr-panel-head h2 { font-size: 17px; margin: 0; }
.fr-legend { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-3); }
.fr-legend .online-dot { margin: 0 2px 0 8px; }

.fr-search input {
  width: 100%; height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 15px;
}
.fr-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }

.fr-results { margin-top: 10px; }
.fr-results:empty { display: none; }

.fr-list { display: grid; gap: 8px; }
.fr-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fr-row:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.fr-row.is-muted { opacity: .62; }

.fr-avatar {
  position: relative; display: grid; place-items: center;
  width: 42px; height: 42px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--amber)));
  color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 2px 8px -2px rgba(14, 122, 95, .5);
}
.fr-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.fr-avatar.sm { width: 34px; height: 34px; font-size: 14px; }

.fr-copy { min-width: 0; flex: 1; display: grid; gap: 2px; }
.fr-name {
  font-weight: 700; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
}
.fr-name:hover { color: var(--brand-text); }
.fr-sub { font-size: 12px; color: var(--ink-3); }

.fr-actions { display: flex; gap: 6px; flex: none; }

.fr-unread {
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
  animation: frBadgePulse 2.4s ease-in-out infinite;
}

.fr-empty { text-align: center; padding: 22px 10px; color: var(--ink-3); }
.fr-empty span { font-size: 34px; display: block; margin-bottom: 6px; }
.fr-empty-sm { font-size: 12px; color: var(--ink-3); text-align: center; padding: 12px 6px; }
.fr-empty-sm a { color: var(--brand-text); font-weight: 700; }

.fr-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------ Einstellungen */
.fr-set-grid { display: grid; gap: 18px; }
.fr-set-grid h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 0 0 8px; }
@media (min-width: 720px) { .fr-set-grid { grid-template-columns: 1fr 1fr; } }

.fr-switch-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 4px; cursor: pointer; user-select: none;
}
.fr-switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.fr-switch {
  position: relative; flex: none;
  width: 44px; height: 26px;
  border-radius: 999px;
  background: var(--line);
  transition: background .18s ease;
}
.fr-switch i {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .18s ease;
}
.fr-switch-row input:checked + .fr-switch { background: var(--brand); }
.fr-switch-row input:checked + .fr-switch i { transform: translateX(18px); }
.fr-switch-row input:focus-visible + .fr-switch { box-shadow: 0 0 0 4px var(--ring); }
.fr-switch-copy { display: grid; gap: 1px; }
.fr-switch-copy b { font-size: 14px; }
.fr-switch-copy small { font-size: 11.5px; color: var(--ink-3); }

input[type="range"][data-fr-volume] {
  width: 100%; accent-color: var(--brand); margin: 6px 0 2px;
}

.fr-themes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fr-themes .chip { cursor: pointer; }
.fr-themes .chip.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.fr-themes .chip[data-fr-theme] span { margin-left: 6px; opacity: .8; }

/* ------------------------------------------------ Freunde-Auktionen */
.fr-auction-grid { display: grid; gap: 8px; }
@media (min-width: 560px) { .fr-auction-grid { grid-template-columns: 1fr 1fr; } }
.fr-auction-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); text-decoration: none; color: var(--ink);
}
.fr-auction-card:hover { border-color: var(--brand); }
.fr-auction-emoji { font-size: 22px; flex: none; }
.fr-auction-copy { display: grid; gap: 2px; min-width: 0; }
.fr-auction-copy b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-auction-copy small { color: var(--ink-3); }

/* ------------------------------------------------ Desktop-Seitenleiste (Steam-Style) */
.fr-rail {
  position: fixed; right: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 55;
  width: 44px; height: 88px;
  border: 1px solid var(--line); border-right: none;
  border-radius: 14px 0 0 14px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
  color: var(--brand-text); font-size: 20px;
  cursor: pointer;
  box-shadow: -4px 4px 16px -8px rgba(0,0,0,.25);
  display: grid; place-items: center;
  transition: width .18s ease;
}
.fr-rail:hover { width: 50px; }
.fr-rail .nav-badge { position: absolute; top: 6px; right: 6px; margin: 0; }

.fr-sidebar {
  position: fixed; top: calc(var(--appbar-h, 64px) + 10px); right: 10px;
  z-index: 55;
  width: 300px; max-height: calc(100vh - var(--appbar-h, 64px) - 90px);
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 44px -18px rgba(0,0,0,.35);
  overflow: hidden;
}
.fr-sidebar-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.fr-sidebar-head b { font-size: 15px; }
.fr-count {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  color: var(--brand-text);
  font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
}
.fr-sidebar-requests { padding: 10px 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--amber) 7%, transparent); }
.fr-sidebar-requests small { font-weight: 700; color: var(--ink-2); }
.fr-mini-more { display: block; margin-top: 6px; font-size: 12px; color: var(--brand-text); font-weight: 700; text-decoration: none; }

.fr-sidebar-list { overflow-y: auto; padding: 8px 10px; display: grid; gap: 4px; }
.fr-mini-row {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 12px;
}
.fr-mini-row:hover { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.fr-mini-copy {
  flex: 1; min-width: 0; font-size: 13.5px; font-weight: 650;
  display: inline-flex; align-items: center; gap: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fr-sidebar-foot {
  display: block; padding: 11px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--brand-text);
  text-decoration: none; background: color-mix(in srgb, var(--brand) 5%, transparent);
}

/* ------------------------------------------------ Schwebende Chatfenster (Desktop) */
#friends-chat-root {
  position: fixed; right: 14px; bottom: 14px;
  z-index: 55;
  display: flex; align-items: flex-end; gap: 12px;
  pointer-events: none;
}
.fr-win {
  pointer-events: auto;
  width: 330px; max-width: calc(100vw - 28px);
  height: 450px; max-height: calc(100vh - 130px);
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 22px 54px -20px rgba(0,0,0,.4);
  overflow: hidden;
  animation: frWinIn .18s ease;
}
.fr-win.flash { animation: frFlash .4s ease; }
@keyframes frWinIn { from { transform: translateY(14px); opacity: 0; } }
@keyframes frFlash { 50% { box-shadow: 0 0 0 3px var(--ring), 0 22px 54px -20px rgba(0,0,0,.4); } }

/* Chat-Grundlayout (Fenster UND Mobile-Seite) */
.fr-chat { display: flex; flex-direction: column; min-height: 0; }
.fr-chat-page {
  height: calc(100vh - var(--appbar-h, 64px) - 24px);
  display: flex; flex-direction: column;
}

.fr-chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, var(--surface)), var(--surface));
}
.fr-chat-title { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fr-chat-title small { font-size: 11px; color: var(--ink-3); font-weight: 650; }
.fr-chat-tools { display: flex; gap: 2px; flex: none; }
.fr-chat-tools .icon-btn { font-size: 15px; }

.fr-search-inline { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.fr-search-inline input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 14px;
}
.fr-search-inline input:focus { outline: none; border-color: var(--brand); }

.fr-flow {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  scroll-behavior: smooth;
}
.fr-flow.searching .fr-day { position: sticky; top: -12px; }

.fr-day { text-align: center; margin: 6px 0 2px; }
.fr-day span {
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  background: var(--bg); padding: 3px 10px; border-radius: 999px;
}

.fr-msg { display: flex; flex-direction: column; max-width: 78%; }
.fr-msg.mine { align-self: flex-end; align-items: flex-end; }
.fr-msg.them { align-self: flex-start; align-items: flex-start; }
.fr-bubble {
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 14.5px; line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}
.fr-msg.mine .fr-bubble {
  background: var(--brand); color: #fff;
  border-bottom-right-radius: 5px;
}
.fr-msg.them .fr-bubble {
  background: color-mix(in srgb, var(--brand) 8%, var(--bg));
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line));
  border-bottom-left-radius: 5px;
}
.fr-meta { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; padding: 0 4px; }
.fr-meta time { font-size: 10px; color: var(--ink-3); }
.fr-ticks { font-size: 11px; color: var(--ink-3); letter-spacing: -2px; }
.fr-ticks.read { color: #3b9de0; }
.fr-flag {
  border: none; background: none; cursor: pointer;
  font-size: 11px; color: var(--ink-3); padding: 0 2px;
  opacity: 0; transition: opacity .15s ease;
}
.fr-msg:hover .fr-flag { opacity: 1; }
.fr-flag:hover { color: var(--danger); }

/* Bilder im Chat */
.fr-img { border: none; background: none; padding: 0; cursor: zoom-in; display: block; }
.fr-img img {
  display: block; max-width: 230px; max-height: 200px;
  border-radius: 12px; object-fit: cover;
}
.fr-img-big { display: block; max-width: 100%; border-radius: 14px; }

/* "schreibt gerade"-Blase */
.fr-typing-row .fr-bubble { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.fr-typing-row .fr-bubble i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-3);
  animation: frTyping 1.2s ease-in-out infinite;
}
.fr-typing-row .fr-bubble i:nth-child(2) { animation-delay: .18s; }
.fr-typing-row .fr-bubble i:nth-child(3) { animation-delay: .36s; }
@keyframes frTyping { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.fr-starter { text-align: center; margin: auto; padding: 20px 10px; color: var(--ink-3); }
.fr-starter span { font-size: 32px; display: block; margin-bottom: 6px; }
.fr-starter h3 { margin: 0 0 4px; color: var(--ink); }

/* Emoji-Leiste + Composer */
.fr-emoji {
  display: flex; gap: 2px; padding: 4px 10px;
  border-top: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.fr-emoji::-webkit-scrollbar { display: none; }
.fr-emoji-btn {
  border: none; background: none; cursor: pointer;
  font-size: 19px; padding: 4px 6px; border-radius: 8px;
  transition: transform .1s ease;
}
.fr-emoji-btn:hover { transform: scale(1.2); }

.fr-composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.fr-composer textarea {
  flex: 1; resize: none;
  max-height: 110px;
  padding: 10px 13px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 14.5px; line-height: 1.4;
}
.fr-composer textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.fr-attach {
  border: none; background: none; cursor: pointer;
  font-size: 21px; padding: 8px;
  border-radius: 10px;
}
.fr-attach:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.fr-send {
  border: none; cursor: pointer;
  width: 42px; height: 42px; flex: none;
  border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 17px;
  box-shadow: 0 6px 16px -6px rgba(14, 122, 95, .6);
  transition: transform .12s ease;
}
.fr-send:hover { transform: scale(1.06); }
.fr-send:active { transform: scale(.94); }

/* ------------------------------------------------ Menü & Teilen */
.fr-menu { display: grid; gap: 6px; }
.fr-menu .menu-item.danger { color: var(--danger); }

.fr-share h3 { font-size: 15px; margin: 0 0 10px; }
.fr-share { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.fr-share-grid { display: grid; gap: 8px; }
@media (min-width: 480px) { .fr-share-grid { grid-template-columns: 1fr 1fr; } }
.fr-share-target {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer; font: inherit;
}
.fr-share-target:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.fr-share-target span { font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }

.fr-teaser { display: grid; gap: 8px; }

/* ------------------------------------------------ Badge-Leuchten */
.nav-badge.pulse, .tab-badge.pulse { animation: frBadgePulse 2.4s ease-in-out infinite; }
@keyframes frBadgePulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 0 rgba(255, 107, 74, .55); }
  50% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 6px rgba(255, 107, 74, 0); }
}

/* ------------------------------------------------ Mobile: eigener Bereich */
.tabbar { grid-template-columns: repeat(5, 1fr); }
body[data-route="dm"] .tabbar { display: none; }
.dm-page { padding-bottom: 0; }

@media (max-width: 899px) {
  #friends-root, #friends-chat-root { display: none; } /* Mobile: Vollbild-Chat per Route */
  .fr-chat-page { height: calc(100vh - var(--appbar-h, 64px) - 16px); }
}

/* ------------------------------------------------ Reduzierte Bewegung */
@media (prefers-reduced-motion: reduce) {
  .fr-unread, .nav-badge.pulse, .tab-badge.pulse { animation: none; }
  .fr-typing-row .fr-bubble i { animation: none; opacity: .7; }
  .fr-win, .fr-send, .fr-emoji-btn { animation: none; transition: none; }
  .fr-flow { scroll-behavior: auto; }
}

/* ============================================================
   MULTIMEDIA-MESSENGER: Uploads, Medien, Antworten, Sprache
   ============================================================ */

/* Composer: Mikrofon-Button */
.fr-mic {
  border: none; background: none; cursor: pointer;
  font-size: 20px; padding: 8px; border-radius: 10px;
  flex: none;
}
.fr-mic:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.fr-mic.recording { background: var(--danger); border-radius: 50%; animation: frRecPulse 1.4s ease-in-out infinite; }

/* Antwort-Balken über dem Composer */
.fr-replying {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}
.fr-replying-copy { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fr-replying-copy b { font-size: 11px; color: var(--brand-text); }
.fr-replying-copy span {
  font-size: 12.5px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Aufnahme-Leiste */
.fr-recording {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
.fr-recording small { flex: 1; color: var(--ink-3); font-size: 11px; }
.fr-rec-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--danger); flex: none;
  animation: frRecPulse 1.1s ease-in-out infinite;
}
.fr-rec-time { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--danger); min-width: 44px; }
@keyframes frRecPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.85); } }

/* Sprach-Vorschau nach der Aufnahme */
.fr-voice-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}
.fr-voice-preview-copy { flex: 1; display: grid; gap: 1px; }
.fr-voice-preview-copy b { font-size: 12.5px; }
.fr-voice-preview-copy small { font-size: 11px; color: var(--ink-3); }

/* Upload-Fortschritt in der Blase */
.fr-upload { display: grid; gap: 7px; min-width: 200px; }
.fr-upload > span { font-size: 12.5px; font-weight: 650; }
.fr-upload-bar {
  height: 8px; border-radius: 999px;
  background: color-mix(in srgb, #fff 25%, var(--brand));
  overflow: hidden;
}
.fr-msg.them .fr-upload-bar { background: var(--line); }
.fr-upload-bar i {
  display: block; height: 100%; width: 0;
  background: #fff; border-radius: 999px;
  transition: width .25s ease;
}
.fr-msg.them .fr-upload-bar i { background: var(--brand); }
.fr-upload-bar.failed i { background: var(--danger); }
.fr-upload-actions { display: flex; gap: 6px; }

/* Nachrichten-Aktionen (Antworten/…) – erscheinen bei Hover/Touch */
.fr-msg { position: relative; }
.fr-msg-actions {
  position: absolute; top: -4px; z-index: 2;
  right: -4px;
  display: none; gap: 2px;
}
.fr-msg.them .fr-msg-actions { right: auto; left: -4px; }
.fr-msg:hover .fr-msg-actions, .fr-msg:focus-within .fr-msg-actions { display: flex; }
.fr-act {
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink-2);
  font-size: 12px; line-height: 1; padding: 4px 6px; cursor: pointer;
  box-shadow: 0 2px 8px -2px rgba(0,0,0,.25);
}
.fr-act:hover { border-color: var(--brand); color: var(--brand-text); }
@media (hover: none) {
  .fr-msg-actions { display: flex; opacity: .85; } /* Touch: immer sichtbar */
}

/* Antwort-Zitat in der Blase */
.fr-quote {
  display: block;
  border-left: 3px solid var(--brand);
  background: color-mix(in srgb, #fff 18%, transparent);
  border-radius: 6px;
  padding: 4px 8px; margin-bottom: 5px;
  font-size: 12px; color: #fff;
  max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fr-msg.them .fr-quote {
  border-left-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand) 7%, transparent);
  color: var(--ink-2);
}
.fr-quote b { font-size: 10.5px; opacity: .85; margin-right: 4px; }

/* Weiterleitungs-Kennzeichnung */
.fr-fwd {
  display: block; font-size: 10.5px; font-weight: 700;
  color: color-mix(in srgb, #fff 75%, transparent);
  margin-bottom: 3px;
}
.fr-msg.them .fr-fwd { color: var(--ink-3); }

/* Gelöschte Nachricht */
.fr-msg.deleted .fr-bubble { opacity: .6; font-style: italic; }
.fr-deleted { font-size: 12.5px; color: var(--ink-3); }
.fr-msg.mine .fr-deleted { color: color-mix(in srgb, #fff 75%, transparent); }

/* Video in der Blase */
.fr-video { position: relative; display: block; }
.fr-video video {
  display: block; max-width: 260px; max-height: 320px;
  border-radius: 12px; background: #000;
}
.fr-video-dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
}
.fr-media-fallback { display: block; font-size: 11.5px; color: var(--danger); margin-top: 4px; }
.fr-media-error video, .fr-media-error img { display: none; }

/* Sprachnachricht-Player */
.fr-voice {
  display: flex; align-items: center; gap: 10px;
  min-width: 210px; padding: 2px 0;
}
.fr-voice-btn {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%; border: none; cursor: pointer;
  background: color-mix(in srgb, #fff 25%, var(--brand)); color: #fff;
  font-size: 14px;
  display: grid; place-items: center;
}
.fr-msg.them .fr-voice-btn { background: var(--brand); }
.fr-voice-track { flex: 1; display: grid; gap: 3px; }
.fr-voice-bar {
  height: 6px; border-radius: 999px; background: color-mix(in srgb, #fff 30%, var(--brand));
  cursor: pointer; position: relative;
}
.fr-msg.them .fr-voice-bar { background: var(--line); }
.fr-voice-fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  border-radius: 999px; background: #fff;
}
.fr-msg.them .fr-voice-fill { background: var(--brand); }
.fr-voice-times { display: flex; justify-content: space-between; font-size: 10px; color: #fff; font-variant-numeric: tabular-nums; }
.fr-msg.them .fr-voice-times { color: var(--ink-3); }

/* Dokument-Karte */
.fr-doc {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid color-mix(in srgb, #fff 30%, transparent);
  background: color-mix(in srgb, #fff 14%, transparent);
  border-radius: 12px; padding: 8px 10px;
  cursor: pointer; text-align: left; min-width: 200px;
  font: inherit; color: #fff;
}
.fr-msg.them .fr-doc {
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line));
  background: color-mix(in srgb, var(--brand) 5%, var(--bg));
  color: var(--ink);
}
.fr-doc-ico { font-size: 22px; flex: none; }
.fr-doc-copy { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fr-doc-copy b {
  font-size: 13px; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fr-doc-copy small { font-size: 10.5px; opacity: .8; }
.fr-doc-dl { flex: none; font-size: 16px; }

/* Auktions-Karte im Chat */
.fr-auction-card {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid color-mix(in srgb, #fff 30%, transparent);
  background: color-mix(in srgb, #fff 14%, transparent);
  border-radius: 12px; padding: 8px 10px;
  text-decoration: none; color: #fff;
  min-width: 220px; max-width: 280px;
}
.fr-msg.them .fr-auction-card {
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line));
  background: color-mix(in srgb, var(--brand) 5%, var(--bg));
  color: var(--ink);
}
.fr-auction-card:hover { filter: brightness(1.06); }
.fr-auction-emoji { font-size: 22px; flex: none; }
.fr-auction-copy { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fr-auction-copy b {
  font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fr-auction-copy small { font-size: 10.5px; opacity: .85; }
.fr-auction-cta {
  flex: none; font-size: 10px; font-weight: 800;
  background: #fff; color: var(--brand);
  border-radius: 999px; padding: 4px 8px; white-space: nowrap;
}
.fr-msg.them .fr-auction-cta { background: var(--brand); color: #fff; }
.fr-auction-card.loading { opacity: .7; }

/* Bildervorschau vor dem Senden */
.fr-preview-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.fr-preview-cell {
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 1; background: var(--bg);
}
.fr-preview-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Medien-Blasen ohne Text: enger */
.fr-msg.has-media .fr-bubble { padding: 4px; }
.fr-msg.has-media .fr-text { display: block; padding: 6px 9px 2px; }
.fr-msg.has-media:not(:has(.fr-text)) .fr-bubble { padding: 4px; }

/* Touch: Aktions-Buttons größer */
@media (max-width: 899px) {
  .fr-act { padding: 7px 10px; font-size: 14px; }
  .fr-video video { max-width: 220px; max-height: 280px; }
  .fr-upload { min-width: 170px; }
  .fr-msg-actions { top: -8px; }
}

/* Reduzierte Bewegung: Aufnahme-Animation aus */
@media (prefers-reduced-motion: reduce) {
  .fr-rec-dot, .fr-mic.recording { animation: none; }
  .fr-upload-bar i { transition: none; }
  .profile-id-copy .verified-pill, .phs-chip { animation: none; }
}

/* Freundschaft angenommen – aufpoppende Bestaetigung */
.fr-accepted-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 28, 22, .55); backdrop-filter: blur(3px);
  padding: 20px;
}
.fr-accepted-card {
  width: min(360px, 100%); text-align: center;
  background: var(--bg, #fff); color: var(--text, #143b32);
  border: 1px solid var(--line, #d7e5df); border-radius: 20px;
  padding: 28px 22px 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  animation: frAcceptedIn .28s cubic-bezier(.2, 1.4, .4, 1);
}
.fr-accepted-icon { font-size: 54px; line-height: 1; margin-bottom: 10px; }
.fr-accepted-card h3 { margin: 0 0 8px; font-size: 21px; }
.fr-accepted-card p { margin: 0 0 18px; opacity: .8; }
.fr-accepted-card .btn { min-width: 140px; }
@keyframes frAcceptedIn {
  from { opacity: 0; transform: translateY(14px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .fr-accepted-card { animation: none; }
}
