/* Mørkt tema inspireret af Nextcloud Mail */
:root {
  --bg: #171717;
  --sidebar: #161b26;
  --sidebar-hover: #222a3a;
  --sidebar-active: #26314a;
  --list: #181818;
  --reader: #141414;
  --border: #2a2a2a;
  --hover: #232323;
  --text: #ececec;
  --muted: #9a9a9a;
  --primary: #1f9bf0;
  --primary-dark: #1580cc;
  --danger: #ff6b6b;
  --star: #f5c542;
  --radius: 8px;
}
* { box-sizing: border-box; }
[v-cloak] { display: none; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 13px/1.4 -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.icon { width: 16px; height: 16px; flex: none; }
.icon.tiny { width: 13px; height: 13px; }
.icon.huge { width: 56px; height: 56px; opacity: .25; }
.icon.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.star-on { color: var(--star); }
.muted { color: var(--muted); }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--text); }
.icon-btn:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 250px 400px 1fr; grid-template-rows: minmax(0, 1fr); height: 100vh; overflow: hidden; }
.app > * { min-height: 0; }
.app.sidebar-hidden { grid-template-columns: 0 400px 1fr; }
.app.sidebar-hidden .sidebar { visibility: hidden; }

/* ---------- venstre ---------- */
.sidebar { background: var(--sidebar); display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.sidebar-top { display: flex; gap: 6px; align-items: center; padding: 10px 10px 6px; }
.btn-new { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 32px;
  border: 0; border-radius: 16px; background: rgba(255,255,255,.06); cursor: pointer; font-weight: 600; }
.btn-new:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.btn-new:disabled { opacity: .5; cursor: default; }
.nav { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.nav-account { margin: 16px 8px 4px; font-weight: 600; color: var(--text); opacity: .9; overflow: hidden; text-overflow: ellipsis; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--radius);
  cursor: pointer; user-select: none; }
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); }
.nav-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 10px; background: rgba(255,255,255,.08); }
.nav-item .count.muted { font-weight: 400; background: none; }
.nav-more { padding-left: 36px; color: var(--muted); }
.nav-account { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; padding: 4px 2px; border-radius: 6px; }
.nav-account:hover { background: var(--sidebar-hover); }
.nav-account .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-account .count { font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 10px; background: rgba(255,255,255,.08); }
.acc-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.acc-dot.big { width: 12px; height: 12px; }
.sidebar-bottom { padding: 6px 8px 8px; border-top: 1px solid var(--border); }
.sidebar-status { display: flex; align-items: center; gap: 6px; padding: 2px 2px 0 10px; }
.sidebar-bottom form { margin: 0; }
.sync-status { flex: 1; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-status.busy { color: var(--primary); }
.sync-status.error { color: var(--danger); white-space: normal; }

/* ---------- midten ---------- */
.list { background: var(--list); display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.list-top { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px; }
.search { flex: 1; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 1px solid #3a3a3a; border-radius: var(--radius); background: #101010; }
.search:focus-within { border-color: var(--primary); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.list-scroll { flex: 1; overflow-y: auto; padding: 0 6px 20px; }
.group { padding: 14px 8px 6px; font-weight: 600; font-size: 13px; }
.item { display: flex; gap: 10px; padding: 9px 10px; border-radius: var(--radius); cursor: pointer; margin-bottom: 2px; }
.item:hover { background: var(--hover); }
.item.selected { background: var(--primary); color: #fff; }
.item.selected .item-time, .item.selected .item-preview { color: rgba(255,255,255,.85); }
.item.selected .dot { background: #fff; }
.item-main { flex: 1; min-width: 0; }
.item-row { display: flex; align-items: center; gap: 8px; }
.item-from, .item-subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-from { font-size: 13px; }
.item-time { flex: none; font-size: 11px; color: var(--muted); }
.item-icons { flex: none; display: flex; align-items: center; gap: 4px; }
.item-preview { color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-top: 1px; }
.item.unread .item-from, .item.unread .item-subject { font-weight: 700; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; }
.avatar.big { width: 40px; height: 40px; font-size: 16px; }
.list-info { padding: 24px; text-align: center; color: var(--muted); }

/* ---------- højre ---------- */
.reader { background: var(--reader); display: flex; flex-direction: column; min-width: 0; padding: 14px 20px 16px; }
.reader-subject { margin: 0 0 12px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.reader-head { display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; }
.reader-from { flex: 1; min-width: 0; }
.from-name { font-weight: 600; }
.from-email { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: default; }
.to-line { margin-left: 6px; }
.reader-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.reader-date { color: var(--muted); font-size: 12px; margin: 0 8px; }
.reader-actions .link-btn { margin-right: 6px; font-size: 12px; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.attachment { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 14px;
  background: rgba(255,255,255,.07); font-size: 12px; }
.attachment:hover { background: rgba(255,255,255,.13); }
.images-banner { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; border-radius: var(--radius);
  background: rgba(31,155,240,.12); font-size: 12px; }
.body-frame { flex: 1; min-height: 0; border-radius: var(--radius); overflow: hidden; background: #fff; }
.body-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.reader-empty { flex: 1; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; color: var(--muted); }

.images-banner .grow { flex: 1; }

/* ---------- kompakt liste ---------- */
.app.compact .item { padding: 5px 10px; gap: 8px; }
.app.compact .avatar { width: 26px; height: 26px; font-size: 12px; }
.app.compact .item-preview { -webkit-line-clamp: 1; }
.app.compact .group { padding: 10px 8px 4px; }

/* ---------- knapper og formularer ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid #3a3a3a; background: #202020; cursor: pointer; font-weight: 600; }
.btn:hover:not(:disabled) { background: #2a2a2a; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--primary-dark); }
.icon-btn.danger:hover:not(:disabled) { color: var(--danger); }
input, select { height: 34px; padding: 0 10px; border-radius: var(--radius); border: 1px solid #3a3a3a; background: #101010;
  color: var(--text); font: inherit; outline: 0; }
input:focus, select:focus { border-color: var(--primary); }
input:disabled { opacity: .6; }
input[type=checkbox], input[type=radio] { height: auto; accent-color: var(--primary); }
.strong { font-weight: 600; }
.small { font-size: 12px; }

/* ---------- indstillinger ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: center;
  justify-content: center; padding: 16px; }
.modal { width: 100%; max-width: 960px; height: min(720px, 100%); display: flex; border-radius: 14px; overflow: hidden;
  background: #181818; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-nav { width: 210px; flex: none; padding: 16px 8px; background: var(--sidebar); border-right: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 700; padding: 4px 10px 14px; }
.modal-body { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 32px 32px; position: relative; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal-body h2 { margin: 0 0 6px; font-size: 20px; }
.modal-body h3 { margin: 24px 0 10px; font-size: 14px; }
.modal-body p { margin: 0 0 16px; }
.acc-list { display: flex; flex-direction: column; gap: 6px; margin: 16px 0 18px; }
.acc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: rgba(255,255,255,.04); }
.acc-info { flex: 1; min-width: 0; }
.acc-info .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 16px; }
.form-grid.servers { grid-template-columns: 2fr 1fr 1fr 1fr; margin-top: 0; }
.form-grid.servers .span2 { grid-column: span 1; }
.form-grid.narrow { grid-template-columns: 1fr; max-width: 360px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; }
.form-grid label input, .form-grid label select { color: var(--text); font-size: 13px; }
.form-grid label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span4 { grid-column: 1 / -1; }
.form-grid.servers label.span2 { grid-column: span 2; }
.field-label { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--bg); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-actions.left { justify-content: flex-start; }
.form-actions .link-btn { margin-right: auto; }
.notice { margin-top: 16px; padding: 10px 12px; border-radius: var(--radius); background: rgba(31,155,240,.12); font-size: 12px; }
.notice.ok { background: rgba(48,164,108,.15); }
.form-error { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); background: rgba(255,107,107,.12); color: #ffb3b3; }
.form-error .link-btn { margin-left: 8px; }
.test-results { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.test-results div { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius); }
.test-results .ok { background: rgba(48,164,108,.15); color: #8fe0b5; }
.test-results .bad { background: rgba(255,107,107,.12); color: #ffb3b3; }
.setting { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting-label { font-weight: 600; padding-top: 7px; }
.setting select { max-width: 220px; }
.radio-group { display: flex; flex-direction: column; gap: 10px; padding-top: 7px; }
.radio-group.row { flex-direction: row; gap: 24px; }
.radio-group label { display: flex; align-items: center; gap: 8px; }
.radio-group select { height: 28px; padding: 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 14px; background: rgba(255,255,255,.07); font-size: 12px; }
.chip-x { display: inline-flex; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px; border-radius: 50%; }
.chip-x:hover { color: var(--text); background: rgba(255,255,255,.1); }
.saved { position: sticky; bottom: 0; margin-top: 16px; color: #8fe0b5; font-size: 12px; }

/* ---------- fase 2: valg, værktøjslinje ---------- */
.hidden { display: none; }
.grow { flex: 1; }
textarea { padding: 8px 10px; border-radius: var(--radius); border: 1px solid #3a3a3a; background: #101010; color: var(--text);
  font: inherit; outline: 0; resize: vertical; }
textarea:focus { border-color: var(--primary); }
.list-top.bulk { height: 48px; }
.bulk-count { flex: 1; font-weight: 600; }
.item.checked { background: rgba(31,155,240,.16); }
.item .avatar { cursor: pointer; }
.item .avatar:hover { outline: 2px solid rgba(255,255,255,.25); }
.item.checked .avatar { background: var(--primary); color: #fff; }
.reader-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -4px 0 10px; }
.tool-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 15px; border: 0;
  background: rgba(255,255,255,.06); cursor: pointer; font-size: 12px; }
.tool-btn:hover { background: rgba(255,255,255,.12); }
.tool-btn.danger:hover { color: var(--danger); }
.tool-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

/* ---------- skriv mail ---------- */
.composer { width: 100%; max-width: 900px; height: min(760px, 100%); display: flex; flex-direction: column; border-radius: 14px;
  overflow: hidden; background: #181818; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.5); position: relative; }
.composer-head { display: flex; align-items: center; padding: 10px 12px 6px 18px; }
.composer-title { flex: 1; font-size: 16px; font-weight: 700; }
.composer-fields { padding: 0 18px; }
.cfield { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--border); }
.cfield-label { width: 44px; flex: none; color: var(--muted); }
.cfield-select, .cfield-input { flex: 1; border: 0; background: transparent; padding: 0; height: 38px; }
.cfield-select option { background: #181818; }
.recipients { flex: 1; position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 0; cursor: text; }
.recipients input { flex: 1; min-width: 160px; border: 0; background: transparent; height: 28px; padding: 0; }
.rchip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 2px 2px 10px; border-radius: 12px;
  background: rgba(31,155,240,.18); font-size: 12px; }
.rchip.bad { background: rgba(255,107,107,.2); }
.suggest { position: absolute; top: 100%; left: 0; z-index: 5; min-width: 320px; max-width: 100%; padding: 4px; border-radius: var(--radius);
  background: #222; border: 1px solid #333; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.suggest-item { padding: 7px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item.active, .suggest-item:hover { background: rgba(31,155,240,.25); }
.editor-toolbar { display: flex; gap: 2px; padding: 6px 14px; border-bottom: 1px solid var(--border); }
.editor-toolbar .icon-btn { border-radius: 6px; width: 32px; font-size: 14px; }
.editor { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px; outline: 0; font-size: 14px; line-height: 1.5;
  background: #fff; color: #222; }
.editor blockquote { border-left: 3px solid #ccc; margin: 0 0 0 4px; padding-left: 12px; color: #555; }
.editor a { color: #1a73e8; text-decoration: underline; }
.editor .signature { color: #555; }
.composer-attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px 0; }
.composer-attachments .attachment { cursor: pointer; }
.composer-attachments .attachment.off { opacity: .45; text-decoration: line-through; }
.composer-attachments input[type=checkbox] { margin: 0; }
.drop-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 3; font-size: 18px;
  font-weight: 600; background: rgba(31,155,240,.25); border: 3px dashed var(--primary); border-radius: 14px; pointer-events: none; }
.composer-error { margin: 10px 18px 0; }
.composer-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; }

/* ---------- flyt-menu ---------- */
.popover-backdrop { position: fixed; inset: 0; z-index: 60; }
.popover { position: fixed; width: 260px; max-height: 400px; overflow-y: auto; padding: 6px; border-radius: 10px; background: #222;
  border: 1px solid #333; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.popover-title { padding: 6px 10px; font-weight: 700; }
.popover-account { display: flex; align-items: center; gap: 8px; padding: 8px 10px 4px; color: var(--muted); font-size: 12px; }
.popover-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 24px; border-radius: 6px; cursor: pointer; }
.popover-item:hover { background: rgba(255,255,255,.08); }
.popover-item.disabled { opacity: .4; cursor: default; }

/* ---------- beskeder ---------- */
.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 16px; border-radius: var(--radius); background: #2a2a2a; border: 1px solid #3a3a3a; box-shadow: 0 6px 20px rgba(0,0,0,.4);
  max-width: 420px; }
.toast.ok { border-left: 3px solid #30a46c; }
.toast.error { border-left: 3px solid var(--danger); }

/* ---------- mappetræ og træk-og-slip ---------- */
.tree-toggle { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: -18px;
  margin-right: 2px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 4px; }
.tree-toggle:hover { color: var(--text); background: rgba(255,255,255,.1); }
.nav-item.drop-target { background: rgba(31,155,240,.35); outline: 1px dashed var(--primary); }
.nav-account.drop-target { box-shadow: 0 -2px 0 var(--primary); }
.nav-account[draggable=true] { cursor: grab; }
.nav-more { padding-left: 14px; gap: 8px; }
.nav-add { color: var(--muted); }
.item[draggable=true] { -webkit-user-drag: element; }

/* ---------- højreklik og dialoger ---------- */
.popover.ctx { width: 240px; }
.popover-item.danger { color: #ff9b9b; }
.popover-item.danger:hover { background: rgba(255,107,107,.15); }
.ctx-sep { height: 1px; background: #333; margin: 4px 6px; }
.dialog { width: 100%; max-width: 420px; padding: 22px 24px; border-radius: 14px; background: #1b1b1b; border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.dialog.wide { max-width: 620px; }
.dialog h3 { margin: 0 0 6px; font-size: 16px; }
.dialog > input { width: 100%; margin-top: 10px; }
.check.big { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; font-weight: 600; cursor: pointer; }
.policy-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; line-height: 2.2; }
.policy-sentence .days { width: 90px; }
.presets { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.notice.warn { background: rgba(255,107,107,.12); }
.bad-text { color: #ffb3b3; }

/* ---------- editor: værktøjslinje ---------- */
.editor-toolbar { flex-wrap: wrap; align-items: center; }
.tb-select { height: 30px; padding: 0 6px; font-size: 12px; max-width: 130px; }
.tb-select.narrow { max-width: 80px; }
.tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.color-btn { position: relative; cursor: pointer; }
.color-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; border: 0; }
.color-a { font-weight: 700; border-bottom: 3px solid; line-height: 1; padding: 0 2px; }
.editor h1 { font-size: 26px; margin: .4em 0; }
.editor h2 { font-size: 21px; margin: .4em 0; }
.editor h3 { font-size: 17px; margin: .4em 0; }
.editor img { max-width: 100%; }
.editor p { margin: 0 0 .6em; }

/* ---------- rødt flag, filtre, fortryd ---------- */
.flag-on { color: #ff4d4f; }
.item.pinned { box-shadow: inset 3px 0 0 #ff4d4f; background: rgba(255,77,79,.07); }
.item.pinned:hover { background: rgba(255,77,79,.12); }
.item.pinned.selected { background: var(--primary); }
.icon-btn.on { background: rgba(31,155,240,.25); color: #fff; }
.list-filter { display: flex; gap: 6px; padding: 0 12px 4px; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-undo { font-weight: 600; }

/* ---------- tofaktor ---------- */
.tfa-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.code-input { width: 150px; font-family: ui-monospace, Consolas, monospace; letter-spacing: 2px; text-align: center; }
.code-input.big { width: 170px; height: 44px; font-size: 22px; letter-spacing: 6px; }
.tfa-steps { margin: 8px 0 14px; padding-left: 20px; line-height: 1.7; }
.tfa-setup { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.qr-wrap { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.tfa-setup .qr { width: 210px; height: 210px; padding: 6px; border-radius: 10px; background: #fff; cursor: zoom-in; }
.qr-overlay { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px; background: #fff; cursor: zoom-out; padding: 16px; }
.qr-big { width: min(80vw, 75vh); height: min(80vw, 75vh); }
.qr-big svg { width: 100%; height: 100%; display: block; }
.qr-hint { color: #333; font-size: 15px; text-align: center; }
.tfa-setup .qr svg { width: 100%; height: 100%; display: block; }
.secret { display: inline-block; padding: 6px 10px; border-radius: 6px; background: #101010; border: 1px solid #333;
  font: 14px ui-monospace, Consolas, monospace; letter-spacing: 1px; user-select: all; }
.recovery-box { margin-top: 18px; padding: 16px 18px; border-radius: 10px; border: 1px solid var(--primary); background: rgba(31,155,240,.08); }
.recovery-box h3 { margin-top: 0; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.codes code { padding: 8px; border-radius: 6px; background: #101010; text-align: center; font: 15px ui-monospace, Consolas, monospace; }
.tfa-disable { margin-top: 22px; }
.tfa-disable summary { cursor: pointer; color: var(--muted); }
.danger-btn { border-color: rgba(255,107,107,.5); color: #ffb3b3; }
.danger-btn:hover:not(:disabled) { background: rgba(255,107,107,.15); }

/* ---------- smal skærm (fase 4 laver en rigtig mobilvisning) ---------- */
@media (max-width: 1100px) {
  .app { grid-template-columns: 220px 320px 1fr; }
  .app.sidebar-hidden { grid-template-columns: 0 320px 1fr; }
}

/* ---------- låseskærm og godkendelse ---------- */
.big-btn { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.check.dim { opacity: .5; }
.lock-screen { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; text-align: center; background: radial-gradient(circle at 30% 20%, #1b2a4a, #0d1220 65%); }
.lock-screen h2 { margin: 6px 0 0; font-size: 24px; }
.lock-screen p { margin: 0 0 14px; }
.lock-logo { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.lock-screen form { margin-top: 18px; }
.approve-overlay { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.approve-card { width: 100%; max-width: 380px; padding: 26px 22px 22px; border-radius: 20px; background: #1c1c1e; border: 1px solid #333;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.approve-card h2 { margin: 8px 0 6px; font-size: 21px; }
.approve-card p { margin: 0 0 8px; line-height: 1.5; }
.approve-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(31,155,240,.18); color: var(--primary); }
.approve-icon .icon { width: 28px; height: 28px; }
.choose-label { margin: 16px 0 10px; font-weight: 600; }
.choices { display: flex; justify-content: center; gap: 12px; }
.choice { width: 78px; height: 64px; border-radius: 14px; border: 2px solid #3a3a3a; background: #111; color: var(--text);
  font: 700 28px/1 -apple-system, 'Segoe UI', sans-serif; cursor: pointer; }
.choice.on { border-color: var(--primary); background: rgba(31,155,240,.2); }
.approve-actions { display: flex; gap: 10px; margin-top: 20px; }
.approve-actions .btn { flex: 1; justify-content: center; }

/* ---------- installér som app ---------- */
.install-banner { display: flex; align-items: center; gap: 10px; margin: 4px 10px 6px; padding: 10px 10px 10px 12px;
  border-radius: 12px; background: rgba(31,155,240,.12); border: 1px solid rgba(31,155,240,.35); }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; }
.install-banner .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.install-steps { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 12px; counter-reset: step; }
.install-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.05);
  counter-increment: step; position: relative; line-height: 1.5; }
.install-steps li::before { content: counter(step); position: absolute; top: -6px; left: -6px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; }
.step-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; background: #2a2a2a; display: flex; align-items: center;
  justify-content: center; color: var(--primary); }
.step-icon .icon { width: 24px; height: 24px; }
.step-icon.app-preview { background: none; }
.step-icon.app-preview img { width: 46px; height: 46px; border-radius: 11px; }
.install-list { line-height: 1.9; padding-left: 20px; }

/* ---------- mobil (Apple Mail-agtig: liste i fuld skærm, skuffe fra venstre, mail glider ind fra højre) ---------- */
.mobile-head, .reader-mobile-bar, .drawer-backdrop, .edge-swipe { display: none; }
@media (max-width: 820px) {
  html, body { overscroll-behavior: none; }
  .desktop-only { display: none !important; }
  .app, .app.sidebar-hidden { display: block; position: relative; height: 100vh; height: 100dvh; }
  .app > .list { position: absolute; inset: 0; border: 0; padding-top: env(safe-area-inset-top); }

  /* Skuffe med konti og mapper */
  .app > .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: min(85vw, 330px); visibility: visible;
    transform: translateX(-102%); transition: transform .25s ease; padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 4px 0 24px rgba(0,0,0,.5); }
  .app.drawer-open > .sidebar { transform: none; }
  .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0,0,0,.45); }
  .nav-item { height: 42px; font-size: 15px; }
  .nav-account { font-size: 15px; padding: 8px 4px; }

  /* Liste */
  .mobile-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 0; }
  .mobile-title { flex: 1; min-width: 0; text-align: center; }
  .mobile-title .strong { font-size: 17px; }
  .mobile-head .icon-btn { width: 40px; height: 40px; }
  .mobile-head .icon-btn .icon { width: 20px; height: 20px; }
  .list-top { padding: 8px 10px; }
  .search input { font-size: 16px; } /* undgår at iPhone zoomer ind */
  .item { padding: 11px 10px; -webkit-touch-callout: none; user-select: none; }
  .item-from, .item-subject { font-size: 15px; }
  .item-preview { font-size: 13px; }
  .list-scroll { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

  /* Læserude glider ind fra højre */
  .app > .reader { position: fixed; inset: 0; z-index: 30; padding: env(safe-area-inset-top) 12px calc(10px + env(safe-area-inset-bottom));
    transform: translateX(102%); transition: transform .25s ease; visibility: hidden; }
  .app.reading > .reader { transform: none; visibility: visible; }
  .reader-mobile-bar { display: flex; align-items: center; height: 44px; margin: 0 -4px; }
  .back-btn { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--primary);
    font-size: 16px; padding: 6px 4px; cursor: pointer; max-width: 70vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .back-btn .icon { width: 22px; height: 22px; }
  .edge-swipe { display: block; position: fixed; top: 0; bottom: 0; left: 0; width: 22px; z-index: 35; }
  .reader-subject { font-size: 19px; margin-bottom: 4px; }
  .reader-head { flex-wrap: wrap; gap: 10px; padding-bottom: 8px; }
  .reader-actions { width: 100%; justify-content: flex-end; }
  .reader-toolbar { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .tool-btn { height: 38px; padding: 0 12px; flex: none; }
  .tool-btn .tlabel { display: none; }
  .tool-btn .icon { width: 18px; height: 18px; }
  .tool-sep { display: none; }
  .images-banner { flex-wrap: wrap; }

  /* Skrivevindue og indstillinger i fuld skærm */
  .modal-backdrop { padding: 0; }
  .composer, .modal { max-width: none; height: 100%; border-radius: 0; border: 0; }
  .composer { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .cfield-input, .recipients input, .cfield-select { font-size: 16px; }
  .editor { font-size: 16px; }
  .editor-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .composer-foot { flex-wrap: wrap; }
  .composer-foot .btn { padding: 0 12px; }
  .modal { flex-direction: column; padding-top: env(safe-area-inset-top); }
  .modal-nav { width: auto; display: flex; gap: 4px; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--border); }
  .modal-nav .modal-title { display: none; }
  .modal-nav .nav-item { flex: none; height: 36px; }
  .modal-body { padding: 18px 16px 40px; }
  .setting { grid-template-columns: 1fr; gap: 6px; }
  .form-grid, .form-grid.servers { grid-template-columns: 1fr 1fr; }
  .form-grid .span2, .form-grid.servers label.span2 { grid-column: 1 / -1; }
  .dialog { max-width: none; margin: auto 12px; }
  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .popover { max-width: calc(100vw - 16px); }
}

/* ---------- scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: #3a3a3a transparent; }
