body #main .postfach { min-width: 0; }
body #main .v2-messages:has(.postfach) { overflow: visible; }
body #main .postfach-chips {
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  gap: 8px;
  margin: 0 -3px;
  padding: 0 3px 4px;
}
.postfach-chips::-webkit-scrollbar { display: none; }
body #main .postfach-chips .postfach-chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  box-shadow: none;
  color: var(--ink);
  background: var(--tonal, #EFEAE0);
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}
body #main .postfach-chip[aria-pressed="true"] {
  color: var(--surface);
  background: var(--ink);
}
body #main .postfach-chips .postfach-chip:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
body #main .postfach-chip-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  color: var(--ink);
  background: var(--gold);
  font-size: 11px;
  font-weight: 750;
}
body #main .postfach-chips .postfach-unread-filter { background: transparent; }
body #main .postfach-chips .postfach-unread-filter[aria-pressed="true"] {
  color: var(--gold-dark);
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1.5px var(--gold);
}
.postfach-filter-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.postfach-unread-filter[aria-pressed="true"] .postfach-filter-dot { background: var(--gold); }
body #main .postfach-group > h2 {
  margin: 16px 0 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .06em;
}
body #main .postfach-group .tonmio-inbox-list {
  gap: 10px;
  margin: 0;
  padding: 0;
}
body #main .postfach-entry {
  border: 1.5px solid transparent;
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--surface) 80%, var(--bg));
  box-shadow: 0 1px 4px rgb(23 20 17 / .07);
}
body #main .postfach-entry.is-unread {
  border-color: var(--gold);
  background: var(--surface);
  box-shadow: 0 4px 14px rgb(120 89 31 / .14);
}
body #main .postfach-entry .postfach-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 72px;
  padding: 11px 14px;
  color: var(--ink);
  text-align: start;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body #main .postfach-entry .postfach-row:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
body #main .postfach-entry[data-inbox-read-id] .postfach-row { padding-inline-end: 42px; }
body #main .postfach-entry.is-unread .postfach-row { padding-block: 14px; }
body #main .postfach-entry .inbox-row-menu { inset-block-start: 3px; inset-inline-end: 0; }
body #main .postfach-entry .inbox-row-menu > summary {
  width: 44px;
  height: 44px;
}
body #main .postfach-avatar { position: relative; }
body #main .postfach-avatar > .tonmio-inbox-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
}
body #main .postfach-avatar .tonmio-inbox-avatar :is(.tonmio-photo-frame,img) {
  width: 100%;
  height: 100%;
}
body #main .postfach-entry.is-notification .postfach-avatar > .tonmio-inbox-avatar {
  background: var(--gold-soft);
  color: var(--gold-dark);
}
.postfach-avatar .tonmio-nav-pin { width: 20px; height: 22px; }
.postfach-kind {
  position: absolute;
  inset-inline-end: -4px;
  inset-block-end: -4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--gold-dark);
  background: var(--gold-soft);
  box-shadow: 0 0 0 2px var(--surface);
  border-radius: 50%;
  --icon-size: 14px;
}
.postfach-kind svg { width: 14px; height: 14px; }
body #main .postfach-copy { min-width: 0; gap: 3px; }
body #main .postfach-copy .inbox-row-heading { align-items: start; }
body #main .postfach-copy .inbox-row-heading strong {
  font-size: 15px;
  font-weight: 520;
  color: var(--ink);
}
body #main .postfach-copy .inbox-row-meta { align-items: center; gap: 5px; }
body #main .postfach-copy .inbox-time {
  color: var(--text-secondary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
body #main .postfach-entry.is-unread .inbox-time {
  color: var(--gold-dark);
  font-weight: 750;
}
body #main .postfach-entry .inbox-unread {
  width: 10px;
  height: 10px;
  background: var(--gold);
}
body #main .postfach-entry.is-unread .inbox-row-heading strong { font-weight: 850; }
body #main .postfach-copy .inbox-event {
  flex-wrap: wrap;
  gap: 4px 7px;
}
body #main .postfach-copy .inbox-event-title {
  max-width: 100%;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}
body #main .tonmio-inbox-state[data-inbox-state] {
  padding: 3px 8px;
  border-radius: var(--r-pill);
  color: var(--ink);
  background: var(--tonal, #EFEAE0);
  font-size: 11px;
  font-weight: 750;
}
body #main .tonmio-inbox-state[data-inbox-state="action"] { background: var(--gold); }
body #main .tonmio-inbox-state[data-inbox-state="accepted"] {
  color: var(--ok, #2F5B3C);
  background: var(--ok-soft, #E2ECE2);
}
body #main .tonmio-inbox-state[data-inbox-state="declined"] {
  color: var(--busy, #7A3328);
  background: var(--busy-soft, #EFDCD7);
}
.postfach-past { color: var(--text-secondary); font-size: 11px; }
body #main .postfach-copy .postfach-direction {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  --icon-size: 18px;
}
body #main .postfach-copy .postfach-direction.is-received {
  color: var(--gold-dark);
  font-weight: 650;
}
body #main .postfach-copy .postfach-direction > svg {
  flex: none;
  width: 18px;
  height: 18px;
  transform: none;
}
body #main .postfach-copy .inbox-preview {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
}
body #main .postfach-entry.is-unread .inbox-preview { color: var(--ink); font-weight: 650; }
body #main .postfach-mine {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  gap: 2px;
  color: var(--text-secondary);
  font-weight: 650;
  --icon-size: 18px;
}
.postfach-mine > svg { width: 18px; height: 18px; }
body #main .postfach-entry.is-notification :is(.inbox-row-heading strong,.inbox-preview) {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  white-space: normal;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.postfach-notification-detail { white-space: pre-line; }
body #main .postfach-empty {
  margin: 20px 0 0;
  padding: 24px 16px;
  border-radius: var(--r-card);
  color: var(--text-secondary);
  background: var(--surface);
  text-align: center;
}
body #dialog .postfach-preferences {
  display: grid;
  gap: 4px;
}
body #dialog .postfach-preference {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  font-size: 14px;
}
body #dialog #dialog-content .postfach-preference input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 44px;
  min-width: 44px;
  height: 26px;
  min-height: 26px;
  padding: 3px;
  margin: 0;
  border: 0;
  border-radius: 20px;
  background: var(--tonal, #EFEAE0);
}
body #dialog .postfach-preference input::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
}
body #dialog #dialog-content .postfach-preference input:checked { background: var(--gold); }
body #dialog .postfach-preference input:checked::before { transform: translateX(18px); }
body #dialog .postfach-preference input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.postfach-more {
  align-self: flex-start;
}

[data-notification-preferences][hidden] {
  display: none !important;
}
