.message-public{min-height:70vh;padding:72px 24px;background:#f3f3f3}.message-card,.message-thread-shell{width:min(940px,100%);margin:0 auto;padding:clamp(28px,5vw,64px);background:#fff;border:1px solid #d8d8d8}.message-card h1,.message-thread-head h1{margin:8px 0 22px;font-size:clamp(2.6rem,7vw,5.6rem);font-weight:400;line-height:.92;letter-spacing:-.06em}.message-card>p{max-width:720px;color:#5e5e5e}.message-form{display:grid;gap:22px;margin-top:34px}.message-form label,.message-reply label{display:grid;gap:8px;font-size:.78rem;font-weight:700}.message-form input,.message-form textarea,.message-reply textarea{width:100%;padding:15px;border:1px solid #aaa;border-radius:0;background:#fff;color:#111;font:inherit;resize:vertical}.message-form input:focus,.message-form textarea:focus,.message-reply textarea:focus{outline:2px solid #a5208e;outline-offset:2px}.message-form small{color:#777;font-weight:400}.message-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.message-consent{display:flex!important;align-items:flex-start;gap:10px!important;font-weight:400!important}.message-consent input{width:auto;margin-top:4px}.message-consent a{color:inherit}.message-identity{padding:18px;border-left:4px solid #a5208e;background:#f7edf5}.message-identity span,.message-identity small{display:block}.message-identity strong{display:block;margin:4px 0}.message-alert{margin:22px 0;padding:15px 18px;border:1px solid}.message-alert.success{color:#176d37;background:#e5f7ea;border-color:#a9dcb7}.message-alert.error{color:#8d1212;background:#ffeded;border-color:#e7b3b3}.message-alert ul{margin:0;padding-left:20px}.message-login-note{margin:24px 0 0!important;font-size:.85rem}.message-thread-shell{width:min(1100px,100%)}.message-thread-head,.inbox-thread-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding-bottom:26px;border-bottom:1px solid #ccc}.message-thread-head h1{font-size:clamp(2.2rem,5vw,4.5rem);margin-bottom:10px}.message-thread-head p,.inbox-thread-head p{margin:0;color:#666}.message-privacy-note{margin:24px 0;padding:16px 18px;border-left:4px solid #a5208e;background:#f7edf5;color:#555}.message-privacy-note strong{color:#111}.message-thread{display:flex;flex-direction:column;gap:16px;padding:28px 0}.message-bubble{width:min(76%,720px);padding:18px 20px;border:1px solid #ccc;background:#fff}.message-bubble.own{align-self:flex-end;color:#fff;background:#111;border-color:#111}.message-bubble.other{align-self:flex-start}.message-bubble header{display:flex;justify-content:space-between;gap:20px;margin-bottom:10px;font-size:.72rem}.message-bubble time{color:#777}.message-bubble.own time{color:#bbb}.message-bubble p{margin:0;overflow-wrap:anywhere}.message-reply{display:grid;gap:14px;padding-top:24px;border-top:1px solid #ccc}.message-reply .button,.message-reply .pill-button{justify-self:end}.inbox-layout{display:grid;grid-template-columns:minmax(260px,340px) minmax(0,1fr);min-height:620px;border:1px solid #d8d8d8;background:#fff}.inbox-list{border-right:1px solid #d8d8d8;background:#f7f7f7}.inbox-item{display:grid;gap:5px;padding:20px;border-bottom:1px solid #d8d8d8;color:#111;text-decoration:none}.inbox-item:hover,.inbox-item.active{background:#111;color:#fff}.inbox-item span{color:#a5208e;font-size:.64rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.inbox-item small{display:-webkit-box;overflow:hidden;color:#777;-webkit-line-clamp:2;-webkit-box-orient:vertical}.inbox-item:hover small,.inbox-item.active small{color:#bbb}.inbox-item time{font-size:.68rem;color:#888}.inbox-thread{min-width:0;padding:28px}.inbox-thread-head h2{margin:4px 0;font-size:clamp(1.6rem,3vw,2.5rem);font-weight:400}.inbox-thread-head span{color:#a5208e;font-size:.7rem;font-weight:700}.customer-body .message-reply textarea,.admin-body .message-reply textarea{background:#fff}.empty-panel{padding:42px;background:#fff;border:1px solid #d8d8d8}.empty-panel h2{margin-top:0}.website-field{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;overflow:hidden!important}
@media(max-width:850px){.admin-header{gap:16px}.admin-header nav{flex-wrap:wrap;justify-content:flex-end;gap:8px 14px}.message-public{padding:30px 14px}.message-card,.message-thread-shell{padding:26px 20px}.message-form-grid,.inbox-layout{grid-template-columns:1fr}.inbox-layout{min-height:0}.inbox-list{max-height:330px;overflow:auto;border-right:0;border-bottom:1px solid #d8d8d8}.inbox-thread{padding:20px}.message-thread-head,.inbox-thread-head{flex-direction:column}.message-bubble{width:90%}}
@media(max-width:520px){.message-bubble{width:96%}.message-bubble header{flex-direction:column;gap:2px}.message-reply .button,.message-reply .pill-button{width:100%;justify-self:stretch}}

/* Kompakte Nachrichten: Zeitangabe ohne Absenderbezeichnung */
.message-bubble {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 14px;
  padding: 13px 17px;
}

.message-bubble header {
  display: block;
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  line-height: 1;
}

.message-bubble time {
  display: block;
  text-align: right;
  white-space: nowrap;
}

.message-bubble p {
  grid-column: 1;
  grid-row: 1;
}
.message-alert.pending{color:#795d00;background:#fff4c9;border-color:#dec879}.message-alert.pending p{margin:6px 0 14px}.inbox-status{justify-self:start;padding:3px 7px;border-radius:999px;font-size:.62rem;font-style:normal}.inbox-status.pending{color:#795d00;background:#fff4c9}.inbox-status.open{color:#176d37;background:#e5f7ea}.inbox-item:hover .inbox-status,.inbox-item.active .inbox-status{color:#111;background:#fff}
.pending-contact{display:grid;gap:3px;margin:14px 0 18px}.pending-contact dt{font-size:.68rem;font-weight:700;text-transform:uppercase}.pending-contact dd{margin:0 0 8px}.pending-contact input{width:100%;padding:9px;border:1px solid #c8ad50;background:#fff;font:inherit;font-size:.75rem}
.inquiry-sent-confirmation{padding:24px 26px;font-size:1rem}.inquiry-sent-confirmation>strong{display:block;margin-bottom:10px;font-size:1.2rem}.inquiry-sent-confirmation p{margin:8px 0}.inquiry-sent-confirmation p:last-child{margin-bottom:0}
.site-header + .message-public{padding-top:calc(var(--public-header-height,104px) + 72px)}
@media(max-width:850px){.site-header + .message-public{padding-top:calc(var(--public-header-height,104px) + 30px)}}

/* Lange Unterhaltungen scrollen innerhalb des Verlaufs. Dadurch bleiben
   Gesprächskopf und Antwortfeld stehen und die neueste Nachricht ist sichtbar. */
.message-thread-shell .message-thread {
  max-height: 52vh;
  min-height: 180px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.inbox-thread {
  display: flex;
  max-height: 74vh;
  flex-direction: column;
  overflow: hidden;
}

.inbox-thread .message-thread {
  flex: 1 1 auto;
  min-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.inbox-thread .message-reply {
  flex: 0 0 auto;
  background: #fff;
}

@media(max-width:850px){
  .message-thread-shell .message-thread{max-height:50vh}
  .inbox-thread{max-height:none}
  .inbox-thread .message-thread{max-height:54vh;min-height:180px}
}

/* Kompakte Chatansicht: Verlauf und Antwortfeld bleiben gemeinsam sichtbar. */
.site-header + .message-public {
  padding-top: calc(var(--public-header-height,104px) + 32px);
  padding-bottom: 32px;
}

.message-thread-shell {
  padding: 26px clamp(24px, 3.2vw, 42px) 22px;
}

.message-thread-head {
  align-items: center;
  padding-bottom: 14px;
}

.message-thread-head .overline {
  margin-bottom: 7px;
  font-size: .62rem;
}

.message-thread-head h1 {
  margin: 3px 0 6px;
  font-size: clamp(2rem, 3.4vw, 3.35rem);
  line-height: .96;
}

.message-thread-head p {
  font-size: .76rem;
  line-height: 1.25;
}

.message-thread-head .pill-button {
  min-height: 38px;
  padding-inline: 18px;
  font-size: .64rem;
}

.message-privacy-note {
  margin: 12px 0;
  padding: 9px 12px;
  font-size: .74rem;
  line-height: 1.3;
}

.message-thread,
.message-thread-shell .message-thread {
  gap: 6px;
  padding: 10px 0;
}

.message-thread-shell .message-thread {
  min-height: 150px;
  max-height: clamp(190px, 29vh, 280px);
}

.message-bubble {
  column-gap: 10px;
  padding: 7px 10px;
  border-radius: 5px;
  font-size: .78rem;
  line-height: 1.25;
}

.message-bubble header {
  padding-top: .15em;
  font-size: .58rem;
  line-height: 1.2;
}

.message-reply {
  gap: 8px;
  padding-top: 12px;
}

.message-thread-shell .message-reply {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 10px;
}

.message-thread-shell .message-reply label {
  gap: 4px;
  font-size: .7rem;
}

.message-thread-shell .message-reply textarea {
  min-height: 62px;
  max-height: 110px;
  padding: 9px 11px;
  font-size: .8rem;
  line-height: 1.3;
}

.message-thread-shell .message-reply .pill-button {
  min-height: 40px;
  padding-inline: 18px;
  font-size: .64rem;
}

@media(max-width:850px) {
  .site-header + .message-public {
    padding-top: calc(var(--public-header-height,104px) + 18px);
  }

  .message-thread-shell .message-thread {
    max-height: clamp(190px, 34vh, 300px);
  }
}

@media(max-width:600px) {
  .message-thread-shell {
    padding: 20px 14px 16px;
  }

  .message-thread-head {
    gap: 12px;
  }

  .message-thread-shell .message-reply {
    grid-template-columns: 1fr;
  }

  .message-thread-shell .message-reply .pill-button {
    width: 100%;
  }
}

/* Eigene Nachrichten: helle CCS-Lilafläche statt schwarzer Sprechblase. */
.message-bubble.own {
  color: #111;
  border-color: #e5d7e2;
  background: #f5edf4;
}

.message-bubble.own time {
  color: #666;
}

/* Kopf, Datenschutzhinweis und Antwortfeld dürfen im flexiblen Chat nicht
   zusammengeschoben werden. Nur der Nachrichtenverlauf wird scrollbar. */
.inbox-thread > .inbox-thread-head,
.inbox-thread > .message-privacy-note,
.inbox-thread > .message-reply {
  flex: 0 0 auto;
}

.inbox-thread > .message-privacy-note {
  height: auto;
  max-height: none;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}

.inbox-thread > .message-thread {
  flex: 1 1 0;
  min-height: 120px;
}

.inbox-thread-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.inbox-thread-actions form {
  margin: 0;
}

.conversation-alias {
  margin-top: 7px !important;
  overflow-wrap: anywhere;
  font-size: .72rem;
}

.mobile-conversation-back {
  display: none;
}

@media(max-width:850px) {
  .inbox-layout.mobile-thread-open .inbox-list {
    display: none;
  }

  .inbox-thread {
    scroll-margin-top: 12px;
  }

  .mobile-conversation-back {
    display: inline-flex;
    width: max-content;
    margin-bottom: 16px;
    color: #555;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
    text-transform: uppercase;
  }

  .inbox-thread-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
