:root {
  --bg: #0c0c0d;
  --panel: #121214;
  --panel-2: #18181b;
  --line: #26262b;
  --line-2: #33333a;
  --text: #ebe8e1;
  --muted: #8d8b85;
  --red: #ff3b2f;
  --red-dim: rgba(255, 59, 47, .14);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --side-w: 248px;
  --list-w: 400px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--text);
  font: 14px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body.booting #app, body.booting #login { visibility: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--red); }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- merk ---------- */
.brand {
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
}
.brand .r, .brand .slash { color: var(--red); }
.brand.big { font-size: clamp(34px, 9vw, 52px); }

/* ---------- knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.btn.primary:hover { background: #ff5247; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: wait; }
.icon-btn {
  width: 38px; height: 38px; flex: none;
  border: 1px solid transparent; background: transparent; cursor: pointer;
  font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--line-2); }
.link-btn {
  background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--muted);
  text-align: left;
}
.link-btn:hover { color: var(--text); }

/* ---------- login ---------- */
#login { height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.field input {
  background: var(--panel); border: 1px solid var(--line-2); padding: 12px 14px; font-size: 16px;
}
.field input:focus { border-color: var(--red); outline: none; }
.error { color: var(--red); min-height: 1.5em; margin: 0; }

/* ---------- app-raster ---------- */
#app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--side-w) var(--list-w) 1fr;
}

#side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px;
  padding: calc(18px + var(--safe-t)) 14px calc(14px + var(--safe-b));
  min-height: 0;
}
.side-head { display: flex; align-items: center; justify-content: space-between; min-height: 38px; }
#accountSelect {
  background: var(--panel-2); border: 1px solid var(--line-2); padding: 8px;
}
#folders { flex: 1; overflow-y: auto; margin: 0 -14px; padding: 4px 0; }
.folder {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 14px; border: 0; background: none; cursor: pointer; text-align: left;
  color: var(--muted); border-left: 2px solid transparent;
}
.folder:hover { color: var(--text); background: rgba(255,255,255,.03); }
.folder.active { color: var(--text); border-left-color: var(--red); background: var(--red-dim); }
.folder .num { color: var(--red); font-size: 11px; width: 18px; flex: none; }
.folder .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .count { font-size: 12px; font-weight: 700; color: var(--text); }
.folder.drop { outline: 1px dashed var(--red); }
.side-foot { display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin: 2px 0 6px; }

/* ---------- lijst ---------- */
#listPane {
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: rgba(12,12,13,.86);
  position: relative;
}
.pane-head {
  display: flex; align-items: center; gap: 8px;
  padding: calc(12px + var(--safe-t)) 14px 12px;
  border-bottom: 1px solid var(--line);
  min-height: 62px;
}
.pane-head h1, .pane-head h2 {
  flex: 1; margin: 0;
  font-family: var(--display); font-weight: 900; font-size: 28px; letter-spacing: .01em;
  text-transform: uppercase; line-height: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search {
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line); padding: 0 14px;
}
.search .prompt { color: var(--red); font-weight: 700; }
.search input {
  flex: 1; background: none; border: 0; padding: 12px 0; outline: none; min-width: 0;
}
.search input::-webkit-search-cancel-button { filter: invert(1); }

.list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.msg {
  display: grid; grid-template-columns: 10px 1fr auto; column-gap: 10px; row-gap: 2px;
  padding: 12px 14px 12px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  border-left: 2px solid transparent;
  user-select: none;
}
.msg:hover { background: rgba(255,255,255,.025); }
.msg.active { background: var(--panel-2); border-left-color: var(--red); }
.msg .dot { grid-row: 1 / span 2; width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; }
.msg.unseen .dot { background: var(--red); }
.msg .from { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.msg.unseen .from { color: var(--text); font-weight: 700; }
.msg .date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg .subj {
  grid-column: 2 / span 2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px;
}
.msg.unseen .subj { color: var(--text); }
.msg .tags { margin-left: 6px; color: var(--red); }
.list-foot { padding: 10px 14px calc(10px + var(--safe-b)); text-align: center; color: var(--muted); font-size: 12px; }
.list-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.skeleton { height: 62px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(255,255,255,.03), transparent); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- lezen ---------- */
#readPane { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; }
.empty-state { margin: auto; text-align: center; }
.big-num { font-family: var(--display); font-weight: 900; font-size: 120px; line-height: 1; color: var(--line-2); }

.read-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: rgba(12,12,13,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.read-bar .spacer { flex: 1; }
.read-bar .btn { padding: 7px 10px; font-size: 13px; }
.read-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.read-head h2 {
  margin: 0 0 14px;
  font-family: var(--display); font-weight: 700; font-size: clamp(24px, 3vw, 34px); line-height: 1.1;
  overflow-wrap: anywhere;
}
.meta { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.meta .who b { font-weight: 700; }
.meta .who span { color: var(--muted); }
.notice {
  margin: 14px 24px 0; padding: 9px 12px; border: 1px dashed var(--line-2);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted);
}
.notice .link-btn { color: var(--red); padding: 0; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 24px 0; }
.att {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  border: 1px solid var(--line-2); padding: 7px 10px; text-decoration: none; color: var(--text); font-size: 13px;
  background: var(--panel);
}
.att:hover { border-color: var(--red); }
.att .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.att .s { color: var(--muted); font-size: 11px; }
.att button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; }
.att button:hover { color: var(--red); }
.body-wrap { padding: 18px 24px calc(40px + var(--safe-b)); }
.mail-frame { width: 100%; border: 0; background: #fff; display: block; min-height: 120px; border-radius: 2px; }
.plain {
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; margin: 0;
  background: var(--panel); border: 1px solid var(--line); padding: 20px;
}
.plain .q { color: var(--muted); }

/* ---------- opstellen ---------- */
.compose {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.55);
  display: grid; place-items: end end;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  padding: 20px;
}
.compose-card {
  width: min(680px, 100%); height: min(720px, 100%);
  background: var(--panel); border: 1px solid var(--line-2);
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.compose-fields { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.compose .row {
  display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 0 16px;
}
.compose .row span { width: 82px; flex: none; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.compose .row input, .compose .row select {
  flex: 1; min-width: 0; background: transparent; border: 0; padding: 11px 0; outline: none;
}
.compose .row select option { background: var(--panel); }
.compose .row.cc { display: none; }
.compose.show-cc .row.cc { display: flex; }
.compose.show-cc .cc-toggle { display: none; }
.cc-toggle { padding: 6px 16px; border-bottom: 1px solid var(--line); font-size: 12px; }
.compose textarea {
  flex: 1; resize: none; border: 0; outline: none; background: transparent;
  padding: 16px; line-height: 1.6; min-height: 160px; font-size: 14px;
}
.att-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.att-list:empty { display: none; }
.compose-foot {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
}
.file-btn { cursor: pointer; }


/* ---------- mailboxen in de zijbalk ---------- */
.folder.unified { color: var(--text); font-weight: 700; margin-bottom: 6px; }
.acc-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 14px 8px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; text-align: left;
  color: var(--muted);
}
.acc-head:hover { color: var(--text); }
.acc-head.open { color: var(--text); }
.acc-head .caret { color: var(--red); width: 12px; flex: none; font-size: 11px; }
.acc-text { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.acc-text .name { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .02em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-text .email { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-head .count, .folder .count { font-size: 12px; font-weight: 700; color: var(--text); }
.count.err { color: var(--red); }
.folder-loading { padding: 6px 14px 6px 34px; }
.titles { flex: 1; min-width: 0; }
.titles h1 { display: block; }
.titles .sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.titles .sub:empty { display: none; }
.acc-tag {
  display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--red); border: 1px solid rgba(255,59,47,.4); padding: 0 5px; margin-right: 7px; line-height: 16px; vertical-align: 1px;
}
.acc-line { margin-bottom: 10px; }

/* ---------- instellingen ---------- */
.settings-card { width: min(720px, 100%); }
#settings { place-items: center; }
#settings .settings-card { height: min(780px, calc(100vh - 40px)); height: min(780px, calc(100dvh - 40px)); }
#settings textarea { flex: none; min-height: 0; padding: 9px 10px; font-size: 13px; }
.settings-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 18px calc(24px + var(--safe-b)); display: grid; gap: 16px; align-content: start; }
.acc-list { display: grid; border: 1px solid var(--line); }
.acc-row {
  display: flex; align-items: center; gap: 12px; padding: 14px; border: 0; border-bottom: 1px solid var(--line);
  background: none; cursor: pointer; text-align: left; width: 100%;
}
.acc-row:last-child { border-bottom: 0; }
.acc-row:hover { background: rgba(255,255,255,.03); }
.acc-row .num { color: var(--red); font-size: 11px; }
.acc-row .go { color: var(--muted); }
.badges { display: flex; gap: 6px; }
.badge { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--red); color: var(--red); padding: 1px 6px; }
.badge.dim { border-color: var(--line-2); color: var(--muted); }
.acc-form { display: grid; gap: 18px; }
.acc-form fieldset { border: 1px solid var(--line); margin: 0; padding: 14px; display: grid; gap: 12px; min-width: 0; }
.acc-form legend { padding: 0 6px; color: var(--red); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.f { display: grid; gap: 5px; min-width: 0; }
.f > span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.f input, .f select, .f textarea, .alias-row input, .alias-row textarea {
  background: var(--bg); border: 1px solid var(--line-2); padding: 9px 10px; width: 100%; min-width: 0;
}
.f input:focus, .f select:focus, .f textarea:focus, .alias-row input:focus, .alias-row textarea:focus { border-color: var(--red); outline: none; }
.f textarea, .alias-row textarea { resize: vertical; line-height: 1.5; }
.f input:disabled, .f select:disabled, .f textarea:disabled { opacity: .6; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--red); width: 16px; height: 16px; flex: none; }
.small-check { font-size: 12px; align-items: flex-start; }
.small-check .muted { font-size: 11px; }
.acc-form.same .smtp .creds { display: none; }
.alias-row { display: grid; grid-template-columns: 1fr 1.3fr 38px; gap: 8px; align-items: start; padding-bottom: 10px; border-bottom: 1px dashed var(--line); margin-bottom: 10px; }
.alias-row textarea { grid-column: 1 / span 2; }
.alias-row .icon-btn { grid-row: 1; grid-column: 3; }
.acc-actions .status { flex-basis: 100%; order: -1; }
.acc-actions .status:empty { display: none; }
.status { margin: 0; min-height: 1.4em; font-size: 13px; color: var(--muted); }
.status.ok { color: #5fd38d; }
.status.err { color: var(--red); }
.acc-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; bottom: -24px; background: var(--panel); padding: 10px 0; }
.acc-actions .spacer { flex: 1; }
.link-btn.danger { color: var(--red); }


/* ---------- selecteren ---------- */
.msg { grid-template-columns: 10px 1fr auto; }
.msg .check {
  display: none; grid-row: 1 / span 2; width: 18px; height: 18px; border: 1px solid var(--line-2); margin-top: 3px; cursor: pointer;
  align-self: start; position: relative; background: var(--bg);
}
.list.sel-mode .msg, .msg:hover { }
.list.sel-mode .msg { grid-template-columns: 18px 1fr auto; }
.list.sel-mode .msg .check { display: block; }
.list.sel-mode .msg .dot { display: none; }
@media (hover: hover) and (min-width: 861px) {
  .msg:hover { grid-template-columns: 18px 1fr auto; }
  .msg:hover .check { display: block; }
  .msg:hover .dot { display: none; }
}
.msg.selected { background: var(--red-dim); }
.msg.selected .check { background: var(--red); border-color: var(--red); }
.msg.selected .check::after { content: '✓'; position: absolute; inset: 0; color: #fff; font-size: 13px; line-height: 17px; text-align: center; }
.msg .cnt { font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); padding: 0 5px; margin-left: 4px; font-weight: 500; }
.msg.unseen .cnt { color: var(--text); }
.msg.sched.failed .date { color: var(--red); }
.bulk-bar {
  display: flex; align-items: center; gap: 2px; padding: 4px 8px; border-bottom: 1px solid var(--line);
  background: var(--red-dim); min-height: 47px;
}
.bulk-bar .spacer { display: none; }
.bulk-bar { overflow: hidden; }
.bulk-bar .icon-btn { width: 31px; height: 34px; font-size: 15px; flex: none; }
.bulk-count { font-size: 12px; color: var(--text); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.count.dim { color: var(--muted); font-weight: 500; }
.side-sep { height: 1px; background: var(--line); margin: 6px 14px; }

/* ---------- gesprek ---------- */
.conv { padding: 14px 24px calc(40px + var(--safe-b)); display: grid; gap: 10px; }
.card { border: 1px solid var(--line); background: var(--panel); }
.card.own { border-left: 2px solid var(--line-2); }
.card.open { border-color: var(--line-2); }
.card-head {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 11px 14px; cursor: pointer;
}
.card-head:hover { background: rgba(255,255,255,.025); }
.card-head .who-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-head .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.card-head .snip { grid-column: 1 / span 2; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-body { padding: 0 14px 14px; }
.card-body .meta { margin-bottom: 10px; }
.card-body .attachments { padding: 0 0 10px; }
.card-body .body-wrap { padding: 0; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; }
.card-actions .btn { padding: 6px 10px; font-size: 12px; }
.notice.in-card { margin: 0 0 10px; }
.star { color: var(--red); font-size: .7em; vertical-align: middle; }
.sched-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 18px 24px; }

/* ---------- menu, tijdkiezer, aanvullen ---------- */
.menu {
  position: fixed; z-index: 200; min-width: 230px; background: var(--panel-2); border: 1px solid var(--line-2);
  box-shadow: 0 12px 40px rgba(0,0,0,.55); padding: 4px 0; max-height: 70vh; overflow-y: auto;
}
.menu button {
  display: flex; justify-content: space-between; gap: 16px; width: 100%; text-align: left; background: none; border: 0;
  padding: 9px 14px; cursor: pointer; color: var(--text);
}
.menu button:hover, .menu button:focus { background: var(--red-dim); outline: none; }
.menu button.danger { color: var(--red); }
.menu .hint-r { color: var(--muted); font-size: 12px; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.picker-card { width: min(420px, 100%); height: auto !important; }
#picker { place-items: center; z-index: 120; }
.ac-list {
  position: fixed; z-index: 210; list-style: none; margin: 0; padding: 4px 0; background: var(--panel-2);
  border: 1px solid var(--line-2); box-shadow: 0 12px 40px rgba(0,0,0,.55); max-height: 280px; overflow-y: auto;
}
.ac-list li { padding: 8px 12px; cursor: pointer; display: grid; line-height: 1.3; }
.ac-list li.on, .ac-list li:hover { background: var(--red-dim); }
.ac-list .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-list .e { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-list mark { background: none; color: var(--red); font-weight: 700; }
#toast.has-act { pointer-events: auto; display: flex; gap: 14px; align-items: center; }
.toast-act { background: none; border: 0; color: var(--red); font-weight: 700; cursor: pointer; padding: 0; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
#toast.err .toast-act { color: #fff; text-decoration: underline; }

/* ---------- editor ---------- */
.toolbar { display: flex; gap: 2px; padding: 4px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar button {
  min-width: 32px; height: 30px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); font-size: 13px;
}
.toolbar button:hover { color: var(--text); border-color: var(--line-2); }
.toolbar button.on { color: var(--red); border-color: rgba(255,59,47,.4); }
.toolbar .sep { width: 1px; background: var(--line); margin: 5px 4px; }
.editor {
  flex: 1; min-height: 160px; overflow-y: auto; padding: 16px; outline: none; line-height: 1.6; font-size: 14px;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow-wrap: anywhere;
}
.editor blockquote { margin: 0 0 0 .4em; padding-left: .9em; border-left: 3px solid var(--line-2); color: var(--muted); }
.editor [data-sig] { color: var(--muted); }
.editor a { color: var(--red); }
.editor ul, .editor ol { padding-left: 1.6em; }
.compose-card.drag { outline: 2px dashed var(--red); outline-offset: -8px; }
.draft-state { font-size: 11px; color: var(--muted); white-space: nowrap; }
.send-group { display: flex; }
.send-group .more { padding: 9px 11px; border-left: 1px solid rgba(0,0,0,.25); }
.att.busy { opacity: .7; }

/* ---------- instellingen: tabbladen en beveiliging ---------- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 12px 9px; cursor: pointer; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; font-size: 12px;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--red); }
.sec-block { border: 1px solid var(--line); margin: 0; padding: 14px; display: grid; gap: 12px; min-width: 0; }
.sec-block legend { padding: 0 6px; color: var(--red); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.sec-status { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; }
.sec-status .led { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.sec-status.on .led { background: #5fd38d; box-shadow: 0 0 10px rgba(95,211,141,.6); }
.choice { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.choice-btn {
  display: grid; gap: 6px; text-align: left; padding: 14px; background: var(--bg); border: 1px solid var(--line-2); cursor: pointer;
}
.choice-btn:hover { border-color: var(--red); }
.choice-btn span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.pw-row .f { flex: 1; min-width: 180px; }
.dev-list { display: grid; border: 1px solid var(--line); }
.dev { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.dev:last-child { border-bottom: 0; }
.setup { display: grid; gap: 14px; }
.setup p { margin: 0; }
.qr { background: #fff; padding: 8px; width: max-content; }
.qr svg { display: block; }
.secret { font-size: 15px; letter-spacing: .08em; color: var(--text); user-select: all; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 24px; padding: 14px; border: 1px dashed var(--line-2); width: max-content; }
.codes code { font-size: 16px; letter-spacing: .06em; user-select: all; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; font-size: 12px; color: var(--muted); }
kbd { font-family: var(--mono); font-size: 11px; color: var(--text); border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 0 5px; }
.row-links { display: flex; justify-content: space-between; gap: 10px; }
#twofaText { margin: 0; line-height: 1.6; }

/* ---------- eerste keer instellen / server ---------- */
.checks { display: grid; gap: 6px; }
.check-row { margin: 0; font-size: 13px; line-height: 1.5; }
.check-row.ok { color: #5fd38d; }
.check-row.bad { color: var(--red); }
.check-row span { color: var(--muted); }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: var(--bg); border: 1px solid var(--line-2); padding: 9px 10px; font-size: 12px; user-select: all; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; font-weight: 500; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); color: #fff; }

.fab {
  position: absolute; right: 18px; bottom: calc(18px + var(--safe-b));
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--red); color: #fff; font-size: 30px; line-height: 1; cursor: pointer;
  box-shadow: 0 8px 24px rgba(255,59,47,.35);
}
.only-mobile { display: none !important; }
#scrim { display: none; }

/* ---------- middelgroot ---------- */
@media (max-width: 1180px) {
  :root { --list-w: 340px; --side-w: 220px; }
}

/* ---------- mobiel ---------- */
@media (max-width: 860px) {
  .only-mobile { display: inline-flex !important; }
  .only-desktop { display: none !important; }
  #app { grid-template-columns: 1fr; }
  #side {
    position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: min(300px, 84vw);
    transform: translateX(-100%); transition: transform .22s ease;
  }
  body.side-open #side { transform: none; }
  #scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 20; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.side-open #scrim { opacity: 1; pointer-events: auto; }
  #listPane, #readPane { grid-column: 1; grid-row: 1; }
  #readPane { display: none; background: var(--bg); }
  body.reading #readPane { display: flex; }
  body.reading #listPane { display: none; }
  .read-head { padding: 18px 16px 14px; }
  .body-wrap { padding: 14px 12px calc(30px + var(--safe-b)); }
  .notice { margin-left: 12px; margin-right: 12px; }
  .attachments { padding-left: 12px; padding-right: 12px; }
  .compose, #settings { padding: 0; place-items: stretch; }
  .compose-card { width: 100%; height: 100%; border: 0; padding-top: var(--safe-t); }
  .compose .row input, .compose textarea { font-size: 16px; }
  .search input { font-size: 16px; }
  .read-bar .label { display: none; }
  .f2 { grid-template-columns: 1fr; }
  .choice { grid-template-columns: 1fr; }
  .conv { padding: 10px 10px calc(30px + var(--safe-b)); }
  .card-body { padding: 0 10px 12px; }
  .editor { font-size: 16px; }
  .bulk-bar .icon-btn { width: 30px; }
  .read-bar .btn { padding: 7px 9px; }
  .settings-card { padding-top: var(--safe-t); }
  #settings .settings-card { height: 100%; }
  .f input, .f select, .f textarea, .alias-row input, .alias-row textarea { font-size: 16px; }
}

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