:root {
  /* Verified against HEY's public app colors and typography, not its marketing fonts. */
  --canvas: #f3f1ef;
  --paper: #fff;
  --ink: #231c33;
  --muted: #6c6677;
  --line: #231c3326;
  --green: #299850;
  --green-soft: #d7efde;
  --lime: #9dffec;
  --blue: #0074e4;
  --blue-soft: #e0eaf9;
  --purple: #5522fa;
  --purple-soft: #e5dfff;
  --coral: #f95c5c;
  --amber: #856000;
  --amber-soft: #fff5ca;
  --red: #c92400;
  --shadow: 0 8px 36px #231c330a, 0 1px 3px #231c3310;
  --body-font: -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", Helvetica, Arial, sans-serif;
  --heading-font: var(--body-font);
}
* { box-sizing: border-box; }
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; color: var(--ink); font-family: var(--body-font); font-size: 14px; background: radial-gradient(ellipse at 10% 0, #9dffec22 0, transparent 45%), radial-gradient(ellipse at 100% 80%, #5522fa08 0, transparent 45%), var(--canvas); min-height: 100vh; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
button { border: 0; background: none; }
a { color: var(--blue); }
svg { width: 18px; height: 18px; stroke-width: 1.6; flex-shrink: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 50; padding: 12px 20px; background: var(--paper); }
.skip-link:focus { top: 12px; }
.masthead { max-width: 1160px; padding: 28px 40px 20px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { font-family: var(--heading-font); font-weight: 700; text-decoration: none; color: var(--green); font-size: 31px; letter-spacing: -2px; transform: rotate(-3deg); white-space: nowrap; }
.wordmark > span:last-child { font-weight: 500; font-size: 25px; letter-spacing: -1.5px; }
.wordmark-comma { color: #72957a; }
.preview-dot { width: 5px; height: 5px; border-radius: 50%; background: #789457; }
.badge-divider { opacity: .35; margin: 0 1px; }
.profile { height: 38px; width: 38px; border-radius: 50%; background: var(--green); color: #fbfff6; font-family: var(--heading-font); font-size: 21px; position: relative; box-shadow: 0 0 0 4px #ffffff69; }
.profile span { position: absolute; width: 10px; height: 10px; background: var(--lime); border: 2px solid var(--canvas); border-radius: 50%; bottom: -1px; right: -1px; }
.workspace { max-width: 1080px; margin: auto; padding: 0 24px 30px; }
.main-nav { display: flex; justify-content: space-between; align-items: center; padding: 6px 0 17px; gap: 12px; }
.nav-tabs { display: flex; gap: 4px; align-items: center; }
.nav-item { font-size: 12px; font-weight: 600; padding: 10px 14px; border-radius: 24px; min-height: 40px; white-space: nowrap; color: #616d65; }
.nav-item.active { background: var(--green); color: #fffefb; }
.nav-item:hover:not(.active) { background: #ffffff80; }
.nav-item span { font-size: 10px; background: #ddebaf; color: var(--green); padding: 2px 6px; border-radius: 12px; margin-left: 4px; }
.demo-switch { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
.demo-switch select { max-width: 170px; font-size: 11px; padding: 7px 24px 7px 9px; border: 1px solid #d5dcd3; border-radius: 7px; background: #f6f7f2; color: #536357; }
main { background: var(--paper); border: 1px solid #dce2d7; border-radius: 15px; box-shadow: var(--shadow); min-height: 550px; overflow: clip; }
main:focus { outline: none; }
:root:not([data-app-ready]) .main-nav { visibility: hidden; }
main:empty::before { content: 'Loading Inbox Review...'; display: block; padding: 32px; color: var(--muted); font-size: 13px; }
.page-heading { padding: 32px 36px 27px; position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: 1.7px; font-size: 10px; font-weight: 700; color: #7d897b; }
h1 { font-family: var(--heading-font); font-size: 35px; font-weight: 500; line-height: 1.2; letter-spacing: -1.4px; margin: 0 0 11px; }
.subtitle { color: var(--muted); font-size: 13px; margin: 0; max-width: 490px; line-height: 1.65; }
.heading-aside { text-align: right; padding-top: 5px; }
.heading-aside p { margin: 0 0 7px; font-size: 10px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 14px; border: 1px solid #d7dfd0; border-radius: 7px; font-size: 11px; font-weight: 600; min-height: 40px; background: var(--paper); text-decoration: none; transition: background 120ms ease, border-color 120ms ease; }
.btn:hover { background: #f1f4ed; border-color: #b8c7b1; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: #173c32; border-color: #173c32; }
.btn-once { color: var(--blue); border-color: #c6d6df; background: var(--blue-soft); }
.btn-once:hover { background: #e0ebf2; border-color: #b6cad7; }
.btn-keep { color: var(--green); background: var(--green-soft); border-color: #ccd9c7; }
.btn-text { background: transparent; border-color: transparent; color: var(--muted); }
.btn-text:hover { border-color: transparent; }
.heading-art { width: 118px; height: 95px; position: relative; margin: -7px 6px 13px auto; }
.paper-note { width: 70px; height: 83px; border: 1px solid #cfd9c3; background: #f5f8ed; border-radius: 3px; position: absolute; top: 10px; left: 29px; transform: rotate(12deg); box-shadow: 4px 4px 0 #eaf0e3; }
.paper-note:before { content: ""; position: absolute; width: 33px; height: 3px; background: #d5dfc8; box-shadow: 0 8px #d5dfc8, 0 16px #d5dfc8; top: 22px; left: 17px; border-radius: 2px; }
.art-check { width: 40px; height: 40px; position: absolute; bottom: -2px; left: 8px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; transform: rotate(-9deg); border: 4px solid var(--paper); }
.art-check svg { width: 23px; height: 23px; stroke: var(--green); stroke-width: 2.3; }
.toolbar { padding: 13px 36px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #f9faf5; }
.search-wrap { display: flex; align-items: center; gap: 9px; width: 360px; color: #819080; }
.search-wrap svg { width: 16px; height: 16px; }
.search-wrap input { width: 100%; border: 0; outline: none; background: transparent; color: var(--ink); padding: 6px 0; font-size: 12px; min-height: 30px; }
.search-wrap:focus-within { outline: 2px solid var(--blue); outline-offset: 6px; border-radius: 2px; }
.search-wrap input:focus-visible { outline: none; }
.search-wrap input::placeholder { color: #829080; }
kbd { border: 1px solid #dce2d7; border-radius: 4px; padding: 1px 5px; font-family: var(--body-font); font-size: 10px; color: #7a877a; background: #fff; }
.toolbar-right { display: flex; gap: 13px; align-items: center; font-size: 10px; color: #788372; }
.toolbar-right select { font-size: 11px; border: 0; background: transparent; color: #65765e; padding: 7px 3px; max-width: 200px; }
.select-all { display: inline-flex; gap: 6px; align-items: center; min-height: 32px; cursor: pointer; white-space: nowrap; }
input[type=checkbox] { accent-color: var(--green); }
.queue-section { padding: 22px 36px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.section-heading h2 { font-size: 11px; font-weight: 700; letter-spacing: .1px; margin: 0; display: flex; gap: 8px; align-items: center; }
.section-heading h2 span { color: #829079; font-size: 10px; font-weight: 500; }
.section-heading p { margin: 0; font-size: 10px; color: #869180; }
.mail-row { border-bottom: 1px solid var(--line); position: relative; }
.mail-row:last-child { border-bottom: 0; }
.mail-row.selected { background: #f4f7ec; margin: 0 -12px; padding: 0 12px; border-radius: 8px; }
.row-summary { display: flex; align-items: center; gap: 13px; padding: 17px 0; }
.row-controls { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.row-controls .quick-apply { order: 1; }
.mobile-action-label { display: none; }
.row-controls .rule-button { display: inline-flex; align-items: center; gap: 5px; }
.row-controls .rule-button > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.destination-chevron { display: none; }
.avatar-selector { display: flex; align-items: center; justify-content: center; position: relative; width: 40px; height: 40px; flex-shrink: 0; cursor: pointer; }
.avatar-selector input { opacity: 0; position: absolute; inset: 0; width: 40px; height: 40px; margin: 0; cursor: pointer; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--heading-font); font-size: 12px; font-weight: 500; transition: background 150ms ease; }
.sage { background: #e6edde; color: #547343; }
.sand { background: #f3e9d8; color: #8a7143; }
.sky { background: #e3edf3; color: #527586; }
.rose { background: #f2e0da; color: #a46654; }
.lilac { background: #eae6f1; color: #7c7198; }
.peach { background: #f4e7cf; color: #997d42; }
.avatar-selector:hover .avatar { box-shadow: 0 0 0 3px #dde6d580; }
.avatar-selector input:focus-visible + .avatar { outline: 3px solid var(--blue); outline-offset: 3px; }
.avatar-selector input:checked + .avatar { background: var(--green); color: white; }
.avatar-selector .checkmark { display: none; }
.avatar-selector input:checked + .avatar .initials { display: none; }
.avatar-selector input:checked + .avatar .checkmark { display: block; }
.mail-summary { flex: 1; min-width: 0; text-align: left; display: grid; grid-template-columns: minmax(190px, .9fr) minmax(150px, 1.3fr); gap: 16px; padding: 0; min-height: 40px; align-items: center; }
.sender-block { min-width: 0; }
.sender-name { display: block; font-size: 13px; font-weight: 600; color: #2b3730; line-height: 1.6; }
.sender-address { display: block; font-size: 10px; color: #83907d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-preview { padding: 0; text-align: left; width: 100%; min-width: 0; }
.custom-to-choices { display: block; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.custom-to-toggle { display: inline; position: relative; max-width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--muted); font: inherit; line-height: inherit; text-align: left; overflow-wrap: anywhere; vertical-align: baseline; }
.custom-to-toggle::after { content: ''; position: absolute; inset: -6px 0; }
.custom-to-choices .custom-to-toggle + .custom-to-toggle::before { content: ', '; color: var(--muted); }
.custom-to-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }
.custom-to-toggle.is-matching { color: var(--blue); }
.subject-block { min-width: 0; }
.subject-line { display: block; font-size: 12px; color: #4a574d; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.7; }
.subject-meta { color: #8a9684; font-size: 10px; display: block; }
.rule-button { font-size: 10px; font-weight: 600; white-space: nowrap; border: 1px solid #dce4d5; background: #f2f6ee; color: #607850; border-radius: 5px; padding: 7px 9px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; min-height: 32px; }
.rule-button.receipt { color: #887047; background: #faf4e9; border-color: #e8dfca; }
.rule-button.notification { color: #5e798a; background: #eff4f7; border-color: #dce6eb; }
.rule-button.application { color: #7d7394; background: #f4f1f8; border-color: #e6e0ed; }
.rule-button:hover { filter: brightness(.97); }
.row-chevron { display: flex; padding: 8px 0 8px 6px; color: #869280; }
.row-chevron svg { height: 13px; width: 13px; }
.is-open .row-chevron svg { transform: rotate(180deg); }
.email-preview { margin: 0 0 20px 53px; border: 1px solid #e0e6db; border-radius: 9px; overflow: hidden; background: #fff; animation: reveal 180ms ease; }
.preview-metadata { padding: 17px 21px 12px; background: #fafbf7; border-bottom: 1px solid var(--line); }
.preview-metadata h3 { font-size: 16px; font-weight: 600; margin: 0 0 12px; line-height: 1.5; }
.preview-metadata dl { display: grid; grid-template-columns: 45px 1fr; gap: 5px; font-size: 11px; margin: 0; }
.preview-metadata dt { color: #8b9585; }
.preview-metadata dd { margin: 0; overflow-wrap: anywhere; }
.email-body { padding: 17px 24px; font-size: 13px; color: #48564e; line-height: 1.85; max-height: 360px; overflow: auto; }
.email-body p { margin: 0 0 15px; white-space: pre-line; overflow-wrap: anywhere; }
.privacy-note { font-size: 10px; color: #8b9685; display: flex; align-items: center; gap: 5px; padding: 0 24px 16px; }
.privacy-note svg { width: 12px; height: 12px; }
.recommendation-note { padding: 12px 21px; background: #f8faf4; border-top: 1px solid var(--line); font-size: 11px; color: #708366; line-height: 1.6; }
.recommendation-note strong { font-weight: 600; color: #567146; }
.row-actions { border-top: 1px solid var(--line); display: flex; gap: 6px; padding: 12px 15px; flex-wrap: wrap; }
.secondary-decisions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions .btn { padding: 8px 10px; font-size: 10px; min-height: 36px; }
.filter-control { display: inline-flex; min-width: 0; max-width: 100%; }
.filter-control .quick-apply { border-radius: 7px 0 0 7px; white-space: normal; flex: 1; min-width: 0; }
.filter-control .filter-change { border-radius: 0 7px 7px 0; min-width: 36px; padding: 8px; border-left-color: #00000026; }
.filter-control .filter-change svg { width: 13px; height: 13px; }
.queue-tail { margin: 26px 36px 0; padding: 18px 0 23px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: #7c8875; font-size: 10px; line-height: 1.7; }
.queue-tail p { margin: 0; }
.quiet-link { font-size: 10px; color: #74856c; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.page-footer { display: flex; gap: 12px; align-items: center; padding: 20px 8px 0; font-size: 9px; color: #8a9686; }
.page-footer p { font-family: "Iowan Old Style", "Baskerville", serif; font-size: 13px; font-style: italic; margin: 0; color: #72816a; }
.page-footer div { text-align: center; }
.page-footer button { font-size: inherit; padding: 7px 0; color: #7c8b73; text-decoration: underline; text-underline-offset: 3px; justify-self: start; white-space: nowrap; }
.page-footer button:last-child { justify-self: end; }
.offline-dot { height: 5px; width: 5px; border: 1px solid #9caa95; border-radius: 50%; }
.footer-divider { opacity: .5; padding: 0 3px; }
.review-intro { margin: 0 36px 22px; padding: 12px 15px; background: var(--green-soft); border-radius: 7px; font-size: 12px; color: var(--green); display: flex; align-items: center; gap: 10px; }
.review-list { padding: 0 36px; }
.review-list .mail-summary { grid-template-columns: 1fr; gap: 0; }
.review-list .subject-block { display: none; }
.review-list .email-preview { margin-left: 0; }
.review-list .mail-row { padding-bottom: 6px; }
.sender-details { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sender-details .sender-address { flex: 0 1 auto; min-width: 0; }
.review-sender .sender-name { min-width: 0; }
.review-subject { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.review-sender .review-number { flex: none; white-space: nowrap; }
.review-number { flex: none; white-space: nowrap; font-size: 10px; color: var(--muted); }
.notice { margin: 0 36px 20px; padding: 16px 19px; border: 1px solid #e7d9bd; background: var(--amber-soft); color: #82602d; border-radius: 8px; display: flex; gap: 12px; font-size: 12px; line-height: 1.7; }
.notice > svg { margin-top: 2px; }
.notice p { margin: 3px 0 0; }
.notice strong { font-size: 12px; font-weight: 600; }
.notice .btn { margin-top: 9px; background: #fffaf1; border-color: #dbc9a6; color: #82602d; }
.history-list { padding: 5px 36px 30px; }
.history-entry { padding: 20px 0; border-bottom: 1px solid var(--line); display: flex; gap: 15px; align-items: flex-start; }
.history-symbol { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #edf3e7; color: #628350; flex-shrink: 0; }
.history-symbol.once { background: var(--blue-soft); color: var(--blue); }
.history-symbol.snooze { background: #f4f0e5; color: #998155; }
.history-symbol.partial { background: var(--amber-soft); color: var(--amber); }
.history-copy { flex: 1; min-width: 0; }
.history-copy h2 { font-size: 13px; margin: 0 0 5px; font-weight: 600; }
.history-copy > p { color: #84917e; font-size: 11px; margin: 0 0 8px; line-height: 1.7; overflow-wrap: anywhere; }
.history-copy details { color: #74816c; font-size: 10px; line-height: 1.8; }
.history-copy summary { cursor: pointer; width: fit-content; }
.history-detail { background: #f8faf4; padding: 12px; border-radius: 6px; margin-top: 8px; }
.history-detail p { margin: 0 0 4px; overflow-wrap: anywhere; }
.history-detail code { font-size: 10px; overflow-wrap: anywhere; }
.history-entry time { display: block; font-size: 9px; color: #8a9582; white-space: nowrap; }
.history-right { display: grid; gap: 10px; justify-items: end; }
.history-right .btn { padding: 7px 9px; min-height: 34px; font-size: 10px; }
.status-tag { font-size: 9px; background: var(--amber-soft); color: var(--amber); padding: 4px 7px; border-radius: 4px; }
.empty-state { padding: 60px 24px 70px; text-align: center; max-width: 470px; margin: auto; }
.empty-illustration { height: 90px; width: 90px; border-radius: 50%; background: #f0f5e4; display: grid; place-items: center; margin: 0 auto 22px; color: #68824d; }
.empty-illustration svg { width: 40px; height: 40px; stroke-width: 1.2; }
.empty-state h2 { font-family: var(--heading-font); font-weight: 500; font-size: 24px; letter-spacing: -.5px; margin: 0 0 14px; }
.empty-state p { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 0 0 22px; }
.empty-state .btn { margin: 3px; }
.skeleton { padding: 0 36px 30px; }
.skeleton-row { padding: 20px 0; display: flex; gap: 15px; border-bottom: 1px solid var(--line); }
.skeleton-circle, .skeleton-lines i { background: linear-gradient(90deg, #edf1e8, #f7f8f3, #edf1e8); background-size: 200% 100%; animation: shimmer 2s ease-in-out infinite; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-lines { flex: 1; display: grid; gap: 10px; }
.skeleton-lines i { display: block; width: 55%; height: 11px; border-radius: 3px; }
.skeleton-lines i:last-child { width: 80%; height: 8px; }
.bulk-toolbar { position: fixed; z-index: 10; bottom: 22px; left: 50%; transform: translateX(-50%); padding: 12px 16px; border: 1px solid #d1ddc9; border-radius: 12px; background: #fffefbef; box-shadow: 0 8px 40px #19352724; display: flex; align-items: center; gap: 7px; max-width: calc(100vw - 32px); backdrop-filter: blur(12px); }
.bulk-toolbar .bulk-count { color: #56724b; font-size: 11px; padding-right: 12px; white-space: nowrap; }
.bulk-toolbar .btn { padding: 8px 11px; font-size: 10px; min-height: 36px; white-space: nowrap; }
.bulk-clear { padding: 7px; display: flex; color: #8a9582; }
body.has-selection { padding-bottom: 90px; }
dialog { padding: 0; border: 1px solid #dde5d6; border-radius: 15px; width: min(560px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); background: var(--paper); color: var(--ink); box-shadow: 0 20px 90px #102b2b24; }
dialog::backdrop { background: #18352b66; backdrop-filter: blur(4px); }
.dialog-top { padding: 24px 27px 0; display: flex; align-items: center; justify-content: space-between; }
.dialog-kicker { font-size: 9px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; color: #819477; }
.dialog-close { display: flex; padding: 6px; color: #8c9686; border-radius: 50%; }
.dialog-close:hover { background: #edf1e7; }
.dialog-body { padding: 12px 27px 24px; }
.dialog-body h2 { font-family: var(--heading-font); font-size: 25px; font-weight: 500; letter-spacing: -.7px; line-height: 1.3; margin: 0 0 12px; }
.dialog-body > p { color: var(--muted); font-size: 12px; line-height: 1.85; margin: 0 0 16px; }
.dialog-targets { margin: 18px 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf4; max-height: 150px; overflow: auto; }
.dialog-targets > div { font-size: 12px; line-height: 1.7; }
.dialog-targets > div + div { margin-top: 10px; }
.dialog-targets small { font-size: 10px; color: #849078; display: block; overflow-wrap: anywhere; }
.dialog-targets strong { font-weight: 600; }
.field-label { font-size: 10px; font-weight: 600; display: block; text-transform: uppercase; letter-spacing: 1px; color: #778b69; margin: 20px 0 7px; }
.dialog-select { width: 100%; padding: 12px; font-size: 13px; border: 1px solid #c9d5bf; border-radius: 7px; background: #fff; color: var(--green); }
.effect-list { list-style: none; padding: 0; margin: 15px 0 0; color: #67795b; font-size: 11px; }
.effect-list li { display: flex; gap: 8px; margin: 8px 0; line-height: 1.6; }
.effect-list svg { width: 14px; height: 14px; margin-top: 2px; }
.dialog-callout { border-radius: 7px; background: var(--blue-soft); padding: 12px 14px; margin: 20px 0 0; color: var(--blue); font-size: 11px; line-height: 1.8; }
.dialog-callout.amber { background: var(--amber-soft); color: var(--amber); }
.dialog-actions { background: #f8faf4; border-top: 1px solid var(--line); padding: 16px 27px; display: flex; justify-content: flex-end; gap: 8px; }
.progress-list { display: grid; gap: 12px; margin: 24px 0; }
.progress-step { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; }
.progress-step.success { background: #f2f7ec; color: #50763b; border-color: #d4e3c7; }
.progress-step.failed { background: var(--amber-soft); color: var(--amber); border-color: #e5d0aa; }
.progress-step.pending { color: #8e9889; }
.progress-step svg { width: 16px; height: 16px; }
.spinner { width: 15px; height: 15px; border: 2px solid #d8e2cd; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.keyboard-list { display: grid; grid-template-columns: 60px 1fr; gap: 15px; font-size: 12px; margin: 20px 0; }
.keyboard-list dt, .keyboard-list dd { margin: 0; }
#toast { position: fixed; z-index: 30; bottom: 25px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 12px 18px; border-radius: 9px; font-size: 12px; box-shadow: 0 5px 30px #294a2926; max-width: calc(100vw - 32px); text-align: center; }
.has-selection #toast { bottom: 102px; }
.noscript { padding: 24px; text-align: center; }
@keyframes reveal { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0%,100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1200px) { .workspace { margin-top: 10px; } .masthead { padding-top: 38px; } }
@media (max-width: 900px) {
  .mail-summary { grid-template-columns: minmax(150px, .8fr) minmax(140px, 1fr); gap: 12px; }
  .rule-button { max-width: 135px; font-size: 9px; }
  .row-summary { gap: 10px; }
  .main-nav { align-items: flex-start; }
  .demo-switch { flex-direction: column; gap: 3px; align-items: flex-end; }
  .demo-switch label { font-size: 9px; }
  .page-footer { gap: 8px; }
  .bulk-toolbar { flex-wrap: wrap; width: fit-content; justify-content: center; }
  .bulk-toolbar .bulk-count { width: calc(100% - 40px); }
  .bulk-clear { order: -1; }
  body.has-selection { padding-bottom: 130px; }
}
@media (max-width: 650px) {
  body { font-size: 13px; }
  .masthead { padding: 20px 18px 16px; gap: 10px; }
  .wordmark { font-size: 27px; }
  .wordmark > span:last-child { font-size: 20px; }
  .profile { width: 32px; height: 32px; font-size: 19px; }
  .preview-dot, .badge-divider { display: none; }
  .workspace { padding: 0 10px 24px; }
  .main-nav { padding: 4px 0 14px; flex-wrap: wrap; }
  .nav-tabs { width: 100%; justify-content: center; gap: 1px; }
  .nav-item { font-size: 10px; padding: 9px 11px; }
  .demo-switch { flex-direction: row; align-items: center; margin-left: auto; margin-right: 5px; }
  .demo-switch select { font-size: 10px; max-width: 160px; padding-top: 5px; padding-bottom: 5px; }
  main { border-radius: 12px; min-height: 490px; }
  .page-heading { padding: 26px 20px 22px; gap: 10px; }
  h1 { font-size: 29px; letter-spacing: -1px; }
  .subtitle { font-size: 12px; max-width: 300px; }
  .heading-aside { padding: 0; }
  .heading-art { display: none; }
  .heading-aside p { display: none; }
  .heading-aside .btn { font-size: 10px; padding: 9px 10px; min-height: 36px; }
  .heading-aside .btn svg { display: none; }
  .toolbar { padding: 10px 20px; flex-wrap: wrap; gap: 7px; }
  .search-wrap { width: 100%; }
  .toolbar-right { width: 100%; justify-content: space-between; gap: 10px; }
  .toolbar-right select { max-width: 190px; padding-left: 0; }
  .queue-section { padding: 20px 20px 0; }
  .section-heading { gap: 8px; }
  .section-heading p { font-size: 9px; }
  .row-summary { display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; column-gap: 11px; row-gap: 7px; padding: 16px 0; }
  .avatar-selector, .avatar, .avatar-selector input { width: 36px; height: 36px; }
  .avatar-selector { grid-row: 1; align-self: start; margin-top: 4px; }
  .mail-summary { display: grid; grid-template-columns: 1fr; gap: 5px; grid-column: 2; grid-row: 1; }
  .sender-name { font-size: 12px; }
  .sender-address { font-size: 9px; }
  .subject-line { font-size: 11px; }
  .subject-meta { font-size: 9px; }
  .rule-button { grid-column: 2; grid-row: 2; justify-self: start; max-width: 100%; font-size: 9px; padding: 4px 7px; min-height: 26px; }
  .row-chevron { grid-column: 3; grid-row: 1; align-self: center; padding: 8px 0; }
  .email-preview { margin-left: 0; }
  .preview-metadata { padding: 16px; }
  .preview-metadata h3 { font-size: 14px; }
  .email-body { padding: 16px; font-size: 12px; }
  .privacy-note { padding: 0 16px 15px; font-size: 9px; }
  .recommendation-note { padding: 12px 16px; font-size: 10px; }
  .row-actions { display: grid; grid-template-columns: 1fr 1fr; padding: 12px; gap: 7px; }
  .row-actions .btn { font-size: 9px; padding: 9px 7px; min-height: 40px; }
  .row-actions .btn svg { width: 13px; height: 13px; }
  .queue-tail { margin: 22px 20px 0; flex-direction: column; gap: 7px; font-size: 9px; }
  .queue-tail .quiet-link { align-self: flex-start; }
  .page-footer { font-size: 8px; padding: 16px 8px 0; }
  .page-footer p { font-size: 12px; }
  .page-footer div { gap: 4px; }
  .notice { margin: 0 20px 18px; padding: 14px; font-size: 11px; }
  .history-list { padding: 0 20px 24px; }
  .history-entry { flex-wrap: wrap; gap: 9px; }
  .history-symbol { width: 30px; height: 30px; }
  .history-copy { width: calc(100% - 40px); flex: initial; }
  .history-copy h2 { font-size: 12px; }
  .history-right { width: 100%; display: flex; align-items: center; justify-content: space-between; padding-left: 39px; }
  .review-intro { margin: 0 20px 16px; font-size: 11px; }
  .review-list { padding: 0 20px; }
  .review-number { font-size: 9px; }
  .bulk-toolbar { bottom: 12px; max-width: calc(100vw - 20px); width: calc(100vw - 20px); padding: 10px; gap: 6px; }
  .bulk-toolbar .btn { flex: 1; padding: 9px 6px; font-size: 9px; min-height: 38px; }
  .bulk-toolbar .btn svg { display: none; }
  .bulk-toolbar .bulk-count { width: calc(100% - 34px); padding-right: 0; }
  .bulk-clear { padding: 6px; }
  .dialog-top { padding: 19px 20px 0; }
  .dialog-body { padding: 12px 20px 20px; }
  .dialog-body h2 { font-size: 23px; }
  .dialog-actions { padding: 14px 20px; }
  .dialog-actions .btn { font-size: 10px; }
  .empty-state { padding: 45px 20px; }
  #toast { bottom: 15px; width: max-content; font-size: 11px; }
  .has-selection #toast { bottom: 125px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Task-first HEY app treatment. Colors and the font stack come from the app CSS. */
.wordmark { color: var(--ink); transform: none; letter-spacing: -1.7px; font-weight: 850; }
.wordmark > span:last-child { font-weight: 700; }
.wordmark-comma { color: var(--ink); }
.profile { background: var(--purple); }
.preview-dot { background: var(--green); }
.nav-item { color: var(--muted); font-size: 13px; }
.nav-item.active { background: var(--lime); color: var(--ink); font-weight: 700; }
.nav-item span { background: #ffffffaa; color: var(--ink); }
.demo-switch, .demo-switch select { color: var(--muted); }
.demo-switch select { background: var(--paper); border-color: var(--line); }
main { border-color: #231c331a; }
.page-heading { padding: 23px 32px 21px; align-items: center; }
h1 { font-size: 27px; font-weight: 750; letter-spacing: -.8px; margin-bottom: 5px; }
.subtitle { font-size: 12px; color: var(--muted); line-height: 1.5; }
.heading-aside { padding: 0; }
.heading-art, .eyebrow { display: none; }
.btn { color: var(--ink); border-color: var(--line); font-size: 12px; border-radius: 7px; }
.btn:hover { background: #f4f3f5; border-color: #231c3355; }
.btn-primary { background: var(--lime); border-color: #139c8038; color: var(--ink); font-weight: 700; }
.btn-primary:hover { background: #80f5df; border-color: #139c8066; }
.btn-primary .spinner { border-color: #231c3326; border-top-color: var(--ink); }
.btn-keep { background: #d7efde; color: #175e2f; border-color: #2998504d; }
.btn-once { background: #e0eaf9; color: #005cb5; border-color: #0074e43b; }
.btn-text { color: var(--muted); border-color: transparent; }
.toolbar { padding: 11px 32px; background: #fbfaf9; }
.search-wrap { color: var(--muted); }
.search-wrap input { font-size: 13px; }
.search-wrap input::placeholder { color: #7d7687; }
.toolbar-right, .toolbar-right select { color: var(--muted); font-size: 12px; }
.queue-section { padding: 19px 32px 0; }
.section-heading h2 { font-size: 13px; }
.section-heading h2 span { font-size: 11px; color: var(--muted); }
.mail-row.selected { background: #9dffec26; }
.mail-summary { grid-template-columns: minmax(165px, .9fr) minmax(140px, 1.15fr); }
.sender-name { color: var(--ink); font-size: 14px; font-weight: 650; }
.sender-address { color: var(--muted); font-size: 11px; }
.subject-line { color: var(--ink); font-size: 13px; }
.subject-meta { color: var(--muted); font-size: 11px; }
.row-summary { gap: 12px; padding: 15px 0; }
.rule-button { background: #9dffec33; border-color: #139c8033; color: #185a4c; font-size: 11px; font-weight: 600; max-width: 175px; }
.rule-button.receipt { background: var(--amber-soft); color: #856000; border-color: #a6770033; }
.rule-button.notification { background: #e0eaf9; color: #005cb5; border-color: #0074e433; }
.rule-button.application { background: var(--purple-soft); color: #5522fa; border-color: #5522fa33; }
.quick-apply { min-width: 68px; padding: 8px 11px; min-height: 36px; font-size: 12px; white-space: nowrap; }
.quick-apply svg { width: 14px; height: 14px; }
.quick-apply[data-switch-mode] { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.interactive-mail-row .quick-apply[data-switch-mode].is-switching-mode:not(:disabled) { transform: translateX(var(--mode-shift, 0px)); transition: none; }
#connection-warning { margin: 12px 0; }
.row-chevron { color: var(--muted); }
.sage { background: #9dffec55; color: #185a4c; }
.sand { background: #fff5ca; color: #856000; }
.sky { background: #e0eaf9; color: #005cb5; }
.rose { background: #ffe5da; color: #b33b27; }
.lilac { background: #e5dfff; color: #5522fa; }
.peach { background: #efdae9; color: #8a205f; }
.avatar-selector input:checked + .avatar { background: var(--purple); color: white; }
.email-preview { border-color: var(--line); }
.preview-metadata { background: #fbfaf9; }
.email-body { color: var(--ink); font-size: 14px; }
.preview-metadata dt, .privacy-note, .history-copy > p, .history-copy details, .history-entry time { color: var(--muted); }
.recommendation-note { color: var(--muted); background: #f4f8fe; }
.recommendation-note strong { color: var(--ink); }
.row-actions .btn { font-size: 11px; }
.queue-tail { margin: 19px 32px 0; color: var(--muted); font-size: 11px; padding: 15px 0 18px; }
.page-footer { color: var(--muted); }
.page-footer button { color: var(--muted); }
.history-copy h2 { font-size: 14px; }
.history-detail { background: #fbfaf9; }
.history-symbol { color: #175e2f; background: #d7efde; }
.dialog-kicker, .field-label { color: var(--muted); }
.dialog-select { border-color: var(--line); color: var(--ink); }
.effect-list { color: var(--ink); }
.dialog-actions { background: #fbfaf9; }
.dialog-body h2 { font-weight: 700; }
.dialog-targets { background: #fbfaf9; border-color: var(--line); }
.dialog-targets small { color: var(--muted); }
.dialog-callout { color: #005cb5; background: #e0eaf9; }
.dialog-callout.amber { color: var(--amber); background: var(--amber-soft); }
#toast { background: var(--ink); }
.review-list { padding: 0 32px; }
.review-controls { display: flex; justify-content: space-between; align-items: center; padding: 0 32px 16px; gap: 12px; color: var(--muted); font-size: 12px; }
.unified-review-hint { padding: 0 32px 14px; color: var(--muted); font-size: 12px; }
.swipe-review-item { position: relative; touch-action: pan-y; transition: transform 180ms ease; scroll-margin-top: 16px; }
.swipe-review-item:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; border-radius: 10px; }
.swipe-review-item.is-dragging { transition: none; user-select: none; }
.swipe-review-item.is-dragging .swipe-message-surface { -webkit-user-select: none; user-select: none; }
.swipe-message-surface { position: relative; background: var(--paper); transform: translateX(var(--message-offset, 0px)); transition: transform 200ms cubic-bezier(.2,.75,.25,1); }
.swipe-review-item.is-dragging .swipe-message-surface { transition: none; will-change: transform; box-shadow: 0 0 16px #00000026; }
.swipe-review-item .quick-apply { transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease; }
.swipe-review-item.swiping-right .quick-apply:not(:disabled) { transform: translateY(calc(var(--swipe-strength, 0) * 2px)) scale(calc(1 - var(--swipe-strength, 0) * .06)); filter: brightness(calc(1 - var(--swipe-strength, 0) * .12)); box-shadow: inset 0 2px 4px #00000038; }
.interactive-mail-row .quick-apply:active:not(:disabled) { transform: translateY(2px) scale(.94); filter: brightness(.9); box-shadow: inset 0 2px 4px #00000038; }
.swipe-review-item.swipe-ready.swiping-right .quick-apply:not(:disabled) { outline: 2px solid var(--blue); outline-offset: 3px; }
.swipe-review-item.is-dragging .quick-apply, .swipe-review-item.is-dragging .review-move-trigger { transition: none; }
#move-once-popover { position: fixed; inset: auto; margin: 0; padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--blue); border-radius: 12px; box-shadow: 0 10px 35px #00000035; overflow: hidden; }
#move-once-popover:popover-open { display: flex; transform-origin: var(--move-anchor-x, 50%) bottom; animation: move-button-open 200ms cubic-bezier(.2,.7,.2,1); }
#move-once-popover[data-side="below"] { transform-origin: var(--move-anchor-x, 50%) top; --move-reveal-y: -10px; }
#move-once-popover::backdrop { background: transparent; }
.review-decision-panel { width: 100%; min-height: 0; padding: 14px; background: var(--paper); display: flex; flex-direction: column; }
.review-decision-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.review-decision-panel h2 { margin: 0 0 5px; font-size: 14px; }
.review-decision-panel header p, .review-undo-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.review-move-labels { display: grid; grid-template-columns: 1fr; gap: 7px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 2px; }
.review-decision-panel > header, .review-decision-panel > .all-move-labels, .review-undo-note { flex-shrink: 0; }
.interactive-mail-row .email-preview { overflow: clip; }
.interactive-mail-row .row-actions.review-bottom-actions { display: flex; position: static; bottom: auto; z-index: auto; background: var(--paper); }
.interactive-mail-row .review-bottom-actions .secondary-decisions { display: flex; gap: 6px; flex-wrap: wrap; }
.review-move-trigger[aria-expanded="true"] { background: var(--blue-soft); border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.review-move-trigger { position: relative; transition: background 180ms ease; }
.scan-issue { padding: 16px 0; border-top: 1px solid var(--line); }
.scan-issue h3 { margin: 0 0 8px; font-size: 15px; }
.scan-issue-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.scan-issue details { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.scan-issue code { display: block; margin-top: 8px; }
.review-move-trigger[aria-expanded="true"]::before { content: ''; position: absolute; width: 1px; height: 9px; left: 50%; bottom: 100%; background: var(--blue); }
body:has(#move-once-popover[data-side="below"]:popover-open) .review-move-trigger[aria-expanded="true"]::before { bottom: auto; top: 100%; }
.swiping-left .review-move-trigger { background: var(--blue-soft); border-color: var(--blue); transform: translateY(calc(var(--swipe-strength, 0) * -2px)); box-shadow: 0 0 0 2px var(--blue-soft); }
@keyframes move-button-open { from { opacity: .3; transform: translateY(var(--move-reveal-y, 10px)) scale(.92); } to { opacity: 1; transform: translateY(0) scale(1); } }
.demo-review #move-once-popover:popover-open { animation: move-choices-rise 280ms cubic-bezier(.16,1,.3,1); }
.demo-review #move-once-popover[data-side="below"]:popover-open { animation-name: move-choices-fall; }
.demo-review #move-once-popover:popover-open .move-label { animation: move-choice-arrive 300ms cubic-bezier(.16,1,.3,1) both; }
.demo-review #move-once-popover .move-label:nth-child(2) { animation-delay: 35ms; }
.demo-review #move-once-popover .move-label:nth-child(3) { animation-delay: 65ms; }
.demo-review .swiping-left .review-move-trigger { transform: translateY(calc(var(--swipe-strength, 0) * -8px)); }
@keyframes move-choices-rise { from { opacity: .4; clip-path: inset(88% 8% 0 round 12px); transform: translateY(14px); } to { opacity: 1; clip-path: inset(0 round 12px); transform: translateY(0); } }
@keyframes move-choices-fall { from { opacity: .4; clip-path: inset(0 8% 88% round 12px); transform: translateY(-14px); } to { opacity: 1; clip-path: inset(0 round 12px); transform: translateY(0); } }
@keyframes move-choice-arrive { from { opacity: .2; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.demo-review { --pending-space: 70px; }
.demo-review .workspace { padding-bottom: 110px; }
@media (max-width: 650px) {
  .unified-review-hint { padding: 0 20px 12px; font-size: 10px; }
  .interactive-mail-row .row-actions.review-bottom-actions { position: static; bottom: auto; z-index: auto; }
  .interactive-mail-row .review-bottom-actions .secondary-decisions { width: 100%; gap: 5px; flex-wrap: nowrap; }
  .interactive-mail-row .review-bottom-actions .btn { flex: 1; padding: 9px 5px; min-height: 44px; font-size: 10px; white-space: nowrap; }
  .interactive-mail-row .review-bottom-actions .btn svg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-review #move-once-popover:popover-open, .demo-review #move-once-popover:popover-open .move-label { animation: none; }
  .demo-review .swiping-left .review-move-trigger { transform: none; }
  .swipe-review-item, #move-once-popover:popover-open { animation: none; transition: none; }
  .swipe-message-surface { transform: none; transition: none; }
  .swipe-review-item.swiping-right .quick-apply:not(:disabled), .interactive-mail-row .quick-apply:active:not(:disabled), .swiping-left .review-move-trigger { transform: none; }
}
.segmented { display: flex; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; background: #f4f3f5; }
.segmented button { font-size: 12px; min-height: 30px; padding: 6px 13px; border-radius: 5px; }
.segmented button[aria-pressed=true] { background: #fff; color: var(--purple); box-shadow: 0 1px 3px #231c331a; font-weight: 650; }
.swipe-review { padding: 0 24px 20px; max-width: 620px; margin: auto; }
.card-navigation { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 9px; min-height: 36px; min-width: 36px; border-radius: 50%; color: var(--blue); }
.search-toggle { color: var(--muted); min-width: 40px; min-height: 40px; }
.search-toggle:hover, .search-toggle[aria-expanded="true"] { color: var(--ink); background: #231c3308; }
.icon-button:hover { background: #0074e415; }
.swipe-card { --swipe-strength: 0; position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 5px 30px #231c330d; display: flex; flex-direction: column; touch-action: pan-y; transition: transform 180ms ease; min-height: 440px; overflow: hidden; }
.swipe-card.is-dragging { transition: none; user-select: none; }
.swipe-card:focus-visible { outline: 3px solid #0074e45c; outline-offset: 4px; }
.swipe-label { display: flex; align-items: center; gap: 7px; position: absolute; z-index: 3; top: 70px; border: 2px solid currentColor; padding: 8px 12px; background: #fffffff5; border-radius: 6px; font-weight: 800; max-width: 90%; font-size: 16px; pointer-events: none; opacity: 0; }
.swipe-label-right { left: 20px; color: #175e2f; transform: rotate(-8deg); }
.swipe-label-left { right: 20px; color: var(--purple); transform: rotate(8deg); }
.swiping-right .swipe-label-right, .swiping-left .swipe-label-left { opacity: var(--swipe-strength); }
.card-sender { display: flex; align-items: center; gap: 13px; padding: 19px 22px 13px; }
.card-sender > div { flex: 1; min-width: 0; }
.card-sender h2 { font-size: 17px; margin: 0 0 5px; font-weight: 700; }
.card-sender p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.card-recommendation { padding: 0 22px 14px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.card-recommendation > span:last-child { margin-left: auto; }
.card-recommendation .rule-button { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; }
.card-recommendation .rule-button svg { height: 12px; width: 12px; }
.card-prior, .card-conflict { font-size: 11px; color: var(--purple); background: #e5dfff66; padding: 8px 22px; margin: 0; }
.card-conflict { background: var(--amber-soft); color: var(--amber); }
.swipe-content { padding: 21px 22px 10px; border-top: 1px solid var(--line); flex: 1; overflow-y: auto; max-height: 46vh; }
.swipe-content h3 { margin: 0 0 13px; line-height: 1.5; font-size: 19px; letter-spacing: -.25px; }
.card-metadata { display: grid; grid-template-columns: 34px 1fr; gap: 4px; margin: 0 0 19px; font-size: 11px; color: var(--muted); }
.card-metadata dd { margin: 0; overflow-wrap: anywhere; }
.swipe-content .email-body { padding: 0; max-height: none; overflow: visible; font-size: 15px; line-height: 1.8; }
.card-reason { margin: 18px 0 6px; padding-top: 15px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.8; overflow-wrap: anywhere; }
.card-reason strong { color: var(--ink); }
.card-footer { padding: 15px 20px 13px; border-top: 1px solid var(--line); background: #fbfaf9; }
.card-actions { display: grid; grid-template-columns: .7fr 1.3fr; gap: 10px; }
.card-actions .btn { min-height: 46px; font-size: 13px; padding: 9px 12px; white-space: normal; }
.card-footer p { font-size: 10px; color: var(--muted); line-height: 1.6; text-align: center; margin: 11px 0 0; }
.swipe-hint { display: flex; justify-content: space-between; gap: 10px; margin: 13px 0 0; font-size: 11px; color: var(--muted); }
.swipe-hint span { display: flex; align-items: center; gap: 5px; }
.swipe-hint svg { height: 13px; width: 13px; }
.card-privacy { color: var(--muted); font-size: 10px; display: flex; align-items: center; justify-content: center; gap: 5px; margin: 15px 0 0; }
.card-privacy svg { width: 12px; height: 12px; }
.option-list { display: grid; gap: 4px; margin-top: 16px; }
.option-list button { display: flex; text-align: left; align-items: center; gap: 13px; padding: 14px 10px; width: 100%; border-radius: 9px; min-height: 64px; }
.option-list button:hover { background: #f4f3f5; }
.option-list button > svg:first-child { color: var(--blue); width: 21px; height: 21px; }
.option-list button > svg:last-child { color: var(--muted); width: 13px; height: 13px; transform: rotate(-90deg); }
.option-list span { flex: 1; min-width: 0; }
.option-list strong { display: block; font-size: 14px; font-weight: 650; }
.option-list small { display: block; margin-top: 5px; line-height: 1.5; font-size: 11px; color: var(--muted); }
.row-chevron.row-more { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-width: 36px; min-height: 36px; flex: 0 0 36px; padding: 0; border-radius: 7px; }
.row-more:hover { background: var(--blue-soft); color: var(--blue); }
.row-chevron.row-more svg { display: block; width: 19px; height: 19px; margin: 0; transform: none; }
.desktop-card-decisions { display: none; }
@media (min-width: 651px) {
  .demo-swipe-card .card-footer, .demo-swipe-card .mobile-card-menu { display: none; }
  .card-sender > .desktop-card-decisions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
  .desktop-card-decisions .quick-apply { min-height: 38px; }
}
@media (max-width: 650px) {
  .interactive-mail-row .row-summary { grid-template-columns: 36px minmax(0, 1fr) 62px 36px; }
  .review-list .interactive-mail-row .row-summary { grid-template-columns: 36px minmax(0, 1fr) 64px; }
  .interactive-mail-row .review-row-more { display: none; }
  .demo-swipe-card .desktop-card-decisions { display: none; }
}
.demo-decision-sheet { width: min(490px, calc(100% - 32px)); }
.demo-decision-sheet .dialog-actions:empty { display: none; }
.decision-context { border-bottom: 1px solid var(--line); padding: 0 0 16px; }
.decision-context strong { font-size: 13px; }
.decision-context p { margin: 5px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.decision-menu { margin-top: 8px; }
.decision-option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 16px 8px; text-align: left; border-radius: 8px; }
.decision-option:hover { background: var(--blue-soft); }
.decision-option > svg:first-child { width: 20px; height: 20px; color: var(--muted); }
.decision-option > span { flex: 1; min-width: 0; }
.decision-option strong { display: block; font-size: 15px; font-weight: 650; }
.decision-option small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.decision-option > svg:last-child { width: 14px; height: 14px; color: var(--muted); transition: transform 160ms ease; }
.decision-option[aria-expanded="true"] > svg:last-child { transform: rotate(180deg); }
.demo-decision-sheet .decision-option:not([aria-controls]) { border: 1px solid var(--line); margin-top: 8px; padding: 12px; min-height: 66px; }
.move-label-fan { border-left: 2px solid var(--line); margin: 0 0 10px 17px; padding: 0 0 6px 18px; animation: reveal 160ms ease; }
.move-scope { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 0 0 10px; }
.suggested-move-labels, .all-label-results { display: grid; gap: 6px; }
.move-label { display: flex; align-items: center; gap: 9px; text-align: left; width: 100%; min-height: 44px; border: 1px solid var(--line); background: var(--paper); border-radius: 7px; padding: 10px; }
.move-label:hover { background: var(--blue-soft); border-color: var(--blue); }
.move-label > svg { width: 15px; height: 15px; color: var(--muted); }
.move-label > svg:last-child { color: var(--blue); }
.move-label > span { flex: 1; overflow-wrap: anywhere; font-size: 13px; }
.move-label small { color: var(--muted); font-size: 9px; }
.suggested-move-labels .move-label:first-child > span { font-weight: 650; }
.all-move-labels { display: flex; align-items: center; justify-content: space-between; min-height: 40px; width: 100%; color: var(--muted); font-size: 11px; padding: 10px 8px; }
.all-move-labels svg { height: 13px; width: 13px; }
.all-move-labels[aria-expanded="true"] svg { transform: rotate(180deg); }
.label-search { display: flex; gap: 9px; align-items: center; border-bottom: 1px solid var(--line); padding: 9px 8px; margin-bottom: 6px; color: var(--muted); }
.label-search svg { width: 15px; height: 15px; }
.label-search input { width: 100%; min-width: 0; padding: 5px 0; border: 0; background: transparent; color: var(--ink); font-size: 12px; }
.all-label-results { max-height: 220px; overflow: auto; overscroll-behavior: contain; }
.label-empty, .move-ranking-note { font-size: 10px; line-height: 1.6; color: var(--muted); margin: 10px 8px 0; }
@media (max-width: 650px) {
  .demo-decision-sheet { width: 100%; }
  .demo-decision-sheet .dialog-body { padding-bottom: 20px; }
  .move-label-fan { margin-left: 13px; padding-left: 14px; }
  .move-label small { display: none; }
}
.picker-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.picker-choice { position: relative; display: flex; flex-direction: column; gap: 5px; text-align: left; padding: 10px 30px 10px 12px; border: 1px solid var(--line); border-radius: 8px; min-height: 59px; background: white; }
.picker-choice strong { font-size: 12px; font-weight: 600; }
.picker-choice small { font-size: 10px; color: var(--muted); line-height: 1.4; }
.picker-caption { font-size: 12px; color: var(--muted); }
.appearance-heading { margin: 4px 0 12px; font-size: 14px; }
.appearance-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.appearance-choice { min-height: 44px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--paper); font-weight: 600; }
.appearance-choice:hover { background: var(--blue-soft); }
.appearance-choice[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.profile-about { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.profile-about svg { width: 14px; height: 14px; }
.picker-choice svg { position: absolute; right: 9px; top: 12px; width: 14px; height: 14px; }
.picker-choice[aria-pressed="true"] { background: #9dffec44; border: 1px solid #139c8099; }
.pending-tray { position: fixed; z-index: 20; bottom: 20px; right: 24px; }
.pending-tray[hidden] { display: none; }
.refresh-status { position: fixed; right: 24px; bottom: 20px; z-index: 21; max-width: min(420px, calc(100vw - 28px)); }
.has-pending .refresh-status { bottom: calc(var(--pending-space, 70px) + 30px); }
.refresh-pill { position: relative; display: flex; align-items: center; gap: 12px; overflow: hidden; padding: 13px 16px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 6px 24px #00000026; }
.refresh-pill > div { min-width: 0; }
.refresh-pill strong { display: block; font-size: 12px; }
.refresh-pill small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.refresh-pill .spinner { border-color: var(--line); border-top-color: var(--blue); flex: none; }
.refresh-elapsed { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 26px; text-align: right; }
.refresh-pill > button { min-height: 36px; padding: 4px; color: var(--blue); font-size: 12px; }
.refresh-progress { position: absolute; inset: auto 0 0; height: 3px; background: var(--blue-soft); overflow: hidden; }
.refresh-progress i { display: block; width: 40%; height: 100%; background: var(--blue); animation: refresh-working 1.6s ease-in-out infinite; }
@keyframes refresh-working { from { transform: translateX(-100%); } to { transform: translateX(350%); } }
@media (max-width: 650px) { .refresh-status { right: 14px; bottom: max(12px, env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .refresh-progress i { animation: none; width: 100%; opacity: .5; } .refresh-pill .spinner { animation: none; } }
.undo-toggle { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 13px; border: 1px solid #231c3326; background: var(--ink); color: white; border-radius: 24px; box-shadow: 0 5px 20px #231c331c; font-size: 12px; }
.undo-toggle svg { width: 15px; height: 15px; }
.demo-review .undo-toggle { position: relative; overflow: hidden; }
.queue-button-status { display: inline-flex; align-items: center; gap: 9px; }
.demo-review .undo-toggle .spinner { border-color: #ffffff30; border-top-color: #ffffff; flex-shrink: 0; }
.undo-timebar { position: absolute; bottom: 4px; left: 14px; right: 14px; height: 3px; border-radius: 2px; overflow: hidden; background: #ffffff26; opacity: 0; }
.undo-timebar i { display: block; height: 100%; background: #8bc1ff; transform-origin: left; }
.undo-toggle[data-kind="undo"] .undo-timebar { opacity: 1; }
.undo-toggle[data-kind="undo"] .undo-timebar i { transition: transform 250ms linear; }
@media (prefers-reduced-motion: reduce) {
  .demo-review .undo-toggle .spinner { animation: none; }
  .undo-toggle[data-kind="undo"] .undo-timebar i { transition: none; }
}
.queue-flight { position: fixed; z-index: 100; pointer-events: none; max-width: min(240px, calc(100vw - 16px)); padding: 9px 13px; border: 1px solid var(--blue); border-radius: 22px; background: var(--blue-soft); color: var(--ink); box-shadow: 0 6px 20px #00000026; font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; will-change: transform, opacity; }
.shared-countdown { font-variant-numeric: tabular-nums; min-width: 22px; color: #b9ffe8; font-size: 11px; }
.queue-badge { font-size: 10px; border-left: 1px solid #ffffff44; padding-left: 10px; color: #ffffffaa; }
.queue-popover { position: absolute; bottom: 56px; right: 0; width: min(420px, calc(100vw - 28px)); background: white; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 10px 40px #231c3322; overflow: hidden; }
.queue-popover > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 14px; background: #fbfaf9; border-bottom: 1px solid var(--line); }
.queue-popover header strong { font-size: 13px; }
.queue-popover header strong span { color: var(--muted); margin-left: 4px; }
.queue-popover header small { display: block; font-size: 10px; color: var(--muted); line-height: 1.5; margin-top: 5px; }
.queue-popover footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #fbfaf9; border-top: 1px solid var(--line); }
.queue-popover footer button { display: inline-flex; align-items: center; gap: 7px; color: var(--blue); font-size: 11px; min-height: 32px; }
.queue-popover footer svg { height: 13px; width: 13px; }
.queue-popover footer small { max-width: 170px; font-size: 9px; color: var(--muted); line-height: 1.5; }
.pending-items { max-height: min(300px, calc(100dvh - 260px)); overflow-y: auto; }
.pending-item { padding: 12px 15px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.pending-item:last-child { border: 0; }
.pending-item > div { min-width: 0; flex: 1; }
.pending-item strong { font-size: 12px; display: block; overflow-wrap: anywhere; }
.pending-item strong span { font-weight: 400; }
.pending-status { font-size: 10px; display: block; color: var(--muted); line-height: 1.6; margin-top: 4px; }
.pending-item .btn { min-height: 40px; background: #f3f1ef; color: var(--ink); font-size: 11px; min-width: 68px; }
.pending-item .undo-seconds { font-size: 10px; min-width: 22px; font-variant-numeric: tabular-nums; }
.undo-progress { height: 3px; background: #231c330d; margin-top: 8px; border-radius: 3px; overflow: hidden; }
.undo-progress i { display: block; height: 100%; background: var(--purple); transition: width 250ms linear; }
.pending-item:not(.pending) .undo-progress { display: none; }
.pending-item.partial, .pending-item.failed { background: #fff5ca77; }
.dialog-pending-tray { margin-top: 18px; display: flex; flex-direction: column; align-items: flex-end; }
.dialog-pending-tray .queue-popover { position: static; width: 100%; margin-bottom: 10px; }
.queued-history { border-bottom: 1px solid var(--line); background: #fbfaf9; }
.queued-history ~ .empty-state { display: none; }
.history-countdown { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.has-pending .workspace { padding-bottom: calc(var(--pending-space, 150px) + 40px); }
.has-pending .bulk-toolbar, .has-pending #toast { bottom: calc(var(--pending-space, 150px) + 15px); }
@media (max-width: 900px) {
  .mail-summary { grid-template-columns: minmax(140px, .8fr) minmax(110px, 1fr); gap: 10px; }
  .rule-button { max-width: 135px; font-size: 10px; }
  .quick-apply { min-width: 58px; padding: 8px; font-size: 11px; }
  .quick-apply svg { display: none; }
}
@media (max-width: 650px) {
  .masthead { padding-top: 16px; padding-bottom: 13px; }
  .nav-item { font-size: 10px; padding: 9px 8px; }
  .page-heading { padding: 18px 20px 16px; }
  h1 { font-size: 25px; }
  .subtitle { font-size: 11px; }
  .heading-aside .btn { font-size: 11px; }
  .toolbar { padding: 10px 20px; }
  .toolbar-right, .toolbar-right select { font-size: 11px; }
  .picker-choice { padding: 10px 23px 10px 10px; }
  .picker-choice strong { font-size: 11px; }
  .pending-tray { bottom: max(12px, env(safe-area-inset-bottom)); right: 14px; }
  .pending-tray > header { padding: 9px 12px; }
  .pending-item { padding: 10px 12px; gap: 8px; }
  .queue-section { padding: 18px 20px 0; }
  .section-heading h2 { font-size: 12px; }
  .row-summary { grid-template-columns: 36px minmax(0, 1fr) 62px 14px; gap: 7px 9px; padding: 15px 0; }
  .sender-name { font-size: 14px; }
  .sender-address { font-size: 10px; }
  .subject-line { font-size: 12px; }
  .subject-meta { font-size: 10px; }
  .mail-summary { grid-template-columns: 1fr; gap: 5px; }
  .row-summary > .quick-apply { grid-column: 3; grid-row: 1; align-self: center; width: 62px; min-height: 40px; font-size: 12px; }
  .row-summary > .rule-button { grid-column: 2 / 4; grid-row: 2; font-size: 10px; padding: 5px 8px; }
  .row-chevron { grid-column: 4; }
  .row-actions { grid-template-columns: 1fr 1fr; }
  .row-actions > .secondary-decisions { grid-column: 1 / -1; }
  .filter-control .filter-change { min-width: 40px; }
  .row-actions .btn { min-height: 42px; font-size: 11px; }
  .queue-tail { margin: 18px 20px 0; font-size: 10px; }
  .review-list { padding: 0 20px; }
  .review-controls { padding: 0 20px 12px; font-size: 10px; }
  .review-list .row-summary { grid-template-columns: 36px minmax(0, 1fr) 64px; }
  .review-list .review-number { font-size: 11px; }
  .review-list .row-summary > .quick-apply { grid-column: 3; }
  .swipe-review { padding: 0 12px 16px; }
  .card-navigation { font-size: 11px; margin-bottom: 8px; }
  .swipe-card { min-height: 395px; border-radius: 14px; }
  .card-sender { padding: 16px 16px 12px; gap: 10px; }
  .card-sender h2 { font-size: 16px; }
  .card-sender p { font-size: 11px; }
  .card-recommendation { padding: 0 16px 13px; font-size: 10px; }
  .card-recommendation .rule-button { font-size: 11px; padding: 6px 8px; }
  .card-prior, .card-conflict { padding: 8px 16px; }
  .swipe-content { padding: 16px 16px 10px; max-height: clamp(210px, calc(100dvh - 510px), 500px); }
  .swipe-content h3 { font-size: 18px; }
  .swipe-content .email-body { font-size: 14px; }
  .card-footer { padding: 13px 14px 12px; }
  .card-actions .btn { font-size: 12px; min-height: 46px; }
  .card-actions .quick-apply svg { display: block; }
  .options-sheet { margin: auto 0 0; width: 100%; max-width: none; max-height: calc(100dvh - 40px); border-radius: 20px 20px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .options-sheet .dialog-targets { margin: 12px 0; }
  .options-sheet .dialog-body { padding-bottom: 10px; }
  .option-list button { padding: 12px 6px; min-height: 67px; }
  .card-mode .demo-switch { display: none; }
  .card-mode .main-nav { padding-bottom: 10px; }
  .card-mode .page-heading { padding-top: 14px; padding-bottom: 13px; }
  .card-mode .page-footer { display: none; }
  .card-mode .card-privacy { margin-bottom: 4px; }
}

/* HEY's published dark surfaces, with its blue/outlined button treatment. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #1b2733;
  --paper: #202c38;
  --surface: #262f3a;
  --ink: #ece9e6;
  --muted: #b0b4b9;
  --line: #ece9e626;
  --green: #69f0ae;
  --green-soft: #283b38;
  --blue: #50a2ff;
  --blue-soft: #28394f;
  --purple: #a49dff;
  --purple-soft: #343d5a;
  --coral: #de8983;
  --amber: #f9d57a;
  --amber-soft: #3c3a3d;
  --red: #ff7878;
  --shadow: 0 8px 36px #00000024, 0 1px 3px #00000040;
}
[data-theme="dark"] body {
  background: var(--canvas);
}
[data-theme="dark"] main,
[data-theme="dark"] dialog { border-color: var(--line); }
[data-theme="dark"] dialog::backdrop { background: #00000099; }
[data-theme="dark"] .profile { background: #6c43f6; box-shadow: 0 0 0 4px #ffffff08; }
[data-theme="dark"] .nav-item:hover:not(.active) { background: var(--surface); }
[data-theme="dark"] .nav-item.active { background: var(--surface); color: var(--ink); box-shadow: inset 0 -2px var(--blue); }
[data-theme="dark"] .nav-item span { background: var(--surface); color: var(--muted); }
[data-theme="dark"] .nav-item.active span { background: #ece9e611; color: var(--ink); }
[data-theme="dark"] .btn { background: transparent; color: var(--ink); border-color: #ece9e650; }
[data-theme="dark"] .btn:hover { background: #ece9e60d; border-color: #ece9e680; }
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover { background: var(--blue); color: #1b2733; border-color: var(--blue); }
[data-theme="dark"] .btn-primary:hover { background: #77b7ff; }
[data-theme="dark"] .btn-primary .spinner { border-color: #1b273326; border-top-color: #1b2733; }
[data-theme="dark"] .btn-keep { background: transparent; color: var(--ink); border-color: #ece9e650; }
[data-theme="dark"] .btn-once { background: transparent; color: #8bc1ff; border-color: #50a2ff88; }
[data-theme="dark"] .btn-text { background: transparent; }
[data-theme="dark"] .toolbar,
[data-theme="dark"] .preview-metadata,
[data-theme="dark"] .history-detail,
[data-theme="dark"] .dialog-actions,
[data-theme="dark"] .dialog-targets,
[data-theme="dark"] .card-footer,
[data-theme="dark"] .queue-popover > header,
[data-theme="dark"] .queue-popover footer,
[data-theme="dark"] .queued-history,
[data-theme="dark"] .segmented { background: var(--surface); }
[data-theme="dark"] .search-wrap input::placeholder { color: var(--muted); }
[data-theme="dark"] kbd { background: var(--surface); color: var(--muted); border-color: var(--line); }
[data-theme="dark"] .search-toggle:hover,
[data-theme="dark"] .search-toggle[aria-expanded="true"],
[data-theme="dark"] .dialog-close:hover,
[data-theme="dark"] .option-list button:hover { background: #ffffff08; }
[data-theme="dark"] .dialog-close,
[data-theme="dark"] .bulk-clear,
[data-theme="dark"] .bulk-toolbar .bulk-count { color: var(--muted); }
[data-theme="dark"] .mail-row.selected { background: #50a2ff0d; }
[data-theme="dark"] .rule-button { background: var(--surface); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .rule-button.receipt { background: var(--surface); color: var(--amber); border-color: var(--line); }
[data-theme="dark"] .rule-button.notification { background: var(--surface); color: #8bc1ff; border-color: var(--line); }
[data-theme="dark"] .rule-button.application { background: var(--surface); color: var(--purple); border-color: var(--line); }
[data-theme="dark"] .sage { background: var(--surface); color: #b0c5c0; }
[data-theme="dark"] .sand { background: var(--amber-soft); color: var(--amber); }
[data-theme="dark"] .sky { background: var(--blue-soft); color: var(--blue); }
[data-theme="dark"] .rose { background: #422823; color: var(--coral); }
[data-theme="dark"] .lilac { background: var(--purple-soft); color: var(--purple); }
[data-theme="dark"] .peach { background: #402a3d; color: #edb9dd; }
[data-theme="dark"] .avatar-selector:hover .avatar { box-shadow: 0 0 0 3px #ffffff0d; }
[data-theme="dark"] .avatar-selector input:checked + .avatar { color: #20182e; }
[data-theme="dark"] .email-preview,
[data-theme="dark"] .dialog-select,
[data-theme="dark"] .picker-choice,
[data-theme="dark"] .queue-popover { background: var(--paper); }
[data-theme="dark"] .recommendation-note,
[data-theme="dark"] .dialog-callout { background: var(--blue-soft); color: #8bc1ff; }
[data-theme="dark"] .notice,
[data-theme="dark"] .notice .btn,
[data-theme="dark"] .dialog-callout.amber,
[data-theme="dark"] .progress-step.failed { background: var(--amber-soft); color: var(--amber); border-color: #e7cc8326; }
[data-theme="dark"] .history-symbol,
[data-theme="dark"] .empty-illustration,
[data-theme="dark"] .review-intro,
[data-theme="dark"] .progress-step.success { background: var(--green-soft); color: var(--green); border-color: #8ddab526; }
[data-theme="dark"] .history-symbol.once { background: var(--blue-soft); color: var(--blue); }
[data-theme="dark"] .history-symbol.snooze,
[data-theme="dark"] .history-symbol.partial { background: var(--amber-soft); color: var(--amber); }
[data-theme="dark"] .progress-step.pending { color: var(--muted); }
[data-theme="dark"] .spinner { border-color: #ffffff26; border-top-color: var(--green); }
[data-theme="dark"] .bulk-toolbar { background: #202c38f5; border-color: var(--line); }
[data-theme="dark"] #toast { background: #2b3338; color: var(--ink); border: 1px solid var(--line); }
[data-theme="dark"] .segmented button[aria-pressed="true"] { background: #35303f; color: var(--purple); }
[data-theme="dark"] .swipe-card { box-shadow: var(--shadow); }
[data-theme="dark"] .swipe-label { background: var(--surface); }
[data-theme="dark"] .swipe-label-right { color: var(--green); }
[data-theme="dark"] .card-prior { background: var(--purple-soft); }
[data-theme="dark"] .picker-choice:hover,
[data-theme="dark"] .picker-choice[aria-pressed="true"] { background: var(--blue-soft); border-color: #50a2ff80; }
[data-theme="dark"] .undo-toggle { background: var(--surface); color: var(--ink); border-color: #ece9e650; }
[data-theme="dark"] .shared-countdown { color: #8bc1ff; }

/* Destination groups share one ordering contract across rules and Gmail labels. */
.destination-section { margin: 24px 0 0; }
.destination-section > h3, .choice-section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; font-size: 12px; font-weight: 700; color: var(--ink); }
.destination-section > h3 span, .choice-section-label span { font-size: 10px; font-weight: 400; color: var(--muted); }
.review-move-labels .choice-section-label { margin: 8px 0 2px; }
.destination-picker #dialog-title:focus { outline: none; }
.destination-picker .picker-choice strong, .destination-picker .picker-choice small { overflow-wrap: anywhere; }

/* Mobile rows have room for both message identity and full action labels. */
@media (max-width: 650px) {
  :root { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .queue-section, .review-list { padding-left: 16px; padding-right: 16px; }
  .interactive-mail-row .row-summary,
  .review-list .interactive-mail-row .row-summary { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 10px 8px; padding: 18px 0; align-items: start; }
  .interactive-mail-row .mail-summary { grid-column: 2 / -1; grid-row: 1; gap: 7px; min-width: 0; width: 100%; }
  .interactive-mail-row .sender-name { font-size: 14px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
  .interactive-mail-row .sender-address { margin-top: 4px; font-size: 11px; }
  .interactive-mail-row .subject-line { font-size: 13px; line-height: 1.5; }
  .interactive-mail-row .subject-meta { font-size: 10px; line-height: 1.5; }
  .interactive-mail-row .row-summary.has-row-menu .sender-block { padding-right: 44px; }
  .interactive-mail-row .row-summary > .row-more { grid-column: 3; grid-row: 1; width: 36px; height: 44px; padding: 0; justify-content: center; align-self: start; z-index: 1; }
  .interactive-mail-row .row-summary > .row-more svg { width: 18px; height: 18px; }
  .interactive-mail-row .row-summary > .rule-button { grid-column: 2; grid-row: 2; align-self: center; max-width: 100%; min-height: 36px; font-size: 11px; padding: 7px 9px; }
  .interactive-mail-row .row-summary > .quick-apply,
  .review-list .interactive-mail-row .row-summary > .quick-apply { grid-column: 3 / 5; grid-row: 2; width: 100%; min-width: 0; min-height: 44px; padding: 10px 8px; font-size: 12px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; align-self: center; }
  .interactive-mail-row .review-bottom-actions .secondary-decisions { min-width: 0; }
  .interactive-mail-row .review-bottom-actions .btn { min-width: 0; white-space: normal; line-height: 1.3; overflow-wrap: anywhere; }
  .interactive-mail-row .row-controls { grid-column: 2 / -1; grid-row: 2; display: flex; justify-content: flex-start; gap: 0; width: max-content; min-width: 0; max-width: 100%; }
  .interactive-mail-row .row-controls .quick-apply { order: 0; width: auto; min-width: 0; min-height: 44px; padding: 8px 12px; flex: 1; white-space: normal; font-size: 12px; text-align: left; }
  .row-controls .desktop-action-label { display: none; }
  .row-controls .mobile-action-label { display: inline-flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
  .row-controls .mobile-action-label svg { display: block; flex: none; width: 12px; height: 12px; }
  .interactive-mail-row .row-controls .rule-button { min-width: 0; max-width: none; min-height: 44px; padding: 8px 10px; font-size: 11px; }
  .interactive-mail-row .has-primary-destination .quick-apply { border-radius: 7px 0 0 7px; border-right: 0; }
  .interactive-mail-row .has-primary-destination .rule-button { order: 1; align-self: stretch; flex: 0 0 44px; width: 44px; border-radius: 0 7px 7px 0; border: 1px solid #139c8038; border-left-color: #231c3326; background: var(--lime); color: var(--ink); justify-content: center; }
  .interactive-mail-row .has-primary-destination .destination-name { display: none; }
  [data-theme="dark"] .interactive-mail-row .has-primary-destination .rule-button { background: var(--blue); color: #1b2733; border-color: var(--blue); border-left-color: #1b273333; }
  .interactive-mail-row .destination-chevron { display: inline-flex; flex: none; }
  .destination-chevron svg { width: 11px; height: 11px; }
  /* One page scroll on phones: native body scrolling otherwise consumes swipes. */
  .interactive-mail-row .email-body { max-height: none; overflow: visible; }
  .heading-aside .btn, .search-toggle { min-height: 44px; }
  input[type="search"], .label-search input, .search-wrap input { font-size: 16px; }
  button { touch-action: manipulation; }
  dialog.destination-picker[open] { position: fixed; inset: auto 0 0; display: flex; flex-direction: column; margin: 0; width: 100%; max-width: 100%; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px); border-radius: 18px 18px 0 0; }
  .destination-picker .dialog-top { flex: none; padding: 10px 20px 0; }
  .destination-picker .dialog-close { width: 44px; height: 44px; align-items: center; justify-content: center; }
  .destination-picker .dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 8px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .destination-picker .dialog-body h2 { font-size: 24px; margin-bottom: 8px; }
  .destination-picker .dialog-body > p { font-size: 12px; line-height: 1.6; }
  .destination-picker .dialog-targets { margin: 14px 0 20px; padding: 0 0 14px; max-height: 110px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
  .destination-picker .dialog-targets strong { font-size: 13px; }
  .destination-picker .dialog-targets small { font-size: 11px; }
  .destination-picker .destination-section { margin-top: 20px; }
  .destination-picker .picker-choices { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
  .destination-picker .picker-choice { min-width: 0; min-height: 56px; padding: 11px 36px 11px 14px; gap: 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
  .destination-picker .picker-choice:last-child { border-bottom: 0; }
  .destination-picker .picker-choice strong { font-size: 13px; }
  .destination-picker .picker-choice small { font-size: 11px; line-height: 1.4; }
  .destination-picker .picker-choice[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--line); }
  .destination-picker .picker-choice svg { top: 16px; right: 12px; }
  .destination-picker .picker-choice:focus-visible { outline-offset: -3px; }
  .destination-picker .dialog-actions { display: none; }
  .destination-picker .picker-caption:last-of-type { margin-top: 18px; }
}

/* Mobile action group: labels take their natural width without adding a row. */
@media (max-width: 650px) {
  [data-mobile-actions="stacked"] .interactive-mail-row .row-summary { grid-template-columns: 36px minmax(0, 1fr) minmax(88px, max-content) 32px; gap: 10px 8px; }
  [data-mobile-actions="stacked"] .interactive-mail-row .mail-summary { grid-column: 2; grid-row: 1; }
  [data-mobile-actions="stacked"] .row-summary.has-row-menu .sender-block { padding-right: 0; }
  [data-mobile-actions="stacked"] .interactive-mail-row .row-controls { grid-column: 3 / -1; grid-row: 1; display: flex; flex-direction: column; align-items: flex-end; width: max-content; min-width: 128px; max-width: none; gap: 2px; }
  [data-mobile-actions="stacked"] .interactive-mail-row .row-controls .quick-apply { align-self: flex-start; flex: none; width: 88px; min-height: 44px; border-radius: 7px; border-right: 1px solid var(--line); text-align: center; white-space: nowrap; padding: 8px; }
  [data-mobile-actions="stacked"] .interactive-mail-row .row-controls .btn-primary { border-color: transparent; }
  [data-mobile-actions="stacked"] .interactive-mail-row .row-controls:not(.has-primary-destination) .quick-apply { width: auto; min-width: 88px; }
  [data-mobile-actions="stacked"] .row-controls .desktop-action-label { display: inline; }
  [data-mobile-actions="stacked"] .row-controls .mobile-action-label { display: none; }
  [data-mobile-actions="stacked"] .interactive-mail-row .row-controls .rule-button { align-self: flex-end; flex: none; width: max-content; max-width: none; min-height: 44px; padding: 5px 2px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; white-space: nowrap; justify-content: center; }
  [data-mobile-actions="stacked"] .interactive-mail-row .row-controls .destination-name { display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  [data-mobile-actions="stacked"] .interactive-mail-row .row-summary > .row-more { grid-column: 4; grid-row: 1; width: 32px; min-width: 32px; }
}
@media (max-width: 380px) {
  [data-mobile-actions="stacked"] .interactive-mail-row .row-summary { grid-template-columns: 28px minmax(0, 1fr) minmax(80px, max-content) 28px; column-gap: 6px; }
  [data-mobile-actions="stacked"] .interactive-mail-row .row-controls { min-width: 114px; }
  [data-mobile-actions="stacked"] .interactive-mail-row .row-controls .quick-apply { width: 80px; }
  [data-mobile-actions="stacked"] .interactive-mail-row .row-summary > .row-more { width: 28px; min-width: 28px; }
  [data-mobile-actions="stacked"] .avatar { width: 28px; height: 28px; }
}
/* Keep Review's independent controls, without the old reserved menu column. */
@media (max-width: 650px) {
  [data-mobile-actions="stacked"] .review-list .interactive-mail-row .row-summary { grid-template-columns: 36px minmax(0, 1fr) auto; }
  [data-mobile-actions="stacked"] .review-list .interactive-mail-row .row-controls { grid-column: 3; width: max-content; min-width: 88px; max-width: min(160px, 42vw); gap: 4px; }
  [data-mobile-actions="stacked"] .review-list .interactive-mail-row .row-controls .quick-apply { width: 88px; align-self: flex-end; border-radius: 7px; }
  [data-mobile-actions="stacked"] .review-list .interactive-mail-row .row-controls .rule-button { align-self: flex-end; width: max-content; max-width: 100%; min-height: 28px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
  [data-mobile-actions="stacked"] .review-list .interactive-mail-row .row-controls .destination-name { white-space: normal; text-align: left; overflow: visible; overflow-wrap: anywhere; }
  [data-mobile-actions="stacked"] .review-list .interactive-mail-row .row-summary { padding-top: 12px; padding-bottom: 8px; }
  [data-mobile-actions="stacked"] .review-list .interactive-mail-row .email-preview { margin-bottom: 8px; }
  [data-mobile-actions="stacked"] .review-list .interactive-mail-row { padding-bottom: 0; }
}
@media (max-width: 380px) {
  [data-mobile-actions="stacked"] .review-list .interactive-mail-row .row-summary { grid-template-columns: 28px minmax(0, 1fr) auto; }
}
/* Mobile Review: sender left, destination and Apply together on the right. */
@media (max-width: 650px) {
  [data-mobile-actions="stacked"] .review-list .review-header-trial .row-summary { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; padding: 12px 0 10px; align-items: center; }
  [data-mobile-actions="stacked"] .review-list .review-header-trial .mail-summary { grid-column: 2; grid-row: 1; }
  [data-mobile-actions="stacked"] .review-list .review-header-trial .row-controls { grid-column: 3; grid-row: 1; flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; width: clamp(144px, 44vw, 184px); min-width: 0; max-width: none; }
  [data-mobile-actions="stacked"] .review-list .review-header-trial .row-controls .quick-apply { order: 1; align-self: auto; flex: none; width: 64px; min-width: 64px; padding: 8px 6px; }
  [data-mobile-actions="stacked"] .review-list .review-header-trial .row-controls .rule-button { order: 0; align-self: auto; flex: 1 1 0; width: auto; min-width: 0; max-width: none; min-height: 44px; padding: 6px 8px; white-space: normal; overflow-wrap: anywhere; }
  [data-review-layout="right-thumb"] .queue-section .interactive-mail-row:not(.is-open) .row-summary { padding-bottom: 12px; }
}
@media (max-width: 380px) {
  [data-mobile-actions="stacked"] .review-list .review-header-trial .row-summary { grid-template-columns: 28px minmax(0, 1fr) auto; column-gap: 6px; }
}
@media (max-width: 380px) {
  .masthead { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 6px 10px; }
  .masthead .wordmark { grid-column: 1; grid-row: 1; }
  .masthead .profile { grid-column: 2; grid-row: 1; }
}
[data-theme="dark"] .filter-control .filter-change { border-left-color: #1b273355; }
[data-theme="dark"] .pending-item .btn { background: var(--surface); }
[data-theme="dark"] .pending-item.partial,
[data-theme="dark"] .pending-item.failed { background: var(--amber-soft); }
[data-theme="dark"] .skeleton-circle,
[data-theme="dark"] .skeleton-lines i { background-image: linear-gradient(90deg, #202428, #2b3036, #202428); }

/* First visit: a small invitation anchored to Review, with no blocking overlay. */
.heading-aside { position: relative; }
.review-start { position: absolute; right: 0; top: calc(100% + 9px); z-index: 3; display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--blue); border-radius: 8px; background: var(--blue-soft); color: var(--ink); box-shadow: 0 4px 12px #00000016; white-space: nowrap; font: inherit; font-size: 12px; cursor: pointer; }
.review-start::before { content: ''; position: absolute; top: -5px; right: 28px; width: 8px; height: 8px; background: var(--blue-soft); border-top: 1px solid var(--blue); border-left: 1px solid var(--blue); transform: rotate(45deg); }
.review-start svg { width: 14px; height: 14px; }
.queue-flight { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 12px 16px; }
.queue-flight svg { width: 22px; height: 22px; flex-shrink: 0; }
.queue-flight span { min-width: 0; }
.queue-flight strong, .queue-flight small { display: block; overflow: hidden; text-overflow: ellipsis; }
.queue-flight small { color: var(--muted); margin-top: 3px; font-size: 10px; font-weight: 400; }
/* A brief demonstration teaches Review's email gestures without moving real mail. */
.review-gesture-guide { display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); align-items: center; gap: 12px; max-width: 580px; margin: 14px auto 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.gesture-choice { text-align: center; min-width: 0; }
.gesture-choice strong { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; color: var(--ink); }
.gesture-choice strong svg { width: 14px; height: 14px; }
.gesture-choice small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.gesture-track { display: flex; align-items: center; justify-content: center; height: 48px; }
.gesture-email { position: relative; display: grid; grid-template-columns: 16px 22px; align-items: center; gap: 4px; padding: 10px; border: 1px solid var(--blue); border-radius: 8px; background: var(--paper); box-shadow: 0 3px 9px #00000014; }
.gesture-email svg { width: 16px; height: 16px; grid-row: 1 / 3; color: var(--blue); }
.gesture-email i { height: 3px; border-radius: 2px; background: var(--line); }
.gesture-email i:last-child { width: 14px; }
.review-gesture-guide.is-animated .gesture-email { animation: teach-email-swipe 4s ease-in-out 1; }
.review-gesture-guide.is-animated .gesture-left strong { animation: teach-move-button 4s ease-in-out 1; }
.review-gesture-guide.is-animated .gesture-right strong { animation: teach-apply-button 4s ease-in-out 1; }
@keyframes teach-email-swipe { 0%, 12%, 48%, 60%, 100% { transform: translateX(0) rotate(0); } 25%, 35% { transform: translateX(-24px) rotate(-5deg); } 73%, 83% { transform: translateX(24px) rotate(5deg); } }
@keyframes teach-move-button { 0%, 12%, 48%, 100% { transform: translateY(0); color: var(--ink); } 25%, 35% { transform: translateY(-5px); color: var(--blue); } }
@keyframes teach-apply-button { 0%, 60%, 100% { transform: scale(1); color: var(--ink); } 73%, 83% { transform: translateY(2px) scale(.94); color: var(--blue); } }
@media (max-width: 650px) { .review-gesture-guide { gap: 7px; padding: 10px 8px; grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1fr); } .gesture-choice strong { font-size: 11px; gap: 3px; } .gesture-choice small { font-size: 9px; } }
@media (prefers-reduced-motion: reduce) { .review-gesture-guide.is-animated .gesture-email, .review-gesture-guide.is-animated .gesture-choice strong { animation: none; } }

.demo-reset { flex-shrink: 0; margin-left: auto; font-size: 11px; }
@media (max-width: 650px) { .main-nav .demo-reset { min-height: 44px; margin-right: 5px; } }

/* Use the same sender, subject and action columns for every desktop row. */
@media (min-width: 651px) {
  .queue-section .row-summary { display: grid; grid-template-columns: 40px minmax(0, 1fr) 204px 32px; }
  .queue-section .mail-summary { grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); width: 100%; }
  .queue-section .row-controls { width: 204px; justify-content: flex-end; }
  .queue-section .rule-button { min-width: 0; max-width: 116px; white-space: normal; text-align: center; }
  .queue-section .destination-name { overflow-wrap: normal; }
}
