/* Thunderweb — Thunderbird "Supernova"-style layout */
:root {
  --bg-0: #ffffff; --bg-1: #f6f7f9; --bg-2: #eceef2; --bg-3: #e2e5ea;
  --border: #d5d8de; --border-soft: #e6e8ec;
  --text: #15141a; --muted: #5b5b66; --faint: #8f8f9d;
  --accent: #1373d9; --accent-hover: #0f62bb; --accent-text: #fff; --accent-soft: #d6e6fa;
  --sel: #1373d9; --sel-text: #fff; --sel-unfocused: #dce3ec; --hover: #e7ebf1;
  --star: #f5a800; --unread: #1373d9; --danger: #d70022; --warn-bg: #fff4ce; --warn-border: #f0d77a;
  --quote-1: #2a7bd8; --quote-2: #3a9a3a; --quote-3: #b5651d;
  --row-h: 28px; --card-h: 58px; --font: 13px;
  --radius: 4px;
  --shadow: 0 6px 20px rgba(0,0,0,.18);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg-0: #1f1e25; --bg-1: #26252d; --bg-2: #18171d; --bg-3: #2f2e37;
  --border: #3a3944; --border-soft: #2f2e38;
  --text: #f6f6f9; --muted: #b9b9c6; --faint: #8b8b98;
  --accent: #3a92f0; --accent-hover: #5aa6f5; --accent-text: #fff; --accent-soft: #23395a;
  --sel: #2c6fc4; --sel-text: #fff; --sel-unfocused: #393a48; --hover: #30303a;
  --star: #ffc23d; --unread: #5aa6f5; --warn-bg: #4a3b10; --warn-border: #6f5918;
  --quote-1: #6fb0ff; --quote-2: #7ccc7c; --quote-3: #e0a060;
  --shadow: 0 6px 24px rgba(0,0,0,.5);
  color-scheme: dark;
}
:root[data-density="compact"] { --row-h: 23px; --card-h: 50px; }
:root[data-density="touch"] { --row-h: 34px; --card-h: 68px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: var(--font)/1.35 system-ui, -apple-system, "Segoe UI", Ubuntu, Cantarell, "Noto Sans", sans-serif; color: var(--text); background: var(--bg-2); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .9em; }
.icon { flex: none; vertical-align: middle; }
i[data-icon] { display: inline-flex; font-style: normal; }
kbd { font: 11px ui-monospace, monospace; color: var(--faint); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; background: var(--bg-1); }

#app { display: grid; grid-template-rows: auto auto 1fr auto; height: 100%; }
#tabbar { grid-row: 1; } #toolbar { grid-row: 2; } #main { grid-row: 3; } #statusbar { grid-row: 4; }

/* ---------------- tabs */
#tabbar { display: flex; align-items: flex-end; gap: 2px; padding: 4px 6px 0 52px; background: var(--bg-2); min-height: 34px; overflow-x: auto; }
.tab { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 10px; min-width: 120px; max-width: 240px; border-radius: 6px 6px 0 0;
  background: transparent; border: 1px solid transparent; border-bottom: none; cursor: default; color: var(--muted); user-select: none; }
.tab:hover { background: var(--bg-3); }
.tab.active { background: var(--bg-1); border-color: var(--border); color: var(--text); position: relative; top: 1px; box-shadow: inset 0 2px 0 var(--accent); }
.tab .tab-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .tab-close { border: 0; background: none; padding: 2px; border-radius: 3px; display: flex; opacity: .7; }
.tab .tab-close:hover { background: var(--hover); opacity: 1; }

/* ---------------- toolbar */
#toolbar { display: flex; align-items: center; gap: 4px; padding: 5px 8px; background: var(--bg-1); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; cursor: pointer; white-space: nowrap; }
.tb-btn:hover { background: var(--hover); }
.tb-btn:active, .tb-btn.checked { background: var(--bg-3); border-color: var(--border); }
.tb-btn.icon-only { padding: 0 7px; }
.tb-btn.small { height: 26px; padding: 0 7px; }
.tb-btn:disabled { opacity: .45; cursor: default; }
.primary-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-text); cursor: pointer; font-weight: 600; }
.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:disabled { opacity: .5; cursor: not-allowed; }
#global-search { display: flex; align-items: center; gap: 6px; width: min(460px, 40vw); height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-0); color: var(--muted); }
#global-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
#global-search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); min-width: 0; }

/* ---------------- main */
#main { display: flex; min-height: 0; }
#spaces { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 44px; padding: 6px 0; background: var(--bg-2); border-right: 1px solid var(--border); }
.space-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.space-btn:hover { background: var(--hover); color: var(--text); }
.space-btn.active { background: var(--accent-soft); color: var(--accent); }
.space-btn .icon { width: 20px; height: 20px; }
.space { flex: 1; display: flex; min-width: 0; min-height: 0; }

/* ---------------- splitters */
.splitter { flex: none; background: var(--border); position: relative; z-index: 2; }
.splitter.vertical, body[data-layout="vertical"] #message-splitter { width: 1px; cursor: col-resize; }
.splitter.vertical::after, body[data-layout="vertical"] #message-splitter::after { content: ""; position: absolute; inset: 0 -3px; }
#message-splitter { height: 1px; cursor: row-resize; }
#message-splitter::after { content: ""; position: absolute; inset: -3px 0; }

/* ---------------- folder pane */
#folder-pane { width: 250px; min-width: 150px; max-width: 50vw; display: flex; flex-direction: column; background: var(--bg-1); }
#folder-pane-header { display: flex; gap: 4px; padding: 8px; }
#folder-pane-header .primary-btn { flex: 1; }
#folder-tree { flex: 1; overflow: auto; padding: 0 0 12px; outline: none; }
.f-row { display: flex; align-items: center; gap: 5px; height: var(--row-h); padding-right: 8px; cursor: default; white-space: nowrap; border-radius: 0; user-select: none; }
.f-row:hover { background: var(--hover); }
.f-row.selected { background: var(--sel-unfocused); }
#folder-tree:focus-within .f-row.selected, #folder-tree:focus .f-row.selected { background: var(--sel); color: var(--sel-text); }
.f-row.account { font-weight: 600; margin-top: 6px; }
.f-row .twisty { width: 16px; height: 16px; display: grid; place-items: center; border: 0; background: none; padding: 0; color: inherit; opacity: .75; }
.f-row .twisty .icon { width: 12px; height: 12px; }
.f-row .twisty.empty { visibility: hidden; }
.f-row .f-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.f-row.has-unread .f-name { font-weight: 700; }
.f-row.noselect .f-name { color: var(--muted); }
.f-row .badge { font-size: 11px; font-weight: 700; min-width: 20px; padding: 0 6px; border-radius: 9px; text-align: center; background: var(--accent); color: #fff; line-height: 17px; }
.f-row .total { font-size: 11px; color: var(--faint); }
.f-row.selected .total { color: inherit; opacity: .8; }
.f-row .f-ico { color: var(--muted); }
.f-row.selected .f-ico { color: inherit; }
.f-row[data-special="inbox"] .f-ico { color: var(--accent); }
.f-row[data-special="junk"] .f-ico { color: #d97706; }
.f-row[data-special="trash"] .f-ico { color: #6b7280; }

/* ---------------- thread pane */
#mail-content { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
body[data-layout="vertical"] #mail-content { flex-direction: row; }
#thread-pane { display: flex; flex-direction: column; min-height: 80px; min-width: 200px; height: 42%; background: var(--bg-0); }
body[data-layout="vertical"] #thread-pane { height: auto; width: 42%; }
body[data-layout="wide"] #main #mail-space { flex-wrap: wrap; }
#thread-pane-header { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border-soft); }
.tp-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
#folder-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#quick-filter-bar { display: flex; flex-direction: column; gap: 4px; padding: 5px 8px; border-bottom: 1px solid var(--border-soft); background: var(--bg-1); }
.qf-row, .qf-sub { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.qf-sep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }
.qf-label { color: var(--muted); font-size: .92em; padding-right: 2px; }
.qf-toggle.small { height: 22px; padding: 0 8px; font-size: .92em; }
.qf-pin { padding: 0 7px; }
.qf-tagbuttons { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.qf-tagbuttons .qf-toggle .tagdot { width: 9px; height: 9px; border-radius: 50%; }
#qf-tagmode { height: 22px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-0); }
.qf-status { margin-left: auto; }
.qf-toggle { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 13px; border: 1px solid var(--border); background: var(--bg-0); cursor: pointer; }
.qf-toggle:hover { background: var(--hover); }
.qf-toggle.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.qf-search { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-0); color: var(--muted); }
.qf-search:focus-within { border-color: var(--accent); }
.qf-search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); min-width: 0; }

#list-header, .m-row.table { display: grid; grid-template-columns: var(--cols); align-items: center; }
:root { --cols: 26px 22px 22px minmax(120px, 1fr) 22px minmax(100px, 28%) 140px; }
:root[data-showsize="1"] { --cols: 26px 22px 22px minmax(120px, 1fr) 22px minmax(100px, 26%) 140px 72px; }
#list-header { height: 28px; border-bottom: 1px solid var(--border); background: var(--bg-1); color: var(--muted); font-size: 12px; user-select: none; }
#list-header > div { display: flex; align-items: center; gap: 4px; height: 100%; padding: 0 6px; border-right: 1px solid var(--border-soft); overflow: hidden; white-space: nowrap; cursor: pointer; }
#list-header > div:hover { background: var(--hover); color: var(--text); }
#list-header > div.icon-col { justify-content: center; padding: 0; }
#list-header .sort { margin-left: auto; font-size: 10px; }
body[data-listview="cards"] #list-header { display: none; }
#list { flex: 1; overflow: auto; position: relative; outline: none; contain: strict; }
#list-spacer { width: 1px; }
#list-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.m-row { position: absolute; left: 0; right: 0; height: var(--row-h); white-space: nowrap; cursor: default; user-select: none; border-bottom: 1px solid transparent; }
.m-row > span { overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.m-row .c-icon { display: flex; justify-content: center; padding: 0; color: var(--faint); }
.m-row:hover { background: var(--hover); }
.m-row.unread .c-subject, .m-row.unread .c-from, .m-row.unread .card-from, .m-row.unread .card-subject { font-weight: 700; }
.m-row .c-star .icon, .m-row .card-star .icon { opacity: 0; }
.m-row:hover .c-star .icon, .m-row:hover .card-star .icon { opacity: .35; }
.m-row.starred .c-star, .m-row.starred .card-star { color: var(--star); }
.m-row.starred .c-star .icon, .m-row.starred .card-star .icon { opacity: 1; fill: var(--star); }
.m-row.starred .c-star path, .m-row.starred .card-star path { fill: var(--star); }
.m-row .c-unread .icon { opacity: 0; }
.m-row.unread .c-unread { color: var(--unread); }
.m-row.unread .c-unread .icon { opacity: 1; }
.m-row .c-date, .m-row .c-size { color: var(--muted); font-variant-numeric: tabular-nums; }
.m-row .c-size { text-align: right; }
.m-row.selected { background: var(--sel-unfocused); }
#list:focus .m-row.selected { background: var(--sel); color: var(--sel-text); }
#list:focus .m-row.selected .c-date, #list:focus .m-row.selected .c-size, #list:focus .m-row.selected .c-icon,
#list:focus .m-row.selected .card-date, #list:focus .m-row.selected .card-subject, #list:focus .m-row.selected .thread-count { color: var(--sel-text); }
.m-row.focused { outline: 1px dotted var(--accent); outline-offset: -1px; }
.m-row.nobody .c-subject, .m-row.nobody .card-subject { font-style: italic; }
.twisty-btn { border: 0; background: none; padding: 0; width: 16px; height: 16px; display: inline-grid; place-items: center; color: inherit; }
.twisty-btn .icon { width: 12px; height: 12px; }
.thread-count { font-size: 11px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.out-arrow { color: var(--faint); margin-right: 3px; }
.tagdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* cards view */
.m-row.card { height: var(--card-h); padding: 6px 10px 6px 26px; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.m-row.card .card-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.m-row.card .card-from { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.m-row.card .card-subject { flex: 1; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.m-row.card.unread .card-subject { color: var(--text); }
.m-row.card .card-date { color: var(--muted); font-size: 12px; flex: none; }
.m-row.card .unread-dot { padding: 0 !important; position: absolute; left: 9px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--unread); display: none; }
.m-row.card.unread .unread-dot { display: block; }
.m-row.card .card-icons { display: flex; gap: 2px; color: var(--faint); flex: none; }
.m-row.card .twisty-btn { position: absolute; left: 5px; bottom: 9px; }

/* ---------------- message pane */
#message-pane { flex: 1; display: flex; flex-direction: column; min-height: 80px; min-width: 200px; background: var(--bg-0); outline: none; }
.mp-empty { flex: 1; display: grid; place-items: center; color: var(--faint); text-align: center; padding: 20px; }
.mp-empty .big { font-size: 15px; }
.mp-empty .big-icon { width: 48px; height: 48px; opacity: .45; }
.msg-header { padding: 10px 14px 8px; border-bottom: 1px solid var(--border-soft); background: var(--bg-1); }
.mh-top { display: flex; align-items: flex-start; gap: 6px 10px; flex-wrap: wrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 15px; }
.mh-from { flex: 1 1 220px; min-width: 0; }
.mh-from .addr { flex-wrap: wrap; }
.mh-actions { display: flex; flex-wrap: wrap; gap: 2px; justify-content: flex-end; }
.mh-actions .tb-btn { height: 28px; padding: 0 8px; border-color: var(--border); background: var(--bg-0); }
.mh-actions .tb-btn:hover { background: var(--hover); }
.addr { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 1px 6px; margin: 1px 2px 1px 0; border-radius: 10px; cursor: pointer; }
.addr:hover { background: var(--hover); }
.addr .addr-name { font-weight: 600; }
.addr .addr-mail { color: var(--muted); }
.mh-from .addr { margin-left: -6px; font-size: 14px; }
.mh-subject-row { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.mh-subject { flex: 1; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.mh-date { color: var(--muted); white-space: nowrap; }
.mh-fields { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin-top: 6px; font-size: 12.5px; }
.mh-fields .lbl { color: var(--muted); text-align: right; padding-top: 2px; }
.mh-star { border: 0; background: none; padding: 2px; color: var(--faint); cursor: pointer; }
.mh-star.on { color: var(--star); }
.mh-star.on path { fill: var(--star); }
.mh-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.tag-pill { padding: 1px 8px; border-radius: 10px; font-size: 11px; color: #fff; }
.notification { display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: var(--warn-bg); border-bottom: 1px solid var(--warn-border); font-size: 12.5px; }
.notification .tb-btn { height: 24px; border-color: var(--warn-border); }
.notification.info { background: var(--accent-soft); border-color: var(--border); }
.msg-body { flex: 1; min-height: 0; position: relative; }
.msg-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
:root[data-theme="dark"] .msg-body iframe.plain { background: var(--bg-0); }
.attachment-bar { border-top: 1px solid var(--border); background: var(--bg-1); }
.att-summary { display: flex; align-items: center; gap: 8px; padding: 5px 12px; cursor: pointer; user-select: none; }
.att-summary .tb-btn { height: 26px; border-color: var(--border); background: var(--bg-0); }
.att-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; padding: 4px 12px 10px; max-height: 30vh; overflow: auto; }
.att-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-0); cursor: pointer; min-width: 0; }
.att-item:hover { border-color: var(--accent); }
.att-item .att-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-item .att-size { color: var(--muted); font-size: 11px; }
.att-item img { width: 32px; height: 32px; object-fit: cover; border-radius: 3px; }
.multi-summary { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.multi-summary .big { font-size: 18px; color: var(--text); }
.multi-summary ul { list-style: none; padding: 0; margin: 0; max-width: 520px; width: 90%; max-height: 50%; overflow: auto; }
.multi-summary li { padding: 4px 8px; border-bottom: 1px solid var(--border-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* message tab */
#message-tab-space { flex-direction: column; background: var(--bg-0); }
#message-tab-space > .tab-msg { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* ---------------- address book */
#addressbook-space { background: var(--bg-0); }
#ab-books { width: 220px; background: var(--bg-1); padding: 8px 0; overflow: auto; }
#ab-list-pane { width: 340px; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.ab-search { display: flex; align-items: center; gap: 6px; margin: 8px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); }
.ab-search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }
#ab-list { flex: 1; overflow: auto; }
.ab-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px; cursor: default; border-bottom: 1px solid var(--border-soft); }
.ab-row:hover { background: var(--hover); }
.ab-row.selected { background: var(--sel); color: var(--sel-text); }
.ab-row.selected .muted { color: var(--sel-text); opacity: .85; }
.ab-row .avatar { width: 30px; height: 30px; font-size: 13px; }
.ab-row .ab-text { min-width: 0; }
.ab-row .ab-text > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ab-detail { flex: 1; overflow: auto; padding: 24px; }
.ab-card-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.ab-card-head .avatar { width: 64px; height: 64px; font-size: 26px; }
.ab-card-head h2 { margin: 0; font-size: 20px; }
.ab-section { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; max-width: 640px; }
.ab-section h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ab-section a { color: var(--accent); }

/* ---------------- placeholder */
#placeholder-space { display: grid; place-items: center; background: var(--bg-0); }
.placeholder-box { text-align: center; color: var(--muted); }
.placeholder-box .icon { width: 64px; height: 64px; opacity: .5; }

/* ---------------- statusbar */
#statusbar { display: flex; align-items: center; gap: 14px; height: 24px; padding: 0 10px; background: var(--bg-2); border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
#statusbar .ro { display: inline-flex; align-items: center; gap: 5px; }

/* ---------------- menus, toasts, overlays */
#menu-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.menu { position: fixed; pointer-events: auto; min-width: 210px; max-width: 340px; padding: 4px; background: var(--bg-0); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); max-height: 80vh; overflow: auto; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 0; border-radius: 4px; background: none; text-align: left; cursor: default; white-space: nowrap; }
.menu-item:hover:not(:disabled), .menu-item:focus { background: var(--accent); color: #fff; outline: none; }
.menu-item:disabled { opacity: .45; }
.menu-item .check { width: 16px; display: inline-flex; }
.menu-item .accel { margin-left: auto; padding-left: 20px; color: var(--faint); font-size: 12px; }
.menu-item:hover .accel { color: inherit; }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--border); }
.menu-label { padding: 4px 10px 2px; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
#toast-layer { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast { background: #2b2a33; color: #fff; padding: 8px 14px; border-radius: 6px; box-shadow: var(--shadow); max-width: 80vw; animation: toast-in .15s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
#drop-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(19, 115, 217, .15); display: grid; place-items: center; border: 3px dashed var(--accent); }
#drop-overlay > div { background: var(--bg-0); padding: 24px 36px; border-radius: 10px; text-align: center; box-shadow: var(--shadow); font-size: 15px; }
#drop-overlay .icon { width: 40px; height: 40px; color: var(--accent); }

/* ---------------- compose */
.compose-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.25); display: grid; place-items: center; }
.compose-window { width: min(860px, 96vw); height: min(680px, 92vh); display: flex; flex-direction: column; background: var(--bg-0); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.compose-titlebar { display: flex; align-items: center; padding: 6px 8px 6px 14px; background: var(--bg-2); border-bottom: 1px solid var(--border); font-weight: 600; }
.compose-title { flex: 1; }
.compose-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--bg-1); }
.compose-fields { padding: 6px 10px; display: grid; gap: 4px; border-bottom: 1px solid var(--border); }
.compose-fields label { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; }
.compose-fields label > span { text-align: right; color: var(--muted); }
.compose-fields input, .compose-fields select { height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-0); }
.compose-fields input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.compose-format { display: flex; gap: 2px; padding: 4px 10px; border-bottom: 1px solid var(--border-soft); }
.compose-format button { min-width: 28px; height: 26px; border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; }
.compose-format button:hover { background: var(--hover); border-color: var(--border); }
.compose-body { flex: 1; overflow: auto; padding: 12px 16px; outline: none; line-height: 1.45; }
.compose-body pre { white-space: pre-wrap; font: inherit; margin: 0; }
.compose-body blockquote { margin: 0 0 0 4px; padding-left: 10px; border-left: 2px solid var(--quote-1); color: var(--quote-1); }

/* ---------------- responsive (phone: one pane at a time) */
#mobile-back { display: none; }
@media (max-width: 760px) {
  #tabbar, #spaces, .splitter, #toolbar [data-cmd="tagMenu"], #toolbar [data-cmd="toggleQuickFilter"], #global-search kbd, #qf-search kbd { display: none !important; }
  #toolbar { gap: 2px; padding: 4px 6px; }
  #toolbar .spacer { display: none; }
  #toolbar .tb-btn span { display: none; }
  #global-search { width: auto; flex: 1; min-width: 0; }
  body:not([data-mview="folders"]) #mobile-back { display: inline-flex; }
  #folder-pane { width: 100% !important; max-width: none; }
  #thread-pane, #message-pane { width: auto !important; height: auto !important; flex: 1; }
  body[data-mview="folders"] #mail-content { display: none; }
  body[data-mview="list"] #folder-pane, body[data-mview="list"] #message-pane { display: none; }
  body[data-mview="message"] #folder-pane, body[data-mview="message"] #thread-pane { display: none; }
  #mail-content { flex-direction: column !important; }
  .f-row { height: 40px; font-size: 15px; }
  .m-row.card { font-size: 14px; }
  .mh-actions .tb-btn span { display: none; }
  .mh-actions { width: 100%; justify-content: flex-start; }
  .mh-date { display: block; }
  .mh-subject-row { flex-wrap: wrap; }
  #statusbar #status-left { display: none; }
  #addressbook-space { flex-direction: column; }
  #ab-books { width: auto; display: flex; overflow-x: auto; padding: 4px; }
  #ab-list-pane { width: auto; max-height: 40%; border-right: 0; border-bottom: 1px solid var(--border); }
  .compose-window { width: 100vw; height: 100vh; border-radius: 0; }
  .compose-toolbar .muted { display: none; }
}

/* dialog pemilihan akun */
.tw-dialog-back { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); }
.tw-dialog { width: min(420px, 92vw); max-height: 80vh; display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--bg-0); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.tw-dialog h3 { margin: 0; font-size: 15px; }
.tw-dialog p { margin: 0; }
.tw-dialog-list { display: flex; flex-direction: column; gap: 2px; overflow: auto; padding: 4px 0; }
.tw-dialog-list label { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 4px; }
.tw-dialog-list label:hover { background: var(--hover); }
.tw-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.tw-dialog-actions button { padding: 5px 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-1); cursor: pointer; }
.tw-dialog-actions button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
