/* LayerNX © – LNX-Mail im Wiki-Stil (Ergänzung zu /_lnx/css/lnx-ui.css) */
.mail-main { width: min(920px, 100%); margin: 0 auto; padding: 28px 18px 64px; }
.page { display: none; }
.page.active { display: block; }
.head-icon { display: flex; align-items: center; gap: 14px; }
.mail-nav { display: flex !important; }
.ico-lg { width: 40px; height: 40px; }
.hide-s { margin-left: 2px; }

.address-box .label { display: block; margin-bottom: 8px; }
.address-row { display: flex; flex-wrap: wrap; gap: 8px; }
.address-field { flex: 1 1 280px; display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg); }
.address-field:focus-within { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(85, 47, 251, .25); }
.address-field input { flex: 1; min-width: 0; border: 0 !important; background: none !important; box-shadow: none !important; padding: 10px 12px !important; font: 1.05rem var(--mono) !important; }
.address-field .address-domain { padding-right: 12px; color: var(--muted); font: 1.05rem var(--mono); white-space: nowrap; }
#input-hint.error { color: var(--err); }

.mailbox-view { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.mailbox-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.mailbox-address, .mailbox-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mailbox-address code { font-size: .95rem; }
.refresh { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; color: var(--faint); font: .74rem var(--mono); }
.refresh .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.refresh.refreshing .pulse { background: var(--warn); }
.mailbox-body { min-height: 120px; }
.mailbox-body .notice { margin: 14px; }

.mail-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mail-item:last-child { border-bottom: 0; }
.mail-item:hover { background: var(--bg-hover); }
.mail-item.unread .mail-from, .mail-item.unread .mail-subject { color: #fff; font-weight: 700; }
.mail-avatar { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-3); border: 1px solid var(--line-2); color: var(--link); font: 700 .9rem var(--font-head); }
.mail-content { flex: 1; min-width: 0; }
.mail-row1 { display: flex; justify-content: space-between; gap: 10px; }
.mail-from { color: var(--text-2); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-time { flex: 0 0 auto; color: var(--faint); font: .74rem var(--mono); }
.mail-subject { margin-top: 2px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-preview { margin-top: 2px; color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-badges { display: flex; gap: 6px; margin-top: 6px; }
.mail-badge { padding: 0 7px; border: 1px solid var(--line-2); border-radius: 99px; color: var(--muted); font-size: .72rem; }
.mail-badge.new { color: var(--ok); border-color: rgba(60, 207, 142, .4); }

/* Mail-Ansicht */
.mail-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.mail-modal[hidden] { display: none; }
.mail-modal-backdrop { position: absolute; inset: 0; background: rgba(5, 5, 8, .78); }
.mail-modal-content { position: relative; display: flex; flex-direction: column; width: min(860px, 100%); max-height: calc(100vh - 32px); border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); box-shadow: 0 16px 50px rgba(0, 0, 0, .5); }
.mail-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mail-modal-body { padding: 16px 18px 20px; overflow-y: auto; }
.mail-subject-h { margin: 0 0 12px; font-size: 1.3rem; overflow-wrap: anywhere; }
.mail-meta { margin-bottom: 14px; }
.mail-body-tabs { align-items: center; }
.mail-body-tabs .body-tab { padding: 7px 12px; margin-bottom: -1px; border: 1px solid transparent; border-radius: var(--radius) var(--radius) 0 0; background: none; color: var(--muted); font: .9rem var(--font); cursor: pointer; }
.mail-body-tabs .body-tab.active { color: var(--text); border-color: var(--line); border-bottom-color: var(--bg-2); }
.mail-body-actions { margin-left: auto; display: flex; gap: 6px; padding-bottom: 4px; }
.mail-body-pane { display: none; }
.mail-body-pane.active { display: block; }
.mail-body-pane pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 55vh; overflow-y: auto; }
.mail-body-pane iframe { width: 100%; height: 55vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.mail-attachments { margin-top: 16px; }
.attachment-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text) !important; }
.attachment-item:hover { background: var(--bg-hover); text-decoration: none !important; }
.attachment-icon { width: 28px; height: 28px; color: var(--muted); }
.attachment-icon svg { width: 100%; height: 100%; }
.attachment-name { font-size: .9rem; }
.attachment-meta { color: var(--faint); font-size: .76rem; }

/* Hinweise unten rechts */
.toast-container { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: grid; gap: 8px; }
.toast { padding: 10px 14px; border: 1px solid var(--line-2); border-left-width: 3px; border-radius: var(--radius); background: var(--bg-2); color: var(--text); font-size: .9rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); animation: toastIn .2s ease-out; }
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--err); }
.toast.info { border-left-color: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

@media (max-width: 560px) {
  .mail-main { padding: 18px 12px 48px; }
  .address-field input, .address-field .address-domain { font-size: .95rem !important; }
  .address-row .btn { flex: 1 1 auto; }
  .hide-s { display: none; }
  .mail-modal { padding: 0; }
  .mail-modal-content { max-height: 100vh; height: 100%; border-radius: 0; }
}
/* Gast-Limit + Anmeldung */
.quota { color: var(--faint); margin-bottom: 0; }
#limit-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 0; }
#limit-notice[hidden] { display: none; }
#limit-notice span { flex: 1 1 260px; }
