/* X&M Mail — indeling zoals een moderne webmail, in de huisstijl van X&M Tuinwerken */
@font-face { font-family: 'Archivo'; src: url(/fonts/archivo-latin.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Archivo'; src: url(/fonts/archivo-latin-ext.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1EFF; }
:root {
  --bg: #f3f5f0; --panel: #fff; --ink: #1c2a21; --muted: #5d6a61; --faint: #8a958d; --line: #e3e8e0; --row-read: #f6f8f3;
  --green: #195b2e; --green-2: #2a7a43; --sap: #cfe36b; --pill: #d8e8cd; --hover: #eef3ea; --sel: #e2eed7; --compose: #dcebc4;
  --danger: #b3261e; --r: 16px; --sb: 256px; --hd: 64px;
  --shadow: 0 1px 2px rgba(20, 40, 28, .12), 0 4px 18px rgba(20, 40, 28, .10);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.45 'Archivo', system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
svg { display: block; }
.boot { height: 100vh; display: grid; place-items: center; }
.boot img { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-4px) rotate(-3deg); opacity: .7; } }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- inloggen */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; overflow: auto; height: 100vh; }
.login__card { width: 100%; max-width: 440px; background: var(--panel); border-radius: 28px; padding: 44px 40px 36px; box-shadow: var(--shadow); }
.login__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login__brand img { height: 46px; width: auto; }
.login__brand b { display: block; font-size: 17px; font-weight: 850; text-transform: uppercase; line-height: .95; color: var(--green); }
.login h1 { margin: 0 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.login p { margin: 0 0 28px; color: var(--muted); }
.fld { position: relative; margin-bottom: 18px; }
.fld input { width: 100%; height: 56px; padding: 22px 16px 6px; border: 1.5px solid #c9d2c6; border-radius: 10px; background: #fff; outline: none; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.fld label { position: absolute; left: 16px; top: 17px; color: var(--muted); pointer-events: none; transition: transform .18s, font-size .18s, color .18s; transform-origin: left; }
.fld input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(25, 91, 46, .14); }
.fld input:focus + label, .fld input:not(:placeholder-shown) + label { transform: translateY(-10px); font-size: 12px; color: var(--green); }
.login__err { min-height: 20px; margin: -6px 0 14px; color: var(--danger); font-size: 13.5px; }
.login__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 8px; }
.login__row a { font-size: 14px; font-weight: 600; text-decoration: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--green); color: #fff; font-weight: 650; transition: background-color .2s, box-shadow .2s, transform .1s; }
.btn:hover { background: var(--green-2); box-shadow: 0 2px 8px rgba(25, 91, 46, .3); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn--ghost { background: transparent; color: var(--green); }
.btn--ghost:hover { background: var(--hover); box-shadow: none; }

/* ---------- kader */
.shell { height: 100vh; display: grid; grid-template-rows: var(--hd) 1fr; }
.hd { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); flex: none; transition: background-color .15s; position: relative; }
.icon-btn:hover { background: rgba(28, 42, 33, .07); color: var(--ink); }
.icon-btn:active { background: rgba(28, 42, 33, .12); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn[aria-pressed="true"] { color: #d39b00; }
.icon-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: #3b463e; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 4px; z-index: 30; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; width: calc(var(--sb) - 60px); text-decoration: none; color: var(--ink); flex: none; }
.brand img { height: 36px; width: auto; }
.brand span { font-size: 21px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.brand span b { color: var(--green); font-weight: 800; }
.search { flex: 1; max-width: 720px; height: 48px; display: flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 999px; background: #e7ece3; transition: background-color .2s, box-shadow .2s; }
.search:focus-within { background: #fff; box-shadow: var(--shadow); }
.search input { flex: 1; height: 100%; border: 0; background: transparent; outline: none; font-size: 16px; min-width: 0; }
.search .icon-btn { width: 40px; height: 40px; }
.hd__end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 15px; flex: none; text-transform: uppercase; }
.avatar--lg { width: 40px; height: 40px; font-size: 17px; }
.acct-btn { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; }
.acct-btn:hover { background: rgba(28, 42, 33, .07); }
.body { display: grid; grid-template-columns: var(--sb) 1fr; min-height: 0; }
.shell.collapsed .body { grid-template-columns: 72px 1fr; }
.shell.collapsed .sb .lbl, .shell.collapsed .sb .cnt, .shell.collapsed .compose-btn span { display: none; }
.shell.collapsed .compose-btn { width: 56px; padding: 0; justify-content: center; }

/* ---------- zijbalk */
.sb { overflow-y: auto; padding: 8px 16px 16px 8px; }
.compose-btn { display: inline-flex; align-items: center; gap: 14px; height: 56px; padding: 0 24px 0 18px; margin: 0 0 16px; border: 0; border-radius: 16px; background: var(--compose); color: var(--ink); font-weight: 650; font-size: 14.5px; box-shadow: 0 1px 2px rgba(20, 40, 28, .15); transition: box-shadow .2s, transform .1s, background-color .2s; }
.compose-btn:hover { box-shadow: var(--shadow); background: #d3e6b6; }
.compose-btn:active { transform: scale(.98); }
.compose-btn svg { width: 24px; height: 24px; }
.nav { list-style: none; margin: 0; padding: 0; }
.nav a { display: flex; align-items: center; gap: 16px; height: 34px; padding: 0 12px 0 22px; border-radius: 0 999px 999px 0; margin-left: -8px; color: var(--ink); text-decoration: none; font-size: 14px; transition: background-color .15s; }
.nav a:hover { background: rgba(28, 42, 33, .06); }
.nav a.on { background: var(--pill); font-weight: 750; }
.nav a svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.nav a.on svg { color: var(--ink); }
.nav .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .cnt { font-size: 12.5px; font-weight: 700; }
.sb__h { font-size: 13px; font-weight: 650; color: var(--muted); padding: 16px 0 6px 14px; }

/* ---------- hoofdpaneel */
.main { background: var(--panel); border-radius: var(--r); margin: 0 16px 16px 0; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.tb { display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 8px 0 10px; border-bottom: 1px solid var(--line); flex: none; }
.tb .sp { flex: 1; }
.tb .pg { color: var(--muted); font-size: 12.5px; margin-right: 6px; white-space: nowrap; }
.tb .icon-btn { width: 40px; height: 40px; }
.tb .icon-btn svg { width: 20px; height: 20px; }
.chk { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; cursor: pointer; }
.chk:hover { background: rgba(28, 42, 33, .07); }
.chk input { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; margin: 0; }
.list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.row { display: flex; align-items: center; height: 42px; padding: 0 12px 0 10px; border-bottom: 1px solid var(--line); background: var(--row-read); cursor: pointer; position: relative; transition: box-shadow .12s; }
.row.unread { background: #fff; }
.row.unread .from, .row.unread .subj, .row.unread .dt { font-weight: 750; color: var(--ink); }
.row:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15); z-index: 1; }
.row.sel { background: var(--sel); }
.row .star { width: 34px; height: 34px; }
.row .star svg { width: 19px; height: 19px; }
.row .av { display: none; }
.rmain { display: contents; }
.from { width: 200px; flex: none; padding: 0 12px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.from .n { font-size: 12px; color: var(--faint); font-weight: 400; margin-left: 4px; }
.line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.subj { color: var(--ink); }
.att { width: 18px; height: 18px; color: var(--faint); margin: 0 8px; flex: none; }
.dt { width: 76px; flex: none; text-align: right; font-size: 12.5px; color: var(--muted); }
.qa { display: none; position: absolute; right: 8px; top: 0; bottom: 0; align-items: center; gap: 0; background: inherit; padding-left: 8px; }
.qa .icon-btn { width: 36px; height: 36px; }
.qa .icon-btn svg { width: 18px; height: 18px; }
.row:hover .qa { display: flex; }
.row:hover .dt { visibility: hidden; }
.empty { display: grid; place-items: center; height: 100%; min-height: 260px; text-align: center; color: var(--muted); padding: 40px; }
.empty img { width: 64px; height: auto; opacity: .5; margin: 0 auto 14px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.loadbar { height: 3px; background: linear-gradient(90deg, transparent, var(--green), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: load 1s linear infinite; flex: none; }
@keyframes load { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.skel .row { pointer-events: none; }
.skel i { display: block; height: 10px; border-radius: 6px; background: #e9eee6; }

/* ---------- lezen */
.read { flex: 1; overflow-y: auto; padding: 0 0 40px; }
.read__subj { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 8px 72px; }
.read__subj h1 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.01em; flex: 1; word-break: break-word; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 4px; background: #e8ece6; color: var(--muted); font-size: 12px; vertical-align: 4px; }
.read__meta { display: flex; gap: 14px; padding: 12px 24px 0 18px; align-items: flex-start; }
.read__who { flex: 1; min-width: 0; }
.read__who b { font-weight: 700; }
.read__who .a { color: var(--muted); font-size: 12.5px; }
.read__who .to { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.read__dt { color: var(--muted); font-size: 12.5px; white-space: nowrap; padding-top: 2px; }
.read__body { padding: 16px 24px 0 72px; }
.read__body iframe { width: 100%; border: 0; min-height: 80px; display: block; }
.atts { display: flex; flex-wrap: wrap; gap: 12px; padding: 18px 24px 0 72px; }
.att-card { width: 180px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--ink); background: #fff; transition: box-shadow .2s; position: relative; }
.att-card:hover { box-shadow: var(--shadow); }
.att-card .pv { height: 110px; background: #eef2eb center/cover no-repeat; display: grid; place-items: center; color: var(--faint); }
.att-card .pv svg { width: 34px; height: 34px; }
.att-card .nm { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12.5px; }
.att-card .nm span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-card .dl { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .92); display: grid; place-items: center; color: var(--ink); opacity: 0; transition: opacity .2s; }
.att-card:hover .dl { opacity: 1; }
.read__acts { display: flex; gap: 10px; padding: 26px 24px 0 72px; flex-wrap: wrap; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 20px 0 14px; border: 1px solid #c4cdc1; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; transition: background-color .15s, box-shadow .15s; }
.pill-btn:hover { background: var(--hover); }
.pill-btn svg { width: 18px; height: 18px; }

/* ---------- opstellen */
.cmp { position: fixed; right: 24px; bottom: 0; width: 560px; max-width: calc(100vw - 32px); height: min(620px, calc(100vh - 80px)); background: #fff; border-radius: 12px 12px 0 0; box-shadow: 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12), 0 5px 5px -3px rgba(0, 0, 0, .2); display: flex; flex-direction: column; z-index: 50; animation: up .25s cubic-bezier(.2, .7, .2, 1); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.cmp.min { height: 44px; }
.cmp.min .cmp__in { display: none; }
.cmp.max { right: 50%; transform: translateX(50%); width: min(1000px, 90vw); height: 86vh; bottom: 7vh; border-radius: 12px; animation: none; }
.cmp__hd { display: flex; align-items: center; height: 44px; padding: 0 6px 0 16px; background: #eef2ea; border-radius: 12px 12px 0 0; font-weight: 650; cursor: pointer; flex: none; }
.cmp__hd span { flex: 1; }
.cmp__hd .icon-btn { width: 32px; height: 32px; }
.cmp__hd .icon-btn svg { width: 18px; height: 18px; }
.cmp__in { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cmp__f { display: flex; align-items: center; border-bottom: 1px solid var(--line); margin: 0 16px; min-height: 40px; }
.cmp__f label { color: var(--muted); width: 88px; flex: none; }
.cmp__f input { flex: 1; border: 0; outline: none; height: 38px; background: transparent; min-width: 0; }
.cmp__f .ccb { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 4px 6px; }
.cmp__f .ccb:hover { text-decoration: underline; }
.cmp__ed { flex: 1; overflow-y: auto; padding: 12px 16px; outline: none; font-size: 14.5px; line-height: 1.55; }
.cmp__ed blockquote { margin: 8px 0 0 6px; padding-left: 12px; border-left: 2px solid #ccd5c8; color: var(--muted); }
.cmp__fmt { display: flex; gap: 2px; padding: 0 12px; flex: none; }
.cmp__fmt .icon-btn { width: 34px; height: 34px; }
.cmp__fmt .icon-btn svg { width: 18px; height: 18px; }
.cmp__atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 8px; flex: none; }
.cmp__atts:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 12px; border-radius: 8px; background: #eef2ea; font-size: 13px; max-width: 240px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip small { color: var(--muted); }
.chip button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 16px; }
.chip button:hover { background: rgba(0, 0, 0, .08); }
.cmp__ft { display: flex; align-items: center; gap: 4px; padding: 10px 12px 12px 16px; flex: none; }
.cmp__ft .sp { flex: 1; }
.cmp__ft .btn { padding: 0 26px; }

/* ---------- menu's, toast */
.pop { position: fixed; z-index: 60; background: #fff; border-radius: 20px; box-shadow: 0 4px 24px rgba(20, 40, 28, .22); padding: 16px; width: 340px; max-width: calc(100vw - 24px); animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(-6px); } }
.pop__acc { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 12px; text-align: left; }
.pop__acc:hover { background: var(--hover); }
.pop__acc.on { background: var(--sel); }
.pop__acc small { display: block; color: var(--muted); font-size: 12px; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.pop .pop__link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 12px; color: var(--ink); font-weight: 600; text-align: left; }
.pop .pop__link:hover { background: var(--hover); }
.pop .pop__link svg { width: 20px; height: 20px; color: var(--muted); }
#toast { position: fixed; left: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 16px; min-width: 260px; max-width: 520px; padding: 13px 16px 13px 20px; border-radius: 8px; background: #2c362f; color: #eef3ea; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); pointer-events: auto; animation: up .25s cubic-bezier(.2, .7, .2, 1); }
.toast.err { background: #5c1f1a; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(15, 25, 18, .35); animation: fade .2s; }
.fab { display: none; }

/* ---------- gsm */
@media (max-width: 860px) {
  :root { --hd: 64px; }
  .brand { display: none; }
  .hd { padding: 8px 12px; }
  .search { max-width: none; height: 48px; background: #e7ece3; }
  .search .menu-in { display: grid; }
  .hd > .menu-out { display: none; }
  .hd__end { display: none; }
  .search .acct-btn { display: grid; }
  .body { grid-template-columns: 1fr; }
  .sb { position: fixed; left: 0; top: 0; bottom: 0; width: 300px; max-width: 86vw; background: #fff; z-index: 45; transform: translateX(-105%); transition: transform .28s cubic-bezier(.2, .7, .2, 1); padding: 16px 12px 16px 0; box-shadow: var(--shadow); }
  .shell.drawer .sb { transform: none; }
  .sb .compose-btn { display: none; }
  .sb__brand { display: flex !important; align-items: center; gap: 10px; padding: 4px 20px 18px; font-size: 20px; font-weight: 600; }
  .sb__brand img { height: 32px; }
  .main { margin: 0; border-radius: 0; }
  .tb { padding: 0 4px; }
  .row { height: auto; min-height: 76px; align-items: flex-start; padding: 12px 14px 12px 10px; flex-wrap: wrap; background: #fff; }
  .row.unread .from { font-weight: 800; }
  .row .chk { display: none; }
  .row .av { display: grid; margin: 2px 12px 0 2px; }
  .row .rmain { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; }
  .row .from { width: auto; padding: 0; font-size: 15px; }
  .row .dt { width: auto; font-size: 12px; padding-top: 2px; }
  .row .line { grid-column: 1 / -1; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .row .line .sep { display: none; }
  .row .line .subj { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .row .star { position: absolute; right: 6px; bottom: 6px; }
  .row .att { position: absolute; right: 44px; bottom: 14px; }
  .row:hover { box-shadow: none; }
  .row:hover .qa { display: none; }
  .row:hover .dt { visibility: visible; }
  .row.sel { background: var(--sel); }
  .read__subj { padding: 16px 16px 6px; }
  .read__subj h1 { font-size: 20px; }
  .read__meta { padding: 12px 16px 0; }
  .read__body, .atts, .read__acts { padding-left: 16px; padding-right: 16px; }
  .att-card { width: calc(50% - 6px); }
  .fab { display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; align-items: center; gap: 12px; height: 56px; padding: 0 20px 0 16px; border: 0; border-radius: 16px; background: var(--compose); font-weight: 650; box-shadow: 0 3px 5px -1px rgba(0, 0, 0, .2), 0 6px 10px 0 rgba(0, 0, 0, .14); }
  .fab svg { width: 24px; height: 24px; }
  .cmp, .cmp.max { right: 0; left: 0; bottom: 0; top: 0; width: 100%; max-width: none; height: 100%; border-radius: 0; transform: none; }
  .cmp__hd { border-radius: 0; }
  #toast { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; }
}
@media (min-width: 861px) { .search .menu-in, .search .acct-btn { display: none; } .sb__brand { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .cmp, .toast, .pop { animation: none; } .sb { transition: none; } }
.att-card .nm svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.att-card .nm small { color: var(--muted); flex: none; }
@media (max-width: 860px) {
  .row .from { grid-column: 1; grid-row: 1; }
  .row .dt { grid-column: 2; grid-row: 1; }
  .row .line { grid-row: 2; padding-right: 34px; }
}
