/* Corvo Mail — mail client styles */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --nav: #eef1f4;
  --border: #e3e6ea;
  --border-strong: #cfd4da;
  --text: #1c2229;
  --text-2: #56606b;
  --text-3: #8a939d;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-soft: #e2f5f2;
  --accent-text: #ffffff;
  --sel: #dcefeb;
  --sel-strong: #c6e6e0;
  --hover: #f0f2f4;
  --danger: #c2410c;
  --warn-bg: #fff7e0;
  --warn-border: #f2d488;
  --flag: #d97706;
  --shadow: 0 10px 30px rgba(17, 24, 39, .14), 0 2px 6px rgba(17, 24, 39, .08);
  --radius: 8px;
  --row-pad: 10px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #12161b;
  --panel: #1a1f25;
  --panel-2: #1e242b;
  --nav: #151a1f;
  --border: #2a3139;
  --border-strong: #3a434d;
  --text: #e6e9ec;
  --text-2: #a7b0ba;
  --text-3: #75808b;
  --accent: #2dd4bf;
  --accent-2: #5eead4;
  --accent-soft: #153a37;
  --accent-text: #06201d;
  --sel: #1d3a37;
  --sel-strong: #23504b;
  --hover: #222930;
  --danger: #fb923c;
  --warn-bg: #3a3016;
  --warn-border: #6b5520;
  --flag: #fbbf24;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
[data-density="compact"] { --row-pad: 6px; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.fill { fill: currentColor; }
.muted { color: var(--text-2); }
.hidden { display: none !important; }

/* ---------- boot / auth ---------- */
.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.auth-card .brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 650; margin-bottom: 4px; }
.auth-card .brand img { width: 34px; height: 34px; }
.auth-card p { margin: 0 0 18px; color: var(--text-2); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea.input { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.row > .narrow { flex: 0 0 110px; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--panel); cursor: pointer; white-space: nowrap; font-weight: 500;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; border: 0; background: transparent; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.active { color: var(--accent); }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-rows: 52px 1fr; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar .brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 16px; width: 228px; flex: none; }
.topbar .brand img { width: 26px; height: 26px; }
.topbar .menu-btn { display: none; }
.search { flex: 1; max-width: 640px; position: relative; }
.search input { width: 100%; height: 36px; padding: 0 36px 0 38px; border-radius: 8px; border: 1px solid transparent; background: var(--bg); outline: none; }
.search input:focus { background: var(--panel); border-color: var(--accent); }
.search > .i { position: absolute; left: 11px; top: 9px; color: var(--text-3); }
.search .clear { position: absolute; right: 2px; top: 2px; }
.topbar .spacer { flex: 1; }
.sync-state { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }

.main { display: grid; grid-template-columns: var(--nav-w, 240px) var(--list-w, 400px) 1fr; min-height: 0; }
.main.reading-hidden { grid-template-columns: var(--nav-w, 240px) 1fr 0; }

/* ---------- navigation ---------- */
.nav { background: var(--nav); border-right: 1px solid var(--border); overflow-y: auto; padding: 12px 8px 24px; min-height: 0; }
.nav .new-mail { width: 100%; justify-content: flex-start; padding: 9px 14px; margin-bottom: 14px; border-radius: 8px; font-weight: 600; }
.nav-section { margin-bottom: 10px; }
.nav-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--text-2); text-transform: uppercase; cursor: pointer; user-select: none; border-radius: 6px; }
.nav-head:hover { background: var(--hover); }
.nav-head .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.nav-head .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; font-size: 13px; letter-spacing: 0; }
.nav-head .err { color: var(--danger); }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; padding-left: calc(8px + var(--depth, 0) * 14px); border-radius: 6px; cursor: pointer; color: var(--text); user-select: none; position: relative; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--sel); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 2px; background: var(--accent); }
.nav-item.drop { background: var(--sel-strong); outline: 2px dashed var(--accent); outline-offset: -2px; }
.nav-item .i { color: var(--text-2); }
.nav-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; font-weight: 700; color: var(--accent); }
.nav-item .count.total { color: var(--text-3); font-weight: 500; }
.nav-item .twisty { width: 16px; height: 16px; display: grid; place-items: center; margin-left: -4px; color: var(--text-3); }
.nav-item .twisty .i { width: 13px; height: 13px; }
.cat-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---------- message list ---------- */
.list { display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--border); min-height: 0; min-width: 0; position: relative; }
.list-head { padding: 12px 14px 8px; border-bottom: 1px solid var(--border); }
.list-title { display: flex; align-items: center; gap: 8px; }
.list-title h2 { margin: 0; font-size: 17px; font-weight: 650; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-tools { display: flex; align-items: center; gap: 2px; margin-top: 6px; }
.list-tools .tabs { display: flex; gap: 2px; flex: 1; }
.tab { padding: 4px 10px; border-radius: 6px; border: 0; background: none; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 500; }
.tab:hover { background: var(--hover); }
.tab.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.bulkbar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--accent-soft); border-bottom: 1px solid var(--border); font-size: 13px; }
.bulkbar .n { flex: 1; font-weight: 600; padding-left: 4px; }
.msgs { flex: 1; overflow-y: auto; min-height: 0; outline: none; }
.group-head { position: sticky; top: 0; z-index: 1; padding: 6px 14px; font-size: 12px; font-weight: 700; color: var(--text-2); background: var(--panel-2); border-bottom: 1px solid var(--border); }
.msg {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 2px 10px; padding: var(--row-pad) 12px var(--row-pad) 14px;
  border-bottom: 1px solid var(--border); cursor: default; position: relative; user-select: none;
}
.msg:hover { background: var(--hover); }
.msg.selected { background: var(--sel); }
.msg.active { background: var(--sel-strong); }
.msg.unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 650; color: #fff; grid-row: span 3; position: relative; flex: none; }
.msg .sel-box { position: absolute; inset: 0; border-radius: 50%; display: none; place-items: center; background: var(--accent); color: var(--accent-text); }
.msg:hover .sel-box, .msg.selected .sel-box, .msgs.multi .sel-box { display: grid; }
.msg:not(.selected):hover .sel-box, .msgs.multi .msg:not(.selected) .sel-box { background: var(--panel); border: 2px solid var(--border-strong); color: transparent; }
.msg .from { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg.unread .from, .msg.unread .subject { font-weight: 700; }
.msg .meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); justify-self: end; }
.msg.unread .meta .time { color: var(--accent); font-weight: 600; }
.msg .subject { grid-column: 2 / 4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.msg .snippet { grid-column: 2 / 4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 13px; }
[data-density="compact"] .msg .snippet { display: none; }
.msg .cats { display: inline-flex; gap: 4px; margin-right: 4px; vertical-align: 1px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--text)); }
.msg .hover-actions { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; background: inherit; padding-left: 6px; }
.msg:hover .hover-actions { display: flex; }
.msg:hover .hover-actions .icon-btn { width: 28px; height: 28px; background: var(--panel); border: 1px solid var(--border); }
.msg .flagged-ico { color: var(--flag); }
.list-empty { padding: 48px 24px; text-align: center; color: var(--text-2); }
.list-empty .i { width: 40px; height: 40px; color: var(--text-3); stroke-width: 1.3; margin-bottom: 8px; }
.list-foot { padding: 14px; text-align: center; }
.acct-tag { font-size: 11px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.acct-tag i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---------- reading pane ---------- */
.reader { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.reader-empty { flex: 1; display: grid; place-items: center; color: var(--text-3); text-align: center; }
.reader-empty img { width: 72px; opacity: .35; filter: grayscale(.4); }
.reader-scroll { flex: 1; overflow-y: auto; padding: 16px; }
.mail-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; max-width: 1100px; margin: 0 auto; }
.mail-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mail-toolbar .sp { flex: 1; }
.mail-toolbar .btn.ghost { padding: 6px 10px; }
.mail-subject { padding: 16px 20px 4px; font-size: 20px; font-weight: 650; line-height: 1.3; word-wrap: break-word; }
.mail-cats { padding: 4px 20px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.mail-head { display: flex; gap: 12px; padding: 14px 20px; align-items: flex-start; }
.mail-head .avatar { width: 42px; height: 42px; font-size: 15px; grid-row: auto; }
.mail-head .who { flex: 1; min-width: 0; }
.mail-head .who .name { font-weight: 650; }
.mail-head .who .addr { color: var(--text-2); font-size: 13px; }
.mail-head .who .rcpt { color: var(--text-2); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.mail-head .date { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.banner { margin: 0 20px 10px; padding: 8px 12px; border-radius: 6px; background: var(--warn-bg); border: 1px solid var(--warn-border); font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.banner .btn { padding: 3px 10px; font-size: 12.5px; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px; }
.att { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 8px; border: 1px solid var(--border); border-radius: 8px; max-width: 260px; text-decoration: none; color: var(--text); background: var(--panel-2); }
.att:hover { border-color: var(--accent); }
.att .ext { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: #64748b; text-transform: uppercase; flex: none; }
.att .nm { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .sz { font-size: 11.5px; color: var(--text-3); }
.att .x { margin-left: auto; }
.mail-body { padding: 4px 20px 20px; }
.mail-body iframe { width: 100%; border: 0; display: block; min-height: 120px; background: #fff; border-radius: 6px; }
.back-btn { display: none; }

/* ---------- compose ---------- */
.compose { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100% - 4px); }
.compose.dragging { outline: 2px dashed var(--accent); outline-offset: -6px; }
.compose-actions { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.compose-actions .sp { flex: 1; }
.cfield { display: flex; align-items: center; gap: 8px; padding: 4px 14px; border-bottom: 1px solid var(--border); min-height: 42px; }
.cfield > label { width: 64px; flex: none; color: var(--text-2); font-size: 13px; }
.cfield select, .cfield > input { border: 0; background: transparent; outline: none; flex: 1; padding: 6px 0; min-width: 0; }
.cfield .toggles { display: flex; gap: 2px; }
.cfield .toggles button { border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 13px; padding: 3px 6px; border-radius: 4px; }
.cfield .toggles button:hover { background: var(--hover); color: var(--text); }
.rcpt { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; position: relative; min-width: 0; padding: 4px 0; }
.rcpt input { border: 0; outline: none; background: transparent; flex: 1; min-width: 120px; padding: 3px 0; }
.rchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: 999px; background: var(--accent-soft); font-size: 13px; max-width: 100%; }
.rchip.bad { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.rchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rchip button { border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 1px; border-radius: 50%; color: var(--text-2); }
.rchip button:hover { background: var(--hover); }
.suggest { position: absolute; top: 100%; left: 0; z-index: 30; min-width: 280px; max-width: 420px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.suggest div { padding: 6px 10px; border-radius: 5px; cursor: pointer; }
.suggest div.on, .suggest div:hover { background: var(--sel); }
.suggest small { color: var(--text-2); display: block; }
.fmtbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border); align-items: center; }
.fmtbar .icon-btn { width: 30px; height: 30px; }
.fmtbar .sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.fmtbar select { border: 1px solid var(--border); border-radius: 5px; background: var(--panel); padding: 3px 4px; font-size: 13px; }
.editor { flex: 1; padding: 16px; outline: none; min-height: 260px; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.editor blockquote { margin: 8px 0 0; padding-left: 10px; border-left: 3px solid var(--border-strong); }
.editor img { max-width: 100%; }
.compose .atts { padding: 10px 14px; border-top: 1px solid var(--border); margin: 0; }
.compose .atts:empty { display: none; }

/* ---------- overlays ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 20, 25, .45); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.modal.wide { max-width: 920px; height: min(720px, calc(100vh - 32px)); }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.settings { display: grid; grid-template-columns: 190px 1fr; flex: 1; min-height: 0; }
.settings-nav { border-right: 1px solid var(--border); padding: 10px 8px; background: var(--panel-2); }
.settings-nav .nav-item { margin-bottom: 2px; }
.settings-pane { overflow-y: auto; padding: 18px 22px; }
.settings-pane h4 { margin: 0 0 12px; font-size: 15px; }
.card-list { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 14px; }
.card-list .item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.card-list .item:last-child { border-bottom: 0; }
.card-list .item .grow { flex: 1; min-width: 0; }
.card-list .item small { color: var(--text-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-line { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.rule-line > * { flex: 1; min-width: 0; }
.rule-line > .icon-btn { flex: none; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px 6px; margin: 0 0 12px; }
legend { font-size: 12.5px; font-weight: 700; color: var(--text-2); padding: 0 4px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 24px; height: 24px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--text); }
.ctx { position: fixed; z-index: 60; min-width: 200px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; animation: fade .08s; }
.ctx .it { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.ctx .it:hover, .ctx .it.on { background: var(--hover); }
.ctx .it.danger { color: var(--danger); }
.ctx .sep { height: 1px; background: var(--border); margin: 4px 2px; }
.ctx .it .chk { margin-left: auto; color: var(--accent); }
.picker-list { max-height: 340px; overflow-y: auto; margin-top: 8px; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1f2937; color: #fff; padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; pointer-events: auto; display: flex; gap: 12px; align-items: center; max-width: 90vw; animation: fade .15s; }
.toast.error { background: #9a3412; }
.toast button { background: none; border: 0; color: #5eead4; font-weight: 700; cursor: pointer; }
.splitter { position: absolute; top: 0; bottom: 0; right: -3px; width: 6px; cursor: col-resize; z-index: 5; }
.splitter:hover, .splitter.drag { background: color-mix(in srgb, var(--accent) 35%, transparent); }
kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--panel-2); }
.kbd-table td { padding: 4px 10px 4px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .main { grid-template-columns: var(--nav-w, 220px) 1fr; }
  .main .reader { display: none; }
  .main.show-reader .list { display: none; }
  .main.show-reader .reader { display: flex; }
  .back-btn { display: inline-grid; }
  .splitter { display: none; }
}
@media (max-width: 760px) {
  .topbar .brand { width: auto; }
  .topbar .brand span, .sync-state { display: none; }
  .topbar .menu-btn { display: inline-grid; }
  .main { grid-template-columns: 1fr; }
  .nav { position: fixed; top: 52px; bottom: 0; left: 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow); }
  .app.nav-open .nav { transform: none; }
  .settings { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .reader-scroll { padding: 0; }
  .mail-card, .compose { border-radius: 0; border-left: 0; border-right: 0; }
  .row { flex-direction: column; gap: 0; }
  .row > .narrow { flex: 1; }
}
@media print {
  .topbar, .nav, .list, .mail-toolbar, .banner { display: none !important; }
  .main { display: block; }
  body { overflow: visible; }
}
