/* WNA Webmail - styles (themes: classic / light / dark / thunderbird / rainloop / hidemaru / cool / meadow / office / office2016) */
:root {
  --font: "Segoe UI", "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", "Microsoft YaHei", system-ui, sans-serif;
  --accent: #0f6cbd;
  --accent-hover: #115ea3;
  --accent-text: #ffffff;
  --topbar-bg: #0f6cbd;
  --topbar-text: #ffffff;
  --topbar-search-bg: #ffffff;
  --topbar-search-text: #242424;
  --page-bg: #f3f2f1;
  --pane-bg: #ffffff;
  --pane-radius: 6px;
  --pane-shadow: 0 1px 2px rgba(0,0,0,0.10);
  --border: #e1dfdd;
  --border-soft: #edebe9;
  --text: #242424;
  --text-2: #424242;
  --text-3: #616161;
  --hover: #f3f2f1;
  --selected: #ebf3fc;
  --selected-bar: #0f6cbd;
  --folder-active: #e0e0e0;
  --unread-subject: #0f6cbd;
  --btn-bg: #ffffff;
  --btn-border: #d1d1d1;
  --input-bg: #ffffff;
  --input-border: #8a8886;
  --danger: #c4314b;
  --ok: #107c41;
  --ribbon-bg: #f3f2f1;
  --cmd-bg: #ffffff;
  --list-item-radius: 0;
  --list-gap: 0;
  --pane-gap: 8px;
  --quote: #616161;
}
body[data-theme="light"] {
  --topbar-bg: #ffffff;
  --topbar-text: #242424;
  --topbar-search-bg: #f3f5f8;
  --topbar-search-text: #242424;
  --page-bg: #e8eef5;
  --pane-radius: 12px;
  --pane-shadow: 0 1px 3px rgba(0,0,0,0.08);
  --border: #e1e5ea;
  --border-soft: #eef1f4;
  --hover: #f3f5f8;
  --selected: #ffffff;
  --selected-bar: #0f6cbd;
  --folder-active: #ffffff;
  --unread-subject: #242424;
  --ribbon-bg: #ffffff;
  --cmd-bg: #ffffff;
  --list-item-radius: 10px;
  --list-gap: 6px;
  --pane-gap: 10px;
}
body[data-theme="dark"] {
  --accent: #479ef5;
  --accent-hover: #62abf5;
  --accent-text: #0c2b4d;
  --topbar-bg: #0c2b4d;
  --topbar-text: #ffffff;
  --topbar-search-bg: #1f3a5c;
  --topbar-search-text: #f0f0f0;
  --page-bg: #1b1b1b;
  --pane-bg: #292929;
  --pane-radius: 4px;
  --pane-shadow: none;
  --border: #3d3d3d;
  --border-soft: #2e2e2e;
  --text: #f0f0f0;
  --text-2: #d6d6d6;
  --text-3: #adadad;
  --hover: #333333;
  --selected: #1f3a5c;
  --selected-bar: #479ef5;
  --folder-active: #333333;
  --unread-subject: #8fc1f7;
  --btn-bg: #333333;
  --btn-border: #4a4a4a;
  --input-bg: #1b1b1b;
  --input-border: #4a4a4a;
  --danger: #f0787e;
  --ok: #54b054;
  --ribbon-bg: #202020;
  --cmd-bg: #292929;
  --pane-gap: 1px;
  --quote: #adadad;
}

body[data-theme="thunderbird"] {
  --font: "Inter", "Segoe UI", "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --accent: #1373d9;
  --accent-hover: #0f5fb5;
  --accent-text: #ffffff;
  --topbar-bg: #f0f0f4;
  --topbar-text: #1c1b22;
  --topbar-search-bg: #ffffff;
  --topbar-search-text: #1c1b22;
  --page-bg: #f0f0f4;
  --pane-bg: #ffffff;
  --pane-radius: 8px;
  --pane-shadow: none;
  --border: #d7d7db;
  --border-soft: #e6e6ea;
  --text: #1c1b22;
  --text-2: #3b3b45;
  --text-3: #5b5b66;
  --hover: #e9e9ee;
  --selected: #e7f0fb;
  --selected-bar: #1373d9;
  --folder-active: #e7f0fb;
  --unread-subject: #1373d9;
  --btn-bg: #ffffff;
  --btn-border: #cfcfd6;
  --input-bg: #ffffff;
  --input-border: #8f8f9d;
  --danger: #c50042;
  --ok: #2ac3a2;
  --ribbon-bg: #f0f0f4;
  --cmd-bg: #f0f0f4;
  --list-item-radius: 6px;
  --list-gap: 6px;
  --pane-gap: 8px;
}
body[data-theme="thunderbird"] .topbar { border-bottom: 1px solid var(--border); height: 52px; }
body[data-theme="thunderbird"] .brand-logo { background: var(--accent); color: #fff; border-radius: 6px; }
body[data-theme="thunderbird"] .search label { border: 1px solid var(--border); border-radius: 6px; height: 34px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.06); }
body[data-theme="thunderbird"] .lang-btn { background: transparent; border-radius: 6px; }
body[data-theme="thunderbird"] .avatar { background: var(--accent); color: #fff; }
body[data-theme="thunderbird"] .ribbon-tabs { display: none; }
body[data-theme="thunderbird"] .cmdbar { margin: 6px 12px 0; box-shadow: none; background: transparent; padding: 0 4px; }
body[data-theme="thunderbird"] .cmd { border-radius: 6px; }
body[data-theme="thunderbird"] .cmd.primary { border-radius: 6px; box-shadow: 0 1px 2px rgba(19,115,217,0.35); }
body[data-theme="thunderbird"] .sep { background: var(--border); }
body[data-theme="thunderbird"] .body { padding: 6px 12px 12px; }
body[data-theme="thunderbird"] .folders { background: transparent; }
body[data-theme="thunderbird"] .folders .account { color: var(--text-2); }
body[data-theme="thunderbird"] .folder { border-radius: 6px; padding-left: 12px; font-size: 14px; }
body[data-theme="thunderbird"] .folder.active { background: var(--folder-active); color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1px #b8d3f4; }
body[data-theme="thunderbird"] .folder .count { background: var(--accent); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; }
body[data-theme="thunderbird"] .folder .count.dim { background: transparent; color: var(--text-3); }
body[data-theme="thunderbird"] .list { background: transparent; box-shadow: none; }
body[data-theme="thunderbird"] .list-head { border-bottom: 0; padding-left: 4px; }
body[data-theme="thunderbird"] .filters { border-radius: 6px; }
body[data-theme="thunderbird"] .list-body { padding: 0 2px 2px; }
body[data-theme="thunderbird"] .group { padding: 6px 8px 2px; }
body[data-theme="thunderbird"] .item { background: #fff; border: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; box-shadow: 0 1px 1px rgba(0,0,0,0.04); }
body[data-theme="thunderbird"] .item .main { padding-left: 10px; border-left: 3px solid transparent; }
body[data-theme="thunderbird"] .item.unread .main { border-left-color: var(--accent); }
body[data-theme="thunderbird"] .item.unread .sender, body[data-theme="thunderbird"] .item.unread .subject { font-weight: 700; }
body[data-theme="thunderbird"] .item:hover { background: #f7f7fa; }
body[data-theme="thunderbird"] .item.selected { background: var(--selected); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
body[data-theme="thunderbird"] .item .av { width: 32px; height: 32px; font-size: 12px; }
body[data-theme="thunderbird"] .item .chk { left: 10px; top: 18px; }
body[data-theme="thunderbird"] .list-foot { border-top: 0; }
body[data-theme="thunderbird"] .reader, body[data-theme="thunderbird"] .compose { border: 1px solid var(--border); border-radius: 8px; }
body[data-theme="thunderbird"] .msg-head { padding: 12px 24px 9px; }
body[data-theme="thunderbird"] .msg-subject { font-size: 18px; }
body[data-theme="thunderbird"] .btn { border-radius: 6px; }
body[data-theme="thunderbird"] .btn.accent { box-shadow: 0 1px 2px rgba(19,115,217,0.35); }
body[data-theme="thunderbird"] .att { border-radius: 6px; }
body[data-theme="thunderbird"] .dialog, body[data-theme="thunderbird"] .menu { border-radius: 8px; }

/* ---------- rainloop (旧ウェブメール風) ---------- */
body[data-theme="rainloop"] {
  --font: "Helvetica Neue", "Segoe UI", "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", Arial, sans-serif;
  --accent: #5bb75b;
  --accent-hover: #4aa04a;
  --accent-text: #ffffff;
  --topbar-bg: rgba(20, 24, 40, 0.55);
  --topbar-text: #ffffff;
  --topbar-search-bg: rgba(255,255,255,0.92);
  --topbar-search-text: #333333;
  --page-bg: #3b3f5c;
  --pane-bg: #ffffff;
  --pane-radius: 5px;
  --pane-shadow: 0 2px 10px rgba(0,0,0,0.35);
  --border: #dddddd;
  --border-soft: #e8e8e8;
  --text: #333333;
  --text-2: #444444;
  --text-3: #888888;
  --hover: #f5f5f5;
  --selected: #e4f1fb;
  --selected-bar: #4c8fcf;
  --folder-active: rgba(255,255,255,0.18);
  --unread-subject: #333333;
  --btn-bg: #ffffff;
  --btn-border: #cccccc;
  --input-bg: #ffffff;
  --input-border: #cccccc;
  --danger: #da4f49;
  --ok: #5bb75b;
  --ribbon-bg: rgba(20, 24, 40, 0.35);
  --cmd-bg: transparent;
  --list-item-radius: 0;
  --list-gap: 0;
  --pane-gap: 10px;
  --quote: #777777;
  --rl-blue: #4c8fcf;
  --rl-orange: #f0a233;
}
body[data-theme="rainloop"] { background: radial-gradient(circle at 15% 10%, rgba(140,90,190,0.85) 0%, rgba(140,90,190,0) 55%), radial-gradient(circle at 85% 90%, rgba(60,130,210,0.85) 0%, rgba(60,130,210,0) 55%), radial-gradient(circle at 60% 40%, rgba(90,70,150,0.6) 0%, rgba(90,70,150,0) 60%), linear-gradient(135deg, #262a4a 0%, #3d3f6e 45%, #2a4c80 100%) #2d3252; background-attachment: fixed; }
body[data-theme="rainloop"] #app { background: transparent; }
body[data-theme="rainloop"] .topbar { background: var(--topbar-bg); border-bottom: 1px solid rgba(255,255,255,0.12); backdrop-filter: blur(6px); }
body[data-theme="rainloop"] .brand-logo { background: rgba(255,255,255,0.9); color: #2d3252; border-radius: 4px; }
body[data-theme="rainloop"] .search label { border-radius: 3px; height: 30px; border: 1px solid rgba(0,0,0,0.25); }
body[data-theme="rainloop"] .font-switch { border-color: rgba(255,255,255,0.4); }
body[data-theme="rainloop"] .fs-btn { background: rgba(255,255,255,0.10); }
body[data-theme="rainloop"] .fs-btn.active { background: #ffffff; color: #2d3252; }
body[data-theme="rainloop"] .lang-btn { background: transparent; }
body[data-theme="rainloop"] .avatar { background: rgba(255,255,255,0.92); color: #2d3252; border-radius: 3px; width: auto; padding: 0 8px; height: 26px; font-weight: 600; font-size: 12px; }
body[data-theme="rainloop"] .icon-btn:hover { background: rgba(255,255,255,0.18); }
body[data-theme="rainloop"] .ribbon-tabs { display: none; }
body[data-theme="rainloop"] .cmdbar { background: transparent; box-shadow: none; margin: 10px 12px 0; padding: 0 2px; color: #ffffff; }
body[data-theme="rainloop"] .cmd { color: #f2f2f2; border-radius: 3px; }
body[data-theme="rainloop"] .cmd:hover { background: rgba(255,255,255,0.16); }
body[data-theme="rainloop"] .cmd.primary { background: var(--accent); color: #fff; border: 1px solid #47a447; border-radius: 4px; padding: 0 14px; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 1px 2px rgba(0,0,0,0.25); }
body[data-theme="rainloop"] .cmd.primary:hover { background: var(--accent-hover); }
body[data-theme="rainloop"] .sep { background: rgba(255,255,255,0.28); }
body[data-theme="rainloop"] .body { padding: 8px 12px 12px; }
body[data-theme="rainloop"] .folders { background: transparent; color: #ffffff; padding: 4px 0; }
body[data-theme="rainloop"] .folders .account { color: #ffffff; }
body[data-theme="rainloop"] .collapse-btn { color: rgba(255,255,255,0.7); }
body[data-theme="rainloop"] .collapse-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
body[data-theme="rainloop"] .folder { color: #ffffff; border-radius: 3px; padding: 7px 10px 7px 14px; font-size: 14px; }
body[data-theme="rainloop"] .folder svg { stroke: rgba(255,255,255,0.85); }
body[data-theme="rainloop"] .folder:hover { background: rgba(255,255,255,0.12); }
body[data-theme="rainloop"] .folder.active { background: rgba(255,255,255,0.22); color: #ffffff; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25); }
body[data-theme="rainloop"] .folder.active svg { stroke: #ffffff; }
body[data-theme="rainloop"] .folder .count { background: rgba(255,255,255,0.28); color: #ffffff; border-radius: 9px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
body[data-theme="rainloop"] .folder .count.dim { background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.75); font-weight: 400; }
body[data-theme="rainloop"] .folders-sub { color: rgba(255,255,255,0.75); }
body[data-theme="rainloop"] .folders-sub button { color: rgba(255,255,255,0.75); }
body[data-theme="rainloop"] .quota { color: rgba(255,255,255,0.8); border-top: 1px solid rgba(255,255,255,0.2); }
body[data-theme="rainloop"] .quota-bar { background: rgba(255,255,255,0.22); }
body[data-theme="rainloop"] .quota-fill { background: var(--accent); }
body[data-theme="rainloop"] .splitter::after { background: rgba(255,255,255,0.35); }
body[data-theme="rainloop"] .list { background: #ffffff; border-radius: 5px; box-shadow: var(--pane-shadow); }
body[data-theme="rainloop"] .list-head { border-bottom: 1px solid var(--border); background: #f7f7f7; border-radius: 5px 5px 0 0; }
body[data-theme="rainloop"] .filters { border-radius: 3px; }
body[data-theme="rainloop"] .filters button.active { background: var(--rl-blue); }
body[data-theme="rainloop"] .list-head .icon-btn.on { background: #e4f1fb; color: var(--rl-blue); }
body[data-theme="rainloop"] .group { background: #f7f7f7; border-bottom: 1px solid var(--border-soft); padding: 5px 16px 4px; }
body[data-theme="rainloop"] .item { padding: 9px 12px 9px 40px; border-bottom: 1px solid var(--border-soft); border-left: 4px solid transparent; background: #ffffff; }
body[data-theme="rainloop"] .item .av { display: none; }
body[data-theme="rainloop"] .item .chk { display: block; left: 14px; top: 50%; margin-top: -8px; width: 15px; height: 15px; }
body[data-theme="rainloop"] .item:hover { background: #f3f7fb; }
body[data-theme="rainloop"] .item.unread { background: #fffbe6; border-left-color: var(--rl-orange); }
body[data-theme="rainloop"] .item.unread .sender, body[data-theme="rainloop"] .item.unread .subject { font-weight: 700; color: #222222; }
body[data-theme="rainloop"] .item.selected { background: var(--selected); border-left-color: var(--rl-blue); }
body[data-theme="rainloop"] .item.unread.selected { background: #e4f1fb; }
body[data-theme="rainloop"] .item .date { color: #999999; font-size: 11px; }
body[data-theme="rainloop"] .item .preview { color: #777777; font-size: 12px; }
body[data-theme="rainloop"] .item .flag { color: #f2b01e; }
body[data-theme="rainloop"] .list-foot { background: #f7f7f7; border-top: 1px solid var(--border); border-radius: 0 0 5px 5px; }
body[data-theme="rainloop"] .list-foot .pager .pg { color: var(--rl-blue); font-size: 13px; }
body[data-theme="rainloop"] .list-foot .pager .pg:hover { background: #e4f1fb; }
body[data-theme="rainloop"] .list-foot .pager .pg.cur { color: #ffffff; background: var(--rl-blue); border-bottom: 0; border-radius: 3px; }
body[data-theme="rainloop"] .list-foot button { border-radius: 3px; }
body[data-theme="rainloop"] .reader, body[data-theme="rainloop"] .compose { background: #ffffff; border-radius: 5px; box-shadow: var(--pane-shadow); }
body[data-theme="rainloop"] .reader-empty { color: #999999; }
body[data-theme="rainloop"] .reader-empty svg { opacity: 0.18; }
body[data-theme="rainloop"] .reader-empty .t1 { color: #666666; font-weight: 400; font-size: 16px; }
body[data-theme="rainloop"] .msg-head { background: #fafafa; border-bottom: 1px solid var(--border); padding: 12px 24px 9px; }
body[data-theme="rainloop"] .btn { border-radius: 3px; }
body[data-theme="rainloop"] .btn.accent { background: var(--accent); border-color: #47a447; box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); }
body[data-theme="rainloop"] .att { border-radius: 3px; }
body[data-theme="rainloop"] .dialog, body[data-theme="rainloop"] .menu { border-radius: 5px; }
body[data-theme="rainloop"] .menu { box-shadow: 0 6px 20px rgba(0,0,0,0.35); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--text); background: var(--page-bg); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; left: -9999px; }

/* ---------- Login (design 5) ---------- */
.login-page { background: #f6f7f9; color: #242424; display: flex; flex-direction: column; min-height: 100%; }
.login-topline { height: 6px; background: #0f6cbd; }
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid #e1e5ea; border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); padding: 40px 44px; display: flex; flex-direction: column; gap: 20px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 300; color: #424242; }
.login-logo-img { height: 32px; width: auto; }
.login-logo { width: 28px; height: 28px; border-radius: 4px; background: #0f6cbd; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.login-head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; }
.login-head p { margin: 0; font-size: 13px; color: #616161; }
.login-step { display: flex; flex-direction: column; gap: 16px; }
.login-field input { width: 100%; height: 40px; border: 0; border-bottom: 2px solid #8a8886; padding: 0 2px; font-size: 16px; outline: 0; background: transparent; }
.login-field input:focus { border-bottom-color: #0f6cbd; }
.login-links { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.login-links a { text-decoration: none; }
.login-note { color: #616161; }
.login-help { font-size: 13px; color: #424242; background: #f3f5f8; border-radius: 4px; padding: 10px 12px; line-height: 1.6; }
.login-actions { display: flex; justify-content: flex-end; }
.login-error { background: #fde7e9; color: #a4262c; border-radius: 4px; padding: 10px 12px; font-size: 13px; }
.login-account { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #424242; }
.login-back { width: 28px; height: 28px; border: 0; background: transparent; border-radius: 50%; font-size: 16px; color: #424242; }
.login-back:hover { background: #f3f5f8; }
.login-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #424242; }
.btn-primary { height: 36px; min-width: 108px; border: 0; background: #0f6cbd; color: #fff; border-radius: 2px; font-size: 15px; font-weight: 600; padding: 0 24px; }
.btn-primary:hover { background: #115ea3; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.login-footer { height: 56px; display: flex; align-items: center; justify-content: center; gap: 20px; font-size: 12px; color: #616161; flex-wrap: wrap; padding: 0 16px; }
.login-langs { display: flex; gap: 12px; }
.login-langs a { color: #616161; text-decoration: none; }
.login-langs a.active { color: #242424; font-weight: 700; }

/* ---------- App shell ---------- */
.app { overflow: hidden; }
#app { height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 48px; flex-shrink: 0; background: var(--topbar-bg); color: var(--topbar-text); display: flex; align-items: center; padding: 0 12px 0 16px; gap: 12px; border-bottom: 1px solid var(--border); }
body[data-theme="classic"] .topbar, body[data-theme="dark"] .topbar { border-bottom: 0; }
.brand { display: flex; align-items: center; gap: 10px; width: 232px; font-size: 17px; font-weight: 300; letter-spacing: 0.2px; flex-shrink: 0; font-family: "Segoe UI Light", "Segoe UI", "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; }
.brand-img { height: 30px; width: auto; display: block; }
.brand-name { white-space: nowrap; }
.brand-logo { width: 28px; height: 28px; border-radius: 6px; background: var(--accent-text); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
body[data-theme="light"] .brand-logo { background: var(--accent); color: #fff; }
body[data-theme="dark"] .brand-logo { background: var(--accent); color: var(--accent-text); }
.search { flex: 1; display: flex; justify-content: center; }
.search label { width: 100%; max-width: 640px; height: 32px; background: var(--topbar-search-bg); border-radius: 4px; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--text-3); }
body[data-theme="light"] .search label { border: 1px solid var(--border); border-radius: 8px; }
body[data-theme="dark"] .search label { border: 1px solid #2d5385; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--topbar-search-text); }
.search input::placeholder { color: var(--text-3); }
.topbar-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.font-switch { display: flex; border: 1px solid rgba(255,255,255,0.55); border-radius: 4px; overflow: hidden; margin-right: 6px; }
.fs-btn { height: 24px; border: 0; background: rgba(255,255,255,0.12); color: inherit; padding: 0 6px; font-size: 10px; line-height: 1; white-space: nowrap; }
.fs-btn + .fs-btn { border-left: 1px solid rgba(255,255,255,0.35); }
.fs-btn.active { background: #ffffff; color: var(--accent); font-weight: 700; }
body[data-theme="light"] .font-switch, body[data-theme="thunderbird"] .font-switch { border-color: var(--border); }
body[data-theme="light"] .fs-btn, body[data-theme="thunderbird"] .fs-btn { background: #fff; color: var(--text-2); }
body[data-theme="light"] .fs-btn + .fs-btn, body[data-theme="thunderbird"] .fs-btn + .fs-btn { border-left-color: var(--border); }
body[data-theme="light"] .fs-btn.active, body[data-theme="thunderbird"] .fs-btn.active { background: var(--accent); color: #fff; }
body[data-theme="dark"] .font-switch { border-color: #2d5385; }
body[data-theme="dark"] .fs-btn { background: #1f3a5c; }
body[data-theme="dark"] .fs-btn.active { background: var(--accent); color: var(--accent-text); }
body[data-fontsize="xs"] .ribbon-tabs, body[data-fontsize="xs"] .cmdbar, body[data-fontsize="xs"] .body { zoom: 0.8; }
body[data-fontsize="s"] .ribbon-tabs, body[data-fontsize="s"] .cmdbar, body[data-fontsize="s"] .body { zoom: 0.9; }
body[data-fontsize="l"] .ribbon-tabs, body[data-fontsize="l"] .cmdbar, body[data-fontsize="l"] .body { zoom: 1.15; }
body[data-fontsize="xl"] .ribbon-tabs, body[data-fontsize="xl"] .cmdbar, body[data-fontsize="xl"] .body { zoom: 1.3; }
.topbar .mobile-menu { display: none; }
.dlg-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.icon-btn { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.icon-btn:hover { background: rgba(127,127,127,0.18); }
.icon-btn svg { width: 20px; height: 20px; }
.lang-btn { height: 30px; white-space: nowrap; flex-shrink: 0; border: 0; background: transparent; color: inherit; border-radius: 4px; padding: 0 7px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.lang-btn:hover { background: rgba(127,127,127,0.18); }
body[data-theme="light"] .lang-btn { background: transparent; }
.lang-btn .flag-ico { width: 18px; height: 12px; }
.flag-ico { width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,0.18); flex-shrink: 0; display: inline-block; vertical-align: middle; }
.lang-item { display: inline-flex; align-items: center; gap: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-text); color: var(--accent); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; cursor: pointer; border: 0; }
body[data-theme="light"] .avatar { background: var(--accent); color: #fff; }
body[data-theme="dark"] .avatar { background: var(--accent); color: var(--accent-text); }

.ribbon-tabs { height: 32px; flex-shrink: 0; background: var(--ribbon-bg); display: flex; align-items: flex-end; padding: 0 20px; gap: 28px; border-bottom: 1px solid var(--border); }
.ribbon-tabs .tab { font-size: 14px; color: var(--text-2); padding: 0 0 6px; border-bottom: 3px solid transparent; background: none; border-top: 0; border-left: 0; border-right: 0; line-height: 1; }
.ribbon-tabs .tab.active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
body[data-theme="light"] .ribbon-tabs { display: none; }

.cmdbar { height: 42px; flex-shrink: 0; background: var(--cmd-bg); margin: 6px 12px 0; border-radius: var(--pane-radius); box-shadow: var(--pane-shadow); display: flex; align-items: center; padding: 0 8px; gap: 1px; overflow: hidden; font-size: 13px; }
body[data-theme="dark"] .cmdbar { margin: 0; border-radius: 0; border-bottom: 1px solid var(--border); }
body[data-theme="light"] .cmdbar { margin: 10px 12px 0; }
.cmd { height: 30px; border: 0; background: transparent; color: var(--text-2); border-radius: 4px; padding: 0 7px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cmd:hover { background: var(--hover); }
.cmd:disabled { opacity: 0.45; cursor: default; background: transparent; }
.cmd svg { width: 17px; height: 17px; flex-shrink: 0; }
.cmd.primary { background: var(--accent); color: var(--accent-text); font-weight: 600; padding: 0 12px; font-size: 14px; }
.cmd.primary:hover { background: var(--accent-hover); }
.cmd.primary svg { stroke: currentColor; }
.cmd.sync-btn { margin-left: 4px; }
.cmd.sync-btn.syncing svg { animation: wm-spin 0.9s linear infinite; }
@keyframes wm-spin { to { transform: rotate(360deg); } }
.cmd.danger svg { stroke: var(--danger); }
.sep { width: 1px; height: 22px; background: var(--border); margin: 0 5px; flex-shrink: 0; }

.body { flex: 1; display: flex; gap: var(--pane-gap); padding: 8px 12px 12px; min-height: 0; }
body[data-theme="dark"] .body { padding: 0; }
body[data-theme="light"] .body { padding: 10px 12px 12px; }

/* main (list + reader) */
.main { flex: 1; min-width: 0; min-height: 0; display: flex; gap: 0; }
body[data-reading="bottom"] .main { flex-direction: column; }
.splitter { flex-shrink: 0; width: var(--pane-gap); min-width: 6px; cursor: col-resize; position: relative; z-index: 5; }
.splitter::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 2px; height: 36px; border-radius: 1px; background: var(--border); }
.splitter:hover::after, body.resizing .splitter::after { background: var(--accent); }
body[data-reading="bottom"] .splitter { width: auto; min-width: 0; height: var(--pane-gap); min-height: 6px; cursor: row-resize; }
body[data-reading="bottom"] .splitter::after { width: 36px; height: 2px; }
body.resizing, body.col-resizing { user-select: none; cursor: col-resize; }
body.col-resizing iframe { pointer-events: none; }
body.resizing[data-reading="bottom"] { cursor: row-resize; }
body.resizing iframe { pointer-events: none; }
body[data-reading="bottom"] .list { width: auto !important; flex: none; }
body[data-reading="right"] .list { height: auto !important; }
body[data-reading="bottom"] .reader, body[data-reading="bottom"] .compose { flex: 1; min-height: 160px; }
body[data-theme="dark"] .splitter::after { background: #3d3d3d; }

/* folder pane */
.folders { width: 232px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; overflow-y: auto; }
body[data-theme="dark"] .folders { background: var(--page-bg); border-right: 1px solid var(--border); padding: 12px 8px; }
body[data-theme="light"] .folders { padding: 4px 0; }
.folders .account { display: flex; align-items: center; gap: 6px; padding: 6px 4px 6px 8px; font-weight: 700; font-size: 13px; }
.folders .acct-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collapse-btn { width: 24px; height: 24px; border: 0; background: transparent; color: var(--text-3); border-radius: 4px; font-size: 16px; line-height: 1; flex-shrink: 0; }
.collapse-btn:hover { background: var(--hover); color: var(--text); }
/* icon-only folder pane */
body[data-folders="icons"] .folders { width: 52px; padding-left: 4px; padding-right: 4px; }
body[data-folders="icons"] .folders .acct-text, body[data-folders="icons"] .folder .fname, body[data-folders="icons"] .folders-sub span, body[data-folders="icons"] .quota-text { display: none; }
body[data-folders="icons"] .folders .account { justify-content: center; padding: 6px 0; }
body[data-folders="icons"] .folder { justify-content: center; padding: 9px 0 !important; position: relative; }
body[data-folders="icons"] .folder .count { position: absolute; top: 2px; right: 2px; font-size: 10px; padding: 0 4px; min-width: 14px; text-align: center; background: var(--accent); color: var(--accent-text); border-radius: 8px; font-weight: 700; }
body[data-folders="icons"] .folder .count.dim { display: none; }
body[data-folders="icons"] .folders-sub { justify-content: center; padding: 8px 0 2px; }
body[data-folders="icons"] .quota { padding: 8px 4px; }
body[data-theme="dark"][data-folders="icons"] .folder.active { padding-left: 0 !important; }
.folder { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 22px; border-radius: 4px; color: var(--text); border: 0; background: transparent; width: 100%; text-align: left; }
body[data-theme="light"] .folder { border-radius: 8px; padding-left: 12px; }
.folder:hover { background: var(--hover); }
.folder.active { background: var(--folder-active); font-weight: 600; }
body[data-theme="light"] .folder.active { color: var(--accent); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
body[data-theme="dark"] .folder.active { border-left: 3px solid var(--accent); padding-left: 19px; }
.folder svg { width: 18px; height: 18px; flex-shrink: 0; stroke: var(--text-2); }
.folder.active svg { stroke: var(--accent); }
.folder .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .count { color: var(--accent); font-weight: 700; font-size: 13px; }
body[data-theme="light"] .folder .count { background: var(--accent); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.folder .count.dim { color: var(--text-3); font-weight: 400; }
body[data-theme="light"] .folder .count.dim { background: transparent; color: var(--text-3); }
.folders-sub { font-size: 12px; font-weight: 700; color: var(--text-3); padding: 12px 10px 4px; display: flex; align-items: center; justify-content: space-between; }
.folders-sub button { border: 0; background: transparent; color: var(--text-3); font-size: 16px; line-height: 1; padding: 0 4px; }
.quota { margin-top: auto; padding: 12px 10px 8px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.quota-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.quota-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.quota-fill.warn { background: var(--danger); }
.quota-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* message list */
.list { width: 380px; flex-shrink: 0; background: var(--pane-bg); border-radius: var(--pane-radius); box-shadow: var(--pane-shadow); display: flex; flex-direction: column; overflow: hidden; }
body[data-theme="dark"] .list { background: #202020; border-right: 1px solid var(--border); border-radius: 0; }
body[data-theme="light"] .list { background: transparent; box-shadow: none; }
.list-head { height: 48px; flex-shrink: 0; display: flex; align-items: center; padding: 0 8px 0 16px; gap: 6px; border-bottom: 1px solid var(--border-soft); }
body[data-theme="light"] .list-head { border-bottom: 0; padding-left: 4px; }
.list-head .list-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-head h2 { margin: 0; font-size: 16px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-chips { font-size: 11px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-head .icon-btn { width: 32px; height: 32px; color: var(--text-2); }
.list-head .icon-btn.on { background: var(--selected); color: var(--accent); }
.menu-row { display: flex; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--border-soft); }
.filters { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.filters button { height: 26px; border: 0; background: var(--btn-bg); color: var(--text-2); padding: 0 9px; font-size: 12px; }
.filters button.active { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.list-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: var(--list-gap); }
.group { padding: 8px 16px 4px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.item { display: flex; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border-soft); cursor: pointer; border-left: 4px solid transparent; position: relative; background: var(--pane-bg); border-radius: var(--list-item-radius); }
body[data-theme="dark"] .item { background: transparent; }
body[data-theme="light"] .item { border-bottom: 0; border-left: 0; padding: 12px 14px; }
.item:hover { background: var(--hover); }
.item.selected { background: var(--selected); border-left-color: var(--selected-bar); }
body[data-theme="light"] .item.selected { box-shadow: 0 0 0 2px var(--accent) inset; background: #fff; }
.item .av { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; color: #fff; }
.item .chk { position: absolute; left: 14px; top: 20px; width: 16px; height: 16px; display: none; }
.list.selecting .item .chk, .item:hover .chk { display: block; }
.list.selecting .item .av, .item:hover .av { visibility: hidden; }
.item .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .row1 { display: flex; justify-content: space-between; gap: 8px; }
.item .sender { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.unread .sender { font-weight: 700; }
.item .date { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.item .subject { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.unread .subject { color: var(--unread-subject); font-weight: 600; }
.item .preview { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.item .icons { display: flex; gap: 4px; align-items: center; }
.item .icons svg { width: 14px; height: 14px; }
.item .flag { color: var(--danger); }
.list-foot { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px 6px 12px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border-soft); }
.list-foot .list-count { white-space: nowrap; }
.list-foot .pager { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: flex-end; overflow: hidden; }
.list-foot .pager .pg { border: 0; background: transparent; color: var(--text-3); font-size: 13px; padding: 2px 4px; min-width: 22px; height: 24px; border-radius: 3px; }
.list-foot .pager .pg:hover { background: var(--hover); color: var(--text); }
.list-foot .pager .pg.cur { color: var(--text); font-weight: 700; border-bottom: 2px solid var(--text); border-radius: 0; cursor: default; }
.list-foot .pager .dots { padding: 0 2px; cursor: pointer; }
.list-foot .list-nav { display: flex; gap: 4px; white-space: nowrap; }
.list-foot button { height: 26px; border: 1px solid var(--btn-border); background: var(--btn-bg); border-radius: 4px; padding: 0 8px; font-size: 12px; color: var(--text-2); }
.list-foot button:disabled { opacity: 0.4; cursor: default; }
.empty { padding: 40px 16px; text-align: center; color: var(--text-3); }

/* reading pane */
.reader { flex: 1; min-width: 0; background: var(--pane-bg); border-radius: var(--pane-radius); box-shadow: var(--pane-shadow); display: flex; flex-direction: column; overflow: hidden; }
body[data-theme="dark"] .reader { border-radius: 0; }
.reader-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-3); gap: 6px; }
.reader-empty svg { width: 120px; height: 120px; opacity: 0.35; margin-bottom: 12px; }
.reader-empty .t1 { font-weight: 600; color: var(--text-2); font-size: 15px; }
.msg-head { padding: 15px 28px 9px; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 9px; }
.msg-subject { font-size: 16px; font-weight: 700; word-break: break-word; line-height: 1.15; }
.msg-meta { display: flex; align-items: flex-start; gap: 9px 12px; flex-wrap: wrap; }
.msg-meta .av { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: #fff; flex-shrink: 0; }
.msg-meta .who { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-3); line-height: 1.65; }
.msg-meta .who .from { font-size: 14px; color: var(--text); }
.msg-meta .who .from b { font-weight: 700; }
.msg-actions { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; margin-left: auto; }
.btn { height: 32px; border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--text); border-radius: 4px; padding: 0 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn svg { width: 15px; height: 15px; }
.btn.accent { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.btn.accent:hover { background: var(--accent-hover); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.att { display: flex; align-items: center; gap: 8px; border: 1px solid var(--btn-border); border-radius: 4px; padding: 6px 10px; font-size: 13px; background: var(--hover); color: inherit; text-decoration: none; max-width: 320px; }
.att .ic { width: 26px; height: 26px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; text-transform: uppercase; }
.att .ic.pdf { background: #c4314b; } .att .ic.img { background: #107c41; } .att .ic.doc { background: #185abd; } .att .ic.xls { background: #107c41; } .att .ic.zip { background: #8a4b08; }
.att .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.att .s { font-size: 11px; color: var(--text-3); }
.att .rm { border: 0; background: transparent; color: var(--text-3); font-size: 16px; line-height: 1; padding: 0 2px; }
.blocked-bar { background: #fff4ce; color: #7a5b00; padding: 8px 28px; font-size: 13px; display: flex; align-items: center; gap: 12px; }
body[data-theme="dark"] .blocked-bar { background: #3d3410; color: #ffe58a; }
.msg-body { flex: 1; overflow: auto; padding: 0; background: var(--pane-bg); }
.msg-body iframe { width: 100%; border: 0; display: block; min-height: 200px; }
.loading { padding: 24px; color: var(--text-3); text-align: center; }

/* compose */
.compose { flex: 1; min-width: 0; background: var(--pane-bg); border-radius: var(--pane-radius); box-shadow: var(--pane-shadow); display: flex; flex-direction: column; overflow: hidden; }
.compose-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border-soft); }
.compose-head h2 { margin: 0; font-size: 16px; flex: 1; }
.compose-row { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-bottom: 1px solid var(--border-soft); }
.compose-row label { width: 60px; color: var(--text-3); font-size: 13px; flex-shrink: 0; }
.compose-row input { flex: 1; border: 0; outline: 0; background: transparent; height: 30px; }
.compose-row .link { border: 0; background: transparent; color: var(--accent); font-size: 12px; }
.compose-tools { display: flex; gap: 2px; padding: 4px 12px; border-bottom: 1px solid var(--border-soft); }
.compose-tools button { width: 32px; height: 30px; border: 0; background: transparent; border-radius: 4px; color: var(--text-2); font-weight: 700; }
.compose-tools button:hover { background: var(--hover); }
.compose-editor { flex: 1; overflow: auto; padding: 16px 20px; outline: 0; font-size: 15px; line-height: 1.7; word-break: break-word; }
.compose-editor:empty:before { content: attr(data-ph); color: var(--text-3); }
.compose-editor blockquote { border-left: 3px solid var(--border); margin: 8px 0; padding-left: 12px; color: var(--text-2); }
.compose-atts { padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border-soft); }
.compose-atts:empty { display: none; }
.suggest { position: fixed; background: var(--pane-bg); border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 50; max-height: 220px; overflow: auto; min-width: 260px; }
.suggest div { padding: 6px 10px; cursor: pointer; font-size: 13px; }
.suggest div:hover, .suggest div.hl { background: var(--hover); }
.suggest small { color: var(--text-3); margin-left: 6px; }

/* dialogs / menus */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; z-index: 100; }
.dialog { background: var(--pane-bg); color: var(--text); border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,0.3); width: 420px; max-width: 94vw; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.dialog h3 { margin: 0; padding: 16px 20px; font-size: 16px; border-bottom: 1px solid var(--border-soft); }
.dialog .dlg-body { padding: 16px 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog .dlg-foot { padding: 12px 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 8px; }
.dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.dialog input[type=text], .dialog input[type=number], .dialog select, .dialog textarea { height: 34px; border: 1px solid var(--input-border); border-radius: 4px; padding: 0 10px; background: var(--input-bg); color: var(--text); }
.dialog textarea { height: 100px; padding: 8px 10px; resize: vertical; }
.dialog .folder-pick { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: auto; }
.dialog .folder-pick button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 4px; color: var(--text); }
.dialog .folder-pick button:hover { background: var(--hover); }
.menu { position: fixed; background: var(--pane-bg); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.18); z-index: 90; min-width: 200px; padding: 4px; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 12px; border-radius: 4px; color: var(--text); }
.menu button:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--border-soft); margin: 4px 0; }
.theme-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-pick button { border: 2px solid var(--border); border-radius: 8px; padding: 6px; background: var(--pane-bg); display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.theme-pick button.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.theme-pick .sw { height: 32px; border-radius: 5px; overflow: hidden; display: flex; flex-direction: column; }
.theme-pick .sw i { display: block; height: 9px; }
.theme-pick .sw b { flex: 1; display: flex; }
.theme-pick .sw b span:first-child { width: 30%; }
.theme-pick .sw b span:last-child { flex: 1; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #242424; color: #fff; padding: 10px 18px; border-radius: 6px; font-size: 13px; z-index: 200; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.toast.err { background: #a4262c; }

.dialog.wide { width: 900px; }
.hdr-table { width: 100%; border-collapse: collapse; font-size: 14px; border: 1px solid var(--border); }
.hdr-table th { text-align: left; font-weight: 400; color: var(--text-2); width: 150px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.hdr-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); word-break: break-all; }
.hdr-id { color: #107c41; }
.hdr-badge { font-weight: 600; }
.hdr-badge.ok { color: #107c41; } .hdr-badge.ng { color: var(--danger); }
.hdr-extra { color: var(--text-2); margin-left: 4px; }
.hdr-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hdr-raw-title { font-size: 12px; font-weight: 700; color: var(--text-3); margin-top: 4px; }
.hdr-raw { background: var(--hover); border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; font-family: Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow: auto; margin: 0; user-select: text; }
.folder.drop { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--selected); }
.item[draggable="true"] { cursor: grab; }
.drag-ghost { position: fixed; top: -1000px; left: -1000px; background: var(--accent); color: var(--accent-text); padding: 6px 12px; border-radius: 6px; font-size: 13px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
/* command bar: drop labels before it can overflow (never scrolls) */
@media (max-width: 1500px) { .cmd.lbl-2 span { display: none; } }
@media (max-width: 1250px) { .cmd.lbl-1 span { display: none; } .sep { margin: 0 3px; } }
@media (max-width: 1000px) { .cmd:not(.primary) span { display: none; } .cmd { padding: 0 6px; } }
/* responsive */
@media (max-width: 1000px) {
  .topbar .mobile-menu { display: inline-flex; }
  .folders { position: absolute; left: 0; top: 0; bottom: 0; width: 260px; background: var(--pane-bg); z-index: 40; padding: 12px 8px; box-shadow: 4px 0 16px rgba(0,0,0,0.2); transform: translateX(-100%); transition: transform .15s; }
  .folders.open { transform: none; }
  .brand span:last-child { display: none; }
  .brand { width: auto; }
  .list { width: 100% !important; height: auto !important; flex: 1; }
  .splitter { display: none; }
  .main { flex-direction: column !important; }
  .reader, .compose { position: absolute; inset: 0; z-index: 30; border-radius: 0; }
  .reader.hidden-mobile { display: none; }
  .msg-head { padding: 12px 16px; }
  .msg-actions { flex-wrap: wrap; }
  .body { position: relative; }
  .ribbon-tabs { display: none; }
}
@media print {
  .topbar, .ribbon-tabs, .cmdbar, .folders, .list, .msg-actions { display: none !important; }
  .reader { position: static; box-shadow: none; }
}

/* ---------- full-screen reading layout ---------- */
body[data-reading="full"] .list { width: auto !important; height: auto !important; flex: 1; }
body[data-reading="full"] .splitter { display: none; }
body[data-reading="full"]:not(.full-open) .reader, body[data-reading="full"]:not(.full-open) .compose { display: none; }
body[data-reading="full"].full-open .list { display: none; }
body[data-reading="full"].full-open .reader, body[data-reading="full"].full-open .compose { flex: 1; }

/* ---------- compact single-row list (bottom / full layouts) ---------- */
.list-cols { display: none; }
body[data-list="rows"] .list-cols { display: grid; grid-template-columns: 26px var(--c-sender, 200px) minmax(0, 1fr) var(--c-prev, 240px) var(--c-date, 128px); align-items: stretch; height: 26px; flex-shrink: 0; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-3); padding: 0 8px 0 6px; }
body[data-list="rows"] .list-cols .colc { position: relative; display: flex; align-items: center; min-width: 0; }
body[data-list="rows"] .list-cols .colc .col { flex: 1; min-width: 0; }
body[data-list="rows"] .list-cols .col-grip { position: absolute; right: -4px; top: 0; bottom: 0; width: 9px; cursor: col-resize; z-index: 2; }
body[data-list="rows"] .list-cols .col-grip::after { content: ''; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 1px; background: var(--border); }
body[data-list="rows"] .list-cols .col-grip:hover::after, body.col-resizing .list-cols .col-grip::after { background: var(--accent); width: 2px; }
body[data-list="rows"] .list-cols .col { border: 0; background: transparent; color: var(--text-2); font-weight: 700; font-size: 12px; text-align: left; padding: 0 6px; height: 26px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
body[data-list="rows"] .list-cols .col-prev { font-weight: 400; color: var(--text-3); }
body[data-list="rows"] .list-cols .col:hover { background: var(--hover); }
body[data-list="rows"] .list-cols .col-date { text-align: right; }
body[data-list="rows"] .list-body { gap: 0; padding: 0; }
body[data-list="rows"] .list-body .group { padding: 3px 12px 2px; font-size: 11px; flex: none; }
body[data-list="rows"] .list-body .item { display: grid; grid-template-columns: 26px var(--c-sender, 200px) minmax(0, 1fr) var(--c-prev, 240px) var(--c-date, 128px); grid-template-rows: 100%; grid-auto-flow: dense; align-items: center; gap: 0; padding: 0 8px 0 6px; height: 27px; flex: none; border-radius: 0; border-bottom: 1px solid var(--border-soft); border-left: 3px solid transparent; box-shadow: none; margin: 0; }
body[data-list="rows"] .list-body .item .av { display: none; }
body[data-list="rows"] .list-body .item .chk { display: block; position: static; grid-column: 1; grid-row: 1; margin: 0 0 0 4px; width: 14px; height: 14px; }
body[data-list="rows"] .list-body .item .main, body[data-list="rows"] .list-body .item .row1 { display: contents; }
body[data-list="rows"] .list-body .item .sender { grid-column: 2; grid-row: 1; padding: 0 6px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-list="rows"] .list-body .item .subject { grid-column: 3; grid-row: 1; padding: 0 6px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-list="rows"] .list-body .item .preview { grid-column: 4; grid-row: 1; padding: 0 6px; font-size: 12px; color: var(--text-3); display: flex; overflow: hidden; }
body[data-list="rows"] .list-body .item .preview > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-list="rows"] .list-body .item .preview .icons { order: 2; margin-left: 6px; }
body[data-list="rows"] .list-body .item .date { grid-column: 5; grid-row: 1; text-align: right; font-size: 12px; padding-right: 2px; white-space: nowrap; }
body[data-list="rows"] .list-body .item.unread { background: var(--pane-bg); }
body[data-list="rows"] .list-body .item.unread .subject { font-weight: 700; }
body[data-list="rows"] .list-body .item.selected { background: var(--selected); border-left-color: var(--selected-bar); }
body[data-list="rows"] .list-body .item:hover { background: var(--hover); }
body[data-list="rows"] .list-body .item.selected:hover { background: var(--selected); }
body[data-theme="rainloop"]:not([data-reading="right"]) .list-body .item.unread { background: #fffbe6; border-left-color: var(--rl-orange); }
body[data-theme="thunderbird"]:not([data-reading="right"]) .list-body .item { border: 0; border-bottom: 1px solid var(--border-soft); border-left: 3px solid transparent; }
body[data-theme="thunderbird"]:not([data-reading="right"]) .list-body .item.unread { border-left-color: var(--accent); }
body[data-theme="dark"]:not([data-reading="right"]) .list-body .item.unread { background: transparent; }
body[data-list="rows"] .list-head { height: 40px; }
body[data-list="rows"] .list-foot { padding-top: 3px; padding-bottom: 3px; }
@media (max-width: 900px) {
  body[data-list="rows"] .list-cols, body[data-list="rows"] .list-body .item { grid-template-columns: 26px 130px minmax(0, 1fr) 0 var(--c-date, 128px); }
  body[data-list="rows"] .list-body .item .preview, body[data-list="rows"] .list-cols .colc:nth-child(4) { display: none; }
}

/* ---------- compose: format / fonts / drawing ---------- */
.compose-tools { flex-wrap: wrap; align-items: center; }
.compose-tools .tool-select { height: 28px; border: 1px solid var(--btn-border); background: var(--input-bg); color: var(--text); border-radius: 4px; padding: 0 4px; font-size: 12px; max-width: 150px; }
.compose-tools .font-sel { width: 130px; }
.compose-tools .size-sel { width: 66px; }
.compose-tools .fmt-sel { width: 110px; }
.compose-tools .tool-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.compose-tools .draw-btn { width: auto; padding: 0 8px; display: inline-flex; align-items: center; gap: 4px; font-weight: 400; font-size: 12px; }
.compose-tools .draw-btn svg { width: 15px; height: 15px; }
.compose-textarea { flex: 1; resize: none; border: 0; outline: 0; padding: 16px 20px; font-size: 14px; line-height: 1.6; font-family: "Consolas", "Courier New", "MS Gothic", monospace; background: var(--pane-bg); color: var(--text); }
.dialog.dialog-wide { width: auto; max-width: 96vw; }
.draw-wrap { display: flex; flex-direction: column; gap: 8px; }
.draw-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.draw-colors { display: flex; gap: 4px; }
.draw-color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); padding: 0; }
.draw-color.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--selected); }
.draw-widths { display: flex; gap: 2px; }
.draw-width { width: 28px; height: 28px; border: 1px solid transparent; background: transparent; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; }
.draw-width i { display: block; border-radius: 50%; background: var(--text); }
.draw-width.on { border-color: var(--accent); background: var(--selected); }
.draw-tools .btn.on { background: var(--selected); border-color: var(--accent); color: var(--accent); }
.draw-canvas { border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: crosshair; touch-action: none; max-width: 100%; height: auto; }
.draw-hint { font-size: 12px; color: var(--text-3); }

/* ---------- density (間隔) ---------- */
.cmd.has-caret span::after { content: ' \25BE'; font-size: 10px; opacity: 0.7; }
/* card layout (reading = right) */
body[data-list="card"][data-density="wide"] .item { padding-top: 14px; padding-bottom: 14px; }
body[data-list="card"][data-density="wide"] .item .main { gap: 4px; }
body[data-list="card"][data-density="compact"] .item { padding-top: 5px; padding-bottom: 5px; gap: 8px; }
body[data-list="card"][data-density="compact"] .item .preview { display: none; }
body[data-list="card"][data-density="compact"] .item .av { width: 26px; height: 26px; font-size: 11px; }
body[data-list="card"][data-density="compact"] .item .chk { top: 13px; }
body[data-list="card"][data-density="compact"] .list-body .group { padding: 4px 16px 2px; }
/* row layout (bottom / full): medium = single line, compact = tighter single line, wide = two lines */
body[data-list="rows"][data-density="compact"] .list-body .item { height: 23px; }
body[data-list="rows"][data-density="compact"] .list-body .item .sender, body[data-list="rows"][data-density="compact"] .list-body .item .subject { font-size: 12px; }
body[data-list="rows"][data-density="compact"] .list-body .item .preview, body[data-list="rows"][data-density="compact"] .list-body .item .date { font-size: 11px; }
body[data-list="rows"][data-density="wide"] .list-cols, body[data-list="rows"][data-density="wide"] .list-body .item { grid-template-columns: 26px var(--c-sender, 200px) minmax(0, 1fr) 0 var(--c-date, 128px); }
body[data-list="rows"][data-density="wide"] .list-cols .colc:nth-child(4) { display: none; }
body[data-list="rows"][data-density="wide"] .list-body .item { height: 46px; grid-template-rows: 22px 18px; align-items: center; padding-top: 3px; }
body[data-list="rows"][data-density="wide"] .list-body .item .preview { grid-column: 2 / 6; grid-row: 2; padding: 0 6px; }
body[data-list="rows"][data-density="wide"] .list-body .item .preview .icons { order: 0; margin: 0 6px 0 0; }
body[data-list="rows"] .list-cols .colc:nth-child(2) { grid-column: 2; }
body[data-list="rows"] .list-cols .colc:nth-child(3) { grid-column: 3; }
body[data-list="rows"] .list-cols .colc:nth-child(4) { grid-column: 4; }
body[data-list="rows"] .list-cols .colc:nth-child(5) { grid-column: 5; }
.fs-current { margin-right: 2px; }
.fs-current svg { width: 18px; height: 18px; }
.fs-current span::after { content: ' \25BE'; font-size: 9px; opacity: 0.75; }

/* 1-line list while the reading pane is on the right: narrow, so no address column */
body[data-reading="right"][data-list="rows"] .list-cols, body[data-reading="right"][data-list="rows"] .list-body .item { grid-template-columns: 26px var(--c-sender, 200px) minmax(0, 1fr) 0 var(--c-date, 128px); }
body[data-reading="right"][data-list="rows"] .list-cols .colc:nth-child(4) { display: none; }
body[data-reading="right"][data-list="rows"][data-density="wide"] .list-body .item .preview { display: flex; }
body[data-reading="right"][data-list="rows"]:not([data-density="wide"]) .list-body .item .preview { display: none; }

/* ==================== contacts ==================== */
.cbody .cfolders { width: 232px; }
.clist { width: auto !important; flex: 1; min-width: 0; height: auto !important; }
.clist .list-head { gap: 10px; }
.csearch { height: 30px; border: 1px solid var(--input-border); border-radius: 4px; padding: 0 10px; background: var(--input-bg); color: var(--text); width: 220px; max-width: 45%; font-size: 13px; }
.ccols { display: grid; grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 1.3fr) minmax(0, 1fr) 140px; align-items: center; gap: 0 8px; height: 28px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text-2); }
.ccols input { width: 15px; height: 15px; margin: 0; }
.clist-body { gap: 0; }
.clist-body .group { padding: 4px 14px 2px; flex: none; }
.citem { display: grid; grid-template-columns: 26px 26px 28px minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) 140px; align-items: center; gap: 0 8px; height: 40px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--border-soft); cursor: pointer; flex: none; border-left: 3px solid transparent; }
.citem:hover { background: var(--hover); }
.citem.selected { background: var(--selected); }
.citem.current { border-left-color: var(--selected-bar); background: var(--selected); }
.citem input { width: 15px; height: 15px; margin: 0; }
.citem .cfav { width: 24px; height: 24px; border: 0; background: transparent; color: var(--text-3); border-radius: 4px; padding: 3px; }
.citem .cfav svg { width: 18px; height: 18px; }
.citem .cfav.on { color: #e5a400; }
.citem .cfav:hover { background: rgba(127,127,127,0.18); }
.citem .av, .cpick-row .av { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; color: #fff; flex-shrink: 0; }
.citem .cname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.citem .cemail, .citem .ccompany, .citem .cphone { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdetail { flex: 1; min-width: 0; }
.cav-big { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; color: #fff; flex-shrink: 0; }
.cdet-name { font-size: 20px; font-weight: 700; color: var(--text); }
.cdet-body { flex: 1; overflow: auto; padding: 12px 28px 24px; }
.cdet-sec { margin-top: 14px; }
.cdet-sec h4 { margin: 0 0 6px; font-size: 13px; color: var(--text-3); font-weight: 700; border-bottom: 1px solid var(--border-soft); padding-bottom: 4px; }
.cdet-row { display: flex; gap: 12px; padding: 4px 0; font-size: 14px; }
.cdet-row .k { width: 150px; flex-shrink: 0; color: var(--text-3); font-size: 13px; }
.cdet-row .v { flex: 1; min-width: 0; word-break: break-word; }
.cdet-notes { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: 13px; }
@media (max-width: 1100px) { .ccols, .citem { grid-template-columns: 26px 26px 28px minmax(0, 1fr) minmax(0, 1.2fr) 0 0; } .ccols { grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 1.3fr) 0 0; } .citem .ccompany, .citem .cphone, .ccols span:nth-child(4), .ccols span:nth-child(5) { display: none; } }
/* editor */
.dialog.dialog-contact { width: 900px; }
.cf-wrap { display: flex; gap: 16px; height: min(70vh, 640px); }
.cf-nav { width: 170px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.cf-nav button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--text-2); padding: 8px 10px; border-radius: 4px; text-align: left; border-left: 3px solid transparent; font-size: 14px; }
.cf-nav button svg { width: 18px; height: 18px; }
.cf-nav button:hover { background: var(--hover); }
.cf-nav button.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.cf-form { flex: 1; overflow: auto; padding-right: 8px; position: relative; }
.cf-sec { padding: 4px 4px 18px; }
.cf-sec h4 { margin: 0 0 8px; font-size: 16px; }
.cf-sec h5 { margin: 12px 0 4px; font-size: 13px; color: var(--text-3); font-weight: 700; }
.cf { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.cf input, .cf textarea { height: 34px; border: 1px solid var(--input-border); border-radius: 4px; padding: 0 10px; background: var(--input-bg); color: var(--text); font-size: 14px; width: 100%; }
.cf textarea { height: 140px; padding: 8px 10px; resize: vertical; font-family: inherit; }
.cf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cf-addr { margin-bottom: 8px; }
/* picker */
.dialog.dialog-pick { width: 620px; }
.compose-row .abook-btn { display: inline-flex; align-items: center; width: 30px; height: 30px; padding: 0; justify-content: center; }
.compose-row .abook-btn svg { width: 18px; height: 18px; }
/* contacts view is independent of the mail reading-pane layout */
.cbody .main { flex-direction: row !important; }
.cbody .clist, .cbody .cdetail { display: flex !important; }
.cbody .clist { width: auto !important; height: auto !important; flex: 1 1 55% !important; }
.cbody .cdetail { flex: 1 1 45% !important; min-height: 0; }
.cbody .list-head { height: 48px; }

/* ---------- transfer status (folder pane, above quota) ---------- */
.fstatus { margin-top: auto; padding: 6px 10px 0; font-size: 11px; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }
.fstatus + .quota { margin-top: 0; }
.fstatus-text { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fstatus-ic { display: inline-flex; width: 12px; height: 12px; flex-shrink: 0; }
.fstatus-ic svg { width: 12px; height: 12px; }
.fstatus-bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; opacity: 0; transition: opacity 0.2s; }
.fstatus.active .fstatus-bar { opacity: 1; }
.fstatus-fill { height: 100%; width: 40%; border-radius: 2px; background: var(--accent); transform: translateX(-100%); }
.fstatus.active .fstatus-fill { animation: wm-indeterminate 1.2s ease-in-out infinite; }
.fstatus.send .fstatus-fill { background: var(--ok); }
.fstatus.active .fstatus-text { color: var(--text-2); }
.fstatus.recv .fstatus-ic svg { animation: wm-spin 1s linear infinite; }
@keyframes wm-indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
body[data-theme="rainloop"] .fstatus { color: rgba(255,255,255,0.75); }
body[data-theme="rainloop"] .fstatus.active .fstatus-text { color: #fff; }
body[data-theme="rainloop"] .fstatus-bar { background: rgba(255,255,255,0.22); }
body[data-folders="icons"] .fstatus { padding: 4px 4px 0; }
body[data-folders="icons"] .fstatus-text span:last-child { display: none; }
img.av { object-fit: cover; }
.cav-empty { background: var(--hover); color: var(--text-3); }
.cav-empty svg { width: 26px; height: 26px; }
.cf-photo { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.cf-photo-btns { display: flex; gap: 6px; }
/* contacts import dialog */
.dialog.dialog-import { width: 560px; }
.import-wrap { display: flex; flex-direction: column; gap: 12px; }
.import-drop { border: 2px dashed var(--border); border-radius: 8px; padding: 28px 16px; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 6px; transition: background 0.15s, border-color 0.15s; }
.import-drop svg { width: 36px; height: 36px; opacity: 0.6; }
.import-drop-t { font-size: 15px; font-weight: 600; color: var(--text-2); }
.import-drop.over { border-color: var(--accent); background: var(--selected); }
.import-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.import-wrap .note { font-size: 12px; color: var(--text-3); text-align: center; }
.import-progress { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); width: 320px; background: var(--pane-bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.2); padding: 10px 14px; z-index: 95; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }

/* contact picker: one compact line per address */
.dialog.dialog-pick { width: 640px; }
.cpick { display: flex; flex-direction: column; gap: 8px; height: min(66vh, 560px); }
.cpick-search { display: flex; align-items: center; gap: 6px; height: 32px; border: 1px solid var(--input-border); border-radius: 4px; padding: 0 10px; background: var(--input-bg); color: var(--text-3); }
.cpick-search span { display: inline-flex; width: 14px; height: 14px; }
.cpick-search svg { width: 14px; height: 14px; }
.cpick-search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; height: 30px; }
.cpick-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.cpick-tabs button { border: 0; border-radius: 12px; padding: 3px 10px; font-size: 12px; background: var(--hover); color: var(--text-2); }
.cpick-tabs button.on { background: var(--accent); color: var(--accent-text); }
.cpick-box { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.cpick-hd, .cpick .cpick-row { display: grid; grid-template-columns: 22px 22px minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; gap: 8px; padding: 0 10px; }
.cpick-hd { height: 26px; flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--ribbon-bg); border-bottom: 1px solid var(--border); }
.cpick-hd input, .cpick .cpick-row input { width: 14px; height: 14px; margin: 0; }
.cpick-list { flex: 1; overflow: auto; }
.cpick-grp { height: 20px; line-height: 20px; padding: 0 10px; font-size: 11px; font-weight: 700; color: var(--text-3); background: var(--ribbon-bg); }
.cpick .cpick-row { height: 30px; border-bottom: 1px solid var(--border-soft); cursor: pointer; font-size: 13px; flex-direction: row; margin: 0; }
.cpick .cpick-row:hover { background: var(--hover); }
.cpick .cpick-row.sel { background: var(--selected); }
.cpick .cpick-av { width: 22px !important; height: 22px !important; font-size: 9px !important; border-radius: 50%; }
.cpick .cname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cpick .cemail { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 26px; max-height: 58px; overflow: auto; font-size: 12px; color: var(--text-3); }
.cpick-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 220px; background: var(--selected); border: 1px solid var(--accent); color: var(--accent); border-radius: 12px; padding: 1px 4px 1px 8px; }
.cpick-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick-chip button { border: 0; background: transparent; color: inherit; font-size: 14px; line-height: 1; padding: 0 3px; }

/* ==================== phone layout (≤700px, 案4) ==================== */
.m-search-btn, .m-search-close { display: none; }
@media (max-width: 700px) {
  .topbar { height: 48px; min-height: 48px; padding: 0 6px 0 4px; gap: 4px; }
  .brand { gap: 8px; font-size: 15px; flex: 1; min-width: 0; }
  .brand .brand-img { height: 26px !important; max-height: 26px; }
  .brand span.brand-name { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .search { display: none; }
  .topbar .fs-current, .topbar .lang-btn, .topbar .gear-btn { display: none; }
  .topbar .m-search-btn { display: inline-flex; }
  .topbar-right { gap: 2px; }
  .avatar { width: 30px; height: 30px; }
  /* search expanded: the search box takes the whole bar */
  .topbar.searching .brand, .topbar.searching .topbar-right, .topbar.searching .mobile-menu { display: none !important; }
  .topbar.searching .search { display: flex; flex: 1; align-items: center; gap: 4px; }
  .topbar.searching .search label { max-width: none; flex: 1; height: 34px; }
  .topbar.searching .m-search-close { display: inline-flex; color: inherit; }
  /* command bar: one line */
  .cmdbar.m-cmd { margin: 6px 8px 0; padding: 0 6px; height: 44px; gap: 4px; overflow: hidden; }
  .cmdbar.m-cmd .cmd.primary { height: 32px; padding: 0 12px; font-size: 14px; }
  .cmdbar.m-cmd .cmd.primary span { display: inline !important; }
  .cmdbar.m-cmd .cmd.m-ic { width: 38px; height: 34px; padding: 0; justify-content: center; flex-shrink: 0; }
  .cmdbar.m-cmd .cmd.primary.m-ic { width: 38px; height: 32px; }
  .cmdbar.m-cmd .cmd.m-ic svg { width: 19px; height: 19px; }
  .cmdbar.m-cmd .cmd.m-more { background: var(--hover); }
  .cmdbar.m-cmd .m-spacer { flex: 1; }
  .cmdbar:not(.m-cmd) { overflow-x: auto; }
  .body { padding: 6px 8px 8px; }
  .menu { max-width: calc(100vw - 16px); }
}

/* ---------- hidemaru (ビジネス) ---------- */
body[data-theme="hidemaru"] {
  --font: "Meiryo UI", "Yu Gothic UI", "MS UI Gothic", "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --accent: #0078d7;
  --accent-hover: #0063b1;
  --accent-text: #ffffff;
  --topbar-bg: #ffffff;
  --topbar-text: #1a1a1a;
  --topbar-search-bg: #ffffff;
  --topbar-search-text: #1a1a1a;
  --page-bg: #f0f0f0;
  --pane-bg: #ffffff;
  --pane-radius: 0;
  --pane-shadow: none;
  --border: #a0a0a0;
  --border-soft: #eeeeee;
  --text: #000000;
  --text-2: #1a1a1a;
  --text-3: #555555;
  --hover: #e5f3ff;
  --selected: #33a02c;
  --selected-bar: #1e7b18;
  --folder-active: #cce8ff;
  --unread-subject: #0033cc;
  --btn-bg: #e1e1e1;
  --btn-border: #adadad;
  --input-bg: #ffffff;
  --input-border: #7a7a7a;
  --danger: #cc0000;
  --ok: #33a02c;
  --ribbon-bg: #f0f0f0;
  --cmd-bg: #f0f0f0;
  --list-item-radius: 0;
  --list-gap: 0;
  --pane-gap: 4px;
  --quote: #666666;
  --hm-bar: linear-gradient(#c6d4e6, #a9bdd7);
  --hm-bar-text: #10243d;
}
body[data-theme="hidemaru"] #app { background: #f0f0f0; }
body[data-theme="hidemaru"] .topbar { background: #ffffff; color: #1a1a1a; border-bottom: 1px solid #d9d9d9; }
body[data-theme="hidemaru"] .topbar .icon-btn, body[data-theme="hidemaru"] .topbar button { color: #1a1a1a; }
body[data-theme="hidemaru"] .topbar .icon-btn:hover { background: #e5f3ff; }
body[data-theme="hidemaru"] .brand-title { color: #1a1a1a; }
body[data-theme="hidemaru"] .search label { border: 1px solid #7a7a7a; border-radius: 0; height: 26px; }
body[data-theme="hidemaru"] .avatar { background: #0078d7; color: #fff; border-radius: 2px; }
body[data-theme="hidemaru"] .ribbon-tabs { display: none; }
body[data-theme="hidemaru"] .cmdbar { background: #f0f0f0; box-shadow: none; margin: 0; border-radius: 0; border-bottom: 1px solid #d9d9d9; padding: 2px 6px; }
body[data-theme="hidemaru"] .cmd { border-radius: 0; border: 1px solid transparent; color: #000; }
body[data-theme="hidemaru"] .cmd:hover { background: #e5f3ff; border-color: #cce8ff; }
body[data-theme="hidemaru"] .cmd:active { background: #cce8ff; border-color: #99d1ff; }
body[data-theme="hidemaru"] .cmd.primary { background: #e1e1e1; color: #000; border: 1px solid #adadad; border-radius: 0; }
body[data-theme="hidemaru"] .cmd.primary:hover { background: #e5f1fb; border-color: #0078d7; }
body[data-theme="hidemaru"] .cmd.primary svg { stroke: #c00000; }
body[data-theme="hidemaru"] .sep { background: #c8c8c8; }
body[data-theme="hidemaru"] .body { padding: 4px; }
/* folder pane */
body[data-theme="hidemaru"] .folders { background: #ffffff; border: 1px solid var(--border); padding: 0; }
body[data-theme="hidemaru"] .folders .account { background: var(--hm-bar); color: var(--hm-bar-text); font-size: 12px; font-weight: 700; padding: 3px 6px; min-height: 24px; border-bottom: 1px solid #8fa3bd; }
body[data-theme="hidemaru"] .folder { border-radius: 0; padding: 2px 8px 2px 18px; font-size: 13px; gap: 6px; }
body[data-theme="hidemaru"] .folder svg { width: 16px; height: 16px; stroke: #b07d00; fill: #ffd966; }
body[data-theme="hidemaru"] .folder:hover { background: #e5f3ff; }
body[data-theme="hidemaru"] .folder.active { background: #cce8ff; box-shadow: inset 0 0 0 1px #99d1ff; color: #000; font-weight: 700; }
body[data-theme="hidemaru"] .folder .count { background: transparent; color: #000; font-weight: 700; padding: 0; font-size: 12px; }
body[data-theme="hidemaru"] .folder .count:not(.dim)::before { content: '('; }
body[data-theme="hidemaru"] .folder .count:not(.dim)::after { content: ')'; }
body[data-theme="hidemaru"] .folder .count.dim { color: #555; font-weight: 400; }
body[data-theme="hidemaru"] .folders-sub { color: #555; border-top: 1px solid #e5e5e5; }
body[data-theme="hidemaru"] .quota { border-top: 1px solid #d9d9d9; background: #f7f7f7; }
body[data-theme="hidemaru"] .quota-bar, body[data-theme="hidemaru"] .fstatus-bar { background: #e6e6e6; border: 1px solid #bcbcbc; border-radius: 0; }
body[data-theme="hidemaru"] .quota-fill { background: #06b025; border-radius: 0; }
/* list pane */
body[data-theme="hidemaru"] .list { background: #ffffff; border: 1px solid var(--border); }
body[data-theme="hidemaru"] .list-head { background: var(--hm-bar); color: var(--hm-bar-text); border-bottom: 1px solid #8fa3bd; height: 28px !important; padding-top: 0; padding-bottom: 0; }
body[data-theme="hidemaru"] .list-head h2 { font-size: 12px; font-weight: 700; color: var(--hm-bar-text); }
body[data-theme="hidemaru"] .list-head .icon-btn { width: 24px; height: 22px; border-radius: 0; color: var(--hm-bar-text); }
body[data-theme="hidemaru"] .list-head .icon-btn:hover, body[data-theme="hidemaru"] .list-head .icon-btn.on { background: rgba(255,255,255,0.55); box-shadow: inset 0 0 0 1px #7f95b3; }
body[data-theme="hidemaru"] .list-cols { background: #ffffff; border-bottom: 1px solid #e5e5e5 !important; height: 24px !important; }
body[data-theme="hidemaru"] .list-cols .col { color: #000 !important; font-weight: 400 !important; height: 24px !important; line-height: 24px !important; }
body[data-theme="hidemaru"] .list-cols .col:hover { background: #d9ebf9 !important; }
body[data-theme="hidemaru"] .list-cols .col-grip::after { background: #e5e5e5 !important; top: 0 !important; bottom: 0 !important; }
body[data-theme="hidemaru"] .list-body .group { background: #ffffff; color: #555; border-bottom: 1px solid #f0f0f0; font-size: 11px; }
body[data-theme="hidemaru"] .list-body .item { background: #ffffff; border-radius: 0; border: 0; border-bottom: 1px solid #f3f3f3; border-left: 0; box-shadow: none; margin: 0; }
body[data-theme="hidemaru"] .list-body .item .av { display: none; }
body[data-theme="hidemaru"] .list-body .item:hover { background: #e5f3ff; }
body[data-theme="hidemaru"] .list-body .item.unread { background: #ffffff; }
body[data-theme="hidemaru"] .list-body .item.unread .sender, body[data-theme="hidemaru"] .list-body .item.unread .subject { color: #0033cc; font-weight: 700; }
body[data-theme="hidemaru"] .list-body .item.selected, body[data-theme="hidemaru"] .list-body .item.selected:hover { background: #33a02c; box-shadow: inset 0 0 0 1px #1e7b18; }
body[data-theme="hidemaru"] .list-body .item.selected .sender, body[data-theme="hidemaru"] .list-body .item.selected .subject, body[data-theme="hidemaru"] .list-body .item.selected .date, body[data-theme="hidemaru"] .list-body .item.selected .preview, body[data-theme="hidemaru"] .list-body .item.selected .preview * { color: #ffffff !important; }
body[data-theme="hidemaru"] .list-body .item .date { color: #000; }
body[data-theme="hidemaru"] .list-body .item .preview { color: #555; }
body[data-theme="hidemaru"] .list-foot { background: #f0f0f0; border-top: 1px solid #d9d9d9; }
body[data-theme="hidemaru"] .list-foot button, body[data-theme="hidemaru"] .list-foot .pager .pg { border-radius: 0; }
body[data-theme="hidemaru"] .list-foot .pager .pg.cur { background: #cce8ff; color: #000; border: 1px solid #99d1ff; }
body[data-theme="hidemaru"] .filters { border-radius: 0; }
body[data-theme="hidemaru"] .splitter::after { background: #a0a0a0; }
/* reader */
body[data-theme="hidemaru"] .reader, body[data-theme="hidemaru"] .compose { background: #ffffff; border: 1px solid var(--border); border-radius: 0; box-shadow: none; }
body[data-theme="hidemaru"] .msg-head { background: #f0f0f0; border-bottom: 1px solid #c8c8c8; padding: 8px 12px 6px; }
body[data-theme="hidemaru"] .msg-subject { font-size: 15px; font-weight: 700; color: #000; }
body[data-theme="hidemaru"] .reader-empty { color: #777; }
body[data-theme="hidemaru"] .btn { border-radius: 0; background: #e1e1e1; border: 1px solid #adadad; color: #000; }
body[data-theme="hidemaru"] .btn:hover { background: #e5f1fb; border-color: #0078d7; }
body[data-theme="hidemaru"] .btn.accent { background: #e1e1e1; color: #000; border-color: #0078d7; box-shadow: inset 0 0 0 1px #0078d7; }
body[data-theme="hidemaru"] .att { border-radius: 0; }
body[data-theme="hidemaru"] .dialog, body[data-theme="hidemaru"] .menu { border-radius: 0; border: 1px solid #a0a0a0; box-shadow: 2px 2px 4px rgba(0,0,0,0.25); }
body[data-theme="hidemaru"] .menu button:hover, body[data-theme="hidemaru"] .menu .mi:hover { background: #91c9f7; }
body[data-theme="hidemaru"] .fstatus { color: #333; }
body[data-theme="hidemaru"] .fstatus-fill { background: #06b025; }
@media (max-width: 700px) {
  body[data-theme="hidemaru"] .body { padding: 0; }
  body[data-theme="hidemaru"] .cmdbar.m-cmd { margin: 0; }
}
body[data-theme="hidemaru"]:not([data-list="rows"]) .list-body .item { padding: 5px 10px 5px 30px; }
body[data-theme="hidemaru"]:not([data-list="rows"]) .list-body .item .chk { display: block; left: 9px; top: 50%; margin-top: -7px; width: 14px; height: 14px; }
body[data-theme="hidemaru"]:not([data-list="rows"]) .list-body .item .sender, body[data-theme="hidemaru"]:not([data-list="rows"]) .list-body .item .subject { font-size: 13px; line-height: 1.35; }
body[data-theme="hidemaru"]:not([data-list="rows"]) .list-body .item .preview { font-size: 12px; }
/* ---------- contacts on phones ---------- */
@media (max-width: 700px) {
  .cbody .list-head { flex-wrap: wrap; height: auto !important; gap: 6px; padding: 8px 12px; }
  .cbody .list-head .csearch { width: 100%; flex: 1 1 100%; }
  .ccols { grid-template-columns: 26px minmax(0, 1fr) !important; }
  .ccols span:not(:nth-child(2)) { display: none; }
  .citem { grid-template-columns: 22px 24px 34px minmax(0, 1fr) !important; grid-template-rows: auto auto; height: auto; min-height: 52px; padding: 6px 12px; row-gap: 1px; }
  .citem > input, .citem .cfav, .citem .av { grid-row: 1 / span 2; }
  .citem .av { width: 32px; height: 32px; }
  .citem .cname { grid-column: 4; grid-row: 1; }
  .citem .cemail { grid-column: 4; grid-row: 2; display: block; }
  .citem .ccompany, .citem .cphone { display: none !important; }
  .cdetail .msg-meta { flex-wrap: wrap; }
  .cdetail .msg-actions { width: 100%; }
  .cdet-body { padding: 8px 16px 24px; }
  .cdet-row { flex-direction: column; gap: 0; }
  .cdet-row .k { width: auto; font-size: 12px; }
}
@media (max-width: 1000px) {
  .cbody .main { flex-direction: column !important; }
  .cbody .clist { flex: 1 1 auto !important; width: 100% !important; }
  .cbody .cdetail { position: absolute; inset: 0; z-index: 30; border-radius: 0; flex: none !important; }
  .cbody .cdetail.hidden-mobile { display: none !important; }
}
@media (max-width: 1000px) { .folders:not(.open) { box-shadow: none; visibility: hidden; transition: transform .15s, visibility 0s .15s; } }

/* ---------- cool (クールグレー: desktop mail client, table style) ---------- */
body[data-theme="cool"] {
  --font: "Segoe UI", "Yu Gothic UI", "Meiryo UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --accent: #0061e0;
  --accent-hover: #0250bb;
  --accent-text: #ffffff;
  --topbar-bg: #1c2638;
  --topbar-text: #ffffff;
  --topbar-search-bg: #ffffff;
  --topbar-search-text: #15141a;
  --page-bg: #f0f0f4;
  --pane-bg: #ffffff;
  --pane-radius: 0;
  --pane-shadow: none;
  --border: #d7d7db;
  --border-soft: #ececef;
  --text: #15141a;
  --text-2: #2b2a33;
  --text-3: #5b5b66;
  --hover: #e8e8ed;
  --selected: #dcdce3;
  --selected-bar: #0061e0;
  --folder-active: #0061e0;
  --unread-subject: #15141a;
  --btn-bg: #ffffff;
  --btn-border: #cfcfd8;
  --input-bg: #ffffff;
  --input-border: #8f8f9d;
  --ribbon-bg: #f0f0f4;
  --cmd-bg: #f9f9fb;
  --list-item-radius: 0;
  --list-gap: 0;
  --pane-gap: 0;
  --quote: #5b5b66;
}
body[data-theme="cool"] #app { background: #f0f0f4; }
body[data-theme="cool"] .topbar { background: #1c2638; min-height: 42px; border-bottom: 0; }
body[data-theme="cool"] .search label { height: 28px; border-radius: 4px; max-width: 520px; font-size: 13px; }
body[data-theme="cool"] .avatar { background: #0061e0; color: #fff; }
body[data-theme="cool"] .ribbon-tabs { display: none; }
body[data-theme="cool"] .cmdbar { background: #f9f9fb; margin: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border); padding: 3px 8px; }
body[data-theme="cool"] .cmd { border-radius: 4px; }
body[data-theme="cool"] .cmd:hover { background: #e0e0e6; }
body[data-theme="cool"] .cmd.primary { background: #0061e0; color: #fff; border-radius: 4px; }
body[data-theme="cool"] .cmd.primary:hover { background: #0250bb; }
body[data-theme="cool"] .sep { background: var(--border); }
body[data-theme="cool"] .body { padding: 0; gap: 0; }
body[data-theme="cool"] .folders { background: #f0f0f4; border-right: 1px solid var(--border); padding: 4px 6px; }
body[data-theme="cool"] .folders .account { font-weight: 700; color: var(--text); }
body[data-theme="cool"] .folder { border-radius: 4px; padding: 4px 8px 4px 20px; font-size: 13px; gap: 8px; }
body[data-theme="cool"] .folder svg { width: 16px; height: 16px; stroke: #0061e0; }
body[data-theme="cool"] .folder:hover { background: #e0e0e6; }
body[data-theme="cool"] .folder.active { background: #0061e0; color: #ffffff; font-weight: 600; }
body[data-theme="cool"] .folder.active svg { stroke: #ffffff; }
body[data-theme="cool"] .folder .count { background: #0061e0; color: #fff; border-radius: 9px; padding: 0 7px; font-size: 11px; font-weight: 700; }
body[data-theme="cool"] .folder.active .count { background: #ffffff; color: #0061e0; }
body[data-theme="cool"] .folder .count.dim { background: transparent; color: var(--text-3); font-weight: 400; }
body[data-theme="cool"] .list { background: #ffffff; border-radius: 0; box-shadow: none; border-right: 1px solid var(--border); }
body[data-theme="cool"] .list-head { background: #f9f9fb; border-bottom: 1px solid var(--border); height: 36px !important; }
body[data-theme="cool"] .list-head h2 { font-size: 14px; }
body[data-theme="cool"] .list-cols { background: #ffffff; border-bottom: 1px solid var(--border) !important; }
body[data-theme="cool"] .list-cols .col { font-weight: 400 !important; color: var(--text-2) !important; }
body[data-theme="cool"] .list-body .group { background: #f9f9fb; border-bottom: 1px solid var(--border-soft); }
body[data-theme="cool"] .list-body .item { border-left: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; }
body[data-theme="cool"] .list-body .item.unread .sender, body[data-theme="cool"] .list-body .item.unread .subject { font-weight: 700; color: var(--text); }
body[data-theme="cool"] .list-body .item.selected, body[data-theme="cool"] .list-body .item.selected:hover { background: #dcdce3; box-shadow: inset 3px 0 0 #0061e0; }
body[data-theme="cool"]:not([data-list="rows"]) .list-body .item { padding: 6px 12px 6px 14px; }
body[data-theme="cool"]:not([data-list="rows"]) .list-body .item .av { width: 30px; height: 30px; font-size: 12px; }
body[data-theme="cool"] .list-foot { background: #f9f9fb; border-top: 1px solid var(--border); }
body[data-theme="cool"] .splitter::after { background: var(--border); }
body[data-theme="cool"] .reader, body[data-theme="cool"] .compose { border-radius: 0; box-shadow: none; }
body[data-theme="cool"] .msg-head { background: #f9f9fb; border-bottom: 1px solid var(--border); padding: 10px 16px 8px; }
body[data-theme="cool"] .msg-subject { font-size: 15px; }
body[data-theme="cool"] .btn { border-radius: 4px; font-size: 12px; }
body[data-theme="cool"] .btn.accent { background: #0061e0; border-color: #0061e0; }
body[data-theme="cool"] .dialog, body[data-theme="cool"] .menu { border-radius: 6px; }

/* ---------- meadow (メドウ: modern cards) ---------- */
body[data-theme="meadow"] {
  --font: "Inter", "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", system-ui, sans-serif;
  --accent: #0060df;
  --accent-hover: #0250bb;
  --accent-text: #ffffff;
  --topbar-bg: #e9e9ee;
  --topbar-text: #15141a;
  --topbar-search-bg: #ffffff;
  --topbar-search-text: #15141a;
  --page-bg: #f0f0f4;
  --pane-bg: #ffffff;
  --pane-radius: 0;
  --pane-shadow: none;
  --border: #d8d8de;
  --border-soft: #e6e6eb;
  --text: #15141a;
  --text-2: #2b2a33;
  --text-3: #5b5b66;
  --hover: #f5f5f8;
  --selected: #eaf2ff;
  --selected-bar: #0060df;
  --folder-active: #e3edfd;
  --unread-subject: #0060df;
  --btn-bg: #ffffff;
  --btn-border: #cfcfd8;
  --input-bg: #ffffff;
  --input-border: #b8b8c2;
  --ribbon-bg: #f0f0f4;
  --cmd-bg: #f9f9fb;
  --list-item-radius: 5px;
  --list-gap: 6px;
  --pane-gap: 0;
  --quote: #5b5b66;
  --mw-tag: #8a55d8;
}
body[data-theme="meadow"] #app { background: #f0f0f4; }
body[data-theme="meadow"] .topbar { background: #e9e9ee; border-bottom: 1px solid var(--border); min-height: 50px; }
body[data-theme="meadow"] .search label { border: 1px solid #b8b8c2; border-radius: 5px; height: 32px; }
body[data-theme="meadow"] .avatar { background: #0060df; color: #fff; }
body[data-theme="meadow"] .ribbon-tabs { display: none; }
body[data-theme="meadow"] .cmdbar { background: #f9f9fb; margin: 0; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border); padding: 6px 10px; }
body[data-theme="meadow"] .cmd { border-radius: 5px; }
body[data-theme="meadow"] .cmd:hover { background: #ececf1; }
body[data-theme="meadow"] .cmd.primary { background: #0060df; color: #fff; border-radius: 5px; padding: 0 16px; }
body[data-theme="meadow"] .cmd.primary:hover { background: #0250bb; }
body[data-theme="meadow"] .body { padding: 0; gap: 0; }
body[data-theme="meadow"] .folders { background: #f9f9fb; border-right: 1px solid var(--border); padding: 8px 10px; }
body[data-theme="meadow"] .folders .account { font-weight: 700; color: var(--text); font-size: 14px; }
body[data-theme="meadow"] .folder { border-radius: 5px; padding: 6px 10px 6px 18px; font-size: 14px; border: 1px solid transparent; }
body[data-theme="meadow"] .folder svg { width: 18px; height: 18px; }
body[data-theme="meadow"] .folder[data-sp="inbox"] svg { stroke: #0060df; }
body[data-theme="meadow"] .folder[data-sp="drafts"] svg { stroke: #b249e0; }
body[data-theme="meadow"] .folder[data-sp="sent"] svg { stroke: #2e9e5b; }
body[data-theme="meadow"] .folder[data-sp="archive"] svg { stroke: #b0712b; }
body[data-theme="meadow"] .folder[data-sp="junk"] svg { stroke: #e2482f; }
body[data-theme="meadow"] .folder[data-sp="trash"] svg { stroke: #5b5b66; }
body[data-theme="meadow"] .folder[data-sp="folder"] svg { stroke: #0e89c6; }
body[data-theme="meadow"] .folder:hover { background: #ececf1; }
body[data-theme="meadow"] .folder.active { background: #e3edfd; border-color: #0060df; color: #0060df; font-weight: 700; }
body[data-theme="meadow"] .folder .count { background: #0060df; color: #fff; border-radius: 11px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
body[data-theme="meadow"] .folder .count.dim { background: transparent; color: var(--text-3); font-weight: 400; }
body[data-theme="meadow"] .list { background: #f0f0f4; border-radius: 0; box-shadow: none; border-right: 1px solid var(--border); }
body[data-theme="meadow"] .list-head { background: #f9f9fb; border-bottom: 1px solid var(--border); }
body[data-theme="meadow"] .list-head h2 { font-size: 17px; }
body[data-theme="meadow"] .list-body .group { background: transparent; color: var(--text-3); }
body[data-theme="meadow"]:not([data-list="rows"]) .list-body { padding: 6px 6px 8px; }
body[data-theme="meadow"]:not([data-list="rows"]) .list-body .item { background: #ffffff; border: 1px solid var(--border); border-radius: 5px; padding: 8px 12px 8px 14px; box-shadow: 0 1px 1px rgba(0,0,0,0.03); }
body[data-theme="meadow"]:not([data-list="rows"]) .list-body .item .av { display: none; }
body[data-theme="meadow"]:not([data-list="rows"]) .list-body .item .chk { left: auto; right: 10px; top: auto; bottom: 8px; }
body[data-theme="meadow"] .list-body .item .sender { position: relative; padding-left: 9px; }
body[data-theme="meadow"] .list-body .item .sender::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; border-radius: 2px; background: var(--mw-tag); }
body[data-theme="meadow"] .list-body .item.unread .sender { font-weight: 700; }
body[data-theme="meadow"] .list-body .item.unread .subject { color: #0060df; font-weight: 700; }
body[data-theme="meadow"] .list-body .item:hover { background: #f7f9fe; }
body[data-theme="meadow"] .list-body .item.selected, body[data-theme="meadow"] .list-body .item.selected:hover { background: #eaf2ff; border-color: #0060df; box-shadow: inset 0 0 0 1px #0060df; }
body[data-theme="meadow"][data-list="rows"] .list-body { background: #ffffff; }
body[data-theme="meadow"][data-list="rows"] .list-body .item { border-left: 0; }
body[data-theme="meadow"] .list-foot { background: #f9f9fb; border-top: 1px solid var(--border); }
body[data-theme="meadow"] .splitter::after { background: var(--border); }
body[data-theme="meadow"] .reader, body[data-theme="meadow"] .compose { border-radius: 0; box-shadow: none; }
body[data-theme="meadow"] .reader { background: linear-gradient(180deg, #dfeafb 0%, #f3f7fe 100%); }
body[data-theme="meadow"] .msg-head { background: #f9f9fb; border-bottom: 1px solid var(--border); padding: 12px 18px 10px; }
body[data-theme="meadow"] .msg-subject { font-size: 16px; font-weight: 700; order: 2; }
body[data-theme="meadow"] .msg-body { background: #ffffff; margin: 16px; border: 1px solid var(--border-soft); border-radius: 12px; padding: 8px; }
body[data-theme="meadow"] .btn { border-radius: 4px; font-size: 13px; }
body[data-theme="meadow"] .btn.accent { background: #0060df; border-color: #0060df; }
body[data-theme="meadow"] .dialog, body[data-theme="meadow"] .menu { border-radius: 8px; }
@media (max-width: 700px) {
  body[data-theme="meadow"] .msg-body { margin: 8px; border-radius: 8px; }
}

/* ---------- compose: full-screen ---------- */
.compose-full-btn { width: 34px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
.compose-full-btn svg { width: 16px; height: 16px; }
.compose.full { position: fixed; left: 0; right: 0; bottom: 0; top: 48px; z-index: 60; border-radius: 0 !important; box-shadow: 0 -2px 12px rgba(0,0,0,0.12); margin: 0; }
.compose.full .compose-head { padding-left: 24px; padding-right: 24px; }
.dialog.dialog-ask { width: 440px; max-width: calc(100vw - 32px); }
.dialog.dialog-ask .dlg-body { white-space: pre-line; line-height: 1.6; }

/* ---------- office (オフィス: modern desktop mail app) ---------- */
body[data-theme="office"] {
  --font: "Segoe UI", "Yu Gothic UI", "Meiryo UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --accent: #0f6cbd;
  --accent-hover: #115ea3;
  --accent-text: #ffffff;
  --topbar-bg: #f3f3f3;
  --topbar-text: #242424;
  --topbar-search-bg: #ffffff;
  --topbar-search-text: #242424;
  --page-bg: #f3f3f3;
  --pane-bg: #ffffff;
  --pane-radius: 8px;
  --pane-shadow: 0 1px 3px rgba(0,0,0,0.10);
  --border: #e0e0e0;
  --border-soft: #ebebeb;
  --text: #242424;
  --text-2: #424242;
  --text-3: #616161;
  --hover: #f5f5f5;
  --selected: #cfe4fa;
  --selected-bar: #0f6cbd;
  --folder-active: #e0e0e0;
  --unread-subject: #0f6cbd;
  --ribbon-bg: #f3f3f3;
  --cmd-bg: #ffffff;
  --list-item-radius: 0;
  --list-gap: 0;
  --pane-gap: 8px;
}
body[data-theme="office"] #app { background: #f3f3f3; }
body[data-theme="office"] .topbar { background: #f3f3f3; border-bottom: 0; }
body[data-theme="office"] .search label { border: 1px solid #d1d1d1; border-radius: 6px; height: 32px; max-width: 480px; }
body[data-theme="office"] .avatar { background: #c8c8c8; color: #fff; }
body[data-theme="office"] .ribbon-tabs { background: #f3f3f3; border-bottom: 0; }
body[data-theme="office"] .cmdbar { border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.12); height: 46px; }
body[data-theme="office"] .cmd { border-radius: 4px; }
body[data-theme="office"] .cmd.primary { background: transparent; color: var(--text); border: 0; }
body[data-theme="office"] .cmd.primary svg { stroke: #0f6cbd; }
body[data-theme="office"] .cmd.primary:hover { background: #f0f0f0; }
body[data-theme="office"] .folders { background: transparent; }
body[data-theme="office"] .folder { font-size: 14px; border-radius: 4px; padding: 6px 10px 6px 20px; }
body[data-theme="office"] .folder.active { background: #e0e0e0; font-weight: 700; }
body[data-theme="office"] .folder .count { background: transparent; color: #0f6cbd; font-weight: 700; }
body[data-theme="office"] .list { border-radius: 8px 0 0 8px; }
body[data-theme="office"] .list-body .group { background: #f0f0f0; color: var(--text); font-weight: 700; padding: 5px 16px; border-bottom: 1px solid var(--border-soft); }
body[data-theme="office"] .list-body .group::before { content: '\2304'; display: inline-block; margin-right: 8px; transform: translateY(-3px); color: var(--text-3); }
body[data-theme="office"] .list-body .item { border-left: 0; }
body[data-theme="office"] .list-body .item.unread .sender { font-weight: 700; }
body[data-theme="office"] .list-body .item.selected, body[data-theme="office"] .list-body .item.selected:hover { background: #cfe4fa; box-shadow: inset 0 0 0 1px #0f6cbd; }
body[data-theme="office"]:not([data-list="rows"]) .list-body .item { padding: 10px 16px 10px 32px; }
body[data-theme="office"]:not([data-list="rows"]) .list-body .item .av { display: none; }
body[data-theme="office"]:not([data-list="rows"]) .list-body .item .chk { left: 9px; }
body[data-theme="office"] .reader, body[data-theme="office"] .compose { border-radius: 0 8px 8px 0; }
body[data-theme="office"] .msg-subject { font-size: 18px; font-weight: 400; }
body[data-theme="office"] .msg-head { border-bottom: 0; }
body[data-theme="office"] .btn { border-radius: 4px; }
body[data-theme="office"] .dialog, body[data-theme="office"] .menu { border-radius: 8px; }

/* ---------- office2016 (オフィス クラシック) ---------- */
body[data-theme="office2016"] {
  --font: "Segoe UI", "Meiryo UI", "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --accent: #2b579a;
  --accent-hover: #1f4380;
  --accent-text: #ffffff;
  --topbar-bg: #2b579a;
  --topbar-text: #ffffff;
  --topbar-search-bg: #ffffff;
  --topbar-search-text: #262626;
  --page-bg: #ffffff;
  --pane-bg: #ffffff;
  --pane-radius: 0;
  --pane-shadow: none;
  --border: #d4d4d4;
  --border-soft: #e6e6e6;
  --text: #262626;
  --text-2: #444444;
  --text-3: #666666;
  --hover: #e6f2fa;
  --selected: #cde6f7;
  --selected-bar: #2b579a;
  --folder-active: #dadada;
  --unread-subject: #2b579a;
  --ribbon-bg: #2b579a;
  --cmd-bg: #f3f3f3;
  --list-item-radius: 0;
  --list-gap: 0;
  --pane-gap: 0;
}
body[data-theme="office2016"] #app { background: #ffffff; }
body[data-theme="office2016"] .topbar { background: #2b579a; border-bottom: 0; min-height: 40px; }
body[data-theme="office2016"] .search label { border-radius: 0; height: 26px; max-width: 420px; }
body[data-theme="office2016"] .avatar { background: #ffffff; color: #2b579a; border-radius: 0; }
body[data-theme="office2016"] .ribbon-tabs { background: #2b579a; border-bottom: 0; height: 30px; gap: 2px; padding: 0 8px; }
body[data-theme="office2016"] .ribbon-tabs .tab { color: #ffffff; padding: 8px 14px; border-bottom: 0; font-size: 13px; }
body[data-theme="office2016"] .ribbon-tabs .tab:hover { background: #3c6aad; }
body[data-theme="office2016"] .ribbon-tabs .tab.active { background: #f3f3f3; color: #2b579a; font-weight: 400; }
body[data-theme="office2016"] .cmdbar { margin: 0; border-radius: 0; box-shadow: none; background: #f3f3f3; border-bottom: 1px solid #d4d4d4; height: 46px; }
body[data-theme="office2016"] .cmd { border-radius: 0; border: 1px solid transparent; color: #262626; }
body[data-theme="office2016"] .cmd:hover { background: #c5c5c5; }
body[data-theme="office2016"] .cmd.primary { background: transparent; color: #262626; }
body[data-theme="office2016"] .cmd.primary svg { stroke: #2b579a; }
body[data-theme="office2016"] .cmd.primary:hover { background: #c5c5c5; }
body[data-theme="office2016"] .sep { background: #d4d4d4; }
body[data-theme="office2016"] .body { padding: 0; }
body[data-theme="office2016"] .folders { background: #ffffff; border-right: 1px solid #d4d4d4; padding: 6px 4px; }
body[data-theme="office2016"] .folders .account { font-size: 15px; color: #262626; }
body[data-theme="office2016"] .folder { border-radius: 0; padding: 3px 8px 3px 26px; font-size: 13px; }
body[data-theme="office2016"] .folder svg { display: none; }
body[data-theme="office2016"] .folder:hover { background: #e6f2fa; }
body[data-theme="office2016"] .folder.active { background: #dadada; font-weight: 700; }
body[data-theme="office2016"] .folder .count { background: transparent; color: #2b579a; font-weight: 700; padding: 0; margin-left: 6px; }
body[data-theme="office2016"] .folder .count.dim { color: #2b579a; font-weight: 400; }
body[data-theme="office2016"] .list { border-right: 1px solid #d4d4d4; }
body[data-theme="office2016"] .list-head { border-bottom: 1px solid #d4d4d4; }
body[data-theme="office2016"] .list-head h2 { color: #2b579a; font-weight: 400; }
body[data-theme="office2016"] .list-body .group { background: #f3f3f3; color: #444; border-bottom: 1px solid var(--border-soft); }
body[data-theme="office2016"] .list-body .item { border-left: 4px solid transparent; border-bottom: 1px solid var(--border-soft); }
body[data-theme="office2016"] .list-body .item.unread { border-left-color: #2b579a; }
body[data-theme="office2016"] .list-body .item.unread .subject { color: #2b579a; font-weight: 700; }
body[data-theme="office2016"] .list-body .item.unread .date { color: #2b579a; font-weight: 700; }
body[data-theme="office2016"] .list-body .item.selected, body[data-theme="office2016"] .list-body .item.selected:hover { background: #cde6f7; outline: 1px dotted #2b579a; outline-offset: -1px; }
body[data-theme="office2016"]:not([data-list="rows"]) .list-body .item { padding: 8px 12px 8px 30px; }
body[data-theme="office2016"]:not([data-list="rows"]) .list-body .item .av { display: none; }
body[data-theme="office2016"]:not([data-list="rows"]) .list-body .item .chk { left: 7px; }
body[data-theme="office2016"]:not([data-list="rows"]) .list-body .item .sender { font-size: 18px; font-weight: 400; }
body[data-theme="office2016"]:not([data-list="rows"]) .list-body .item .subject { font-size: 13px; }
body[data-theme="office2016"] .list-foot { background: #f3f3f3; border-top: 1px solid #d4d4d4; }
body[data-theme="office2016"] .msg-head { border-bottom: 1px solid #d4d4d4; }
body[data-theme="office2016"] .msg-subject { font-weight: 400; color: #262626; }
body[data-theme="office2016"] .reader-empty .t1 { color: #444; font-weight: 400; }
body[data-theme="office2016"] .btn { border-radius: 0; }
body[data-theme="office2016"] .btn.accent { background: #2b579a; border-color: #2b579a; }
body[data-theme="office2016"] .dialog, body[data-theme="office2016"] .menu { border-radius: 0; }
/* ---------- compose header on phones ---------- */
@media (max-width: 700px) {
  .compose-head { gap: 4px; padding: 8px 8px 8px 12px; flex-wrap: nowrap; }
  .compose-head h2 { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; margin-right: 2px; }
  .compose-head .btn { flex: none; padding: 0 7px; gap: 3px; height: 32px; font-size: 13px; white-space: nowrap; }
  .compose-head .btn svg { width: 14px; height: 14px; }
  .compose-head .compose-full-btn { width: 32px; padding: 0 !important; }
}
@media (max-width: 380px) { .compose-head .btn:not(.accent):not(.compose-full-btn) svg { display: none; } .compose-head .btn { padding: 0 6px; font-size: 12px; } .compose-head h2 { font-size: 14px; } }
@media (max-width: 700px) { .reader .msg-subject { font-size: 16px !important; line-height: 1.2 !important; } }
/* ---------- reader: full-screen ---------- */
.reader-full-btn { width: 34px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
.reader-full-btn svg { width: 16px; height: 16px; }
body.reader-max .body > .main > .list, body.reader-max .body > .main > .splitter { display: none !important; }
body.reader-max .body > .main > .reader, body.reader-max .body > .main > .compose { flex: 1 1 auto !important; width: auto !important; height: auto !important; max-width: none !important; }
@media (max-width: 1000px) { .reader-full-btn { display: none !important; } }
@media (max-width: 700px) { .reader .msg-head { gap: 10px; } .reader .msg-meta { row-gap: 8px; } .reader .msg-meta .who { line-height: 1.2; gap: 1px; } }
/* ---------- phone: back button ---------- */
.cmdbar.m-cmd .m-back { flex: none; display: inline-flex; align-items: center; gap: 1px; padding: 0 8px 0 3px; height: 32px; border: 1px solid var(--btn-border); border-radius: 4px; background: var(--btn-bg); color: var(--text); }
.cmdbar.m-cmd .m-back svg { width: 18px; height: 18px; }
.cmdbar.m-cmd .m-back span { display: inline !important; font-size: 14px; }
@media (max-width: 420px) { .cmdbar.m-cmd:has(.m-back) .cmd.m-ic { width: 34px; } }
@media (max-width: 360px) { .cmdbar.m-cmd .m-back span { display: none !important; } .cmdbar.m-cmd .m-back { padding: 0 5px; } .cmdbar.m-cmd:has(.m-back) .cmd.m-ic { width: 32px; } }
@media (max-width: 360px) { .cmdbar.m-cmd:has(.m-back) .cmd.primary:not(.m-ic) { padding: 0 9px; } .cmdbar.m-cmd:has(.m-back) { gap: 3px; } }
/* ---------- external images caution ---------- */
.img-warn { margin-top: 6px; padding: 10px 12px; border: 1px solid #f0c36d; background: #fff8e1; color: #6b4e00; border-radius: 4px; font-size: 13px; line-height: 1.6; }
.img-warn b { display: block; margin-bottom: 2px; }
body[data-theme="dark"] .img-warn { background: #3a3220; border-color: #7a6331; color: #f3dfa8; }
.img-warn-note { margin: 6px 0 0; font-size: 12px; color: var(--text-3); }
.chk-line { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; }
.chk-line input { width: auto !important; margin: 0; }
.blocked-bar .btn.sm + .btn.sm { margin-left: 6px; }
/* ---------- login: language picker ---------- */
.login-card { position: relative; }
.login-lang { position: absolute; top: 12px; right: 12px; z-index: 5; }
.login-lang-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; font: inherit; font-size: 13px; color: #424242; cursor: pointer; }
.login-lang-btn:hover, .login-lang-btn.open { background: #f3f5f8; border-color: #e1e5ea; }
.login-lang-btn .car { font-size: 9px; color: #888; }
.login-lang-menu { position: absolute; top: 34px; right: 0; background: #fff; border: 1px solid #e1e5ea; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.14); padding: 4px; min-width: 170px; }
.login-lang-menu[hidden] { display: none; }
.login-lang-menu a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; font-size: 14px; border-radius: 4px; color: #242424; text-decoration: none; white-space: nowrap; }
.login-lang-menu a:hover { background: #f3f5f8; }
.login-lang-menu a.on { background: #f0f0f0; font-weight: 600; }
.login-lang .flag-ico { width: 21px; height: 14px; }
.menu .menu-grp { padding: 8px 12px 4px; font-size: 12px; font-weight: 700; color: var(--text-3); }
/* ---------- folder pane: narrow (stage 1) ---------- */
.collapse-pair { display: inline-flex; gap: 1px; flex-shrink: 0; }
.folders .account .acct-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-folders="narrow"] .folders { width: 162px; }
body[data-folders="narrow"] .folder { padding-left: 8px !important; padding-right: 4px; gap: 6px; }
body[data-folders="narrow"] .folder .count { font-size: 12px; }
body[data-folders="narrow"] .folders .account { padding-left: 6px; }
.list-cols .col-allc { justify-content: flex-start; } .list-cols .col-all { width: 14px; height: 14px; margin: 0 0 0 4px; cursor: pointer; }
/* ---------- menus: compact list + scrolling ---------- */
.menu { overflow-y: auto; overscroll-behavior: contain; }
.menu.menu-compact button { padding: 3px 12px; line-height: 1.27; }
.menu.menu-compact hr { margin: 3px 0; }
.menu .mi-lang { display: inline-flex; align-items: center; gap: 8px; }
.menu .mi-lang .ck { display: inline-block; width: 14px; }

/* ---------- help center ---------- */
.hc-ov { align-items: center; justify-content: center; }
.hc { font-family: Meiryo, "メイリオ", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", "Noto Sans CJK JP", "Microsoft YaHei", "PingFang SC", "Malgun Gothic", "Leelawadee UI", sans-serif; width: min(1080px, calc(100vw - 48px)); height: min(780px, calc(100vh - 48px)); background: #fff; color: #242424; border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,0.25); display: flex; flex-direction: column; overflow: hidden; font-size: 14px; }
.hc-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 20px; border-bottom: 1px solid #e6e6e6; flex: none; }
.hc-head h2 { margin: 0; font-size: 17px; flex: none; }
.hc-tabs { display: flex; gap: 4px; flex: none; }
.hc-tabs button { padding: 6px 14px; border-radius: 16px; font: inherit; font-size: 13.5px; color: #444; border: 1px solid transparent; background: transparent; cursor: pointer; white-space: nowrap; }
.hc-tabs button:hover { background: #f0f0f0; }
.hc-tabs button.on { background: #0f6cbd; color: #fff; }
.hc-search { flex: 1; max-width: 420px; min-width: 0; height: 32px; border: 1px solid #c8c8c8; border-radius: 4px; padding: 0 10px; font: inherit; font-size: 13.5px; background: #fff; color: #242424; }
.hc-x { margin-left: auto; width: 32px; height: 32px; border: 0; background: transparent; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: #444; cursor: pointer; flex: none; }
.hc-x:hover { background: #f0f0f0; }
.hc-x svg { width: 18px; height: 18px; }
.hc-msel { display: none; }
.hc-body { flex: 1; display: flex; min-height: 0; }
.hc-nav { width: 260px; flex: none; border-right: 1px solid #e6e6e6; overflow-y: auto; padding: 8px; background: #fafafa; }
.hc-nav .g { font-size: 11px; font-weight: 700; color: #888; padding: 10px 10px 4px; letter-spacing: 0.04em; }
.hc-nav a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 4px; color: #333; text-decoration: none; font-size: 13.5px; }
.hc-nav a:hover { background: #eef2f6; }
.hc-nav a.on { background: #e3eefb; color: #0f6cbd; font-weight: 700; }
.hc-nav a .n { width: 20px; text-align: center; color: #999; font-size: 12px; flex: none; font-weight: 400; }
.hc-nav a .c { color: #999; font-weight: 400; margin-left: 2px; }
.hc-ver { margin: 16px 10px 6px; font-size: 11px; color: #aaa; }
.hc-main { flex: 1; overflow-y: auto; padding: 22px 32px 32px; line-height: 1.7; }
.hc-bc { font-size: 12px; color: #888; margin-bottom: 6px; }
.hc-main h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.4; }
.hc-main p { margin: 0 0 10px; }
.hc-lead { color: #555; margin: 0 0 16px !important; }
.hc-main h4 { font-size: 15px; margin: 22px 0 8px; padding-left: 10px; border-left: 3px solid #0f6cbd; line-height: 1.4; }
.hc-steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 8px; }
.hc-steps li { counter-increment: s; position: relative; padding: 5px 0 5px 36px; }
.hc-steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 24px; height: 24px; border-radius: 50%; background: #0f6cbd; color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.hc-ul { margin: 0 0 10px; padding-left: 22px; }
.hc-ul li { margin: 2px 0; }
.hc .ui { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #d1d1d1; border-radius: 4px; padding: 0 7px; font-size: 12.5px; background: #fff; line-height: 20px; vertical-align: 1px; white-space: nowrap; }
.hc .kbd { display: inline-block; border: 1px solid #c8c8c8; border-bottom-width: 2px; border-radius: 4px; padding: 0 6px; font-size: 12px; background: #f7f7f7; line-height: 18px; }
.hc .tip { background: #eef6fd; border: 1px solid #cfe3f7; border-radius: 6px; padding: 10px 14px; margin: 14px 0; }
.hc .tip b { color: #0f6cbd; }
.hc .warn { background: #fff8e1; border: 1px solid #f0c36d; border-radius: 6px; padding: 10px 14px; margin: 14px 0; color: #6b4e00; }
.hc-tbl { border-collapse: collapse; width: 100%; font-size: 13px; margin: 6px 0 10px; }
.hc-tbl td, .hc-tbl th { border: 1px solid #e6e6e6; padding: 6px 10px; text-align: left; vertical-align: top; }
.hc-tbl th { background: #f5f5f5; white-space: nowrap; }
.hc-next { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 14px; border-top: 1px solid #eee; font-size: 13px; }
.hc-next a, .hc-hit { color: #0f6cbd; text-decoration: none; }
.hc-hit { display: block; padding: 10px 12px; border: 1px solid #e6e6e6; border-radius: 6px; margin-bottom: 8px; color: #242424; }
.hc-hit:hover { background: #f5f9fe; border-color: #b9d4f1; }
.hc-hit-t { font-weight: 700; color: #0f6cbd; }
.hc-hit-l { font-size: 13px; color: #555; }
.faq-g { font-size: 13px; font-weight: 700; color: #0f6cbd; margin: 18px 0 6px; }
.faq { border: 1px solid #e3e3e3; border-radius: 6px; margin-bottom: 8px; overflow: hidden; }
.faq .q { display: flex; gap: 10px; align-items: center; width: 100%; padding: 11px 14px; font: inherit; font-weight: 700; font-size: 14px; text-align: left; border: 0; background: #fff; color: #242424; cursor: pointer; }
.faq .q:hover { background: #f7f9fc; }
.faq .q .Q { color: #0f6cbd; font-weight: 800; flex: none; }
.faq .q .qt { flex: 1; }
.faq .q .ar { color: #999; transition: transform .15s; flex: none; }
.faq.open .q .ar { transform: rotate(180deg); }
.faq .a { display: none; padding: 8px 14px 14px 38px; color: #333; border-top: 1px dashed #e3e3e3; background: #fbfcfe; }
.faq.open .a { display: block; }
.faq .a .A { color: #d13438; font-weight: 800; margin-left: -24px; margin-right: 10px; }
.hc-more { margin-top: 20px; }
@media (max-width: 760px) {
  .hc { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .hc-head { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .hc-head h2 { display: none; }
  .hc-search { order: 3; flex: 1 1 100%; max-width: none; }
  .hc-x { margin-left: auto; }
  .hc-nav { display: none; }
  .hc-msel { display: block; margin: 8px 12px 0; height: 36px; border: 1px solid #c8c8c8; border-radius: 4px; padding: 0 8px; font: inherit; font-size: 14px; background: #fff; color: #242424; }
  .hc-main { padding: 14px 16px 24px; }
  .hc-main h3 { font-size: 19px; }
  .hc-tbl { font-size: 12.5px; }
  .hc-tbl th { white-space: normal; }
}
/* ---------- delete button in red ---------- */
.cmdbar .cmd.cmd-del, .cmdbar .cmd.cmd-del svg { color: #d13438; stroke: #d13438; }
.cmdbar .cmd.cmd-del:disabled, .cmdbar .cmd.cmd-del:disabled svg { color: #d13438; stroke: #d13438; opacity: 0.45; }
body[data-theme="dark"] .cmdbar .cmd.cmd-del, body[data-theme="dark"] .cmdbar .cmd.cmd-del svg, body[data-theme="rainloop"] .cmdbar .cmd.cmd-del, body[data-theme="rainloop"] .cmdbar .cmd.cmd-del svg { color: #ff8a8f; stroke: #ff8a8f; }
/* ---------- text encoding ---------- */
.menu .mi-enc { display: flex; align-items: center; gap: 6px; width: 100%; }
.menu .mi-enc small { margin-left: auto; padding-left: 16px; color: var(--text-3); font-size: 12px; }
.enc-bar { display: flex; align-items: center; gap: 10px; margin: 8px 28px 0; padding: 6px 12px; background: #eef6fd; border: 1px solid #cfe3f7; border-radius: 4px; font-size: 13px; color: #0f4a85; }
.enc-bar .btn { margin-left: auto; }
body[data-theme="dark"] .enc-bar { background: #1d3248; border-color: #2d4d6e; color: #cfe3f7; }
@media (max-width: 700px) { .enc-bar { margin: 6px 12px 0; } }
/* ---------- version info ---------- */
.menu .menu-info { padding: 2px 12px 6px; font-size: 11.5px; color: var(--text-3); cursor: default; user-select: text; }
.login-footer { flex-wrap: wrap; height: auto; min-height: 56px; padding-top: 8px; padding-bottom: 10px; row-gap: 2px; }
.login-ver { flex-basis: 100%; text-align: center; font-size: 11px; color: #8a8a8a; }

/* ---------- attachment labels in the list + preview panel ---------- */
.att-ic { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 14px; border-radius: 2px; background: #6b7280; color: #fff; font-size: 7.5px; font-weight: 700; letter-spacing: .2px; flex-shrink: 0; line-height: 1; }
.att-ic.pdf { background: #c4314b; } .att-ic.img { background: #0f7b6c; } .att-ic.doc { background: #185abd; } .att-ic.xls { background: #107c41; } .att-ic.zip { background: #8a4b08; }
.att-ic.big { width: 54px; height: 54px; border-radius: 8px; font-size: 15px; }
.item .att-labels { display: flex; flex-wrap: nowrap; gap: 4px; margin: 3px 0 1px; overflow: hidden; min-width: 0; }
.att-label { display: inline-flex; align-items: center; gap: 4px; max-width: 46%; min-width: 0; height: 20px; padding: 0 6px 0 3px; border: 1px solid var(--btn-border); border-radius: 3px; background: var(--pane-bg); color: var(--text-2); font-size: 11px; cursor: pointer; flex-shrink: 1; }
.att-label .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.att-label:hover { border-color: var(--accent); color: var(--accent); background: var(--hover); }
.att-label.more { flex-shrink: 0; padding: 0 6px; font-weight: 600; color: var(--text-3); }
body[data-list="rows"] .list-body .item.has-att { height: auto; min-height: 27px; grid-template-rows: 27px auto; padding-bottom: 4px; }
body[data-list="rows"] .list-body .item.has-att .att-labels { grid-column: 3 / 6; grid-row: 2; margin: 0; padding: 0 6px; }
body[data-list="rows"] .list-body .item .att-label { height: 18px; font-size: 11px; }
body[data-list="rows"] .list-body .item .att-label { max-width: 32%; }
body[data-list="rows"][data-density="compact"] .list-body .item.has-att { grid-template-rows: 23px auto; padding-bottom: 3px; }
body[data-list="rows"][data-density="wide"] .list-body .item.has-att { height: auto; min-height: 46px; grid-template-rows: 22px 20px; padding-bottom: 3px; }
body[data-list="rows"][data-density="wide"] .list-body .item.has-att .preview { grid-column: 2; }
@media (min-width: 701px) { .reader { position: relative; } }
.att .att-dl { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); border-radius: 4px; flex-shrink: 0; }
.att .att-dl svg { width: 16px; height: 16px; }
.att .att-dl:hover { background: var(--active, rgba(0,0,0,.08)); }
.att-preview { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; z-index: 30; display: flex; flex-direction: column; background: var(--pane-bg); box-shadow: -6px 0 18px rgba(0,0,0,.18); transform: translateX(100%); transition: transform .18s ease-out; border-left: 1px solid var(--border); }
.att-preview.open { transform: translateX(0); }
.pv-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--pane-bg); }
.pv-head .att-ic { width: 30px; height: 30px; border-radius: 4px; font-size: 9px; }
.pv-title { flex: 1; min-width: 0; }
.pv-title .n { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-title .s { font-size: 11px; color: var(--text-3); }
.pv-head .btn { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: inherit; white-space: nowrap; }
.pv-head .btn svg { width: 16px; height: 16px; }
.pv-head .btn[disabled] { opacity: .45; pointer-events: none; }
.pv-head .pv-x { padding: 0 8px; }
.pv-tabs { display: flex; align-items: center; gap: 2px; padding: 5px 10px 0; border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.pv-tabs-l { font-size: 11px; color: var(--text-3); margin-right: 6px; white-space: nowrap; }
.pv-tabs button { border: 1px solid var(--border); border-bottom: 0; background: var(--hover); color: var(--text-2); font-size: 12px; padding: 4px 12px; border-radius: 4px 4px 0 0; white-space: nowrap; cursor: pointer; }
.pv-tabs button.cur { background: var(--pane-bg); color: var(--accent); font-weight: 700; border-color: var(--btn-border); position: relative; top: 1px; }
.pv-view { flex: 1; min-height: 0; overflow: auto; position: relative; background: #e9ebee; }
body[data-theme="dark"] .pv-view { background: #1b1b1b; }
.pv-msg { padding: 40px; text-align: center; color: var(--text-3); font-size: 13px; }
.pv-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.pv-imgwrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.pv-img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.2); }
.pv-docx .docx-wrapper { background: transparent !important; padding: 16px !important; align-items: center; }
.pv-docx { min-width: min-content; }
.pv-docx .docx-wrapper > section.docx { box-shadow: 0 1px 6px rgba(0,0,0,.2) !important; margin-bottom: 16px !important; color: #000; }
.pv-sheet { padding: 0; background: #fff; min-height: 100%; }
.pv-sheet table { border-collapse: collapse; font-size: 12px; color: #000; font-family: "Meiryo", "Yu Gothic UI", "Hiragino Sans", sans-serif; }
.pv-sheet td { border: 1px solid #d4d4d4; padding: 2px 6px; white-space: nowrap; min-width: 48px; height: 20px; background: #fff; }
.pv-sheet th { border: 1px solid #c8c8c8; background: #f3f3f3; color: #555; font-weight: 400; font-size: 11px; padding: 2px 6px; position: sticky; top: 0; z-index: 1; }
.pv-sheet tbody th, .pv-sheet tr > th:first-child { position: sticky; left: 0; min-width: 34px; text-align: center; z-index: 1; }
.pv-sheet thead th:first-child { z-index: 2; }
.pv-none { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 100%; padding: 30px; text-align: center; box-sizing: border-box; background: var(--pane-bg); }
.pv-none .t1 { font-size: 15px; font-weight: 700; }
.pv-none .t2 { font-size: 12.5px; color: var(--text-3); }
.pv-none .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; margin-top: 6px; }
.pv-none .btn svg { width: 16px; height: 16px; }
@media (max-width: 700px) {
  body > .att-preview { position: fixed; inset: 0; z-index: 900; border-left: 0; }
  .pv-head .btn span { display: none; }
  .att-label { max-width: 60%; }
  body[data-list="rows"] .list-body .item.has-att, body[data-list="rows"][data-density] .list-body .item.has-att { grid-template-rows: auto auto auto; padding-top: 3px; }
  body[data-list="rows"] .list-body .item.has-att .att-labels { grid-column: 2 / 6; grid-row: 3; margin-top: 2px; }
  body[data-list="rows"] .list-body .item .att-label { max-width: 34%; }
}
@media print { body.pv-open .att-preview { display: none; } }

/* clip mark at the right end of the sender cell (Outlook style) */
.item .sender { display: flex; align-items: center; gap: 4px; min-width: 0; }
.item .sender .snm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sender .sclip { flex: none; display: inline-flex; width: 15px; height: 15px; color: var(--text-3); }
.item .sender .sclip svg { width: 15px; height: 15px; }
.item.selected .sender .sclip { color: inherit; }
.item .row1 .sender { flex: 1; }
.item .preview .icons:empty { display: none; }

/* reader attachments: compact labels, 3 per row */
.attachments.ratts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.ratt { display: flex; align-items: center; gap: 6px; min-width: 0; height: 28px; padding: 0 8px 0 4px; border: 1px solid var(--btn-border); border-radius: 4px; background: var(--hover); color: inherit; text-decoration: none; font-size: 12.5px; cursor: pointer; }
.ratt:hover { border-color: var(--accent); background: var(--pane-bg); }
.ratt:hover .n { color: var(--accent); }
.ratt .att-ic { width: 22px; height: 15px; font-size: 8px; }
.ratt .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ratt .s { flex: none; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
@media (max-width: 700px) { .attachments.ratts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { .ratt { background: none; } }

/* time zone setting (Japan / automatic / choose) */
.tz-field .tz-opt { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; flex-wrap: wrap; }
.tz-field .tz-note { color: var(--text-3); font-size: 12px; }
.tz-field .tz-pick { margin: 2px 0 0 24px; }
.tz-field .tz-select { width: 100%; }
.tz-field .tz-select:disabled { opacity: .5; }
.tz-field .tz-preview { margin-top: 8px; padding: 6px 10px; border-radius: 4px; background: var(--hover); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }

/* ---------- lighter type (light 300 for normal text, regular 400 for emphasis) ---------- */
body:not([data-weight="normal"]) .list .item .sender, body:not([data-weight="normal"]) .list .item .subject, body:not([data-weight="normal"]) .list .item .preview, body:not([data-weight="normal"]) .list .item .date,
body:not([data-weight="normal"]) .list-body .item .sender, body:not([data-weight="normal"]) .list-body .item .subject, body:not([data-weight="normal"]) .list-body .item .preview, body:not([data-weight="normal"]) .list-body .item .date { font-weight: 300 !important; }
body:not([data-weight="normal"]) .list .item.unread .sender, body:not([data-weight="normal"]) .list .item.unread .subject, body:not([data-weight="normal"]) .list .item.unread .date,
body:not([data-weight="normal"]) .list-body .item.unread .sender, body:not([data-weight="normal"]) .list-body .item.unread .subject, body:not([data-weight="normal"]) .list-body .item.unread .date { font-weight: 400 !important; }
body:not([data-weight="normal"]) .list-body .item.unread .date { color: var(--unread-subject, var(--accent)); }
body:not([data-weight="normal"]) .folder { font-weight: 300 !important; }
body:not([data-weight="normal"]) .folder.active, body:not([data-weight="normal"]) .folders .account, body:not([data-weight="normal"]) .folder .count { font-weight: 400 !important; }
body:not([data-weight="normal"]) .folders-sub, body:not([data-weight="normal"]) .group, body:not([data-weight="normal"]) .list-cols .col, body:not([data-weight="normal"]) .list-cols .col-prev { font-weight: 300 !important; }
body:not([data-weight="normal"]) .list-head h2 { font-weight: 400 !important; }
body:not([data-weight="normal"]) .ribbon-tabs .tab { font-weight: 300; }
body:not([data-weight="normal"]) .ribbon-tabs .tab.active { font-weight: 400 !important; }
body:not([data-weight="normal"]) .item .att-label, body:not([data-weight="normal"]) .ratt .n { font-weight: 300; }

/* ---------- settings window (category / section / content) ---------- */
.set-ov { align-items: stretch; justify-content: stretch; padding: 24px; }
.set-win { display: flex; width: 100%; max-width: 1280px; height: calc(100vh - 48px); margin: 0 auto; background: var(--pane-bg); color: var(--text); border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.35); overflow: hidden; }
.set-c1 { width: 230px; flex: none; background: var(--hover); border-right: 1px solid var(--border); padding: 18px 14px; overflow-y: auto; }
.set-h1 { font-size: 21px; font-weight: 400; margin: 2px 4px 14px; }
.set-search { width: 100%; height: 32px; border: 1px solid var(--btn-border); border-radius: 4px; padding: 0 10px; background: var(--input-bg, var(--pane-bg)); color: var(--text); margin-bottom: 14px; box-sizing: border-box; }
.set-cat { display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 10px; border: 0; background: transparent; color: inherit; border-radius: 4px; font-size: 14.5px; cursor: pointer; position: relative; text-align: left; }
.set-cat svg { width: 19px; height: 19px; flex: none; }
.set-cat:hover { background: rgba(127,127,127,.12); }
.set-cat.on { background: rgba(127,127,127,.16); }
.set-cat.on svg { color: var(--accent); }
.set-cat.on::before { content: ''; position: absolute; left: -6px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--accent); }
.set-c2 { width: 230px; flex: none; border-right: 1px solid var(--border); padding: 18px 10px; overflow-y: auto; }
.set-sub { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: inherit; height: 36px; padding: 0 14px; font-size: 14px; border-radius: 4px; position: relative; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-sub:hover { background: var(--hover); }
.set-sub.on::before { content: ''; position: absolute; left: 2px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--accent); }
.set-none { color: var(--text-3); font-size: 13px; padding: 8px 14px; }
.set-c3 { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.set-head { height: 60px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 28px; border-bottom: 1px solid var(--border); }
.set-title { font-size: 20px; font-weight: 400; }
.set-x svg { width: 20px; height: 20px; }
.set-body { flex: 1; overflow-y: auto; padding: 8px 28px 24px; }
.set-foot { flex: none; border-top: 1px solid var(--border); padding: 12px 24px; display: flex; justify-content: flex-end; gap: 8px; }
.set-field { margin: 18px 0 0; max-width: 680px; }
.set-label { font-size: 13.5px; margin-bottom: 6px; }
.set-desc { font-size: 12.5px; color: var(--text-3); margin: -2px 0 8px; }
.set-h2 { font-size: 15px; margin: 20px 0 6px; }
.set-select, .set-input { height: 36px; border: 1px solid var(--btn-border); border-radius: 4px; padding: 0 10px; background: var(--input-bg, var(--pane-bg)); color: var(--text); font-size: 14px; width: 100%; max-width: 420px; box-sizing: border-box; }
.set-select.w-s { max-width: 300px; } .set-select.w-xs { max-width: 120px; }
.set-static { font-size: 14px; color: var(--text-2); }
.set-textarea { width: 100%; max-width: 640px; min-height: 180px; border: 1px solid var(--btn-border); border-radius: 4px; padding: 8px 10px; background: var(--input-bg, var(--pane-bg)); color: var(--text); font: inherit; box-sizing: border-box; }
.set-seg { display: inline-flex; border: 1px solid var(--btn-border); border-radius: 4px; overflow: hidden; flex-wrap: wrap; }
.set-seg button { border: 0; border-right: 1px solid var(--btn-border); background: var(--pane-bg); color: inherit; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.set-seg button:last-child { border-right: 0; }
.set-seg button.on { background: var(--accent); color: var(--accent-text, #fff); }
.set-radio { margin: 6px 0; font-size: 13.5px; }
.set-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.set-toolbar .set-select { max-width: 300px; }
.set-toolbar .set-select.w-xs { max-width: 90px; }
.set-tog { width: 34px; height: 34px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: inherit; font-size: 16px; cursor: pointer; }
.set-tog:hover { background: var(--hover); }
.set-tog.on { background: var(--hover); border-color: var(--btn-border); color: var(--accent); }
.set-color { width: 38px; height: 32px; padding: 2px; border: 1px solid var(--btn-border); border-radius: 4px; background: transparent; cursor: pointer; }
.set-compose-prev { margin-top: 12px; max-width: 640px; border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; line-height: 1.7; background: var(--pane-bg); }
.set-body .tz-field .tz-pick .set-select { max-width: 400px; }
.set-body .theme-pick { max-width: 680px; }
@media (max-width: 700px) {
  .set-ov { padding: 0; }
  .set-win { flex-direction: column; height: 100vh; border-radius: 0; }
  .set-c1 { width: auto; display: flex; align-items: center; gap: 4px; padding: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .set-h1, .set-search { display: none; }
  .set-cat { width: auto; flex: none; height: 34px; }
  .set-cat.on::before { display: none; }
  .set-c2 { width: auto; display: flex; gap: 2px; padding: 6px 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .set-sub { width: auto; flex: none; height: 32px; }
  .set-sub.on { background: var(--hover); }
  .set-sub.on::before { display: none; }
  .set-head { height: 48px; padding: 0 8px 0 16px; }
  .set-body { padding: 4px 16px 16px; }
}

/* ---------- compact compose header (about 30% lower) ---------- */
.compose-head { padding: 5px 12px 5px 16px; gap: 6px; }
.compose-head h2 { font-size: 15px; }
.compose-head .btn { height: 28px; padding: 0 10px; font-size: 13px; gap: 5px; }
.compose-head .btn svg { width: 14px; height: 14px; }
.compose-head .compose-full-btn { width: 30px; }
.compose-row { padding: 2px 16px; }
.compose-row input { height: 28px; }
.compose-row .abook-btn { width: 26px; height: 26px; }
.compose-row .abook-btn svg { width: 16px; height: 16px; }
.compose-tools { padding: 2px 10px; }
.compose-tools button { height: 26px; width: 28px; }
.compose-tools .tool-select { height: 24px; }
.compose-tools .draw-btn { width: auto; }
@media (max-width: 700px) {
  .compose-head { padding: 5px 8px 5px 12px; }
  .compose-head .btn { height: 28px; padding: 0 7px; }
}

/* ---------- centre layout: list and reading pane 50% : 50% ---------- */
body[data-reading="right"][data-half="1"] .list { width: auto !important; flex: 1 1 0; min-width: 0; }
body[data-reading="right"][data-half="1"] .reader, body[data-reading="right"][data-half="1"] .compose { flex: 1 1 0; min-width: 0; }
body[data-reading="right"][data-half="1"] .splitter { cursor: default; pointer-events: none; }
body[data-reading="right"][data-half="1"] .splitter::after { display: none; }

/* ---------- reader header: date at the far right of the "To" line, tighter gap to attachments ---------- */
.msg-meta { flex-wrap: nowrap; }
.msg-meta .meta-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msg-meta .meta-row1 { display: flex; align-items: flex-start; gap: 9px 12px; flex-wrap: wrap; }
.msg-meta .meta-row1 .who { flex: 1; min-width: 180px; }
.msg-meta .to-line { display: flex; align-items: baseline; gap: 12px; font-size: 13px; color: var(--text-3); line-height: 1.65; min-width: 0; }
.msg-meta .to-line .to-txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.msg-meta .to-line .msg-date { flex: none; white-space: nowrap; color: var(--text-2); }
.msg-head { gap: 6px; }
.attachments.ratts { margin-top: 0; }
.msg-body { overflow: auto; }
.msg-body iframe { min-width: 100%; }
@media (max-width: 700px) {
  .msg-meta .to-line { flex-wrap: wrap; gap: 0 10px; }
}

/* ---------- compact reader actions: icon-only (name on hover) ---------- */
.msg-meta .meta-row1 { flex-wrap: wrap; align-items: center; }
.msg-meta .meta-row1 .who { flex: 1 1 220px; min-width: 0; }
.msg-meta .meta-row1 .who .from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-actions { gap: 2px; align-items: center; flex-wrap: nowrap; }
.msg-actions .act-ico { border-color: transparent !important; background: transparent !important; box-shadow: none !important; width: 32px; height: 30px; padding: 0 !important; justify-content: center; border-radius: 4px; }
.msg-actions .act-ico span { display: none; }
.msg-actions .act-ico:hover { background: var(--hover) !important; }
.msg-actions .act-ico svg { width: 18px; height: 18px; }
.msg-actions .act-sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.msg-actions .ag-reply svg, .msg-actions .ag-replyall svg { color: #8b3ab8; }
.msg-actions .ag-forward svg { color: #0f6cbd; }
body[data-theme="dark"] .msg-actions .ag-reply svg, body[data-theme="dark"] .msg-actions .ag-replyall svg { color: #c792ea; }
body[data-theme="dark"] .msg-actions .ag-forward svg { color: #6cb6ff; }

/* ---------- icon-only folder pane: bold icons + short name below, corner badge ---------- */
.folder .fshort { display: none; }
body[data-folders="icons"] .folders { width: 60px !important; min-width: 60px; padding-left: 4px !important; padding-right: 4px !important; }
body[data-folders="icons"] .folder { flex-direction: column; gap: 2px; padding: 7px 0 5px !important; border-radius: 6px; }
body[data-folders="icons"] .folder svg { width: 21px; height: 21px; stroke-width: 2; flex: none; }
body[data-folders="icons"] .folder .fshort { display: block; font-size: 10px; line-height: 1.2; max-width: 52px; overflow: hidden; white-space: nowrap; text-overflow: clip; font-weight: 400 !important; }
body[data-folders="icons"] .folder.active::before { content: ''; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent); }
body[data-folders="icons"] .folder .count { top: 1px; right: 0; font-size: 9.5px; line-height: 15px; padding: 0 4px; min-width: 15px; border: 1.5px solid var(--page-bg, #f0f0f2); font-weight: 700 !important; }
body[data-folders="icons"] .folder .count.capped { font-size: 0; }
body[data-folders="icons"] .folder .count.capped::after { content: attr(data-cap); font-size: 9.5px; }
body[data-folders="icons"] .folder .count.junkc { display: block; background: #8a8a8a; color: #fff; }
body[data-folders="icons"] .folders .account svg, body[data-folders="icons"] .folders-sub button { font-weight: 700; }

/* dark mode toggle (moon / sun) */
.topbar .dark-btn svg { width: 19px; height: 19px; }
@media (max-width: 700px) { .topbar .dark-btn { display: none; } }

/* ---------- search: recent searches dropdown + advanced search panel ---------- */
.search label { position: relative; }
.search .adv-btn { border: 0; background: transparent; color: var(--text-3); width: 28px; height: 26px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.search .adv-btn:hover { background: rgba(127,127,127,.18); color: var(--text); }
.search .adv-btn svg { width: 17px; height: 17px; }
.search-drop { position: fixed; z-index: 120; background: var(--pane-bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.22); font-size: 13px; overflow: hidden; }
.sd-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px 4px; font-size: 11.5px; color: var(--text-3); }
.sd-head a { color: var(--accent); text-decoration: none; }
.sd-none { padding: 6px 14px 10px; color: var(--text-3); }
.sd-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 14px; cursor: pointer; }
.sd-item:hover { background: var(--hover); }
.sd-ic { display: inline-flex; width: 15px; height: 15px; color: var(--text-3); flex: none; }
.sd-ic svg { width: 15px; height: 15px; }
.sd-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-x { border: 0; background: transparent; color: var(--text-3); width: 24px; height: 24px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sd-x svg { width: 12px; height: 12px; }
.sd-x:hover { background: var(--hover); color: var(--text); }
.sd-foot { border-top: 1px solid var(--border-soft); padding: 8px 12px; display: flex; justify-content: flex-end; }
.sd-foot .btn { gap: 6px; }
.sd-foot .btn svg { width: 15px; height: 15px; }
.adv-panel { position: fixed; z-index: 121; width: 392px; max-width: calc(100vw - 16px); background: var(--pane-bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.22); font-size: 13px; padding: 6px 0 10px; }
.adv-h { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px; font-weight: 700; }
.adv-h .icon-btn { width: 28px; height: 28px; }
.adv-h .icon-btn svg { width: 15px; height: 15px; }
.adv-row { display: flex; align-items: center; gap: 8px; padding: 4px 14px; }
.adv-l { width: 68px; flex: none; color: var(--text-2); font-size: 12.5px; }
.adv-row input, .adv-row select { flex: 1; min-width: 0; height: 30px; border: 1px solid var(--btn-border); border-radius: 4px; padding: 0 8px; background: var(--input-bg, var(--pane-bg)); color: var(--text); font: inherit; font-size: 12.5px; }
.adv-date { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.adv-date select { width: 100%; }
.adv-range { display: flex; align-items: center; gap: 6px; }
.adv-range input { flex: 1; min-width: 0; }
.adv-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px 2px; }
@media (max-width: 700px) { .adv-panel { left: 8px !important; right: 8px; width: auto; } .adv-l { width: 56px; } }

/* ---------- icon-only folder pane, narrowest: no labels, 40px, 2px outer margin, 4px gap ---------- */
body[data-folders="icons"] .folders { width: 40px !important; min-width: 40px; padding-left: 2px !important; padding-right: 2px !important; }
body[data-folders="icons"] .folder .fshort { display: none !important; }
body[data-folders="icons"] .folder { padding: 8px 0 !important; gap: 0; }
body[data-folders="icons"] .folder svg { width: 20px; height: 20px; }
body[data-folders="icons"] .folder .count { right: -2px; top: 0; font-size: 9px; line-height: 14px; min-width: 14px; padding: 0 3px; }
body[data-folders="icons"] .folder.active::before { left: -2px; top: 8px; bottom: 8px; }
body[data-folders="icons"] .body { padding-left: 2px; }
body[data-folders="icons"] .body > .folders + .main { margin-left: calc(4px - var(--pane-gap)); }
body[data-folders="icons"] .folders .account { padding: 4px 0; }
body[data-folders="icons"] .folders-sub { padding: 6px 0 2px; }
body[data-folders="icons"] .quota { padding: 6px 2px; }
body[data-theme="thunderbird"][data-folders="icons"] .body, body[data-theme="rainloop"][data-folders="icons"] .body { padding-left: 2px; }
