:root {
  --bg: #f5f3ee;
  --card: #ffffff;
  --ink: #141413;
  --ink-2: #5f5d57;
  --ink-3: #9a978e;
  --line: rgba(20, 20, 19, .08);
  --line-2: rgba(20, 20, 19, .16);
  --dark: #141413;
  --on-dark: #f5f3ee;
  --accent: #d4ff4f;          /* lime: het knipoogje */
  --accent-ink: #1f2a00;
  --wait: #f2a93b;  --wait-bg: rgba(242, 169, 59, .14);
  --me: #7b6cf6;    --me-bg: rgba(123, 108, 246, .13);
  --stuck: #e5534b; --stuck-bg: rgba(229, 83, 75, .12);
  --done: #2f9e6e;  --done-bg: rgba(47, 158, 110, .12);
  --muted-bg: rgba(20, 20, 19, .05);
  --radius: 22px;
  --serif: "New York", ui-serif, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0d; --card: #1a1a18; --ink: #f2f0ea; --ink-2: #aaa79f; --ink-3: #6f6d67;
    --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .14);
    --dark: #f2f0ea; --on-dark: #141413; --muted-bg: rgba(255, 255, 255, .06);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--me); outline-offset: 2px; border-radius: 10px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 18px 18px 120px; }

/* ---------- Kop ---------- */
.top { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.mark { width: 30px; height: 30px; border-radius: 10px; background: var(--dark); display: grid; place-items: center; }
.mark i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); display: block; animation: blink 6s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.icon-btn { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); transition: transform .2s var(--ease); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }

.hello { font-family: var(--serif); font-size: clamp(30px, 8vw, 42px); line-height: 1.08; letter-spacing: -.02em; margin: 4px 0 6px; font-weight: 500; }
.hello em { font-style: italic; color: var(--ink-2); }
.sub { color: var(--ink-2); margin: 0 0 22px; }

/* ---------- Tellers ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 14px 12px; text-align: left; transition: transform .25s var(--ease), border-color .2s; }
.stat:active { transform: scale(.97); }
.stat.on { border-color: var(--ink); }
.stat .n { font-family: var(--serif); font-size: 32px; line-height: 1; letter-spacing: -.02em; }
.stat .l { font-size: 13px; color: var(--ink-2); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.wait { background: var(--wait); } .dot.me { background: var(--me); } .dot.stuck { background: var(--stuck); } .dot.done { background: var(--done); }
.stat.hero { background: var(--dark); color: var(--on-dark); border-color: transparent; }
.stat.hero .l { color: color-mix(in srgb, var(--on-dark) 70%, transparent); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -18px 6px; padding-left: 18px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; transition: all .2s var(--ease); }
.chip.on { background: var(--dark); color: var(--on-dark); border-color: transparent; }
.search { width: 100%; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); margin-bottom: 14px; outline: none; }
.search:focus { border-color: var(--line-2); }

/* ---------- Kaarten ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; text-align: left; width: 100%;
  transition: transform .35s var(--ease), opacity .35s var(--ease), box-shadow .2s; animation: rise .45s var(--ease) both; touch-action: pan-y; }
.card:hover { box-shadow: 0 6px 24px rgba(0, 0, 0, .05); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card.leaving { opacity: 0; transform: translateX(110%) rotate(4deg); }
.card.leaving.left { transform: translateX(-110%) rotate(-4deg); }
.card .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.badge.wacht_op_akkoord { background: var(--wait-bg); color: color-mix(in srgb, var(--wait) 75%, var(--ink)); }
.badge.actie_remco { background: var(--me-bg); color: color-mix(in srgb, var(--me) 80%, var(--ink)); }
.badge.vastgelopen { background: var(--stuck-bg); color: color-mix(in srgb, var(--stuck) 80%, var(--ink)); }
.badge.afgehandeld { background: var(--done-bg); color: color-mix(in srgb, var(--done) 80%, var(--ink)); }
.badge.genegeerd, .badge.bezig, .badge.nieuw { background: var(--muted-bg); color: var(--ink-2); }
.badge.wacht_op_akkoord .dot { background: var(--wait); } .badge.actie_remco .dot { background: var(--me); } .badge.vastgelopen .dot { background: var(--stuck); } .badge.afgehandeld .dot { background: var(--done); }
.badge.bezig .dot { animation: pulse 1s infinite; background: var(--ink-3); }
@keyframes pulse { 50% { opacity: .2; } }
.meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.card .cat { font-size: 12px; color: var(--ink-3); margin-top: 10px; display: flex; gap: 10px; align-items: center; }
.swipe-hint { position: absolute; inset: 0; border-radius: var(--radius); display: flex; align-items: center; padding: 0 22px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .15s; }
.swipe-hint.r { background: var(--accent); color: var(--accent-ink); justify-content: flex-start; }
.swipe-hint.l { background: var(--me-bg); color: var(--me); justify-content: flex-end; }

/* ---------- Leeg ---------- */
.empty { text-align: center; padding: 56px 20px; }
.empty .big { font-size: 56px; animation: float 3s ease-in-out infinite; display: inline-block; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-4deg); } }
.empty h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 10px 0 4px; }
.empty p { color: var(--ink-2); margin: 0; }

/* ---------- Detail (sheet) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 10, 9, .35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 20; animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0;
  padding: 10px 20px calc(28px + env(safe-area-inset-bottom)); animation: up .4s var(--ease) both; overscroll-behavior: contain; }
@media (min-width: 900px) { .sheet { left: auto; top: 0; width: 520px; max-height: none; border-radius: 28px 0 0 28px; animation-name: side; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes side { from { transform: translateX(100%); } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 14px; }
.sheet h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.15; letter-spacing: -.01em; margin: 10px 0 6px; }
.sheet .from { color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; }
.box h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.box p { margin: 0; }
.claude-says { display: flex; gap: 10px; }
.claude-says .av { width: 28px; height: 28px; border-radius: 9px; background: var(--dark); flex: none; display: grid; place-items: center; }
.claude-says .av i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.warn { background: var(--stuck-bg); color: color-mix(in srgb, var(--stuck) 85%, var(--ink)); border-radius: 12px; padding: 10px 12px; margin-top: 10px; font-size: 14px; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.steps .ck { width: 20px; height: 20px; border-radius: 7px; border: 1.5px solid var(--line-2); flex: none; margin-top: 1px; display: grid; place-items: center; font-size: 12px; }
.steps .ck.done { background: var(--done); border-color: var(--done); color: #fff; }
details summary { cursor: pointer; color: var(--ink-2); font-size: 14px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
.mailbody { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); margin-top: 10px; max-height: 300px; overflow: auto; }
.att { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; background: var(--muted-bg); padding: 6px 10px; border-radius: 10px; margin: 8px 6px 0 0; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field label { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.field select, .field input, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 12px; outline: none; }
.field textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.field select:focus, .field input:focus, .field textarea:focus { border-color: var(--line-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }
.sigprev { white-space: pre-wrap; font-size: 13px; color: var(--ink-3); border-left: 2px solid var(--line-2); padding-left: 10px; margin: 2px 0 12px; }

.actions { position: sticky; bottom: calc(-28px - env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 4px; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 8px; }
.actions .btn { padding: 14px 10px; white-space: nowrap; }
.btn { padding: 14px 16px; border-radius: 16px; font-weight: 600; font-size: 15px; background: var(--card); border: 1px solid var(--line); transition: transform .15s var(--ease), opacity .2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--dark); color: var(--on-dark); border-color: transparent; }
.btn.lime { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.small { padding: 9px 12px; font-size: 14px; border-radius: 12px; }
.btn[disabled] { opacity: .5; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline .who { font-weight: 600; }
.timeline .when { color: var(--ink-3); font-size: 12px; }
.timeline .det { color: var(--ink-2); font-size: 13px; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px; max-width: 440px; margin: 0 auto; }
.login .mark { width: 64px; height: 64px; border-radius: 22px; margin-bottom: 28px; }
.login .mark i { width: 22px; height: 22px; }
.login h1 { font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.05; letter-spacing: -.02em; margin: 0 0 10px; }
.login p { color: var(--ink-2); margin: 0 0 28px; }
.login .btn { width: 100%; padding: 16px; font-size: 16px; }
.login input { width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); margin-bottom: 12px; outline: none; }
.fine { font-size: 13px; color: var(--ink-3); margin-top: 16px; text-align: center; }

/* ---------- Toast & confirm ---------- */
#toast { transition: transform .4s var(--ease), opacity .3s; position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 200%); opacity: 0; background: var(--dark); color: var(--on-dark); padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 500;
  z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast:empty { display: none; }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(10, 10, 9, .4); animation: fade .2s both; }
.modal .in { background: var(--bg); border-radius: 24px; padding: 22px; width: 100%; max-width: 380px; animation: pop .3s var(--ease) both; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0 0 6px; }
.modal p { color: var(--ink-2); margin: 0 0 16px; font-size: 15px; }
.modal textarea { width: 100%; min-height: 90px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 10px 12px; margin-bottom: 14px; outline: none; }
.modal .btnrow .btn { flex: 1; }

.install { background: var(--dark); color: var(--on-dark); border-radius: 18px; padding: 14px 16px; margin-bottom: 16px; font-size: 14px; display: flex; gap: 12px; align-items: center; }
.install b { color: var(--accent); }
.install button { margin-left: auto; color: var(--on-dark); opacity: .6; font-size: 20px; }

.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.live .dot { background: var(--done); box-shadow: 0 0 0 0 rgba(47, 158, 110, .5); animation: ring 2s infinite; }
.live.off .dot { background: var(--ink-3); animation: none; }
@keyframes ring { 70% { box-shadow: 0 0 0 7px rgba(47, 158, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 158, 110, 0); } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: drop 1.4s var(--ease) forwards; }
@keyframes drop { to { transform: translateY(105vh) rotate(540deg); opacity: .8; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Skills ---------- */
.pill { position: absolute; top: -5px; right: -5px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
.propbanner { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--accent); color: var(--accent-ink); border-radius: 16px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; text-align: left; animation: rise .45s var(--ease) both; }
.propbanner .arrow { margin-left: auto; font-weight: 700; }
.skillbox { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); }
.skillhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.skilltag { font-size: 14px; background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--ink); padding: 4px 10px; border-radius: 999px; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: flex; gap: 10px; font-size: 14px; }
.checks li div { display: flex; flex-direction: column; }
.checks li span:not(.cdot) { color: var(--ink-2); font-size: 13px; }
.cdot { width: 22px; height: 22px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--muted-bg); color: var(--ink-3); }
.ck-ok .cdot { background: var(--done-bg); color: var(--done); }
.ck-let_op .cdot { background: var(--wait-bg); color: var(--wait); }
.ck-stop .cdot { background: var(--stuck-bg); color: var(--stuck); }
.prop, .skillrow { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.prop:first-of-type, .skillrow:first-of-type { border-top: 0; padding-top: 2px; }
.skillrow { flex-direction: row; justify-content: space-between; gap: 12px; }
.skillrow p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.skillstats { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.skillstats .hot { background: var(--wait-bg); color: color-mix(in srgb, var(--wait) 75%, var(--ink)); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.skilltext { white-space: pre-wrap; font-size: 12.5px; line-height: 1.5; max-height: 400px; overflow: auto; background: var(--bg); border-radius: 12px; padding: 12px; margin-top: 10px; }
.ev { font-size: 14px; margin: 4px 0; }
.testsum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.testsum div { background: var(--bg); border-radius: 12px; padding: 10px; font-size: 12px; color: var(--ink-2); }
.testsum .n { display: block; font-family: var(--serif); font-size: 26px; color: var(--ink); line-height: 1.1; }
.testrow { border-top: 1px solid var(--line); padding: 10px 0; font-size: 14px; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; font-size: 13px; }
.ba .lbl { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-right: 6px; }
.ba .lbl.new { color: var(--done); }
.diff { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.55; border-radius: 12px; overflow: hidden; background: var(--bg); }
.diff > div { padding: 1px 10px; white-space: pre-wrap; word-break: break-word; }
.diff span { display: inline-block; width: 14px; color: var(--ink-3); }
.d-add { background: var(--done-bg); }
.d-del { background: var(--stuck-bg); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--stuck) 50%, transparent); }
.d-skip { color: var(--ink-3); text-align: center; }

/* Filter per mailbox */
.filters.mbs { margin-top: -4px; align-items: center; }
.mblabel { font-size: 15px; padding-right: 2px; }
.chip .cnt { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--accent, #d4ff4f); color: #111; font-size: 12px; font-weight: 600; text-align: center; }
.mbselect { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; }
.mbselect select { flex: 1; padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: inherit; font-size: 15px; }

/* Koppelingen */
.conn { padding: 4px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.conn-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.conn-form { display: flex; gap: 8px; }
.conn-form input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: inherit; font-size: 15px; }
.hint { white-space: normal; margin-top: 8px; line-height: 1.4; }
.conn-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.conn-row:last-child { border-bottom: 0; }
.conn-txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--line); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 6px 0 10px; }
.adv summary { cursor: pointer; font-size: 14px; color: var(--ink-3); margin: 6px 0; }
.keybox { font-family: ui-monospace, Menlo, monospace; font-size: 11px; word-break: break-all; background: var(--muted-bg); padding: 10px; border-radius: 10px; user-select: all; }
.tag.new { background: var(--accent); color: var(--accent-ink); }
.tag.err { background: #ffd9d4; color: #8a1c0c; }
.conn-row .btn { flex: none; }
.field label.chip { display: inline-flex; align-items: center; width: auto; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--ink); margin: 0; }
.field label.chip input { width: auto; padding: 0; margin: 0 6px 0 0; border: 0; }
a.btn { color: inherit; text-decoration: none; display: inline-flex; align-items: center; }

.logbox { font-family: ui-monospace, Menlo, monospace; font-size: 11px; line-height: 1.45; background: var(--muted-bg); border-radius: 12px; padding: 10px; max-height: 60vh; overflow: auto; }
.ll { padding: 2px 0; border-bottom: 1px solid var(--line); word-break: break-word; }
.ll span { color: var(--ink-3); }
.ll.error { color: #b3261e; }
.formerr { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #ffe4df; color: #8a1c0c; font-size: 14px; line-height: 1.4; }
#toast { z-index: 50; }

/* Wachtrij voor uitvoeren */
.badge.uitvoeren { background: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-ink); }
.badge.uitvoeren .dot { background: var(--accent-ink); }
.queuebox { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--accent) 30%, var(--card)); font-size: 14px; line-height: 1.45; }
a.att { color: inherit; text-decoration: none; }

/* Detail: kort bovenaan, details ingeklapt */
.toprow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2.headline { font-size: 26px; line-height: 1.2; margin: 12px 0 6px; }
.notebox { display: flex; gap: 8px; margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: var(--me-bg); font-size: 14px; }
.box.doing h4 { margin-bottom: 8px; }
ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
ol.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 15px; line-height: 1.4; border-bottom: 1px solid var(--line); }
ol.steps li:last-child { border-bottom: 0; }
ol.steps li.done span:last-child { color: var(--ink-3); text-decoration: line-through; }
.actions.main { display: flex; gap: 10px; margin: 4px 0 14px; }
.actions.main .btn.big { flex: 1; padding: 15px 12px; font-size: 16px; }
.actions.minor { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
details.more > summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: '›'; float: right; transition: transform .2s; color: var(--ink-3); }
details.more[open] > summary::after { transform: rotate(90deg); }
details.more[open] > summary { margin-bottom: 12px; }
.actions.main, .actions.minor { position: static; background: none; box-shadow: none; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.actions.minor { margin: 10px 0 4px; }

/* Chat */
.chat-sheet { display: flex; flex-direction: column; height: 92dvh; }
@media (min-width: 900px) { .chat-sheet { height: 100dvh; } }
.chat-head { display: flex; justify-content: space-between; align-items: center; }
.chat-log { flex: 1; overflow-y: auto; padding: 8px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 88%; padding: 11px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--dark); color: var(--on-dark); border-bottom-right-radius: 6px; }
.bubble.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble .li { display: block; padding-left: 4px; }
.bubble .lookups { margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.bubble.thinking { color: var(--ink-3); font-size: 14px; }
.dots { display: inline-flex; gap: 3px; margin-right: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.chat-empty { text-align: center; margin: auto 0; padding: 20px 6px; color: var(--ink-2); }
.chat-empty .big { font-size: 40px; }
.chat-ex { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; align-items: center; }
.chat-ex .chip { white-space: normal; text-align: left; }
.chat-in { display: flex; gap: 8px; align-items: flex-end; padding-top: 8px; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.chat-in textarea { flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 18px; padding: 11px 14px; background: var(--card); font-size: 16px; line-height: 1.4; max-height: 140px; }
.chat-in .btn { width: 46px; height: 46px; border-radius: 50%; padding: 0; font-size: 20px; }

.bubble .tbl { overflow-x: auto; margin: 8px 0; }
.bubble table { border-collapse: collapse; font-size: 13px; width: 100%; }
.bubble th, .bubble td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bubble th { font-weight: 600; color: var(--ink-2); }

/* ================= Mail-look (zoals Mail op de iPhone) ================= */
:root { --mbg: #ffffff; --blue: #007aff; --sep: rgba(60, 60, 67, .18); --glass: rgba(249, 249, 249, .82); --gray: #8a8a8e; }
@media (prefers-color-scheme: dark) { :root { --mbg: #000; --blue: #0a84ff; --sep: rgba(84, 84, 88, .55); --glass: rgba(28, 28, 30, .82); --gray: #8d8d93; } }
body { background: var(--mbg); }
body.noscroll { overflow: hidden; }
.mailapp { max-width: 760px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 8px) 0 calc(96px + env(safe-area-inset-bottom)); }
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 16px; }
.navbar.sticky { position: sticky; top: 0; z-index: 5; background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); padding-top: calc(env(safe-area-inset-top) + 6px); }
.navright { display: flex; gap: 10px; align-items: center; }
.circle { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--glass); box-shadow: 0 1px 6px rgba(0,0,0,.08), inset 0 0 0 .5px var(--sep); display: grid; place-items: center; color: var(--ink); font-size: 20px; cursor: pointer; backdrop-filter: blur(20px); }
.circle svg { width: 22px; height: 22px; }
.circle.on { background: var(--blue); color: #fff; }
.circle .pill { position: absolute; top: -4px; right: -4px; }
.pillbtn { height: 44px; padding: 0 16px; border-radius: 22px; border: 0; background: var(--glass); box-shadow: 0 1px 6px rgba(0,0,0,.08), inset 0 0 0 .5px var(--sep); font-weight: 600; font-size: 16px; color: var(--ink); cursor: pointer; }
.bigtitle { font-family: var(--sans); font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 14px 20px 0; line-height: 1.1; }
.subtitle { color: var(--gray); font-size: 15px; margin: 4px 20px 10px; }
.betsiebar { display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); margin: 6px 16px 8px; padding: 12px 14px; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--accent) 55%, var(--mbg)); color: var(--accent-ink); font-size: 15px; text-align: left; cursor: pointer; }
.betsiebar .arrow { margin-left: auto; font-size: 20px; }
.mlist { border-top: .5px solid var(--sep); }
.mrow { position: relative; overflow: hidden; cursor: pointer; }
.mrow .mfront { position: relative; display: flex; gap: 6px; padding: 12px 16px 12px 8px; background: var(--mbg); transition: transform .25s var(--ease); z-index: 1; }
.mrow .mfront::after { content: ''; position: absolute; left: 34px; right: 0; bottom: 0; border-bottom: .5px solid var(--sep); }
.mrow .udot { width: 11px; height: 11px; border-radius: 50%; margin: 6px 6px 0 6px; flex: none; }
.mrow.unread .udot { background: var(--blue); }
.mbody { flex: 1; min-width: 0; }
.l1 { display: flex; align-items: baseline; gap: 6px; }
.l1 .from { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l1 .time { color: var(--gray); font-size: 15px; white-space: nowrap; }
.l1 .chev { color: #c4c4c7; font-size: 20px; line-height: 1; }
.subj { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.mrow:not(.unread) .from { font-weight: 600; }
.prev { color: var(--gray); font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 1px; }
.mbx { color: var(--gray); font-size: 12px; margin-top: 3px; }
.bl { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 13px; background: var(--muted-bg); }
.bl .bt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bl .bs { flex: none; font-weight: 600; opacity: .8; }
.bl.wacht_op_akkoord { background: color-mix(in srgb, var(--accent) 50%, var(--mbg)); color: var(--accent-ink); }
.bl.vastgelopen { background: var(--stuck-bg); color: color-mix(in srgb, var(--stuck) 80%, var(--ink)); }
.bl.uitvoeren, .bl.bezig { background: var(--me-bg); }
.swipe-bg { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 22px; color: #fff; font-weight: 600; font-size: 15px; z-index: 0; }
.swipe-bg.l { right: 0; left: 0; justify-content: flex-end; background: #a259ff; opacity: 0; }
.swipe-bg.r { left: 0; right: 0; justify-content: flex-start; background: var(--blue); opacity: 0; }
.mrow.sl .swipe-bg.l, .mrow.sr .swipe-bg.r { opacity: 1; }
.mrow.leaving { transition: max-height .3s, opacity .3s; max-height: 0; opacity: 0; }
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; gap: 10px; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; }
.searchpill { flex: 1; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 24px; background: var(--glass); box-shadow: 0 1px 6px rgba(0,0,0,.08), inset 0 0 0 .5px var(--sep); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: var(--gray); }
.searchpill svg { width: 20px; height: 20px; flex: none; }
.searchpill input { flex: 1; border: 0; background: none; outline: none; font-size: 17px; color: var(--ink); min-width: 0; }
.bottombar .circle { width: 48px; height: 48px; }
/* Postvakken */
.boxes-sheet h4.sect { margin: 18px 4px 6px; font-size: 20px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink); }
.boxgroup { background: var(--card); border-radius: 12px; overflow: hidden; }
.boxrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-bottom: .5px solid var(--sep); background: none; font-size: 17px; color: var(--ink); text-align: left; cursor: pointer; }
.boxrow:last-child { border-bottom: 0; }
.boxrow.on { background: var(--muted-bg); }
.boxrow .bi { width: 26px; text-align: center; color: var(--blue); }
.boxrow .bl2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boxrow .bn { color: var(--gray); }
.boxrow .chev { color: #c4c4c7; font-size: 20px; }
.menu { display: flex; flex-direction: column; background: var(--card); border-radius: 12px; overflow: hidden; }
.menu button { padding: 15px 16px; border: 0; border-bottom: .5px solid var(--sep); background: none; text-align: left; font-size: 17px; color: var(--ink); cursor: pointer; }
.menu button:last-child { border-bottom: 0; }
.pill.inline { position: static; margin-left: 6px; }
/* Mail openen */
.page { position: fixed; inset: 0; z-index: 15; background: var(--mbg); overflow-y: auto; -webkit-overflow-scrolling: touch; animation: pagein .25s var(--ease); }
@keyframes pagein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.pagebody { max-width: 760px; margin: 0 auto; padding: 4px 16px calc(100px + env(safe-area-inset-bottom)); }
.backlink { display: flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--blue); font-size: 17px; padding: 8px 0; cursor: pointer; }
.backlink svg { width: 24px; height: 24px; }
.betsiecard { border-radius: 18px; padding: 14px 16px; margin: 6px 0 16px; background: color-mix(in srgb, var(--accent) 18%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.betsiecard.vastgelopen { background: color-mix(in srgb, var(--stuck) 8%, var(--card)); box-shadow: inset 0 0 0 1px var(--stuck-bg); }
.bc-top { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.bc-top .badge { margin-left: auto; }
.betsiecard h2.headline { font-family: var(--sans); font-size: 21px; font-weight: 700; line-height: 1.25; margin: 10px 0 8px; letter-spacing: -.01em; }
.betsiecard h4.doing { margin: 12px 0 4px; font-size: 13px; }
.betsiecard .queuebox, .betsiecard .notebox { display: flex; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--card); font-size: 14px; margin: 8px 0; }
.draftlink { display: flex; align-items: center; width: 100%; margin: 10px 0 4px; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--card); font-size: 15px; color: var(--ink); text-align: left; cursor: pointer; }
.draftlink .arrow { margin-left: auto; color: var(--gray); font-size: 20px; }
.bc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.bc-actions .btn { flex: 1 1 auto; padding: 12px 14px; }
.betsiecard details.more { margin-top: 10px; }
.mailview { padding: 4px 0 10px; }
.mv-head { display: flex; gap: 12px; align-items: flex-start; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(#a8adb8, #858b97); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 16px; flex: none; }
.mv-who { flex: 1; min-width: 0; }
.mv-l1 { display: flex; justify-content: space-between; gap: 8px; font-size: 17px; }
.mv-who .meta { white-space: normal; overflow-wrap: anywhere; }
.mv-subj { font-size: 20px; font-weight: 700; margin: 16px 0 10px; line-height: 1.3; }
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mv-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.5; }
.logbox2 { margin-top: 18px; }
.mailtools { position: fixed; left: 0; right: 0; bottom: 0; z-index: 16; display: flex; justify-content: space-around; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep); }
.mailtools button { border: 0; background: none; color: var(--blue); padding: 6px 14px; cursor: pointer; }
.mailtools svg { width: 26px; height: 26px; }
/* Keuzemenu */
.actsheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.3); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.as-in { width: 100%; max-width: 520px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.as-group, .as-cancel { background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 14px; overflow: hidden; }
.as-group button, .as-cancel { display: block; width: 100%; padding: 17px; border: 0; border-bottom: .5px solid var(--sep); background: none; color: var(--blue); font-size: 19px; cursor: pointer; }
.as-group button:last-child { border-bottom: 0; }
.as-cancel { margin-top: 8px; font-weight: 600; border: 0; }
/* Opstellen */
.compose-sheet { padding-top: 10px; }
.cm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.linkbtn { border: 0; background: none; color: var(--blue); font-size: 17px; cursor: pointer; padding: 6px 0; }
.sendbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 20px; font-weight: 700; cursor: pointer; }
.sendbtn:disabled { opacity: .4; }
.cm-fields { border-top: .5px solid var(--sep); }
.cm-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: .5px solid var(--sep); font-size: 16px; }
.cm-row span { color: var(--gray); flex: none; }
.cm-row input, .cm-row select { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; color: var(--ink); }
.cm-body { width: 100%; min-height: 34vh; border: 0; outline: none; background: none; resize: vertical; font-size: 16px; line-height: 1.5; padding: 12px 0; color: var(--ink); }
.cm-sig select { border: 0; background: var(--muted-bg); border-radius: 10px; padding: 6px 10px; font-size: 14px; color: var(--ink); }
.cm-sig .sigprev { margin-top: 8px; }
.cm-quote { margin-top: 12px; padding-left: 10px; border-left: 2px solid var(--sep); color: var(--gray); font-size: 14px; white-space: pre-wrap; max-height: 30vh; overflow: auto; }
.empty { text-align: center; padding: 60px 20px; }
.searchpill { min-width: 0; }
.bottombar { background: linear-gradient(to bottom, transparent, var(--mbg) 45%); }
.bottombar .circle { flex: none; }
.sheet h2 { font-family: var(--sans); font-weight: 700; letter-spacing: -.01em; }
