/*
 * HyperDC Webmail. Colours come from the hx-* tokens, so every surface follows the theme. The two places that hold other people's colours, the
 * message frame and the editor, stay "on paper" in what they save and are turned over as a picture in the dark theme, so nothing is white on
 * white or black on black and what the recipient gets is never changed.
 */
[hidden] { display: none !important; }
body { background: var(--hx-bg); }

#wm-app { height: 100dvh; display: grid; grid-template-columns: 76px minmax(0, 1fr); background: var(--hx-bg); color: var(--hx-ink); font-family: var(--wm-font, var(--hx-font)); }
.wm-main { display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.wm-views { grid-row: 3; position: relative; min-height: 0; min-width: 0; display: grid; }
.wm-pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; }

/* App rail */
.wm-rail { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; background: var(--hx-surface); border-right: 1px solid var(--hx-edge); min-height: 0; overflow: hidden auto; }
.wm-rail-btn { position: relative; width: 67px; padding: 7px 2px 5px; display: grid; justify-items: center; gap: 3px; border: 0; border-radius: 10px; background: transparent; color: var(--hx-ink-2); cursor: pointer; font-size: 0.66rem; line-height: 1.1; font-weight: 500; }
.wm-rail-btn i { font-size: 1.05rem; }
.wm-rail-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-rail-btn:hover { background: color-mix(in srgb, var(--hx-accent) 10%, transparent); color: var(--hx-ink); }
.wm-rail-btn.on { background: color-mix(in srgb, var(--hx-accent) 16%, transparent); color: var(--hx-accent); }
.wm-rail-btn em { position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--hx-primary-fill); color: var(--hx-on-primary); font-style: normal; font-size: 0.62rem; font-weight: 700; line-height: 16px; text-align: center; }
.wm-rail-gap { flex: 1 1 auto; }
.wm-rail-tool { flex: none; }

/* Top bar */
.wm-top { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: var(--hx-surface); border-bottom: 1px solid var(--hx-edge); min-width: 0; }
.wm-brand { display: flex; align-items: center; gap: 8px; flex: none; }
.wm-brand b { font-size: 0.92rem; font-weight: 600; color: var(--hx-ink); }
.wm-logo { height: 26px; width: auto; }
.wm-search { flex: 1 1 auto; min-width: 0; max-width: 640px; margin: 0 auto; height: 34px; padding-right: 2px; }
.wm-search .tool-ib { width: 28px; height: 28px; }
.wm-top-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.wm-menu-btn { display: none; }

/* Avatars: corporate blue in a few depths */
.wm-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 600; font-size: 0.76rem; color: #ffffff; background: var(--hx-primary-fill); line-height: 1; user-select: none; }
.wm-avatar.big { width: 64px; height: 64px; font-size: 1.25rem; }
.wm-me { width: 32px; height: 32px; border: 0; padding: 0; cursor: pointer; }
.wm-tone-0 { background: #0071bc; }
.wm-tone-1 { background: #1b5f94; }
.wm-tone-2 { background: #2b95e0; }
.wm-tone-3 { background: #34587c; }
.wm-tone-4 { background: #0d4a78; }

/* Ribbon */
.wm-ribbon { background: var(--hx-surface); border-bottom: 1px solid var(--hx-edge); min-width: 0; container-type: inline-size; }
.wm-rb-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px 10px 0; }
.wm-rb-tabs button { border: 0; background: transparent; padding: 4px 11px; border-radius: 8px 8px 0 0; color: var(--hx-ink-2); font-size: 0.8rem; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; }
.wm-rb-tabs button:hover { color: var(--hx-ink); background: color-mix(in srgb, var(--hx-accent) 7%, transparent); }
.wm-rb-tabs button.on { color: var(--hx-ink); font-weight: 600; border-bottom-color: var(--hx-accent); }
.wm-rb-cmds { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; padding: 4px 10px 5px; min-height: 40px; }
.wm-rb-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--hx-ink-2); font-size: 0.78rem; font-weight: 500; cursor: pointer; white-space: nowrap; }
.wm-rb-btn i { color: var(--hx-accent); font-size: 0.84rem; }
.wm-rb-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--hx-accent) 10%, transparent); color: var(--hx-ink); }
.wm-rb-btn.on { background: color-mix(in srgb, var(--hx-accent) 16%, transparent); color: var(--hx-ink); }
.wm-rb-btn.primary { background: var(--hx-primary-fill); color: var(--hx-on-primary); padding: 0 11px; margin-right: 2px; }
.wm-rb-btn.primary i { color: inherit; }
.wm-rb-btn.primary:hover:not(:disabled) { background: var(--hx-primary-fill); color: var(--hx-on-primary); filter: brightness(1.08); }
.wm-rb-btn:disabled { opacity: 0.42; cursor: default; }
.wm-rb-icons .wm-rb-btn span { display: none; }
.wm-rb-sep { width: 1px; height: 18px; background: var(--hx-edge); margin: 0 5px; }
@container (max-width: 1360px) { .wm-rb-btn:not(.primary) span { display: none; } .wm-rb-btn { padding: 0 8px; } }

/* Mail layout */
.wm-mail { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.wm-body { --wm-f: var(--wm-fw, 228px); display: grid; grid-template-columns: var(--wm-f) 5px var(--wm-lw, 372px) 5px minmax(0, 1fr); min-height: 0; min-width: 0; }
.wm-split { background: transparent; cursor: col-resize; touch-action: none; position: relative; }
.wm-split::after { content: ""; position: absolute; inset: 0 2px; background: var(--hx-edge); }
.wm-split:hover::after { inset: 0 1px; background: var(--hx-accent); }
.wm-folders { background: var(--hx-surface); padding: 10px 8px 8px; overflow-y: auto; gap: 4px; }
.wm-list { background: var(--hx-surface); }
.wm-reader { background: var(--hx-bg); }
.wm-r-part { flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; flex-direction: column; }

[data-pane="bottom"] .wm-body { grid-template-columns: var(--wm-f) 5px minmax(0, 1fr); grid-template-rows: var(--wm-lh, 42%) 5px minmax(0, 1fr); }
[data-pane="bottom"] .wm-folders, [data-pane="bottom"] [data-split="f"] { grid-row: 1 / span 3; }
[data-pane="bottom"] [data-split="l"] { cursor: row-resize; }
[data-pane="bottom"] [data-split="l"]::after { inset: 2px 0; }
[data-pane="bottom"] [data-split="l"]:hover::after { inset: 1px 0; }
[data-pane="off"] .wm-body { grid-template-columns: var(--wm-f) 5px minmax(0, 1fr); }
[data-pane="off"] [data-split="l"] { display: none; }
[data-pane="off"][data-view="reader"] .wm-list, [data-pane="off"]:not([data-view="reader"]) .wm-reader { display: none; }
[data-nofolders="1"] .wm-folders, [data-nofolders="1"] [data-split="f"] { display: none; }
[data-nofolders="1"] .wm-body { grid-template-columns: var(--wm-lw, 372px) 5px minmax(0, 1fr); }
[data-nofolders="1"][data-pane="bottom"] .wm-body, [data-nofolders="1"][data-pane="off"] .wm-body { grid-template-columns: minmax(0, 1fr); }
.wm-back { display: none; }
[data-pane="off"] .wm-reader .wm-back { display: inline-grid; }

/* Folders */
.wm-new { width: 100%; flex: none; margin-bottom: 4px; }
.wm-f-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; flex: none; min-height: 28px; }
.wm-f-head .tool-ib { width: 26px; height: 26px; font-size: 0.76rem; }
.wm-f-section { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--hx-ink-3); font-size: 0.76rem; font-weight: 600; padding: 3px 4px; cursor: pointer; min-width: 0; }
.wm-f-section i { font-size: 0.62rem; width: 12px; }
.wm-f-section:hover { color: var(--hx-ink); }
.wm-f-list { display: grid; gap: 1px; margin: 0 0 6px; padding: 0; list-style: none; flex: none; }
.wm-f-row { position: relative; min-width: 0; }
.wm-f { position: relative; display: flex; align-items: center; gap: 2px; border-radius: 8px; color: var(--hx-ink-2); font-size: 0.86rem; min-width: 0; padding-right: 4px; }
.wm-f:hover { background: color-mix(in srgb, var(--hx-accent) 8%, transparent); color: var(--hx-ink); }
.wm-f.on { background: color-mix(in srgb, var(--hx-accent) 15%, transparent); color: var(--hx-ink); font-weight: 600; }
.wm-f.drop { outline: 2px solid var(--hx-accent); outline-offset: -2px; background: color-mix(in srgb, var(--hx-accent) 18%, transparent); }
.wm-f-tw { flex: none; width: 18px; height: 26px; display: grid; place-items: center; border: 0; background: transparent; color: var(--hx-ink-3); font-size: 0.58rem; padding: 0; cursor: pointer; }
span.wm-f-tw { cursor: default; }
.wm-f-main { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; height: 30px; padding: 0 4px 0 2px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wm-f-main > i { flex: none; width: 16px; text-align: center; color: var(--hx-ink-3); font-size: 0.82rem; }
.wm-f.on .wm-f-main > i { color: var(--hx-accent); }
.wm-f-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-f-count { flex: none; font-size: 0.74rem; font-weight: 700; color: var(--hx-accent); font-variant-numeric: tabular-nums; }
.wm-f-count.quiet { color: var(--hx-ink-3); font-weight: 500; }
.wm-f-more { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; display: none; background: var(--hx-surface); }
.wm-f-row:hover .wm-f-more, .wm-f-row:focus-within .wm-f-more { display: inline-grid; }
@media (hover: none) { .wm-f-more { display: inline-grid; } .wm-f-count { margin-right: 26px; } }

/* List */
.wm-l-head { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--hx-edge); min-height: 45px; min-width: 0; flex: none; }
.wm-check-all { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: var(--hx-ink-3); border-radius: 7px; cursor: pointer; }
.wm-check-all[aria-checked="true"], .wm-check-all:hover { color: var(--hx-accent); }
.wm-l-title { flex: 1 1 auto; min-width: 0; }
.wm-l-title b { display: block; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-l-title small { display: block; color: var(--hx-ink-3); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-focus { flex: 1 1 auto; display: flex; align-items: center; gap: 2px; min-width: 0; }
.wm-focus button[role="tab"] { border: 0; background: transparent; padding: 6px 8px; color: var(--hx-ink-2); font-size: 0.84rem; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.wm-focus button[role="tab"].on { color: var(--hx-ink); font-weight: 600; border-bottom-color: var(--hx-accent); }
.wm-focus em { font-style: normal; font-size: 0.7rem; font-weight: 700; color: var(--hx-accent); }
.wm-focus .tool-ib { width: 24px; height: 24px; font-size: 0.74rem; color: var(--hx-ink-3); }
.wm-sort { flex: none; height: 30px; padding: 0 7px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 7px; background: transparent; color: var(--hx-ink-2); font-size: 0.76rem; font-weight: 500; cursor: pointer; white-space: nowrap; }
.wm-sort:hover { background: color-mix(in srgb, var(--hx-accent) 10%, transparent); color: var(--hx-ink); }
.wm-sort.is-on { color: var(--hx-accent); background: color-mix(in srgb, var(--hx-accent) 14%, transparent); }
.wm-list { container-type: inline-size; }
@container (max-width: 400px) { .wm-sort-word { display: none; } }
.wm-bulk { display: flex; align-items: center; flex-wrap: wrap; gap: 0; flex: 1 1 auto; min-width: 0; }
.wm-bulk b { font-size: 0.8rem; margin: 0 auto 0 2px; white-space: nowrap; }
.wm-bulk .tool-ib { width: 28px; height: 28px; font-size: 0.8rem; }
.wm-l-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; overscroll-behavior: contain; display: flex; flex-direction: column; }
.wm-l-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 3px 8px; border-top: 1px solid var(--hx-edge); font-size: 0.76rem; color: var(--hx-ink-3); min-height: 36px; font-variant-numeric: tabular-nums; }
.wm-l-foot span { margin-right: auto; padding-left: 4px; }
.wm-group { flex: none; position: sticky; top: 0; z-index: 1; padding: 5px 12px; background: var(--hx-surface); color: var(--hx-ink-3); font-size: 0.74rem; font-weight: 600; border-bottom: 1px solid var(--hx-edge); }

.wm-m { flex: none; position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: start; gap: 4px; padding: 7px 10px 7px 5px; border-bottom: 1px solid var(--hx-edge); border-left: 3px solid transparent; cursor: pointer; min-width: 0; }
.wm-m:hover { background: color-mix(in srgb, var(--hx-accent) 6%, transparent); }
.wm-m:focus-visible { outline: 2px solid var(--hx-accent); outline-offset: -2px; }
.wm-m.sel { background: color-mix(in srgb, var(--hx-accent) 10%, transparent); }
.wm-m.open { background: color-mix(in srgb, var(--hx-accent) 15%, transparent); }
.wm-m.unread { border-left-color: var(--hx-accent); }
.wm-m.member { padding-left: 26px; grid-template-columns: 26px minmax(0, 1fr); background: color-mix(in srgb, var(--hx-ink) 3%, transparent); }
.wm-pick-av { position: relative; width: 34px; height: 34px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.wm-m.member .wm-pick-av { width: 24px; height: 24px; }
.wm-check { position: absolute; inset: 0; display: none; place-items: center; border-radius: 50%; background: var(--hx-surface); color: var(--hx-accent); font-size: 1rem; }
.wm-m:hover .wm-check, .wm-m.sel .wm-check, .wm-pick-av:focus-visible .wm-check { display: grid; }
@media (hover: none) { .wm-m.member .wm-check { display: grid; } }
.wm-m-main { min-width: 0; }
.wm-m-line { display: flex; align-items: baseline; gap: 6px; min-width: 0; min-height: 18px; }
.wm-m-tw { flex: none; width: 16px; height: 16px; padding: 0; border: 0; background: transparent; color: var(--hx-ink-3); font-size: 0.6rem; cursor: pointer; align-self: center; }
.wm-m-from { flex: 1 1 auto; min-width: 0; font-size: 0.86rem; color: var(--hx-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-m-count { flex: none; font-size: 0.7rem; font-weight: 600; color: var(--hx-ink-3); }
.wm-m-date { flex: none; font-size: 0.72rem; color: var(--hx-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wm-m-sub { flex: 1 1 auto; min-width: 0; font-size: 0.8rem; color: var(--hx-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-m-pre { flex: 1 1 auto; min-width: 0; font-size: 0.76rem; color: var(--hx-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-m.unread .wm-m-from, .wm-m.unread .wm-m-sub { font-weight: 600; color: var(--hx-ink); }
.wm-m.unread .wm-m-date { color: var(--hx-accent); font-weight: 600; }
.wm-m-ic { flex: none; display: inline-flex; gap: 6px; color: var(--hx-ink-3); font-size: 0.72rem; align-items: center; }
.wm-flagged { color: var(--hx-warn); }
.wm-imp { color: var(--hx-bad); margin-right: 4px; }
.wm-imp-low { color: var(--hx-ink-3); margin-right: 4px; }
.wm-cat { flex: none; display: inline-block; max-width: 130px; padding: 0 7px; border-radius: 5px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--hx-ink); font-size: 0.68rem; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-m-acts { position: absolute; top: 4px; right: 6px; display: none; gap: 1px; padding: 1px; border-radius: 7px; background: var(--hx-surface); box-shadow: 0 0 0 1px var(--hx-edge); }
.wm-m-acts button { width: 26px; height: 24px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--hx-ink-2); font-size: 0.74rem; cursor: pointer; }
.wm-m-acts button:hover { background: color-mix(in srgb, var(--hx-accent) 12%, transparent); color: var(--hx-ink); }
@media (hover: hover) { .wm-m:hover .wm-m-acts, .wm-m:focus-within .wm-m-acts { display: flex; } }

[data-density="compact"] .wm-m { padding-top: 3px; padding-bottom: 3px; grid-template-columns: 28px minmax(0, 1fr); }
[data-density="compact"] .wm-avatar:not(.big):not(.wm-me) { width: 24px; height: 24px; font-size: 0.62rem; }
[data-density="compact"] .wm-pick-av { width: 24px; height: 24px; }
[data-density="compact"] .wm-m-third { display: none; }
[data-density="compact"] .wm-m-third:has(.wm-cat) { display: flex; }
[data-density="roomy"] .wm-m { padding-top: 12px; padding-bottom: 12px; }
[data-density="roomy"] .wm-m-main { display: grid; gap: 3px; }
[data-density="roomy"] .wm-f-main { height: 36px; }

/* Reader */
.wm-r-tools { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 5px 10px; background: var(--hx-surface); border-bottom: 1px solid var(--hx-edge); min-width: 0; container-type: inline-size; }
.wm-r-tools .btn { display: inline-flex; align-items: center; padding: 4px 8px; font-size: 0.78rem; border-radius: 7px; gap: 6px; border-color: transparent; background: transparent; color: var(--hx-ink-2); font-weight: 500; }
.wm-r-tools .btn:hover { background: color-mix(in srgb, var(--hx-accent) 10%, transparent); color: var(--hx-ink); box-shadow: none; }
.wm-r-tools .btn i { color: var(--hx-accent); }
.wm-r-tools .btn.is-on i { color: var(--hx-warn); }
.wm-r-sep { width: 1px; height: 18px; background: var(--hx-edge); margin: 0 3px; }
@container (max-width: 900px) { .wm-r-tools .btn.wm-sec span { display: none; } }
@container (max-width: 560px) { .wm-r-tools .btn span { display: none; } .wm-r-sep { display: none; } .wm-r-tools .btn { padding: 6px; } .wm-r-tools .tool-ib { width: 28px; } }
.wm-r-scroll { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.wm-r-head { flex: none; padding: 12px 16px 10px; background: var(--hx-surface); border-bottom: 1px solid var(--hx-edge); container-type: inline-size; max-height: 45%; overflow-y: auto; }
.wm-r-head h2 { margin: 0 0 8px; font-size: 1.06rem; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; text-wrap: pretty; }
.wm-r-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.wm-r-who { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.wm-r-meta { flex: 1 1 auto; min-width: 0; font-size: 0.8rem; color: var(--hx-ink-2); }
.wm-r-from { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
.wm-r-from b { color: var(--hx-ink); font-size: 0.88rem; font-weight: 600; overflow-wrap: anywhere; }
.wm-r-from span { color: var(--hx-ink-3); overflow-wrap: anywhere; }
.wm-r-to { overflow-wrap: anywhere; }
.wm-r-to em { font-style: normal; color: var(--hx-ink-3); }
.wm-r-date { flex: none; color: var(--hx-ink-3); font-size: 0.76rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wm-r-date-s { display: none; color: var(--hx-ink-3); font-size: 0.74rem; }
@container (max-width: 560px) { .wm-r-date { display: none; } .wm-r-date-s { display: block; } }
.wm-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wm-att { display: inline-flex; align-items: center; max-width: 100%; border-radius: 8px; border: 1px solid var(--hx-edge); background: var(--hx-glass); min-width: 0; }
.wm-att:hover { border-color: var(--hx-edge-strong); }
.wm-att-main { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 4px 8px 4px 10px; border: 0; background: transparent; color: var(--hx-ink); font-size: 0.78rem; text-decoration: none; cursor: pointer; }
.wm-att-main:hover { color: var(--hx-ink); }
.wm-att-main i { color: var(--hx-accent); flex: none; }
.wm-att-main b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wm-att-main small { color: var(--hx-ink-3); flex: none; }
.wm-att-dl { width: 28px; height: 28px; font-size: 0.74rem; }
.wm-notice { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 16px; font-size: 0.78rem; color: var(--hx-ink-2); background: color-mix(in srgb, var(--hx-accent) 8%, var(--hx-surface)); border-bottom: 1px solid var(--hx-edge); }
.wm-notice i { color: var(--hx-accent); }
.wm-notice span { flex: 1 1 200px; min-width: 0; }
.wm-notice .btn { padding: 3px 10px; font-size: 0.76rem; border-radius: 7px; }
.wm-frame-box { flex: 1 1 auto; min-height: 0; display: flex; padding: 8px; }
.wm-frame { flex: 1 1 auto; width: 100%; min-width: 0; height: 100%; border: 1px solid var(--hx-edge); border-radius: 10px; background: var(--hx-surface); display: block; }
:root[data-theme="light"] .wm-frame { background: #ffffff; }
.wm-print-frame { position: absolute; left: -9999px; width: 1px; height: 1px; border: 0; }

.wm-empty { flex: 1 1 auto; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 32px 20px; color: var(--hx-ink-3); }
.wm-empty i { font-size: 2rem; color: var(--hx-ink-3); }
.wm-empty h3 { font-size: 0.98rem; margin: 6px 0 0; color: var(--hx-ink); }
.wm-empty p { margin: 0; font-size: 0.84rem; }
.wm-load { flex: 1 1 auto; display: grid; place-items: center; padding: 40px; color: var(--hx-ink-3); }
.wm-scrim { display: none; }

/* Compose: in the reading pane, its open drafts as tabs along the bottom */
#wm-r-compose { background: var(--hx-surface); }
.wm-c { flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; flex-direction: column; position: relative; }
.wm-c.drop { outline: 2px dashed var(--hx-accent); outline-offset: -5px; }
.wm-c-actions { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 7px 12px; border-bottom: 1px solid var(--hx-edge); min-width: 0; }
.wm-c-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.wm-c-flags { display: inline-flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.wm-c-flag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; color: var(--hx-ink-2); padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--hx-accent) 12%, transparent); }
.wm-c-flag i { color: var(--hx-accent); }
.wm-status { margin-left: auto; font-size: 0.74rem; color: var(--hx-ink-3); }
.wm-rows { padding: 0 14px; border-bottom: 1px solid var(--hx-edge); flex: none; max-height: 40%; overflow-y: auto; }
.wm-row { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--hx-edge); min-width: 0; }
.wm-row:last-child { border-bottom: 0; }
.wm-row > label { flex: none; width: 58px; padding-top: 4px; font-size: 0.8rem; color: var(--hx-ink-3); margin: 0; }
.wm-row > input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--hx-ink); font-size: 0.88rem; padding: 3px 0; }
.wm-chips { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; cursor: text; }
.wm-chips input { flex: 1 1 120px; min-width: 80px; border: 0; outline: 0; background: transparent; color: var(--hx-ink); font-size: 0.88rem; padding: 2px 0; }
.wm-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 1px 4px 1px 9px; border-radius: 99px; background: color-mix(in srgb, var(--hx-accent) 13%, transparent); color: var(--hx-ink); font-size: 0.78rem; min-width: 0; }
.wm-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wm-chip.bad { background: color-mix(in srgb, var(--hx-bad) 16%, transparent); color: var(--hx-bad); }
.wm-chip-from { padding-right: 9px; margin-top: 2px; }
.wm-chip button { flex: none; width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; color: inherit; display: grid; place-items: center; font-size: 0.68rem; cursor: pointer; padding: 0; }
.wm-chip button:hover { background: color-mix(in srgb, var(--hx-accent) 22%, transparent); }
.wm-cc-toggle { flex: none; border: 0; background: none; color: var(--hx-accent); font-size: 0.78rem; font-weight: 500; padding: 4px; cursor: pointer; }
.wm-suggest { position: fixed; z-index: 2300; width: min(420px, calc(100vw - 32px)); max-height: 240px; overflow-y: auto; padding: 4px; border-radius: 10px; background: var(--hx-surface); border: 1px solid var(--hx-edge); box-shadow: var(--hx-shadow); }
.wm-suggest button { display: grid; width: 100%; padding: 6px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--hx-ink); text-align: left; font-size: 0.82rem; min-width: 0; }
.wm-suggest button small { color: var(--hx-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-suggest button b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-suggest button.on, .wm-suggest button:hover { background: color-mix(in srgb, var(--hx-accent) 12%, transparent); }
.wm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; padding: 3px 10px; border-bottom: 1px solid var(--hx-edge); flex: none; }
.wm-bar .tool-ib { width: 28px; height: 28px; font-size: 0.8rem; }
.wm-bar-sep { width: 1px; height: 18px; background: var(--hx-edge); margin: 0 4px; }

/* The editor holds what will be sent, so it stays dark ink on paper in its data and is turned over as a picture in the dark theme. */
.wm-editor-wrap { flex: 1 1 auto; min-height: 120px; overflow-y: auto; background: #ffffff; display: flex; flex-direction: column; }
:root[data-theme="dark"] .wm-editor-wrap { background: var(--hx-surface); }
.wm-editor { flex: 1 1 auto; min-height: 100%; box-sizing: border-box; padding: 12px 14px; background: transparent; color: #1b2a41; font-family: var(--wm-font, var(--hx-font)); font-size: var(--wm-size, 11pt); line-height: 1.5; outline: 0; overflow-wrap: anywhere; }
:root[data-theme="dark"] .wm-editor { filter: invert(1) hue-rotate(180deg); }
:root[data-theme="dark"] .wm-editor img { filter: invert(1) hue-rotate(180deg); }
.wm-editor a { color: #0071bc; text-decoration: underline; }
.wm-editor ::selection, .wm-editor::selection { background: #b6daf5; color: #0b1424; }
.wm-editor img { max-width: 100%; height: auto; }
.wm-editor blockquote { margin: 8px 0 8px 2px; padding-left: 12px; border-left: 2px solid #c6d0dc; color: #33415c; }
.wm-editor table { max-width: 100%; }
.wm-sign-ed { flex: none; height: 150px; border: 1px solid var(--hx-edge); border-radius: 0 0 10px 10px; }
.wm-sign-bar { border: 1px solid var(--hx-edge); border-bottom: 0; border-radius: 10px 10px 0 0; padding: 3px 6px; }
.wm-sig-del { margin-left: auto; }
.wm-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px 14px; border-top: 1px solid var(--hx-edge); max-height: 104px; overflow-y: auto; flex: none; }
.wm-files:empty { display: none; }
.wm-file { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 3px 4px 3px 10px; border-radius: 8px; border: 1px solid var(--hx-edge); font-size: 0.78rem; min-width: 0; }
.wm-file i.wm-file-ic { color: var(--hx-accent); flex: none; }
.wm-file b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wm-file small { color: var(--hx-ink-3); flex: none; }
.wm-file .tool-ib { width: 24px; height: 24px; font-size: 0.74rem; }
.wm-file-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--hx-accent); transition: width 0.15s; }
.wm-hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.wm-draft-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 8px; background: var(--hx-surface); border-top: 1px solid var(--hx-edge); min-width: 0; }
.wm-dtab { display: inline-flex; align-items: center; max-width: 220px; min-width: 0; border-radius: 7px; background: var(--hx-glass); border: 1px solid var(--hx-edge); }
.wm-dtab.on { background: color-mix(in srgb, var(--hx-accent) 16%, transparent); border-color: var(--hx-edge-strong); }
.wm-dtab-main { display: inline-flex; align-items: center; gap: 7px; min-width: 0; height: 26px; padding: 0 4px 0 9px; border: 0; background: transparent; color: var(--hx-ink); font-size: 0.76rem; cursor: pointer; }
.wm-dtab-main i { color: var(--hx-accent); font-size: 0.7rem; flex: none; }
.wm-dtab-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wm-dtab-x { flex: none; width: 22px; height: 22px; margin-right: 2px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--hx-ink-3); font-size: 0.68rem; cursor: pointer; }
.wm-dtab-x:hover { color: var(--hx-ink); background: color-mix(in srgb, var(--hx-accent) 12%, transparent); }

/* Pop-out: only the draft */
[data-popout="1"] #wm-app { grid-template-columns: minmax(0, 1fr); }
[data-popout="1"] .wm-rail, [data-popout="1"] .wm-top, [data-popout="1"] .wm-folders, [data-popout="1"] .wm-list, [data-popout="1"] .wm-split, [data-popout="1"] .wm-draft-tabs { display: none; }
[data-popout="1"] .wm-body { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }

/* Popovers and small controls */
.wm-pop { position: fixed; z-index: 2300; padding: 10px; border-radius: 12px; background: var(--hx-surface); color: var(--hx-ink); border: 1px solid var(--hx-edge); box-shadow: var(--hx-shadow); overflow-y: auto; max-width: calc(100vw - 16px); }
.wm-pop-top { z-index: 2400; }
.wm-pop-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.wm-search-pop { width: min(430px, calc(100vw - 16px)); }
.wm-search-form .tool-field { margin-bottom: 10px; }
.wm-date-pop { width: 280px; }
.wm-dp-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.wm-dp-top b { font-size: 0.86rem; font-weight: 600; }
.wm-dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.wm-dp-head { text-align: center; font-size: 0.7rem; color: var(--hx-ink-3); padding: 3px 0; font-weight: 600; }
.wm-dp-day { height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--hx-ink); font-size: 0.8rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.wm-dp-day:hover { background: color-mix(in srgb, var(--hx-accent) 12%, transparent); }
.wm-dp-day.other { color: var(--hx-ink-3); opacity: 0.6; }
.wm-dp-day.today { box-shadow: inset 0 0 0 1px var(--hx-accent); }
.wm-dp-day.on { background: var(--hx-primary-fill); color: var(--hx-on-primary); }
.wm-dp-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.wm-swatches { display: grid; grid-template-columns: repeat(7, 26px); gap: 4px; }
.wm-swatches button { width: 26px; height: 26px; padding: 0; border: 1px solid var(--hx-edge-strong); border-radius: 6px; cursor: pointer; }
.wm-swatches button:hover { outline: 2px solid var(--hx-accent); outline-offset: 1px; }
.wm-swatch-none { width: 100%; margin-top: 8px; }
.wm-emoji { display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; max-width: 100%; }
.wm-emoji button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; font-size: 1.1rem; cursor: pointer; }
.wm-emoji button:hover { background: color-mix(in srgb, var(--hx-accent) 12%, transparent); }
.wm-table-grid { display: grid; grid-template-columns: repeat(8, 22px); gap: 2px; }
.wm-table-grid button { width: 22px; height: 22px; padding: 0; border: 1px solid var(--hx-edge-strong); border-radius: 3px; background: transparent; cursor: pointer; }
.wm-table-grid button.on { background: color-mix(in srgb, var(--hx-accent) 45%, transparent); border-color: var(--hx-accent); }
.wm-table-size { margin-top: 6px; font-size: 0.78rem; color: var(--hx-ink-2); text-align: center; }
.wm-pick { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; min-width: 0; color: var(--hx-ink); }
.wm-pick i { color: var(--hx-accent); flex: none; }
.wm-pick span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wm-two > .tool-field { margin-bottom: 14px; align-content: start; }
.wm-dt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; min-width: 0; }
.wm-dt [data-pick^="time"] { width: 96px; }
.wm-dt:has([data-pick^="time"][hidden]) { grid-template-columns: minmax(0, 1fr); }
.wm-switch { display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 0; color: var(--hx-ink); cursor: pointer; text-align: left; font-size: 0.86rem; font-weight: 400; min-width: 0; }
.wm-switch-knob { flex: none; position: relative; width: 36px; height: 20px; border-radius: 99px; background: var(--hx-glass-3); box-shadow: inset 0 0 0 1px var(--hx-edge-strong); transition: background 0.15s; }
.wm-switch-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--hx-ink-2); transition: transform 0.15s, background 0.15s; }
.wm-switch[aria-checked="true"] .wm-switch-knob { background: var(--hx-primary-fill); box-shadow: none; }
.wm-switch[aria-checked="true"] .wm-switch-knob::after { transform: translateX(16px); background: #ffffff; }
.wm-seg-row > * { display: inline-flex; align-items: center; }
.wm-foot-left { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; }
.hx-m-foot .btn i { margin-right: 6px; }
.wm-foot-left i { margin-right: 0 !important; }
.wm-hint { margin: 0 0 12px; font-size: 0.82rem; color: var(--hx-ink-3); font-weight: 400; }
.wm-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 0.88rem; color: var(--hx-ink-2); }
.wm-source { margin: 0; font-family: var(--hx-font-mono); font-size: 0.74rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--hx-console-ink); background: var(--hx-console-bg); border: 1px solid var(--hx-edge); border-radius: 10px; padding: 12px; }
.tool-modal.wm-source-card { width: min(860px, 100%); }
.tool-modal.wm-preview { width: min(980px, 100%); }
.wm-preview-img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.wm-preview-frame { display: block; width: 100%; height: calc(100dvh - 190px); border: 1px solid var(--hx-edge); border-radius: 10px; background: #ffffff; }
.wm-preview-pdf .tool-m-body { padding-bottom: 10px; }

/* Settings */
.tool-modal.wm-settings { width: min(780px, 100%); height: min(640px, calc(100dvh - 32px)); }
.wm-settings .tool-m-body { padding: 0; overflow: hidden; display: flex; }
.wm-set { flex: 1 1 auto; display: grid; grid-template-columns: 170px minmax(0, 1fr); min-height: 0; min-width: 0; }
.wm-set-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-right: 1px solid var(--hx-edge); overflow-y: auto; }
.wm-set-nav button { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--hx-ink-2); font-size: 0.84rem; cursor: pointer; text-align: left; min-width: 0; }
.wm-set-nav button i { width: 16px; text-align: center; color: var(--hx-ink-3); }
.wm-set-nav button:hover { background: color-mix(in srgb, var(--hx-accent) 9%, transparent); color: var(--hx-ink); }
.wm-set-nav button.on { background: color-mix(in srgb, var(--hx-accent) 15%, transparent); color: var(--hx-ink); font-weight: 600; }
.wm-set-nav button.on i { color: var(--hx-accent); }
.wm-set-body { padding: 14px 20px 18px; overflow-y: auto; min-width: 0; min-height: 0; }
.wm-set-h { margin: 16px 0 10px; font-size: 0.9rem; font-weight: 600; color: var(--hx-ink); }
.wm-set-h:first-child { margin-top: 0; }
.wm-sig-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.wm-cat-rows { display: grid; gap: 6px; margin-bottom: 10px; }
.wm-cat-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 32px; gap: 6px; align-items: center; }
.wm-cat-dot { width: 24px; height: 24px; padding: 0; border: 1px solid var(--hx-edge-strong); border-radius: 6px; cursor: pointer; }
.wm-rule-rows { display: grid; gap: 4px; }
.wm-rule { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; gap: 8px; align-items: center; font-size: 0.84rem; padding: 2px 0 2px 8px; border-radius: 8px; background: var(--hx-glass); }
.wm-rule span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wm-rule em { font-style: normal; font-size: 0.76rem; color: var(--hx-ink-3); }
.wm-keys { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 0.86rem; align-items: center; }
.wm-keys dt { font-weight: 400; display: flex; flex-wrap: wrap; gap: 3px; }
.wm-keys dd { margin: 0; color: var(--hx-ink-2); }
.wm-keys kbd { display: inline-block; padding: 1px 6px; border-radius: 5px; background: var(--hx-glass-2); color: var(--hx-ink); font-family: var(--hx-font-mono); font-size: 0.72rem; box-shadow: inset 0 0 0 1px var(--hx-edge-strong); }

/* Calendar */
.wm-cal { min-width: 0; min-height: 0; background: var(--hx-surface); }
.wm-cal-bar { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 7px 12px; border-bottom: 1px solid var(--hx-edge); min-width: 0; }
.wm-cal-bar .btn { display: inline-flex; align-items: center; gap: 6px; }
.wm-cal-title { font-size: 0.96rem; font-weight: 600; margin-right: auto; min-width: 0; }
.wm-cal-bar .hx-seg { padding: 2px; }
.wm-cal-bar .hx-seg > * { padding: 3px 11px; font-size: 0.8rem; }
.wm-cal-month { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.wm-cal-head { flex: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--hx-edge); }
.wm-cal-dow { padding: 5px 6px; font-size: 0.74rem; font-weight: 600; color: var(--hx-ink-3); text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wm-cal-dow.today { color: var(--hx-accent); }
.wm-cal-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); }
.wm-cal-cell { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1px; padding: 2px 3px; border-right: 1px solid var(--hx-edge); border-bottom: 1px solid var(--hx-edge); cursor: pointer; }
.wm-cal-cell:nth-child(7n) { border-right: 0; }
.wm-cal-cell:hover { background: color-mix(in srgb, var(--hx-accent) 5%, transparent); }
.wm-cal-cell.other { background: color-mix(in srgb, var(--hx-ink) 3%, transparent); }
.wm-cal-cell.other .wm-cal-num { color: var(--hx-ink-3); }
.wm-cal-num { flex: none; align-self: flex-start; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 99px; font-size: 0.76rem; line-height: 22px; text-align: center; color: var(--hx-ink-2); font-variant-numeric: tabular-nums; }
.wm-cal-num:hover { background: color-mix(in srgb, var(--hx-accent) 14%, transparent); }
.wm-cal-cell.today .wm-cal-num { background: var(--hx-primary-fill); color: var(--hx-on-primary); font-weight: 600; }
.wm-cal-more { flex: none; font-size: 0.68rem; color: var(--hx-ink-3); padding-left: 4px; }
.wm-ev { display: flex; align-items: baseline; gap: 5px; width: 100%; min-width: 0; padding: 1px 5px; border: 0; border-left: 3px solid var(--hx-accent); border-radius: 4px; background: color-mix(in srgb, var(--hx-accent) 17%, transparent); color: var(--hx-ink); font-size: 0.7rem; line-height: 1.4; text-align: left; cursor: pointer; overflow: hidden; flex: none; }
.wm-ev:hover { background: color-mix(in srgb, var(--hx-accent) 28%, transparent); }
.wm-ev small { flex: none; color: var(--hx-ink-2); font-size: 0.66rem; }
.wm-ev span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-ev.all { background: var(--hx-primary-fill); color: var(--hx-on-primary); border-left-color: transparent; }
.wm-cal-time { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; min-width: 0; }
.wm-cal-tr { display: grid; grid-template-columns: 52px repeat(var(--days), minmax(0, 1fr)); min-width: 0; flex: none; border-bottom: 1px solid var(--hx-edge); }
.wm-cal-corner { min-width: 0; }
.wm-cal-allday-label { font-size: 0.66rem; color: var(--hx-ink-3); padding: 3px 4px; line-height: 1.2; }
.wm-cal-alld { display: flex; flex-direction: column; gap: 1px; padding: 2px; min-width: 0; min-height: 24px; border-left: 1px solid var(--hx-edge); }
.wm-cal-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.wm-cal-scroll .wm-cal-tr { border-bottom: 0; }
.wm-cal-hour { font-size: 0.68rem; color: var(--hx-ink-3); text-align: right; padding: 0 6px 0 0; font-variant-numeric: tabular-nums; }
.wm-cal-hours { min-width: 0; }
.wm-cal-col { position: relative; min-width: 0; border-left: 1px solid var(--hx-edge); cursor: pointer; background-image: linear-gradient(to bottom, var(--hx-edge) 1px, transparent 1px); background-size: 100% 44px; }
.wm-ev-b { position: absolute; display: block; width: auto; padding: 2px 5px; border-radius: 5px; box-shadow: 0 0 0 1px var(--hx-surface); }
.wm-ev-b small { display: block; }
.wm-ev-b span { display: block; }

/* People */
.wm-people { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); min-height: 0; min-width: 0; }
.wm-p-list { background: var(--hx-surface); border-right: 1px solid var(--hx-edge); }
.wm-p-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--hx-edge); min-width: 0; }
.wm-p-head .btn { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.wm-p-q { flex: 1 1 auto; height: 32px; margin: 0; min-width: 0; }
.wm-p-rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.wm-p-item { flex: none; display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 12px; border: 0; border-bottom: 1px solid var(--hx-edge); background: transparent; color: var(--hx-ink); text-align: left; cursor: pointer; min-width: 0; }
.wm-p-item:hover { background: color-mix(in srgb, var(--hx-accent) 6%, transparent); }
.wm-p-item.on { background: color-mix(in srgb, var(--hx-accent) 15%, transparent); }
.wm-p-item > span:last-child { display: grid; min-width: 0; }
.wm-p-item b { font-size: 0.86rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-p-item small { font-size: 0.74rem; color: var(--hx-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-p-card { padding: 0 0 18px; overflow-y: auto; background: var(--hx-bg); }
.wm-p-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--hx-edge); background: var(--hx-surface); }
.wm-p-tools .btn { display: inline-flex; align-items: center; gap: 6px; }
.wm-p-name { display: flex; align-items: center; gap: 14px; padding: 18px 20px 12px; min-width: 0; }
.wm-p-name h2 { margin: 0; font-size: 1.2rem; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.wm-p-row { display: flex; gap: 12px; padding: 7px 20px; font-size: 0.88rem; min-width: 0; }
.wm-p-row > i { flex: none; width: 18px; text-align: center; color: var(--hx-accent); padding-top: 3px; }
.wm-p-row > div { min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.wm-p-row small { display: block; color: var(--hx-ink-3); font-size: 0.72rem; }

/* To Do */
.wm-todo { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 0; min-width: 0; }
.wm-t-side { background: var(--hx-surface); border-right: 1px solid var(--hx-edge); padding: 8px; gap: 8px; }
.wm-t-lists { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.wm-t-listrow { position: relative; min-width: 0; flex: none; }
.wm-t-list { display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--hx-ink-2); font-size: 0.86rem; cursor: pointer; text-align: left; min-width: 0; flex: none; }
.wm-t-list i { width: 16px; text-align: center; color: var(--hx-accent); flex: none; }
.wm-t-list span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-t-list em { flex: none; font-style: normal; font-size: 0.72rem; color: var(--hx-ink-3); }
.wm-t-list:hover { background: color-mix(in srgb, var(--hx-accent) 8%, transparent); color: var(--hx-ink); }
.wm-t-list.on { background: color-mix(in srgb, var(--hx-accent) 15%, transparent); color: var(--hx-ink); font-weight: 600; }
.wm-t-more { position: absolute; right: 2px; top: 4px; width: 26px; height: 26px; display: none; background: var(--hx-surface); }
.wm-t-listrow:hover .wm-t-more, .wm-t-listrow:focus-within .wm-t-more { display: inline-grid; }
@media (hover: none) { .wm-t-more { display: inline-grid; } }
.wm-t-newlist { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; }
.wm-t-main { padding: 14px 20px; gap: 10px; overflow: hidden; background: var(--hx-bg); }
.wm-t-head { flex: none; }
.wm-t-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.wm-t-add { flex: none; display: flex; gap: 8px; min-width: 0; }
.wm-t-add .form-control { flex: 1 1 auto; min-width: 0; }
.wm-t-add .btn { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.wm-t-items { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.wm-t-item { flex: none; display: flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 8px; background: var(--hx-surface); border: 1px solid var(--hx-edge); min-width: 0; }
.wm-t-check { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; color: var(--hx-accent); cursor: pointer; padding: 0; }
.wm-t-text { flex: 1 1 auto; display: grid; min-width: 0; padding: 5px 4px; border: 0; background: transparent; color: var(--hx-ink); text-align: left; cursor: pointer; }
.wm-t-text b { font-size: 0.86rem; font-weight: 500; overflow-wrap: anywhere; }
.wm-t-text small { font-size: 0.72rem; color: var(--hx-ink-3); overflow-wrap: anywhere; }
.wm-t-text small.late { color: var(--hx-bad); }
.wm-t-item.done b { text-decoration: line-through; color: var(--hx-ink-3); }
.wm-t-star.on { color: var(--hx-warn); }
.wm-t-done-head { flex: none; display: flex; align-items: center; gap: 7px; margin-top: 8px; padding: 4px; border: 0; background: transparent; color: var(--hx-ink-2); font-size: 0.8rem; font-weight: 600; cursor: pointer; text-align: left; }
.wm-t-done-head i { font-size: 0.62rem; }

/* Tablet: folders become a drawer */
@media (max-width: 1099.98px) {
  .wm-body, [data-nofolders="1"] .wm-body { grid-template-columns: minmax(260px, var(--wm-lw, 320px)) 5px minmax(0, 1fr); }
  [data-pane="bottom"] .wm-body, [data-pane="off"] .wm-body, [data-nofolders="1"][data-pane="bottom"] .wm-body, [data-nofolders="1"][data-pane="off"] .wm-body { grid-template-columns: minmax(0, 1fr); }
  .wm-folders { position: fixed; z-index: 1000; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform 0.18s ease; }
  [data-nofolders="1"] .wm-folders { display: flex; }
  [data-drawer="1"] .wm-folders { transform: none; box-shadow: var(--hx-shadow); }
  [data-split="f"] { display: none; }
  [data-pane="bottom"] .wm-folders { grid-row: auto; }
  [data-drawer="1"] .wm-scrim { display: block; position: fixed; inset: 0; z-index: 999; background: var(--hx-scrim); }
  .wm-menu-btn { display: inline-grid; }
  [data-app]:not([data-app="mail"]) .wm-menu-btn { display: none; }
  .wm-brand b { display: none; }
}

/* Phone: one pane at a time, the apps along the bottom */
@media (max-width: 767.98px) {
  #wm-app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .wm-main { grid-row: 1; }
  .wm-rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 3px 4px calc(3px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--hx-edge); overflow: visible; }
  .wm-rail-gap, .wm-rail-tool { display: none; }
  .wm-rail-btn { flex: 1 1 0; width: auto; }
  .wm-logo { display: none !important; }
  .wm-brand { display: none; }
  .wm-ribbon { display: none; }
  [data-composing="1"][data-app="mail"] .wm-ribbon { display: block; }
  .wm-rb-btn:not(.primary) span { display: none; }
  .wm-rb-sep { display: none; }
  .wm-rb-cmds { min-height: 0; }
  .wm-rb-tabs [data-rtab="home"], .wm-rb-tabs [data-rtab="view"] { display: none; }
  .wm-c .wm-bar, .wm-c-pop { display: none; }
  .wm-body, [data-pane="bottom"] .wm-body, [data-pane="off"] .wm-body { display: block; position: relative; }
  .wm-split { display: none; }
  .wm-pane.wm-list, .wm-pane.wm-reader { position: absolute; inset: 0; border: 0; }
  .wm-reader, [data-pane="off"]:not([data-view="reader"]) .wm-reader { display: none; }
  .wm-list, [data-pane="off"][data-view="reader"] .wm-list { display: flex; }
  [data-view="reader"] .wm-pane.wm-reader, [data-pane="off"][data-view="reader"] .wm-pane.wm-reader { display: flex; z-index: 2; }
  .wm-reader .wm-back { display: inline-grid; }
  .wm-frame-box { padding: 4px; }
  .wm-r-head { padding: 10px 12px 8px; }
  .wm-row > label { width: 46px; }
  .wm-two { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .wm-dtab { max-width: 150px; }
  .wm-set { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .wm-set-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--hx-edge); }
  .wm-set-nav button span { display: none; }
  .wm-set-nav button { flex: 1 1 0; justify-content: center; }
  .wm-set-body { padding: 12px 14px; }
  .wm-cal-title { order: 9; flex-basis: 100%; margin: 0; font-size: 0.88rem; }
  .wm-cal-cell { padding: 1px; }
  .wm-ev { padding: 0 2px; font-size: 0.62rem; border-left-width: 2px; }
  .wm-ev small { display: none; }
  .wm-ev-b small { display: block; }
  .wm-cal-tr { grid-template-columns: 38px repeat(var(--days), minmax(0, 1fr)); }
  .wm-cal-dow { padding: 4px 1px; font-size: 0.66rem; }
  .wm-people { display: block; position: relative; }
  .wm-p-list, .wm-p-card { position: absolute; inset: 0; border: 0; }
  .wm-p-card { display: none; }
  .wm-people[data-card="1"] .wm-p-card { display: flex; z-index: 2; }
  .wm-p-card .wm-back { display: inline-grid; }
  .wm-todo { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .wm-t-side { border-right: 0; border-bottom: 1px solid var(--hx-edge); flex-direction: row; flex-wrap: wrap; align-items: center; }
  .wm-t-lists { flex-direction: row; flex-wrap: wrap; max-height: 112px; gap: 2px; }
  .wm-t-list { width: auto; height: 30px; }
  .wm-t-list i { display: none; }
  .wm-t-listrow { padding-right: 26px; }
  .wm-t-more { top: 2px; }
  .wm-t-main { padding: 10px 12px; }
}
@media (min-width: 768px) {
  .wm-cal-bar > [data-act="cal-new"], .wm-p-head > [data-act="person-new"] { display: none; }
}

/* Rules of the mailbox, in Settings */
.wm-rc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.wm-rule.wm-mrule { grid-template-columns: minmax(0, 1fr) auto 32px 32px 32px; }
.wm-rule .wm-mrule-t { display: grid; gap: 2px; white-space: normal; overflow: visible; }
.wm-mrule-t small { color: var(--hx-ink-3); overflow-wrap: anywhere; }
.wm-rd-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media (max-width: 600px) { .wm-rc { grid-template-columns: minmax(0, 1fr); } .wm-rule.wm-mrule { grid-template-columns: minmax(0, 1fr) 32px 32px 32px; } .wm-rule.wm-mrule .wm-mrule-t { grid-column: 1 / -1; } }
