/* Trakto Mail */
:root {
	--accent: #f5b800; --accent-ink: #1b1f24;
	--bg: #eef0f3; --panel: #ffffff; --panel2: #f7f8fa; --line: #e2e5e9; --line2: #d3d8de;
	--text: #1f2328; --muted: #646d78; --faint: #8b939d; --hover: #f1f3f6;
	--sel: color-mix(in srgb, var(--accent) 16%, var(--panel)); --open: color-mix(in srgb, var(--accent) 24%, var(--panel));
	--top: #2b2f33; --top-ink: #f2f3f5; --danger: #c93c3c; --ok: #23864f;
	--shadow: 0 10px 30px rgba(15, 20, 30, .18), 0 2px 6px rgba(15, 20, 30, .08);
	--radius: 10px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color-scheme: light;
}
html[data-theme="dark"] {
	--bg: #121418; --panel: #1b1e23; --panel2: #20242a; --line: #2c3138; --line2: #3a4049;
	--text: #e7e9ec; --muted: #a0a8b2; --faint: #7b838d; --hover: #252a31;
	--sel: color-mix(in srgb, var(--accent) 14%, var(--panel)); --open: color-mix(in srgb, var(--accent) 22%, var(--panel));
	--top: #0d0f12; --shadow: 0 10px 30px rgba(0, 0, 0, .5);
	color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
	html[data-theme="auto"] {
		--bg: #121418; --panel: #1b1e23; --panel2: #20242a; --line: #2c3138; --line2: #3a4049;
		--text: #e7e9ec; --muted: #a0a8b2; --faint: #7b838d; --hover: #252a31;
		--sel: color-mix(in srgb, var(--accent) 14%, var(--panel)); --open: color-mix(in srgb, var(--accent) 22%, var(--panel));
		--top: #0d0f12; --shadow: 0 10px 30px rgba(0, 0, 0, .5);
		color-scheme: dark;
	}
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: color-mix(in srgb, var(--accent) 35%, #0b5cc0); }
[hidden], .hidden { display: none !important; }
.tml-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tml-i.rot { transform: rotate(-90deg); }
.flip .tml-i { transform: rotate(180deg); }

/* Buttons */
.tml-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid var(--line2); background: var(--panel); border-radius: 8px; cursor: pointer; white-space: nowrap; font-weight: 500; transition: background .12s, border-color .12s; text-decoration: none; color: var(--text); }
.tml-btn:hover { background: var(--hover); }
.tml-btn:focus-visible, .tml-ibtn:focus-visible, .tml-row:focus-visible, .tml-folder:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tml-btn-primary { background: var(--accent); border-color: color-mix(in srgb, var(--accent) 80%, #000); color: var(--accent-ink); font-weight: 600; }
.tml-btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.tml-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.tml-btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.tml-btn-ghost { border-color: transparent; background: transparent; }
.tml-btn-ghost:hover { background: var(--hover); }
.tml-btn.danger { color: var(--danger); }
.tml-btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.tml-btn.busy { opacity: .7; pointer-events: none; }
.tml-btn:disabled { opacity: .55; cursor: default; }
.tml-ibtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--muted); flex: none; text-decoration: none; }
.tml-ibtn:hover { background: var(--hover); color: var(--text); }
.tml-ibtn.on { color: #d2452d; }
.tml-ibtn:disabled, .tml-ibtn.disabled { opacity: .35; cursor: default; pointer-events: none; }
.tml-link { border: 0; background: none; padding: 0; color: color-mix(in srgb, var(--accent) 30%, #0b5cc0); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
html[data-theme="dark"] .tml-link, html[data-theme="dark"] a { color: color-mix(in srgb, var(--accent) 30%, #6eb0ff); }
.tml-link:hover { text-decoration: underline; }
.tml-push { margin-left: auto; }
.tml-input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); color: var(--text); }
.tml-input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); border-color: var(--accent); }
select.tml-input { padding-right: 28px; }
.tml-check { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.tml-muted { color: var(--muted); }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; font: 12px/1.4 var(--font); background: var(--panel2); }

/* Splash / loading */
.tml-splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--muted); }
.tml-spinner { width: 26px; height: 26px; border: 3px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: tml-spin .8s linear infinite; }
@keyframes tml-spin { to { transform: rotate(360deg); } }
.tml-skel { display: block; height: 11px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 25%, var(--hover) 50%, var(--line) 75%); background-size: 200% 100%; animation: tml-shine 1.3s infinite; margin: 6px 0; width: 70%; }
.tml-skel.short { width: 40%; } .tml-skel.wide { width: 90%; height: 18px; } .tml-skel.round { width: 34px; height: 34px; border-radius: 50%; margin: 0; }
@keyframes tml-shine { to { background-position: -200% 0; } }

/* Brand */
.tml-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; min-width: 0; }
.tml-brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); flex: none; }
.tml-brand-mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.tml-brand-mark.big { width: 64px; height: 64px; border-radius: 16px; }
.tml-brand-mark.big svg { width: 34px; height: 34px; }
.tml-brand-mark.ghost { background: var(--line); color: var(--faint); }
.tml-brand-logo { height: 30px; width: auto; max-width: 180px; object-fit: contain; }
.tml-brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Top bar */
#tml-app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.tml-top { height: 54px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 16px; background: var(--top); color: var(--top-ink); }
.tml-top .tml-ibtn { color: #c7ccd2; }
.tml-top .tml-ibtn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.tml-top .tml-brand { width: 228px; }
.tml-nav-toggle { display: none !important; }
.tml-search { flex: 1; max-width: 640px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; border-radius: 9px; background: rgba(255, 255, 255, .1); color: #c7ccd2; transition: background .15s; }
.tml-search:focus-within { background: #fff; color: #555; }
.tml-search-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: #fff; height: 100%; }
.tml-search:focus-within .tml-search-input { color: #1f2328; }
.tml-search-input::placeholder { color: #aab1b9; }
.tml-search-scope { border: 0; background: transparent; color: inherit; font-size: 12px; max-width: 150px; cursor: pointer; }
.tml-search-scope option { color: #1f2328; }
.tml-top-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tml-me { border: 0; background: none; padding: 2px; margin-left: 6px; border-radius: 50%; cursor: pointer; }
.tml-me:hover .tml-avatar { box-shadow: 0 0 0 2px var(--accent); }

/* Layout */
.tml-main { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--nav-w, 250px) var(--list-w, 380px) minmax(0, 1fr); gap: 0; position: relative; }
body.tml-pane-bottom .tml-main { grid-template-columns: var(--nav-w, 250px) minmax(0, 1fr); grid-template-rows: var(--list-h, minmax(200px, 42%)) minmax(0, 1fr); }
body.tml-pane-bottom .tml-nav { grid-row: 1 / 3; }
body.tml-pane-bottom .tml-reader { border-top: 1px solid var(--line); }
body.tml-pane-off .tml-main { grid-template-columns: var(--nav-w, 250px) minmax(0, 1fr); }
body.tml-pane-off.tml-m-list .tml-reader, body.tml-pane-off.tml-m-reader .tml-listpane { display: none; }
body.tml-pane-off .tml-back { display: inline-grid; }
.tml-nav { background: var(--panel2); border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.tml-listpane { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.tml-reader { background: var(--panel); overflow-y: auto; min-height: 0; min-width: 0; position: relative; }

/* Nav */
.tml-nav-inner { padding: 12px 5px 16px 8px; }
.tml-new { width: 100%; justify-content: center; height: 36px; margin-bottom: 10px; }
.tml-acc { margin-bottom: 4px; }
.tml-acc-head { display: flex; align-items: center; gap: 2px; }
.tml-acc-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 4px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; text-align: left; color: var(--text); }
.tml-acc-toggle:hover { background: var(--hover); }
.tml-acc-toggle .tml-i { width: 15px; height: 15px; color: var(--muted); transition: transform .15s; }
.tml-acc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--acc); flex: none; }
.tml-acc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tml-acc-more, .tml-folder-more { opacity: 0; width: 26px; height: 24px; }
.tml-acc-head:hover .tml-acc-more, .tml-folder:hover .tml-folder-more, .tml-folder:focus-within .tml-folder-more { opacity: 1; }
.tml-folders { list-style: none; margin: 0; padding: 0; }
.tml-folder { display: flex; align-items: center; gap: 8px; height: 28px; font-size: 13.5px; padding-right: 3px; border-radius: 7px; cursor: pointer; color: var(--text); position: relative; user-select: none; }
.tml-folder .tml-i { color: var(--muted); width: 15px; height: 15px; }
.tml-folder:hover { background: var(--hover); }
.tml-folder.active { background: var(--open); font-weight: 600; }
.tml-folder.active::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--accent); }
.tml-folder.active .tml-i { color: var(--text); }
.tml-folder.noselect { cursor: default; color: var(--muted); }
.tml-folder.drop { background: var(--sel); outline: 2px dashed var(--accent); outline-offset: -2px; }
.tml-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-folder-name.tagged { display: flex; align-items: center; gap: 7px; }
.tml-folder-name.tagged .tml-fn { flex: 0 0 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tml-fav-tag { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.tml-fav-tag .tml-acc-dot { flex: none; }
.tml-fav-acc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-fav-tag .tml-acc-dot { width: 7px; height: 7px; }
.tml-favs { padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.tml-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-right: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 1; flex: none; }
.tml-count.muted { background: transparent; color: var(--muted); font-weight: 500; min-width: 0; padding: 0 2px; }
.tml-compact .tml-count:not(.muted) { height: 18px; min-width: 18px; padding: 0 5px; }
.tml-folder:hover .tml-count { display: none; }
.tml-folder-error { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--danger); padding: 6px 8px; }
.tml-folder-loading { padding: 4px 10px; }
.tml-nav-foot { margin-top: 10px; padding: 0 8px; }
.tml-nav-foot .tml-link { color: var(--muted); font-size: 13px; }
.tml-nav-foot .tml-i { width: 15px; height: 15px; }

/* List */
.tml-list-head { flex: none; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.tml-list-actions { display: flex; align-items: center; gap: 6px; min-height: 40px; }
.tml-list-actions > .tml-check { margin: 0 10px 0 8px; }
.tml-list-actions .tml-btn-ghost { padding: 0 9px; }
.tml-list-actions .tml-btn-label { display: none; }
.tml-list-title { min-width: 0; flex: 1; }
.tml-list-title h1 { font-size: 17px; font-weight: 650; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tml-sub { color: var(--muted); font-size: 12.5px; }
.tml-selcount { font-weight: 600; margin-right: 6px; white-space: nowrap; }
.tml-filters { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.tml-pill { border: 1px solid var(--line2); background: transparent; border-radius: 999px; padding: 3px 11px; font-size: 12.5px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tml-pill:hover { color: var(--text); background: var(--hover); }
.tml-pill.on { background: var(--text); border-color: var(--text); color: var(--panel); }
.tml-list { flex: 1; overflow-y: auto; min-height: 0; transition: opacity .15s; }
.tml-list.busy { opacity: .6; }
.tml-row { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 10px 12px 10px 10px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; outline: none; }
.tml-compact .tml-row { padding-top: 6px; padding-bottom: 6px; }
.tml-compact .tml-row .tml-avatar { width: 26px; height: 26px; font-size: 11px; }
.tml-row:hover { background: var(--hover); }
.tml-row.selected { background: var(--sel); }
.tml-row.open { background: var(--open); }
.tml-row.unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.tml-row-side { position: relative; display: grid; place-items: center start; padding-left: 2px; }
.tml-row-side .tml-check { position: absolute; left: 10px; top: 50%; margin-top: -8px; opacity: 0; }
.tml-row:hover .tml-row-side .tml-check, .tml-row.selected .tml-row-side .tml-check, .tml-listpane:has(.tml-selcount) .tml-row-side .tml-check { opacity: 1; }
.tml-row:hover .tml-row-side .tml-avatar, .tml-row.selected .tml-row-side .tml-avatar, .tml-listpane:has(.tml-selcount) .tml-row-side .tml-avatar { opacity: 0; }
.tml-row-main { min-width: 0; }
.tml-row-top { display: flex; align-items: center; gap: 8px; }
.tml-row-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-row.unread .tml-row-from { font-weight: 700; }
.tml-row-icons { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); }
.tml-row-icons .tml-i { width: 14px; height: 14px; }
.tml-row-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tml-row.unread .tml-row-date { color: color-mix(in srgb, var(--accent) 50%, var(--text)); font-weight: 600; }
.tml-row-subject { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.tml-row.unread .tml-row-subject { color: var(--text); font-weight: 600; }
.tml-row.flagged { box-shadow: inset -3px 0 0 #e0573c; }
.tml-row-hover { position: absolute; right: 0; top: 0; bottom: 1px; padding-right: 8px; align-items: center; display: none; gap: 2px; background: var(--hover); padding-left: 10px; box-shadow: -14px 0 12px -4px var(--hover); }
.tml-row.selected .tml-row-hover { background: var(--sel); box-shadow: -14px 0 12px -4px var(--sel); }
.tml-row.open .tml-row-hover { background: var(--open); box-shadow: -14px 0 12px -4px var(--open); }
.tml-row-hover .tml-ibtn { width: 30px; height: 30px; }
.tml-row:hover .tml-row-hover { display: flex; }
@media (hover: none) { .tml-row:hover .tml-row-hover { display: none; } }
.tml-high { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 3px; background: #d2452d; color: #fff; font-size: 11px; font-weight: 800; margin-right: 4px; vertical-align: 1px; }
.tml-draft-tag { color: #c4402b; font-weight: 600; margin-right: 6px; }
.tml-row.skel { cursor: default; }
.tml-pager { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.tml-pager span { margin-right: 6px; }
.tml-empty-state { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 60px 24px; color: var(--muted); }
.tml-empty-state > .tml-i { width: 38px; height: 38px; stroke-width: 1.4; color: var(--faint); }
.tml-empty-state.error > .tml-i { color: var(--danger); }
.tml-empty-state p { margin: 0 0 6px; max-width: 360px; }

/* Avatar */
.tml-avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 600; flex: none; letter-spacing: .02em; transition: opacity .1s; }
.tml-avatar.big { width: 44px; height: 44px; font-size: 16px; }
.tml-top .tml-avatar { width: 32px; height: 32px; }

/* Reader */
.tml-reader-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--faint); }
.tml-msg { max-width: 1100px; margin: 0 auto; padding: 0 26px 30px; }
.tml-msg-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 10px 0; background: var(--panel); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tml-msg-bar .tml-btn-ghost { padding: 0 10px; }
.tml-bar-sep { width: 1px; height: 22px; background: var(--line2); margin: 0 6px; }
.tml-back { display: none; }
.tml-msg-loading { padding: 20px 0; }
.tml-msg-loading .tml-spinner { margin: 30px auto; }
.tml-msg-subject { font-size: 21px; font-weight: 650; line-height: 1.3; margin: 0 0 16px; word-break: break-word; }
.tml-msg-from { display: flex; gap: 12px; align-items: flex-start; }
.tml-msg-meta { flex: 1; min-width: 0; }
.tml-msg-sender { word-break: break-all; }
.tml-msg-sender span { color: var(--muted); }
.tml-msg-recips { font-size: 12.5px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.tml-msg-recips b { font-weight: 600; color: var(--text); }
.tml-msg-date { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tml-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; padding: 9px 12px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); font-size: 13px; }
.tml-atts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; align-items: center; }
.tml-att { display: flex; align-items: center; border: 1px solid var(--line2); border-radius: 9px; max-width: 290px; background: var(--panel2); }
.tml-att-main { display: flex; align-items: center; gap: 10px; padding: 7px 4px 7px 9px; min-width: 0; color: inherit; text-decoration: none; }
.tml-att-ext { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--top); color: var(--accent); font-size: 10px; font-weight: 700; flex: none; }
.tml-att-text { display: grid; min-width: 0; }
.tml-att-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-att-size { font-size: 11.5px; color: var(--muted); }
.tml-att-count { font-size: 12px; color: var(--muted); }
.tml-msg-body { margin-top: 18px; background: #fff; border-radius: 8px; }
html[data-theme="dark"] .tml-msg-body { padding: 14px; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .tml-msg-body { padding: 14px; } }
.tml-frame { display: block; width: 100%; border: 0; height: 200px; background: #fff; }
.tml-msg-quick { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.tml-source { max-height: 65vh; overflow: auto; background: var(--panel2); padding: 12px; border-radius: 8px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; margin: 0; }

/* Compose */
.tml-compose { display: flex; flex-direction: column; min-height: 100%; max-width: 1100px; margin: 0 auto; padding: 0 22px 0; position: relative; }
.tml-compose.dropping::after { content: "Drop files to attach"; position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent); display: grid; place-items: center; font-weight: 600; font-size: 16px; pointer-events: none; }
.tml-compose-head { display: flex; align-items: center; gap: 8px; padding: 12px 0 8px; }
.tml-compose-head h2 { margin: 0; font-size: 17px; font-weight: 650; }
.tml-cstatus { font-size: 12px; color: var(--muted); }
.tml-cfields { border-top: 1px solid var(--line); }
.tml-cfield { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); min-height: 42px; position: relative; }
.tml-cfield label { width: 44px; color: var(--muted); font-size: 13px; flex: none; }
.tml-cfield .tml-input { border: 0; height: 40px; padding: 0 2px; border-radius: 0; background: transparent; }
.tml-cfield .tml-input:focus { outline: none; }
.tml-cfield select.tml-input { cursor: pointer; }
.tml-subject { font-size: 15px; font-weight: 500; }
.tml-cc-toggle { font-size: 12.5px; white-space: nowrap; color: var(--muted); }
.tml-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.tml-tb { flex: none; display: inline-grid; place-items: center; min-width: 28px; height: 30px; padding: 0 4px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text); position: relative; }
.tml-tb:hover { background: var(--hover); }
.tml-tb .tml-i { width: 16px; height: 16px; }
.tml-tb-sep { flex: none; width: 1px; height: 20px; background: var(--line2); margin: 0 4px; }
.tml-tb-select { flex: none; height: 30px; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 0 2px; cursor: pointer; max-width: 92px; color: var(--text); }
.tml-tb-select:hover { background: var(--hover); }
.tml-tb-select.small { max-width: 62px; }
.tml-tb-c { overflow: hidden; }
.tml-tb-a { font-weight: 700; border-bottom: 3px solid #c00000; line-height: 1.1; }
.tml-tb-hl { background: #ff0; color: #000; padding: 0 2px; font-size: 12px; }
.tml-tb-color { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.tml-editor { flex: 1; min-height: 260px; padding: 16px 2px 40px; outline: none; overflow-wrap: anywhere; line-height: 1.45; }
.tml-editor img { max-width: 100%; height: auto; }
.tml-editor blockquote { margin: 0 0 0 .5em; padding-left: .8em; border-left: 3px solid var(--line2); }
.tml-editor .tml-quoted { color: inherit; }
.tml-catts { display: flex; flex-wrap: wrap; gap: 6px; }
.tml-catts:not(:empty) { padding: 8px 0; border-bottom: 1px solid var(--line); }
.tml-catt { display: flex; align-items: center; gap: 6px; padding: 3px 2px 3px 9px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel2); max-width: 300px; font-size: 13px; }
.tml-catt .tml-att-name { max-width: 170px; }
.tml-catt .tml-ibtn { width: 26px; height: 26px; }
.tml-catt .tml-i { width: 15px; height: 15px; }
.tml-catt.uploading { opacity: .7; }
.tml-catt.err { border-color: var(--danger); color: var(--danger); }
.tml-compose-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 10px 0 14px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
.tml-send { padding: 0 20px; }
.tml-sig-select { width: auto; max-width: 170px; height: 32px; font-size: 13px; }
.tml-suggest { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; max-height: 320px; overflow-y: auto; }
.tml-suggest-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.tml-suggest-item .tml-avatar { width: 28px; height: 28px; font-size: 11px; }
.tml-suggest-item span { display: grid; min-width: 0; }
.tml-suggest-item b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-suggest-item small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-suggest-item.on, .tml-suggest-item:hover { background: var(--sel); }

/* Menus, modals, toasts */
.tml-menu { position: fixed; z-index: 70; min-width: 210px; max-width: 320px; max-height: 70vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; }
.tml-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 12px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; color: var(--text); }
.tml-menu-item:hover, .tml-menu-item:focus { background: var(--hover); outline: none; }
.tml-menu-item .tml-i { color: var(--muted); width: 17px; height: 17px; }
.tml-menu-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-menu-item.danger, .tml-menu-item.danger .tml-i { color: var(--danger); }
.tml-menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.tml-menu-head { padding: 6px 12px 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tml-modal-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(10, 14, 20, .45); display: grid; place-items: center; padding: 16px; animation: tml-fade .12s; }
@keyframes tml-fade { from { opacity: 0; } }
.tml-modal { width: 100%; max-width: 440px; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.tml-modal.wide { max-width: 900px; }
.tml-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 4px 20px; }
.tml-modal-head h2 { margin: 0; font-size: 17px; font-weight: 650; }
.tml-modal-body { padding: 6px 20px 8px; }
.tml-modal-body p { margin: 4px 0 10px; color: var(--muted); }
.tml-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.tml-toasts { position: fixed; left: 16px; bottom: 16px; z-index: 90; display: grid; gap: 8px; justify-items: start; pointer-events: none; }
.tml-toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #2b2f33; color: #fff; padding: 10px 8px 10px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: min(560px, 92vw); font-size: 13.5px; animation: tml-up .18s; transition: opacity .3s, transform .3s; }
.tml-toast.error { background: #8f2424; }
.tml-toast.ok::before { content: "✓"; color: var(--accent); font-weight: 700; }
.tml-toast.out { opacity: 0; transform: translateY(8px); }
.tml-toast button { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; }
.tml-toast .tml-toast-x { color: #aaa; font-size: 18px; line-height: 1; padding: 0 6px; }
@keyframes tml-up { from { opacity: 0; transform: translateY(10px); } }

/* Welcome */
.tml-welcome { height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; gap: 12px; padding: 30px; }
.tml-welcome h1 { margin: 6px 0 0; font-size: 26px; }
.tml-welcome p { margin: 0 0 10px; color: var(--muted); max-width: 420px; }
body.tml-empty .tml-listpane { display: none; }
body.tml-empty .tml-main { grid-template-columns: var(--nav-w, 250px) minmax(0, 1fr); }

/* Settings */
.tml-settings-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 20, .45); display: grid; place-items: center; padding: 16px; animation: tml-fade .12s; }
.tml-settings { width: 100%; max-width: 1500px; height: min(960px, 100%); background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.tml-settings-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px 24px; border-bottom: 1px solid var(--line); }
.tml-settings-head h1 { margin: 0; font-size: 20px; font-weight: 650; }
.tml-settings-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px 1fr; }
.tml-settings-nav { padding: 14px 10px; background: var(--panel2); border-right: 1px solid var(--line); display: grid; align-content: start; gap: 2px; }
.tml-settings-tab { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); }
.tml-settings-tab:hover { background: var(--hover); }
.tml-settings-tab.on { background: var(--open); font-weight: 600; }
.tml-settings-tab .tml-i { color: var(--muted); }
.tml-settings-content { padding: 22px 30px 40px; overflow-y: auto; }
.tml-settings-title { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tml-settings-title h2 { margin: 0; font-size: 19px; font-weight: 650; flex: 1; }
.tml-settings-content h3 { font-size: 14px; font-weight: 650; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tml-form { max-width: 720px; margin-top: 14px; }
.tml-field { display: grid; gap: 5px; margin-bottom: 14px; }
.tml-field > span { font-size: 13px; font-weight: 500; }
.tml-field small { color: var(--muted); font-size: 12px; }
.tml-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.tml-grid3 { display: grid; grid-template-columns: 2fr 90px 1fr; gap: 0 12px; }
.tml-color { width: 60px; padding: 2px; height: 34px; cursor: pointer; }
.tml-note { background: color-mix(in srgb, var(--accent) 13%, var(--panel)); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; font-size: 13px; margin: -4px 0 14px; }
.tml-adv { border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; margin: 8px 0 14px; }
.tml-adv summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.tml-adv[open] { padding-bottom: 6px; }
.tml-adv h4 { margin: 12px 0 10px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tml-checkline { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; margin-bottom: 12px; cursor: pointer; }
.tml-checkline input { width: 16px; height: 16px; accent-color: var(--accent); }
.tml-checkline small { grid-column: 2; color: var(--muted); font-size: 12px; }
.tml-form-error { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: color-mix(in srgb, var(--danger) 12%, var(--panel)); border-left: 3px solid var(--danger); color: var(--text); padding: 10px 12px; border-radius: 6px; margin: 8px 0 14px; font-size: 13.5px; word-break: break-word; }
.tml-form-actions { display: flex; gap: 8px; margin-top: 18px; }
.tml-acc-card { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }
.tml-acc-card-text { flex: 1; min-width: 0; display: grid; }
.tml-acc-card-text span, .tml-acc-card-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-acc-card-text small { font-size: 12px; color: var(--faint); }
.tml-acc-swatch { width: 12px; height: 40px; border-radius: 6px; flex: none; }
.tml-acc-swatch.sm { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.tml-sig-edit { min-width: 0; }
.tml-sig-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; margin-top: 16px; }
.tml-sig-list { display: grid; align-content: start; gap: 4px; }
.tml-sig-item { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); }
.tml-sig-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-sig-item.on { border-color: var(--accent); background: var(--sel); font-weight: 600; }
.tml-sig-item.add { border-style: dashed; color: var(--muted); }
.tml-sig-item .tml-i { width: 15px; height: 15px; color: var(--muted); }
.tml-sig-editor-wrap { border: 1px solid var(--line2); border-radius: 10px; padding: 0 12px; }
.tml-sig-editor-wrap .tml-toolbar { position: static; }
.tml-sig-editor { min-height: 170px; padding: 12px 2px; font-family: Calibri, Arial, sans-serif; font-size: 11pt; }
.tml-sig-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.tml-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tml-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tml-table td { padding: 8px; border-bottom: 1px solid var(--line); }
.tml-table select { height: 32px; }
.tml-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tml-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); font-size: 12.5px; }
.tml-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 4px; }
.tml-keys { line-height: 2.1; }
.tml-about p { margin: 10px 0; }

/* Login */
body.tml-login-page { background: var(--top); background-image: radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--accent) 30%, transparent) 0, transparent 40%), radial-gradient(circle at 90% 90%, rgba(255, 255, 255, .06) 0, transparent 45%); }
.tml-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.tml-login-card { width: 100%; max-width: 380px; background: #fff; color: #1f2328; border-radius: 16px; padding: 30px 30px 26px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); display: grid; gap: 14px; }
.tml-login-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 650; }
.tml-login-card h1 { margin: 6px 0 0; font-size: 22px; }
.tml-login-card label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; }
.tml-login-card input[type=text], .tml-login-card input[type=password] { height: 42px; padding: 0 12px; border: 1px solid #cdd2d8; border-radius: 9px; font-size: 15px; background: #fff; color: #1f2328; }
.tml-login-card input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); border-color: var(--accent); }
.tml-login-card label.tml-check { display: flex; align-items: center; gap: 8px; font-weight: 400; width: auto; height: auto; }
.tml-login-card label.tml-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.tml-login-card .tml-btn { height: 44px; justify-content: center; font-size: 15px; }
.tml-login-card p { margin: 0; color: #555; }
.tml-login-error { background: #fdecea; color: #8f2424 !important; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; }
.tml-login-lost { font-size: 13px; text-align: center; color: #555 !important; }

/* Mobile */
.tml-scrim { display: none; }
@media (max-width: 1180px) {
	.tml-main { grid-template-columns: var(--nav-w, 220px) var(--list-w, 340px) minmax(0, 1fr); }
	.tml-top .tml-brand { width: 198px; }
	.tml-msg { padding: 0 18px 24px; }
}
@media (max-width: 980px) {
	.tml-rz { display: none !important; }
	.tml-main, body.tml-pane-bottom .tml-main, body.tml-pane-off .tml-main, body.tml-empty .tml-main { grid-template-columns: 1fr minmax(0, 1.2fr); grid-template-rows: none; }
	body.tml-pane-bottom .tml-nav { grid-row: auto; }
	.tml-nav { position: fixed; top: 54px; bottom: 0; left: 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s, visibility .2s; visibility: hidden; }
	body.tml-nav-open .tml-nav { transform: none; box-shadow: var(--shadow); visibility: visible; }
	body.tml-nav-open .tml-scrim { display: block; position: fixed; inset: 54px 0 0; background: rgba(0, 0, 0, .35); z-index: 39; }
	.tml-nav-toggle { display: inline-grid !important; }
	.tml-top .tml-brand { width: auto; }
	.tml-settings-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
	.tml-settings-nav { grid-auto-flow: column; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
	.tml-settings-tab span { white-space: nowrap; }
	.tml-settings-wrap { padding: 0; }
	.tml-settings { height: 100%; border-radius: 0; }
	.tml-settings-content { padding: 18px 18px 40px; }
}
@media (max-width: 820px) {
	.tml-toasts { left: 50%; transform: translateX(-50%); bottom: 76px; justify-items: center; width: max-content; max-width: 92vw; }
	.tml-main, body.tml-pane-bottom .tml-main, body.tml-pane-off .tml-main, body.tml-empty .tml-main { grid-template-columns: 1fr; }
	body.tml-m-list .tml-reader, body.tml-m-reader .tml-listpane { display: none; }
	body.tml-empty .tml-reader { display: block; }
	.tml-back { display: inline-grid; }
	.tml-listpane { border-right: 0; }
	.tml-search-scope, .tml-top .tml-brand { display: none; }
	.tml-search { min-width: 0; }
	.tml-top-right { gap: 0; }
	.tml-top-right > .tml-ibtn:first-child { display: none; }
	.tml-msg-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	.tml-msg-bar .tml-ibtn { width: 32px; }
	.tml-bar-sep { margin: 0 3px; }
	.tml-top { gap: 8px; padding: 0 8px; }
	.tml-msg { padding: 0 14px 24px; }
	.tml-msg-bar .tml-btn-label { display: none; }
	.tml-msg-bar .tml-btn-ghost { padding: 0 7px; }
	.tml-compose { padding: 0 12px; }
	.tml-grid2, .tml-grid3, .tml-sig-layout { grid-template-columns: 1fr; }
	.tml-acc-card { flex-wrap: wrap; }
	.tml-msg-from { flex-wrap: wrap; }
	.tml-msg-date { width: 100%; padding-left: 56px; }
	.tml-compose-foot .tml-btn-ghost .tml-btn-label { font-size: 13px; }
}
@media print { .tml-top, .tml-nav, .tml-listpane, .tml-msg-bar, .tml-msg-quick { display: none !important; } }

/* Pane resizers */
.tml-rz { position: absolute; top: 0; bottom: 0; width: 9px; margin-left: -5px; z-index: 6; cursor: col-resize; touch-action: none; }
.tml-rz.h { top: auto; bottom: auto; left: 0; right: 0; width: auto; height: 9px; margin: -5px 0 0; cursor: row-resize; }
.tml-rz::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: transparent; transition: background .12s; }
.tml-rz.h::after { top: 4px; bottom: auto; left: 0; right: 0; width: auto; height: 2px; }
.tml-rz:hover::after, .tml-rz.drag::after { background: var(--accent); }
body.tml-resizing, body.tml-resizing * { user-select: none !important; }
body.tml-resizing iframe { pointer-events: none; }
body.tml-resizing.col, body.tml-resizing.col * { cursor: col-resize !important; }
body.tml-resizing.row, body.tml-resizing.row * { cursor: row-resize !important; }
.tml-list-title .tml-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tml-compact .tml-folder { height: 25px; font-size: 13px; }
.tml-compact .tml-acc-toggle { padding: 3px 4px; }

/* Contacts */
.tml-nav-apps { margin: 0 0 8px; }
.tml-btn-sm { height: 30px; padding: 0 11px; font-size: 13px; }
.tml-ct-search { height: 32px; margin-top: 8px; }
.tml-ct-letter { position: sticky; top: 0; z-index: 1; padding: 4px 14px; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--panel2); border-bottom: 1px solid var(--line); }
.tml-ct-row { grid-template-columns: 40px 1fr; }
.tml-ct-head { display: flex; gap: 16px; align-items: center; margin: 4px 0 22px; }
.tml-ct-head .tml-avatar.big { width: 64px; height: 64px; font-size: 22px; }
.tml-ct-head h1 { margin: 0 0 2px; font-size: 22px; font-weight: 650; word-break: break-word; }
.tml-ct-badge { display: inline-block; margin-top: 6px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, var(--panel)); font-size: 12px; }
.tml-ct-stat { font-size: 12.5px; margin-top: 4px; }
.tml-ct-fields { display: grid; gap: 4px; max-width: 640px; }
.tml-ct-field { display: flex; gap: 14px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.tml-ct-field > .tml-i { color: var(--muted); margin-top: 10px; }
.tml-ct-field small { display: block; color: var(--muted); font-size: 12px; }
.tml-ct-field .tml-link, .tml-ct-field a { font-weight: 500; }
.tml-ct-notes { white-space: pre-wrap; }
.tml-ct-formtitle { margin: 0 0 0 6px; font-size: 17px; font-weight: 650; }
.tml-textarea { height: auto; min-height: 96px; padding: 8px 10px; resize: vertical; }
.tml-person { border: 0; background: none; padding: 0; margin: 0; cursor: pointer; text-align: left; color: inherit; font: inherit; border-radius: 4px; }
.tml-person:hover b { text-decoration: underline; }
.tml-sug-saved { margin-left: auto; color: var(--muted); }
.tml-sug-saved .tml-i { width: 15px; height: 15px; }
.tml-suggest-item span:not(.tml-avatar):not(.tml-sug-saved) { flex: 1; }
.tml-ct-row:hover .tml-row-side .tml-avatar, .tml-ct-row.open .tml-row-side .tml-avatar { opacity: 1 !important; }
.tml-list-actions .tml-btn-sm .tml-btn-label { display: inline; }

/* Counts sit at the pane edge; the ⋯ buttons float over the row end on hover */
.tml-folder-more { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.tml-acc-head { position: relative; }
.tml-acc-toggle { padding-right: 3px; }
.tml-acc-more { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.tml-acc-head:hover .tml-acc-toggle .tml-count { visibility: hidden; }

/* Templates */
.tml-cbody { flex: 1; display: flex; flex-direction: column; }
.tml-tpl-frame { margin: 12px 0 20px; border-radius: 10px; overflow: hidden; cursor: default; }
.tml-tpl-frame .tml-editor.in-tpl { min-height: 160px; padding: 0; cursor: text; color: inherit; }
.tml-editor h1 { font-size: 26px; line-height: 1.25; margin: 0 0 12px; font-weight: 800; }
.tml-editor h2 { font-size: 20px; line-height: 1.25; margin: 0 0 12px; font-weight: 700; }
.tml-editor h3 { font-size: 17px; line-height: 1.25; margin: 0 0 12px; font-weight: 700; }
.tml-editor p { margin: 0 0 12px; }
.tml-editor.in-tpl h1, .tml-editor.in-tpl h2, .tml-editor.in-tpl h3 { color: var(--tpl-heading); }
.tml-editor.in-tpl h1 { font-size: var(--tpl-h1, 26px); font-weight: var(--tpl-hw, 800); }
.tml-editor.in-tpl h2 { font-size: var(--tpl-h2, 20px); }
.tml-editor.in-tpl h3 { font-size: var(--tpl-h3, 17px); }
.tml-editor.in-tpl a { color: var(--tpl-link); }
.tml-editor .tml-button { cursor: pointer; }
.tml-editor .tml-button:hover { outline: 2px dashed var(--accent); outline-offset: 3px; }
.tml-editor .tml-button a { pointer-events: none; }
.tml-tb-button { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); }
.tml-btn-preview { padding: 6px 0 2px; }
.tml-tpl-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.tml-tpl-layout .tml-sig-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tml-tpl-layout .tml-sig-item { width: auto; max-width: 260px; }
.tml-tpl-cols { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(320px, 664px); gap: 24px; align-items: start; }
.tml-tpl-form .tml-grid3 { grid-template-columns: 1fr 1fr 110px; }
.tml-tpl-side { position: sticky; top: -22px; display: grid; gap: 6px; }
.tml-tpl-preview { width: 100%; height: max(520px, calc(100vh - 230px)); border: 1px solid var(--line2); border-radius: 10px; background: #fff; }
.tml-tpl-name { margin: 0 0 10px !important; border: 0 !important; }
.tml-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; margin-bottom: 12px; }
.tml-swatch-field { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.tml-swatch-field .tml-color { width: 40px; height: 30px; flex: none; }
.tml-swatch-field input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0 12px; }
.tml-logo-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tml-logo-box img { max-height: 44px; max-width: 160px; background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0/12px 12px; border-radius: 6px; padding: 4px; }
.tml-seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; width: max-content; }
.tml-seg button { border: 0; background: none; padding: 6px 14px; cursor: pointer; color: var(--text); }
.tml-seg button.on { background: var(--text); color: var(--panel); font-weight: 600; }
.tml-code { min-height: 300px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@media (max-width: 1240px) { .tml-tpl-cols { grid-template-columns: 1fr; } .tml-tpl-side { position: static; } .tml-tpl-preview { height: 620px; } }

.tml-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tml-settings-title .tml-btn { height: 32px; }

/* Template text styles, bullets and highlight boxes */
.tml-editor.in-tpl { font-family: var(--tpl-font, inherit); font-size: var(--tpl-size, inherit); color: var(--tpl-color, inherit); line-height: var(--tpl-lh, inherit); }
.tml-editor.in-tpl h1, .tml-editor.in-tpl h2, .tml-editor.in-tpl h3 { font-family: var(--tpl-hfont, inherit); }
.tml-editor.tpl-bullets ul { list-style: none; padding-left: 0; margin: 0 0 14px; }
.tml-editor.tpl-bullets ul li { position: relative; padding: 3px 0 3px 24px; }
.tml-editor.tpl-bullets ul li::before { content: var(--tpl-bullet); position: absolute; left: 0; top: 3px; color: var(--tpl-bullet-color); font-weight: 700; }
.tml-tb-hlbox { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: #eef0f2; color: #333; border: 1px solid #d5d9de; }
.tml-swatches.one { grid-template-columns: 1fr; align-self: end; margin-bottom: 14px; }
.tml-clr { font-size: 11.5px; margin-left: 2px; }
.tml-editor.tpl-nums ol { list-style: none; padding-left: 0; margin: 0 0 14px; counter-reset: tplnum; }
.tml-editor.tpl-nums ol li { position: relative; padding: 6px 0 6px 36px; counter-increment: tplnum; }
.tml-editor.tpl-nums ol li::before { content: counter(tplnum); position: absolute; left: 0; top: 4px; width: 24px; height: 24px; line-height: 24px; border-radius: 50%; background: var(--tpl-num-bg); color: var(--tpl-num-color); text-align: center; font-size: 13px; font-weight: 700; }
.tml-starter-editor { min-height: 140px; max-height: 420px; overflow: auto; padding: 12px 2px; font-family: Arial, sans-serif; font-size: 14px; }

/* Template layout tools */
.tml-tpl-rmtools { display: grid; gap: 8px; margin: 0 0 10px; }
.tml-tpl-trim { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line2); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--panel2); font-size: 13px; }
.tml-tpl-trim span { flex: 1; }
.tml-tpl-trim .tml-btn { flex: none; }
.tml-rm-hint { margin: 0; }
.tml-tpl-rm { outline: 2px solid #e53935; outline-offset: -1px; }

/* Alignment buttons */
.tml-tb.on { background: var(--sel); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.tml-align-group { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); width: max-content; }
.tml-align-group .tml-tb { width: 34px; height: 30px; }
.tml-align-group .tml-tb .tml-i { width: 18px; height: 18px; }

/* Reordering favourites by dragging */
.tml-favs .tml-folder[draggable="true"] { cursor: grab; }
.tml-favs .tml-folder.dragging { opacity: .45; }
.tml-favs .tml-folder.fav-before, .tml-favs .tml-folder.fav-after { position: relative; }
.tml-favs .tml-folder.fav-before::after, .tml-favs .tml-folder.fav-after::after { content: ''; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 65%, var(--text)); pointer-events: none; }
.tml-favs .tml-folder.fav-before::after { top: -2px; }
.tml-favs .tml-folder.fav-after::after { bottom: -2px; }

/* Sign-in logo */
.tml-login-brand-logo { justify-content: center; padding: 4px 0 2px; }
.tml-login-logo { display: block; width: auto; max-width: 100%; object-fit: contain; }

/* All Inboxes */
.tml-row-top:has(.tml-row-acc) .tml-row-from { flex: 0 1 auto; }
.tml-row-acc { display: inline-flex; align-items: center; gap: 5px; flex: 1 1 0; min-width: 0; font-size: 11.5px; font-weight: 400; color: var(--faint); }
.tml-row-acc span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-all-inboxes:hover .tml-count { display: inline-grid; }
.tml-row-acc .tml-acc-dot { flex: none; }
.tml-list-warn { display: flex; align-items: flex-start; gap: 8px; margin: 8px 10px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; background: color-mix(in srgb, #e53935 10%, var(--panel)); color: var(--text); }
.tml-list-warn .tml-i { flex: none; color: #e53935; width: 16px; height: 16px; margin-top: 1px; }

/* Contact groups */
.tml-group-av { background: color-mix(in srgb, var(--accent) 22%, var(--panel)); color: color-mix(in srgb, var(--accent) 35%, var(--text)); display: inline-grid; place-items: center; }
.tml-group-av .tml-i { width: 55%; height: 55%; }
.tml-grp-members { display: grid; gap: 2px; padding: 4px 22px 22px; }
.tml-grp-member { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; }
.tml-grp-member.link { cursor: pointer; }
.tml-grp-member.link:hover { background: var(--hover); }
.tml-grp-member div { display: grid; min-width: 0; }
.tml-grp-member b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-grp-member small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-grp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; max-height: 220px; overflow: auto; }
.tml-grp-chips:empty { display: none; }
.tml-grp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 14px; background: var(--sel); font-size: 13px; max-width: 260px; }
.tml-grp-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-grp-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; width: 20px; height: 20px; border-radius: 50%; }
.tml-grp-chip button:hover { background: var(--hover); color: var(--text); }
.tml-grp-add { position: relative; }
.tml-grp-pick { padding: 4px; position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 20; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); overflow: hidden; }
.tml-grp-pick:empty { display: none; }
.tml-ct-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.tml-chip-link { border: 0; cursor: pointer; padding: 2px 10px; border-radius: 12px; background: var(--sel); color: var(--text); font: inherit; font-size: 13px; }
.tml-chip-link:hover { text-decoration: underline; }

/* Conversations */
.tml-thread-caret { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; margin: 0 2px 0 -4px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.tml-thread-caret:hover { background: var(--hover); color: var(--text); }
.tml-thread-caret .tml-i { width: 16px; height: 16px; transform: rotate(-90deg); transition: transform .12s; }
.tml-thread-caret.open .tml-i { transform: none; }
.tml-thread-count { flex: none; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--hover); }
.tml-row.unread .tml-thread-count { color: var(--accent-ink); background: var(--accent); }
.tml-row-child { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 58px; min-height: 34px; font-size: 13px; background: color-mix(in srgb, var(--hover) 45%, transparent); }
.tml-row-child .tml-row-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.tml-row-child.unread .tml-row-from { color: var(--text); }
.tml-row-child .tml-row-icons { display: inline-flex; gap: 4px; color: var(--faint); }
.tml-row-child .tml-row-icons .tml-i { width: 14px; height: 14px; }
.tml-row-child .tml-row-date { flex: none; font-size: 12px; color: var(--faint); }
.tml-child-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--line2); }
.tml-row-child.unread .tml-child-dot { background: var(--accent); border-color: var(--accent); }
.tml-row-child:hover { background: var(--hover); }
.tml-row-child.open { background: var(--open); }
.tml-list-actions .tml-ibtn.on { color: color-mix(in srgb, var(--accent) 55%, var(--text)); background: color-mix(in srgb, var(--accent) 16%, transparent); }

.tml-conv { margin: 0 22px 4px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tml-conv-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: 0; background: var(--panel2); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-align: left; }
.tml-conv-head > .tml-i { width: 16px; height: 16px; }
.tml-conv-head span:first-of-type { flex: 1; }
.tml-conv-caret .tml-i { width: 16px; height: 16px; transform: rotate(180deg); }
.tml-conv.closed .tml-conv-caret .tml-i { transform: none; }
.tml-conv-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 12px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.tml-conv-item .tml-avatar { width: 24px; height: 24px; font-size: 10px; flex: none; }
.tml-conv-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-conv-who small { color: var(--faint); }
.tml-conv-date { flex: none; font-size: 12px; color: var(--faint); }
.tml-conv-item:hover { background: var(--hover); }
.tml-conv-item.on { background: var(--open); font-weight: 600; cursor: default; }
.tml-conv-item.unread .tml-conv-who { font-weight: 700; }

/* Rules */
.tml-rules { display: grid; gap: 8px; }
.tml-rule { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tml-rule.off .tml-rule-main { opacity: .55; }
.tml-rule-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tml-rule-main b { font-weight: 600; }
.tml-rule-main small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.tml-rule-btns { display: flex; align-items: center; gap: 4px; flex: none; }
.tml-rule-btns .tml-ibtn.disabled { opacity: .3; pointer-events: none; }
.tml-switch { position: relative; flex: none; width: 36px; height: 20px; cursor: pointer; }
.tml-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tml-switch span { position: absolute; inset: 0; border-radius: 10px; background: var(--line2); transition: background .15s; pointer-events: none; }
.tml-switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.tml-switch input:checked + span { background: var(--accent); }
.tml-switch input:checked + span::after { transform: translateX(16px); }
.tml-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tml-rule-form h3 { margin-top: 18px; }
.tml-rule-match { max-width: 260px; margin-bottom: 8px; }
.tml-rule-conds { display: grid; gap: 8px; margin-bottom: 6px; }
.tml-rule-cond { display: grid; grid-template-columns: minmax(150px, 190px) minmax(130px, 160px) 1fr 32px; gap: 8px; align-items: center; }
.tml-ibtn-space { width: 32px; }
.tml-rule-folder { display: grid; gap: 4px; max-width: 360px; margin: -4px 0 12px 24px; }
.tml-rule-folder:empty { display: none; }
@media (max-width: 760px) { .tml-rule-cond { grid-template-columns: 1fr 1fr; } .tml-rule-cond input { grid-column: 1 / -1; } .tml-rule { flex-wrap: wrap; } }

/* Automatic replies in rules */
.tml-rule-reply { margin: -4px 0 14px 24px; display: grid; gap: 10px; }
.tml-rule-reply:empty { display: none; }
.tml-rule-reply .tml-note { margin: 0; }
.tml-rule-reply-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tml-rule-reply-prev { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 4px; }
.tml-rule-all { padding: 0 4px; font-size: 13px; grid-column: span 2; }
.tml-rule-dates { max-width: 520px; }
.tml-small { font-size: 12px; margin: 6px 0; }
@media (max-width: 1100px) { .tml-rule-reply-cols { grid-template-columns: 1fr; } }
.tml-form.tml-rule-form { max-width: 1120px; }
.tml-rule-form > .tml-grid2:first-child, .tml-rule-form .tml-rule-conds, .tml-rule-form .tml-rule-dates { max-width: 760px; }

/* Rule: accounts it applies to */
.tml-acc-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.tml-acc-pick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border: 1px solid var(--line2); border-radius: 18px; background: var(--panel); font-size: 13px; cursor: pointer; user-select: none; }
.tml-acc-pick input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.tml-acc-pick.on { border-color: color-mix(in srgb, var(--accent) 70%, var(--line2)); background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.tml-acc-pick:hover { border-color: var(--accent); }
.tml-rule-name { max-width: 372px; }
.tml-login-note { background: color-mix(in srgb, var(--accent) 16%, #fff); color: #1f2328 !important; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; border-left: 3px solid var(--accent); }

/* ---- Team mailboxes (1.0.25) ---- */
.tml-team-chips { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.tml-team-who { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px 1px 2px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 11.5px; font-weight: 500; color: var(--muted); max-width: 110px; }
.tml-team-who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-team-who.me { background: color-mix(in srgb, var(--accent) 20%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--text); }
.tml-team-ini { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #5b6470; color: #fff; font-size: 8.5px; font-weight: 700; letter-spacing: .02em; flex: none; }
.tml-team-who.me .tml-team-ini { background: var(--accent); color: var(--accent-ink); }
.tml-team-notecount { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--faint); }
.tml-team-notecount .tml-i { width: 13px; height: 13px; }
.tml-team-tag { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 600; vertical-align: 1px; line-height: 17px; }
.tml-team-tag .tml-i { width: 12px; height: 12px; }
.tml-team-tag.done { background: #e3f4ea; color: #1e7a45; }
.tml-team-tag.replying { background: #fff1d6; color: #8a5a00; }
.tml-team-tag.replied { background: var(--panel2); color: var(--muted); font-weight: 500; }
html[data-theme="dark"] .tml-team-tag.done { background: #17382a; color: #7fd6a3; }
html[data-theme="dark"] .tml-team-tag.replying { background: #3a2f12; color: #f2c766; }
.tml-row.team-done .tml-row-from, .tml-row.team-done .tml-row-subject { opacity: .62; }
.tml-acc-team { display: inline-grid; place-items: center; color: var(--faint); margin-left: -2px; }
.tml-acc-team .tml-i { width: 13px; height: 13px; }

.tml-team { margin: 16px 0 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); overflow: hidden; }
.tml-team-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; }
.tml-team-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.tml-team-label .tml-i { width: 16px; height: 16px; color: var(--muted); }
.tml-team-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.tml-team-assign { width: auto; min-width: 150px; height: 32px; }
.tml-btn-sm { height: 30px; padding: 0 11px; font-size: 13px; }
.tml-team-done { display: inline-flex; align-items: center; gap: 4px; color: #1e7a45; font-weight: 600; font-size: 13px; }
.tml-team-done .tml-i { width: 15px; height: 15px; }
html[data-theme="dark"] .tml-team-done { color: #7fd6a3; }
.tml-team-replying { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff1d6; color: #6b4600; font-size: 13px; border-top: 1px solid var(--line); }
html[data-theme="dark"] .tml-team-replying { background: #3a2f12; color: #f2c766; }
.tml-team-replying .tml-i { width: 15px; height: 15px; flex: none; }
.tml-team-notes { border-top: 1px solid var(--line); }
.tml-team-notes > summary { cursor: pointer; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; list-style: none; }
.tml-team-notes > summary::-webkit-details-marker { display: none; }
.tml-team-notes > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); margin-right: 4px; transition: transform .15s; }
.tml-team-notes[open] > summary::before { transform: rotate(45deg); }
.tml-team-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; }
.tml-team-activity { max-height: 260px; overflow-y: auto; padding: 2px 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.tml-team-empty { margin: 2px 0 6px; font-size: 12.5px; }
.tml-team-event { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--faint); padding: 1px 2px; }
.tml-team-event time, .tml-team-note-head time { flex: none; color: var(--faint); font-size: 11.5px; }
.tml-team-note { background: #fffbe8; border: 1px solid #f1e3a6; border-radius: 10px; padding: 7px 10px; }
.tml-team-note.mine { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
html[data-theme="dark"] .tml-team-note { background: #2c2816; border-color: #4a4120; }
.tml-team-note-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.tml-team-note-head b { font-weight: 600; }
.tml-team-del { margin-left: auto; font-size: 12px; color: var(--faint); }
.tml-team-note-text { margin-top: 3px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tml-team-add { padding: 0 12px 12px; }
.tml-team-input { height: auto; min-height: 58px; padding: 8px 10px; resize: vertical; font: inherit; font-size: 13.5px; }
.tml-team-add-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.tml-team-warn { margin: 0 0 4px; background: #fff1d6; color: #6b4600; }
html[data-theme="dark"] .tml-team-warn { background: #3a2f12; color: #f2c766; }
.tml-shared-tag { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--muted); vertical-align: 1px; line-height: 17px; }
.tml-row-top .tml-shared-tag { margin-left: 0; flex: none; }
.tml-ct-badge.shared { display: inline-flex; align-items: center; gap: 5px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.tml-ct-badge.shared .tml-i { width: 13px; height: 13px; }
.tml-ct-sharednote { margin: 0 0 4px; font-size: 13px; }
.tml-team-admin-title { margin-top: 30px; }
.tml-team-members .tml-acc-picks { margin-top: 6px; }
.tml-acc-card.team .tml-acc-card-text b { display: inline-flex; align-items: center; }
.tml-filters.wrap { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
.tml-selbar { flex-wrap: wrap; row-gap: 2px; }

/* ---- Conversation cards in the reading pane (1.0.26, like Outlook) ---- */
.tml-msg-conv .tml-conv-title { margin-top: 14px; }
.tml-msg-conv .tml-conv-title .tml-msg-subject { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.tml-conv-n { font-size: 13px; font-weight: 500; color: var(--faint); }
.tml-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.tml-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
.tml-card.open { padding: 14px 18px 16px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--accent); }
.tml-card.open .tml-msg-head { margin: 0; padding: 0; border: 0; }
.tml-card.expanded { padding: 12px 16px 14px; }
.tml-card.collapsed { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; transition: background .12s; }
.tml-card.collapsed:hover { background: var(--hover); }
.tml-card.collapsed:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tml-card.collapsed.unread { box-shadow: inset 3px 0 0 var(--accent); }
.tml-card.collapsed.unread .tml-card-who { font-weight: 700; }
.tml-card.loading { opacity: .55; pointer-events: none; }
.tml-card-main { flex: 1; min-width: 0; }
.tml-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tml-card-who { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-card-who small, .tml-msg-sender small { font-weight: 400; color: var(--faint); font-size: 12.5px; }
.tml-card-date { flex: none; font-size: 12.5px; color: var(--faint); }
.tml-card-snip { margin-top: 2px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-card-head { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.tml-card-tools { display: flex; align-items: center; gap: 0; flex: none; margin-left: auto; }
.tml-card-tools .tml-msg-date { margin-right: 6px; }
.tml-card-tools .tml-ibtn { width: 30px; height: 30px; }
.tml-card .tml-msg-body { margin-top: 14px; }
.tml-card .tml-msg-quick { margin-top: 16px; }
@media (max-width: 700px) { .tml-card-tools .tml-msg-date { display: none; } .tml-card.open { padding: 12px; } }

/* ---- Reading pane toolbar (1.0.26): actions left, Reply / Reply all / Forward right ---- */
.tml-msg-bar { gap: 4px; }
.tml-msg-bar > .tml-ibtn { width: 34px; height: 34px; color: var(--text); border-radius: 9px; }
.tml-msg-bar > .tml-ibtn .tml-i { width: 20px; height: 20px; stroke-width: 1.7; }
.tml-msg-bar > .tml-ibtn:hover { background: var(--hover); color: var(--text); }
.tml-msg-bar > .tml-act-delete:hover { color: #c62f2f; background: color-mix(in srgb, #c62f2f 10%, transparent); }
.tml-msg-bar > .tml-ibtn.on { color: #d9480f; background: color-mix(in srgb, #d9480f 12%, transparent); }
.tml-msg-bar > .tml-ibtn.on .tml-i { fill: color-mix(in srgb, #d9480f 25%, transparent); }
.tml-bar-replies { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.tml-bar-replies .tml-btn { height: 34px; padding: 0 12px; border-radius: 9px; color: var(--text); }
.tml-bar-replies .tml-btn .tml-i { width: 19px; height: 19px; stroke-width: 1.7; }
.tml-bar-replies .tml-btn:hover { background: var(--hover); }
.tml-card-tools .tml-ibtn { color: var(--text); }
.tml-card-tools .tml-ibtn .tml-i { width: 18px; height: 18px; stroke-width: 1.7; }
.tml-reader { container-type: inline-size; }
@container (max-width: 760px) { .tml-bar-replies .tml-btn-label { display: none; } .tml-bar-replies .tml-btn { padding: 0 8px; } .tml-bar-replies .tml-btn .tml-i { width: 20px; height: 20px; } }
.tml-sent-tag { flex: none; padding: 0 7px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel2); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 17px; }
.tml-row-child .tml-sent-tag { margin-left: 2px; }

/* ---- List rows like Outlook (1.0.28): From / Subject + time / Preview ---- */
.tml-row-line2 { display: flex; align-items: baseline; gap: 8px; margin-top: 1px; min-width: 0; }
.tml-row-line2 .tml-row-subject { display: block; flex: 1; min-width: 0; margin-top: 0; }
.tml-row-line2 .tml-row-date { flex: none; }
.tml-row-top .tml-row-icons { margin-left: auto; }
.tml-row-top:has(.tml-row-acc) .tml-row-icons, .tml-row-top:has(.tml-team-chips) .tml-row-icons { margin-left: 0; }
.tml-row-preview { margin-top: 1px; font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-row.unread .tml-row-preview { color: var(--muted); }
body.tml-compact .tml-row-preview, [data-density="compact"] .tml-row-preview { margin-top: 0; }
.tml-row-line2 .tml-row-subject { color: color-mix(in srgb, var(--text) 82%, var(--panel)); }
.tml-row.unread .tml-row-line2 .tml-row-subject { color: var(--text); }

/* ---- Search as you type (1.0.28, like Outlook) ---- */
.tml-search { position: relative; }
.tml-sq { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 440px; max-height: min(72vh, 640px); overflow-y: auto; padding: 6px 0; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(15, 20, 30, .22); z-index: 60; }
.tml-sq-item { display: flex; align-items: center; gap: 12px; padding: 8px 14px; cursor: pointer; min-height: 52px; }
.tml-sq-item.on { background: var(--hover); }
.tml-sq-item .tml-avatar { width: 34px; height: 34px; font-size: 12px; flex: none; }
.tml-sq-main { flex: 1; min-width: 0; }
.tml-sq-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tml-sq-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.tml-sq-title b, .tml-sq-sub b { font-weight: 700; color: var(--text); }
.tml-sq-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; }
.tml-sq-ico.plain { color: var(--muted); }
.tml-sq-ico.plain .tml-i { width: 20px; height: 20px; }
.tml-sq-ico.mail { background: color-mix(in srgb, #2f80ed 14%, var(--panel)); color: #2f6fd6; }
.tml-sq-file { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; flex: none; font-size: 10px; font-weight: 700; letter-spacing: .02em; color: #fff; background: #6b7280; }
.tml-sq-file.pdf { background: #d64535; } .tml-sq-file.doc { background: #2f6fd6; } .tml-sq-file.xls { background: #1f8a4c; }
.tml-sq-file.ppt { background: #d9692b; } .tml-sq-file.img { background: #8a4fd6; } .tml-sq-file.zip { background: #8a6d3b; }
.tml-sq-act { color: #2f6fd6; flex: none; }
.tml-sq-date { flex: none; font-size: 12.5px; color: var(--muted); }
.tml-sq-wait { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 4px; }
.tml-spinner.small { width: 16px; height: 16px; border-width: 2px; margin: 0; }
@media (max-width: 700px) { .tml-sq { min-width: 0; position: fixed; left: 8px; right: 8px; top: 56px; } }
.tml-sq .tml-sq-act, .tml-sq .tml-sq-act .tml-i { color: #2f6fd6; opacity: 1; }

/* ---- Message rows like Outlook / Apple Mail (1.0.29) ---- */
.tml-row.tml-mrow { grid-template-columns: 16px 38px 1fr; gap: 0 10px; padding: 10px 14px 10px 4px; }
.tml-row-gutter { display: grid; place-items: center; align-self: center; }
.tml-row-gutter .tml-thread-caret { margin: 0; width: 18px; height: 22px; }
.tml-mrow .tml-row-from { font-size: 14.5px; }
.tml-mrow .tml-row-line2 { margin-top: 2px; }
.tml-mrow .tml-row-line2 .tml-row-subject, .tml-mrow .tml-row-preview { font-size: 14px; line-height: 1.35; }
.tml-mrow .tml-row-preview { margin-top: 1px; color: var(--muted); }
.tml-mrow .tml-row-date { font-size: 13px; }
.tml-row-child { display: block; padding: 8px 14px 8px 78px; min-height: 0; font-size: 14px; background: color-mix(in srgb, var(--hover) 40%, var(--panel)); border-bottom: 1px solid var(--line); }
.tml-child-main { min-width: 0; }
.tml-child-l1, .tml-child-l2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tml-child-l2 { margin-top: 2px; }
.tml-row-child .tml-row-from { font-size: 14.5px; color: var(--text); }
.tml-row-child.unread .tml-row-from { font-weight: 700; }
.tml-row-child .tml-row-icons { margin-left: auto; color: var(--muted); }
.tml-row-child .tml-row-icons .tml-i { width: 15px; height: 15px; }
.tml-row-child .tml-row-preview { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); margin: 0; }
.tml-row-child .tml-row-date { font-size: 13px; color: var(--muted); }
.tml-row-child .tml-sent-tag { font-size: 12px; padding: 1px 8px; border-radius: 7px; }
.tml-row-child.open { background: var(--open); }
.tml-row-child.unread { box-shadow: inset 3px 0 0 var(--accent); }

/* ---- Replies: the earlier email sits under the message / template (1.0.29) ---- */
.tml-cbody.has-quote > .tml-editor:not(.tml-quote-box) { flex: none; min-height: 120px; padding-bottom: 12px; }
.tml-cbody.has-quote > .tml-tpl-frame { margin-bottom: 8px; }
.tml-quote-box { flex: 1; min-height: 80px; padding: 4px 2px 40px; }
.tml-quote-box .tml-quote-head { margin-top: 0 !important; }

/* =====================================================================
   Soft Cards (1.0.30): panes as rounded cards on a soft background, a light
   top bar and quieter controls. Every highlight comes from the site's accent
   colour (Settings › Trakto Mail), with --accent-ink for text on it.
   ===================================================================== */
:root {
	--bg: #eceef2; --panel2: #f5f6f8; --line: #eceef1; --hover: #f3f4f7;
	--tint: color-mix(in srgb, var(--accent) 15%, var(--panel));
	--tint-strong: color-mix(in srgb, var(--accent) 26%, var(--panel));
	--sel: var(--tint); --open: var(--tint-strong);
	--card-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 0 0 1px rgba(16, 24, 40, .03);
	--font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--top: var(--bg); --top-ink: var(--text);
}
html[data-theme="dark"] { --bg: #0f1114; --panel2: #1f2329; --line: #272b31; --hover: #23272d; --card-shadow: 0 0 0 1px #23272e; --top: var(--bg); --top-ink: var(--text); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] { --bg: #0f1114; --panel2: #1f2329; --line: #272b31; --hover: #23272d; --card-shadow: 0 0 0 1px #23272e; --top: var(--bg); --top-ink: var(--text); } }

/* Top bar: light, with a white search box */
.tml-top { height: 64px; padding: 0 16px 0 20px; gap: 18px; background: var(--top); color: var(--top-ink); }
.tml-top .tml-brand { width: 236px; }
.tml-top .tml-ibtn { color: var(--text); width: 40px; height: 40px; border-radius: 10px; }
.tml-top .tml-ibtn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.tml-top .tml-ibtn .tml-i { width: 20px; height: 20px; stroke-width: 1.7; }
.tml-search { height: 42px; border-radius: 12px; background: var(--panel); color: var(--muted); box-shadow: var(--card-shadow), 0 1px 3px rgba(16, 24, 40, .06); }
.tml-search:focus-within { background: var(--panel); color: var(--muted); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent), 0 4px 14px rgba(16, 24, 40, .08); }
.tml-search-input, .tml-search:focus-within .tml-search-input { color: var(--text); font-size: 14px; }
.tml-search-input::placeholder { color: var(--muted); }
.tml-search-scope { color: var(--muted); }
/* A white logo gets a dark tile on the light bar (and a dark logo a light tile in dark mode). */
.tml-brand.tone-light { background: #1f2328; padding: 6px 12px; border-radius: 10px; width: auto !important; max-width: 236px; }
html[data-theme="dark"] .tml-brand.tone-light { background: transparent; padding: 0; }
html[data-theme="dark"] .tml-brand.tone-dark { background: #f3f4f6; padding: 6px 12px; border-radius: 10px; width: auto !important; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .tml-brand.tone-light { background: transparent; padding: 0; } html[data-theme="auto"] .tml-brand.tone-dark { background: #f3f4f6; padding: 6px 12px; border-radius: 10px; width: auto !important; } }

/* Panes as cards */
.tml-main { gap: 12px; padding: 0 12px 12px; }
.tml-nav, .tml-listpane, .tml-reader { background: var(--panel); border: 0; border-radius: 16px; box-shadow: var(--card-shadow); }
body.tml-pane-bottom .tml-reader { border-top: 0; }
.tml-listpane { overflow: hidden; }
.tml-rz::after { left: 3px; width: 3px; border-radius: 2px; }

/* Folder card */
.tml-nav-inner { padding: 14px 10px 18px; }
.tml-new { height: 44px; border-radius: 12px; font-size: 15px; margin-bottom: 14px; box-shadow: none; }
.tml-acc-toggle { font-size: 14px; padding: 6px 6px; border-radius: 9px; }
.tml-folder { height: 34px; font-size: 14px; border-radius: 10px; padding-right: 4px; }
.tml-folder .tml-i { width: 17px; height: 17px; }
.tml-folder.active { background: var(--tint); }
.tml-folder.active::before { display: none; }
.tml-favs { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 10px; }
.tml-count { min-width: 22px; height: 20px; border-radius: 10px; }

/* Message list card */
.tml-list-head { padding: 16px 16px 12px; border-bottom: 0; }
.tml-list-title h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.tml-list-title .tml-sub { font-size: 13px; }
.tml-list-actions .tml-ibtn { border-radius: 10px; }
.tml-list-actions .tml-ibtn.on { color: var(--text); background: var(--tint); }
.tml-filters { margin-top: 12px; gap: 2px; padding: 3px; background: var(--panel2); border-radius: 10px; }
.tml-filters.wrap { row-gap: 2px; }
.tml-pill { flex: 1 1 auto; border: 0; border-radius: 8px; height: 30px; padding: 0 10px; font-size: 13px; font-weight: 500; color: var(--muted); background: transparent; }
.tml-pill:hover { background: color-mix(in srgb, var(--panel) 60%, transparent); color: var(--text); }
.tml-pill.on { background: var(--panel); color: var(--text); border: 0; box-shadow: 0 1px 2px rgba(16, 24, 40, .12), 0 0 0 1px rgba(16, 24, 40, .04); }
.tml-list { padding: 0 8px 8px; }
.tml-row { border-bottom: 0; border-radius: 12px; margin: 2px 0; }
.tml-row.tml-mrow { padding: 12px 12px 12px 4px; }
.tml-row:hover { background: var(--hover); }
.tml-row.selected { background: var(--tint); }
.tml-row.open { background: var(--tint-strong); }
.tml-row.unread::before { left: 3px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; }
.tml-row.flagged { box-shadow: inset -3px 0 0 #e0573c; }
.tml-row-hover { border-radius: 0 12px 12px 0; }
.tml-row-child { margin: 0 0 2px 76px; padding: 8px 12px; border-left: 2px solid var(--line); border-bottom: 0; border-radius: 0 10px 10px 0; background: transparent; }
.tml-row-child:hover { background: var(--hover); }
.tml-row-child.open { background: var(--tint-strong); }
.tml-row-child.unread { box-shadow: none; border-left-color: var(--accent); }
.tml-thread-count { background: var(--panel2); }
.tml-row.unread .tml-thread-count { background: var(--accent); color: var(--accent-ink); }
.tml-ct-letter { background: transparent; }
.tml-pager { border-top: 1px solid var(--line); }

/* Pastel avatars (hue from the address) */
.tml-avatar { background: hsl(var(--h, 220) 72% 82%) !important; color: hsl(var(--h, 220) 60% 24%); }
.tml-avatar.big { width: 46px; height: 46px; }
html[data-theme="dark"] .tml-avatar { background: hsl(var(--h, 220) 45% 32%) !important; color: hsl(var(--h, 220) 85% 88%); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .tml-avatar { background: hsl(var(--h, 220) 45% 32%) !important; color: hsl(var(--h, 220) 85% 88%); } }
.tml-group-av { background: var(--tint) !important; color: var(--text) !important; }

/* Reading pane card */
.tml-msg { padding: 0 32px 32px; }
.tml-msg-bar { padding: 12px 0; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tml-tray { display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--panel2); border-radius: 12px; }
.tml-msg-bar .tml-tray > .tml-ibtn { width: 36px; height: 34px; border-radius: 9px; color: var(--text); }
.tml-msg-bar .tml-tray > .tml-ibtn:hover { background: var(--panel); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.tml-msg-bar .tml-tray > .tml-act-delete:hover { color: #c62f2f; background: var(--panel); }
.tml-msg-bar .tml-tray > .tml-ibtn.on { color: #d9480f; background: var(--panel); }
.tml-bar-replies .tml-btn { height: 38px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel); font-weight: 500; }
.tml-bar-replies .tml-btn:hover { background: var(--hover); }
.tml-bar-replies .tml-btn:first-child { background: var(--accent); border-color: color-mix(in srgb, var(--accent) 80%, #000); color: var(--accent-ink); font-weight: 600; }
.tml-bar-replies .tml-btn:first-child:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.tml-msg-subject { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 20px; }
.tml-msg-body { margin-top: 24px; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.tml-msg-quick .tml-btn { height: 40px; border-radius: 10px; }
.tml-cards { gap: 12px; }
.tml-card { border-radius: 16px; border-color: var(--line); }
.tml-card.open { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--accent); }
.tml-team { border-radius: 16px; }

/* Smaller screens: the folder card becomes a drawer under the 64px bar */
@media (max-width: 980px) {
	.tml-main { gap: 8px; padding: 0 8px 8px; }
	.tml-nav { top: 64px; border-radius: 0 16px 16px 0; }
	body.tml-nav-open .tml-scrim { inset: 64px 0 0; }
}
/* Dark mode: accent tints stay subtle whatever the accent (a pale accent mixed strongly into a dark panel turns mid-grey). */
html[data-theme="dark"] { --tint: color-mix(in srgb, var(--accent) 16%, var(--panel)); --tint-strong: color-mix(in srgb, var(--accent) 27%, var(--panel)); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] { --tint: color-mix(in srgb, var(--accent) 16%, var(--panel)); --tint-strong: color-mix(in srgb, var(--accent) 27%, var(--panel)); } }

/* Folder card alignment (1.0.32): All Inboxes / Contacts in line with the arrows; folders under their heading's name. */
.tml-nav-apps .tml-folder { padding-left: 6px; }
.tml-acc-toggle { gap: 6px; }
/* Slightly more compact folder card */
.tml-nav-inner { padding: 12px 10px 14px; }
.tml-new { height: 40px; margin-bottom: 10px; }
.tml-folder { height: 30px; font-size: 13.5px; }
.tml-folder .tml-i { width: 16px; height: 16px; }
.tml-acc-toggle { padding: 4px 6px; font-size: 13.5px; }
.tml-acc-head { margin-top: 2px; }
.tml-favs { padding-bottom: 6px; margin-bottom: 6px; }
.tml-acc { margin-bottom: 2px; }
.tml-nav-apps { margin-bottom: 6px; }
.tml-nav-foot { margin-top: 6px; }
.tml-compact .tml-folder { height: 27px; }
/* Compose subject uses the same text as the From / To values (1.0.35) */
.tml-subject, .tml-compose .tml-subject { font-size: 14px; font-weight: 400; }
.tml-subject::placeholder { font-size: 14px; font-weight: 400; }
/* Tighter message rows (1.0.37) */
.tml-list .tml-row:not(.tml-row-child) { padding-top: 7px; padding-bottom: 7px; }
.tml-list .tml-row:not(.tml-row-child) .tml-row-from,
.tml-list .tml-row:not(.tml-row-child) .tml-row-sender { line-height: 1.3; }
.tml-list .tml-row:not(.tml-row-child) .tml-row-line2 { margin-top: 0; line-height: 1.3; }
.tml-list .tml-row:not(.tml-row-child) .tml-row-preview { margin-top: 0; line-height: 1.3; }
.tml-list .tml-row-child { padding-top: 6px; padding-bottom: 6px; }
.tml-compact .tml-list .tml-row:not(.tml-row-child) { padding-top: 4px; padding-bottom: 4px; }
/* Tighter message heading (1.0.38) */
.tml-msg-subject { font-size: 22px; line-height: 1.25; margin-bottom: 12px; }
.tml-msg-from { gap: 10px; }
.tml-msg-from .tml-avatar { width: 38px; height: 38px; font-size: 14px; }
.tml-msg-recips { margin-top: 1px; }
.tml-reader .tml-atts { margin-top: 12px; }
.tml-msg > .tml-msg-body, .tml-card.open > .tml-msg-body { margin-top: 16px; }
.tml-msg-bar { margin-bottom: 14px; }
/* Toolbar menus show the current style, font and size (1.0.39) */
.tml-toolbar .tml-tb-select { max-width: none; }
.tml-toolbar .tml-tb-select[aria-label="Paragraph style"] { width: 112px; }
.tml-toolbar .tml-tb-select[aria-label="Font"] { width: 128px; }
.tml-toolbar .tml-tb-select[aria-label="Text size"] { width: 78px; }
/* Template / signature menus size to their names (1.0.41) */
.tml-compose-foot .tml-sig-select { max-width: 360px; flex: none; }
