[hidden] { display: none !important; }

.account-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 201, 255, 0.17), transparent 26rem),
    radial-gradient(circle at 90% 6%, rgba(255, 213, 31, 0.11), transparent 21rem),
    linear-gradient(180deg, #020914 0%, #061527 42rem, #f4f8fc 42rem, #f4f8fc 100%);
}

/* Account-only links (shown by account.js) under the shared site header. */
.account-nav { display: flex; align-items: center; gap: 22px; margin: -48px 0 24px; color: #bad0e3; font-size: 0.94rem; font-weight: 750; }
.account-nav:not(:has(a:not([hidden]))) { display: none; }
.account-nav a:hover { color: #fff; }
.account-footer { color: #b7c9da; background: #020914; border-top: 1px solid rgba(123, 198, 255, 0.18); }
.account-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 78px; padding-block: 16px; }
.account-footer-inner p { margin: 0; font-weight: 750; }
.account-footer nav { display: flex; flex-wrap: wrap; gap: 12px 22px; }
.account-footer a { color: #b7c9da; text-decoration: underline; text-underline-offset: 3px; }
.account-footer a:hover { color: #fff; }
.account-main { max-width: 1180px; padding: 112px 0 88px; }
.account-hero { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr); gap: 34px; align-items: stretch; margin-bottom: 28px; }
.account-main > *, .account-hero > *, .account-panel > *, .download-grid > *, .workflow-grid > *, .account-details > * { min-width: 0; }
.account-hero-copy, .launch-card, .account-panel {
  border: 1px solid rgba(122, 198, 255, 0.24);
  border-radius: 30px;
  box-shadow: 0 30px 90px rgba(0, 16, 43, 0.24);
}
.account-hero-copy { padding: clamp(28px, 5vw, 54px); background: rgba(3, 16, 31, 0.78); backdrop-filter: blur(18px); }
.account-main h1 { max-width: 820px; margin: 0; font-size: clamp(2.7rem, 5.7vw, 5.45rem); line-height: .98; letter-spacing: -.065em; }
.account-main h1, .account-main h2, .account-main h3, .account-main p, .account-main li, .account-main dd { overflow-wrap: break-word; }
.account-main h2 { margin: 0; font-size: clamp(1.55rem, 2.8vw, 2.28rem); line-height: 1.12; letter-spacing: -.04em; }
.account-main h3 { margin: 0 0 12px; font-size: 1.1rem; letter-spacing: -.02em; }
.account-main .hero-lead { max-width: 690px; margin-top: 24px; color: #c7d7e6; }
.account-status-card { display: flex; gap: 14px; align-items: flex-start; max-width: 660px; margin-top: 30px; padding: 17px 18px; border: 1px solid rgba(0, 201, 255, .24); border-radius: 18px; background: rgba(0, 201, 255, .07); }
.account-status-card strong { display: block; color: #fff; }
.account-status-card span:not(.status-dot) { display: block; color: #96b1c9; font-size: .86rem; }
.status-dot { width: 12px; height: 12px; flex: 0 0 auto; margin-top: 7px; border-radius: 50%; background: #ffd51f; box-shadow: 0 0 0 7px rgba(255, 213, 31, .12); }
body[data-membership="premium"] .status-dot { background: #39e58c; box-shadow: 0 0 0 7px rgba(57, 229, 140, .13); }
body[data-membership="unavailable"] .status-dot { background: #ff8a8a; box-shadow: 0 0 0 7px rgba(255, 138, 138, .12); }
.account-actions { margin-top: 26px; }
.launch-card { position: relative; overflow: hidden; padding: clamp(26px, 4vw, 40px); background: linear-gradient(150deg, rgba(255,255,255,.98), rgba(230, 244, 255, .95)); color: #071221; }
.launch-card::after { content: ""; position: absolute; inset: auto -18% -34% 28%; height: 230px; border-radius: 999px; background: rgba(0, 125, 255, .12); filter: blur(22px); }
.launch-label { display: inline-flex; padding: 6px 10px; border-radius: 999px; color: #003b67; background: #dff5ff; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.launch-card h2 { margin-top: 26px; color: #06182b; }
.launch-card ul { position: relative; z-index: 1; display: grid; gap: 12px; padding: 0; margin: 26px 0 0; list-style: none; }
.launch-card li { color: #344a5e; font-weight: 750; }
.launch-card li::before { content: "✓"; margin-right: 10px; color: #008add; font-weight: 900; }

.account-panel { margin-top: 18px; padding: clamp(22px, 4vw, 36px); background: rgba(255, 255, 255, .96); color: #071221; }
.account-panel-feature { border-color: rgba(0, 151, 255, .3); }
.account-panel-downloads { background: #fff; }
.account-panel-muted { background: rgba(255,255,255,.88); box-shadow: 0 16px 46px rgba(8, 33, 59, 0.08); }
.workspace-hub { border-color: rgba(0, 151, 255, .32); }
.workspace-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.workspace-card { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; min-height: 220px; padding: 18px; border: 1px solid #dbe6f1; border-radius: 18px; background: linear-gradient(180deg, #fbfdff, #f4f8fc); }
.workspace-card h3 { margin: 0; color: #071221; }
.workspace-card p { flex: 1; margin: 0; font-size: .9rem; line-height: 1.55; }
.workspace-card-state { padding: 4px 8px; border-radius: 999px; color: #07592e; background: #e3f8eb; font-size: .68rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.workspace-card-unavailable { background: #f5f7f9; }
.workspace-card-unavailable .workspace-card-state { color: #495d70; background: #e8eef4; }
.workspace-card .button { margin-top: auto; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.account-panel .eyebrow { margin-bottom: 8px; color: #0070cf; }
.panel-copy, .download-message, .account-panel p { color: #52687c; line-height: 1.7; }
.membership-badge { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border-radius: 999px; color: #003b67; background: #dff5ff; font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
body[data-membership="premium"] .membership-badge { color: #063f24; background: #dffbea; }
body[data-membership="unavailable"] .membership-badge { color: #641515; background: #ffe6e6; }
.account-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0; margin: 24px 0; }
.account-details div { padding: 18px; border: 1px solid #dbe6f1; border-radius: 18px; background: #f7fbff; }
.account-details dt { color: #5c7186; font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.account-details dd { margin: 8px 0 0; color: #071221; font-size: 1.15rem; font-weight: 850; text-align: left; text-transform: capitalize; }
.account-main button:disabled { opacity: .58; cursor: wait; }

.download-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 22px 0; }
.download-card { min-height: 250px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px; border: 1px solid #dbe6f1; border-radius: 22px; background: linear-gradient(180deg, #fafdff, #f1f7fe); }
.platform-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #006ecd; background: #e5f5ff; font-size: 1.18rem; font-weight: 900; }
.download-card strong { display: block; color: #071221; font-size: 1.25rem; }
.download-card small { color: #62788d; font-weight: 750; }
.download-card p { margin: 8px 0 0; }
.download-card .download-button { margin-top: auto; color: #10130b; text-decoration: none; }
.download-note { display: block; margin-top: 10px; color: #60768a; font-size: .82rem; }
.download-requirement { color: var(--hf-text-2); font-size: .84rem; line-height: 1.45; }
.download-requirement a { color: var(--hf-accent); font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.download-requirements { margin: 0 0 22px; padding: 20px 22px; border: 1px solid var(--hf-border); border-radius: 22px; background: var(--hf-surface-2); }
.download-requirements h3 { margin: 0 0 12px; color: var(--hf-text); font-size: 1.05rem; }
.download-requirements dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.download-requirements dt { color: var(--hf-text); font-weight: 850; }
.download-requirements dd { margin: 4px 0 0; color: var(--hf-text-2); font-size: .9rem; line-height: 1.6; }
.download-requirements code { padding: 1px 5px; border-radius: 6px; background: var(--hf-surface-3); font-size: .85em; white-space: nowrap; }

.advanced-details { border: 0; }
.advanced-details summary { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; list-style: none; cursor: pointer; }
.advanced-details summary::-webkit-details-marker { display: none; }
.advanced-details summary::after { content: "+"; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #bdd4e9; border-radius: 50%; color: #006ecd; font-size: 1.35rem; }
.advanced-details[open] summary::after { content: "−"; }
.advanced-details summary span { color: #071221; font-size: 1.35rem; font-weight: 850; letter-spacing: -.03em; }
.advanced-details summary small { display: block; margin-top: 4px; color: #65788b; font-size: .92rem; line-height: 1.45; }
.advanced-body { margin-top: 28px; padding-top: 26px; border-top: 1px solid #dbe6f1; }
.workflow-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 20px 0 0; }
.workflow-grid article { padding: 20px; border: 1px solid #dbe6f1; border-radius: 20px; background: #f9fcff; }
.account-form { display: grid; gap: 12px; margin: 16px 0; }
.request-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.request-form .wide-field { grid-column: 1 / -1; }
.account-form label { display: grid; gap: 7px; color: #273f55; font-weight: 760; }
.account-form input, .account-form select, .account-form textarea { width: 100%; padding: 12px; border: 1px solid #bfd0df; border-radius: 12px; background: #fff; color: #03101f; }
.account-form textarea { min-height: 92px; resize: vertical; }
.account-form fieldset { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; border: 1px solid #d5e2ee; border-radius: 14px; padding: 12px; }
.account-form legend { padding: 0 6px; color: #4e6579; font-weight: 850; }
.account-form fieldset label { display: flex; align-items: center; gap: 8px; }
.account-form fieldset input { width: auto; }
.account-list { display: grid; gap: 8px; padding: 0; margin: 12px 0 0; list-style: none; }
.account-list li { padding: 12px 0 0; border-top: 1px solid #dbe6f1; color: #273f55; }
.account-list small { display: block; color: #65788b; margin-top: 3px; }
.account-list-action { margin-top: 10px; }
.account-list-action + .account-list-action { margin-left: 8px; }
.connector-vault { margin-top: 24px; padding-top: 20px; border-top: 1px solid #dbe6f1; }
.connector-vault > h3 { margin-top: 18px; }
.workspace-story-steps { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; color: #273f55; font-size: .95rem; line-height: 1.5; }
.workspace-story-steps li { position: relative; padding-left: 18px; }
.workspace-story-steps li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: #006ecd; }
.workspace-story-steps strong { color: #071221; }
.workspace-story-next { margin: 16px 0 24px; }
.workspace-hub-subtitle { margin: 0 0 6px; color: #071221; font-size: 1.15rem; }
.connector-action-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.checkout-fineprint { margin: 18px 0 0; color: #697f93; font-size: .8rem; }
.scope-picker { display: grid; gap: 8px; max-width: 520px; color: #273f55; font-weight: 800; }
.scope-picker select { width: 100%; min-height: 48px; padding: 12px; border: 1px solid #bfd0df; border-radius: 12px; background: #fff; color: #03101f; font: inherit; }
.scope-picker select:disabled { color: #65788b; background: #f1f5f9; }
.scope-status { margin: 12px 0; padding: 12px 14px; border-left: 3px solid #008add; border-radius: 8px; background: #f1f8ff; }
.organization-create-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; max-width: 760px; padding-top: 16px; }
.organization-create-form button { min-height: 46px; }
.organization-members-panel { margin-top: 24px; padding-top: 22px; border-top: 1px solid #dbe6f1; }
.organization-members-panel .panel-heading { align-items: center; margin-bottom: 8px; }
.organization-members-panel h3 { margin: 0; }
.organization-capabilities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.organization-capability { display: grid; gap: 8px; align-content: start; padding: 18px; border: 1px solid #dbe6f1; border-radius: 16px; background: #f8fbfe; }
.employee-mail-body { max-height: 55vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 14px; border-radius: 12px; background: #f4f7fa; color: #162b3d; font: 0.92rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.organization-billing-panel { margin: 24px 0; padding: 22px; border: 1px solid #cbd9e8; border-radius: 18px; background: #fbfdff; }
.organization-billing-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.organization-billing-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin: 16px 0; }
.organization-billing-actions label { flex: 0 1 240px; }
.organization-billing-actions input { min-height: 46px; padding: 10px 12px; border: 1px solid #bfd0df; border-radius: 10px; font: inherit; }
.billing-owner-transfer { margin-top: 20px; padding-top: 18px; border-top: 1px solid #dbe6f1; }
.billing-owner-transfer h4 { margin: 0; color: #071221; }
.billing-owner-candidate-summary { margin: 10px 0; padding: 12px 14px; border-radius: 10px; background: #f1f8ff; color: #273f55; overflow-wrap: anywhere; }
.billing-owner-acknowledgement { display: flex !important; flex: 1 1 100%; align-items: flex-start; gap: 10px !important; font-weight: 650 !important; }
.billing-owner-acknowledgement input { width: auto !important; min-height: 0; margin-top: 4px; }
.organization-capability h3 { margin: 0; color: #071221; }
.organization-capability p { margin: 0; color: #52687c; font-size: .92rem; }
.capability-state { justify-self: start; padding: 4px 9px; border-radius: 999px; color: #495d70; background: #e8eef4; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }

@media (max-width: 920px) {
  .account-hero { grid-template-columns: 1fr; }
  .account-details, .download-grid, .workflow-grid, .request-form, .organization-capabilities, .workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .request-form .wide-field { grid-column: auto; }
  .organization-create-form { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .account-main { padding-top: 84px; }
  .account-hero-copy, .launch-card, .account-panel { border-radius: 24px; }
  .account-hero-copy { padding: 28px; }
  .account-main h1 { font-size: clamp(2.35rem, 11vw, 2.9rem); }
  .account-nav { flex-wrap: wrap; gap: 10px 16px; font-size: .86rem; }
  .account-footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
  .panel-heading { flex-direction: column; }
  .account-details div, .download-card, .workflow-grid article, .workspace-card { padding: 16px; }
  .organization-billing-details { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .advanced-details summary { grid-template-columns: 1fr; }
  .advanced-details summary::after { justify-self: start; }
  .team-brain-columns { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .download-card { min-height: 0; }
  .download-requirements { padding: 16px; }
  .download-requirements dl { grid-template-columns: 1fr; }
}

/* Shared Team Brain reader (read-only org Brain spaces/items) */
.team-brain-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.team-brain-field { font-weight: 700; color: #071221; }
.team-brain-select { padding: 8px 10px; border: 1px solid #c9d7e6; border-radius: 10px; background: #fff; color: #071221; min-width: 220px; }
.team-brain-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.team-brain-column h3 { margin: 0 0 8px; color: #071221; font-size: .95rem; }
.team-brain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.team-brain-list li { margin: 0; }
.team-brain-list button { width: 100%; text-align: left; padding: 10px 12px; border: 1px solid #dbe6f1; border-radius: 12px; background: linear-gradient(180deg, #fbfdff, #f4f8fc); color: #07406e; font: inherit; cursor: pointer; }
.team-brain-list button:hover, .team-brain-list button:focus-visible { border-color: rgba(0, 151, 255, .5); }
.team-brain-body { white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; margin: 6px 0 0; padding: 12px; border-radius: 12px; background: #f4f8fc; color: #071221; font-size: .85rem; line-height: 1.5; }

/* =====================================================================
   Account portal refresh (2026-10): theme tokens (light default + dark
   via prefers-color-scheme and [data-theme]), readable branded buttons,
   theme toggle, and a modern multi-pane Mail client.
   ===================================================================== */
:root {
  --hf-bg: #eef4fb;
  --hf-surface: #ffffff;
  --hf-surface-2: #f3f8fd;
  --hf-surface-3: #e7f0f9;
  --hf-text: #071221;
  --hf-text-2: #41586e;
  --hf-text-3: #6d8298;
  --hf-border: #dde7f2;
  --hf-border-strong: #c4d5e6;
  --hf-accent: #0a6fe0;
  --hf-accent-strong: #0858b4;
  --hf-accent-soft: rgba(10, 111, 224, 0.10);
  --hf-selected: rgba(10, 111, 224, 0.12);
  --hf-ok-text: #0a6c38;
  --hf-ok-soft: #e1f6ea;
  --hf-warn-text: #8a5a00;
  --hf-warn-soft: #fbeecf;
  --hf-crit-text: #b3261e;
  --hf-crit-soft: #fde6e4;
  --hf-demo-text: #5b46c9;
  --hf-demo-soft: #ece8fb;
  --hf-shadow: 0 18px 50px rgba(8, 33, 59, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hf-bg: #060e1b;
    --hf-surface: #0e1a2d;
    --hf-surface-2: #13233a;
    --hf-surface-3: #1d3251;
    --hf-text: #e9f1ff;
    --hf-text-2: #b0c6de;
    --hf-text-3: #7f97b1;
    --hf-border: rgba(123, 198, 255, 0.16);
    --hf-border-strong: rgba(123, 198, 255, 0.30);
    --hf-accent: #58abff;
    --hf-accent-strong: #8cc6ff;
    --hf-accent-soft: rgba(88, 171, 255, 0.16);
    --hf-selected: rgba(88, 171, 255, 0.18);
    --hf-ok-text: #9af4c4;
    --hf-ok-soft: rgba(57, 229, 140, 0.14);
    --hf-warn-text: #f0c46a;
    --hf-warn-soft: rgba(224, 165, 58, 0.16);
    --hf-crit-text: #ff8d93;
    --hf-crit-soft: rgba(255, 107, 115, 0.16);
    --hf-demo-text: #bca9ff;
    --hf-demo-soft: rgba(157, 135, 255, 0.18);
    --hf-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  --hf-bg: #060e1b;
  --hf-surface: #0e1a2d;
  --hf-surface-2: #13233a;
  --hf-surface-3: #1d3251;
  --hf-text: #e9f1ff;
  --hf-text-2: #b0c6de;
  --hf-text-3: #7f97b1;
  --hf-border: rgba(123, 198, 255, 0.16);
  --hf-border-strong: rgba(123, 198, 255, 0.30);
  --hf-accent: #58abff;
  --hf-accent-strong: #8cc6ff;
  --hf-accent-soft: rgba(88, 171, 255, 0.16);
  --hf-selected: rgba(88, 171, 255, 0.18);
  --hf-ok-text: #9af4c4;
  --hf-ok-soft: rgba(57, 229, 140, 0.14);
  --hf-warn-text: #f0c46a;
  --hf-warn-soft: rgba(224, 165, 58, 0.16);
  --hf-crit-text: #ff8d93;
  --hf-crit-soft: rgba(255, 107, 115, 0.16);
  --hf-demo-text: #bca9ff;
  --hf-demo-soft: rgba(157, 135, 255, 0.18);
  --hf-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Page + panel surfaces follow the theme. Hero top stays dark (brand). */
.account-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 201, 255, 0.17), transparent 26rem),
    radial-gradient(circle at 90% 6%, rgba(255, 213, 31, 0.11), transparent 21rem),
    linear-gradient(180deg, #020914 0%, #061527 42rem, var(--hf-bg) 42rem, var(--hf-bg) 100%);
  color: var(--hf-text);
}
.account-page .account-panel,
.account-page .account-panel-downloads,
.account-page .account-panel-muted { background: var(--hf-surface); color: var(--hf-text); border-color: var(--hf-border); box-shadow: var(--hf-shadow); }
.account-page .workspace-card { background: var(--hf-surface-2); border-color: var(--hf-border); }
.account-page .workspace-card h3,
.account-page .account-details dd,
.account-page .download-card strong,
.account-page .advanced-details summary span { color: var(--hf-text); }
.account-page .workspace-card p,
.account-page .panel-copy,
.account-page .download-message,
.account-page .account-panel p { color: var(--hf-text-2); }
.account-page .account-details div,
.account-page .download-card,
.account-page .workflow-grid article { background: var(--hf-surface-2); border-color: var(--hf-border); }
.account-page .account-details dt,
.account-page .account-list small,
.account-page .download-card small,
.account-page .download-note,
.account-page .checkout-fineprint { color: var(--hf-text-3); }
.account-page .account-form label,
.account-page .scope-picker,
.account-page .account-form legend { color: var(--hf-text-2); }
.account-page .account-form input,
.account-page .account-form select,
.account-page .account-form textarea,
.account-page .scope-picker select,
.account-page .hf-mail-mailbox select,
.account-page .hf-mail-search input {
  background: var(--hf-surface); color: var(--hf-text); border: 1px solid var(--hf-border-strong);
}
.account-page .account-form input::placeholder,
.account-page .hf-mail-search input::placeholder { color: var(--hf-text-3); }
.account-page .account-list li { border-top-color: var(--hf-border); color: var(--hf-text-2); }
.account-page .scope-status { color: var(--hf-text-3); }

/* ---- Readable, branded buttons on light/dark panel surfaces ---------- */
.account-panel .button-outline,
.workspace-card .button-outline,
.hf-mail-shell .button-outline {
  color: var(--hf-accent);
  background: var(--hf-accent-soft);
  border-color: var(--hf-accent);
}
.account-panel .button-outline:hover,
.workspace-card .button-outline:hover,
.hf-mail-shell .button-outline:hover {
  color: var(--hf-accent-strong);
  background: color-mix(in srgb, var(--hf-accent) 18%, transparent);
  border-color: var(--hf-accent-strong);
}
.account-panel .button-quiet,
.hf-mail-shell .button-quiet {
  color: var(--hf-text-2);
  background: var(--hf-surface-2);
  border-color: var(--hf-border-strong);
}
.account-panel .button-quiet:hover,
.hf-mail-shell .button-quiet:hover { color: var(--hf-text); background: var(--hf-surface-3); }

/* ---- Workspace "available" state polish ------------------------------ */
.account-page .workspace-card:not(.workspace-card-unavailable) .workspace-card-state { color: var(--hf-ok-text); background: var(--hf-ok-soft); }

/* ---- Theme toggle (sits on the dark hero strip) ---------------------- */
.account-nav { justify-content: flex-start; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 9px; margin-left: auto;
  padding: 6px 12px 6px 7px; border: 1px solid rgba(123, 198, 255, 0.34);
  border-radius: 999px; background: rgba(6, 20, 38, 0.55); color: #d7e6f5;
  font: inherit; font-size: 0.82rem; font-weight: 800; cursor: pointer;
}
.theme-toggle:hover { border-color: rgba(123, 198, 255, 0.6); color: #fff; }
.theme-toggle-track { position: relative; width: 34px; height: 18px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); transition: background .18s ease; }
.theme-toggle-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #ffd51f; transition: transform .18s ease; }
.theme-toggle[aria-pressed="true"] .theme-toggle-track { background: rgba(88, 171, 255, 0.55); }
.theme-toggle[aria-pressed="true"] .theme-toggle-thumb { transform: translateX(16px); background: #cfe6ff; }

/* =====================================================================
   Mail client — AI-native 3-pane redesign (2026-10)
   Folder+smart-view rail | message list | reading pane + docked Assist.
   All styling is class/data-attr driven (CSP style-src 'self': no inline
   styles). Reading-pane position, density and theme are user-customizable
   (View menu + Cmd/Ctrl-K palette), persisted in localStorage by account.js.
   ===================================================================== */
.hf-mail-shell {
  display: grid;
  grid-template-columns: 188px minmax(220px, 0.95fr) minmax(430px, 1.6fr);
  grid-template-areas: "rail list read"; grid-template-rows: minmax(0, 1fr);
  gap: 0; margin-top: 20px; height: clamp(560px, 74vh, 880px);
  border: 1px solid var(--hf-border); border-radius: 20px;
  background: var(--hf-surface); box-shadow: var(--hf-shadow); overflow: hidden;
  container: hf-shell / inline-size;
}
.hf-mail-shell[data-pane="bottom"] {
  grid-template-columns: 188px 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-areas: "rail list" "rail read";
}
.hf-mail-shell[data-pane="off"] { grid-template-columns: 188px 1fr; grid-template-areas: "rail list"; }
.hf-mail-shell[data-pane="off"] .hf-mail-read { display: none; }

/* ---- Folder + smart-view rail --------------------------------------- */
.hf-mail-rail { grid-area: rail; display: flex; flex-direction: column; gap: 14px; padding: 14px 12px; background: var(--hf-surface-2); border-right: 1px solid var(--hf-border); overflow-y: auto; min-height: 0; }
.hf-mail-mailbox { display: grid; gap: 6px; color: var(--hf-text-3); font-size: .72rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.hf-mail-mailbox select { min-height: 42px; padding: 9px 10px; border-radius: 10px; font: inherit; font-weight: 700; }
.hf-mail-compose-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 42px; padding: 10px; border: 0; border-radius: 11px; background: var(--hf-accent); color: #fff; font: inherit; font-weight: 850; cursor: pointer; }
.hf-mail-compose-btn:hover { filter: brightness(1.06); }
.hf-mail-compose-btn[hidden] { display: none; }
.hf-rail-group { display: flex; flex-direction: column; gap: 2px; }
.hf-rail-label { display: flex; align-items: center; gap: 7px; padding: 2px 10px 4px; color: var(--hf-text-3); font-size: .64rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.hf-rail-label svg { width: 12px; height: 12px; color: var(--hf-accent); }
.hf-mail-folders { display: flex; flex-direction: column; gap: 3px; }
.hf-folder-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border: 0; border-left: 3px solid transparent; border-radius: 9px; background: transparent;
  color: var(--hf-text-2); font: inherit; font-weight: 750; font-size: .92rem;
  text-align: left; cursor: pointer; transition: background .14s ease, color .14s ease;
}
.hf-folder-btn svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: .9; }
.hf-folder-btn .hf-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hf-folder-btn .hf-count { color: var(--hf-text-3); font-size: .8rem; font-weight: 800; }
.hf-folder-btn .hf-view-swatch { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.hf-folder-btn:hover { background: var(--hf-surface-3); color: var(--hf-text); }
.hf-folder-btn[aria-pressed="true"] { background: var(--hf-accent-soft); color: var(--hf-text); border-left-color: var(--hf-accent); font-weight: 850; }
.hf-folder-btn[aria-pressed="true"] .hf-count { color: var(--hf-accent); }
.hf-folder-btn:focus-visible, .hf-view-btn:focus-visible { outline: 2px solid var(--hf-accent); outline-offset: -2px; }
.hf-mail-refresh { margin-top: auto; width: 100%; }

/* smart-view swatches by triage class */
.hf-sw-reply { background: var(--hf-accent); }
.hf-sw-alert { background: var(--hf-crit-text); }
.hf-sw-action { background: var(--hf-warn-text); }
.hf-sw-demo { background: var(--hf-demo-text); }
.hf-sw-fyi { background: var(--hf-ok-text); }

/* ---- Message list --------------------------------------------------- */
.hf-mail-list-pane { grid-area: list; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--hf-border); background: var(--hf-bg); }
.hf-mail-shell[data-pane="off"] .hf-mail-list-pane, .hf-mail-shell[data-pane="bottom"] .hf-mail-list-pane { border-right: 0; }
.hf-mail-list-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--hf-border); flex: none; background: var(--hf-surface); }
.hf-mail-list-head h2 { margin: 0; font-size: 1rem; font-weight: 850; color: var(--hf-text); }
.hf-mail-list-head .hf-list-sub { font-size: .78rem; color: var(--hf-text-3); font-weight: 700; }
.hf-mail-list-head .hf-head-spacer { flex: 1; }
.hf-viewbtn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--hf-border-strong); border-radius: 8px; background: var(--hf-surface); color: var(--hf-text-2); font: inherit; font-size: .82rem; font-weight: 750; cursor: pointer; }
.hf-viewbtn:hover { color: var(--hf-text); border-color: var(--hf-accent); }
.hf-viewbtn svg { width: 14px; height: 14px; }
.hf-viewbtn:focus-visible { outline: 2px solid var(--hf-accent); outline-offset: 1px; }
.hf-mail-search { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--hf-border); flex: none; background: var(--hf-surface); }
.hf-mail-search input { flex: 1; min-width: 0; min-height: 38px; padding: 8px 12px; border-radius: 9px; font: inherit; }
.hf-mail-list-pane > .scope-status { margin: 10px 12px; flex: none; }
.hf-mail-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; grid-template-columns: minmax(0, 1fr); gap: 0; align-content: start; }
.hf-mail-list > li { min-width: 0; }
.hf-mail-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  margin: 0; padding: 11px 14px 11px 11px; border-bottom: 1px solid var(--hf-border);
  border-left: 3px solid transparent; cursor: pointer;
}
.hf-mail-list li:hover { background: var(--hf-surface-3); }
.hf-mail-list li.hf-row-selected { background: var(--hf-selected); border-left-color: var(--hf-accent); }
.hf-mail-list li.hf-row-selected:hover { background: var(--hf-selected); }
/* One row = one click target (role=option). Actions reveal on hover/focus. */
.hf-mail-list li.hf-row-message { position: relative; display: block; padding: 10px 14px 10px 26px; user-select: none; }
.hf-mail-list li.hf-row-message:focus { outline: none; }
.hf-mail-list li.hf-row-message:focus-visible { outline: 2px solid var(--hf-accent); outline-offset: -2px; }
.hf-row-message::before { content: ""; position: absolute; left: 10px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.hf-row-message.is-unread::before { background: var(--hf-accent); }
.hf-row-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.hf-row-sender { flex: 1 1 auto; min-width: 0; font-weight: 650; font-size: .93rem; color: var(--hf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-row-message.is-unread .hf-row-sender { font-weight: 850; }
.hf-row-meta { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; color: var(--hf-text-3); }
.hf-row-clip { width: 14px; height: 14px; color: var(--hf-text-3); }
.hf-mail-list .hf-row-date { color: var(--hf-text-3); font-size: .76rem; font-weight: 650; white-space: nowrap; }
.hf-row-message.is-unread .hf-row-date { color: var(--hf-accent); font-weight: 800; }
.hf-row-subject { display: block; font-size: .86rem; color: var(--hf-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-row-message.is-unread .hf-row-subject { color: var(--hf-text); font-weight: 700; }
.hf-row-preview { display: block; margin-top: 1px; font-size: .8rem; color: var(--hf-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-row-tags:empty { display: none; }
.hf-row-tags { display: flex; gap: 6px; margin-top: 4px; }
.hf-row-actions { position: absolute; right: 8px; top: 8px; display: none; gap: 2px; padding: 2px; border-radius: 9px; background: var(--hf-surface); box-shadow: 0 1px 4px rgba(4, 12, 24, .18); }
.hf-mail-list li.hf-row-message:hover .hf-row-actions,
.hf-mail-list li.hf-row-message:focus-within .hf-row-actions,
.hf-mail-list li.hf-row-message.hf-row-selected .hf-row-actions { display: inline-flex; }
.hf-mail-list li.hf-row-message:hover .hf-row-meta,
.hf-mail-list li.hf-row-message:focus-within .hf-row-meta,
.hf-mail-list li.hf-row-message.hf-row-selected .hf-row-meta { visibility: hidden; }
.hf-row-icon { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--hf-text-2); cursor: pointer; }
.hf-row-icon:hover { background: var(--hf-surface-3); color: var(--hf-text); }
.hf-row-icon svg { width: 16px; height: 16px; }
.hf-row-sent, .hf-row-draft { display: flex; flex-wrap: wrap; }
.hf-row-sent { flex-direction: column; align-items: stretch; gap: 3px; cursor: default; }
.hf-row-sent strong { color: var(--hf-text); }
.hf-row-sent small { color: var(--hf-text-3); }
.hf-row-draft { align-items: center; gap: 10px; }
.hf-mail-load-more { margin: 12px; width: calc(100% - 24px); flex: none; }

/* triage chip (per-row and in assist) */
.hf-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 850; letter-spacing: .01em; white-space: nowrap; }
.hf-chip .hf-chip-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.hf-chip-reply { background: var(--hf-accent-soft); color: var(--hf-accent); } .hf-chip-reply .hf-chip-dot { background: var(--hf-accent); }
.hf-chip-fyi { background: var(--hf-ok-soft); color: var(--hf-ok-text); } .hf-chip-fyi .hf-chip-dot { background: var(--hf-ok-text); }
.hf-chip-action { background: var(--hf-warn-soft); color: var(--hf-warn-text); } .hf-chip-action .hf-chip-dot { background: var(--hf-warn-text); }
.hf-chip-alert { background: var(--hf-crit-soft); color: var(--hf-crit-text); } .hf-chip-alert .hf-chip-dot { background: var(--hf-crit-text); }
.hf-chip-demo { background: var(--hf-demo-soft); color: var(--hf-demo-text); } .hf-chip-demo .hf-chip-dot { background: var(--hf-demo-text); }

/* compact density */
.hf-mail-shell[data-density="compact"] .hf-mail-list li { padding-top: 7px; padding-bottom: 7px; }
.hf-mail-shell[data-density="compact"] .hf-mail-list li.hf-row-message { padding-top: 6px; padding-bottom: 6px; }
.hf-mail-shell[data-density="compact"] .hf-row-preview { display: none; }
.hf-mail-shell[data-density="compact"] .hf-row-message::before { top: 13px; }

/* ---- Reading pane + docked Assist ----------------------------------- */
/* Default: the Assist panel is docked directly BELOW the message (a distinct,
   full-width panel — the AI spine, never a row of footer buttons). On a wide
   shell it docks to the RIGHT of the message instead (see @container below). */
.hf-mail-read { grid-area: read; display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.hf-mail-shell[data-pane="bottom"] .hf-mail-read { border-top: 1px solid var(--hf-border); }
@container hf-shell (min-width: 1120px) {
  .hf-mail-read { grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); }
  .hf-mail-assist { max-height: none; }
  .hf-mail-assist { border-left: 1px solid var(--hf-border); border-top: 0; }
}
.hf-mail-reading-pane { position: relative; display: flex; flex-direction: column; min-width: 0; overflow-y: auto; background: var(--hf-surface); }
.hf-mail-empty { display: none; }
.hf-mail-reading-pane:not(:has(#employee-mail-detail:not([hidden]))):not(:has(#employee-mail-compose:not([hidden]))) .hf-mail-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  height: 100%; min-height: 320px; padding: 40px; text-align: center; color: var(--hf-text-3);
}
.hf-mail-empty-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--hf-accent-soft); color: var(--hf-accent); font-size: 1.5rem; }
.hf-mail-detail { margin: 0; border: 0; border-radius: 0; background: transparent; padding: 0 24px 22px; }
.hf-mail-detail h3 { margin: 14px 0 12px; color: var(--hf-text); font-size: 1.25rem; line-height: 1.3; overflow-wrap: anywhere; }
.hf-mail-detail .panel-copy { font-size: .85rem; }
.hf-mail-actionbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 -24px; padding: 8px 16px; border-bottom: 1px solid var(--hf-border); background: var(--hf-surface); }
.hf-act-spacer { flex: 1; }
.hf-act-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--hf-text-2); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.hf-act-btn:hover { background: var(--hf-surface-3); color: var(--hf-text); }
.hf-act-btn:focus-visible { outline: 2px solid var(--hf-accent); outline-offset: -2px; }
.hf-act-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.hf-act-btn[hidden] { display: none; }
.hf-mail-headers { display: flex; align-items: flex-start; gap: 12px; }
@container hf-shell (max-width: 640px) {
  .hf-mail-headers { flex-wrap: wrap; }
  .hf-mail-headers .hf-mail-date { flex: 1 1 100%; padding-left: 50px; }
  .hf-mail-headers .hf-mail-header-lines { flex: 1 1 160px; }
  .hf-mail-detail { padding: 0 16px 18px; }
  .hf-mail-actionbar { margin: 0 -16px; padding: 6px 8px; }
}
.hf-mail-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: var(--hf-accent-soft); color: var(--hf-accent); font-weight: 850; font-size: .95rem; text-transform: uppercase; }
.hf-mail-header-lines { flex: 1; min-width: 0; }
.hf-mail-header-lines p { margin: 0; }
.hf-mail-from { color: var(--hf-text); font-size: .92rem; overflow-wrap: anywhere; }
.hf-mail-address { color: var(--hf-text-3); font-size: .84rem; }
.hf-mail-recipients { margin-top: 2px; color: var(--hf-text-3); font-size: .8rem; overflow-wrap: anywhere; }
.hf-mail-recipients span + span::before { content: "\00a0\00b7\00a0"; }
.hf-mail-date { flex: 0 0 auto; color: var(--hf-text-3); font-size: .78rem; white-space: nowrap; }
.hf-mail-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.hf-mail-attachments[hidden] { display: none; }
.hf-attachment { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; padding: 7px 8px 7px 10px; border: 1px solid var(--hf-border-strong); border-radius: 10px; background: var(--hf-surface-2); }
.hf-attachment svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--hf-text-3); }
.hf-attachment-name { display: block; max-width: 240px; color: var(--hf-text); font-size: .84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-attachment-size { display: block; color: var(--hf-text-3); font-size: .74rem; }
.hf-attachment-warning { color: var(--hf-crit-text); }
.hf-attachment-download { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--hf-accent); cursor: pointer; }
.hf-attachment-download svg { color: inherit; }
.hf-attachment-download:hover { background: var(--hf-accent-soft); }
.hf-attachment-download:disabled { color: var(--hf-text-3); cursor: not-allowed; background: transparent; }
.employee-mail-body { white-space: pre-wrap; word-break: break-word; font: inherit; max-height: none; overflow: visible; margin: 16px 0 0; padding: 4px 0; border: 0; border-radius: 0; background: transparent; color: var(--hf-text); line-height: 1.6; }
.employee-mail-body a { color: var(--hf-accent); text-decoration: underline; overflow-wrap: anywhere; }
.employee-mail-html { margin: 14px 0 0; }
.hf-mail-html-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 12px 0 0; }
#employee-mail-format-toggle { margin-left: auto; }
.hf-mail-shell .hf-mail-html-controls .button { min-height: 0; padding: 4px 10px; border-radius: 8px; font-size: .8rem; }
.hf-mail-html-controls[hidden] { display: none; }
.hf-mail-images-note { color: var(--hf-text-3); font-size: .8rem; }
.hf-mail-images-note:empty { display: none; }
/* Height is set from the measured content (account.js): no inner vertical scrollbar. */
.employee-mail-html-frame { display: block; width: 100%; height: 160px; min-height: 80px; border: 1px solid var(--hf-border); border-radius: 12px; background: #fff; }
.hf-mail-links { margin-top: 12px; font-size: .85rem; }
.hf-mail-links > summary { cursor: pointer; color: var(--hf-text-2); margin-bottom: 8px; }
.hf-mail-links ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hf-mail-link { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--hf-border); border-radius: 8px; background: var(--hf-surface-2); color: var(--hf-text); cursor: pointer; }
.hf-mail-link:hover, .hf-mail-link:focus-visible { border-color: var(--hf-accent, #0b5fff); }
.hf-mail-link-text { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-mail-link-dest { font-size: .78rem; color: var(--hf-text-muted, #7b8aa0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-mail-link-warn { color: var(--hf-crit-text); font-size: .74rem; font-weight: 800; }
.hf-link-status { position: fixed; left: 0; bottom: 0; max-width: min(640px, 90vw); padding: 4px 10px; border: 1px solid var(--hf-border-strong); border-radius: 0 8px 0 0; pointer-events: none; background: var(--hf-surface-2); color: var(--hf-text-2); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2050; }
.hf-link-status[hidden] { display: none; }
.hf-link-status.is-warning { color: var(--hf-crit-text); border-color: var(--hf-crit-text); }
.hf-mail-list-pane > .scope-status:empty { display: none; }
.connector-action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hf-mail-compose { margin: 0; padding: 22px 24px; border-top: 1px solid var(--hf-border); }
.hf-mail-compose h3 { margin: 0 0 4px; color: var(--hf-text); }
.hf-mail-compose textarea { min-height: 150px; resize: vertical; }
.hf-compose-recipients { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.hf-compose-recipients[hidden] { display: none; }
.hf-compose-field { display: grid; gap: 6px; }
.hf-compose-cc { grid-column: 1 / -1; display: grid; gap: 10px; }
.hf-compose-cc[hidden] { display: none; }
.hf-compose-cc-toggle { margin-bottom: 4px; }
.hf-mail-compose-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* ---- Docked HeapFile Assist panel ----------------------------------- */
.hf-mail-assist { display: flex; flex-direction: column; min-width: 0; min-height: 0; max-height: min(40vh, 320px); border-top: 1px solid var(--hf-border); background: var(--hf-surface-2); overflow-y: auto; }
.hf-assist-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 9px; padding: 13px 15px; border-bottom: 1px solid var(--hf-border); background: var(--hf-surface-2); }
.hf-assist-glyph { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--hf-accent); color: #fff; flex: 0 0 auto; }
.hf-assist-glyph svg { width: 15px; height: 15px; }
.hf-assist-head .hf-assist-title { font-weight: 850; font-size: .9rem; color: var(--hf-text); }
.hf-assist-head .hf-assist-title small { display: block; font-weight: 500; font-size: .7rem; color: var(--hf-text-3); letter-spacing: .01em; }
.hf-assist-idle { padding: 20px 16px; color: var(--hf-text-3); font-size: .86rem; line-height: 1.55; }
.hf-mail-assist:has(#employee-mail-ai:not([hidden])) .hf-assist-idle { display: none; }
.hf-mail-ai { padding: 15px 16px; }
.hf-ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hf-ai-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: var(--hf-accent-soft); color: var(--hf-accent); font-size: .64rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.hf-ai-result { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; color: var(--hf-text); }
.hf-ai-result .hf-asec { padding-bottom: 14px; border-bottom: 1px solid var(--hf-border); }
.hf-ai-result .hf-asec:last-child { border-bottom: 0; padding-bottom: 0; }
.hf-ai-result h4 { margin: 0 0 7px; font-size: .64rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: var(--hf-text-3); }
.hf-ai-result ul { margin: 0; padding-left: 18px; }
.hf-ai-result li { margin: 3px 0; color: var(--hf-text-2); font-size: .86rem; }
.hf-ai-result p { margin: 0; color: var(--hf-text); font-size: .9rem; line-height: 1.5; }
.hf-ai-verdict { display: flex; align-items: flex-start; gap: 10px; padding: 11px; border-radius: 10px; background: var(--hf-surface); border: 1px solid var(--hf-border); }
.hf-ai-verdict .hf-ai-why { margin-top: 5px; font-size: .82rem; color: var(--hf-text-2); line-height: 1.5; }
.hf-ai-reply-draft { white-space: pre-wrap; word-break: break-word; margin: 0; padding: 0; border: 0; background: transparent; }
.hf-ai-draft-field { width: 100%; min-height: 104px; resize: vertical; padding: 10px 11px; border-radius: 10px; background: var(--hf-surface); border: 1px solid var(--hf-border-strong); color: var(--hf-text); font: inherit; font-size: .86rem; line-height: 1.5; }
.hf-ai-draft-field:focus { outline: none; border-color: var(--hf-accent); box-shadow: 0 0 0 3px var(--hf-accent-soft); }
.hf-ai-sendnote { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; font-size: .74rem; color: var(--hf-text-3); line-height: 1.4; }
.hf-ai-sendnote svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; color: var(--hf-warn-text); }
.hf-ai-priority { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.hf-ai-priority-urgent { color: #ffffff; background: var(--hf-crit-text); }
.hf-ai-priority-normal { color: var(--hf-accent); background: var(--hf-accent-soft); }
.hf-ai-priority-low { color: var(--hf-text-3); background: var(--hf-surface-3); }

/* ---- View menu (dropdown) + command palette + toast ----------------- */
.hf-viewbtn-wrap { position: relative; }
.hf-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 210px; padding: 7px; border: 1px solid var(--hf-border-strong); border-radius: 12px; background: var(--hf-surface); box-shadow: var(--hf-shadow); }
.hf-menu[hidden] { display: none; }
.hf-menu-label { padding: 7px 10px 4px; color: var(--hf-text-3); font-size: .62rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.hf-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: none; text-align: left; color: var(--hf-text); font: inherit; font-size: .88rem; cursor: pointer; }
.hf-menu-item:hover { background: var(--hf-surface-2); }
.hf-menu-item .hf-menu-check { margin-left: auto; color: var(--hf-accent); opacity: 0; }
.hf-menu-item[aria-checked="true"] .hf-menu-check { opacity: 1; }
.hf-menu-item:focus-visible { outline: 2px solid var(--hf-accent); outline-offset: -2px; }
.hf-menu-sep { height: 1px; margin: 6px 4px; background: var(--hf-border); }

.hf-palette-scrim { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; background: rgba(4, 10, 20, .5); }
.hf-palette-scrim[hidden] { display: none; }
.hf-palette { width: min(560px, 92vw); max-height: 70vh; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--hf-border-strong); border-radius: 14px; background: var(--hf-surface); box-shadow: var(--hf-shadow); }
.hf-palette-in { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--hf-border); }
.hf-palette-in svg { width: 17px; height: 17px; color: var(--hf-accent); flex: 0 0 auto; }
.hf-palette-in input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--hf-text); font: inherit; font-size: 1rem; }
.hf-palette-results { overflow-y: auto; padding: 7px; }
.hf-palette-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border: 0; border-radius: 9px; background: none; text-align: left; color: var(--hf-text); font: inherit; cursor: pointer; }
.hf-palette-item.hf-cur, .hf-palette-item:hover { background: var(--hf-accent-soft); }
.hf-palette-item .hf-pname { font-size: .9rem; font-weight: 650; }
.hf-palette-item .hf-pdesc { font-size: .76rem; color: var(--hf-text-3); }
.hf-palette-empty { padding: 18px; text-align: center; color: var(--hf-text-3); }

.hf-toast { position: fixed; left: 50%; bottom: 24px; z-index: 2100; transform: translateX(-50%) translateY(16px); padding: 10px 16px; border-radius: 10px; background: var(--hf-text); color: var(--hf-surface); font-size: .86rem; font-weight: 650; box-shadow: var(--hf-shadow); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.hf-toast.hf-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hf-toast { display: flex; align-items: center; gap: 14px; }
.hf-toast.hf-toast-show.hf-toast-actionable { pointer-events: auto; }
.hf-toast-action { padding: 3px 8px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; font-weight: 850; text-decoration: underline; cursor: pointer; }
.hf-toast-action:hover { background: color-mix(in srgb, var(--hf-surface) 18%, transparent); }

@media (prefers-reduced-motion: reduce) { .hf-toast { transition: none; } }

@media (max-width: 960px) {
  .hf-mail-shell, .hf-mail-shell[data-pane] { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "rail" "list" "read"; height: auto; }
  .hf-mail-rail { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--hf-border); }
  .hf-mail-mailbox { flex: 1 1 100%; }
  .hf-mail-compose-btn { flex: 1 1 100%; }
  .hf-rail-group { flex: 1 1 100%; }
  .hf-mail-folders { flex-direction: row; flex-wrap: wrap; }
  .hf-folder-btn { width: auto; }
  .hf-folder-btn[aria-pressed="true"] { border-left-color: transparent; box-shadow: inset 0 -3px 0 var(--hf-accent); }
  .hf-mail-refresh { margin-top: 0; width: auto; }
  .hf-mail-list-pane { border-right: 0; border-bottom: 1px solid var(--hf-border); }
  .hf-mail-list { max-height: 50vh; }
  .hf-mail-read, .hf-mail-shell[data-pane] .hf-mail-read { grid-template-columns: 1fr; }
  .hf-mail-assist { border-left: 0; border-top: 1px solid var(--hf-border); }
}
