:root {
  --bg: #f5f6f8;
  --panel: #fff;
  --text: #1f2328;
  --muted: #6a737d;
  --line: #dde1e6;
  --accent: #2563eb;
  --accent-text: #fff;
  --hover: #eef2f7;
  --selected: #dbe7ff;
  --unread-bg: #eef5ff; /* 未読メールの行の背景 */
  --danger: #c62828;
  --warn-bg: #fff4e5;
  --warn-text: #8a4b00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --panel: #1d2025;
    --text: #e6e8eb;
    --muted: #9aa3ad;
    --line: #30353c;
    --accent: #4f8cff;
    --hover: #262a31;
    --selected: #253a5e;
    --unread-bg: #1c2638;
    --danger: #ef5350;
    --warn-bg: #3a2c14;
    --warn-text: #ffcc80;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, "Segoe UI", "Hiragino Sans", "Meiryo", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}
[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}
button:hover { background: var(--hover); }
button:disabled { opacity: .6; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--danger); }
button.wide { width: 100%; }
input, select, textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}
textarea { resize: vertical; font-family: inherit; }
label { display: block; margin: 8px 0; color: var(--muted); font-size: 13px; }
label > input, label > select { margin-top: 4px; color: var(--text); font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
label.check input { width: auto; margin: 0; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1em; margin: 6px 0; }
.status { color: var(--muted); min-height: 1em; margin: 4px 0; font-size: 13px; }
.status.err { color: var(--danger); }
.warn, .notice { background: var(--warn-bg); color: var(--warn-text); padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.spacer { flex: 1; }

/* ---- ログイン ---- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.card h1 { margin: 0 0 8px; font-size: 22px; }
.card button { width: 100%; margin-top: 8px; }

/* ---- メイン ---- */
.main {
  --side-w: 220px; /* フォルダ一覧の幅 (区切り線のドラッグで変わる) */
  --list-w: 340px; /* メール一覧の幅 */
  height: 100%;
  display: grid;
  grid-template-columns: var(--side-w) 5px var(--list-w) 5px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "top top top top top" "side split1 list split2 reader";
}

/* 列の区切り線: ドラッグで幅を変える */
.splitter {
  cursor: col-resize; touch-action: none; outline: none;
  background: linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat;
}
.splitter:hover, .splitter:focus-visible, .splitter.dragging {
  background: linear-gradient(var(--accent), var(--accent)) center / 3px 100% no-repeat;
}
#split-side { grid-area: split1; }
#split-list { grid-area: split2; }
/* ドラッグ中は本文の iframe にマウスを取られないようにする */
body.resizing { cursor: col-resize; user-select: none; }
body.resizing iframe { pointer-events: none; }
.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.logo { font-size: 16px; }
.sidebar { grid-area: side; padding: 12px; overflow-y: auto; min-width: 0; }
.sidebar > button { margin-bottom: 12px; }
.account { margin-bottom: 14px; }
.account-head { display: flex; align-items: center; gap: 4px; }
.account-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-head button { padding: 2px 6px; font-size: 12px; }
.account-error { color: var(--danger); font-size: 12px; margin: 2px 0; word-break: break-all; }
.folder {
  display: flex; justify-content: space-between;
  width: 100%; border: 0; background: none; text-align: left; padding: 5px 8px; margin-top: 2px;
}
.folder.active { background: var(--selected); }
.folder.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.badge { font-weight: 600; color: var(--accent); }

/* ユーザーフォルダ (ツリー) */
.tree-item { display: flex; align-items: center; margin-top: 2px; border-radius: 6px; }
.tree-item.active { background: var(--selected); }
.tree-item.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.tree-item.drop-before { box-shadow: inset 0 3px 0 var(--accent); }
.tree-item.drop-after { box-shadow: inset 0 -3px 0 var(--accent); }
.tree-item[draggable=true] { cursor: grab; }
.folder-order { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; font-size: 13px; }
.folder-order button { padding: 4px 10px; }
.small-note { font-size: 12px; flex-basis: 100%; }
.tree-item .folder { margin: 0; padding-left: 2px; flex: 1; min-width: 0; background: none; }
.tree-item .folder > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-toggle, .tree-more { border: 0; background: none; padding: 2px 4px; color: var(--muted); font-size: 11px; }
.tree-toggle { width: 20px; flex: none; }
.tree-more { visibility: hidden; font-size: 14px; line-height: 1; }
.tree-item:hover .tree-more, .tree-item.active .tree-more { visibility: visible; }
.add-folder { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 4px 8px; }
.add-folder:hover { color: var(--accent); background: none; }
#move-select { width: auto; padding: 5px 8px; }

/* 振り分けルール */
.small { font-size: 12px; margin: 0 0 8px; }
.rules { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; max-height: 50vh; overflow-y: auto; }
.rules li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rules li:last-child { border-bottom: 0; }
.rules li.disabled .rule-main { opacity: .5; }
.rules li.empty { color: var(--muted); justify-content: center; padding: 20px; }
.rules input[type=checkbox] { width: auto; }
.rule-main { flex: 1; min-width: 0; }
.rule-name { font-weight: 600; }
.rule-desc { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rules li button { padding: 2px 8px; font-size: 12px; }
.cond-row { display: grid; grid-template-columns: 130px 140px 1fr auto; gap: 6px; margin: 6px 0; }
.cond-row button { padding: 4px 10px; }
@media (max-width: 600px) {
  .cond-row { grid-template-columns: 1fr 1fr; }
}

.list-pane { grid-area: list; display: flex; flex-direction: column; background: var(--panel); min-height: 0; min-width: 0; }
.toolbar { display: flex; gap: 8px; padding: 10px 10px 0; }
.toolbar input { flex: 1; }
.list-pane .status { padding: 0 10px; }
.messages { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.messages li { position: relative; display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
/* 既読: 文字を控えめに / 未読: 青い帯・薄い青の背景・太字・青い日時で目立たせる */
.messages li .m-from, .messages li .m-subject { color: var(--muted); }
.messages li.unread { background: var(--unread-bg); }
.messages li.unread::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.messages li.unread .m-from, .messages li.unread .m-subject { color: var(--text); font-weight: 700; }
.messages li.unread .m-date { color: var(--accent); font-weight: 700; }
.messages li:hover { background: var(--hover); }
.messages li.checked { background: var(--hover); }
.messages li.selected, .messages li.checked.selected { background: var(--selected); }
.messages li.selected .m-from, .messages li.selected .m-subject { color: var(--text); }
/* 未読マーク (●)。押すと既読/未読を切り替える。既読の行ではマウスを乗せたときだけ ○ を出す */
.m-dot { flex: none; width: 18px; height: 18px; margin-top: 1px; padding: 0; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; }
.m-dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--muted); opacity: 0; }
.messages li:hover .m-dot::after, .m-dot:focus-visible::after { opacity: .6; }
.messages li.unread .m-dot::after { background: var(--accent); border-color: var(--accent); opacity: 1; }
.m-dot:hover { background: var(--selected); }
.unread-only { margin: 0 0 0 8px; font-size: 13px; white-space: nowrap; }
.messages li.m-empty { justify-content: center; }
.m-check { width: auto; margin: 3px 0 0; flex: none; cursor: pointer; }
.m-body { flex: 1; min-width: 0; }

/* 選択と一括操作 */
.select-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 40px; padding: 4px 12px; border-bottom: 1px solid var(--line);
}
.select-all { margin: 0; font-size: 13px; white-space: nowrap; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.bulk-actions button { padding: 3px 8px; font-size: 12px; }
.bulk-actions select { width: auto; padding: 3px 6px; font-size: 12px; max-width: 150px; }
.m-top { display: flex; gap: 8px; }
.m-from { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.m-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.m-empty { color: var(--muted); padding: 20px; text-align: center; cursor: default; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-top: 1px solid var(--line); }

.reader-pane { grid-area: reader; overflow-y: auto; min-height: 0; }
.empty { display: grid; place-items: center; height: 100%; }
#reader { display: flex; flex-direction: column; min-height: 100%; padding: 12px 16px; gap: 8px; }
.reader-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#reader h2 { margin: 4px 0 0; font-size: 18px; word-break: break-word; }
.headers { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 13px; }
.headers dt { color: var(--muted); }
.headers dd { margin: 0; word-break: break-all; }
.addr-link {
  display: inline; padding: 0; border: 0; border-radius: 0; background: none;
  color: var(--accent); text-align: left; word-break: break-all; font-size: inherit;
}
.addr-link:hover { background: none; text-decoration: underline; }
.attachments { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.attachments a {
  display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); text-decoration: none; font-size: 13px;
}
.attachments a:hover { background: var(--hover); }
#r-body { flex: 1; min-height: 400px; width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* 印刷用の非表示 iframe (display:none にすると印刷できないブラウザがあるため大きさ 0 で置く) */
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }

/* ---- ダイアログ ---- */
dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--text); padding: 20px;
}
dialog.wide-dialog { width: min(760px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .4); }
dialog h2 { margin: 0 0 8px; font-size: 18px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; padding: 4px 12px 8px; }
legend { padding: 0 4px; font-weight: 600; }
.row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 12px; }
table.users { width: 100%; border-collapse: collapse; }
table.users th, table.users td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); }
table.users td:last-child { text-align: right; white-space: nowrap; }
table.users td button { padding: 2px 8px; font-size: 12px; }
.inline-form { margin-top: 16px; }
.inline-form h3 { margin: 0; font-size: 15px; }

/* ---- メール作成ウインドウ ---- */
/* モーダルにしない (show() で開く) ので、作成中も後ろの一覧や本文を操作・コピーできる */
.compose-window {
  position: fixed; inset: auto; margin: 0; padding: 0; z-index: 50;
  width: 680px; height: 620px; max-width: none; max-height: none;
  min-width: 360px; min-height: 300px;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  resize: both; /* 右下の角をドラッグして大きさを変える */
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.compose-window[open] { display: flex; flex-direction: column; }
.cw-titlebar {
  display: flex; align-items: center; gap: 2px; flex: none;
  padding: 4px 6px 4px 14px; background: var(--hover); border-bottom: 1px solid var(--line);
  cursor: move; user-select: none; touch-action: none;
}
.cw-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-btn { border: 0; background: none; width: 30px; height: 28px; padding: 0; font-size: 15px; line-height: 1; cursor: pointer; }
.cw-btn:hover { background: var(--selected); }
#cw-close:hover { background: var(--danger); color: #fff; }
.cw-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 8px 16px 12px; }
.cw-body label { margin: 4px 0; }
.cw-body textarea { flex: 1; min-height: 120px; resize: none; }
.cw-body .dialog-actions { margin-top: 8px; }

/* 添付ファイル */
.attach-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 8px; }
.attach-row #btn-attach { padding: 4px 10px; font-size: 13px; }
.attach-list { display: contents; list-style: none; }
.attach-list li {
  display: inline-flex; align-items: center; gap: 4px; max-width: 260px;
  padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: 14px; font-size: 13px;
}
.attach-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-list .size { color: var(--muted); font-size: 12px; white-space: nowrap; }
.attach-list button { border: 0; background: none; padding: 0 6px; font-size: 14px; line-height: 1; }
.attach-list button:hover { color: var(--danger); background: none; }
.attach-total { color: var(--muted); font-size: 12px; margin-left: auto; }
/* ファイルをドラッグして重ねている間 */
.compose-window.file-over { outline: 3px dashed var(--accent); outline-offset: -3px; }
.attachments .save-all { border-style: dashed; font-weight: 600; }
#compose-error { white-space: pre-line; }

/* 最小化: タイトルバーだけを右下に置く */
.compose-window.minimized { width: 320px !important; height: auto !important; min-height: 0; resize: none; }
.compose-window.minimized .cw-body { display: none; }
/* 最大化 */
.compose-window.maximized {
  left: 16px !important; top: 16px !important;
  width: calc(100vw - 32px) !important; height: calc(100vh - 32px) !important; resize: none;
}
.compose-window.maximized .cw-titlebar, .compose-window.standalone .cw-titlebar { cursor: default; }
/* 別ウインドウ: ブラウザのウインドウいっぱいに表示する */
.compose-window.standalone {
  left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important;
  border: 0; border-radius: 0; resize: none; box-shadow: none;
}
.compose-window.standalone #cw-min, .compose-window.standalone #cw-max, .compose-window.standalone #cw-popout { display: none; }
.standalone-login { padding: 24px; }

/* ---- アカウントの種類 (受信と送信 / 送信のみ) ---- */
.acc-kind { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 6px 0 2px; }
.acc-kind label { margin: 4px 0; }
.acc-kind input[type=radio] { width: auto; margin: 0; }
.small-text { font-size: 12px; margin: 4px 0; }
#account-status { white-space: pre-line; }
.acc-tag { flex: none; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; }

/* ---- アドレス帳 ---- */
#contacts-dialog { width: min(900px, calc(100vw - 32px)); }
.ct-search { margin: 0 0 8px; font-size: 13px; }
.tpl-tree .ct-sub { color: var(--muted); font-size: 12px; margin-left: 6px; }
.tpl-tree .ct-count { color: var(--muted); font-size: 12px; margin-left: 4px; }
.tpl-tree .ct-path { display: block; color: var(--muted); font-size: 11px; }
#ct-notice { margin: 0 0 8px; }

/* 作成ウインドウの宛先欄 (入力候補 + アドレス帳ボタン) */
.addr-input { display: flex; gap: 6px; margin-top: 4px; }
.ac-wrap { position: relative; flex: 1; min-width: 0; }
.ac-wrap input { margin: 0; }
.pick-btn { padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 20;
  margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.ac-list li { padding: 5px 8px; border-radius: 5px; cursor: pointer; color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-list li.active { background: var(--selected); }
.ac-list .sub { color: var(--muted); margin-left: 8px; font-size: 12px; }

/* アドレス帳から選ぶ */
.pick-tree { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; height: min(420px, 50vh); overflow-y: auto; }
.pick-tree li { display: flex; align-items: center; gap: 6px; padding: 3px 8px; }
.pick-tree li:hover { background: var(--hover); }
.pick-tree label { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text); font-size: 14px; flex: 1; min-width: 0; cursor: pointer; }
.pick-tree label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-tree input[type=checkbox] { width: auto; margin: 0; flex: none; }
.pick-tree .sub { color: var(--muted); font-size: 12px; }
.pick-tree .empty-note { color: var(--muted); padding: 16px; justify-content: center; }

/* 受信メールのアドレスの横の「アドレス帳に登録」 */
.addr-add { border: 0; background: none; padding: 0 3px; font-size: 12px; opacity: .45; }
.addr-add:hover, .addr-add:focus-visible { opacity: 1; background: none; }

/* ---- 定型文 ---- */
#templates-dialog { width: min(900px, calc(100vw - 32px)); }
.tpl-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; min-height: 420px; }
.tpl-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); padding-right: 12px; }
.tpl-side-actions { display: flex; gap: 6px; margin-bottom: 8px; }
.tpl-side-actions button { flex: 1; padding: 5px 6px; font-size: 13px; }
.tpl-tree { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 60vh; }
.tpl-tree li { display: flex; align-items: center; border-radius: 6px; }
.tpl-tree li.active { background: var(--selected); }
.tpl-tree li:hover:not(.active) { background: var(--hover); }
.tpl-tree li .tree-toggle { visibility: visible; display: inline-block; }
.tpl-tree li[draggable=true] { cursor: grab; }
.tpl-tree li.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.tpl-tree li.drop-before { box-shadow: inset 0 3px 0 var(--accent); }
.tpl-tree li.drop-after { box-shadow: inset 0 -3px 0 var(--accent); }
.tpl-item {
  flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 5px 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tpl-item:hover { background: none; }
.tpl-tree .empty-note { color: var(--muted); font-size: 13px; padding: 8px; }
.tpl-main h3 { margin: 0 0 4px; font-size: 15px; }
.tpl-main textarea { font-family: inherit; }
.tpl-insert-row { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
.tpl-bar-label { color: var(--muted); font-size: 13px; padding-top: 5px; white-space: nowrap; }
.tpl-menubar { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.tpl-menubar .muted { font-size: 13px; padding-top: 5px; }
.tpl-bar-item { padding: 4px 10px; font-size: 13px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-bar-item.open { background: var(--selected); border-color: var(--accent); }
.tpl-bar-item.is-template { border-style: dashed; }

/* 定型文メニュー (ダイアログのスクロールで切れないよう position: fixed で開く) */
.tpl-menu {
  position: fixed; z-index: 10; margin: 0; padding: 4px; list-style: none;
  min-width: 170px; max-width: 320px; max-height: calc(100vh - 16px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.tpl-menu button {
  display: flex; justify-content: space-between; gap: 16px; width: 100%;
  border: 0; background: none; text-align: left; padding: 6px 10px; border-radius: 5px;
}
.tpl-menu button span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-menu button:hover, .tpl-menu button:focus-visible, .tpl-menu button.open { background: var(--hover); outline: none; }
.tpl-menu .arrow { color: var(--muted); }
.tpl-menu .empty { color: var(--muted); padding: 6px 10px; font-size: 13px; }

/* ---- 狭い画面: 1 列に並べる ---- */
@media (max-width: 800px) {
  .main {
    height: auto;
    grid-template-columns: 1fr;
    grid-template-areas: "top" "side" "list" "reader";
  }
  .splitter { display: none; } /* 縦に並ぶので幅の調整はしない */
  .topbar { flex-wrap: wrap; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .list-pane { border-right: 0; max-height: 60vh; }
  /* 狭い画面では作成ウインドウを全画面にする (移動・最小化・最大化はしない) */
  .compose-window, .compose-window.minimized, .compose-window.maximized {
    left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important;
    min-width: 0; border: 0; border-radius: 0; resize: none;
  }
  .compose-window.minimized .cw-body { display: flex; }
  #cw-min, #cw-max { display: none; }
  .cw-titlebar { cursor: default; }
  .tpl-layout { grid-template-columns: 1fr; }
  .tpl-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; }
  .tpl-tree { max-height: 30vh; }
}
