:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f2f6fc;
  --hover: #f2f6fc;
  --row-read: #f2f6fc;
  --row-unread: #ffffff;
  --row-selected: #c2dbff;
  --text: #1f1f1f;
  --text-2: #444746;
  --text-3: #5f6368;
  --border: #e3e3e3;
  --accent: #0b57d0;
  --accent-soft: #d3e3fd;
  --compose: #c2e7ff;
  --compose-hover: #b0daf7;
  --danger: #b3261e;
  --star: #f4b400;
  --shadow: 0 1px 2px rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15);
  --shadow-lg: 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12), 0 5px 5px -3px rgba(0,0,0,.2);
  --chip: #e8eaed;
  --input: #eaf1fb;
  --radius: 16px;
  --row-h: 40px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317; --surface: #1b1c1f; --surface-2: #232428; --hover: #2a2b2f;
    --row-read: #1b1c1f; --row-unread: #232428; --row-selected: #233a5e;
    --text: #e3e3e3; --text-2: #c4c7c5; --text-3: #9aa0a6; --border: #3a3b3f;
    --accent: #a8c7fa; --accent-soft: #29374f; --compose: #2a3f5c; --compose-hover: #334c6e;
    --danger: #f2b8b5; --chip: #3c4043; --input: #2a2b2f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111317; --surface: #1b1c1f; --surface-2: #232428; --hover: #2a2b2f;
  --row-read: #1b1c1f; --row-unread: #232428; --row-selected: #233a5e;
  --text: #e3e3e3; --text-2: #c4c7c5; --text-3: #9aa0a6; --border: #3a3b3f;
  --accent: #a8c7fa; --accent-soft: #29374f; --compose: #2a3f5c; --compose-hover: #334c6e;
  --danger: #f2b8b5; --chip: #3c4043; --input: #2a2b2f; color-scheme: dark;
}
:root[data-density="compact"] { --row-h: 32px; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.4 "Google Sans", Roboto, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.hidden { display: none !important; }

.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 36px; height: 36px; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; overflow: auto; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 28px; padding: 40px 36px 32px; box-shadow: var(--shadow); }
.login-card .logo { width: 48px; height: 48px; margin-bottom: 16px; }
.login-card h1 { font-size: 28px; font-weight: 400; margin: 0 0 6px; }
.login-card p.sub { margin: 0 0 28px; color: var(--text-2); }
.field { position: relative; margin-bottom: 18px; }
.field input { width: 100%; height: 56px; border: 1px solid var(--text-3); border-radius: 6px; padding: 18px 14px 6px; background: transparent; outline: none; font-size: 16px; }
.field input:focus { border: 2px solid var(--accent); padding: 17px 13px 5px; }
.field label { position: absolute; left: 14px; top: 17px; color: var(--text-3); pointer-events: none; transition: .15s; font-size: 16px; }
.field input:focus + label, .field input:not(:placeholder-shown) + label { top: 5px; font-size: 12px; color: var(--accent); }
.field .toggle-pw { position: absolute; right: 6px; top: 8px; border: 0; background: none; padding: 8px; border-radius: 50%; color: var(--text-3); }
.login-err { color: var(--danger); min-height: 20px; margin: -6px 0 12px; font-size: 13px; }
.login-actions { display: flex; justify-content: flex-end; }
.btn-primary { background: var(--accent); color: #fff; border: 0; border-radius: 20px; height: 40px; padding: 0 24px; font-weight: 500; }
:root[data-theme="dark"] .btn-primary { color: #062e6f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #062e6f; } }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn { background: transparent; border: 1px solid var(--border); border-radius: 18px; height: 36px; padding: 0 16px; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.btn:hover { background: var(--hover); }
.login-foot { margin-top: 20px; color: var(--text-3); font-size: 12px; text-align: center; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-rows: 64px minmax(0, 1fr); grid-template-columns: auto minmax(0, 1fr); height: 100vh; height: 100dvh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; }
.brand { display: flex; align-items: center; gap: 8px; width: 222px; padding-left: 4px; font-size: 22px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.brand img { width: 32px; height: 32px; }
.icon-btn { width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-2); flex: none; position: relative; }
.icon-btn:hover { background: rgba(68,71,70,.08); }
.icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.icon-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px; background: #3c4043; color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 4px; white-space: nowrap; z-index: 50; pointer-events: none; }
.search { flex: 1; max-width: 720px; display: flex; align-items: center; height: 48px; background: var(--input); border-radius: 24px; padding: 0 4px; transition: background .15s, box-shadow .15s; }
.search:focus-within { background: var(--surface); box-shadow: var(--shadow); }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; height: 100%; padding: 0 8px; min-width: 0; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 500; font-size: 15px; flex: none; text-transform: uppercase; user-select: none; }
.avatar.lg { width: 40px; height: 40px; font-size: 18px; }
.avatar-btn { border: 0; background: none; padding: 4px; border-radius: 50%; }
.avatar-btn:hover { background: rgba(68,71,70,.08); }

.sidebar { width: 256px; overflow-y: auto; padding: 0 16px 16px 0; transition: width .2s; }
.compose-btn { margin: 8px 0 16px 8px; height: 56px; border: 0; border-radius: 16px; background: var(--compose); color: var(--text); display: inline-flex; align-items: center; gap: 12px; padding: 0 24px 0 18px; font-weight: 500; font-size: 14px; box-shadow: none; transition: box-shadow .15s; }
.compose-btn:hover { box-shadow: var(--shadow); background: var(--compose-hover); }
.compose-btn svg { width: 24px; height: 24px; }
.nav { list-style: none; margin: 0; padding: 0; }
.nav-item { display: flex; align-items: center; height: 32px; border-radius: 0 16px 16px 0; padding: 0 12px 0 26px; gap: 18px; color: var(--text-2); cursor: pointer; user-select: none; position: relative; }
.nav-item:hover { background: rgba(68,71,70,.08); }
.nav-item.active { background: var(--accent-soft); color: var(--text); font-weight: 700; }
.nav-item.unread { font-weight: 700; color: var(--text); }
.nav-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; font-weight: 700; }
.nav-item .more { display: none; width: 24px; height: 24px; margin-right: -6px; }
.nav-item:hover .more { display: inline-grid; }
.nav-item:hover .count.has-more { display: none; }
.nav-item.drop-target { background: var(--accent-soft); outline: 2px dashed var(--accent); }
.nav-section { display: flex; align-items: center; justify-content: space-between; padding: 16px 8px 4px 26px; font-size: 16px; color: var(--text); }
.app.collapsed .sidebar { width: 72px; }
.app.collapsed .sidebar .label, .app.collapsed .sidebar .count, .app.collapsed .nav-section, .app.collapsed .compose-btn span { display: none; }
.app.collapsed .compose-btn { padding: 0 16px; }
.app.collapsed .nav-item { padding-left: 26px; }

.main { background: var(--surface); border-radius: var(--radius); margin: 0 16px 16px 0; overflow: hidden; display: flex; flex-direction: column; min-width: 0; position: relative; }
.toolbar { display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 8px 0 12px; border-bottom: 1px solid transparent; flex: none; }
.toolbar .spacer { flex: 1; }
.toolbar .pager { color: var(--text-3); font-size: 12px; margin-right: 4px; white-space: nowrap; }
.toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.chk { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.chk-wrap { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; }
.chk-wrap:hover { background: rgba(68,71,70,.08); }
.progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; overflow: hidden; z-index: 5; }
.progress::after { content: ""; position: absolute; height: 100%; width: 30%; background: var(--accent); animation: prog 1s ease-in-out infinite; }
@keyframes prog { from { left: -30%; } to { left: 100%; } }

.banner { padding: 10px 20px; background: var(--surface-2); color: var(--text-2); font-size: 13px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner button.link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 500; }

/* ---------- lista ---------- */
.list { flex: 1; overflow-y: auto; }
.row { display: flex; align-items: center; height: var(--row-h); padding: 0 16px 0 12px; border-bottom: 1px solid var(--border); cursor: pointer; background: var(--row-read); position: relative; gap: 0; }
.row.unread { background: var(--row-unread); font-weight: 700; }
.row:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); z-index: 1; }
.row.selected { background: var(--row-selected); }
.row.focused::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.row .chk-wrap { width: 32px; height: 32px; }
.star { border: 0; background: none; width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--text-3); border-radius: 50%; padding: 0; }
.star:hover { background: rgba(68,71,70,.08); }
.star.on { color: var(--star); }
.row .from { width: 200px; flex: none; padding: 0 16px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .from .n { font-weight: 400; color: var(--text-3); }
.row .subj { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.row .subj .s { font-weight: inherit; }
.row .subj .snip { color: var(--text-3); font-weight: 400; }
.row .subj .snip::before { content: " - "; }
.remote-banner { margin: 12px 24px 0 72px; border-radius: 8px; }
.row .meta { display: flex; align-items: center; gap: 8px; padding-left: 12px; flex: none; }
.row .date { font-size: 12px; min-width: 56px; text-align: right; color: var(--text-2); }
.row.unread .date { color: var(--text); }
.row .clip { color: var(--text-3); }
.row .clip svg { width: 16px; height: 16px; }
.row .hover-actions { display: none; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: inherit; padding-left: 8px; }
.row:hover .hover-actions { display: flex; }
.row:hover .meta .date { visibility: hidden; }
.row .tag-draft { color: var(--danger); font-weight: 400; margin-right: 4px; }
.row[draggable="true"] { -webkit-user-drag: element; }
.empty { padding: 64px 24px; text-align: center; color: var(--text-3); }
.empty svg { width: 64px; height: 64px; opacity: .4; display: block; margin: 0 auto 12px; }

/* ---------- leitura ---------- */
.reader { flex: 1; overflow-y: auto; padding: 0 0 40px; }
.reader h2 { font-size: 22px; font-weight: 400; margin: 12px 24px 12px 72px; word-wrap: break-word; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reader h2 .chip { font-size: 12px; background: var(--chip); padding: 2px 8px; border-radius: 4px; }
.msg-head { display: flex; gap: 16px; padding: 8px 24px 0 16px; align-items: flex-start; }
.msg-head .who { flex: 1; min-width: 0; }
.msg-head .who b { font-weight: 700; }
.msg-head .who .em { color: var(--text-3); font-size: 12px; }
.msg-head .to { color: var(--text-3); font-size: 12px; display: flex; align-items: center; gap: 2px; }
.msg-head .to button { border: 0; background: none; padding: 0; color: var(--text-3); display: inline-flex; }
.msg-head .when { color: var(--text-3); font-size: 12px; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.details { margin: 8px 24px 0 72px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--text-2); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; max-width: 640px; }
.details span:nth-child(odd) { color: var(--text-3); text-align: right; }
.msg-body { margin: 16px 24px 0 72px; }
.msg-body iframe { width: 100%; border: 0; min-height: 60px; background: #fff; border-radius: 4px; display: block; }
.attachments { margin: 24px 24px 0 72px; border-top: 1px solid var(--border); padding-top: 16px; }
.attachments .title { font-weight: 500; margin-bottom: 12px; color: var(--text-2); }
.att-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.att { width: 180px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column; background: var(--surface); }
.att:hover { box-shadow: var(--shadow); }
.att .thumb { height: 100px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); overflow: hidden; }
.att .thumb img { width: 100%; height: 100%; object-fit: cover; }
.att .thumb svg { width: 40px; height: 40px; }
.att .info { padding: 8px 10px; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.att .info .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.att .info .sz { color: var(--text-3); }
.reply-bar { margin: 32px 24px 0 72px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- compose ---------- */
.compose-dock { position: fixed; right: 16px; bottom: 0; display: flex; align-items: flex-end; gap: 16px; z-index: 40; pointer-events: none; }
.composer { width: 560px; height: 560px; max-height: calc(100vh - 40px); background: var(--surface); border-radius: 12px 12px 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; pointer-events: auto; overflow: hidden; }
.composer.min { height: 40px; width: 280px; }
.composer.max { position: fixed; inset: 5vh 8vw; width: auto; height: auto; max-height: none; border-radius: 12px; z-index: 60; }
.composer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; pointer-events: auto; }
.c-head { height: 40px; flex: none; display: flex; align-items: center; background: var(--surface-2); padding: 0 6px 0 16px; cursor: pointer; font-weight: 500; }
.c-head .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-head .icon-btn { width: 28px; height: 28px; }
.c-head .icon-btn svg { width: 16px; height: 16px; }
.c-fields { flex: none; padding: 0 16px; }
.c-line { display: flex; align-items: center; border-bottom: 1px solid var(--border); min-height: 36px; gap: 6px; flex-wrap: wrap; padding: 2px 0; }
.c-line > label { color: var(--text-3); min-width: 34px; }
.c-line input.plain { flex: 1; border: 0; outline: none; background: none; height: 30px; min-width: 120px; }
.c-line .toggles { margin-left: auto; display: flex; gap: 8px; }
.c-line .toggles button { border: 0; background: none; color: var(--text-2); padding: 2px 4px; }
.c-line .toggles button:hover { text-decoration: underline; }
.chips { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; position: relative; min-width: 0; }
.chip-addr { display: inline-flex; align-items: center; gap: 2px; background: var(--chip); border-radius: 12px; padding: 0 2px 0 10px; height: 24px; font-size: 13px; max-width: 100%; }
.chip-addr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-addr.bad { background: #fce8e6; color: #a50e0e; }
.chip-addr button { border: 0; background: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; padding: 0; color: var(--text-3); }
.chip-addr button svg { width: 14px; height: 14px; }
.chips input { flex: 1; min-width: 120px; border: 0; outline: none; background: none; height: 28px; }
.suggest { position: absolute; top: 100%; left: 0; min-width: 300px; background: var(--surface); box-shadow: var(--shadow-lg); border-radius: 8px; z-index: 70; padding: 6px 0; max-height: 280px; overflow: auto; }
.suggest div { padding: 6px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.suggest div.on, .suggest div:hover { background: var(--hover); }
.suggest small { color: var(--text-3); display: block; }
.c-editor { flex: 1; overflow-y: auto; padding: 12px 16px; outline: none; min-height: 80px; word-wrap: break-word; font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
.c-editor:empty::before { content: attr(data-ph); color: var(--text-3); }
.c-editor blockquote { margin: 0 0 0 .8ex; border-left: 1px solid #ccc; padding-left: 1ex; }
.c-editor img { max-width: 100%; }
.c-atts { flex: none; padding: 0 16px; display: flex; flex-direction: column; gap: 4px; max-height: 120px; overflow-y: auto; }
.c-att { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 4px; padding: 4px 4px 4px 10px; font-size: 13px; }
.c-att .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); font-weight: 500; }
.c-att .sz { color: var(--text-3); }
.c-att .bar { height: 3px; background: var(--accent); width: 0; transition: width .2s; }
.c-att.up { opacity: .7; }
.c-format { flex: none; display: flex; flex-wrap: wrap; gap: 0; padding: 2px 12px; margin: 0 16px; border-radius: 8px; background: var(--surface-2); }
.c-format .icon-btn { width: 30px; height: 30px; border-radius: 4px; }
.c-format .icon-btn svg { width: 18px; height: 18px; }
.c-format .icon-btn.on { background: var(--accent-soft); }
.c-format input[type=color] { width: 30px; height: 30px; border: 0; background: none; padding: 4px; cursor: pointer; }
.c-foot { flex: none; display: flex; align-items: center; gap: 4px; padding: 10px 12px 12px 16px; }
.c-foot .status { color: var(--text-3); font-size: 12px; margin-left: 8px; }
.c-foot .spacer { flex: 1; }
.send-btn { background: var(--accent); color: #fff; border: 0; height: 36px; border-radius: 18px; padding: 0 22px; font-weight: 500; margin-right: 6px; }
:root[data-theme="dark"] .send-btn { color: #062e6f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .send-btn { color: #062e6f; } }
.composer.dragover .c-editor { outline: 2px dashed var(--accent); outline-offset: -6px; }

/* ---------- menus, modais, toasts ---------- */
.menu { position: fixed; background: var(--surface); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 6px 0; z-index: 100; min-width: 200px; max-height: 70vh; overflow: auto; }
.menu .mi { padding: 0 16px; height: 36px; display: flex; align-items: center; gap: 12px; cursor: pointer; white-space: nowrap; }
.menu .mi:hover { background: var(--hover); }
.menu .mi.danger { color: var(--danger); }
.menu .sepr { height: 1px; background: var(--border); margin: 6px 0; }
.menu .hdr { padding: 8px 16px; color: var(--text-3); font-size: 12px; }
.menu .acct { padding: 12px 16px 16px; text-align: center; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu .acct .avatar { margin: 0 auto 8px; width: 56px; height: 56px; font-size: 24px; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 24px; padding: 24px; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal h3 { margin: 0 0 16px; font-size: 22px; font-weight: 400; }
.modal .row2 { margin-bottom: 16px; }
.modal .row2 > label { display: block; font-weight: 500; margin-bottom: 6px; }
.modal input[type=text], .modal select { width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; background: var(--surface); outline: none; }
.modal input[type=text]:focus, .modal select:focus { border-color: var(--accent); }
.modal .sig { border: 1px solid var(--border); border-radius: 8px; min-height: 100px; padding: 10px 12px; outline: none; font-family: Arial, sans-serif; }
.modal .sig:focus { border-color: var(--accent); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal .hint { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.modal table.keys { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal table.keys td { padding: 4px 6px; border-bottom: 1px solid var(--border); }
.modal kbd { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-family: monospace; }
.toasts { position: fixed; left: 24px; bottom: 24px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #303030; color: #f2f2f2; border-radius: 4px; padding: 12px 16px; min-width: 280px; max-width: 560px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 16px; animation: up .2s; font-size: 14px; }
.toast button { background: none; border: 0; color: #a8c7fa; font-weight: 500; padding: 4px; }
.toast .x { color: #ccc; margin-left: auto; }
@keyframes up { from { transform: translateY(20px); opacity: 0; } }

/* ---------- responsivo ---------- */
.scrim { display: none; }
@media (max-width: 900px) {
  .row .from { width: 140px; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); }
  .brand { display: none; }
  .topbar { gap: 4px; padding-left: 4px; }
  .search { min-width: 0; }
  #q-opts { display: none; }
  .brand { width: auto; }
  .brand span { display: none; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 280px; background: var(--surface); z-index: 80; transform: translateX(-100%); transition: transform .2s; padding-top: 8px; box-shadow: var(--shadow-lg); }
  .app.drawer .sidebar { transform: none; }
  .app.drawer .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 79; }
  .app.collapsed .sidebar { width: 280px; }
  .main { margin: 0; border-radius: 0; }
  .topbar { padding-right: 8px; }
  .search { height: 44px; }
  .row { height: auto; padding: 10px 12px; flex-wrap: wrap; align-items: flex-start; }
  .row .chk-wrap { display: none; }
  .row .from { order: 1; width: auto; flex: 1; padding: 0; }
  .row .meta { order: 2; }
  .row .subj { order: 3; flex-basis: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .row .star { order: 4; position: absolute; right: 6px; bottom: 4px; }
  .row .subj .snip { display: block; }
  .row .hover-actions { display: none !important; }
  .row:hover .meta .date { visibility: visible; }
  .reader h2, .msg-body, .attachments, .reply-bar, .details { margin-left: 16px; margin-right: 16px; }
  .msg-head { padding: 8px 12px 0; flex-wrap: wrap; gap: 4px 12px; }
  .msg-head .when { width: 100%; padding-left: 52px; }
  .remote-banner { margin: 12px 16px 0; }
  .row .subj .snip::before { content: none; }
  .composer, .composer.max { position: fixed; inset: 0; width: auto; height: auto; max-height: none; border-radius: 0; }
  .composer.min { inset: auto 0 0 auto; width: 240px; height: 40px; }
  .compose-dock { right: 0; }
  .toolbar .pager { display: none; }
  .toasts { left: 8px; right: 8px; bottom: 8px; }
  .toast { min-width: 0; }
  .hide-mobile { display: none !important; }
  .fab { position: fixed; right: 16px; bottom: 20px; z-index: 30; box-shadow: var(--shadow-lg); margin: 0; }
}
@media print {
  .topbar, .sidebar, .toolbar, .reply-bar, .compose-dock, .toasts { display: none !important; }
  body { overflow: visible; }
  .app { display: block; height: auto; }
  .main { margin: 0; }
  .reader { overflow: visible; }
}
