@font-face { font-family: 'Geist'; src: url('/fonts/Geist-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

/* ---------- Kleuren: licht (standaard) ---------- */
:root {
  --accent: #1E5A52;
  --accent-text: var(--accent);
  --accent-btn: var(--accent);
  --accent-hover: color-mix(in srgb, var(--accent) 85%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--panel));
  --ground: #F5F4F0;
  --panel: #FFFFFF;
  --raised: #FFFFFF;
  --input: #FFFFFF;
  --subtle: #F5F4F0;
  --hover: rgba(26,26,28,.04);
  --line: #ECE9E2;
  --line-strong: #DAD6CC;
  --border: #E3E0D8;
  --text: #1A1A1C;
  --text-2: #3A3935;
  --muted: #6B6860;
  --danger: #A8322A;
  --danger-soft: #FBEDEB;
  --star: #B7791F;
  --neutral-avatar: #E9E6DF;
  --skel-a: #F3F1EC;
  --skel-b: #FAF9F6;
  --overlay: rgba(26,26,28,.28);
  --shadow: 0 1px 2px rgba(26,26,28,.06);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.18);
  color-scheme: light;
}
/* ---------- Donker ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent-text: color-mix(in srgb, var(--accent) 45%, #fff);
    --accent-btn: color-mix(in srgb, var(--accent) 72%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 28%, #1D1D20);
    --accent-hover: color-mix(in srgb, var(--accent) 80%, #fff);
    --ground: #121214; --panel: #1C1C1F; --raised: #242428; --input: #232327; --subtle: #26262A;
    --hover: rgba(255,255,255,.05); --line: #2A2A2E; --line-strong: #3A3A40; --border: #34343A;
    --text: #EDEDEF; --text-2: #CFCFD4; --muted: #9C9CA4;
    --danger: #F08A80; --danger-soft: rgba(240,138,128,.12); --star: #E3B341;
    --neutral-avatar: #33333A; --skel-a: #222226; --skel-b: #2A2A2F;
    --overlay: rgba(0,0,0,.55); --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent-text: color-mix(in srgb, var(--accent) 45%, #fff);
  --accent-btn: color-mix(in srgb, var(--accent) 72%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 28%, #1D1D20);
  --accent-hover: color-mix(in srgb, var(--accent) 80%, #fff);
  --ground: #121214; --panel: #1C1C1F; --raised: #242428; --input: #232327; --subtle: #26262A;
  --hover: rgba(255,255,255,.05); --line: #2A2A2E; --line-strong: #3A3A40; --border: #34343A;
  --text: #EDEDEF; --text-2: #CFCFD4; --muted: #9C9CA4;
  --danger: #F08A80; --danger-soft: rgba(240,138,128,.12); --star: #E3B341;
  --neutral-avatar: #33333A; --skel-a: #222226; --skel-b: #2A2A2F;
  --overlay: rgba(0,0,0,.55); --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--ground); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
a { color: var(--accent-text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1 1 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--subtle); font: 600 12px/1.4 'Geist', system-ui, sans-serif; text-align: center; }

/* ---------- Knoppen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; background: none; cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; color: var(--text); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent-btn); color: #fff; font-weight: 600; border-color: rgba(255,255,255,.08); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-btn) 85%, #000); }
a.btn { text-decoration: none; }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { border-color: var(--border); background: var(--raised); }
.btn-ghost:hover { background: var(--subtle); }
.btn-danger { color: var(--danger); border-color: var(--border); background: var(--raised); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-lg { height: 52px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.icon-btn { width: 40px; height: 40px; border: none; background: transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { background: var(--hover); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.on { color: var(--star); }
.icon-btn.on svg { fill: currentColor; }
.link-btn { border: none; background: none; color: var(--accent-text); font-weight: 500; cursor: pointer; padding: 4px; }
.link-btn:hover { text-decoration: underline; }
.only-mobile { display: none; }

/* ---------- Merk ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; min-height: 42px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.brand-logo { max-height: 36px; max-width: 180px; display: block; }
.brand-name { font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 12px; color: var(--muted); }
:root[data-theme="dark"] .brand-logo, :root[data-theme="dark"] .login-side .brand-logo { filter: brightness(0) invert(.92); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-logo { filter: brightness(0) invert(.92); } }

/* ---------- Aanmelden ---------- */
.login { display: flex; min-height: 100vh; min-height: 100dvh; }
.login-side { width: min(560px, 100%); flex-shrink: 0; padding: 40px 64px 32px; display: flex; flex-direction: column; }
.login-side .brand { padding: 0; }
.login-side .brand-logo { max-height: 44px; }
.login-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; max-width: 400px; padding: 40px 0; }
.login-intro h1 { margin: 0 0 10px; font-size: 40px; font-weight: 650; letter-spacing: -.025em; line-height: 1.1; }
.login-intro p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input-wrap { height: 50px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--input); display: flex; align-items: center; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.input-wrap:focus-within { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-wrap input { border: none; outline: none; background: transparent; font-size: 15px; padding: 0 0 0 16px; flex: 1; min-width: 0; height: 100%; }
.input-suffix { padding: 0 16px 0 2px; font-size: 15px; color: var(--muted); white-space: nowrap; }
.input-wrap .icon-btn { margin-right: 4px; }
.text-input { height: 42px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input); padding: 0 12px; outline: none; width: 100%; }
.text-input:focus { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.text-input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.login-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.login-foot svg { width: 14px; height: 14px; }
.login-foot a { color: inherit; }

.login-art { position: relative; flex: 1; margin: 16px 16px 16px 0; border-radius: 24px; background: var(--accent); padding: 48px 56px; display: flex; flex-direction: column; overflow: hidden; color: #fff; isolation: isolate; }
.art-rings { position: absolute; width: 900px; height: 900px; right: -300px; top: -320px; border-radius: 50%; z-index: -1;
  background: repeating-radial-gradient(circle, transparent 0 58px, rgba(255,255,255,.07) 58px 59px); }
.art-top { display: flex; }
.art-pill { font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); }
.art-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 300px; }
.art-device { position: relative; width: min(440px, 90%); }
.art-window { position: relative; width: 100%; background: #fff; border-radius: 16px; padding: 14px 14px 10px; box-shadow: 0 30px 70px rgba(0,0,0,.28); }
.art-back { position: absolute; inset: 0; transform: translate(28px, -22px) rotate(3deg); opacity: .16; box-shadow: none; }
.art-bar { display: flex; gap: 6px; padding: 2px 4px 12px; }
.art-bar span { width: 9px; height: 9px; border-radius: 50%; background: #E6E3DC; }
.art-row { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 10px; }
.art-row.active { background: color-mix(in srgb, var(--accent) 9%, #fff); }
.art-row i { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); opacity: .85; flex-shrink: 0; }
.art-row i.c2 { background: #C2702F; } .art-row i.c3 { background: #7A6A9E; } .art-row i.c4 { background: #4F8A6B; }
.art-row div { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.art-row b, .art-row em { display: block; height: 8px; border-radius: 4px; background: #D9D5CC; }
.art-row em { background: #ECE9E2; }
.art-row.active b { background: color-mix(in srgb, var(--accent) 45%, #fff); }
.art-toast { position: absolute; bottom: -22px; left: -28px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: #1A1A1C; color: #fff; font-size: 13px; font-weight: 500; box-shadow: 0 14px 30px rgba(0,0,0,.25); }
.art-toast svg { width: 15px; height: 15px; }
.art-copy h2 { margin: 0 0 18px; font-size: clamp(28px, 2.6vw, 38px); font-weight: 650; letter-spacing: -.025em; line-height: 1.15; max-width: 16ch; text-wrap: balance; }
.art-copy ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.art-copy li { display: flex; align-items: center; gap: 10px; opacity: .92; }
.art-copy li svg { width: 17px; height: 17px; opacity: .85; }
@media (max-height: 760px) { .art-stage { min-height: 220px; } .art-back { display: none; } }

/* ---------- Mail-layout ---------- */
.mail { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: 248px; flex-shrink: 0; padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; }
.compose-btn { height: 44px; border-radius: 12px; }
.folders { display: flex; flex-direction: column; gap: 2px; }
.folder { height: 38px; padding: 0 10px; border-radius: 9px; display: flex; align-items: center; gap: 11px; border: none; background: none; text-align: left; color: var(--text-2); cursor: pointer; width: 100%; font-size: 14px; }
.folder:hover { background: var(--hover); }
.folder.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.folder.drop { background: var(--accent-soft); outline: 2px dashed var(--accent-text); outline-offset: -2px; }
.folder .f-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .f-count { font-size: 12px; color: var(--muted); }
.folder.active .f-count, .folder .f-count.unread { color: var(--accent-text); font-weight: 600; }
.folder .dot { width: 8px; height: 8px; border-radius: 3px; margin: 0 5px; }
.folders-label { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 4px 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.account { padding: 12px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.account-row { display: flex; align-items: center; gap: 10px; }
.account-text { flex: 1; min-width: 0; }
.account-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-mail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-actions { display: flex; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.account-actions .btn { flex: 1; height: 32px; padding: 0 8px; font-size: 12px; gap: 6px; color: var(--text-2); }
.account-actions .btn:hover { background: var(--hover); }
.account-actions .btn svg { width: 14px; height: 14px; }

.avatar { width: 40px; height: 40px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; background: #5E6B73; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.neutral { background: var(--neutral-avatar); color: var(--text-2); }

.list { width: 420px; flex-shrink: 0; margin: 12px 0; background: var(--panel); border-radius: 16px 0 0 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.list-head { padding: 18px 20px 12px; display: flex; flex-direction: column; gap: 14px; }
.list-title { display: flex; align-items: center; gap: 10px; }
.list-title h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { height: 40px; border-radius: 10px; background: var(--subtle); display: flex; align-items: center; gap: 9px; padding: 0 12px; color: var(--muted); }
.search input { border: none; background: transparent; outline: none; font-size: 14px; color: var(--text); flex: 1; min-width: 0; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--border); background: var(--raised); color: var(--text-2); font-size: 13px; cursor: pointer; }
.pill.active { background: var(--text); border-color: var(--text); color: var(--panel); font-weight: 500; }

.bulkbar { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 6px; border-radius: 12px; background: var(--accent-soft); }
.bulkbar .count { font-size: 12px; font-weight: 700; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent-btn); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.bulkbar .icon-btn { width: 34px; height: 34px; }
.bulkbar .icon-btn svg { width: 17px; height: 17px; }
.cb { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.cb-wrap { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }

.messages { flex: 1; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.msg { position: relative; border: none; text-align: left; cursor: pointer; padding: 12px; border-radius: 12px; background: transparent; display: flex; gap: 12px; align-items: flex-start; width: 100%; color: var(--text); }
.msg:hover { background: var(--hover); }
.msg.selected { background: var(--accent-soft); }
.msg.checked { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent-text); }
.msg.dragging { opacity: .5; }
.msg-pick { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.msg-pick .avatar { position: absolute; inset: 0; }
.msg-pick .cb-box { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; border-radius: 50%; background: var(--raised); border: 1px solid var(--border); }
.msg:hover .msg-pick .cb-box, .messages.selecting .msg-pick .cb-box, .msg.checked .msg-pick .cb-box { display: flex; }
.msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.msg-line { display: flex; align-items: center; gap: 8px; }
.msg-from { font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-count { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--subtle); border-radius: 8px; padding: 1px 6px; }
.msg-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.msg-subject, .msg-preview { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-preview { color: var(--muted); }
.msg-draft { color: var(--danger); font-weight: 500; }
.msg.unread .msg-from, .msg.unread .msg-subject { font-weight: 600; }
.msg.unread .msg-time { color: var(--accent-text); font-weight: 600; }
.msg .ico { width: 14px; height: 14px; color: var(--muted); }
.msg .ico.star { color: var(--star); fill: currentColor; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-text); flex-shrink: 0; margin-top: 6px; }
.list-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.more-btn { margin: 8px auto 12px; }
.skeleton { height: 70px; border-radius: 12px; background: linear-gradient(90deg, var(--skel-a) 0, var(--skel-b) 50%, var(--skel-a) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin: 2px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.compact .msg { padding: 8px 10px; gap: 10px; }
.compact .msg-pick, .compact .msg .avatar { width: 30px; height: 30px; font-size: 11px; }
.compact .msg-preview { display: none; }

.reader { flex: 1; min-width: 0; margin: 12px 12px 12px 0; background: var(--panel); border-radius: 0 16px 16px 0; display: flex; flex-direction: column; overflow: hidden; }
.reader-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.reader-empty svg { width: 40px; height: 40px; stroke-width: 1.3; opacity: .6; }
.reader-empty .hint { font-size: 12px; }
.reader-full { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.toolbar { height: 60px; flex-shrink: 0; padding: 0 16px; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.toolbar .btn { height: 36px; padding: 0 12px; font-size: 13px; margin-left: 4px; }
.reader-scroll { flex: 1; overflow-y: auto; }
.reader-body { padding: 28px 56px 32px; display: flex; flex-direction: column; gap: 16px; max-width: 920px; }
.reader-body h2 { margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; overflow-wrap: anywhere; }

.mcard { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.mcard.single { border: none; }
.mcard-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; border-radius: 14px; }
.mcard.single .mcard-head { padding: 0 0 8px; cursor: default; }
.mcard-head:hover { background: var(--hover); }
.mcard.single .mcard-head:hover, .mcard.open .mcard-head:hover { background: transparent; }
.mcard-head .avatar { width: 42px; height: 42px; font-size: 14px; }
.sender-text { flex: 1; min-width: 0; font-size: 14px; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.sender-text .snippet { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.mcard-tools { display: flex; gap: 2px; }
.mcard-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.mcard.single .mcard-body { padding: 8px 0 0; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--subtle); font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.mail-frame { width: 100%; border: none; min-height: 80px; display: block; background: #fff; border-radius: 10px; }
:root[data-theme="dark"] .mail-frame { padding: 0; }
.attachments { display: flex; flex-wrap: wrap; gap: 10px; }
.attachment { display: flex; align-items: center; gap: 12px; width: 280px; max-width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); }
.attachment:hover { background: var(--subtle); }
.att-type { width: 38px; height: 38px; border-radius: 9px; background: var(--subtle); color: var(--text-2); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; text-transform: uppercase; flex-shrink: 0; }
.att-type.pdf { background: #FBEDE7; color: #B4462A; }
.att-type.img { background: #E7F0FB; color: #2F5E9E; }
.att-meta { flex: 1; min-width: 0; }
.att-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { font-size: 12px; color: var(--muted); }
.quick-reply { margin: 0 56px 24px; border: 1px solid var(--border); border-radius: 14px; padding: 8px 8px 8px 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 10px rgba(26,26,28,.04); max-width: 808px; background: var(--raised); }
.quick-reply:focus-within { border-color: var(--accent-text); }
.quick-reply input { border: none; outline: none; background: transparent; font-size: 14px; flex: 1; min-width: 0; }

/* ---------- Menu's ---------- */
.menu { position: fixed; z-index: 70; min-width: 220px; max-width: 320px; max-height: 360px; overflow-y: auto; background: var(--raised); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: none; background: none; border-radius: 8px; cursor: pointer; text-align: left; font-size: 14px; color: var(--text); }
.menu button:hover, .menu button.active { background: var(--hover); }
.menu button svg { width: 16px; height: 16px; color: var(--muted); }
.menu hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .menu-sub { font-size: 12px; color: var(--muted); padding: 0 10px; overflow: hidden; text-overflow: ellipsis; }
.menu .ac-item { height: auto; padding: 8px 10px; flex-direction: column; align-items: flex-start; gap: 1px; }
.menu .ac-item strong { font-weight: 500; }

/* ---------- Opstellen ---------- */
.compose-backdrop, .modal-backdrop { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.compose { width: min(820px, 100%); height: min(760px, 100%); background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.compose-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 6px 24px; }
.compose-head h2 { margin: 0; font-size: 18px; font-weight: 600; flex: 1; }
.draft-status { font-size: 12px; color: var(--muted); }
.compose-fields { padding: 0 24px; }
.c-row { position: relative; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); min-height: 46px; }
.c-row label { width: 76px; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.c-row input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 14px; height: 44px; }
.c-from { font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-bar { display: flex; align-items: center; gap: 2px; padding: 6px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.editor-bar .icon-btn { width: 34px; height: 34px; font-weight: 700; font-size: 14px; }
.editor-bar .icon-btn.on { color: var(--accent-text); background: var(--accent-soft); }
.editor-bar .icon-btn.on svg { fill: none; }
.editor { flex: 1; overflow-y: auto; padding: 18px 24px; font-size: 15px; line-height: 1.6; outline: none; overflow-wrap: anywhere; }
.editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
.editor p, .sig-editor p { margin: 0 0 .6em; }
.editor blockquote, .sig-editor blockquote { margin: .4em 0; padding-left: 12px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.editor img { max-width: 100%; height: auto; }
.editor table { max-width: 100%; }
.editor .wm-quote { color: var(--muted); }
.editor .wm-signature { color: var(--text-2); }
.compose-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 24px 0; }
.compose-files:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 12px; border-radius: 16px; background: var(--subtle); font-size: 13px; max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { width: 26px; height: 26px; border: none; background: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); }
.chip button svg { width: 14px; height: 14px; }
.compose .form-error { margin: 8px 24px 0; }
.compose-foot { display: flex; align-items: center; gap: 8px; padding: 14px 24px 18px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.compose.dragover .editor { background: var(--accent-soft); }

/* ---------- Modals ---------- */
.modal { width: min(560px, 100%); max-height: min(760px, 100%); background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 8px 24px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal-body { padding: 8px 24px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 18px; border-top: 1px solid var(--line); }
.sig-box { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input); overflow: hidden; }
.sig-box .editor-bar { padding: 4px 6px; }
.sig-editor { min-height: 110px; max-height: 240px; overflow-y: auto; padding: 10px 12px; outline: none; line-height: 1.5; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--subtle); gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border: none; border-radius: 8px; background: none; cursor: pointer; font-size: 13px; color: var(--text-2); }
.seg button.active { background: var(--raised); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch-row .t { font-weight: 500; }
.switch-row .d { font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--line-strong); transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent-btn); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; font-size: 14px; }
.keys div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--panel); padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 80; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 14px; }
.toast .link-btn { color: inherit; text-decoration: underline; padding: 0; }
.scrim { display: none; }
.drag-ghost { position: fixed; top: -100px; left: -100px; padding: 8px 12px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; }

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
  .list { width: 360px; }
  .reader-body { padding: 24px 28px; }
  .quick-reply { margin: 0 28px 20px; }
  .hide-sm span, .toolbar .hide-sm { display: none; }
}

/* ---------- Gsm ---------- */
@media (max-width: 860px) {
  .only-mobile { display: inline-flex; }
  .login-art { display: none; }
  .login-side { padding: 28px 24px; width: 100%; }
  .login-intro h1 { font-size: 34px; }
  .login-body { max-width: none; }

  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; background: var(--ground); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  .mail.nav-open .sidebar { transform: none; }
  .mail.nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 39; }
  .list { width: 100%; margin: 0; border-radius: 0; border: none; }
  .list-head { padding: 12px 16px 10px; }
  .list-title .icon-btn:first-child { margin-left: -8px; }
  .list-title h1 { font-size: 24px; }
  .reader { position: fixed; inset: 0; margin: 0; border-radius: 0; z-index: 30; transform: translateX(100%); transition: transform .2s ease; }
  .mail.reading .reader { transform: none; }
  .toolbar { padding: 0 8px; overflow-x: auto; }
  .toolbar .btn span { display: none; }
  .toolbar .btn { width: 40px; padding: 0; border: none; margin: 0; }
  .reader-body { padding: 16px 12px; gap: 12px; }
  .reader-body h2 { font-size: 22px; padding: 0 4px; }
  .mcard-head { padding: 12px; flex-wrap: wrap; }
  .mcard-date { width: 100%; padding-left: 54px; margin-top: -6px; }
  .mcard.single .mcard-head { padding: 0 4px 8px; }
  .quick-reply { margin: 0 12px 12px; }
  .compose-backdrop, .modal-backdrop { padding: 0; }
  .compose, .modal { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .compose-head, .compose-fields, .editor, .compose-foot, .compose-files { padding-left: 16px; padding-right: 16px; }
  .editor-bar { padding: 4px 10px; }
  .c-row label { width: 64px; }
  .keys { grid-template-columns: 1fr; }
}
