
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--fg); font-family: var(--font-sans); font-size: 13px; -webkit-font-smoothing: antialiased; }
.hb-num { font-variant-numeric: tabular-nums; }
.hb-row-demo { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-4); }
.hb-col-demo { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); }

.hb-icon { flex-shrink: 0; display: block; }
:where(button, [role="button"], [tabindex], a[href]):focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Buttons */
.hb-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-md); padding: 0 12px; border-radius: var(--radius-md); border: 1px solid transparent; font: 500 13px/16px var(--font-sans); cursor: pointer; white-space: nowrap; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard), border-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard), color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-btn--sm { height: var(--control-sm); padding: 0 8px; font-size: 12px; }
.hb-btn--primary { background: var(--primary); color: var(--fg-on-primary); }
.hb-btn--primary:hover, .hb-btn--primary.is-hover { background: var(--primary-hover); }
.hb-btn:hover, .hb-iconbtn:hover, .hb-rail:hover, .hb-folders__item:hover, .hb-menu__item:hover, .hb-palette__item:hover, .hb-msg--collapsed:hover, .hb-btn.is-hover, .hb-iconbtn.is-hover, .hb-rail.is-hover, .hb-folders__item.is-hover, .hb-menu__item.is-hover, .hb-palette__item.is-hover, .hb-msg--collapsed.is-hover { transition-duration: 0ms; }
.hb-btn--primary:active, .hb-btn--primary.is-active { background: var(--primary-active); }
.hb-btn--secondary { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.hb-btn--secondary:hover, .hb-btn--secondary.is-hover { background: var(--surface-hover); }
.hb-btn--ghost { background: transparent; color: var(--fg-muted); }
.hb-btn--ghost:hover, .hb-btn--ghost.is-hover { background: var(--surface-hover); color: var(--fg); }
.hb-btn--secondary:active, .hb-btn--ghost:active, .hb-btn--danger:active, .hb-btn--secondary.is-active, .hb-btn--ghost.is-active, .hb-btn--danger.is-active { background: var(--surface-pressed); }
.hb-btn--danger { background: transparent; color: var(--danger); border-color: var(--line-strong); }
.hb-btn--danger:hover, .hb-btn--danger.is-hover { background: var(--surface-hover); }
.hb-btn:disabled, .hb-iconbtn:disabled { cursor: default; pointer-events: none; color: var(--fg-disabled); }
.hb-btn--primary:disabled { background: var(--surface-selected); color: var(--fg-disabled); }
.hb-btn--secondary:disabled, .hb-btn--danger:disabled { border-color: var(--line); color: var(--fg-disabled); }
.hb-btn--loading { color: transparent !important; pointer-events: none; }
.hb-btn--loading .hb-spinner-wrap { position: absolute; inset: 0; justify-content: center; color: var(--fg-on-primary); }
.hb-btn--loading .hb-spinner { color: inherit; }
.hb-btn--secondary.hb-btn--loading .hb-spinner-wrap, .hb-btn--ghost.hb-btn--loading .hb-spinner-wrap { color: var(--fg-muted); }
.hb-btn--danger.hb-btn--loading .hb-spinner-wrap { color: var(--danger); }
.hb-btn--icon { padding: 0 8px; }

.hb-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: var(--control-md); height: var(--control-md); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg-muted); cursor: pointer; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard), color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-iconbtn--sm { width: var(--control-sm); height: var(--control-sm); border-radius: var(--radius-sm); }
.hb-iconbtn:hover, .hb-iconbtn.is-hover { background: var(--surface-hover); color: var(--fg); }
.hb-iconbtn:active, .hb-iconbtn.is-active { background: var(--surface-pressed); }
.hb-iconbtn--active { background: var(--surface-selected); color: var(--fg); }

.hb-spinner-wrap { display: inline-flex; align-items: center; }
.hb-spinner { animation: hb-spin var(--duration-spin) var(--ease-linear) infinite; }
.hb-spinner__label { display: none; font: 400 12px/16px var(--font-sans); }
@keyframes hb-spin { to { transform: rotate(360deg); } }

/* Keys and tooltip */
.hb-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--radius-xs); background: var(--surface); color: var(--fg-muted); font: 500 11px/14px var(--font-mono); }
.hb-kbds { display: inline-flex; gap: 3px; }
.hb-tooltip { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 6px 0 10px; border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-popover); font: 500 12px/16px var(--font-sans); color: var(--fg); white-space: nowrap; }
.hb-tooltip .hb-kbd { background: var(--surface-raised-hover); }

/* Inputs */
.hb-search { display: flex; align-items: center; gap: 8px; height: var(--control-md); padding: 0 6px 0 10px; border: 1px solid transparent; border-radius: var(--radius-md); background: var(--surface-hover); color: var(--fg-subtle); transition: border-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-search:hover, .hb-search.is-hover { border-color: var(--control-off); }
.hb-search:focus-within, .hb-search.is-focus { border-color: var(--accent-solid); background: var(--canvas); }
.hb-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--fg); font: 400 13px/16px var(--font-sans); }
.hb-search input::placeholder { color: var(--fg-subtle); }
.hb-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-on-soft); font: 500 12px/16px var(--font-mono); white-space: nowrap; }

.hb-badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border: 1px solid transparent; border-radius: var(--radius-sm); font: 500 12px/16px var(--font-sans); white-space: nowrap; }
.hb-badge--neutral { background: var(--surface-selected); color: var(--fg-muted); }
.hb-badge--accent { background: var(--accent-soft); color: var(--accent-on-soft); }
.hb-badge--outline { border-color: var(--line-strong); color: var(--fg-muted); }
.hb-badge--danger { border-color: var(--line-strong); color: var(--danger); }
.hb-badge--success { border-color: var(--line-strong); color: var(--success); }
.hb-badge--warning { border-color: var(--line-strong); color: var(--warning); }

.hb-switch { display: inline-flex; align-items: center; width: 32px; height: 18px; padding: 2px; border: 0; border-radius: var(--radius-full); background: var(--control-off); cursor: pointer; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-switch__knob { width: 14px; height: 14px; border-radius: var(--radius-full); background: var(--canvas); transition: transform calc(var(--duration-base) * var(--motion-scale)) var(--ease-standard); }
.hb-switch[aria-checked="true"] { background: var(--primary); }
.hb-switch[aria-checked="true"] .hb-switch__knob { transform: translateX(14px); }
.hb-switch-field { display: inline-flex; align-items: center; gap: 10px; font: 400 13px/16px var(--font-sans); color: var(--fg); }

.hb-seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: max-content; align-self: flex-start; padding: 2px; border-radius: var(--radius-md); background: var(--surface-selected); }
.hb-seg__thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; border-radius: calc(var(--radius-md) - 2px); background: var(--control-thumb); box-shadow: var(--shadow-card); transition: transform calc(var(--duration-base) * var(--motion-scale)) var(--ease-standard); }
.hb-seg__opt { position: relative; height: 28px; padding: 0 14px; border: 0; border-radius: calc(var(--radius-md) - 2px); background: transparent; color: var(--fg-muted); font: 500 13px/16px var(--font-sans); cursor: pointer; transition: color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard), background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-seg__opt[aria-checked="true"] { color: var(--fg); }

.hb-check { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: var(--radius-xs); transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard), border-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); border: 1.5px solid var(--control-off); color: var(--fg-on-primary); }
.hb-check--on { background: var(--primary); border-color: var(--primary); }

/* Identity */
.hb-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: var(--radius-full); background: var(--surface-pressed); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg-muted); font-weight: 600; }
.hb-acct { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; border-radius: var(--radius-full); }
.hb-acct--1 { background: var(--acct-1); } .hb-acct--2 { background: var(--acct-2); } .hb-acct--3 { background: var(--acct-3); } .hb-acct--4 { background: var(--acct-4); }
/* Accounts 5 to 8: the same four colors as rings, so color vision needs no new hues; from 9 on the marks repeat. */
.hb-acct--5, .hb-acct--6, .hb-acct--7, .hb-acct--8 { box-sizing: border-box; background: transparent; border: 2px solid; }
.hb-acct--5 { border-color: var(--acct-1); } .hb-acct--6 { border-color: var(--acct-2); } .hb-acct--7 { border-color: var(--acct-3); } .hb-acct--8 { border-color: var(--acct-4); }
.hb-acct-label { display: inline-flex; align-items: center; gap: 6px; font: 400 12px/16px var(--font-sans); color: var(--fg-muted); }
.hb-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hb-avatar-wrap { position: relative; display: inline-flex; }
.hb-avatar-wrap .hb-acct { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--row-bg, var(--surface)); }

/* Thread rows */
.hb-thread, .hb-skel { --row-bg: var(--surface); position: relative; display: grid; grid-template-columns: 14px 20px 112px minmax(0, 1fr) auto; align-items: center; column-gap: 8px; width: calc(100% - 24px); height: var(--row-compact); padding: 0 8px 0 10px; margin: 0 12px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg); font: 400 13px/18px var(--font-sans); text-align: left; cursor: pointer; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
/* Dim the grid children together and keep state backgrounds at full strength. */
[data-theme="dark"] { --read-opacity: .625; }
[data-theme="system-dark"] { --read-opacity: .635; }
[data-theme="light"] { --read-opacity: .69; }
[data-theme="system-light"] { --read-opacity: .745; }
.hb-thread--dim-read:not(:is(:hover, :active, .is-hover, .is-active, .hb-thread--focused, .hb-thread--selected, .hb-thread--checked)) { --read-ink: var(--fg); --read-content-opacity: var(--read-opacity); }
/* Dim the text only (opacity on the text, never on a parent of a mark): the checkbox, the avatar and the account dot keep 3:1 (multi-select council). */
.hb-thread--dim-read :is(.hb-thread__from, .hb-thread__subject, .hb-thread__snippet, .hb-thread__count, .hb-thread__time, .hb-thread__meta > :not(.hb-acct)) { opacity: var(--read-content-opacity, 1); }
/* The keyboard cursor shows as the hover fill, not a ring (owner, 2026-11-12). */
.hb-thread:hover, .hb-thread.is-hover, .hb-thread--focused { --row-bg: var(--surface-hover); background: var(--surface-hover); transition-duration: 0ms; }
.hb-thread:active, .hb-thread.is-active { background: var(--surface-pressed); }
.hb-thread--selected, .hb-thread--selected:hover, .hb-thread--checked, .hb-thread--checked:hover, .hb-thread--selected.is-hover, .hb-thread--checked.is-hover { --row-bg: var(--surface-selected); background: var(--surface-selected); transition-duration: 0ms; }
.hb-thread:active, .hb-thread--selected:active, .hb-thread--checked:active, .hb-thread.is-active, .hb-thread--selected.is-active, .hb-thread--checked.is-active { --row-bg: var(--surface-pressed); background: var(--surface-pressed); }
.hb-thread__lead { display: inline-flex; align-items: center; justify-content: center; width: 14px; }
.hb-thread__dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--accent-solid); }
.hb-thread__meta .hb-acct { width: 6px; height: 6px; }
/* In rows a 6px ring would read as a fainter dot: draw it at 8px in the same 6px slot, so the hole shows. */
.hb-thread__meta .hb-acct--5, .hb-thread__meta .hb-acct--6, .hb-thread__meta .hb-acct--7, .hb-thread__meta .hb-acct--8 { width: 8px; height: 8px; margin: -1px; border-width: 1.5px; }
.hb-thread__from { display: flex; align-items: baseline; gap: 6px; min-width: 0; color: var(--fg); }
.hb-thread__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-thread__count { flex-shrink: 0; font: 400 12px/16px var(--font-sans); font-variant-numeric: tabular-nums; color: var(--fg-subtle); }
.hb-thread__line { display: flex; flex-wrap: wrap; align-items: baseline; height: 18px; overflow: hidden; min-width: 0; }
.hb-thread__line > .hb-thread__subject { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-thread__line > .hb-thread__status { flex-shrink: 0; }
/* After a status (Draft, Sending) the line is the status and the subject only: the snippet gives way, so the subject never wraps out of view. */
.hb-thread__line > .hb-thread__status + .hb-thread__subject { flex: 1 1 0; }
.hb-thread__line > .hb-thread__status ~ .hb-thread__snippet { display: none; }
.hb-thread__subject { color: var(--fg-muted); }
.hb-thread__snippet { flex: 1 1 0; min-width: 6ch; margin-left: 6px; color: var(--fg-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-thread__status { margin-right: 6px; font: 500 12px/16px var(--font-sans); }
.hb-thread__status--draft { color: var(--fg-subtle); }
.hb-thread__status--failed { color: var(--danger); }
.hb-thread__status--sending { display: inline-flex; vertical-align: -2px; color: var(--fg-subtle); }
.hb-thread__meta { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-subtle); font: 400 12px/16px var(--font-sans); font-variant-numeric: tabular-nums; }
.hb-thread__time { min-width: 38px; text-align: right; }
.hb-thread__time--failed { color: var(--danger); font-weight: 500; }
.hb-thread--one-account .hb-thread__meta .hb-acct { visibility: hidden; }
.hb-thread--unread .hb-thread__from, .hb-thread--unread .hb-thread__subject { color: var(--fg); font-weight: 600; }
.hb-thread--unread .hb-thread__time { color: var(--fg); }
.hb-thread--automated .hb-thread__from, .hb-thread--automated .hb-thread__subject { color: var(--fg-subtle); font-weight: 400; }
.hb-thread--dim-read :is(.hb-thread__from, .hb-thread__subject, .hb-thread__snippet, .hb-thread__count, .hb-thread__time) { color: var(--read-ink, var(--fg-subtle)); }
.hb-thread--comfortable, .hb-skel--comfortable { grid-template-columns: 14px 32px minmax(0, 1fr) auto; height: var(--row-comfortable); column-gap: 10px; }
.hb-thread__stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hb-thread--comfortable .hb-thread__meta { align-self: start; margin-top: 11px; }
.hb-skel-list { display: flex; flex-direction: column; gap: 1px; }
.hb-skel { pointer-events: none; }
.hb-skel__bar { display: block; max-width: 100%; height: 8px; border-radius: var(--radius-full); background: var(--skeleton); animation: hb-pulse var(--duration-pulse) var(--ease-pulse) var(--pulse-delay, 0ms) infinite alternate; }
.hb-skel__mark { width: 6px; }
.hb-skel__avatar { height: 20px; border-radius: 50%; }
.hb-skel--comfortable .hb-skel__avatar { height: 32px; }
.hb-skel__stack { gap: 12px; }
.hb-skel__meta { height: 16px; }
.hb-skel--comfortable .hb-skel__meta { align-self: start; margin-top: 11px; }
@keyframes hb-pulse { from { opacity: 1; } to { opacity: 0.6; } }

/* Messages */
.hb-msg { position: relative; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card); --msg-duration: calc(var(--duration-slow) * var(--motion-scale)); }
.hb-msg--collapsed { --msg-duration: calc(var(--duration-base) * var(--motion-scale)); cursor: pointer; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-msg--collapsed:hover, .hb-msg--collapsed.is-hover { background: var(--surface-card-hover); }
.hb-msg__head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; }
.hb-msg__who { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hb-msg__secondary { display: grid; grid-template-columns: minmax(0, 1fr); }
.hb-msg__secondary > * { grid-area: 1 / 1; min-width: 0; transition: opacity var(--msg-duration) var(--ease-standard); }
.hb-msg__secondary > [aria-hidden="true"] { opacity: 0; pointer-events: none; }
.hb-msg__secondary .hb-msg__addr { justify-self: start; }
.hb-msg__snip { color: var(--fg-muted); font: 400 12px/16px var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-msg__meta { display: flex; align-items: center; flex: none; }
.hb-msg__actions { display: grid; grid-template-columns: 1fr; opacity: 1; transition: grid-template-columns var(--msg-duration) var(--ease-standard), opacity var(--msg-duration) var(--ease-standard); }
.hb-msg--collapsed .hb-msg__actions { grid-template-columns: 0fr; opacity: 0; }
.hb-msg__actions-clip { min-width: 0; overflow: hidden; }
.hb-msg__buttons { display: flex; width: max-content; padding-right: 10px; gap: 10px; }
.hb-msg__time { flex: none; font: 400 12px/16px var(--font-sans); font-variant-numeric: tabular-nums; color: var(--fg-subtle); }
.hb-msg__head .hb-iconbtn { flex: none; }
.hb-msg__toggle { width: 28px; height: 28px; }
.hb-msg__toggle .hb-icon { transition: transform var(--msg-duration) var(--ease-standard); }
.hb-msg--open .hb-msg__toggle .hb-icon { transform: rotate(90deg); }
.hb-msg--collapsed .hb-msg__toggle::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.hb-msg__reveal { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows var(--msg-duration) var(--ease-standard), opacity var(--msg-duration) var(--ease-standard); }
.hb-msg--collapsed .hb-msg__reveal { grid-template-rows: 0fr; opacity: 0; }
.hb-msg__clip { min-height: 0; overflow: hidden; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.hb-msg__contents { display: flex; flex-direction: column; gap: 14px; padding: 2px 18px 18px; }
@media (prefers-reduced-motion: reduce) {
  .hb-msg { --msg-duration: 0ms; }
  .hb-msg__secondary > * { transition: none; }
}
.hb-msg__name { align-self: flex-start; margin: 0 -4px; padding: 0 4px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--fg); font: 600 13px/18px var(--font-sans); cursor: pointer; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-msg__name:hover, .hb-msg__name.is-open, .hb-msg__name.is-hover { background: var(--surface-hover); transition-duration: 0ms; }
.hb-msg__chev { transition: transform calc(var(--duration-base) * var(--motion-scale)) var(--ease-standard); }
.hb-msg__addr.is-open .hb-msg__chev { transform: rotate(180deg); }
.hb-msg__addr:hover, .hb-msg__addr.is-open, .hb-msg__addr.is-hover { color: var(--fg-muted); }
.hb-msg__pop { position: absolute; top: 58px; left: 56px; z-index: 2; }
.hb-details { margin: -2px 0 2px; padding: 12px 14px 8px; overflow: hidden; border-radius: var(--radius-md); background: var(--surface); animation: hb-fade-in calc(var(--duration-base) * var(--motion-scale)) var(--ease-standard) both; }
.hb-details__grid { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; margin: 0; font: 400 12px/16px var(--font-sans); }
.hb-details__grid dt { color: var(--fg-subtle); }
.hb-details__grid dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 2px; min-width: 0; color: var(--fg); }
.hb-person { white-space: nowrap; }
.hb-person__email { margin-left: 4px; color: var(--fg-muted); overflow-wrap: anywhere; white-space: normal; }
.hb-details__warn { display: inline-flex; align-items: center; gap: 4px; color: var(--warning); font-weight: 500; }
.hb-details__copied { display: inline-flex; align-items: center; gap: 4px; color: var(--success); font-weight: 500; }
.hb-details__more { border: 0; padding: 0; background: transparent; color: var(--fg-muted); font: 500 12px/16px var(--font-sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.hb-details__ok { display: inline-flex; align-items: center; gap: 4px; color: var(--success); font-weight: 500; }
.hb-details__copy { margin: -6px 0; opacity: 0; transition: opacity calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-details__grid dd:hover .hb-details__copy, .hb-details__copy:focus-visible, .hb-details__grid dd.is-hover .hb-details__copy { opacity: 1; }
.hb-details__foot { display: flex; gap: 2px; margin: 8px -14px 0; padding: 6px 6px 0; border-top: 1px solid var(--line); }
.hb-sender { width: 320px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.hb-sender__head { display: flex; align-items: center; gap: 12px; }
.hb-sender__who { display: flex; flex-direction: column; min-width: 0; }
.hb-sender__name { font: 600 15px/22px var(--font-sans); }
.hb-sender__addr { display: inline-flex; align-items: center; gap: 2px; font: 400 13px/18px var(--font-sans); color: var(--fg-muted); }
.hb-sender__meta { font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-sender__actions { display: flex; gap: 6px; }
.hb-msg__addr { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin: 0 -4px; padding: 0 4px; border: 0; border-radius: var(--radius-xs); background: transparent; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); cursor: pointer; }
.hb-msg__body { font: 400 14px/22px var(--font-sans); color: var(--fg); display: flex; flex-direction: column; gap: 10px; min-width: 0; text-wrap: pretty; }
.hb-msg__body p { margin: 0; }
/* Every body is one mail page in the card's 18px padding, as in Geary (ADR 0015): no reading measure; the thread
   column stops at 820px. `.hb-mailpage` is the page: the browser's paragraph spacing (1em), code in Geist Mono, and
   one 2px `control-off` bar per quote level (3:1, so nested levels can be counted). */
.hb-mailpage { display: block; min-width: 0; overflow-wrap: break-word; }
.hb-msg__body .hb-mailpage p { margin: 14px 0; }
.hb-mailpage > :first-child { margin-top: 0; }
.hb-mailpage > :last-child { margin-bottom: 0; }
.hb-mailpage :is(pre, code, kbd, samp, tt) { font-family: var(--font-mono); }
.hb-mailpage pre { margin: 14px 0; white-space: break-spaces; }
.hb-mailpage blockquote { margin: 0.3em 0; border-left: 2px solid var(--control-off); padding: 0 0 0 12px; }
/* Plain text (ADR 0015): the sender's lines kept and long lines wrapped (`break-spaces`); only format=flowed reflows.
   Blank lines are the sender's. A quote is muted; the signature after "-- " is dimmer still; a unified diff does not
   wrap: it scrolls sideways in its own box (Roundcube). */
.hb-plain { white-space: break-spaces; overflow-wrap: break-word; text-wrap: wrap; font: 400 14px/22px var(--font-sans); }
.hb-plain blockquote { color: var(--fg-muted); }
.hb-plain__sig { color: var(--fg-subtle); }
.hb-plain__diff { display: block; margin-inline-end: -18px; padding-inline-end: 18px; white-space: pre; overflow-x: auto; font-family: var(--font-mono); }
/* Kept for older boards (ScrollBars): the HB-083 quote and signature as flex rows. */
.hb-pquote { display: flex; gap: 10px; color: var(--fg-muted); }
.hb-pquote__bar { flex: none; width: 2px; border-radius: 1px; background: var(--control-off); }
.hb-pquote > p { flex: 1; min-width: 0; margin: 0; }
.hb-psig { color: var(--fg-subtle); }
/* A designed page in the same padded frame. A page wider than the frame is scaled down to fit (zoom = frame width /
   page width, never under 0.25): never cut. */
.hb-msg__page { align-self: stretch; min-width: 0; overflow: hidden; }
.hb-msg--collapsed:active, .hb-msg--collapsed.is-active { background: var(--surface-card-pressed); }
.hb-attach { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 10px; border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-card); font: 400 12px/16px var(--font-sans); color: var(--fg); overflow: hidden; }
.hb-attach__size, .hb-attach__state { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-attach { flex-shrink: 0; white-space: nowrap; max-width: 100%; }
.hb-attach__name { flex: 0 1 auto; min-width: 7ch; overflow: hidden; text-overflow: ellipsis; }
.hb-attach__state, .hb-attach .hb-btn, .hb-attach__acts, .hb-attach__remove, .hb-attach .hb-icon, .hb-attach__thumb { flex-shrink: 0; }
.hb-attach:hover, .hb-attach.is-hover { background: var(--surface-card-hover); }
.hb-attach__thumb { width: 20px; height: 20px; border-radius: var(--radius-xs); background: var(--surface-pressed); box-shadow: inset 0 0 0 1px var(--line); flex-shrink: 0; }
.hb-attach__acts { display: inline-flex; gap: 0; opacity: 0; transition: opacity calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-attach:hover .hb-attach__acts, .hb-attach.is-hover .hb-attach__acts, .hb-attach:focus-within .hb-attach__acts { opacity: 1; transition-duration: 0ms; }
.hb-attach__bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent-solid); transition: width calc(var(--duration-base) * var(--motion-scale)) var(--ease-linear); }
.hb-attach--failed { box-shadow: 0 0 0 1px var(--danger); }
.hb-attach__state { color: var(--fg-subtle); }
.hb-attach--failed .hb-attach__state { color: var(--danger); }
.hb-attach__size { color: var(--fg-subtle); }
.hb-replybar { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 16px 0 0; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card); transition: box-shadow calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); color: var(--fg-subtle); font: 400 13px/16px var(--font-sans); cursor: text; }
.hb-replybar__keys { display: inline-flex; align-items: center; gap: 2px; margin-right: -8px; }

/* Navigation */
.hb-rail { --rail-bg: var(--surface); position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg-subtle); cursor: pointer; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard), color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-rail:hover, .hb-rail.is-hover { --rail-bg: var(--surface-hover); background: var(--surface-hover); color: var(--fg); }
.hb-rail:active, .hb-rail.is-active { --rail-bg: var(--surface-pressed); background: var(--surface-pressed); }
.hb-rail--active, .hb-rail--active:hover, .hb-rail--active.is-hover { --rail-bg: var(--surface-selected); background: var(--surface-selected); color: var(--fg); }
.hb-rail__count { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--accent-solid); box-shadow: 0 0 0 2px var(--rail-bg); }

.hb-folders { width: 248px; padding: 10px 6px; display: flex; flex-direction: column; gap: 1px; background: var(--surface); }
.hb-folders__acct { display: flex; align-items: center; gap: 8px; padding: 14px 10px 6px; font: 500 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-folders__item { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 10px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg-muted); font: 400 13px/16px var(--font-sans); text-align: left; cursor: pointer; width: 100%; }
.hb-folders__item:hover, .hb-folders__item.is-hover { background: var(--surface-hover); color: var(--fg); }
.hb-folders__item--active { background: var(--surface-selected); color: var(--fg); font-weight: 600; }
.hb-folders__item:active, .hb-folders__item.is-active { background: var(--surface-pressed); }
.hb-folders__item--child { padding-left: 34px; }
.hb-folders__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-folders__count { font: 400 12px/16px var(--font-sans); font-variant-numeric: tabular-nums; color: var(--fg-subtle); }

/* Feedback */
.hb-banner { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 6px 6px 12px; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card); font: 400 13px/18px var(--font-sans); color: var(--fg); }
.hb-banner__icon { color: var(--fg-muted); }
.hb-banner--warning .hb-banner__icon { color: var(--warning); }
.hb-banner--danger .hb-banner__icon { color: var(--danger); }
.hb-banner__text { flex: 1; min-width: 0; text-wrap: pretty; }
.hb-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px; }
.hb-empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-lg); background: var(--surface-selected); color: var(--fg-muted); margin-bottom: 6px; }
.hb-empty__title { font: 600 14px/20px var(--font-sans); color: var(--fg); }
.hb-empty__body { font: 400 13px/18px var(--font-sans); color: var(--fg-muted); max-width: 280px; text-wrap: balance; }
.hb-empty__actions { display: flex; gap: 8px; margin-top: 10px; }

/* Floating layers */
.hb-pop { border-radius: var(--radius-xl); background: var(--surface-raised); box-shadow: var(--shadow-popover); font-family: var(--font-sans); color: var(--fg); animation: hb-pop-in calc(var(--duration-base) * var(--motion-scale)) var(--ease-enter) both; }
@keyframes hb-pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.hb-menu { width: 232px; padding: 4px; border-radius: var(--radius-lg); }
.hb-menu__item { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 30px; padding: 0 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg); font: 400 13px/16px var(--font-sans); text-align: left; cursor: pointer; }
.hb-menu__item:hover, .hb-menu__item.is-hover { background: var(--surface-raised-hover); }
.hb-menu__item--active { background: var(--surface-raised-selected); }
.hb-menu__item:active, .hb-palette__item:active, .hb-menu__item.is-active, .hb-palette__item.is-active { background: var(--surface-raised-selected); }
.hb-menu__item--danger { color: var(--danger); }
.hb-menu__item .hb-icon { color: var(--fg-muted); }
.hb-menu__item--danger .hb-icon { color: var(--danger); }
.hb-menu__label { flex: 1; }
.hb-menu__sep { height: 1px; margin: 4px 6px; background: var(--line); }

.hb-palette { width: 560px; max-width: 100%; overflow: hidden; container-type: inline-size; }
.hb-palette__input { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--fg-subtle); }
.hb-palette__input input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--fg); font: 400 15px/22px var(--font-sans); }
.hb-palette__list { padding: 6px; display: flex; flex-direction: column; }
.hb-palette__group { padding: 10px 12px 4px; font: 500 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-palette__item { position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px 0 12px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg); font: 400 13px/16px var(--font-sans); text-align: left; cursor: pointer; width: 100%; }
.hb-palette__item:hover, .hb-palette__item.is-hover { background: var(--surface-raised-hover); }
.hb-palette__item--active { background: var(--surface-raised-selected); }
.hb-palette__item--active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 1px; background: var(--accent-solid); }
.hb-palette__mark { display: inline-flex; align-items: center; justify-content: center; width: 16px; color: var(--fg-muted); }
.hb-palette__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-palette__hint { color: var(--fg-subtle); }
.hb-palette__foot > span { flex-shrink: 0; }
.hb-palette__foot .hb-palette__all { margin-left: auto; }
@container (max-width: 480px) { .hb-palette__tab { display: none; } }
.hb-palette__foot { display: flex; gap: 14px; height: 34px; white-space: nowrap; overflow: hidden; align-items: center; padding: 0 14px; border-top: 1px solid var(--line); font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-palette .hb-kbd, .hb-menu .hb-kbd { background: var(--surface-raised-hover); }

.hb-dialog { width: 420px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.hb-dialog__title { margin: 0; font: 600 15px/22px var(--font-sans); text-wrap: balance; }
.hb-dialog__body { margin: 0; font: 400 13px/18px var(--font-sans); color: var(--fg-muted); text-wrap: pretty; }
.hb-dialog__fields { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.hb-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.hb-sheet { width: 640px; max-width: 100%; display: flex; flex-direction: column; overflow: hidden; animation: hb-sheet-in calc(var(--duration-slow) * var(--motion-scale)) var(--ease-enter) both; }
@keyframes hb-sheet-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.hb-sheet__head { display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); }
.hb-sheet__title { flex: 1; font: 600 15px/22px var(--font-sans); }
.hb-sheet__status { font: 400 12px/16px var(--font-sans); font-variant-numeric: tabular-nums; color: var(--fg-subtle); margin-right: 6px; }
.hb-sheet__field { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; min-height: 42px; padding: 8px 16px; border-bottom: 1px solid var(--line); font: 400 13px/18px var(--font-sans); }
.hb-sheet__label { color: var(--fg-subtle); }
.hb-sheet__value { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.hb-sheet__body { min-height: 180px; padding: 16px; max-width: calc(60ch + 32px); text-wrap: pretty; font: 400 14px/22px var(--font-sans); display: flex; flex-direction: column; gap: 10px; }
.hb-sheet__body p, .hb-sheet__body ul { margin: 0; }
.hb-sheet__foot { display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 12px; border-top: 1px solid var(--line); }
.hb-recipient { display: inline-flex; align-items: center; height: 24px; margin-left: 0; padding: 0 8px; border-radius: var(--radius-full); background: var(--surface-selected); font: 500 12px/16px var(--font-sans); }
.hb-from { display: inline-flex; align-items: center; gap: 8px; height: 28px; margin-left: -8px; padding: 0 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg); font: 400 13px/16px var(--font-sans); cursor: pointer; }
.hb-from:hover, .hb-from.is-hover { background: var(--surface-raised-hover); }

.hb-toast { display: inline-flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px 0 14px; border-radius: var(--radius-xl); background: var(--surface-raised); box-shadow: var(--shadow-popover); font: 400 13px/16px var(--font-sans); color: var(--fg); position: relative; overflow: hidden; animation: hb-toast-in calc(var(--duration-toast) * var(--motion-scale)) var(--ease-enter) both; }
/* HB-167: a toast hugs its text; in a narrower place (at most the bar's width - 96px) the message elides. */
.hb-toast { max-width: 100%; box-sizing: border-box; }
.hb-toast__text { min-width: 0; }
.hb-toast:not(.hb-toast--error) .hb-toast__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes hb-toast-in { from { opacity: 0; transform: translateY(8px); } }
.hb-toast__icon { color: var(--fg-muted); }
.hb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.hb-toast__track { position: absolute; left: 16px; right: 16px; bottom: 4px; height: 2px; border-radius: 1px; background: var(--line); }
.hb-toast__progress { position: absolute; inset: 0; border-radius: 1px; background: var(--fg-muted); transform-origin: left; animation: hb-countdown var(--duration-undo-send) var(--ease-linear) forwards; }
@keyframes hb-countdown { to { transform: scaleX(0); } }
.hb-toast:hover .hb-toast__progress, .hb-toast:focus-within .hb-toast__progress, .hb-toast.is-hover .hb-toast__progress { animation-play-state: paused; }

mark.hb-mark { background: var(--highlight); color: var(--fg); border-radius: 2px; padding: 0 1px; }

@media (prefers-reduced-motion: reduce) {
  :root { --motion-scale: 0; }
  .hb-pop, .hb-sheet, .hb-toast, .hb-scrim, .hb-folders--enter { animation-name: hb-fade-in; animation-duration: var(--duration-exit); animation-timing-function: var(--ease-standard); }
  .hb-spinner, .hb-skel__bar { animation: none; }
  .hb-skel__bar { opacity: 0.8; }
  .hb-spinner { display: none; }
  .hb-spinner__label { display: inline; }
  .hb-toast__track { display: none; }
}
:root[data-motion="reduced"] { --motion-scale: 0; }
:root[data-motion="reduced"] .hb-pop, :root[data-motion="reduced"] .hb-sheet, :root[data-motion="reduced"] .hb-toast, :root[data-motion="reduced"] .hb-scrim, :root[data-motion="reduced"] .hb-folders--enter { animation-name: hb-fade-in; animation-duration: var(--duration-exit); animation-timing-function: var(--ease-standard); }
:root[data-motion="reduced"] .hb-spinner, :root[data-motion="reduced"] .hb-skel__bar { animation: none; }
:root[data-motion="reduced"] .hb-skel__bar { opacity: 0.8; }
:root[data-motion="reduced"] .hb-spinner { display: none; }
:root[data-motion="reduced"] .hb-spinner__label { display: inline; }
:root[data-motion="reduced"] .hb-toast__track { display: none; }
@keyframes hb-fade-in { from { opacity: 0; } }

.hb-pop.hb-tooltip { border-radius: var(--radius-md); animation-name: hb-fade-in; animation-duration: calc(var(--duration-fast) * var(--motion-scale)); }
@keyframes hb-fade-out { to { opacity: 0; } }
.hb-leaving { animation: hb-fade-out var(--duration-exit) var(--ease-exit) both; } /* exits fade at duration-exit at any motion-scale, matching Theme.fade() */
.hb-scrim { background: var(--scrim); animation: hb-fade-in calc(var(--duration-base) * var(--motion-scale)) var(--ease-standard) both; }
.hb-menu { transform-origin: top left; }
.hb-palette, .hb-dialog, .hb-shortcuts { transform-origin: top center; }
.hb-sender { transform-origin: top left; }
.hb-folders--enter { animation: hb-panel-in calc(var(--duration-base) * var(--motion-scale)) var(--ease-enter) both; }
@keyframes hb-panel-in { from { transform: translateX(-248px); } }
.hb-focus { box-shadow: var(--shadow-focus) !important; }

/* Selection bar (multi-select) */
.hb-selbar { display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); background: var(--canvas); }
.hb-selbar--compact { gap: 0; padding: 0 8px 0 14px; }
.hb-selbar--compact .hb-btn--sm { padding: 0 5px; gap: 4px; }
.hb-selbar__count { font: 600 13px/16px var(--font-sans); font-variant-numeric: tabular-nums; margin-right: 8px; white-space: nowrap; }

/* Shortcut sheet */
.hb-shortcuts { width: 760px; padding: 20px 22px 18px; }
.hb-shortcuts__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hb-shortcuts__title { margin: 0; flex: 1; font: 600 15px/22px var(--font-sans); }
.hb-shortcuts__tabs { margin-right: 12px; }
.hb-shortcuts__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.hb-shortcuts__group { display: flex; flex-direction: column; gap: 2px; }
.hb-shortcuts__gtitle { font: 500 12px/16px var(--font-sans); color: var(--fg-subtle); margin-bottom: 6px; }
.hb-shortcuts__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; height: 26px; font: 400 13px/16px var(--font-sans); color: var(--fg-muted); }
.hb-shortcuts__row > :first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-shortcuts .hb-kbd { background: var(--surface-raised-hover); }

/* Account name + address */
.hb-acctname { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.hb-acctname__addr { color: var(--fg-subtle); }

/* Inline reply */
.hb-reply { border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-solid); display: flex; flex-direction: column; }
.hb-reply__to { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); font: 400 13px/18px var(--font-sans); color: var(--fg-subtle); }
.hb-reply__body { padding: 12px 18px; max-width: calc(60ch + 36px); text-wrap: pretty; min-height: 72px; font: 400 14px/22px var(--font-sans); color: var(--fg); }
.hb-reply__caret { display: inline-block; width: 1px; height: 18px; vertical-align: -4px; background: var(--fg); }
.hb-reply__foot { display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 10px 0 12px; }
.hb-reply__status { font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); margin: 0 8px 0 4px; }
/* HB-107: the reply box under the message it answers. The To field while it has focus (Forward); the
   forwarded message and the quote chip under the body; a saved draft collapsed to one line after Esc. */
.hb-reply__field { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.hb-reply__placeholder { color: var(--fg-subtle); }
.hb-reply__fwd { display: flex; flex-direction: column; gap: 4px; margin: 0 18px 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-card-hover); font: 400 12px/16px var(--font-sans); color: var(--fg-muted); }
.hb-reply__fwdhead { font-weight: 500; color: var(--fg-muted); }
.hb-reply__files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hb-reply__fwd .hb-attach:hover, .hb-reply__fwd .hb-attach.is-hover { background: var(--surface-card-pressed); }
.hb-reply__quote { margin: -4px 18px 4px; }
.hb-reply__body--empty { min-height: 22px; }
/* Joined to its message (HB-107): the card holds the box under a 1px line; the accent ring goes round the
   whole card while focus is in the box, so the box reads as part of the message it answers. */
.hb-msg__reply { margin: 4px -18px -18px; border-top: 1px solid var(--line); }
.hb-msg__reply > * > .hb-reply, .hb-msg__reply > .hb-reply, .hb-msg__reply .hb-reply { background: transparent; box-shadow: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); max-width: none; }
.hb-msg__reply .hb-replydraft { background: transparent; box-shadow: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); max-width: none; }
.hb-msg__reply .hb-replydraft:hover, .hb-msg__reply .hb-replydraft.is-hover { background: var(--surface-card-hover); }
.hb-msg--replying { box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-solid); }
.hb-replydraft { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 18px; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card); font: 400 13px/18px var(--font-sans); color: var(--fg-muted); cursor: pointer; }
.hb-replydraft:hover, .hb-replydraft.is-hover { background: var(--surface-card-hover); }
.hb-replydraft__icon { color: var(--fg-subtle); }
.hb-replydraft__who { font-weight: 500; color: var(--fg-muted); white-space: nowrap; }
.hb-replydraft__snip { color: var(--fg-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-quoted { align-self: flex-start; display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border: 0; border-radius: var(--radius-full); background: var(--surface-card-hover); color: var(--fg-muted); font: 500 12px/16px var(--font-sans); cursor: pointer; }
.hb-quoted:hover { background: var(--surface-card-pressed); }
/* Recipient chips + autocomplete */
.hb-recipient { position: relative; gap: 4px; }
.hb-recipient--hover { background: var(--surface-raised-selected); padding-right: 4px; }
.hb-recipient--invalid { background: transparent; box-shadow: inset 0 0 0 1px var(--danger); color: var(--danger); }
.hb-recipient__x { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; border-radius: var(--radius-full); color: var(--fg-muted); }
.hb-autocomplete { position: absolute; top: calc(100% + 4px); left: 72px; z-index: 3; width: 320px; }
.hb-autocomplete .hb-menu { width: 100%; }
.hb-menu__label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-menu__hint { color: var(--fg-subtle); font-size: 12px; }
.hb-sheet__field { position: relative; }

/* ---- Context-aware states (round 7): one rule set, scoped by the surface a control sits on ---- */
:root { --skeleton: var(--surface-selected); }
.hb-msg, .hb-replybar, .hb-reply, .hb-replydraft, .hb-banner, .hb-attach, .hb-sync { --surface-hover: var(--surface-card-hover); --surface-pressed: var(--surface-card-pressed); --skeleton: var(--surface-card-pressed); }
.hb-pop, .hb-sheet, .hb-toast { --surface-hover: var(--surface-raised-hover); --surface-pressed: var(--surface-raised-selected); --skeleton: var(--surface-raised-selected); }
.hb-msg__name, .hb-msg__addr { position: relative; max-width: 100%; white-space: nowrap; border-radius: var(--radius-xs); transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard), color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-msg__name::after, .hb-msg__addr::after { content: ""; position: absolute; inset: -4px 0; }
.hb-msg__label { display: block; overflow: hidden; text-overflow: ellipsis; }
.hb-msg__name:hover, .hb-msg__name.is-hover, .hb-msg__name.is-open,
.hb-msg__addr:hover, .hb-msg__addr.is-hover, .hb-msg__addr.is-open { background: var(--surface-card-hover); transition-duration: 0ms; }
.hb-msg__name:active, .hb-msg__name.is-active, .hb-msg__addr:active, .hb-msg__addr.is-active { background: var(--surface-card-pressed); }
.hb-msg__addr:hover, .hb-msg__addr.is-hover, .hb-msg__addr.is-open, .hb-msg__addr.is-active { color: var(--fg-muted); }
.hb-sender--above { transform-origin: bottom left; }
/* Composer recovery */
.hb-field-error { grid-column: 2 / 4; padding: 4px 0 0; font: 400 12px/16px var(--font-sans); color: var(--danger); }
.hb-recipient__x { border: 0; padding: 0; background: transparent; cursor: pointer; }
.hb-recipient__x:hover, .hb-recipient__x.is-hover { background: var(--surface-raised-selected); color: var(--fg); }
.hb-attach__remove { margin-left: -2px; }
/* Inline reply header geometry */
.hb-reply__to { padding: 8px 12px 8px 18px; min-height: 44px; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hb-reply__addresses { display: flex; flex: 1 1 240px; min-width: 0; align-items: center; gap: 8px; }
.hb-reply__label { flex: 0 0 28px; }
.hb-reply__people { min-width: 0; flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hb-reply__people .hb-recipient { max-width: 100%; overflow: hidden; }
/* Loading */
.hb-skel-block { display: block; border-radius: var(--radius-full); background: var(--skeleton); animation: hb-pulse var(--duration-pulse) var(--ease-pulse) infinite alternate; }
.hb-progress { position: relative; height: 4px; border-radius: var(--radius-full); background: var(--skeleton); overflow: hidden; }
.hb-progress__fill { position: absolute; inset: 0 auto 0 0; border-radius: var(--radius-full); background: var(--accent-solid); transition: width calc(var(--duration-base) * var(--motion-scale)) var(--ease-standard); }
.hb-sync { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card); font: 400 12px/16px var(--font-sans); color: var(--fg-muted); }
.hb-sync__count { margin-left: auto; color: var(--fg-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.hb-sync__top { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .hb-skel-block { animation: none; opacity: 0.8; } }
:root[data-motion="reduced"] .hb-skel-block { animation: none; opacity: 0.8; }

.hb-thread, .hb-skel, .hb-msg--collapsed, .hb-banner, .hb-sync { flex-shrink: 0; }

.hb-spinner-wrap--decorative .hb-spinner__label { display: none !important; }
@media (prefers-reduced-motion: reduce) { .hb-spinner-wrap--decorative { display: none; } }
:root[data-motion="reduced"] .hb-spinner-wrap--decorative { display: none; }
.hb-cc { display: inline-flex; gap: 10px; }

.hb-avatar.text-subtitle { line-height: 22px; }

/* Links and selection */
::selection { background: var(--highlight); color: var(--fg); }
.hb-msg__body a, .hb-reply a, .hb-sheet__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.hb-msg__body a:visited, .hb-reply a:visited, .hb-sheet__body a:visited { color: var(--accent); }
.hb-btn .hb-spinner__label { font: inherit; }
.hb-msg__body a:hover, .hb-reply a:hover, .hb-sheet__body a:hover { text-decoration-thickness: 2px; }
.hb-msg__body a:focus-visible, .hb-reply a:focus-visible, .hb-sheet__body a:focus-visible { border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
@media (prefers-reduced-motion: reduce) { .hb-pop.hb-tooltip { animation-duration: var(--duration-exit); } }
:root[data-motion="reduced"] .hb-pop.hb-tooltip { animation-duration: var(--duration-exit); }
.hb-sheet__value > .hb-recipient:first-child { margin-left: -8px; }
.hb-seg { user-select: none; }

/* ---- App patterns ---- */
.hb-window { position: relative; display: flex; overflow: hidden; background: var(--canvas); color: var(--fg); font-family: var(--font-sans); }
.hb-railbar { width: var(--rail-width); flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; background: var(--surface); border-right: 1px solid var(--line); }
.hb-railbar__gap { height: 10px; flex-shrink: 0; }
.hb-listpane { width: var(--list-width); flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.hb-listpane__head { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px 10px; }
.hb-listpane__title { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 20px; }
.hb-listpane__title :is(h1, h2) { margin: 0; }
.hb-listpane__accts { display: inline-flex; gap: 12px; }
.hb-listpane__rows { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1px; padding-top: 6px; border-top: 1px solid var(--line); }
.hb-listpane__foot { display: flex; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--line); font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-reader { --reader-pad: 40px; flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--canvas); }
.hb-readerbar { display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 24px 0 calc(var(--reader-pad) - 8px); flex-shrink: 0; }
.hb-reader__scroll { flex: 1; min-height: 0; overflow: hidden; padding: 4px var(--reader-pad) 24px; display: flex; flex-direction: column; gap: 6px; }
.hb-threadhead { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.hb-threadhead h1 { margin: 0; text-wrap: balance; }
.hb-threadhead__meta { display: flex; align-items: center; gap: 6px; }
.hb-threadhead__meta .hb-acctname { margin-right: 4px; }
.hb-settingsnav { width: 232px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1px; padding: 20px 8px; background: var(--surface); border-right: 1px solid var(--line); }
.hb-settingsnav__title { margin: 0 10px 14px; }
.hb-settings { flex: 1; min-width: 0; padding: 28px 56px; display: flex; flex-direction: column; overflow: hidden; }
.hb-settings > * { max-width: 880px; width: 100%; }
.hb-settings__h { margin: 0 0 4px; }
.hb-settings__lede { margin: 0 0 16px; font: 400 13px/18px var(--font-sans); color: var(--fg-muted); max-width: 52ch; }
.hb-setting { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 32px; padding: 18px 0; border-top: 1px solid var(--line); }
.hb-setting__text { display: flex; flex-direction: column; gap: 4px; }
.hb-setting__title { font: 500 13px/18px var(--font-sans); color: var(--fg); }
.hb-setting__desc { font: 400 12px/16px var(--font-sans); color: var(--fg-muted); text-wrap: pretty; }
.hb-setting__control { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.hb-acctrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card); --surface-hover: var(--surface-card-hover); --surface-pressed: var(--surface-card-pressed); }
.hb-acctrow__who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hb-acctrow__name { font: 600 13px/18px var(--font-sans); }
.hb-acctrow__addr { font: 400 12px/16px var(--font-sans); color: var(--fg-muted); }
.hb-acctrow__status { display: inline-flex; align-items: center; gap: 6px; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); white-space: nowrap; }
.hb-acctrow__status--synced .hb-icon { color: var(--fg-subtle); }
.hb-acctrow__status--error { color: var(--danger); }
.hb-acctrow .hb-avatar-wrap .hb-acct { box-shadow: 0 0 0 2px var(--surface-card); }

.hb-replybar__main { flex: 1; align-self: stretch; text-align: left; padding: 0 18px; border: 0; border-radius: var(--radius-lg) 0 0 var(--radius-lg); background: transparent; font: 400 13px/16px var(--font-sans); color: var(--fg-subtle); cursor: text; }
.hb-replybar__main:hover { color: var(--fg-muted); }
.hb-palette__hint, .hb-menu__hint { margin-left: 8px; }
.hb-selbar { border-bottom: 0; }
.hb-reader .hb-selbar { padding-left: 40px; }
.hb-settingsnav { padding-top: 0; }
.hb-settingsnav__head { display: flex; align-items: center; min-height: 20px; padding: 14px 10px; margin-bottom: 4px; }
.hb-setting__title { font: 600 14px/20px var(--font-sans); color: var(--fg); }
.hb-settings__lede { font: 400 14px/22px var(--font-sans); }
.hb-listpane__foot--warning > :first-child { color: var(--warning); }
.hb-listpane__foot--danger > :first-child { color: var(--danger); }
/* "· 1 more problem" in the footer status (HB-089): a link to Settings › Accounts, in fg-muted so the status keeps its tone. */
.hb-listpane__footlink { padding: 0; border: 0; background: none; font: inherit; color: var(--fg-muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.hb-listpane__footlink:hover { color: var(--fg); }
.hb-field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.hb-field__label { font: 500 13px/16px var(--font-sans); color: var(--fg); }
.hb-field__box { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--radius-md); border: 1px solid var(--control-off); background: var(--canvas); color: var(--fg-subtle); }
.hb-field__box.is-focus, .hb-field__box:focus-within { border-color: var(--accent-solid); box-shadow: 0 0 0 3px var(--accent-soft); }
.hb-field__box input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--fg); font: 400 14px/20px var(--font-sans); }
.hb-field__box input::placeholder { color: var(--fg-subtle); }
.hb-field__hint { font: 400 12px/16px var(--font-sans); color: var(--fg-muted); }
.hb-field--error .hb-field__box { border-color: var(--danger); }
.hb-field--error .hb-field__hint { color: var(--danger); }
.hb-onboard { width: 440px; display: flex; flex-direction: column; gap: 24px; padding: 32px; border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-card); }
.hb-btn--lg { height: 40px; padding: 0 14px; font-size: 14px; }
.hb-thread { cursor: default; }

/* Screens round 3 */
.hb-palette__prefix { flex-shrink: 0; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--surface-raised-hover); color: var(--fg-muted); font: 500 12px/16px var(--font-sans); }
.hb-palette__item--disabled { color: var(--fg-subtle); cursor: default; }
.hb-palette__item--disabled:hover, .hb-palette__item--disabled.is-hover { background: transparent; }
.hb-palette__check { margin-left: auto; color: var(--fg-subtle); }
.hb-palette__item--disabled mark.hb-mark { background: transparent; color: inherit; padding: 0; }
.hb-palette__item--disabled .hb-palette__mark { opacity: 0.6; }
/* Chips never grow (owner, 2026-11-12): each takes its content width, at most 340px; they flow in a row with 8px gaps and wrap. */
.hb-msg__files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.hb-msg__files > .hb-attach { flex: 0 0 auto; max-width: 340px; }
.hb-sheet__input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; color: inherit; font: inherit; }
.hb-cc { display: inline-flex; gap: 2px; }
.hb-cc__btn { height: 24px; padding: 0 6px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--fg-subtle); font: 400 12px/16px var(--font-sans); cursor: pointer; }
.hb-copy-close { visibility: hidden; flex: none; }
.hb-copy-row:hover .hb-copy-close, .hb-copy-row.is-hover .hb-copy-close { visibility: visible; }
.hb-cc__btn:hover { background: var(--surface-raised-hover); color: var(--fg-muted); }

/* Pane resizer: the list's right border, 9px to grab. At rest it is only the border; hover shows a
   2px control-off line (>= 3:1 on every surface), dragging the accent line (attention only while
   acting), keyboard focus one 4px accent bar with a canvas gap. Left/Right resize in 16px steps
   (Shift: 64px), Home/End go to list-width-min/max, Enter or a double-click resets to list-width.
   The width follows the pointer 1:1 with no animation. */
.hb-listpane { position: relative; }
.hb-resizer { position: absolute; top: 0; bottom: 0; right: -5px; z-index: 3; width: 9px; padding: 0; border: 0; background: transparent; cursor: col-resize; outline: none; }
.hb-resizer__line { position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; border-radius: var(--radius-full); background: transparent; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-resizer:hover .hb-resizer__line, .hb-resizer.is-hover .hb-resizer__line { background: var(--control-off); transition-duration: 0ms; }
.hb-resizer:focus-visible .hb-resizer__line, .hb-resizer.is-focus .hb-resizer__line { left: 2px; width: 4px; background: var(--accent-solid); box-shadow: 0 0 0 2px var(--canvas); transition-duration: 0ms; }
.hb-resizer:active .hb-resizer__line, .hb-resizer.is-active .hb-resizer__line { left: 3px; width: 2px; background: var(--accent-solid); box-shadow: none; transition-duration: 0ms; }

/* Form control states (README, "Form control states"). Hover moves the control one step toward fg.
   Pressed keeps the hover color, and the change comes on release. Disabled never uses opacity. State
   colors change at 0ms in and over duration-fast out. */
.hb-switch:hover, .hb-switch.is-hover, .hb-switch:active, .hb-switch.is-active { background: var(--control-hover); transition-duration: 0ms; }
.hb-switch[aria-checked="true"]:hover, .hb-switch[aria-checked="true"].is-hover, .hb-switch[aria-checked="true"]:active, .hb-switch[aria-checked="true"].is-active { background: var(--primary-hover); }
.hb-switch:active .hb-switch__knob, .hb-switch.is-active .hb-switch__knob { width: 18px; }
.hb-switch[aria-checked="true"]:active .hb-switch__knob, .hb-switch[aria-checked="true"].is-active .hb-switch__knob { transform: translateX(10px); }
.hb-switch__knob { transition-property: transform, width; }
.hb-switch:disabled { cursor: default; pointer-events: none; background: var(--line-strong); }
.hb-switch[aria-checked="true"]:disabled { background: var(--fg-disabled); }
.hb-switch-field.is-disabled { color: var(--fg-disabled); }
.hb-check:hover, .hb-check.is-hover, .hb-check:active, .hb-check.is-active { border-color: var(--control-hover); transition-duration: 0ms; }
.hb-check--on:hover, .hb-check--on.is-hover, .hb-check--on:active, .hb-check--on.is-active { background: var(--primary-hover); border-color: var(--primary-hover); }
.hb-check.is-disabled { pointer-events: none; border-color: var(--line-strong); }
.hb-check--on.is-disabled { background: var(--fg-disabled); border-color: var(--fg-disabled); }
.hb-seg__opt[aria-checked="false"]:hover, .hb-seg__opt[aria-checked="false"].is-hover { color: var(--fg); transition-duration: 0ms; }
.hb-seg__opt[aria-checked="false"]:active, .hb-seg__opt[aria-checked="false"].is-active { color: var(--fg); background: var(--surface-pressed); transition-duration: 0ms; }
.hb-seg.is-disabled .hb-seg__opt { color: var(--fg-disabled); cursor: default; pointer-events: none; }
.hb-seg.is-disabled .hb-seg__thumb { box-shadow: none; }
.hb-field__box { transition: border-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-field__box:hover, .hb-field__box.is-hover { border-color: var(--control-hover); transition-duration: 0ms; }
.hb-field--error .hb-field__box:hover, .hb-field--error .hb-field__box.is-hover { border-color: var(--danger); }
.hb-field__box.is-focus, .hb-field__box:focus-within { border-color: var(--accent-solid); transition-duration: 0ms; }
.hb-field--error .hb-field__box.is-focus, .hb-field--error .hb-field__box:focus-within { border-color: var(--danger); box-shadow: var(--shadow-focus); }
.hb-field.is-disabled .hb-field__label, .hb-field.is-disabled .hb-field__hint { color: var(--fg-disabled); }
.hb-field.is-readonly .hb-field__box { background: var(--surface); }
.hb-field.is-readonly .hb-field__box input { color: var(--fg-muted); }
.hb-field.is-disabled .hb-field__box { background: var(--surface); border-color: var(--line); color: var(--fg-disabled); pointer-events: none; }
.hb-field.is-disabled .hb-field__box input, .hb-field.is-disabled .hb-field__box input::placeholder { color: var(--fg-disabled); }

/* ---- HB-069: one look for the keyboard's current item in every list (the palette's: fill and accent tick) ---- */
.hb-menu__item--active, .hb-option.is-current { background: var(--surface-raised-selected); }
.hb-menu__item--active::before, .hb-option.is-current::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 1px; background: var(--accent-solid); }
.hb-menu__item--disabled, .hb-menu__item--disabled .hb-icon, .hb-menu__item--disabled .hb-kbd { color: var(--fg-disabled); cursor: default; }
.hb-menu__item--disabled:hover, .hb-menu__item--disabled.is-hover, .hb-menu__item--disabled:active { background: transparent; }
.hb-menu__item--disabled.hb-menu__item--active { background: var(--surface-raised-hover); }
.hb-menu__reason { position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); z-index: 2; pointer-events: none; }
.hb-menu__reason .hb-tooltip { white-space: nowrap; color: var(--fg); }
.hb-menu__title { padding: 6px 8px 4px; font: 500 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-menu__note { padding: 6px 8px 4px; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); text-wrap: pretty; }
.hb-menu__meta { flex-shrink: 0; font-size: 12px; color: var(--fg-subtle); }
.hb-menu__check { display: inline-flex; flex-shrink: 0; width: 15px; color: var(--fg); }
.hb-menu__item .hb-menu__check .hb-icon { color: var(--fg); }
.hb-menu__lead { display: inline-flex; justify-content: center; flex-shrink: 0; width: 15px; }

/* Popover: a small anchored surface for choosers that are not menus. */
.hb-popover { display: flex; flex-direction: column; border-radius: var(--radius-lg); transform-origin: bottom center; }
.hb-popover__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 0 16px; }
.hb-popover__title { margin: 0; font: 600 14px/20px var(--font-sans); }
.hb-popover__body { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 16px; }
.hb-popover__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }

/* Listbox and options (Select, Autocomplete). */
.hb-listbox { width: 280px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 4px; border-radius: var(--radius-lg); transform-origin: top left; }
.hb-option { position: relative; display: flex; align-items: center; gap: 10px; flex-shrink: 0; min-height: 30px; padding: 0 8px; border-radius: var(--radius-md); color: var(--fg); font: 400 13px/16px var(--font-sans); cursor: pointer; }
.hb-option--person { min-height: 44px; }
.hb-option:hover, .hb-option.is-hover { background: var(--surface-raised-hover); }
.hb-option.is-current:hover { background: var(--surface-raised-selected); }
.hb-option.is-disabled, .hb-option.is-disabled .hb-option__hint { color: var(--fg-disabled); cursor: default; }
.hb-option.is-disabled:hover { background: transparent; }
.hb-option .hb-icon { color: var(--fg-muted); }
.hb-option__text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.hb-option--person .hb-option__text { flex-direction: column; align-items: flex-start; gap: 2px; }
.hb-option__label, .hb-option__hint { min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-option__hint { font-size: 12px; color: var(--fg-subtle); }
.hb-option__check { display: inline-flex; flex-shrink: 0; width: 15px; }
.hb-option__check .hb-icon { color: var(--fg); }
.hb-option .hb-acct { flex-shrink: 0; }
.hb-autocomplete .hb-listbox { width: 100%; }
.hb-listbox, .hb-palette__list { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* Select: `field` in forms, `inline` in a line of text (the composer's From). */
.hb-select-wrap { position: relative; display: inline-flex; min-width: 0; }
.hb-field > .hb-select-wrap { width: 100%; }
.hb-select-wrap > .hb-listbox { position: absolute; top: calc(100% + 4px); left: 0; z-index: 4; min-width: 100%; }
.hb-select { display: inline-flex; align-items: center; gap: 8px; min-width: 0; border: 0; background: transparent; color: var(--fg); text-align: left; cursor: pointer; }
.hb-select--field { width: 100%; height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--control-off); border-radius: var(--radius-md); background: var(--canvas); font: 400 14px/20px var(--font-sans); transition: border-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-select--field:hover, .hb-select--field.is-hover { border-color: var(--control-hover); transition-duration: 0ms; }
.hb-select--field:active, .hb-select--field.is-active { background: var(--surface-hover); }
.hb-select--field.is-open { border-color: var(--accent-solid); }
.hb-field--error .hb-select--field { border-color: var(--danger); }
.hb-select--field:disabled { background: var(--surface); border-color: var(--line); color: var(--fg-disabled); cursor: default; }
.hb-select--inline { height: 28px; margin-left: -8px; padding: 0 8px; border-radius: var(--radius-md); font: 400 13px/16px var(--font-sans); }
.hb-select--inline:hover, .hb-select--inline.is-hover { background: var(--surface-raised-hover); }
.hb-select--inline:active, .hb-select--inline.is-active, .hb-select--inline.is-open { background: var(--surface-raised-selected); }
.hb-select:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.hb-select__value { flex: 1; min-width: 0; display: flex; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-select--inline .hb-select__value { flex: 0 1 auto; }
.hb-select__hint, .hb-select__placeholder { color: var(--fg-subtle); }
.hb-select:disabled .hb-select__hint { color: var(--fg-disabled); }
.hb-select__chevron { flex-shrink: 0; color: var(--fg-subtle); transition: transform calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-select.is-open .hb-select__chevron { transform: rotate(180deg); }
.hb-from--one { margin-left: 0; padding: 0; cursor: default; }

/* Date and time picker: compact, so it fits above the composer's Send later. */
.hb-dtp .hb-popover__body { gap: 10px; padding: 12px 12px 14px; }
.hb-dtp__head { display: flex; align-items: center; justify-content: space-between; padding-left: 6px; }
.hb-dtp__nav { display: inline-flex; gap: 2px; }
.hb-dtp__month { font: 600 13px/16px var(--font-sans); }
.hb-dtp__grid { display: flex; flex-direction: column; gap: 2px; }
.hb-dtp__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.hb-dtp__weekdays span { display: flex; align-items: center; justify-content: center; height: 24px; font: 500 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-day { position: relative; height: 32px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg); font: 400 13px/16px var(--font-sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.hb-day:hover, .hb-day.is-hover { background: var(--surface-raised-hover); }
.hb-day:active { background: var(--surface-raised-selected); }
.hb-day.is-today { box-shadow: inset 0 0 0 1px var(--control-off); font-weight: 600; }
.hb-day.is-selected { background: var(--primary); color: var(--fg-on-primary); font-weight: 600; box-shadow: none; }
.hb-day.is-selected:hover { background: var(--primary-hover); }
.hb-day.is-past { color: var(--fg-disabled); cursor: default; background: transparent; }
.hb-day.is-outside { pointer-events: none; }
.hb-dtp__time { flex-direction: row; align-items: center; gap: 12px; padding: 4px 6px 0; border-top: 1px solid var(--line); padding-top: 12px; }
.hb-dtp__time .hb-field__box { width: 88px; height: 32px; padding: 0 10px; }
.hb-dtp__time .hb-field__box input { font: 400 13px/16px var(--font-sans); font-variant-numeric: tabular-nums; }
.hb-dtp__summary { margin: -2px 0 0; padding: 0 6px; font: 400 12px/16px var(--font-sans); color: var(--fg-muted); }
.hb-dtp__summary--error { color: var(--danger); }
.hb-dtp .hb-popover__foot { padding: 10px 12px; }

/* Settings navigation. */
.hb-settingsnav .hb-folders__item { justify-content: space-between; }
.hb-settingsnav .hb-folders__item:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.hb-settingsnav__attn { display: inline-flex; color: var(--warning); }

/* HB-029: the palette list stops at 420px and scrolls. A 40px fade at an edge says more is there (here the bottom). */
.hb-palette__list { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 40px; }
.hb-palette__list.is-scrollable { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); padding-bottom: 0; }
.hb-palette__item--child { padding-left: 32px; }

/* Error toast: wraps to two lines at most (560px), the icon in `danger`, a close button. */
.hb-toast--error { height: auto; min-height: 40px; max-width: 560px; padding-top: 8px; padding-bottom: 8px; align-items: flex-start; }
.hb-toast--error .hb-toast__icon { color: var(--danger); flex-shrink: 0; margin-top: 3px; }
.hb-toast--error .hb-toast__text { padding-top: 3px; padding-bottom: 3px; font: 400 13px/18px var(--font-sans); text-wrap: pretty; }
.hb-toast--error .hb-btn, .hb-toast--error .hb-iconbtn { flex-shrink: 0; }
.hb-toast__close { margin-left: -6px; }

/* Brand lockup in the app (HB-073): the 3D icon is the only logo. On a screen with its own title, the word is quiet
   (text-heading) with 10px after the icon, as in the brand book's in-product mockup (ctx-welcome). The 0.4 x icon word
   of GUIDELINES.md 04 is for the About window and marketing. Clear space: a quarter of the icon on every side. */
.hb-lockup { display: flex; align-items: center; gap: 10px; }
.hb-brandicon { display: block; flex-shrink: 0; width: 48px; height: 48px; }
.hb-lockup__name { font: 600 14px/20px var(--font-sans); letter-spacing: -0.03em; color: var(--fg); }

/* First-run page (owner, 2026-11-11): optical center. The card is centered across the window, and its vertical
   center is at 45% of the window height: the frame is 90% high and centers the card. A card that does not fit grows
   the frame, so the card sits 24px from the top and the page scrolls. */
.hb-onboard-page { flex: 1; min-height: 0; overflow-y: auto; padding: 0 24px; background: var(--canvas); }
.hb-onboard-frame { height: 90%; min-height: max-content; box-sizing: border-box; padding: 24px 0; display: flex; align-items: center; justify-content: center; }
.hb-onboard-frame > .hb-onboard { flex-shrink: 0; }

/* Dialog: a line about a further loss ("2 unsent messages in the Outbox will be deleted.") and a third action at the left. */
.hb-dialog__detail { color: var(--fg); }
.hb-dialog__extra { margin-right: auto; }

/* Account color swatch (Settings, one account): the mark at 14px on a 32px target. */
.hb-swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.hb-swatch { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; cursor: pointer; }
.hb-swatch .hb-acct { width: 14px; height: 14px; }
.hb-swatch:hover, .hb-swatch.is-hover { background: var(--surface-hover); }
.hb-swatch[aria-checked="true"] { background: var(--surface-selected); box-shadow: inset 0 0 0 1.5px var(--fg-muted); }
.hb-swatch:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Sidebar (HB-086, sidebar.md): expanded 240px, collapsed = the rail. */
.hb-sidebar { width: var(--sidebar-width); flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.hb-sidebar--fill { width: 100%; border-right: 0; }
.hb-sidebar--overlay { position: absolute; top: 0; bottom: 0; left: var(--rail-width); z-index: 6; box-shadow: var(--shadow-popover); border-right: 0; }
.hb-sidebar__head { display: flex; align-items: center; gap: 6px; padding: 12px 10px 8px; }
.hb-sidebar__compose { flex: 1; justify-content: flex-start; }
.hb-sidebar__scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding: 4px 8px 8px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.hb-sidebar__label { padding: 16px 10px 4px; font: 500 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-sidebar__foot { display: flex; flex-direction: column; gap: 1px; padding: 8px; border-top: 1px solid var(--line); }
.hb-sidebar__foot .hb-kbds { opacity: 0; }
.hb-sidebar__foot .hb-folders__item:hover .hb-kbds, .hb-sidebar__foot .hb-folders__item:focus-visible .hb-kbds { opacity: 1; }
.hb-side__item { width: 100%; text-align: left; flex-shrink: 0; }
.hb-side__item:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.hb-side__item--d1 { padding-left: 30px; }
.hb-side__item--d2 { padding-left: 50px; }
.hb-side__acct { position: relative; display: flex; flex-shrink: 0; }
.hb-side__acct > .hb-side__item { padding-left: 30px; }
.hb-side__chev { position: absolute; left: 6px; top: 5px; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--fg-subtle); cursor: pointer; }
.hb-side__chev:hover { background: var(--surface-pressed); color: var(--fg); }
.hb-side__folders { position: relative; flex-shrink: 0; }
.hb-side__folder-menu { position: absolute; z-index: 3; top: calc(100% + 4px); left: 0; width: 100%; max-height: 300px; overflow-y: auto; }
.hb-menu__label--path { direction: rtl; text-align: left; }
.hb-side__folder-menu--above { top: auto; bottom: calc(100% + 4px); }
.hb-side__mark { display: inline-flex; justify-content: center; width: 15px; flex-shrink: 0; }
.hb-side__count--danger { color: var(--danger); }
.hb-side__health { display: inline-flex; color: var(--fg-muted); }
.hb-side__health--signin, .hb-side__health--cert, .hb-side__health--storage { color: var(--danger); }
.hb-side__health--offline, .hb-rail__badge.hb-side__health--offline { color: var(--warning); }
.hb-railbar__sep { width: 20px; height: 1px; flex-shrink: 0; margin: 6px 0; background: var(--line); }
.hb-rail--acct .hb-acct { width: 10px; height: 10px; }
.hb-rail__badge { position: absolute; right: 4px; bottom: 4px; display: inline-flex; border-radius: var(--radius-full); background: var(--rail-bg); padding: 1px; color: var(--fg-muted); }
.hb-rail__badge.hb-side__health--signin, .hb-rail__badge.hb-side__health--cert, .hb-rail__badge.hb-side__health--storage { color: var(--danger); }
.hb-listpane__scope { display: flex; align-items: center; gap: 6px; margin-bottom: -6px; font: 500 12px/16px var(--font-sans); color: var(--fg-muted); }
.hb-settingsnav { width: var(--sidebar-width); }
.hb-settingsnav__back { padding: 12px 2px 0; }
.hb-side__item--scope { color: var(--fg); font-weight: 600; }
.hb-listpane__back { margin: -4px 0 -4px -6px; }
.hb-listpane__title .hb-listpane__back + h2 { flex: 1; }
.hb-sidebar__title { padding: 16px 18px 0; }
.hb-sidebar__title h1 { margin: 0; }
.hb-sidebar--fill .hb-sidebar__compose { flex: 0 1 240px; }

/* The thread column stops at 820px and centers in a wide reader, so the two ends of a card row stay close
   (full-window check, HB-086). The toolbar stays full width. At 1280 the reader is narrower, so nothing changes. */
.hb-reader__scroll :is(.hb-threadhead, .hb-msg, .hb-fold, .hb-fold-group, .hb-replybar, .hb-reply, .hb-replydraft, .hb-banner), .hb-reader__scroll > div:not(.sc-host-x) { width: 100%; max-width: 820px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.hb-reader__scroll > div:not(.sc-host-x) :is(.hb-replybar, .hb-reply, .hb-replydraft) { max-width: none; }
/* A cut sidebar list fades at its edge, so it reads as a scroll, not a clip. */
.hb-sidebar__scroll { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent); }


/* The footer keeps active work available above the status line. The anchor includes the hover gap. */
.hb-sync-activity { position: relative; min-width: 0; }
.hb-sync-activity__trigger { display: flex; align-items: center; gap: 6px; border: 0; padding: 0; background: transparent; color: inherit; font: inherit; cursor: default; }
.hb-sync-activity__trigger:is(:hover, :focus-visible) { color: var(--fg); }
.hb-sync-activity__trigger:focus-visible { outline: 2px solid var(--accent-solid); outline-offset: 2px; border-radius: var(--radius-sm); }
.hb-sync-activity__anchor { position: absolute; bottom: 100%; left: 0; z-index: 4; padding-bottom: 8px; }
.hb-sync-activity__panel { box-sizing: border-box; width: 264px; max-width: calc(100vw - 16px); padding: 12px; border-radius: var(--radius-lg); display: grid; gap: 8px; text-align: left; font: 400 12px/16px var(--font-sans); }
.hb-sync-activity__panel strong { font: 600 13px/18px var(--font-sans); }
.hb-sync-activity__name { display: flex; align-items: center; gap: 6px; color: var(--fg); font: 400 13px/18px var(--font-sans); }
.hb-sync-activity__detail { margin-left: 14px; color: var(--fg-muted); overflow-wrap: anywhere; white-space: pre-line; }
/* Multi-select (owner 2026-11-12, "like Linear"): the floating action bar, the reader summary, the select-all offer. */
.hb-actionbar { position: relative; display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 6px 0 14px; border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-popover); --surface-hover: var(--surface-raised-hover); --surface-pressed: var(--surface-raised-selected); white-space: nowrap; }
.hb-actionbar__count { font: 500 13px/16px var(--font-sans); color: var(--fg); margin-right: 2px; }
.hb-actionbar__sep { width: 1px; height: 20px; margin: 0 6px; background: var(--line); flex: none; }
.hb-actionbar--compact { padding-left: 12px; }
.hb-actionbar__tipwrap { position: relative; display: inline-flex; }
.hb-actionbar__tip { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 3; }
.hb-actionbar__menu { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 3; }
.hb-selsum { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 360px; text-align: center; }
.hb-selsum__deck { position: relative; width: 340px; height: 84px; margin-bottom: 18px; }
.hb-selsum__card { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card); text-align: left; transform: translateY(calc(var(--i) * 10px)) scale(calc(1 - var(--i) * 0.05)); transform-origin: 50% 100%; z-index: calc(3 - var(--i)); }
.hb-selsum__card:not(:first-child) > * { visibility: hidden; }
.hb-selsum__from { display: flex; align-items: center; gap: 8px; font: 600 13px/18px var(--font-sans); color: var(--fg); }
.hb-selsum__subj { font: 400 13px/18px var(--font-sans); color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-selsum__title { font: 600 15px/22px var(--font-sans); color: var(--fg); }
.hb-selsum__detail { font: 400 13px/18px var(--font-sans); color: var(--fg-muted); text-wrap: pretty; }
.hb-selall { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 8px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--surface-raised); font: 400 12px/16px var(--font-sans); color: var(--fg-muted); text-align: center; }
.hb-selall__link { padding: 0; border: 0; background: none; font: 500 12px/16px var(--font-sans); color: var(--accent); cursor: pointer; border-radius: 2px; text-decoration: underline; text-underline-offset: 2px; }
.hb-selall__link:hover { text-decoration-thickness: 2px; }
.hb-actionbar__fixed { display: inline-grid; }
.hb-actionbar__fixed > * { grid-area: 1 / 1; }
.hb-actionbar__ghost { visibility: hidden; }
/* List header and view options (HB-129): title, a quiet count, the View options button; the popover; sticky group headers. */
.hb-listpane__title > h2 + .hb-listpane__count { margin-right: auto; }
.hb-listpane__count { font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-listpane__title > h2:has(+ .hb-listpane__count) { flex: none; }
.hb-listpane__viewbtn { position: relative; display: inline-flex; margin: -4px -6px -4px 0; }
.hb-listpane__viewbtn { --viewbtn-bg: var(--surface); }
.hb-listpane__viewbtn:has(.hb-iconbtn:hover), .hb-listpane__viewbtn:has(.is-hover) { --viewbtn-bg: var(--surface-hover); }
.hb-listpane__viewbtn:has(.hb-iconbtn--active) { --viewbtn-bg: var(--surface-selected); }
.hb-listpane__viewdot { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--accent-solid); box-shadow: 0 0 0 2px var(--viewbtn-bg); pointer-events: none; }
.hb-listpane__viewpop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 6; }
.hb-listpane__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hb-filterchip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 6px 0 10px; border: 0; border-radius: var(--radius-full); background: var(--surface-selected); font: 500 12px/16px var(--font-sans); color: var(--fg); cursor: pointer; }
.hb-filterchip:hover { background: var(--surface-pressed); }
.hb-filterchip .hb-icon, .hb-filterchip svg { color: var(--fg-muted); }
.hb-viewopt .hb-popover__body { gap: 0; padding: 6px 0 0; }
.hb-viewopt__section { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px 10px; }
.hb-viewopt__section + .hb-viewopt__section { border-top: 1px solid var(--line); }
.hb-viewopt__head { padding: 2px 0 6px; font: 500 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-viewopt__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.hb-viewopt__label { font: 400 13px/18px var(--font-sans); color: var(--fg); }
.hb-viewopt__only { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 2px; }
.hb-viewopt__chips { display: flex; gap: 6px; }
.hb-togglechip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: var(--radius-md); background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); font: 500 12px/16px var(--font-sans); color: var(--fg-muted); cursor: pointer; }
.hb-togglechip:hover { background: var(--surface-raised-hover); color: var(--fg); }
.hb-togglechip.is-on { background: var(--surface-raised-selected); box-shadow: inset 0 0 0 1px var(--fg-subtle); color: var(--fg); }
.hb-viewopt__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; border-top: 1px solid var(--line); }
.hb-viewopt__note { font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-group { position: relative; display: flex; align-items: baseline; gap: 8px; height: 28px; padding: 10px 16px 0; margin: 0; box-sizing: border-box; background: var(--surface); z-index: 1; }
.hb-group { transition: box-shadow calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-group--stuck { box-shadow: 0 1px 0 var(--line); transition-duration: 0ms; }
.hb-group__name { font: 600 12px/16px var(--font-sans); color: var(--fg-muted); }
.hb-group__count { font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-listend { padding: 14px 16px; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); text-align: center; }
/* HB-088: compose and Outbox states. */
.hb-sheet__notice { padding: 12px 16px 0; }
.hb-thread__time--scheduled, .hb-thread__time--waiting { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.hb-thread__time--waiting { color: var(--warning); font-weight: 500; }
.hb-sheet__status--danger { color: var(--danger); }
/* HB-102: the overlay scroll bar of the list and the reader. A 12px strip at the pane's right edge, over the content;
   the thumb is 4px at rest, 8px under the pointer or while dragged. Hidden until the view scrolls. */
.hb-scrollbar { position: absolute; top: 4px; bottom: 4px; right: 2px; width: 12px; border-radius: var(--radius-full); pointer-events: auto; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-scrollbar__thumb { position: absolute; right: 2px; width: 4px; min-height: 32px; border-radius: var(--radius-full); background: var(--control-off); transition: width calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard), background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard), opacity calc(var(--duration-slow) * var(--motion-scale)) var(--ease-standard); }
.hb-scrollbar.is-rest .hb-scrollbar__thumb { opacity: 0; }
.hb-scrollbar.is-hover, .hb-scrollbar.is-drag { background: var(--surface-hover); }
.hb-scrollbar.is-hover .hb-scrollbar__thumb { width: 8px; background: var(--control-hover); }
.hb-scrollbar.is-drag .hb-scrollbar__thumb { width: 8px; background: var(--fg-subtle); }
/* HB-092: old mail past the sync window. The list end line and a message whose body is not here. */
.hb-listend--offline, .hb-listend--error, .hb-listend--busy, .hb-listend--signin { color: var(--fg-muted); text-wrap: balance; }
.hb-listend__icon { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.hb-listend__action { margin-left: 6px; }
.hb-msg__pending { margin: 0; color: var(--fg-muted); }
.hb-msg__fetch { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.hb-msg__status { display: flex; align-items: center; gap: 8px; margin-top: 2px; font: 400 13px/18px var(--font-sans); color: var(--fg-subtle); }
.hb-msg__fetch .hb-msg__status { margin-top: 0; }
.hb-msg__status > svg { flex: none; }
.hb-msg__statustext { flex: 0 1 auto; }
.hb-msg__status .hb-selall__link { margin-left: -2px; }
.hb-reply__note { margin: -4px 18px 4px; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-seg__opt:disabled { color: var(--fg-disabled); cursor: default; }
.hb-menu--flip .hb-menu__reason { left: auto; right: calc(100% + 12px); }
/* The footer start may need two lines (long search footers, the narrowest list): the icon stays on the first line, the end text stays at the top. */
.hb-listpane__foot { gap: 12px; align-items: flex-start; }
.hb-listpane__footstart { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; text-wrap: balance; }
.hb-listpane__footstart > svg { flex: none; margin-top: 1px; }
/* A problem line is stronger than the calm progress line (as the list end lines). */
.hb-msg__status--offline, .hb-msg__status--failed, .hb-msg__status--busy, .hb-msg__status--deleted { color: var(--fg-muted); }
/* HB-008: the BottomBar (touch, compact width). 56px plus the bottom inset; items are 44px targets. */
.hb-bottombar { display: flex; align-items: center; gap: 4px; min-height: var(--bottom-bar); padding: 6px 8px calc(6px + var(--inset-bottom, 0px)); box-sizing: border-box; border-top: 1px solid var(--line); background: var(--surface); flex: none; }
.hb-bottombar__item { flex: 1; min-width: var(--touch-target); min-height: var(--touch-target); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg-muted); font: 500 12px/16px var(--font-sans); cursor: pointer; }
.hb-bottombar__item:active { background: var(--surface-pressed); color: var(--fg); }
.hb-bottombar__item:disabled { color: var(--fg-disabled); }
.hb-bottombar__status { flex: 1; min-width: 0; padding-left: 8px; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-bottombar__action { min-height: var(--touch-target); }
.hb-bottombar__item:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
/* Touch, compact width: the card header's own actions go to the BottomBar; the whole header is the tap target (44px or more). */
.hb-msg--touch .hb-msg__actions { display: none; }
.hb-msg--touch .hb-msg__toggle { pointer-events: none; }
/* HB-140: attachment tiles with thumbnails, and the previewer (Quick Look style). */
.hb-msg__tilerow { display: flex; align-items: flex-end; gap: 12px; }
.hb-msg__tiles { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.hb-msg__saveall { flex: none; margin-bottom: 10px; }
.hb-tile { position: relative; display: flex; flex-direction: column; width: 168px; border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-card); overflow: hidden; font: 400 13px/16px var(--font-sans); color: var(--fg); }
.hb-tile:hover, .hb-tile.is-hover { background: var(--surface-card-hover); }
.hb-tile:focus-visible, .hb-tile.hb-focus { outline: none; box-shadow: var(--shadow-focus); }
.hb-tile__thumb { position: relative; height: 104px; display: flex; align-items: center; justify-content: center; background: var(--surface-card-pressed); border-bottom: 1px solid var(--line); overflow: hidden; }
.hb-tile__img { position: absolute; inset: 0; animation: hb-tile-in calc(var(--duration-base) * var(--motion-scale)) var(--ease-standard); }
.hb-tile__pdf { position: absolute; inset: 12px 28px 0; display: flex; animation: hb-tile-in calc(var(--duration-base) * var(--motion-scale)) var(--ease-standard); }
@keyframes hb-tile-in { from { opacity: 0; } }
.hb-tile__page { flex: 1; display: flex; flex-direction: column; gap: 5px; padding: 12px 10px; border-radius: 2px 2px 0 0; box-shadow: 0 0 0 1px var(--line); }
.hb-tile__page i { display: block; height: 3px; border-radius: 2px; background: var(--tile-ink, var(--line-strong)); }
.hb-tile__generic { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--fg-muted); }
.hb-tile__ext { font: 500 12px/16px var(--font-sans); letter-spacing: 0.04em; color: var(--fg-subtle); }
.hb-tile__acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 0; border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-popover); opacity: 0; transition: opacity calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-tile:hover .hb-tile__acts, .hb-tile.is-hover .hb-tile__acts, .hb-tile:focus-within .hb-tile__acts, .hb-tile.hb-focus .hb-tile__acts { opacity: 1; transition-duration: 0ms; }
.hb-tile__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.hb-tile__bar > span { display: block; height: 100%; background: var(--accent-solid); transition: width calc(var(--duration-base) * var(--motion-scale)) var(--ease-linear); }
.hb-tile__foot { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; }
.hb-tile__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.hb-tile__size, .hb-tile__state { flex: none; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-tile__state--danger { color: var(--danger); }
.hb-tile--failed { box-shadow: 0 0 0 1px var(--danger); }
.hb-tile--unavailable .hb-tile__generic { color: var(--fg-subtle); }
.hb-tile--dragging { opacity: 0.6; }
.hb-tile__foot .hb-selall__link { flex: none; }
.hb-tiles-stack .hb-msg__tilerow { flex-direction: column; align-items: stretch; }
.hb-tiles-stack .hb-msg__tiles { flex-direction: column; }
.hb-tiles-stack .hb-msg__saveall { align-self: flex-end; margin-bottom: 0; }
.hb-tile-ghost { position: absolute; z-index: 30; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-popover); font: 400 13px/16px var(--font-sans); color: var(--fg); }
.hb-tile-ghost .hb-num { font-size: 12px; color: var(--fg-subtle); }
.hb-qv { position: absolute; left: 50%; top: 50%; width: min(85%, 1440px); height: min(85%, 960px); transform: translate(-50%, -50%); z-index: 20; display: flex; flex-direction: column; border-radius: var(--radius-xl); background: var(--surface-raised); box-shadow: var(--shadow-popover); overflow: hidden; color: var(--fg); font-family: var(--font-sans); animation: hb-qv-in calc(var(--duration-base) * var(--motion-scale)) var(--ease-enter); }
@keyframes hb-qv-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); } }
.hb-qv__bar { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.hb-qv__file { display: flex; align-items: baseline; gap: 8px; min-width: 0; color: var(--fg-muted); }
.hb-qv__file > svg { align-self: center; flex: none; }
.hb-qv__name { font: 500 13px/16px var(--font-sans); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hb-qv__meta { font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); white-space: nowrap; }
.hb-qv__count { flex: none; padding-left: 4px; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-qv__grow { flex: 1; }
.hb-qv__sep { width: 1px; height: 20px; margin: 0 2px; background: var(--line); }
.hb-qv__stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--surface); }
.hb-qv__content { position: relative; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; animation: hb-tile-in calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-qv__content--image > :first-child, .hb-qv__content--video > :first-child, .hb-qv__content--pdf > :first-child { box-shadow: var(--shadow-card); }
.hb-qv__content--image > :first-child, .hb-qv__content--video > :first-child { border-radius: var(--radius-sm); }
.hb-qv__content--video { width: 100%; max-width: 760px; }
.hb-qv__content--video > :first-child { width: 100%; }
.hb-qv__content--mail { width: 100%; max-width: 760px; align-items: stretch; }
.hb-qv__foot { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 10px; border-top: 1px solid var(--line); flex: none; }
.hb-qv__footmid { flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; min-width: 0; }
.hb-qv__pct { min-width: 44px; text-align: center; font: 500 12px/16px var(--font-sans); color: var(--fg-muted); }
.hb-qv__pages { padding: 4px 8px; border: 0; border-radius: var(--radius-md); background: transparent; font: 500 12px/16px var(--font-sans); color: var(--fg-muted); white-space: nowrap; cursor: pointer; }
.hb-qv__pages:hover { background: var(--surface-raised-hover); }
.hb-qv__zsep { width: 1px; height: 16px; background: var(--line); margin: 0 6px; }
.hb-qv__code { width: 100%; max-width: 860px; max-height: 100%; overflow: hidden; box-sizing: border-box; padding: 16px 0; border-radius: var(--radius-md); background: var(--canvas); box-shadow: var(--shadow-card); font: 400 13px/20px var(--font-mono); color: var(--fg); }
.hb-qv__code--prose { max-width: calc(60ch + 48px); padding: 20px 24px; font: 400 14px/22px var(--font-sans); }
.hb-qv__line { display: grid; grid-template-columns: 52px minmax(0, 1fr); white-space: pre; }
.hb-qv__code--prose .hb-qv__line, .hb-qv__code--wrap .hb-qv__line { white-space: pre-wrap; }
.hb-qv__code--prose .hb-qv__line { grid-template-columns: minmax(0, 1fr); }
.hb-qv__ln { padding-right: 16px; text-align: right; color: var(--fg-subtle); user-select: none; }
.hb-qv__note { display: flex; align-items: center; gap: 8px; margin: -4px 16px 12px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--surface-selected); font: 400 13px/18px var(--font-sans); color: var(--fg-muted); }
.hb-qv__cut { margin: 12px 16px 0; padding-top: 12px; border-top: 1px solid var(--line); font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-qv__audio { width: 360px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 24px 28px; border-radius: var(--radius-lg); background: var(--canvas); box-shadow: var(--shadow-card); }
.hb-qv__audioicon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 4px; border-radius: var(--radius-lg); background: var(--surface-selected); color: var(--fg-muted); }
.hb-qv__audioname { font: 500 13px/16px var(--font-sans); }
.hb-qv__audiolen { font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-qv__time { font: 400 12px/16px var(--font-sans); color: var(--fg-muted); white-space: nowrap; }
.hb-qv__scrub { flex: 1; max-width: 480px; height: 4px; border-radius: var(--radius-full); background: var(--control-off); position: relative; margin: 0 8px; }
.hb-qv__scrub > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--fg); }
.hb-qv__card { max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font: 400 14px/22px var(--font-sans); color: var(--fg-muted); text-wrap: balance; }
.hb-qv__cardicon { color: var(--fg-muted); }
.hb-qv__card--failed .hb-qv__cardicon, .hb-qv__card--cannotRead .hb-qv__cardicon { color: var(--danger); }
.hb-qv__card--busy .hb-qv__cardicon { color: var(--warning); }
.hb-qv__cardname { font: 600 15px/22px var(--font-sans); color: var(--fg); }
.hb-qv__carddetail { font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); margin-top: -8px; }
.hb-qv__cardacts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.hb-qv__progress { width: 240px; height: 2px; border-radius: var(--radius-full); background: var(--line); overflow: hidden; }
.hb-qv__progress > span { display: block; height: 100%; background: var(--accent-solid); }
.hb-qv__pw { width: 260px; text-align: left; }
.hb-qv__menu { position: absolute; top: 4px; right: 52px; z-index: 2; }
.hb-qv__toast { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 3; }
.hb-qv--compact { left: 0; top: 0; width: 100%; height: 100%; transform: none; border-radius: 0; animation: none; }
.hb-qv__navs { display: flex; gap: 0; }
.hb-qv--compact .hb-qv__stage { padding: 16px 12px; }
.hb-qv--compact .hb-qv__bar { padding: 0 6px 0 12px; gap: 2px; }
.hb-qv__code { align-self: flex-start; }
.hb-qv__loadline { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; font: 400 14px/22px var(--font-sans); color: var(--fg-muted); }
.hb-tile__ext--danger { letter-spacing: 0; color: var(--danger); }
.hb-tile__badge { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; height: 20px; padding: 0 8px 0 6px; border-radius: var(--radius-full); background: var(--surface-raised); box-shadow: var(--shadow-popover); font: 500 12px/16px var(--font-sans); color: var(--fg); }
.hb-tiles-stack .hb-tile { width: auto; align-self: stretch; }
.hb-tiles-stack .hb-tile__thumb { height: 140px; }
.hb-tile__badge .hb-selall__link { margin-left: 4px; }

/* Thread fold (HB-147, reading.md R11, ThreadFold README). No card surface, so it reads as a gap in the thread, not as a
   message. The dashed line runs on the avatar axis (18px padding + 16px) from the card above to the card below, through
   the 6px gaps; control-off is 3:1 on every ground, as the quote bars. The label starts at the sender-name column (60px). */
.hb-fold { position: relative; display: flex; align-items: center; gap: 4px; min-height: 40px; flex-shrink: 0; }
.hb-fold__axis { position: absolute; left: 33px; top: -6px; bottom: -6px; z-index: 1; width: 1px; background: repeating-linear-gradient(to bottom, var(--control-off) 0 3px, transparent 3px 6px); pointer-events: none; }
.hb-fold__main { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 60px; border: 0; border-radius: var(--radius-lg); background: transparent; color: var(--fg-muted); font: 400 12px/16px var(--font-sans); text-align: left; cursor: pointer; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-fold__main:hover, .hb-fold__main.is-hover { background: var(--surface-hover); transition-duration: 0ms; }
.hb-fold__main:active, .hb-fold__main.is-pressed { background: var(--surface-pressed); transition-duration: 0ms; }
.hb-fold__main.is-focus, .hb-fold__all.is-focus, .hb-fold__retry.is-focus { box-shadow: var(--shadow-focus); }
.hb-fold__faces { display: inline-flex; flex: none; }
/* The avatar keeps its 1px `line` edge; the 2px ring follows the ground (canvas, hover, pressed). */
.hb-fold__faces .hb-avatar { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 2px var(--canvas); }
.hb-fold__faces .hb-avatar + .hb-avatar { margin-left: -6px; }
.hb-fold__faces .hb-avatar { position: relative; }
.hb-fold__faces .hb-avatar:nth-child(1) { z-index: 2; }
.hb-fold__faces .hb-avatar:nth-child(2) { z-index: 1; }
.hb-fold__main:hover .hb-fold__faces .hb-avatar, .hb-fold__main.is-hover .hb-fold__faces .hb-avatar { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 2px var(--surface-hover); }
.hb-fold__main:active .hb-fold__faces .hb-avatar, .hb-fold__main.is-pressed .hb-fold__faces .hb-avatar { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 2px var(--surface-pressed); }
.hb-fold__count { flex: none; color: var(--fg); font: 500 13px/18px var(--font-sans); white-space: nowrap; }
.hb-fold__names { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-fold__what { flex: none; display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding-left: 8px; font-weight: 500; white-space: nowrap; }
/* With no "Show all", the chevron centers where the card chevrons do: 32px from the card edge (18px padding, a 28px button). */
.hb-fold:not(.hb-fold--partial) .hb-fold__main { padding-right: 25px; }
.hb-fold__main:hover .hb-fold__what, .hb-fold__main.is-hover .hb-fold__what, .hb-fold__main.is-focus .hb-fold__what { color: var(--fg); }
.hb-fold__all { flex: none; height: 28px; padding: 0 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg-muted); font: 500 12px/16px var(--font-sans); white-space: nowrap; cursor: pointer; }
.hb-fold__all:hover, .hb-fold__all.is-hover { background: var(--surface-hover); color: var(--fg); transition-duration: 0ms; }
.hb-fold__all:active, .hb-fold__all.is-pressed { background: var(--surface-pressed); }
.hb-fold__main--status { cursor: default; padding-top: 11px; padding-bottom: 11px; color: var(--fg-muted); font: 400 13px/18px var(--font-sans); text-wrap: pretty; }
.hb-fold--loading .hb-fold__main--status { color: var(--fg-subtle); }
.hb-fold__main--status > svg, .hb-fold__main--status > .hb-spinner-wrap { flex: none; align-self: flex-start; margin-top: 2px; }
.hb-fold__statustext { flex: 0 1 auto; min-width: 0; }
.hb-fold__retry { margin-left: 8px; }
/* A failure colors its icon `danger` and keeps the text muted, as the list footer and a failed file. Offline is a state: its icon stays muted. */
.hb-fold--error .hb-fold__main--status > svg { color: var(--danger); }
.hb-fold__tip { position: absolute; left: 60px; bottom: calc(100% + 4px); z-index: 3; }
.hb-fold-group { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.hb-fold__skel { display: flex; align-items: center; gap: 10px; height: 59px; padding: 0 18px; box-sizing: border-box; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card); --skeleton: var(--surface-card-pressed); }
.hb-fold__skelface { flex: none; width: 32px; height: 32px; }
.hb-fold__skellines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.hb-fold__skellines .hb-skel-block { height: 8px; }
/* Touch (a compact window with touch input): every target is at least touch-target (44px). */
.hb-fold--touch, .hb-fold--touch .hb-fold__main { min-height: 48px; }
.hb-fold--touch .hb-fold__all { height: var(--touch-target); padding: 0 12px; }
/* A phone column (about 366px) cannot hold the faces, the names and both actions: the fold keeps the count and the actions. */
.hb-fold--touch .hb-fold__faces, .hb-fold--touch .hb-fold__names { display: none; }
/* A collapsed row that was unread when the thread opened (HB-147): a 6px accent-solid dot before the time, as in the fold. */
.hb-msg__unread { flex: none; width: 6px; height: 6px; margin-right: 8px; border-radius: var(--radius-full); background: var(--accent-solid); }
.hb-msg.is-focus { box-shadow: var(--shadow-card), var(--shadow-focus); }

/* Files in compose (HB-151, compose.md C6; ComposeFile and DropTarget READMEs).
   The tray is pinned between the text and the footer: it never scrolls with the text, so every landing is in view. */
.hb-tray { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 0 16px 12px; flex-shrink: 0; }
.hb-tray__files { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
/* More than 2 rows: the tray scrolls inside and fades at its bottom edge, so the text keeps its room. */
.hb-tray--scroll .hb-tray__files { max-height: 116px; overflow: hidden; padding: 2px 2px 4px; margin: -2px -2px 0; -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, black calc(100% - 40px), transparent); }
.hb-tray__sum { flex: none; display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); white-space: nowrap; }
.hb-tray__sum--over { color: var(--fg-muted); }
.hb-tray__sum--over > svg { color: var(--warning); }
.hb-reply__foot .hb-tray__sum + .hb-reply__status { margin-left: 12px; }
.hb-reply .hb-tray { padding: 0 18px 10px; }
.hb-reply__notice { padding: 0 18px 10px; }

.hb-cfile { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; max-width: 264px; padding: 0 4px 0 6px; box-sizing: border-box; border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-card); color: var(--fg); outline: none; --surface-hover: var(--surface-card-hover); --surface-pressed: var(--surface-card-pressed); transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-cfile:hover, .hb-cfile.is-hover { background: var(--surface-card-hover); transition-duration: 0ms; }
.hb-cfile.is-focus, .hb-cfile:focus-visible { box-shadow: var(--shadow-card), var(--shadow-focus); }
.hb-cfile__thumb { position: relative; flex: none; width: 32px; height: 32px; overflow: hidden; border-radius: var(--radius-xs); background: var(--surface-card-pressed); }
.hb-cfile__img { position: absolute; inset: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: inherit; animation: hb-fade-in calc(var(--duration-base) * var(--motion-scale)) var(--ease-standard); }
.hb-cfile__pdf { position: absolute; inset: 4px 5px 0; display: flex; animation: hb-fade-in calc(var(--duration-base) * var(--motion-scale)) var(--ease-standard); }
.hb-cfile__page { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 5px 4px; border-radius: 2px 2px 0 0; box-shadow: 0 0 0 1px var(--line); }
.hb-cfile__page i { display: block; height: 2px; border-radius: 1px; background: var(--tile-ink, var(--line-strong)); }
.hb-cfile__type { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--fg-muted); }
/* The extension is decoration under the type icon (text-micro); the name already says the type. */
.hb-cfile__ext { font: 600 10px/12px var(--font-sans); letter-spacing: 0.02em; color: var(--fg-subtle); }
.hb-cfile__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.hb-cfile__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12px/16px var(--font-sans); color: var(--fg); }
.hb-cfile__meta { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-cfile__meta > svg { flex: none; }
.hb-cfile__retry { margin-left: 4px; }
.hb-cfile__acts { flex: none; display: inline-flex; align-items: center; }
/* Preview shows on hover and focus; Remove is always there (a file in your own message is yours to take out). */
.hb-cfile__eye { display: none; }
.hb-cfile:hover .hb-cfile__eye, .hb-cfile.is-hover .hb-cfile__eye, .hb-cfile.is-focus .hb-cfile__eye, .hb-cfile:focus-within .hb-cfile__eye { display: inline-flex; }
.hb-cfile__x { color: var(--fg-subtle); }
.hb-cfile__bar { position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; overflow: hidden; border-radius: 1px; }
.hb-cfile__bar > span { display: block; height: 100%; background: var(--accent-solid); transition: width calc(var(--duration-base) * var(--motion-scale)) var(--ease-linear); }
.hb-cfile--adding .hb-cfile__type, .hb-cfile--downloading .hb-cfile__type, .hb-cfile--offline .hb-cfile__type { color: var(--fg-subtle); }
/* A provider limit can be fixed (remove the file, or send from another account): warning. A file Hushbox cannot read: danger. */
.hb-cfile--warn { max-width: 304px; box-shadow: var(--shadow-card), 0 0 0 1px var(--warning); }
.hb-cfile--warn .hb-cfile__meta { color: var(--fg-muted); }
.hb-cfile--warn .hb-cfile__meta > svg { color: var(--warning); }
.hb-cfile--bad { box-shadow: var(--shadow-card), 0 0 0 1px var(--danger); }
.hb-cfile--bad .hb-cfile__meta { color: var(--danger); }
.hb-cfile--warn.is-focus, .hb-cfile--bad.is-focus { box-shadow: var(--shadow-card), var(--shadow-focus); }
.hb-cfile__tip { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 4; }
/* Touch: the chip is 44px high already; the remove target grows to touch-target. */
.hb-cfile--touch .hb-cfile__x { width: var(--touch-target); height: var(--touch-target); margin: 0 -6px 0 -8px; }

/* Motion (ComposeFile README "Motion"). Transforms and opacity only. `--i` is the stagger index (capped at 4). */
.hb-cfile--land, .hb-cfile--rise, .hb-cfile--drop { z-index: calc(6 - var(--i, 0)); animation: hb-cfile-land calc(var(--duration-slow) * var(--motion-scale)) var(--ease-enter) calc(var(--i, 0) * var(--stagger-enter) * var(--motion-scale)) both; }
.hb-cfile--rise { --dx: 0px; --dy: 8px; --s0: 0.92; }
.hb-cfile--drop { --dx: 0px; --dy: -8px; --s0: 0.92; }
@keyframes hb-cfile-land {
  from { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(var(--s0, 0.85)); opacity: 0; }
  50% { opacity: 1; }
  to { transform: none; opacity: 1; }
}
.hb-cfile--leave { pointer-events: none; animation: hb-cfile-leave calc(var(--duration-exit) * var(--motion-scale)) var(--ease-exit) both; }
@keyframes hb-cfile-leave { to { transform: scale(0.92); opacity: 0; } }

/* The drop target. Only while a drag with files is over the window. The wash hides the ground under it, so the card reads. */
.hb-drop { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; padding: 16px; pointer-events: none; border-radius: inherit; animation: hb-fade-in calc(var(--duration-fast) * var(--motion-scale)) var(--ease-enter) both; }
.hb-drop::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--drop-ground, var(--canvas)); opacity: 0.92; }
.hb-drop--armed::before { opacity: 0; }
/* Armed: the pill sits at the top of its pane, inside the frame, so it never covers a line of text. */
.hb-drop--armed { align-items: flex-start; padding-top: 24px; }
.hb-drop__frame { position: absolute; inset: 8px; border: 2px dashed var(--accent-solid); border-radius: var(--radius-lg); }
.hb-drop--armed .hb-drop__frame, .hb-drop--refuse .hb-drop__frame { border-width: 1px; border-color: var(--control-off); }
.hb-drop__card { position: relative; display: flex; align-items: center; gap: 12px; max-width: 420px; padding: 14px 20px 14px 14px; border-radius: var(--radius-xl); background: var(--surface-raised); box-shadow: var(--shadow-popover); animation: hb-drop-card calc(var(--duration-base) * var(--motion-scale)) var(--ease-enter) both; }
@keyframes hb-drop-card { from { opacity: 0; transform: translateY(4px) scale(0.96); } }
.hb-drop__icon { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--accent-on-soft); }
.hb-drop--refuse .hb-drop__icon { background: var(--surface-raised-selected); color: var(--fg-muted); }
.hb-drop__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hb-drop__title { font: 600 14px/20px var(--font-sans); color: var(--fg); }
.hb-drop__detail { display: inline-flex; align-items: center; gap: 6px; font: 400 13px/18px var(--font-sans); color: var(--fg-muted); text-wrap: pretty; }
.hb-drop__from { gap: 6px; color: var(--fg-subtle); font-size: 12px; line-height: 16px; margin-top: 2px; }
.hb-drop__warn { display: inline-flex; align-items: flex-start; gap: 6px; margin-top: 4px; font: 400 12px/16px var(--font-sans); color: var(--fg-muted); text-wrap: balance; }
.hb-drop__warn > svg { flex: none; margin-top: 2px; color: var(--warning); }
.hb-drop__pill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-full); background: var(--surface-raised); box-shadow: var(--shadow-popover); font: 500 12px/16px var(--font-sans); color: var(--fg-muted); }
.hb-drop--out { animation: hb-drop-out calc(var(--duration-exit) * var(--motion-scale)) var(--ease-exit) both; }
@keyframes hb-drop-out { to { opacity: 0; } }
/* The drop: the card sinks a little as it lets go and the wash fades; the files take over the motion. */
.hb-drop--release { animation: hb-drop-out calc(var(--duration-exit) * var(--motion-scale)) var(--ease-exit) both; }
.hb-drop--release .hb-drop__card { animation: hb-drop-release calc(var(--duration-exit) * var(--motion-scale)) var(--ease-exit) both; }
@keyframes hb-drop-release { to { transform: scale(0.97); } }
.hb-sheet { position: relative; }
.hb-sheet--full { width: 100%; max-width: none; height: 100%; border-radius: 0; }
.hb-sheet--full .hb-sheet__body { flex: 1; }
.hb-sheet--touch .hb-sheet__foot .hb-iconbtn, .hb-sheet--touch .hb-sheet__head .hb-iconbtn { width: var(--touch-target); height: var(--touch-target); }
.hb-sheet--touch .hb-sheet__foot { height: 64px; }

@media (prefers-reduced-motion: reduce) {
  .hb-cfile--land, .hb-cfile--rise, .hb-cfile--drop { animation: hb-fade-in var(--duration-exit) var(--ease-standard) both; }
  .hb-cfile--leave, .hb-drop--out, .hb-drop--release { animation-duration: var(--duration-exit); }
  .hb-drop, .hb-drop__card { animation-name: hb-fade-in; animation-duration: var(--duration-exit); }
}
:root[data-motion="reduced"] .hb-cfile--land, :root[data-motion="reduced"] .hb-cfile--rise, :root[data-motion="reduced"] .hb-cfile--drop { animation: hb-fade-in var(--duration-exit) var(--ease-standard) both; }
:root[data-motion="reduced"] .hb-cfile--leave, :root[data-motion="reduced"] .hb-drop--out, :root[data-motion="reduced"] .hb-drop--release { animation-duration: var(--duration-exit); }
:root[data-motion="reduced"] .hb-drop, :root[data-motion="reduced"] .hb-drop__card { animation-name: hb-fade-in; animation-duration: var(--duration-exit); }
.hb-sheet__foot, .hb-reply__foot { position: relative; }
.hb-sheet__sendtip { position: absolute; right: 12px; bottom: calc(100% + 6px); z-index: 4; }
.hb-reply__foot .hb-sheet__sendtip { right: 18px; }
.hb-reply__status { white-space: nowrap; }
/* A phone footer cannot hold the count and the draft status: the tray shows the files, so the count goes (not when it warns). */
.hb-reply--touch .hb-tray__sum:not(.hb-tray__sum--over) { display: none; }
/* While files land, the tray is above the drop target that lets go: only the card and the wash fade under the flight. */
.hb-tray--landing { z-index: 9; }
.hb-sheet__notice--files { padding: 0 16px 12px; }
/* Dark themes: a white page would be the brightest thing on screen; the page thumbnail sits one step back. */
[data-theme="dark"] .hb-cfile__page, [data-theme="system-dark"] .hb-cfile__page { opacity: 0.86; }
/* Under 480px (a phone), each file takes the tray width, so Remove lines up at the right edge. */
.hb-tray--touch .hb-cfile { flex: 1 1 100%; max-width: none; }
/* Touch footer: the count shows only when it warns, and then it takes the place of the draft status. */
.hb-reply--touch .hb-tray__sum--over + .hb-reply__status { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hb-cfile--leave { animation-name: hb-drop-out; }
  .hb-drop--release .hb-drop__card { animation: none; }
}
:root[data-motion="reduced"] .hb-cfile--leave { animation-name: hb-drop-out; }
:root[data-motion="reduced"] .hb-drop--release .hb-drop__card { animation: none; }

/* Calendar (product/journeys/calendar.md; docs/adr/0012). Colors: cal-* tokens from design/review/cal_colors.py. */
/* Workspace navigation shares one bottom anchor on Mail and Calendar. */
.hb-sidebar__more { padding: 0 8px 4px; }
.hb-sidebar__utilities { display: flex; align-items: center; gap: 4px; }
.hb-sidebar__utilities > .hb-side__item { flex: 1; min-width: 0; }
.hb-workspaces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; margin-bottom: 4px; }
.hb-workspaces__option { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 32px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg-muted); font: 500 13px/16px var(--font-sans); cursor: pointer; }
.hb-workspaces__option:hover { color: var(--fg); background: var(--surface-hover); }
.hb-workspaces__option[aria-current="page"] { color: var(--fg); background: var(--surface-selected); }
.hb-workspaces__option[aria-current="page"]::after { content: ""; position: absolute; width: 14px; height: 2px; bottom: 2px; left: calc(50% - 7px); border-radius: 1px; background: var(--fg-subtle); }
.hb-workspaces--compact .hb-workspaces__option[aria-current="page"]::after { width: 2px; height: 14px; left: 2px; bottom: calc(50% - 7px); }
.hb-workspaces__option:active { background: var(--surface-pressed); }
.hb-workspaces__option:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
@media (forced-colors: active) {
  .hb-workspaces__option[aria-current="page"]::after { forced-color-adjust: none; background: CanvasText; }
  .hb-workspaces__option:focus-visible { outline: 2px solid Highlight; outline-offset: -2px; }
}
.hb-railbar__footer { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.hb-workspaces--compact { grid-template-columns: 36px; gap: 4px; margin-bottom: 0; }
.hb-workspaces--compact .hb-workspaces__option { width: 36px; height: 36px; }
.hb-cal { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; background: var(--canvas); --cal-gutter: 64px; }

/* "Today" starts on the gutter line, where the day columns start. */
.hb-caltool { display: flex; align-items: center; gap: 8px; height: 56px; flex-shrink: 0; padding: 0 16px 0 var(--cal-gutter, 64px); }
.hb-caltool__steps { display: inline-flex; gap: 2px; }
.hb-caltool__title { margin: 0 0 0 6px; white-space: nowrap; }
.hb-caltool__year { font-weight: 400; color: var(--fg-subtle); }
.hb-caltool__sub { color: var(--fg-subtle); white-space: nowrap; padding-top: 3px; }
.hb-caltool__scope { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; padding: 0 2px 0 8px; height: 26px; border-radius: var(--radius-sm); background: var(--surface-hover); color: var(--fg-muted); white-space: nowrap; }
.hb-caltool__unscope { width: 22px; height: 22px; }
.hb-caltool__gap { flex: 1; }
.hb-caltool .hb-seg { align-self: center; }
.hb-caltool__search { width: 220px; margin-left: 4px; }

.hb-week { --cal-gutter: 64px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hb-week__head, .hb-week__allday, .hb-week__scroll { display: grid; }
.hb-week__head { height: 40px; align-items: center; padding-bottom: 4px; box-sizing: border-box; flex-shrink: 0; }
.hb-week__tz { color: var(--fg-subtle); text-align: right; padding-right: 10px; }
.hb-week__day { display: flex; align-items: center; gap: 6px; padding-left: 10px; font: 400 13px/20px var(--font-sans); color: var(--fg-muted); white-space: nowrap; overflow: hidden; }
.hb-week__num { display: inline-flex; align-items: center; justify-content: center; min-width: 0; height: 24px; margin-left: 0; font-weight: 600; color: var(--fg); }
.hb-week__day--past, .hb-week__day--past .hb-week__num { color: var(--fg-subtle); }
.hb-week__day--today .hb-week__wd { color: var(--accent); font-weight: 500; }
.hb-week__day--today .hb-week__num { box-sizing: border-box; min-width: 24px; padding: 0 4px; margin-left: -4px; border-radius: var(--radius-full); background: var(--cal-today); color: var(--cal-on-today); }

.hb-week__allday { flex-shrink: 0; grid-auto-rows: 24px; row-gap: 2px; padding: 2px 0 6px; border-bottom: 1px solid var(--line); position: relative; }
.hb-week__lanelabel { grid-column: 1; grid-row: 1; align-self: center; color: var(--fg-subtle); text-align: right; padding-right: 10px; white-space: nowrap; }
.hb-week__lanecell { border-left: 1px solid var(--line); margin: -2px 0 -6px; }
.hb-week__chip { position: relative; min-width: 0; padding: 0 3px 0 2px; }
.hb-week__more { justify-self: start; height: 20px; margin: 2px 0 0 4px; padding: 0 6px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--fg-muted); cursor: pointer; }
.hb-week__more:hover { background: var(--surface-hover); color: var(--fg); }

.hb-week__body { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.hb-week__scroll { position: relative; }
.hb-week__gutter { position: relative; }
.hb-week__hour { position: absolute; right: 10px; transform: translateY(-50%); color: var(--fg-subtle); white-space: nowrap; transition: opacity calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
/* M16: an hour label within 10px of the now label fades out. */
.hb-week__hour--near { opacity: 0; }
.hb-week__col { position: relative; border-left: 1px solid var(--line); }
.hb-week__col::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour-h); }
.hb-week__nowline { position: absolute; left: var(--cal-gutter); right: 0; height: 1px; margin-top: -0.5px; background: var(--accent-solid); opacity: 0.4; z-index: 40; pointer-events: none; }
.hb-week__now { position: absolute; left: -1px; right: 0; height: 2px; margin-top: -1px; background: var(--accent-solid); z-index: 41; pointer-events: none; }
.hb-week__now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--accent-solid); }
.hb-week__nowlabel { position: absolute; right: 6px; transform: translateY(-50%); padding: 0 4px; border-radius: var(--radius-xs); background: var(--canvas); color: var(--accent); font-weight: 500; white-space: nowrap; }

.hb-ev { position: absolute; box-sizing: border-box; display: flex; overflow: hidden; padding: 3px 6px 3px 9px; border-radius: var(--radius-xs); background: var(--ev-fill); color: var(--ev-ink); font: 400 12px/16px var(--font-sans); cursor: default; transition: background-color calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ev-bar); }
.hb-ev--stacked, .hb-ev--selected { --ev-seam: var(--canvas); }
.hb-ev--allday { position: relative; height: 24px; align-items: center; padding: 0 6px 0 9px; }
.hb-ev--contl { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.hb-ev--contl::before { display: none; }
.hb-ev--contr { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.hb-ev__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hb-ev__title { font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hb-ev__line { display: block; white-space: pre; overflow: hidden; }
.hb-ev__time, .hb-ev__where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The time and place lines under the title are text-axis (11/14). */
.hb-ev__text > .hb-ev__time, .hb-ev__text > .hb-ev__where { font-size: 11px; line-height: 14px; }
.hb-ev__title .hb-ev__time { font-weight: 400; }
.hb-ev--one { padding-top: 1px; padding-bottom: 1px; align-items: flex-start; }
.hb-ev--narrow { padding-left: 7px; padding-right: 3px; }
.hb-ev--narrow .hb-ev__text > .hb-ev__time, .hb-ev--narrow .hb-ev__where { display: none; }
.hb-ev__sync { position: absolute; top: 4px; right: 4px; display: inline-flex; }
.hb-ev__cut { display: inline-flex; align-self: center; margin: 0 4px 0 -3px; opacity: 0.8; }
.hb-ev__text + .hb-ev__cut { margin: 0 -2px 0 4px; }
.hb-ev--one .hb-ev__sync, .hb-ev--allday .hb-ev__sync { top: 50%; transform: translateY(-50%); }
.hb-ev:has(.hb-ev__sync) { padding-right: 18px; }
.hb-ev:hover, .hb-ev.is-hover { background: var(--ev-hover); transition-duration: 0ms; }
/* Pressed is a fill only: a scale blurs native text in Qt (M8). */
.hb-ev:active, .hb-ev.is-pressed { background: var(--ev-hover); }
/* Selected: one clear state, the indigo ring (M9, instant). The fill stays the Event's own. */
.hb-ev--selected, .hb-ev--selected:hover { outline: 2px solid var(--accent-solid); outline-offset: 1px; }
/* Past: the hue stays; fill and text step down (cal-N-past, cal-N-past-ink, still 7:1). */
.hb-ev--past { background: var(--ev-past); color: var(--ev-past-ink); }
.hb-ev--past::before { opacity: 0.5; }
.hb-ev--past:hover, .hb-ev--past.is-hover { background: var(--ev-fill); color: var(--ev-ink); }
/* States without a full fill keep a canvas ground, so a cascaded Event never shows the one under it through. */
/* Tentative: a quiet texture of the fill and hover tones (6px bands), so the text never sits on a high-contrast stripe. */
.hb-ev--tentative { --stripe-a: var(--ev-fill); --stripe-b: var(--ev-hover); }
.hb-ev--past.hb-ev--tentative { --stripe-a: var(--ev-past); --stripe-b: color-mix(in oklch, var(--ev-past) 55%, var(--canvas)); }
.hb-ev--tentative:is(:hover, .is-hover, :active, .is-pressed) { --stripe-a: var(--ev-hover); --stripe-b: color-mix(in oklch, var(--ev-hover) 30%, var(--ev-fill)); color: var(--ev-ink); }
.hb-ev.hb-ev--tentative, .hb-ev--tentative:is(:hover, .is-hover, :active, .is-pressed) { background: repeating-linear-gradient(-45deg, var(--stripe-a) 0 6px, var(--stripe-b) 6px 12px); }
.hb-ev--none { background: var(--canvas); --ev-edge: var(--ev-bar); }
.hb-ev--none::before { display: none; }
.hb-ev--none:hover, .hb-ev--none.is-hover { background: var(--ev-fill); }
.hb-ev--declined { background: var(--canvas); color: var(--fg-subtle); --ev-edge: var(--line-strong); }
.hb-ev--declined::before { display: none; }
.hb-ev--declined .hb-ev__title { text-decoration: line-through; text-decoration-thickness: 1px; }
.hb-ev--declined:hover, .hb-ev--declined.is-hover { background: var(--surface-hover); }
.hb-ev--past.hb-ev--none { background: var(--canvas); --ev-edge: var(--line-strong); }
/* Keep the response edge inside the Event and the selection ring outside, including in a cascade. */
.hb-ev:is(.hb-ev--none, .hb-ev--declined, .hb-ev--stacked, .hb-ev--selected) { box-shadow: inset 0 0 0 1px var(--ev-edge, transparent), 0 0 0 1px var(--ev-seam, transparent); }

.hb-mini { padding: 4px 0 4px; flex-shrink: 0; }
.hb-mini__head { display: flex; align-items: center; gap: 2px; height: 28px; padding-left: 10px; margin-bottom: 2px; }
.hb-mini__title { flex: 1; color: var(--fg); }
.hb-mini__grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 1px; }
.hb-mini__wd { height: 20px; display: flex; align-items: center; justify-content: center; color: var(--fg-subtle); }
.hb-mini__day { position: relative; z-index: 0; display: flex; flex-direction: column; align-items: center; height: 28px; padding: 2px 0 0; border: 0; background: transparent; font: 400 12px/16px var(--font-sans); color: var(--fg); cursor: pointer; }
.hb-mini__num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--radius-full); }
.hb-mini__day:hover .hb-mini__num, .hb-mini__day.is-hover .hb-mini__num { background: var(--surface-hover); }
.hb-mini__day--out { color: var(--fg-subtle); }
.hb-mini__day--week { background: var(--surface-selected); }
.hb-mini__day--week:hover .hb-mini__num, .hb-mini__day--week.is-hover .hb-mini__num { background: var(--surface-pressed); }
.hb-mini__day--wstart { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.hb-mini__day--wend { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.hb-mini__day--today .hb-mini__num, .hb-mini__day--today:hover .hb-mini__num { background: var(--cal-today); color: var(--cal-on-today); font-weight: 600; }
/* Busy: up to three 3px dots in fg-subtle; one look for every Account (monochrome). */
.hb-mini__busy { display: flex; gap: 2px; height: 3px; margin-top: 1px; }
.hb-mini__busy i { width: 3px; height: 3px; border-radius: var(--radius-full); background: var(--fg-subtle); }

.hb-callist { display: flex; flex-direction: column; gap: 1px; }
.hb-callist__row { position: relative; cursor: default; }
.hb-callist__check { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 13px; height: 13px; border-radius: var(--radius-xs); border: 1.5px solid var(--ev-bar); color: var(--ev-on-bar); }
.hb-callist__check--on { background: var(--ev-bar); }
.hb-callist__name--off { color: var(--fg-subtle); }
.hb-callist__muted { display: inline-flex; color: var(--fg-subtle); }
.hb-callist__menu { position: absolute; right: 2px; top: 2px; opacity: 0; }
/* The menu button takes the place of the trailing mark under the pointer, so nothing moves. */
.hb-callist__row:hover .hb-callist__muted, .hb-callist__row.is-hover .hb-callist__muted, .hb-callist__row.is-open .hb-callist__muted, .hb-callist__row:focus-within .hb-callist__muted { visibility: hidden; }
.hb-callist__row:hover .hb-callist__menu, .hb-callist__row.is-hover .hb-callist__menu, .hb-callist__row.is-open .hb-callist__menu, .hb-callist__menu:focus-visible { opacity: 1; }
.hb-callist__row.is-open { background: var(--surface-hover); color: var(--fg); }
.hb-callist__pop { position: absolute; z-index: 3; top: calc(100% + 4px); left: 24px; width: 200px; }

/* HB-158 rich text in the composer (product/journeys/rich-text.md; FormatBar, RichText, LinkPopover READMEs). */
/* The formatting bar: one 40px row directly above the footer. It shares the footer's hairline, so bar and footer read as one control zone; the text above stays clean. */
.hb-fmt { display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 12px; border-top: 1px solid var(--line); flex-shrink: 0; }
.hb-reply .hb-fmt { padding: 0 10px 0 12px; }
.hb-sheet__foot--fmt, .hb-reply__foot--fmt { border-top: 0; }
.hb-sheet__foot--fmt { height: 52px; }
.hb-fmt__slot { position: relative; display: inline-flex; }
.hb-fmt__sep { width: 1px; height: 16px; margin: 0 6px; background: var(--line); flex-shrink: 0; }
.hb-fmt__btn { color: var(--fg-muted); }
.hb-fmt__btn.is-on, .hb-fmt__toggle.is-on { background: var(--surface-pressed); color: var(--fg); }
.hb-fmt__btn.is-pressed, .hb-fmt__btn:active { background: var(--surface-pressed); color: var(--fg); }
.hb-fmt__btn.is-open { background: var(--surface-pressed); color: var(--fg); }
.hb-fmt__btn[aria-disabled="true"], .hb-fmt__style[aria-disabled="true"] { color: var(--fg-disabled); background: transparent; cursor: default; }
.hb-fmt__style { display: inline-flex; align-items: center; gap: 4px; height: var(--control-sm); padding: 0 6px 0 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--fg-muted); font: 500 12px/16px var(--font-sans); cursor: pointer; white-space: nowrap; }
.hb-fmt__style:hover, .hb-fmt__style.is-hover { background: var(--surface-hover); color: var(--fg); }
.hb-fmt__style.is-pressed, .hb-fmt__style.is-open, .hb-fmt__style:active { background: var(--surface-pressed); color: var(--fg); }
.hb-fmt__style.is-open .hb-fmt__chev { transform: rotate(180deg); }
.hb-fmt__chev { color: var(--fg-subtle); transition: transform calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-fmt__end { margin-left: auto; }
.hb-fmt__mode { height: var(--control-sm); padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--fg-muted); font: 500 12px/16px var(--font-sans); cursor: pointer; white-space: nowrap; }
.hb-fmt__mode:hover, .hb-fmt__mode.is-hover { background: var(--surface-hover); color: var(--fg); }
.hb-fmt__mode.is-on, .hb-fmt__mode.is-pressed, .hb-fmt__mode:active { background: var(--surface-pressed); color: var(--fg); }
.hb-fmt__tip { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 6; pointer-events: none; }
.hb-fmt__tip--left { left: 0; transform: none; }
.hb-fmt__tip--right { left: auto; right: 0; transform: none; }
.hb-fmt__menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 6; }
.hb-fmt__menu--end { left: auto; right: 0; }
.hb-fmt__menu .hb-menu { transform-origin: bottom left; }
.hb-fmt--enter { animation: hb-fmt-in calc(var(--duration-base) * var(--motion-scale)) var(--ease-enter) both; }
@keyframes hb-fmt-in { from { height: 0; opacity: 0; } to { height: 40px; opacity: 1; } }
/* The footer label in plain-text mode: a quiet tag, a button that switches back. */
.hb-plainlabel { display: inline-flex; align-items: center; height: 20px; margin-left: 6px; padding: 0 6px; border: 0; border-radius: var(--radius-sm); background: var(--surface-hover); color: var(--fg-muted); font: 500 12px/16px var(--font-sans); cursor: pointer; white-space: nowrap; }
.hb-plainlabel:hover, .hb-plainlabel.is-hover { background: var(--surface-pressed); color: var(--fg); }
.hb-reply .hb-plainlabel { background: var(--surface-card-hover); }
.hb-reply .hb-plainlabel:hover, .hb-reply .hb-plainlabel.is-hover { background: var(--surface-card-pressed); }

/* The text. One measure (60ch), one body size; headings use text-title and text-subtitle; nothing is colored but links. */
.hb-sheet__body--rich { display: block; position: relative; max-width: none; }
.hb-reply__body--rich { position: relative; max-width: none; }
.hb-rt { display: flex; flex-direction: column; gap: 10px; font: 400 14px/22px var(--font-sans); color: var(--fg); text-wrap: pretty; }
.hb-rt__chunk { display: contents; }
.hb-rt__chunk > * { max-width: 60ch; }
.hb-rt p, .hb-rt h1, .hb-rt h2, .hb-rt ul, .hb-rt ol, .hb-rt blockquote, .hb-rt pre { margin: 0; }
.hb-rt h1 { font: 600 20px/28px var(--font-sans); letter-spacing: -0.01em; margin-top: 6px; }
.hb-rt h2 { font: 600 15px/22px var(--font-sans); margin-top: 4px; }
.hb-rt__chunk:first-child > h1:first-child, .hb-rt__chunk:first-child > h2:first-child { margin-top: 0; }
.hb-rt strong { font-weight: 600; }
.hb-rt s { text-decoration-thickness: 1px; }
.hb-rt ul, .hb-rt ol { padding-left: 24px; display: flex; flex-direction: column; gap: 4px; }
.hb-rt li { padding-left: 2px; }
.hb-rt li > ul, .hb-rt li > ol { margin-top: 4px; }
.hb-rt ul { list-style: disc; }
.hb-rt ul ul { list-style: circle; }
.hb-rt ul ul ul { list-style: square; }
.hb-rt ol { list-style: decimal; }
.hb-rt ol ol { list-style: lower-alpha; }
.hb-rt ol ol ol { list-style: lower-roman; }
.hb-rt li::marker { color: var(--fg-subtle); font-variant-numeric: tabular-nums; }
.hb-rt blockquote { padding-left: 14px; border-left: 2px solid var(--line-strong); color: var(--fg-muted); display: flex; flex-direction: column; gap: 6px; }
.hb-rt code { padding: 1px 4px; border-radius: var(--radius-xs); background: var(--surface-pressed); font: 400 13px/20px var(--font-mono); }
.hb-rt pre { padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--line); font: 400 13px/20px var(--font-mono); white-space: pre; overflow: hidden; }
.hb-rt pre code { padding: 0; background: none; }
.hb-rt a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.hb-rt a.is-hover, .hb-rt a:hover { text-decoration-thickness: 2px; }
.hb-rt .hb-sel { background: var(--highlight); color: inherit; border-radius: 1px; }
.hb-rt .hb-typed { white-space: pre; }
.hb-caret { display: inline-block; width: 1px; height: 18px; margin: 0 -0.5px; vertical-align: -4px; background: var(--fg); }
.hb-rt h1 .hb-caret { height: 24px; vertical-align: -5px; }
.hb-rt pre .hb-caret { height: 16px; vertical-align: -3px; }
.hb-rt__placeholder { color: var(--fg-subtle); }
.hb-rt--empty p { display: flex; align-items: center; }
.hb-rt__pasting { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-subtle); font: 400 12px/22px var(--font-sans); }
.hb-rt__pasting-esc::before { content: "\00b7"; margin-right: 8px; }
.hb-rt__fold { margin-top: 2px; }
.hb-reply .hb-rt code { background: var(--surface-card-pressed); }
.hb-reply .hb-rt pre { background: var(--surface-card-hover); }

/* An image in the text. Selected: the accent ring and a small bar of three actions, top right, inside the picture. */
.hb-rt__img { position: relative; margin: 2px 0; max-width: 100%; border-radius: var(--radius-md); }
.hb-rt__pic { display: block; width: 100%; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--line); }
/* Hover shows the image's actions at once (as Notion and Slack); only a selection draws the accent outline. */
.hb-rt__img.is-hover { box-shadow: 0 0 0 1px var(--line-strong); }
.hb-rt__img.is-selected { box-shadow: 0 0 0 2px var(--accent-solid); }
.hb-rt__img.is-focus { box-shadow: var(--shadow-focus); }
.hb-rt__imgbar { position: absolute; top: 8px; right: 8px; display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-popover); --surface-hover: var(--surface-raised-hover); --surface-pressed: var(--surface-raised-selected); }
.hb-rt__imgtip { position: absolute; right: 8px; top: 44px; z-index: 6; }
.hb-rt__imgmenu { position: absolute; left: 40%; top: 46%; z-index: 6; }

/* The kept HTML quote: one block with the quote line and the sender's layout beside a bar. Its actions show on hover and focus. */
.hb-hquote { position: relative; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.hb-hquote__head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.hb-hquote__line { flex: 1; min-width: 0; font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); }
.hb-hquote__fwd { font-weight: 500; color: var(--fg-muted); }
.hb-hquote__acts { display: inline-flex; gap: 2px; opacity: 0; transition: opacity calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-hquote__acts.is-shown { opacity: 1; transition-duration: 0ms; }
.hb-hquote__frame { border-left: 2px solid var(--line-strong); padding-left: 14px; overflow: hidden; }
.hb-hquote.is-hover .hb-hquote__frame, .hb-hquote.is-focus .hb-hquote__frame { border-left-color: var(--fg-subtle); }
.hb-hquote.is-focus { border-radius: var(--radius-sm); box-shadow: var(--shadow-focus); }
.hb-hquote__tip { position: absolute; right: 0; top: -34px; z-index: 6; }

/* Links. The insert Popover: one row (Address, Apply) for a selection; Text and Address with no selection. The card: the address and three icon buttons. */
.hb-linkpop { width: 360px; padding: 8px; border-radius: var(--radius-lg); }
.hb-linkpop__row { display: flex; align-items: flex-start; gap: 8px; }
.hb-linkpop__row .hb-field { flex: 1; min-width: 0; }
.hb-linkpop__row .hb-field__box { height: 32px; padding: 0 10px; }
.hb-linkpop__row .hb-btn { height: 32px; }
.hb-linkpop .hb-field__box input { font-size: 13px; }
.hb-linkpop--two { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.hb-linkpop--two .hb-field__box { height: 34px; }
.hb-linkpop__foot { display: flex; justify-content: flex-end; gap: 8px; }
.hb-linkcard { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 4px 0 10px; border-radius: var(--radius-lg); max-width: 420px; }
.hb-linkcard__icon { color: var(--fg-subtle); flex-shrink: 0; }
.hb-linkcard__addr { min-width: 0; font: 400 12px/16px var(--font-sans); color: var(--fg-muted); white-space: nowrap; overflow: hidden; }
.hb-linkcard__acts { display: inline-flex; gap: 2px; padding-left: 4px; border-left: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .hb-fmt--enter { animation: hb-fade-in var(--duration-exit) var(--ease-standard) both; } }
:root[data-motion="reduced"] .hb-fmt--enter { animation: hb-fade-in var(--duration-exit) var(--ease-standard) both; }
.hb-sheet, .hb-reply { position: relative; }
.hb-rt-overlay { position: absolute; z-index: 7; }
.hb-sheet--fixed .hb-sheet__body { flex: 1 1 0; min-height: 0; overflow: hidden; }
.hb-reply .hb-fmt, .hb-reply .hb-fmt__toggle, .hb-reply .hb-linkcard { --surface-hover: var(--surface-card-hover); --surface-pressed: var(--surface-card-pressed); }
.hb-reply .hb-linkcard, .hb-reply .hb-linkpop { --surface-hover: var(--surface-raised-hover); --surface-pressed: var(--surface-raised-selected); }
.hb-rt .hb-qline { font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); margin-bottom: -2px; }
.hb-fmt__note { font: 400 12px/16px var(--font-sans); color: var(--fg-subtle); padding-left: 4px; }
.hb-sheet__status--icon { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-muted); }
.hb-sheet__status--icon .hb-icon { flex-shrink: 0; }
.hb-linkcard .hb-fmt__tip { bottom: auto; top: calc(100% + 6px); }

/* Counts: new mail since you last looked (HB-159, notifications.md C1–C7). The rail's Unified Inbox carries the total in a small
   neutral box (NS5): the sidebar count's ink (fg, tabular figures) on surface-selected, radius 4. It sits above the icon's top edge
   (the inbox glyph starts 3px into the 18px icon) and inside the 52px rail at "99+". The Outbox box is danger ink. */
.hb-rail__num { position: absolute; top: -3px; right: -3px; min-width: 14px; height: 14px; padding: 0 3px; box-sizing: border-box; border-radius: var(--radius-xs); background: var(--surface-selected); color: var(--fg); font: 600 10px/14px var(--font-sans); font-variant-numeric: tabular-nums; text-align: center; pointer-events: none; }
.hb-rail__num--danger { color: var(--danger); }
/* An account mark with new mail: the 6px accent dot joins the account dot's top-right edge (2px overlap) and its 2px ring of the
   rail ground cuts into the mark, so the two read as one mark, not two dots side by side. */
.hb-rail--acct .hb-rail__count { top: 9px; right: 9px; }
/* A folder with unread mail: its name in 600 weight, no number (C4 table "Sidebar, other mailboxes"). */
.hb-side__item--unread .hb-folders__name, .hb-menu__item--unread .hb-menu__label { font-weight: 600; color: var(--fg); }

/* HB-167 drag to act. The bar becomes the drop zone: the same container, taller; the five actions become targets in place.
   Drop look everywhere (zone target, sidebar row, folder menu item): hot = accent-soft with accent-on-soft; Delete hot = danger
   on surface-raised-selected; refuse = no fill, the reason on the stack. No dashed frames, no dim over the window. */
.hb-actionbar--zone { height: 88px; padding: 8px; gap: 4px; border-radius: var(--radius-xl); background: var(--surface-raised); box-shadow: var(--shadow-popover); }
.hb-dropzone__target { position: relative; box-sizing: border-box; min-width: 112px; height: 72px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--fg-muted); font: 500 12px/16px var(--font-sans); }
/* The fill is its own layer: hot and receive scale the fill only, so the icon and the label never scale (QML NativeRendering text stays sharp). */
.hb-dropzone__fill { position: absolute; inset: 0; border-radius: var(--radius-md); background: var(--surface-raised-hover); transition: transform calc(var(--duration-fast) * var(--motion-scale)) var(--ease-enter); }
.hb-dropzone__target > svg, .hb-dropzone__label { position: relative; }
.hb-dropzone__label { color: var(--fg); }
.hb-dropzone__target.is-hot { color: var(--accent-on-soft); }
.hb-dropzone__target.is-hot .hb-dropzone__fill { background: var(--accent-soft); transform: scale(1.04); }
.hb-dropzone__target.is-hot .hb-dropzone__label { color: var(--accent-on-soft); }
.hb-dropzone__target--danger.is-hot { color: var(--danger-on-soft); }
.hb-dropzone__target--danger.is-hot .hb-dropzone__fill { background: var(--danger-soft); }
.hb-dropzone__target--danger.is-hot .hb-dropzone__label { color: var(--danger-on-soft); }
.hb-dropzone__target.is-received .hb-dropzone__fill { transform: scale(0.96); }
.hb-dropzone__target.is-disabled { color: var(--fg-disabled); }
.hb-dropzone__target.is-disabled .hb-dropzone__fill { background: transparent; }
.hb-dropzone__target.is-disabled .hb-dropzone__label { color: var(--fg-disabled); }
.hb-actionbar--zone.hb-actionbar--compact .hb-dropzone__target { min-width: 0; width: 64px; height: 56px; padding: 0; }
.hb-actionbar--zone.hb-actionbar--compact { height: 72px; }
.hb-dragstack { position: relative; width: 280px; height: 34px; pointer-events: none; }
/* Over a target the cards under the top card fan out (they hold no text); the top card and the badge stay at 0 degrees, so NativeRendering text never rotates. */
.hb-dragstack--hot .hb-dragstack__card:nth-child(2), .hb-dragstack--danger .hb-dragstack__card:nth-child(2) { transform: translateY(5px) scale(0.96) rotate(-2deg); }
.hb-dragstack--hot .hb-dragstack__card:nth-child(3), .hb-dragstack--danger .hb-dragstack__card:nth-child(3) { transform: translateY(10px) scale(0.92) rotate(-4deg); }
.hb-dragstack__card { position: absolute; left: 0; top: 0; box-sizing: border-box; width: 280px; height: 34px; border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: var(--shadow-popover); transform: translateY(calc(var(--i) * 5px)) scale(calc(1 - var(--i) * 0.04)); transform-origin: 50% 100%; z-index: calc(3 - var(--i)); font: 400 13px/16px var(--font-sans); white-space: nowrap; overflow: hidden; }
.hb-dragstack__card:not(:first-child) > * { visibility: hidden; }
.hb-dragstack__face, .hb-dragstack__verb { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; transition: opacity calc(var(--duration-fast) * var(--motion-scale)) var(--ease-standard); }
.hb-dragstack__verb { justify-content: center; padding: 0 12px; font-weight: 500; color: var(--fg); }
.hb-dragstack--hot .hb-dragstack__card:first-child .hb-dragstack__face, .hb-dragstack--danger .hb-dragstack__card:first-child .hb-dragstack__face, .hb-dragstack--refuse .hb-dragstack__card:first-child .hb-dragstack__face, .hb-dragstack--spring .hb-dragstack__card:first-child .hb-dragstack__face { opacity: 0; }
.hb-dragstack__verbtext { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hb-dragstack__note { color: var(--fg-muted); font-weight: 400; }
.hb-dragstack--hot .hb-dragstack__verb > svg { color: var(--accent); }
.hb-dragstack--danger .hb-dragstack__verb > svg { color: var(--danger-on-soft); }
.hb-dragstack--refuse .hb-dragstack__verb, .hb-dragstack--spring .hb-dragstack__verb { color: var(--fg-muted); font-weight: 400; }
.hb-dragstack__from { flex: none; max-width: 110px; overflow: hidden; text-overflow: ellipsis; font-weight: 400; color: var(--fg-subtle); }
.hb-dragstack__subj { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--fg-subtle); }
/* The card keeps its row's text styles (a checked row: read in fg-subtle, unread in 600 fg), so the lift changes no glyph. */
.hb-dragstack__card--unread :is(.hb-dragstack__from, .hb-dragstack__subj) { font-weight: 600; color: var(--fg); }
.hb-dragstack__face--grid > * { position: absolute; top: 8px; line-height: 18px; }
.hb-dragstack__face--grid > .hb-avatar { left: 8px; top: 7px; }
.hb-dragstack__face--grid > .hb-dragstack__from { max-width: none; }
.hb-dragstack__face--grid > .hb-dragstack__mark { top: 13px; line-height: 0; }
.hb-dragstack__count { position: absolute; z-index: 4; top: -8px; right: -8px; box-sizing: border-box; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--primary); color: var(--fg-on-primary); font: 600 12px/20px var(--font-sans); text-align: center; box-shadow: var(--shadow-card); }
/* HB-167 lift: the card holds the row's avatar, sender, subject and dot (they go to 0); the rest of the row stays at 40%. */
.hb-thread.hb-thread--lifted :is(.hb-avatar, .hb-thread__name, .hb-thread__subject, .hb-thread__meta > .hb-acct) { opacity: 0; }
.hb-thread.hb-thread--lifted :is(.hb-thread__lead, .hb-thread__count, .hb-thread__snippet, .hb-thread__meta > :not(.hb-acct)) { opacity: 0.4; }
.hb-side__item--drop-hot, .hb-side__item--drop-hot:hover { background: var(--accent-soft); color: var(--accent-on-soft); }
.hb-side__item--drop-hot .hb-folders__count { color: var(--accent-on-soft); }
.hb-side__item--drop-spring { background: var(--surface-hover); color: var(--fg); }
.hb-menu__item--drop-hot, .hb-menu__item--drop-hot:hover { background: var(--accent-soft); color: var(--accent-on-soft); }
.hb-menu__item--drop-hot .hb-menu__meta { color: var(--accent-on-soft); }
.hb-palette__mark--many { width: auto; min-width: 16px; gap: 3px; }
