/* Liber Veda Mail — responsive shell (desktop sidebar / mobile drawer) */

:root {
  --hb-mail-sidebar-w: 300px;
  --hb-mail-sidebar-collapsed: 0px;
  --lv-mail-brand: #e8eef7;
  --lv-mail-accent: #7eb6d9;
  /* Zelfde teal-groen als het mail-appicoon */
  --hb-mail-status-bar: #38b8a0;
  --lv-mail-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --lv-mail-ui: 'Source Sans 3', 'Segoe UI', sans-serif;
}

/*
 * Alleen het bovenste systeemlaagje (tijd / batterij / wifi) is groen.
 * Geen extra balkbreedte — rest van de UI blijft ongewijzigd.
 * Android: theme-color / manifest theme_color (#38b8a0).
 */
html:has(body.hb-mail-body),
html:has(.hb-mail-layout) {
  background-color: var(--hb-mail-status-bar, #38b8a0);
}

body.hb-mail-body {
  background-color: var(--bg-page, #0b1220);
}

body.hb-mail-body .hb-main-nav::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: env(safe-area-inset-top, 0px);
  background: var(--hb-mail-status-bar, #38b8a0);
  pointer-events: none;
  z-index: 2;
}

.hb-mail-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  background: var(--bg-page, #0b1220);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  overflow-x: hidden;
  /* Safe-area-padding bovenaan = groene systeembalkkleur */
  background-image: linear-gradient(
    to bottom,
    var(--hb-mail-status-bar, #38b8a0) 0,
    var(--hb-mail-status-bar, #38b8a0) env(safe-area-inset-top, 0px),
    var(--bg-page, #0b1220) env(safe-area-inset-top, 0px)
  );
}

/* —— Sidebar —— */
.hb-mail-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  width: var(--hb-mail-sidebar-w);
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--bg-card, #121820) 96%, #000);
  border-right: 1px solid var(--border-soft, rgba(255,255,255,0.1));
  transform: translateX(-105%);
  transition: transform 0.22s ease;
}

.hb-mail-sidebar.is-open {
  transform: translateX(0);
}

.hb-mail-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border-soft, rgba(255,255,255,0.08));
  flex-shrink: 0;
}

.hb-mail-sidebar__brand {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: inherit;
  display: block;
}

.hb-mail-sidebar__credit {
  display: block;
  margin: 0.55rem 0 0;
  padding: 0 0.15rem;
  text-align: center;
  font-family: var(--lv-mail-ui);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--text-muted, #8b95a5);
  line-height: 1.35;
}

.hb-mail-sidebar__credit strong {
  font-family: var(--lv-mail-display);
  font-weight: 500;
  color: color-mix(in srgb, var(--lv-mail-brand) 80%, var(--text-muted));
}

.hb-mail-sidebar__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.65rem 0.65rem 1rem;
  display: flex;
  flex-direction: column;
}

.hb-mail-sidebar__section {
  margin-bottom: 1rem;
}

.hb-mail-sidebar__section--bottom {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
}

.hb-mail-sidebar__title {
  margin: 0 0 0.4rem 0.4rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.hb-mail-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.hb-mail-nav-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.65rem;
}

.hb-mail-nav-item:hover,
.hb-mail-nav-item.is-active {
  border-color: var(--accent, #3d8fd1);
  background: color-mix(in srgb, var(--accent, #3d8fd1) 14%, transparent);
}

.hb-mail-nav-item__ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--text-muted, #9aabc4);
}

.hb-mail-nav-item.is-active .hb-mail-nav-item__ico,
.hb-mail-nav-item:hover .hb-mail-nav-item__ico {
  color: var(--accent, #3d8fd1);
}

.hb-mail-nav-item__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  word-break: break-word;
  min-width: 0;
  flex: 1 1 auto;
}

.hb-mail-nav-item[data-view] .hb-mail-nav-item__label {
  flex: 1 1 0;
}

.hb-mail-nav-item__meta {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hb-mail-nav-item--account {
  flex-direction: column;
  align-items: stretch;
  gap: 0.1rem;
}

.hb-mail-nav-item__row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.hb-mail-nav-item__row .hb-mail-nav-item__label {
  flex: 1 1 auto;
}

.hb-mail-nav-item__chev {
  flex: 0 0 auto;
  width: 0.9rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.hb-mail-account {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hb-mail-folder-list {
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0 0 0 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.hb-mail-folder-list--nested {
  padding-left: 0.7rem;
  margin: 0.05rem 0 0.2rem;
}

.hb-mail-folder-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.hb-mail-folder-row .hb-mail-nav-item--folder {
  flex: 1;
  min-width: 0;
}

.hb-mail-nav-item--folder {
  padding: 0.42rem 0.65rem;
}

.hb-mail-nav-item--folder.is-child {
  padding-left: 0.55rem;
}

.hb-mail-nav-item--folder .hb-mail-nav-item__label {
  font-size: 0.84rem;
  font-weight: 500;
}

.hb-mail-nav-item--folder.is-child .hb-mail-nav-item__label {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted, #9aa4b2);
}

.hb-mail-folder-menu {
  position: relative;
  flex-shrink: 0;
  opacity: 0.35;
  transition: opacity 0.15s ease;
}

.hb-mail-folder-row:hover .hb-mail-folder-menu,
.hb-mail-folder-menu.is-open {
  opacity: 1;
}

.hb-mail-folder-menu__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.35rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.hb-mail-folder-menu__btn:hover,
.hb-mail-folder-menu.is-open .hb-mail-folder-menu__btn {
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.hb-mail-folder-menu__pop {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.15rem);
  z-index: 40;
  min-width: 9.5rem;
  padding: 0.25rem;
  border-radius: 0.45rem;
  background: var(--bg-elevated, #121a2b);
  border: 1px solid var(--border-soft, rgba(255,255,255,0.12));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.hb-mail-folder-menu.is-open .hb-mail-folder-menu__pop {
  display: block;
}

.hb-mail-folder-menu__pop button {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: 0.35rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.hb-mail-folder-menu__pop button:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.hb-mail-folder-menu__pop button.is-danger {
  color: #f0a0a0;
}

.hb-mail-folder-menu__pop button.is-danger:hover {
  background: color-mix(in srgb, #e85d5d 18%, transparent);
}

.hb-mail-icon-btn--danger {
  color: #e89a9a;
}

.hb-mail-icon-btn--danger:hover {
  color: #ffb4b4;
  background: color-mix(in srgb, #e85d5d 16%, transparent);
}

.hb-mail-rule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.hb-mail-sidebar__foot {
  flex-shrink: 0;
  padding: 0.65rem 0.75rem 0.85rem;
  border-top: 1px solid var(--border-soft, rgba(255,255,255,0.08));
}

/* —— Liber Veda Mail splash —— */
.lv-mail-splash {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(126, 182, 217, 0.14), transparent 70%),
    linear-gradient(165deg, #0a101c 0%, #121a2c 48%, #0b1220 100%);
  color: var(--lv-mail-brand);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.lv-mail-splash.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.lv-mail-splash__inner {
  text-align: center;
  padding: 1.5rem;
  animation: lv-mail-splash-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lv-mail-splash__mark {
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1.15rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--lv-mail-accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--lv-mail-accent) 40%, transparent);
  color: var(--lv-mail-accent);
  animation: lv-mail-splash-pulse 2.2s ease-in-out infinite;
}

.lv-mail-splash__title {
  margin: 0;
  font-family: var(--lv-mail-display);
  font-weight: 600;
  font-size: clamp(1.65rem, 4.5vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lv-mail-splash__title span {
  display: inline-block;
  color: var(--lv-mail-accent);
  font-weight: 500;
}

.lv-mail-splash__tag {
  margin: 0.65rem 0 0;
  font-family: var(--lv-mail-ui);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, #c5d0e0 70%, transparent);
}

.lv-mail-splash__bar {
  width: 4.5rem;
  height: 2px;
  margin: 1.35rem auto 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lv-mail-accent) 25%, transparent);
  overflow: hidden;
}

.lv-mail-splash__bar::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: var(--lv-mail-accent);
  animation: lv-mail-splash-bar 1.1s ease-in-out infinite;
}

@keyframes lv-mail-splash-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes lv-mail-splash-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(126, 182, 217, 0.2); }
  50% { box-shadow: 0 0 0 10px rgba(126, 182, 217, 0); }
}

@keyframes lv-mail-splash-bar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

@media (prefers-reduced-motion: reduce) {
  .lv-mail-splash__inner,
  .lv-mail-splash__mark,
  .lv-mail-splash__bar::after {
    animation: none;
  }
}

.lv-mail-login-hero h1 {
  font-family: var(--lv-mail-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lv-mail-login-hero h1 span {
  color: var(--lv-mail-accent);
  font-weight: 500;
}

.lv-mail-login-kicker {
  margin: 0 0 0.45rem;
  font-family: var(--lv-mail-ui);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted, #8b95a5);
}

.hb-mail-overlay__footer .hb-mail-btn-ico {
  display: inline-flex;
  vertical-align: -0.15em;
  margin-right: 0.25rem;
}

.hb-mail-item-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  position: relative;
}

.hb-mail-item-wrap .hb-mail-item {
  flex: 1;
  min-width: 0;
}

.hb-mail-item-menu {
  position: relative;
  flex-shrink: 0;
  align-self: center;
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

.hb-mail-item-wrap:hover .hb-mail-item-menu,
.hb-mail-item-menu.is-open {
  opacity: 1;
}

.hb-mail-item-menu__pop button.is-danger {
  color: #e07a7a;
}

.hb-mail-item-menu__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.35rem;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}

.hb-mail-item-menu__btn:hover,
.hb-mail-item-menu.is-open .hb-mail-item-menu__btn {
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.hb-mail-item-menu__pop {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.15rem);
  z-index: 30;
  min-width: 10.5rem;
  padding: 0.25rem;
  border-radius: 0.45rem;
  background: var(--bg-elevated, #121a2b);
  border: 1px solid var(--border-soft, rgba(255,255,255,0.12));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.hb-mail-item-menu.is-open .hb-mail-item-menu__pop {
  display: block;
}

.hb-mail-item-menu__pop button {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-radius: 0.35rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.hb-mail-item-menu__pop button:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

/* Mobiel long-press bottom sheet */
.hb-mail-sheet {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hb-mail-sheet.hb-is-hidden {
  display: none;
}

.hb-mail-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.hb-mail-sheet__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 1rem 1rem 0 0;
  background: var(--bg-elevated, #121a2b);
  border: 1px solid var(--border-soft, rgba(255,255,255,0.12));
  border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
  padding: 0.35rem 0 calc(0.65rem + env(safe-area-inset-bottom, 0px));
  animation: hb-mail-sheet-up 0.22s ease-out;
}

@keyframes hb-mail-sheet-up {
  from { transform: translateY(12%); opacity: 0.7; }
  to { transform: translateY(0); opacity: 1; }
}

.hb-mail-sheet__handle {
  width: 2.4rem;
  height: 0.28rem;
  border-radius: 999px;
  margin: 0.25rem auto 0.35rem;
  background: color-mix(in srgb, currentColor 28%, transparent);
}

.hb-mail-sheet__header {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.15rem 0.75rem 0.55rem;
}

.hb-mail-sheet__heading {
  flex: 1;
  min-width: 0;
}

.hb-mail-sheet__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.hb-mail-sheet__sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted, #9aa4b2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb-mail-sheet__body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 0.55rem 0.35rem;
}

.hb-mail-sheet__view {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hb-mail-sheet__action {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.85rem 0.75rem;
  border-radius: 0.65rem;
  cursor: pointer;
  min-height: 3rem;
}

.hb-mail-sheet__action:hover,
.hb-mail-sheet__action:active {
  background: color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 14%, transparent);
}

.hb-mail-sheet__action.is-child {
  padding-left: 1.65rem;
  font-size: 0.9rem;
}

.hb-mail-sheet__action.is-danger {
  color: #e07a7a;
}

.hb-mail-sheet__action-ico {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.hb-mail-sheet__action-ico svg {
  display: block;
}

body.hb-mail-sheet-open {
  overflow: hidden;
}

.hb-mail-item-wrap.is-longpress {
  background: color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 12%, transparent);
  border-radius: 0.55rem;
}

@media (max-width: 959px) {
  .hb-mail-item-menu {
    display: none;
  }

  .hb-mail-item-wrap {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
}

.hb-mail-junk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid color-mix(in srgb, #e8a35a 35%, var(--border-soft, rgba(255,255,255,0.12)));
  background: color-mix(in srgb, #e8a35a 12%, var(--bg-card, #121820));
}

.hb-mail-junk-bar__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.hb-mail-junk-bar__text strong {
  font-size: 0.95rem;
}

.hb-mail-junk-bar__text span {
  font-size: 0.8rem;
  color: var(--text-muted, #9aa4b2);
}

.hb-mail-junk-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hb-mail-dnd-hint {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
}

body.hb-mail-dnd-active .hb-mail-nav-item--folder {
  outline: 1px dashed color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 55%, transparent);
  outline-offset: -2px;
}

.hb-mail-nav-item.is-drop-target {
  background: color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 22%, transparent) !important;
  outline: 2px solid var(--lv-mail-accent, #7eb6d9);
  outline-offset: -2px;
}

.hb-mail-item-wrap.is-dragging {
  opacity: 0.45;
}

.hb-mail-item-wrap.is-selected .hb-mail-item,
.hb-mail-item.is-selected {
  background: color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 14%, transparent);
  border-color: color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 40%, transparent);
}

.hb-mail-item-wrap {
  cursor: grab;
}

.hb-mail-item-wrap:active,
.hb-mail-item:active {
  cursor: grabbing;
}

.hb-mail-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.45);
}

/* Desktop: persistente zijbalk; main/header starten rechts ervan */
@media (min-width: 960px) {
  .hb-mail-layout {
    display: block;
    padding-left: 0;
  }

  .hb-mail-sidebar {
    transform: translateX(0) !important;
  }

  .hb-mail-layout.is-sidebar-collapsed .hb-mail-sidebar {
    transform: translateX(0) !important;
  }

  .hb-mail-main {
    margin-left: var(--hb-mail-sidebar-w);
    width: calc(100% - var(--hb-mail-sidebar-w));
    max-width: none;
    box-sizing: border-box;
  }

  .hb-mail-drawer-backdrop {
    display: none !important;
  }

  /* Geen hamburger/collapse: navigatie is al zichtbaar */
  .hb-mail-btn-close-drawer,
  .hb-mail-btn-collapse,
  #btnMenu {
    display: none !important;
  }

  .hb-mail-account.is-expanded {
    margin-bottom: 0.35rem;
  }

  .hb-mail-folder-list {
    padding-left: 0.55rem;
    margin-top: 0.15rem;
  }
}

@media (max-width: 959px) {
  .hb-mail-btn-collapse {
    display: none !important;
  }

  /* Mobiel: verplaatsen via tap/action sheet, niet slepen */
  .hb-mail-dnd-hint {
    display: none !important;
  }
}

/* —— Main / appbar —— */
.hb-mail-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hb-mail-appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border-soft, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--bg-page, #0b1220) 92%, transparent);
  backdrop-filter: blur(8px);
}

.hb-mail-appbar__inner {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  min-width: 0;
}

.hb-mail-appbar__brand {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.hb-mail-appbar__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.hb-mail-appbar__subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hb-mail-appbar__subtitle.hb-is-hidden {
  display: none !important;
}

.hb-mail-actions {
  display: flex;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  gap: 0.3rem;
  align-items: center;
  justify-content: flex-end;
}

.hb-mail-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid var(--border-soft, rgba(255,255,255,0.12));
  background: color-mix(in srgb, var(--bg-elevated, #15202b) 80%, transparent);
  color: inherit;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}

.hb-mail-icon-btn svg {
  display: block;
}

.hb-mail-icon-btn:hover {
  border-color: var(--accent, #3d8fd1);
  color: var(--accent, #3d8fd1);
}

.hb-mail-content {
  padding: 0.85rem 0.85rem calc(5.5rem + env(safe-area-inset-bottom, 0px));
  min-width: 0;
  overflow-x: hidden;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* Views */
.hb-mail-view.hb-is-hidden {
  display: none !important;
}

/* Paginatitel alleen in de appbar (desktop én mobiel) */
@media (min-width: 960px) {
  .hb-mail-appbar {
    position: sticky;
    top: 0;
    left: auto;
    width: 100%;
    box-sizing: border-box;
  }

  .hb-mail-appbar__inner {
    /* Zelfde horizontale marge als de berichtenlijst */
    padding: 0.7rem 1rem;
    gap: 0.75rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .hb-mail-appbar__title {
    font-size: 1.15rem;
  }

  .hb-mail-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.hb-mail-panel {
  border: 1px solid var(--border-soft, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 1rem;
  background: color-mix(in srgb, var(--bg-card, #121820) 88%, transparent);
  margin-bottom: 1rem;
}

.hb-mail-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.hb-mail-form-row {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

@media (min-width: 700px) {
  .hb-mail-form-row.is-2 {
    grid-template-columns: 1fr 1fr;
  }
  .hb-mail-form-row.is-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.hb-mail-cal-planned-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.hb-mail-cal-planned-btn strong,
.hb-mail-cal-planned-btn span {
  display: block;
}

.hb-mail-data-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hb-mail-data-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft, rgba(255,255,255,0.08));
}

.hb-mail-data-item strong {
  display: block;
  font-size: 0.95rem;
}

.hb-mail-data-item span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.hb-mail-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.hb-mail-cal-toolbar__left,
.hb-mail-cal-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.hb-mail-cal-views {
  display: inline-flex;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  overflow: hidden;
}

.hb-mail-cal-views button {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.hb-mail-cal-views button.is-active {
  background: color-mix(in srgb, var(--accent, #3d8fd1) 22%, transparent);
  font-weight: 700;
}

.hb-mail-cal-shell {
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-elevated, #15202b) 80%, transparent);
}

.hb-mail-cal-scroll {
  max-height: min(65vh, 640px);
  overflow: auto;
}

.hb-mail-cal-grid-time {
  display: grid;
  min-width: 560px;
}

.hb-mail-cal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.45rem 0.25rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-elevated, #15202b);
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
}

.hb-mail-cal-head.is-today {
  color: var(--accent, #3d8fd1);
}

.hb-mail-cal-hour {
  height: 44px;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
  padding: 0.1rem 0.3rem 0 0;
  border-top: 1px solid var(--border-soft, rgba(255, 255, 255, 0.05));
  box-sizing: border-box;
}

.hb-mail-cal-daycol {
  position: relative;
  border-left: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
}

.hb-mail-cal-slot {
  display: block;
  width: 100%;
  height: 44px;
  border: none;
  border-top: 1px solid var(--border-soft, rgba(255, 255, 255, 0.05));
  background: transparent;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}

.hb-mail-cal-slot:hover {
  background: color-mix(in srgb, var(--accent, #3d8fd1) 12%, transparent);
}

.hb-mail-cal-event {
  position: absolute;
  left: 2px;
  right: 2px;
  border: none;
  border-radius: 5px;
  padding: 0.15rem 0.3rem;
  background: color-mix(in srgb, var(--accent, #3d8fd1) 85%, #0f172a);
  color: #fff;
  font: inherit;
  font-size: 0.7rem;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
}

.hb-mail-cal-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.hb-mail-cal-month--weeks {
  grid-template-columns: 32px repeat(7, minmax(0, 1fr));
}

.hb-mail-cal-month__wkhead,
.hb-mail-cal-month__weeknum {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent, #3d8fd1);
  border-right: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
}

.hb-mail-cal-month__weeknum {
  min-height: 84px;
}

.hb-mail-cal-head--weeknum {
  color: var(--accent, #3d8fd1);
  font-size: 0.72rem;
}

.hb-mail-cal-month__dow {
  padding: 0.45rem 0.25rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
}

.hb-mail-cal-month__day {
  min-height: 84px;
  padding: 0.3rem;
  border-right: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
  border-bottom: 1px solid var(--border-soft, rgba(255, 255, 255, 0.06));
  cursor: pointer;
}

.hb-mail-cal-month__day:hover {
  background: color-mix(in srgb, var(--accent, #3d8fd1) 10%, transparent);
}

.hb-mail-cal-month__day.is-muted {
  opacity: 0.4;
}

.hb-mail-cal-month__day.is-today .hb-mail-cal-month__num {
  background: var(--accent, #3d8fd1);
  color: #fff;
}

.hb-mail-cal-month__num {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.hb-mail-cal-month__ev {
  display: block;
  width: 100%;
  margin-top: 0.15rem;
  border: none;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent, #3d8fd1) 22%, transparent);
  color: inherit;
  font: inherit;
  font-size: 0.65rem;
  text-align: left;
  padding: 0.12rem 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb-mail-cal-month__more {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.hb-mail-cal-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(8, 12, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.hb-mail-cal-modal.hb-is-hidden {
  display: none !important;
}

.hb-mail-cal-modal__panel {
  width: min(520px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: var(--bg-page, #0f172a);
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.12));
  border-radius: 14px;
  padding: 1rem 1.1rem 1.15rem;
}

.hb-mail-cal-modal__panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.hb-mail-cal-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* Message list */
.hb-mail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hb-mail-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-soft, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--bg-elevated, #15202b) 70%, transparent);
  color: inherit;
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  cursor: grab;
  font: inherit;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

.hb-mail-item:hover {
  border-color: var(--accent, #3d8fd1);
  background: color-mix(in srgb, var(--accent, #3d8fd1) 10%, transparent);
}

.hb-mail-item.is-unread .hb-mail-item__subject,
.hb-mail-item.is-unread .hb-mail-item__from {
  color: var(--accent, #3d8fd1);
  font-weight: 700;
}

.hb-mail-item__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.hb-mail-item__from {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hb-mail-item__date {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.hb-mail-item__subject {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
}

.hb-mail-item__box {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  word-break: break-all;
}

.hb-mail-empty {
  padding: 2.5rem 0.5rem;
  color: var(--text-muted);
  text-align: center;
}

.hb-mail-suggest {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--accent, #3d8fd1) 50%, transparent);
  background: color-mix(in srgb, var(--accent, #3d8fd1) 8%, transparent);
}

.hb-mail-suggest h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.hb-mail-suggest__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.hb-mail-attach-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hb-mail-attach-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.hb-mail-attach-trigger {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 32%, var(--border-soft, rgba(255,255,255,0.12)));
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 16%, transparent),
      color-mix(in srgb, var(--bg-elevated, #15202b) 88%, transparent)
    );
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.hb-mail-attach-trigger:hover,
.hb-mail-attach-trigger:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 70%, transparent);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 24%, transparent),
      color-mix(in srgb, var(--bg-elevated, #15202b) 82%, transparent)
    );
}

.hb-mail-attach-trigger:active {
  transform: scale(0.99);
}

.hb-mail-attach-trigger__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 22%, transparent);
  color: var(--lv-mail-accent, #7eb6d9);
}

.hb-mail-attach-trigger__text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
}

.hb-mail-attach-trigger__text strong {
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.2;
}

.hb-mail-attach-trigger__text small {
  font-size: 0.78rem;
  color: var(--text-muted, #9aa4b2);
  line-height: 1.3;
}

.hb-mail-attach-trigger__chev {
  flex: 0 0 auto;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-muted, #9aa4b2);
  opacity: 0.85;
}

/* Boven compose-overlay (z-index 1200), zodat het keuzemenu zichtbaar blijft */
#attachSheet.hb-mail-sheet {
  z-index: 1300;
}

.hb-mail-attach-sheet .hb-mail-sheet__panel,
.hb-mail-attach-sheet {
  max-width: min(100%, 440px);
}

.hb-mail-attach-sheet .hb-mail-sheet__action {
  border: 1px solid var(--border-soft, rgba(255,255,255,0.1));
  background: color-mix(in srgb, var(--bg-card, #121820) 70%, transparent);
  margin-bottom: 0.4rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hb-mail-attach-sheet .hb-mail-sheet__action:hover,
.hb-mail-attach-sheet .hb-mail-sheet__action:active {
  border-color: color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 45%, transparent);
}

.hb-mail-attach-sheet .hb-mail-sheet__action.hb-mail-attach-opt--primary {
  border-color: color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 40%, transparent);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 18%, transparent),
      color-mix(in srgb, var(--bg-card, #121820) 78%, transparent)
    );
}

.hb-mail-attach-sheet .hb-mail-sheet__action-ico {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--lv-mail-accent, #7eb6d9) 16%, transparent);
  color: var(--lv-mail-accent, #7eb6d9);
}

.hb-mail-attach-sheet .hb-mail-sheet__action span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.hb-mail-attach-sheet .hb-mail-sheet__action strong {
  font-weight: 650;
  font-size: 0.95rem;
}

.hb-mail-attach-opt-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted, #9aa4b2);
  font-weight: 400;
}

@media (min-width: 960px) {
  #attachSheet.hb-mail-sheet {
    align-items: center;
    padding: 1.25rem;
  }

  #attachSheet .hb-mail-sheet__panel {
    border-radius: 1rem;
    border-bottom: 1px solid var(--border-soft, rgba(255,255,255,0.12));
    max-height: min(70vh, 520px);
    animation: hb-mail-attach-pop 0.18s ease-out;
  }

  #attachSheet .hb-mail-sheet__handle {
    display: none;
  }
}

@keyframes hb-mail-attach-pop {
  from { transform: translateY(8px) scale(0.98); opacity: 0.75; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.hb-mail-attach-list {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hb-mail-attach-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border-soft, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--bg-elevated, #15202b) 70%, transparent);
}

.hb-mail-contact-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.hb-mail-contact-chip {
  border: 1px solid var(--border-soft, rgba(255,255,255,0.14));
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.hb-mail-contact-chip:hover {
  border-color: var(--accent, #3d8fd1);
  background: color-mix(in srgb, var(--accent, #3d8fd1) 14%, transparent);
}

.hb-mail-to-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.75rem;
  margin-top: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent, #3d8fd1) 35%, transparent);
  background: color-mix(in srgb, var(--accent, #3d8fd1) 12%, transparent);
  font-size: 0.86rem;
  line-height: 1.35;
}

.hb-mail-to-prompt.hb-is-hidden {
  display: none !important;
}

.hb-mail-to-prompt__text {
  flex: 1 1 14rem;
  min-width: 0;
  color: var(--text-main, inherit);
}

.hb-mail-to-prompt__text strong {
  word-break: break-all;
}

.hb-mail-to-prompt__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.hb-mail-reader__attachments {
  margin: 0.5rem 0 0.85rem;
}

.hb-mail-attach-panel {
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: color-mix(in srgb, var(--bg-elevated, #15202b) 70%, transparent);
}

.hb-mail-attach-panel strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
}

.hb-mail-attach-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hb-mail-attach-files li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  font-size: 0.86rem;
}

.hb-mail-attach-files__name {
  font-weight: 600;
  min-width: 0;
  word-break: break-all;
}

.hb-mail-attach-files__size {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.hb-mail-item__meta-right {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.hb-mail-item__clip {
  display: inline-flex;
  color: var(--text-muted);
}

.hb-mail-item.is-unread .hb-mail-item__clip {
  color: var(--accent, #3d8fd1);
}

.hb-mail-reader__body {
  margin-top: 0.5rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.hb-mail-reader__body--html {
  white-space: normal;
}

.hb-mail-reader__body--html img {
  max-width: 100%;
  height: auto;
}

/* Overlays */
.hb-mail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: color-mix(in srgb, #05080f 72%, transparent);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.hb-mail-overlay__panel {
  width: min(920px, 100%);
  height: 100%;
  background: var(--bg-page, #0b1220);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-soft, rgba(255,255,255,0.08));
  border-right: 1px solid var(--border-soft, rgba(255,255,255,0.08));
}

.hb-mail-overlay__panel--compose {
  width: min(820px, 100%);
}

.hb-mail-compose-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.hb-mail-compose-form .hb-mail-overlay__body {
  flex: 1 1 auto;
  min-height: 0;
}

.hb-mail-compose-form .hb-mail-overlay__footer {
  flex: 0 0 auto;
}

.hb-mail-toast {
  position: fixed;
  left: 50%;
  top: max(1rem, env(safe-area-inset-top, 0px));
  transform: translate(-50%, -120%);
  z-index: 4000;
  max-width: min(520px, calc(100vw - 1.5rem));
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.35;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
  background: #1a2436;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8eef7;
}

.hb-mail-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.hb-mail-toast.is-ok {
  background: color-mix(in srgb, #2e8b57 35%, #0b1220);
  border-color: color-mix(in srgb, #2e8b57 55%, transparent);
}

.hb-mail-toast.is-error {
  background: color-mix(in srgb, #c0392b 40%, #0b1220);
  border-color: color-mix(in srgb, #c0392b 60%, transparent);
}

#btnSend.is-loading {
  opacity: 0.85;
  cursor: wait;
}

.hb-mail-overlay__panel--narrow {
  width: min(420px, 100%);
  height: auto;
  max-height: min(90vh, 520px);
  margin: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--border-soft, rgba(255,255,255,0.12));
  align-self: center;
}

.hb-mail-overlay__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.hb-mail-overlay__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-soft, rgba(255,255,255,0.08));
}

.hb-mail-overlay__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.45;
}

.hb-mail-overlay__body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.15rem 1.25rem;
}

.hb-mail-overlay__subject {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  line-height: 1.3;
}

.hb-mail-overlay__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-soft, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--bg-card, #121820) 90%, transparent);
}

body.hb-mail-lock {
  overflow: hidden;
}

.hb-rte {
  border: 1px solid var(--border-soft, rgba(255,255,255,0.14));
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-elevated, #15202b) 70%, transparent);
}

.hb-rte__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.4rem;
  border-bottom: 1px solid var(--border-soft, rgba(255,255,255,0.1));
}

.hb-rte__toolbar button {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.hb-rte__toolbar button:hover {
  border-color: var(--accent, #3d8fd1);
  background: color-mix(in srgb, var(--accent, #3d8fd1) 12%, transparent);
}

.hb-rte__editor {
  min-height: 200px;
  padding: 0.85rem 0.95rem;
  outline: none;
  line-height: 1.55;
}

.hb-btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.85rem;
}

.hb-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.hb-flash {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.hb-flash.is-ok {
  background: color-mix(in srgb, #2e8b57 22%, transparent);
  border: 1px solid color-mix(in srgb, #2e8b57 45%, transparent);
}

.hb-flash.is-error {
  background: color-mix(in srgb, #c0392b 22%, transparent);
  border: 1px solid color-mix(in srgb, #c0392b 45%, transparent);
}

.hb-is-hidden {
  display: none !important;
}

.hb-mail-actions [data-pwa-install-btn][hidden] {
  display: none !important;
}

.hb-check-inline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
}

/* —— Floating compose (Gmail/Outlook-stijl) —— */
.hb-mail-fab {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1.15rem, env(safe-area-inset-bottom, 0px));
  z-index: 55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.35rem;
  padding: 0 1.15rem 0 0.95rem;
  border: none;
  border-radius: 999px;
  background: var(--accent, #3d8fd1);
  color: #0b1220;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(61, 143, 209, 0.35);
  cursor: pointer;
  transition:
    width 0.22s ease,
    padding 0.22s ease,
    border-radius 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.18s ease;
}

.hb-mail-fab:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.hb-mail-fab__icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.hb-mail-fab__label {
  display: inline-block;
  white-space: nowrap;
  max-width: 10rem;
  overflow: hidden;
  transition: max-width 0.22s ease, opacity 0.18s ease, margin 0.22s ease;
}

.hb-mail-fab.is-mini {
  width: 3.35rem;
  min-width: 3.35rem;
  height: 3.35rem;
  min-height: 3.35rem;
  padding: 0;
  border-radius: 14px;
  gap: 0;
}

.hb-mail-fab.is-mini .hb-mail-fab__label {
  max-width: 0;
  opacity: 0;
  margin: 0;
}

body.hb-mail-lock .hb-mail-fab {
  display: none !important;
}

/* PWA-banner boven FAB houden op webmail */
body.hb-mail-layout .hb-pwa-install {
  bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  max-width: min(520px, calc(100vw - 24px));
  margin-inline: auto;
  box-sizing: border-box;
}

.hb-flash {
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 959px) {
  .hb-mail-sidebar {
    padding-top: env(safe-area-inset-top, 0px);
    width: min(var(--hb-mail-sidebar-w), 88vw);
  }

  .hb-mail-appbar__inner {
    padding: 0.5rem 0.65rem;
    gap: 0.35rem;
  }

  .hb-mail-icon-btn {
    width: 2.3rem;
    height: 2.3rem;
    flex: 0 0 auto;
  }

  .hb-mail-appbar__title {
    font-size: 1rem;
  }

  .hb-mail-content {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hb-mail-fab {
    right: max(0.85rem, env(safe-area-inset-right, 0px));
    bottom: max(0.95rem, env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 960px) {
  .hb-mail-fab {
    right: max(1.35rem, env(safe-area-inset-right, 0px));
    bottom: max(1.35rem, env(safe-area-inset-bottom, 0px));
  }
}
